diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-08-10 14:24:26 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-08-10 14:24:26 +0300 |
commit | b9898ebde44d6584ea37a05aaeca8760d31ccc7b (patch) | |
tree | e6dfc796cc82b4b8b8c248c4ff29d2e2047ff84c /source/blender/blenkernel/intern/tracking_stabilize.c | |
parent | b17380971a144896b34b7863a82bbda3ff68a39f (diff) | |
parent | 553b581f25c1782c4231816965cd3f6ce58a449a (diff) |
Merge branch 'master' into filebrowser_redesign
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_stabilize.c')
-rw-r--r-- | source/blender/blenkernel/intern/tracking_stabilize.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c index b852e8a12cd..03229c654fb 100644 --- a/source/blender/blenkernel/intern/tracking_stabilize.c +++ b/source/blender/blenkernel/intern/tracking_stabilize.c @@ -611,16 +611,19 @@ static bool average_track_contributions(StabContext *ctx, float rotation, scale, quality; quality = rotation_contribution( stabilization_base, marker, aspect, r_pivot, &rotation, &scale); - weight *= quality; - weight_sum += weight; - *r_angle += rotation * weight; + const float quality_weight = weight * quality; + weight_sum += quality_weight; + *r_angle += rotation * quality_weight; if (stab->flag & TRACKING_STABILIZE_SCALE) { - *r_scale_step += logf(scale) * weight; + *r_scale_step += logf(scale) * quality_weight; } else { *r_scale_step = 0; } - ok |= (weight_sum > EPSILON_WEIGHT); + /* NOTE: Use original marker weight and not the scaled one with the proximity here to allow + * simple stabilization setups when there is a single track in a close proximity of the + * center. */ + ok |= (weight > EPSILON_WEIGHT); } } } @@ -1338,7 +1341,7 @@ typedef struct TrackingStabilizeFrameInterpolationData { } TrackingStabilizeFrameInterpolationData; static void tracking_stabilize_frame_interpolation_cb( - void *__restrict userdata, const int j, const ParallelRangeTLS *__restrict UNUSED(tls)) + void *__restrict userdata, const int j, const TaskParallelTLS *__restrict UNUSED(tls)) { TrackingStabilizeFrameInterpolationData *data = userdata; ImBuf *ibuf = data->ibuf; @@ -1443,7 +1446,7 @@ ImBuf *BKE_tracking_stabilize_frame( .interpolation = interpolation, }; - ParallelRangeSettings settings; + TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); settings.use_threading = (tmpibuf->y > 128); BLI_task_parallel_range( |