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 | |
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')
-rw-r--r-- | Alc/filters/biquad.h | 14 | ||||
-rw-r--r-- | Alc/mixvoice.cpp | 23 |
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; |