aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-01-01 00:04:46 -0800
committerChris Robinson <[email protected]>2019-01-01 00:04:46 -0800
commite930c70eaab7946a716d641beb7c4b026fee5d4d (patch)
tree11540f13835b99627bdce14cab0e9f3bffdbd872 /Alc
parenta9e71c2668e7c49d089623633bd92bcfc3fe1465 (diff)
Don't make BiquadFilter's src and dst restrict
There's no technical reason they can't be the same since IIR filters can't be auto-vectorized anyway.
Diffstat (limited to 'Alc')
-rw-r--r--Alc/filters/biquad.cpp19
-rw-r--r--Alc/filters/biquad.h2
2 files changed, 10 insertions, 11 deletions
diff --git a/Alc/filters/biquad.cpp b/Alc/filters/biquad.cpp
index c6266949..16a1b3fb 100644
--- a/Alc/filters/biquad.cpp
+++ b/Alc/filters/biquad.cpp
@@ -12,18 +12,17 @@
void BiquadFilter::setParams(BiquadType type, float gain, float f0norm, float rcpQ)
{
- float alpha, sqrtgain_alpha_2;
- float w0, sin_w0, cos_w0;
- float a[3] = { 1.0f, 0.0f, 0.0f };
- float b[3] = { 1.0f, 0.0f, 0.0f };
-
// Limit gain to -100dB
assert(gain > 0.00001f);
- w0 = F_TAU * f0norm;
- sin_w0 = std::sin(w0);
- cos_w0 = std::cos(w0);
- alpha = sin_w0/2.0f * rcpQ;
+ const float w0{F_TAU * f0norm};
+ const float sin_w0{std::sin(w0)};
+ const float cos_w0{std::cos(w0)};
+ const float alpha{sin_w0/2.0f * rcpQ};
+
+ float sqrtgain_alpha_2;
+ float a[3]{ 1.0f, 0.0f, 0.0f };
+ float b[3]{ 1.0f, 0.0f, 0.0f };
/* Calculate filter coefficients depending on filter type */
switch(type)
@@ -90,7 +89,7 @@ void BiquadFilter::setParams(BiquadType type, float gain, float f0norm, float rc
}
-void BiquadFilter::process(float *RESTRICT dst, const float *RESTRICT src, int numsamples)
+void BiquadFilter::process(float *dst, const float *src, int numsamples)
{
ASSUME(numsamples > 0);
diff --git a/Alc/filters/biquad.h b/Alc/filters/biquad.h
index 98085dbb..eccaed35 100644
--- a/Alc/filters/biquad.h
+++ b/Alc/filters/biquad.h
@@ -71,7 +71,7 @@ public:
}
- void process(float *RESTRICT dst, const float *RESTRICT src, int numsamples);
+ void process(float *dst, const float *src, int numsamples);
void passthru(int numsamples) noexcept
{