aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-01-14 12:13:00 -0800
committerChris Robinson <[email protected]>2020-01-14 12:13:00 -0800
commit75a58ae333d3b606ec24f9d09b47430a880bae07 (patch)
tree3f902639abbe805390757fd57311d65f71788a75 /alc
parent5324bdb9080db1acdd45e84d191542501675a302 (diff)
Simplify appending delayed samples
Diffstat (limited to 'alc')
-rw-r--r--alc/alu.cpp12
1 files changed, 6 insertions, 6 deletions
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<FloatBufferLine> B
const al::span<float,FrontStablizer::DelayLength> 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