Remove unused variable
This commit is contained in:
parent
75ca9b7d82
commit
6c84d58ad8
2 changed files with 11 additions and 11 deletions
|
|
@ -70,7 +70,7 @@ void LinearSmoother::reset(float value)
|
||||||
current_ = value;
|
current_ = value;
|
||||||
target_ = value;
|
target_ = value;
|
||||||
step_ = 0.0;
|
step_ = 0.0;
|
||||||
framesToTarget_ = 0;
|
//framesToTarget_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> output, bool canShortcut)
|
void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> output, bool canShortcut)
|
||||||
|
|
@ -93,7 +93,7 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
|
||||||
}
|
}
|
||||||
|
|
||||||
float step = step_;
|
float step = step_;
|
||||||
int32_t framesToTarget = framesToTarget_;
|
// int32_t framesToTarget = framesToTarget_;
|
||||||
const int32_t smoothFrames = smoothFrames_;
|
const int32_t smoothFrames = smoothFrames_;
|
||||||
|
|
||||||
for (; i + 15 < count; i += 16) {
|
for (; i + 15 < count; i += 16) {
|
||||||
|
|
@ -101,8 +101,8 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
|
||||||
if (target != nextTarget) {
|
if (target != nextTarget) {
|
||||||
target = nextTarget;
|
target = nextTarget;
|
||||||
//framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames;
|
//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);
|
const simde__m128 targetX4 = simde_mm_set1_ps(target);
|
||||||
if (target > current) {
|
if (target > current) {
|
||||||
|
|
@ -141,16 +141,16 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
|
||||||
simde_mm_storeu_ps(&output[i + 8], targetX4);
|
simde_mm_storeu_ps(&output[i + 8], targetX4);
|
||||||
simde_mm_storeu_ps(&output[i + 12], targetX4);
|
simde_mm_storeu_ps(&output[i + 12], targetX4);
|
||||||
}
|
}
|
||||||
framesToTarget -= 16;
|
//framesToTarget -= 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < count) {
|
if (i < count) {
|
||||||
const float nextTarget = input[count - 1];
|
const float nextTarget = input[count - 1];
|
||||||
if (target != nextTarget) {
|
if (target != nextTarget) {
|
||||||
target = nextTarget;
|
target = nextTarget;
|
||||||
//framesToTarget = (framesToTarget > 0) ? framesToTarget : smoothFrames;
|
// 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);
|
||||||
}
|
}
|
||||||
if (target > current) {
|
if (target > current) {
|
||||||
for (; i < count; ++i)
|
for (; i < count; ++i)
|
||||||
|
|
@ -164,13 +164,13 @@ void LinearSmoother::process(absl::Span<const float> input, absl::Span<float> ou
|
||||||
for (; i < count; ++i)
|
for (; i < count; ++i)
|
||||||
output[i] = target;
|
output[i] = target;
|
||||||
}
|
}
|
||||||
framesToTarget -= count;
|
//framesToTarget -= count;
|
||||||
}
|
}
|
||||||
|
|
||||||
current_ = current;
|
current_ = current;
|
||||||
target_ = target;
|
target_ = target;
|
||||||
step_ = step;
|
step_ = step;
|
||||||
framesToTarget_ = max(0, framesToTarget);
|
//framesToTarget_ = max(0, framesToTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ private:
|
||||||
float current_ = 0.0;
|
float current_ = 0.0;
|
||||||
float target_ = 0.0;
|
float target_ = 0.0;
|
||||||
float step_ = 0.0;
|
float step_ = 0.0;
|
||||||
int32_t framesToTarget_ = 0;
|
//int32_t framesToTarget_ = 0;
|
||||||
int32_t smoothFrames_ = 0;
|
int32_t smoothFrames_ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue