Fix: Stepping issue with Butterworth filter #110060

Merged
Christoph Lendenfeld merged 3 commits from ChrisLend/blender:fix_butter_smooth_stepping into main 2023-07-13 15:47:37 +02:00
1 changed files with 3 additions and 1 deletions

View File

@ -557,7 +557,9 @@ void butterworth_smooth_fcurve_segment(FCurve *fcu,
}
const float x_delta = fcu->bezt[i].vec[1][0] - left_bezt.vec[1][0] + filter_order;
const int filter_index = (int)(x_delta * sample_rate);
/* Using round() instead of casting to int. Casting would introduce a stepping issue when the
* x-value is just below a full frame. */
const int filter_index = round(x_delta * sample_rate);
const float blend_value = butterworth_calculate_blend_value(samples,
filtered_values,
samples_start_index,