diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-04-06 13:15:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-04-06 13:16:28 +0300 |
commit | ccaf6c74044d30bc2de9db033a703319d79127a7 (patch) | |
tree | 9a2b2f74e0e6da93025b30906c5587c208c7c2b1 | |
parent | 5d3c7d121879bd107687a12424e3b901e12dc82b (diff) |
Tracking: Fix slow undistored display
TH distortion model was not cached properly, making it so frame is
undistorted on every redraw.
-rw-r--r-- | source/blender/blenkernel/intern/movieclip.c | 12 |
1 files changed, 6 insertions, 6 deletions
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 { |