Call ALfilterState_processC directly

It's the only implementation currently, so there's no point to having it stored
as a function pointer in the filter struct. Even if there were SIMD versions,
it'd be a global selection, not per-instance.
This commit is contained in:
Chris Robinson
2016-09-12 11:48:15 -07:00
parent 46b3e1d08c
commit 53d8a49673
4 changed files with 2 additions and 10 deletions
-4
View File
@@ -151,7 +151,6 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
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].process = state->filter[0][0].process;
}
gain = props->Equalizer.Mid1Gain;
@@ -168,7 +167,6 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
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].process = state->filter[1][0].process;
}
gain = props->Equalizer.Mid2Gain;
@@ -185,7 +183,6 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
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].process = state->filter[2][0].process;
}
gain = sqrtf(props->Equalizer.HighGain);
@@ -200,7 +197,6 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCdevice *
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].process = state->filter[3][0].process;
}
}
-1
View File
@@ -142,7 +142,6 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCdevice *
state->Filter[i].b0 = a;
state->Filter[i].b1 = -a;
state->Filter[i].b2 = 0.0f;
state->Filter[i].process = ALfilterState_processC;
}
STATIC_CAST(ALeffectState,state)->OutBuffer = Device->FOAOut.Buffer;
+2 -3
View File
@@ -44,10 +44,9 @@ typedef struct ALfilterState {
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" */
void (*process)(struct ALfilterState *self, ALfloat *restrict dst, const ALfloat *restrict src, ALuint numsamples);
} ALfilterState;
#define ALfilterState_process(a, ...) ((a)->process((a), __VA_ARGS__))
/* Currently only a C-based filter process method is implemented. */
#define ALfilterState_process ALfilterState_processC
/* Calculates the rcpQ (i.e. 1/Q) coefficient for shelving filters, using the
* reference gain and shelf slope parameter.
-2
View File
@@ -431,8 +431,6 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g
filter->b0 = b[0] / a[0];
filter->b1 = b[1] / a[0];
filter->b2 = b[2] / a[0];
filter->process = ALfilterState_processC;
}