diff options
author | Chris Robinson <[email protected]> | 2008-01-15 18:29:21 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-01-15 18:29:21 -0800 |
commit | 03ca50fa70268644b0c57ec7c36638f5edbb7909 (patch) | |
tree | bd4994b492cbd66f0c8533f039aa962416b86073 | |
parent | 7b1b8bd7417b694de7ab3648701e650570354ce6 (diff) |
Use the previous low-pass filter again, as it seems to match the intended output better
-rw-r--r-- | Alc/ALu.c | 20 |
1 files changed, 14 insertions, 6 deletions
@@ -217,9 +217,13 @@ static __inline ALfloat aluComputeDrySample(ALsource *source, ALfloat DryGainHF, { if(DryGainHF < 1.0f) { - ALfloat u = sample + source->LastDrySample; - ALfloat v = sample - source->LastDrySample; - sample = (u + (v*DryGainHF)) * 0.5; + if(DryGainHF > 0.0f) + { + sample *= DryGainHF; + sample += source->LastDrySample * (1.0f-DryGainHF); + } + else + sample = 0.0f; } source->LastDrySample = sample; @@ -230,9 +234,13 @@ static __inline ALfloat aluComputeWetSample(ALsource *source, ALfloat WetGainHF, { if(WetGainHF < 1.0f) { - ALfloat u = sample + source->LastWetSample; - ALfloat v = sample - source->LastWetSample; - sample = (u + (v*WetGainHF)) * 0.5; + if(WetGainHF > 0.0f) + { + sample *= WetGainHF; + sample += source->LastWetSample * (1.0f-WetGainHF); + } + else + sample = 0.0f; } source->LastWetSample = sample; |