diff options
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 5 | ||||
-rw-r--r-- | OpenAL32/alFilter.c | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 855bb534..8012e398 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -43,8 +43,7 @@ typedef struct ALfilterState { ALfloat x[2]; /* History of two last input samples */ ALfloat y[2]; /* History of two last output samples */ ALfloat a1, a2; /* Transfer function coefficients "a" (a0 is pre-applied) */ - ALfloat b1, b2; /* Transfer function coefficients "b" (b0 is input_gain) */ - ALfloat input_gain; + ALfloat b0, b1, b2; /* Transfer function coefficients "b" */ void (*process)(struct ALfilterState *self, ALfloat *restrict dst, const ALfloat *src, ALuint numsamples); } ALfilterState; @@ -83,7 +82,7 @@ inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample { ALfloat outsmp; - outsmp = filter->input_gain * sample + + outsmp = filter->b0 * sample + filter->b1 * filter->x[0] + filter->b2 * filter->x[1] - filter->a1 * filter->y[0] - diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index 7b96263a..da447c27 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -429,9 +429,9 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g filter->a1 = a[1] / a[0]; filter->a2 = a[2] / a[0]; + filter->b0 = b[0] / a[0]; filter->b1 = b[1] / a[0]; filter->b2 = b[2] / a[0]; - filter->input_gain = b[0] / a[0]; filter->process = ALfilterState_processC; } |