diff options
author | Chris Robinson <[email protected]> | 2011-05-18 18:42:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-18 18:42:25 -0700 |
commit | 194f8fc791e6675d1913e8a66ebe25e05bde7c0e (patch) | |
tree | 22bf00992724f7820bec0b6a42c2efa79bbe195a /OpenAL32 | |
parent | c3167661441525ed1f33daa06cdc38e7e5c70654 (diff) |
Uninline lpCoeffCalc
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 14 | ||||
-rw-r--r-- | OpenAL32/alFilter.c | 14 |
2 files changed, 15 insertions, 13 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 7eabe5cb..927b7fc4 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -101,19 +101,7 @@ static __inline ALfloat lpFilter1PC(FILTER *iir, ALuint offset, ALfloat input) /* Calculates the low-pass filter coefficient given the pre-scaled gain and * cos(w) value. Note that g should be pre-scaled (sqr(gain) for one-pole, * sqrt(gain) for four-pole, etc) */ -static __inline ALfloat lpCoeffCalc(ALfloat g, ALfloat cw) -{ - ALfloat a = 0.0f; - - /* Be careful with gains < 0.01, as that causes the coefficient - * head towards 1, which will flatten the signal */ - g = __max(g, 0.01f); - if(g < 0.9999f) /* 1-epsilon */ - a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / - (1 - g); - - return a; -} +ALfloat lpCoeffCalc(ALfloat g, ALfloat cw); typedef struct ALfilter diff --git a/OpenAL32/alFilter.c b/OpenAL32/alFilter.c index d63e8e8a..b16dc073 100644 --- a/OpenAL32/alFilter.c +++ b/OpenAL32/alFilter.c @@ -406,6 +406,20 @@ AL_API ALvoid AL_APIENTRY alGetFilterfv(ALuint filter, ALenum param, ALfloat *pf } +ALfloat lpCoeffCalc(ALfloat g, ALfloat cw) +{ + ALfloat a = 0.0f; + + /* Be careful with gains < 0.01, as that causes the coefficient + * head towards 1, which will flatten the signal */ + g = __max(g, 0.01f); + if(g < 0.9999f) /* 1-epsilon */ + a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / + (1 - g); + + return a; +} + ALvoid ReleaseALFilters(ALCdevice *device) { ALsizei i; |