Fix linear smoother again

This commit is contained in:
Jean Pierre Cimalando 2021-03-18 14:10:02 +01:00
parent 44e48f7003
commit 2b4efe6eb7

View file

@ -105,8 +105,8 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
if (target != nextTarget) {
target = nextTarget;
//framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames;
//step = (target - current) / (16 * max(1, framesToTarget));
step = (target - current) / (16 * max(1, smoothFrames));
//step = (target - current) / max(16, framesToTarget);
step = (target - current) / max(16, smoothFrames);
}
const simde__m128 targetX4 = simde_mm_set1_ps(target);
if (target > current) {
@ -154,8 +154,8 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
if (target != nextTarget) {
target = nextTarget;
//framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames;
//step = (target - current) / (16 * max(1, framesToTarget));
step = (target - current) / (16 * max(1, smoothFrames));
//step = (target - current) / max(16, framesToTarget);
step = (target - current) / max(16, smoothFrames);
}
if (target > current) {
for (size_t j = 0; j < 16; ++j)
@ -179,8 +179,8 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
if (target != nextTarget) {
target = nextTarget;
// framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames;
// step = (target - current) / ((count - i) * max(1, framesToTarget));
step = (target - current) / ((count - i) * max(1, smoothFrames));
// step = (target - current) / max(static_cast<int32_t>(count - i), framesToTarget);
step = (target - current) / max(static_cast<int32_t>(count - i), smoothFrames);
}
if (target > current) {
for (; i < count; ++i)