diff options
author | Chris Robinson <[email protected]> | 2008-01-05 03:51:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-01-05 03:51:24 -0800 |
commit | 312108a0d32190289a1e59a3797b7075d6d745d3 (patch) | |
tree | 7baac9b59defd45a5af6ddb92952b0a8367eeaec /Alc | |
parent | 5e48be27b840ff0a8b90baaae41e2809f7ca99ab (diff) |
Try a different low-pass filter
Seems to be more correct, although it's not as powerful as the previous (which
may be a good thing)
Diffstat (limited to 'Alc')
-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; |