From 8d40ecca4d4c1dbd8d71c921d38f8e5bc66968d7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 27 Nov 2023 21:15:28 -0800 Subject: Avoid extra multiplies --- alc/effects/reverb.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'alc/effects') diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 0f1fcca1..603d20c3 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -1604,7 +1604,7 @@ void ReverbPipeline::processLate(size_t offset, const size_t samplesToDo, size_t late_delay_tap1{offset - mLateDelayTap[j][1]}; size_t late_feedb_tap{offset - mLate.Offset[j]}; const float midGain{mLate.T60[j].MidGain}; - const float densityGain{mLate.DensityGain * midGain}; + const float densityGain{mLate.DensityGain}; const float densityStep{late_delay_tap0 != late_delay_tap1 ? densityGain*fadeStep : 0.0f}; float fadeCount{0.0f}; @@ -1641,9 +1641,9 @@ void ReverbPipeline::processLate(size_t offset, const size_t samplesToDo, const float fade0{densityGain - densityStep*fadeCount}; const float fade1{densityStep*fadeCount}; fadeCount += 1.0f; - tempSamples[j][i] = out*midGain + + tempSamples[j][i] = (out + in_delay.Line[late_delay_tap0++][j]*fade0 + - in_delay.Line[late_delay_tap1++][j]*fade1; + in_delay.Line[late_delay_tap1++][j]*fade1) * midGain; ++i; } while(--td); } -- cgit v1.2.3