aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/filters/biquad.h14
-rw-r--r--Alc/mixvoice.cpp23
2 files changed, 8 insertions, 29 deletions
diff --git a/Alc/filters/biquad.h b/Alc/filters/biquad.h
index 96bf3407..eb4cf82a 100644
--- a/Alc/filters/biquad.h
+++ b/Alc/filters/biquad.h
@@ -74,20 +74,6 @@ public:
void process(Real *dst, const Real *src, int numsamples);
- void passthru(int numsamples) noexcept
- {
- if(LIKELY(numsamples >= 2))
- {
- z1 = 0.0f;
- z2 = 0.0f;
- }
- else if(numsamples == 1)
- {
- z1 = z2;
- z2 = 0.0f;
- }
- }
-
/* Rather hacky. It's just here to support "manual" processing. */
std::pair<Real,Real> getComponents() const noexcept
{ return {z1, z2}; }
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index 17da538d..d3521f5b 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -292,35 +292,28 @@ void SendSourceStoppedEvent(ALCcontext *context, ALuint id)
}
-const ALfloat *DoFilters(BiquadFilter *lpfilter, BiquadFilter *hpfilter,
- ALfloat *RESTRICT dst, const ALfloat *RESTRICT src, ALsizei numsamples, int type)
+const ALfloat *DoFilters(BiquadFilter *lpfilter, BiquadFilter *hpfilter, ALfloat *dst,
+ const ALfloat *src, ALsizei numsamples, int type)
{
switch(type)
{
case AF_None:
- lpfilter->passthru(numsamples);
- hpfilter->passthru(numsamples);
+ lpfilter->clear();
+ hpfilter->clear();
break;
case AF_LowPass:
lpfilter->process(dst, src, numsamples);
- hpfilter->passthru(numsamples);
+ hpfilter->clear();
return dst;
case AF_HighPass:
- lpfilter->passthru(numsamples);
+ lpfilter->clear();
hpfilter->process(dst, src, numsamples);
return dst;
case AF_BandPass:
- for(ALsizei i{0};i < numsamples;)
- {
- ALfloat temp[256];
- ALsizei todo = mini(256, numsamples-i);
-
- lpfilter->process(temp, src+i, todo);
- hpfilter->process(dst+i, temp, todo);
- i += todo;
- }
+ lpfilter->process(dst, src, numsamples);
+ hpfilter->process(dst, dst, numsamples);
return dst;
}
return src;