diff options
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -211,8 +211,9 @@ static __inline ALfloat aluComputeDrySample(ALsource *source, ALfloat DryGainHF, { if(DryGainHF < 1.0f) { - sample *= DryGainHF; - sample += source->LastDrySample * (1.0f - DryGainHF); + ALfloat u = sample + source->LastDrySample; + ALfloat v = sample - source->LastDrySample; + sample = (u + (v*DryGainHF)) * 0.5; } source->LastDrySample = sample; @@ -223,8 +224,9 @@ static __inline ALfloat aluComputeWetSample(ALsource *source, ALfloat WetGainHF, { if(WetGainHF < 1.0f) { - sample *= WetGainHF; - sample += source->LastWetSample * (1.0f - WetGainHF); + ALfloat u = sample + source->LastWetSample; + ALfloat v = sample - source->LastWetSample; + sample = (u + (v*WetGainHF)) * 0.5; } source->LastWetSample = sample; |