From ab3c2ea777dd6a31163f0d31922004185ff8a180 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 24 Jun 2019 21:18:25 -0700 Subject: Don't bother with a passthru filter method There's not really a case where it'll process less than 2 samples, and it was wrong anyway. --- Alc/mixvoice.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'Alc/mixvoice.cpp') 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; -- cgit v1.2.3