diff options
author | Chris Robinson <[email protected]> | 2016-01-23 01:22:08 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-01-23 01:22:08 -0800 |
commit | 352d9afd642e94651e69dbb28ade50eea88eae0d (patch) | |
tree | 626f33f1797f34090a0d5245560a3251ac3c95db /OpenAL32 | |
parent | 87b6c30932d66228af4774d6e65bdea3d9895514 (diff) |
Inline a couple filterstate methods
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 27 | ||||
-rw-r--r-- | OpenAL32/alFilter.c | 27 |
2 files changed, 27 insertions, 27 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 3c65fd9f..fa86af27 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -68,7 +68,14 @@ inline ALfloat calc_rcpQ_from_bandwidth(ALfloat freq_mult, ALfloat bandwidth) return 2.0f*sinhf(logf(2.0f)/2.0f*bandwidth*w0/sinf(w0)); } -void ALfilterState_clear(ALfilterState *filter); +inline void ALfilterState_clear(ALfilterState *filter) +{ + filter->x[0] = 0.0f; + filter->x[1] = 0.0f; + filter->y[0] = 0.0f; + filter->y[1] = 0.0f; +} + void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat gain, ALfloat freq_mult, ALfloat rcpQ); inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample) @@ -90,7 +97,23 @@ inline ALfloat ALfilterState_processSingle(ALfilterState *filter, ALfloat sample void ALfilterState_processC(ALfilterState *filter, ALfloat *restrict dst, const ALfloat *src, ALuint numsamples); -void ALfilterState_processPassthru(ALfilterState *filter, const ALfloat *src, ALuint numsamples); +inline void ALfilterState_processPassthru(ALfilterState *filter, const ALfloat *src, ALuint numsamples) +{ + if(numsamples >= 2) + { + filter->x[1] = src[numsamples-2]; + filter->x[0] = src[numsamples-1]; + filter->y[1] = src[numsamples-2]; + filter->y[0] = src[numsamples-1]; + } + else if(numsamples == 1) + { + filter->x[1] = filter->x[0]; + filter->x[0] = src[0]; + filter->y[1] = filter->y[0]; + filter->y[0] = src[0]; + } +} typedef struct ALfilter { diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index 3cf82c32..6d088a45 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -330,13 +330,8 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *va } -void ALfilterState_clear(ALfilterState *filter) -{ - filter->x[0] = 0.0f; - filter->x[1] = 0.0f; - filter->y[0] = 0.0f; - filter->y[1] = 0.0f; -} +extern inline void ALfilterState_clear(ALfilterState *filter); +extern inline void ALfilterState_processPassthru(ALfilterState *filter, const ALfloat *src, ALuint numsamples); void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat gain, ALfloat freq_mult, ALfloat rcpQ) { @@ -418,24 +413,6 @@ void ALfilterState_setParams(ALfilterState *filter, ALfilterType type, ALfloat g filter->process = ALfilterState_processC; } -void ALfilterState_processPassthru(ALfilterState *filter, const ALfloat *src, ALuint numsamples) -{ - if(numsamples >= 2) - { - filter->x[1] = src[numsamples-2]; - filter->x[0] = src[numsamples-1]; - filter->y[1] = src[numsamples-2]; - filter->y[0] = src[numsamples-1]; - } - else if(numsamples == 1) - { - filter->x[1] = filter->x[0]; - filter->x[0] = src[0]; - filter->y[1] = filter->y[0]; - filter->y[0] = src[0]; - } -} - static void lp_SetParami(ALfilter *UNUSED(filter), ALCcontext *context, ALenum UNUSED(param), ALint UNUSED(val)) { SET_ERROR_AND_RETURN(context, AL_INVALID_ENUM); } |