diff options
author | Chris Robinson <[email protected]> | 2010-08-14 22:59:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-08-14 22:59:55 -0700 |
commit | 0c49e5ba56bb9b944ea3a55ce34a7ecc69832f38 (patch) | |
tree | f5ee01a0743b45f87c364253f92daf6234713fe3 /OpenAL32/Include | |
parent | b65bc4523653017dfc7b910ebafcb213714fcb0c (diff) |
Use click removal when starting a source
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 9f420d35..ef852d13 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -61,6 +61,43 @@ static __inline ALfloat lpFilter1P(FILTER *iir, ALuint offset, ALfloat input) return output; } +static __inline ALfloat lpFilter4PC(const FILTER *iir, ALuint offset, ALfloat input) +{ + const ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + output = output + (history[1]-output)*a; + output = output + (history[2]-output)*a; + output = output + (history[3]-output)*a; + + return output; +} + +static __inline ALfloat lpFilter2PC(const FILTER *iir, ALuint offset, ALfloat input) +{ + const ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + output = output + (history[1]-output)*a; + + return output; +} + +static __inline ALfloat lpFilter1PC(FILTER *iir, ALuint offset, ALfloat input) +{ + const ALfloat *history = &iir->history[offset]; + ALfloat a = iir->coeff; + ALfloat output = input; + + output = output + (history[0]-output)*a; + + return output; +} + /* 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) */ |