aboutsummaryrefslogtreecommitdiffstats
path: root/alc/effects/reverb.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-08 12:44:53 -0700
committerChris Robinson <[email protected]>2019-08-08 12:44:53 -0700
commitfb1fde9fb030116cdfc66af3ff7277d89a31953a (patch)
tree078b382af08f38175365147c12e1e4aeeafdb841 /alc/effects/reverb.cpp
parenta4391a213d705810a13f225e6927812ac69c52f8 (diff)
Simplify the weighted decay time calculation
Diffstat (limited to 'alc/effects/reverb.cpp')
-rw-r--r--alc/effects/reverb.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index 77ac0f94..423aedd8 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -767,15 +767,11 @@ void LateReverb::updateLines(const ALfloat density, const ALfloat diffusion,
* approximate bandwidth. This attempts to compensate for losses of energy
* that reduce decay time due to scattering into highly attenuated bands.
*/
- const ALfloat bandWeights[3]{
- lf0norm*norm_weight_factor,
- hf0norm*norm_weight_factor - lf0norm*norm_weight_factor,
- 1.0f - hf0norm*norm_weight_factor};
- DensityGain[1] = CalcDensityGain(
- CalcDecayCoeff(length,
- bandWeights[0]*lfDecayTime + bandWeights[1]*mfDecayTime + bandWeights[2]*hfDecayTime
- )
- );
+ const ALfloat decayTimeWeighted{
+ (lf0norm*norm_weight_factor)*lfDecayTime +
+ (hf0norm*norm_weight_factor - lf0norm*norm_weight_factor)*mfDecayTime +
+ (1.0f - hf0norm*norm_weight_factor)*hfDecayTime};
+ DensityGain[1] = CalcDensityGain(CalcDecayCoeff(length, decayTimeWeighted));
/* Calculate the all-pass feed-back/forward coefficient. */
VecAp.Coeff = std::sqrt(0.5f) * std::pow(diffusion, 2.0f);