aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include/alFilter.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-01-23 03:38:15 -0800
committerChris Robinson <[email protected]>2016-01-23 03:38:15 -0800
commit94816d007375295a8d767b06a483a060be292692 (patch)
treef66f29a492d2b4d93dc3b857f6003faa0f2cb44b /OpenAL32/Include/alFilter.h
parent352d9afd642e94651e69dbb28ade50eea88eae0d (diff)
Reorder filterstate properties
Diffstat (limited to 'OpenAL32/Include/alFilter.h')
-rw-r--r--OpenAL32/Include/alFilter.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h
index fa86af27..6f44e3b7 100644
--- a/OpenAL32/Include/alFilter.h
+++ b/OpenAL32/Include/alFilter.h
@@ -42,8 +42,9 @@ typedef enum ALfilterType {
typedef struct ALfilterState {
ALfloat x[2]; /* History of two last input samples */
ALfloat y[2]; /* History of two last output samples */
- ALfloat a[3]; /* Transfer function coefficients "a" */
- ALfloat b[3]; /* Transfer function coefficients "b" */
+ 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;
void (*process)(struct ALfilterState *self, ALfloat *restrict dst, const ALfloat *src, ALuint numsamples);
} ALfilterState;
@@ -82,11 +83,11 @@ inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample
{
ALfloat outsmp;
- outsmp = filter->b[0] * sample +
- filter->b[1] * filter->x[0] +
- filter->b[2] * filter->x[1] -
- filter->a[1] * filter->y[0] -
- filter->a[2] * filter->y[1];
+ outsmp = filter->input_gain * sample +
+ filter->b1 * filter->x[0] +
+ filter->b2 * filter->x[1] -
+ filter->a1 * filter->y[0] -
+ filter->a2 * filter->y[1];
filter->x[1] = filter->x[0];
filter->x[0] = sample;
filter->y[1] = filter->y[0];