Jonathan Thomas
3daa5bdb7b
Large refactor of OpenMP integration (or rather the removal of OpenMP on the Timeline and FFmpeg-related classes). The logic behind this decision, was based on profiling libopenshot and the amount of wasted CPU idle time on all the various threads. The slow code is still synchronous, and all the threads must wait on each other, adding additional overhead. So, removing lots of unneeded threads, and simplifying the underlying Timeline->Clip->FFmpegReader flow. Also, removed 2 calls to QPainter::drawImage, by improving the flexibility of Clip->GetFrame.
2021-02-17 19:44:44 -06:00
FeRD (Frank Dana)
0fe84d36f6
Keyframe: Get rid of vector aliases, Coord ctor
2021-01-29 03:42:56 -05:00
FeRD (Frank Dana)
00d458210e
KeyFrame.h: Avoid shadowing SWIG templates
2021-01-29 01:08:50 -05:00
FeRD (Frank Dana)
deae5b2de2
Keyframe: Replace pair vector w/ CoordinateVector
2020-12-04 12:06:26 -05:00
FeRD (Frank Dana)
c9112bb08f
Keyframe: Add vector ctors
2020-12-04 11:28:37 -05:00
FeRD (Frank Dana)
db7bf5f622
Keyframe: Replace AddPoint overload w/default arg
2020-12-04 11:28:37 -05:00
FeRD (Frank Dana)
aa40ea29e0
Update include paths in all source/header files
2020-10-18 07:43:37 -04:00
Jonathan Thomas
4f591c7b94
Merge pull request #396 from ferdnyc/json-parsing
...
Behind-the-scenes code tidying for Json data handling
2020-02-27 15:32:05 -06:00
Christoph Willing
e39a1fc809
Resolve ambiguous abs() call
...
Signed-off-by: Christoph Willing <chris.willing@linux.com >
2020-02-10 18:28:56 +10:00
Frank Dana
8ea7449363
Merge branch 'develop' into json-parsing
2020-01-20 15:25:40 -05:00
FeRD (Frank Dana)
e49f62247e
Use C++11 range-based for loops where we can
2019-12-28 09:50:09 -05:00
FeRD (Frank Dana)
22bf6edfba
Enhance Json data handling
...
- Parsing from string to Json::Value is now done by utility function
openshot::stringToJson() in Json.cpp, all SetJson() methods call it.
- Expand use of const member functions and args where appropriate.
- Use std::to_string() to format int/float values as strings.
- Correct mentions of nonexistent Json::JsonValue type in docstrings
2019-12-27 08:51:51 -05:00
FeRD (Frank Dana)
e502f97d8a
Don't compare differently-signed types
2019-12-15 14:22:59 -05:00
Daniel Jour
c940c1f42b
Keyframe: Cleanup duplicate binary search code
...
GetRepeatFraction uses two binary searches; reuse that code!
2019-12-06 01:21:25 +01:00
Daniel Jour
1fbdc521ca
Keyframe::GetRepeatFraction(): Binary search, skipping when constant
...
The old implementation did a linear scan over the values. This was
slow with slowly changing keyframes. This new implementation skips
over constant (when rounded) segments and performs binary search
in (possibly long) interpolated segments to find the X coordinates
where a change occurs quickly.
2019-12-06 01:04:47 +01:00
Daniel Jour
f00edbad7e
Keyframe interpolation: In own function; only for Y coordinate
2019-12-06 01:03:56 +01:00
Daniel Jour
ed0b081803
Keyframe::IsIncreasing(): Search over points, not values
...
Searching over the keyframe points is considerably faster than
calculating interpolating values and searching over them.
2019-12-03 17:27:28 +01:00
Daniel Jour
b40fa6922e
Keyframe::GetMaxPoint() simplify loop
2019-12-03 16:58:53 +01:00
Daniel Jour
79cb8483f3
Keyframe: Move Bezier code into extra function, parameterise
...
Bezier interpolation code is now in a dedicated function and can be
used to either find a Y from a known X or a X from a known Y, with a
given allowed error.
2019-12-03 16:56:53 +01:00
Daniel Jour
65cb3dfde9
Keyframe::GetClosestPoint(): Use binary search
2019-11-30 11:58:51 +01:00
Daniel Jour
54e8e37d2d
Keyframe::Contains(): Use binary search instead of linear search
2019-11-30 11:32:52 +01:00
Daniel Jour
a67fb9555c
Keyframe interpolation selection: Use switch instead of if
...
Using switch allows (some) compilers to emit a warning if a possible
enum value for the interpolation type has been forgotten. This is not
the case now, but might guard against future errors (e.g. adding an
interpolation type)
2019-11-25 10:37:51 +01:00
Daniel Jour
b546b6a982
Keyframe: Dedicated Point comparision function instead of lambda's
2019-11-25 10:34:14 +01:00
Daniel Jour
6f71736c6a
Keyframe: mark all non-modifying member functions const
...
Member functions that do not (need to) modify any members or internal
state of the Keyframe class should be declared as const.
2019-11-25 10:29:58 +01:00
Daniel Jour
edf85dda78
Keyframe: use = default to specify default constructor
2019-11-25 10:23:45 +01:00