aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-11-27 21:15:28 -0800
committerChris Robinson <[email protected]>2023-12-01 19:28:18 -0800
commit8d40ecca4d4c1dbd8d71c921d38f8e5bc66968d7 (patch)
tree2f60e5a45da51599ced8569a78379599e399b992 /alc/effects
parent30727ab310d4b76c9b6299bd98d18dbead991105 (diff)
Avoid extra multiplies
Diffstat (limited to 'alc/effects')
-rw-r--r--alc/effects/reverb.cpp6
1 files changed, 3 insertions, 3 deletions
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);
}