From 75a58ae333d3b606ec24f9d09b47430a880bae07 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 14 Jan 2020 12:13:00 -0800 Subject: Simplify appending delayed samples --- alc/alu.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'alc/alu.cpp') diff --git a/alc/alu.cpp b/alc/alu.cpp index e5899794..02d5e66f 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -1730,13 +1730,13 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span B const al::span DelayBuf, BandSplitter &Filter, ALfloat (&splitbuf)[2][BUFFERSIZE]) -> void { - /* Combine the delayed samples and the input samples into the temp - * buffer, in reverse. Then copy the final samples back into the delay - * buffer for next time. Note that the delay buffer's samples are - * stored backwards here. + /* Combine the input and delayed samples into a temp buffer in reverse, + * then copy the final samples into the delay buffer for next time. + * Note that the delay buffer's samples are stored backwards here. */ - std::copy_backward(DelayBuf.cbegin(), DelayBuf.cend(), tmpbuf.end()); - std::reverse_copy(InBuf.begin(), InBuf.begin()+SamplesToDo, tmpbuf.begin()); + auto tmp_iter = std::reverse_copy(InBuf.cbegin(), InBuf.cbegin()+SamplesToDo, + tmpbuf.begin()); + std::copy(DelayBuf.cbegin(), DelayBuf.cend(), tmp_iter); std::copy_n(tmpbuf.cbegin(), DelayBuf.size(), DelayBuf.begin()); /* Apply an all-pass on the reversed signal, then reverse the samples -- cgit v1.2.3