diff options
author | Chris Robinson <[email protected]> | 2019-06-24 21:18:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-24 21:18:25 -0700 |
commit | ab3c2ea777dd6a31163f0d31922004185ff8a180 (patch) | |
tree | 9b510a6e8f6bf6659cc03de4786febaaf0a8a442 /Alc/mixvoice.cpp | |
parent | f5cb6ac20ec36a48002c4056d0eb342d7dcd7b26 (diff) |
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.
Diffstat (limited to 'Alc/mixvoice.cpp')
-rw-r--r-- | Alc/mixvoice.cpp | 23 |
1 files changed, 8 insertions, 15 deletions
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; |