aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2008-01-15 18:29:21 -0800
committerChris Robinson <chris.kcat@gmail.com>2008-01-15 18:29:21 -0800
commit03ca50fa70268644b0c57ec7c36638f5edbb7909 (patch)
treebd4994b492cbd66f0c8533f039aa962416b86073 /Alc
parent7b1b8bd7417b694de7ab3648701e650570354ce6 (diff)
Use the previous low-pass filter again, as it seems to match the intended output better
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 3b9e0611..3e9387bb 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -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;