Reorder filter coefficients

This commit is contained in:
Chris Robinson 2016-12-21 21:35:50 -08:00
parent 4c33818dde
commit 080b0cea8b
3 changed files with 11 additions and 11 deletions

View File

@ -146,11 +146,11 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
/* Copy the filter coefficients for the other input channels. */
for(i = 1;i < MAX_EFFECT_CHANNELS;i++)
{
state->filter[0][i].a1 = state->filter[0][0].a1;
state->filter[0][i].a2 = state->filter[0][0].a2;
state->filter[0][i].b0 = state->filter[0][0].b0;
state->filter[0][i].b1 = state->filter[0][0].b1;
state->filter[0][i].b2 = state->filter[0][0].b2;
state->filter[0][i].a1 = state->filter[0][0].a1;
state->filter[0][i].a2 = state->filter[0][0].a2;
}
gain = props->Equalizer.Mid1Gain;
@ -162,11 +162,11 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
);
for(i = 1;i < MAX_EFFECT_CHANNELS;i++)
{
state->filter[1][i].a1 = state->filter[1][0].a1;
state->filter[1][i].a2 = state->filter[1][0].a2;
state->filter[1][i].b0 = state->filter[1][0].b0;
state->filter[1][i].b1 = state->filter[1][0].b1;
state->filter[1][i].b2 = state->filter[1][0].b2;
state->filter[1][i].a1 = state->filter[1][0].a1;
state->filter[1][i].a2 = state->filter[1][0].a2;
}
gain = props->Equalizer.Mid2Gain;
@ -178,11 +178,11 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
);
for(i = 1;i < MAX_EFFECT_CHANNELS;i++)
{
state->filter[2][i].a1 = state->filter[2][0].a1;
state->filter[2][i].a2 = state->filter[2][0].a2;
state->filter[2][i].b0 = state->filter[2][0].b0;
state->filter[2][i].b1 = state->filter[2][0].b1;
state->filter[2][i].b2 = state->filter[2][0].b2;
state->filter[2][i].a1 = state->filter[2][0].a1;
state->filter[2][i].a2 = state->filter[2][0].a2;
}
gain = sqrtf(props->Equalizer.HighGain);
@ -192,11 +192,11 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
);
for(i = 1;i < MAX_EFFECT_CHANNELS;i++)
{
state->filter[3][i].a1 = state->filter[3][0].a1;
state->filter[3][i].a2 = state->filter[3][0].a2;
state->filter[3][i].b0 = state->filter[3][0].b0;
state->filter[3][i].b1 = state->filter[3][0].b1;
state->filter[3][i].b2 = state->filter[3][0].b2;
state->filter[3][i].a1 = state->filter[3][0].a1;
state->filter[3][i].a2 = state->filter[3][0].a2;
}
}

View File

@ -137,11 +137,11 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice *
for(i = 0;i < MAX_EFFECT_CHANNELS;i++)
{
state->Filter[i].a1 = -a;
state->Filter[i].a2 = 0.0f;
state->Filter[i].b0 = a;
state->Filter[i].b1 = -a;
state->Filter[i].b2 = 0.0f;
state->Filter[i].a1 = -a;
state->Filter[i].a2 = 0.0f;
}
STATIC_CAST(ALeffectState,state)->OutBuffer = Device->FOAOut.Buffer;

View File

@ -42,8 +42,8 @@ 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 a1, a2; /* Transfer function coefficients "a" (a0 is pre-applied) */
ALfloat b0, b1, b2; /* Transfer function coefficients "b" */
ALfloat a1, a2; /* Transfer function coefficients "a" (a0 is pre-applied) */
} ALfilterState;
/* Currently only a C-based filter process method is implemented. */
#define ALfilterState_process ALfilterState_processC