diff options
author | Chris Robinson <[email protected]> | 2009-11-22 21:20:27 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-11-22 21:20:27 -0800 |
commit | 06bbee24492e70bf3d3a18a9823da57a38e7456a (patch) | |
tree | 602dd85a56bd4d29b727f2ddf994ae4f9f17adea /OpenAL32 | |
parent | 85bc300dfa58791338cfe777d72eb55e224c0be7 (diff) |
Add a function for 1-pole filtering
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 86ada5ef..754b0b6f 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -49,6 +49,18 @@ static __inline ALfloat lpFilter2P(FILTER *iir, ALuint offset, ALfloat input) return output; } +static __inline ALfloat lpFilter1P(FILTER *iir, ALuint offset, ALfloat input) +{ + ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + history[0] = output; + + return output; +} + #define AL_FILTER_TYPE 0x8001 |