From 7a7a4844f441a2d269cffdadfd553655a8d3484e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 16 Apr 2009 05:43:09 -0700 Subject: Make the filter history buffer size flexible This lets the filter history buffer be as big as needed for a given use, so that it can have a size large enough for the more demanding cases, but not be wasteful for lesser-demanding cases, while not incuring the overhead of an added pointer indirection --- Alc/alcEcho.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Alc/alcEcho.c') diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index cbc57a03..f6606bfa 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -48,7 +48,9 @@ struct ALechoState { ALfloat GainR; ALfloat FeedGain; + FILTER iirFilter; + ALfloat history[2]; }; // Find the next power of 2. Actually, this will return the input value if @@ -100,8 +102,8 @@ ALechoState *EchoCreate(ALCcontext *Context) state->GainL = 0.0f; state->GainR = 0.0f; - for(i = 0;i < sizeof(state->iirFilter.history)/sizeof(state->iirFilter.history[0]);i++) - state->iirFilter.history[i] = 0.0f; + for(i = 0;i < sizeof(state->history)/sizeof(state->history[0]);i++) + state->history[i] = 0.0f; state->iirFilter.coeff = 0.0f; return state; -- cgit v1.2.3