From 6c84d58ad842fdb30bbcbe424a27fcdf04e5b3ba Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sat, 13 Mar 2021 14:19:19 +0100 Subject: [PATCH] Remove unused variable --- src/sfizz/Smoothers.cpp | 20 ++++++++++---------- src/sfizz/Smoothers.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sfizz/Smoothers.cpp b/src/sfizz/Smoothers.cpp index 189249c2..9dcd8023 100644 --- a/src/sfizz/Smoothers.cpp +++ b/src/sfizz/Smoothers.cpp @@ -70,7 +70,7 @@ void LinearSmoother::reset(float value) current_ = value; target_ = value; step_ = 0.0; - framesToTarget_ = 0; + //framesToTarget_ = 0; } void LinearSmoother::process(absl::Span input, absl::Span output, bool canShortcut) @@ -93,7 +93,7 @@ void LinearSmoother::process(absl::Span input, absl::Span ou } float step = step_; - int32_t framesToTarget = framesToTarget_; + // int32_t framesToTarget = framesToTarget_; const int32_t smoothFrames = smoothFrames_; for (; i + 15 < count; i += 16) { @@ -101,8 +101,8 @@ void LinearSmoother::process(absl::Span input, absl::Span ou if (target != nextTarget) { target = nextTarget; //framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames; - framesToTarget = smoothFrames; - step = (target - current) / max(1, framesToTarget); + //step = (target - current) / max(1, framesToTarget); + step = (target - current) / max(1, smoothFrames); } const simde__m128 targetX4 = simde_mm_set1_ps(target); if (target > current) { @@ -141,16 +141,16 @@ void LinearSmoother::process(absl::Span input, absl::Span ou simde_mm_storeu_ps(&output[i + 8], targetX4); simde_mm_storeu_ps(&output[i + 12], targetX4); } - framesToTarget -= 16; + //framesToTarget -= 16; } if (i < count) { const float nextTarget = input[count - 1]; if (target != nextTarget) { target = nextTarget; - //framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames; - framesToTarget = smoothFrames; - step = (target - current) / max(1, framesToTarget); + // framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames; + // step = (target - current) / max(1, framesToTarget); + step = (target - current) / max(1, smoothFrames); } if (target > current) { for (; i < count; ++i) @@ -164,13 +164,13 @@ void LinearSmoother::process(absl::Span input, absl::Span ou for (; i < count; ++i) output[i] = target; } - framesToTarget -= count; + //framesToTarget -= count; } current_ = current; target_ = target; step_ = step; - framesToTarget_ = max(0, framesToTarget); + //framesToTarget_ = max(0, framesToTarget); } } diff --git a/src/sfizz/Smoothers.h b/src/sfizz/Smoothers.h index 1d64c9d4..e62190eb 100644 --- a/src/sfizz/Smoothers.h +++ b/src/sfizz/Smoothers.h @@ -87,7 +87,7 @@ private: float current_ = 0.0; float target_ = 0.0; float step_ = 0.0; - int32_t framesToTarget_ = 0; + //int32_t framesToTarget_ = 0; int32_t smoothFrames_ = 0; };