aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcEcho.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-05-16 23:34:26 -0700
committerChris Robinson <[email protected]>2009-05-16 23:34:26 -0700
commit1bfa7609d2b27e6ec5928268856a3496723bdeef (patch)
tree1a99d403e7096c2ea4890648d2f03f2ba56a6c7a /Alc/alcEcho.c
parent7e8501123a092a19b8153f7fdeecef2e0c5f0aa2 (diff)
Make the filter functions global inline, and use it for echo
Diffstat (limited to 'Alc/alcEcho.c')
-rw-r--r--Alc/alcEcho.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c
index e518fb21..feede2ba 100644
--- a/Alc/alcEcho.c
+++ b/Alc/alcEcho.c
@@ -144,8 +144,6 @@ ALvoid EchoUpdate(ALCcontext *Context, struct ALeffectslot *Slot, ALeffect *Effe
ALvoid EchoProcess(ALechoState *state, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
- ALfloat *history = state->iirFilter.history;
- const ALfloat a = state->iirFilter.coeff;
const ALuint delay = state->BufferLength-1;
ALuint tap1off = state->Tap[0].offset;
ALuint tap2off = state->Tap[1].offset;
@@ -156,12 +154,7 @@ ALvoid EchoProcess(ALechoState *state, ALuint SamplesToDo, const ALfloat *Sample
for(i = 0;i < SamplesToDo;i++)
{
// Apply damping
- samp[0] = state->SampleBuffer[tap2off] + SamplesIn[i];
-
- samp[0] += (history[0]-samp[0]) * a;
- history[0] = samp[0];
- samp[0] += (history[1]-samp[0]) * a;
- history[1] = samp[0];
+ samp[0] = lpFilter2P(&state->iirFilter, 0, state->SampleBuffer[tap2off]+SamplesIn[i]);
// Apply feedback gain and mix in the new sample
state->SampleBuffer[fboff] = samp[0] * state->FeedGain;