From 0ca0d3366d4c79949914e229858f0a5477b9e6ec Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 25 Nov 2020 10:40:17 +0100 Subject: 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. --- source/blender/blenkernel/intern/tracking_stabilize.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/tracking_stabilize.c') 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, -- cgit v1.2.3