From e08180fdab8925328ed505333f6e5a721b18e0b4 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 15 Mar 2022 15:45:09 +0100 Subject: Fix slow tracking of long sequences The performance issue was noticeable when tracking a lot of tracks which are using keyframe pattern matching. What was happening is that at some cache gets filled in and the furthest away frame gets removed from the cache: the frame at marker's keyframe gets removed and needs to be re-read from disk on the next tracking step. This change makes it so frames at markers' keyframes are not removed from cache during tracking. Steps to easily reproduce: - Set cache size to 512 Mb. - Open image sequence in clip editor - Detect features - Track all markers Originally was reported by Rik, thanks! --- source/blender/editors/space_clip/tracking_ops_track.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/space_clip') diff --git a/source/blender/editors/space_clip/tracking_ops_track.c b/source/blender/editors/space_clip/tracking_ops_track.c index f9cbce40deb..d5223d57490 100644 --- a/source/blender/editors/space_clip/tracking_ops_track.c +++ b/source/blender/editors/space_clip/tracking_ops_track.c @@ -211,6 +211,8 @@ static void track_markers_startjob( TrackMarkersJob *tmj = (TrackMarkersJob *)tmv; int framenr = tmj->sfra; + BKE_autotrack_context_start(tmj->context); + while (framenr != tmj->efra) { if (tmj->delay > 0) { /* Tracking should happen with fixed fps. Calculate time -- cgit v1.2.3