diff options
author | Chris Robinson <[email protected]> | 2011-05-18 18:49:41 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-18 18:49:41 -0700 |
commit | 1d3926e1872657da9b0490cff233454b583ff964 (patch) | |
tree | 7ff839b35a51d5e66a0c78f49de89f2c9dd41d31 /Alc/alcEcho.c | |
parent | 194f8fc791e6675d1913e8a66ebe25e05bde7c0e (diff) |
Remove some more duplication
Diffstat (limited to 'Alc/alcEcho.c')
-rw-r--r-- | Alc/alcEcho.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 68549fde..35b94a90 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -105,7 +105,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff { ALechoState *state = (ALechoState*)effect; ALuint frequency = Context->Device->Frequency; - ALfloat lrpan, cw, a, g; + ALfloat lrpan, cw, g; state->Tap[0].delay = (ALuint)(Effect->Echo.Delay * frequency) + 1; state->Tap[1].delay = (ALuint)(Effect->Echo.LRDelay * frequency); @@ -119,10 +119,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff cw = cos(2.0*M_PI * LOWPASSFREQCUTOFF / frequency); g = 1.0f - Effect->Echo.Damping; - a = 0.0f; - if(g < 0.9999f) // 1-epsilon - a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / (1 - g); - state->iirFilter.coeff = a; + state->iirFilter.coeff = lpCoeffCalc(g, cw); } static ALvoid EchoProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) |