[Bf-blender-cvs] [ccaf6c74044] master: Tracking: Fix slow undistored display

Sergey Sharybin noreply at git.blender.org
Mon Apr 6 12:16:37 CEST 2020


Commit: ccaf6c74044d30bc2de9db033a703319d79127a7
Author: Sergey Sharybin
Date:   Mon Apr 6 12:15:14 2020 +0200
Branches: master
https://developer.blender.org/rBccaf6c74044d30bc2de9db033a703319d79127a7

Tracking: Fix slow undistored display

TH distortion model was not cached properly, making it so frame is
undistorted on every redraw.

===================================================================

M	source/blender/blenkernel/intern/movieclip.c

===================================================================

diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 1964dba7593..ad9314d7ee3 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -457,8 +457,8 @@ typedef struct MovieClipCache {
 
     /* cache for undistorted shot */
     float principal[2];
-    float polynomial_k1;
-    float division_k1;
+    float polynomial_k[3];
+    float division_k[2];
     short distortion_model;
     bool undistortion_used;
 
@@ -896,11 +896,11 @@ static bool check_undistortion_cache_flags(const MovieClip *clip)
     return false;
   }
 
-  if (!equals_v3v3(&camera->k1, &cache->postprocessed.polynomial_k1)) {
+  if (!equals_v3v3(&camera->k1, cache->postprocessed.polynomial_k)) {
     return false;
   }
 
-  if (!equals_v2v2(&camera->division_k1, &cache->postprocessed.division_k1)) {
+  if (!equals_v2v2(&camera->division_k1, cache->postprocessed.division_k)) {
     return false;
   }
 
@@ -1002,8 +1002,8 @@ static void put_postprocessed_frame_to_cache(
   if (need_undistortion_postprocess(user, flag)) {
     cache->postprocessed.distortion_model = camera->distortion_model;
     copy_v2_v2(cache->postprocessed.principal, camera->principal);
-    copy_v3_v3(&cache->postprocessed.polynomial_k1, &camera->k1);
-    copy_v2_v2(&cache->postprocessed.division_k1, &camera->division_k1);
+    copy_v3_v3(cache->postprocessed.polynomial_k, &camera->k1);
+    copy_v2_v2(cache->postprocessed.division_k, &camera->division_k1);
     cache->postprocessed.undistortion_used = true;
   }
   else {



More information about the Bf-blender-cvs mailing list