diff options
author | Sergey Sharybin <sergey@blender.org> | 2020-11-25 12:40:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2021-01-18 18:38:40 +0300 |
commit | 0ca0d3366d4c79949914e229858f0a5477b9e6ec (patch) | |
tree | b89cd6245af0ac3d379cbb4bd85ff0ece27b967d /source/blender/blenkernel/intern/tracking_stabilize.c | |
parent | f508292277d7a12c04b2cb2655622683ee4fef54 (diff) |
Tracking: Re-write marker request function
There are two main things.
First, remove the marker index caching. Thins makes it possible to
safely use function from a threaded environment.
Second, replace linear search with binary search, which speeds up
random lookup.
There is no measurable difference in the stabilization which had a
comment about caching nature of track lookup. The random lookup
complexity changed from O(N) to O(log N). In practice this also
unlikely to be measurable, but thread-safety worth it.
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_stabilize.c')
-rw-r--r-- | source/blender/blenkernel/intern/tracking_stabilize.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c index 6f58416924f..46589a578a8 100644 --- a/source/blender/blenkernel/intern/tracking_stabilize.c +++ b/source/blender/blenkernel/intern/tracking_stabilize.c @@ -311,11 +311,7 @@ static void retrieve_next_lower_usable_frame( * translation stabilization, which has an enabled tracking marker at this very * frame. We search both for the next lower and next higher position, to allow * the caller to interpolate gaps and to extrapolate at the ends of the - * definition range. - * - * NOTE: Regarding performance note that the individual tracks will cache the - * last search position. - */ + * definition range. */ static void find_next_working_frames(StabContext *ctx, int framenr, int *next_lower, |