diff options
author | Chris Robinson <[email protected]> | 2019-04-04 22:50:41 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-04-04 22:57:29 -0700 |
commit | e6daab51e8cd06c66680eb88e4b83ca3fb5918b0 (patch) | |
tree | 05918f8858e6f20cf9ed09a953e3148fe34bdb5f | |
parent | dc5759f80cfc2ba55727905eb8b58dfbea3dd2ca (diff) |
Make sure the all-pass filter is cleared before use
-rw-r--r-- | Alc/alu.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp index 0021faae..dd99a9f5 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -1506,7 +1506,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, ALfloat (*RESTRICT Buffer)[BUFFER } } - SplitterAllpass APFilter = Stablizer->APFilter; + SplitterAllpass &APFilter = Stablizer->APFilter; ALfloat (&lsplit)[2][BUFFERSIZE] = Stablizer->LSplit; ALfloat (&rsplit)[2][BUFFERSIZE] = Stablizer->RSplit; auto &tmpbuf = Stablizer->TempBuf; @@ -1529,9 +1529,13 @@ void ApplyStablizer(FrontStablizer *Stablizer, ALfloat (*RESTRICT Buffer)[BUFFER std::copy_n(std::begin(tmpbuf), FrontStablizer::DelayLength, std::begin(DelayBuf)); /* Apply an all-pass on the reversed signal, then reverse the samples - * to get the forward signal with a reversed phase shift. + * to get the forward signal with a reversed phase shift. Note that the + * all-pass filter is copied to a local for use, since each pass is + * indepedent because the signal's processed backwards (with a delay + * being used to hide discontinuities). */ - APFilter.process(tmpbuf, SamplesToDo+FrontStablizer::DelayLength); + SplitterAllpass allpass{APFilter}; + allpass.process(tmpbuf, SamplesToDo+FrontStablizer::DelayLength); std::reverse(std::begin(tmpbuf), tmpbuf_end+FrontStablizer::DelayLength); /* Now apply the band-splitter, combining its phase shift with the |