aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index ce669791..eefab9ee 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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;