diff options
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alFilter.h | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h index 927b7fc4..fc91bb16 100644 --- a/OpenAL32/Include/alFilter.h +++ b/OpenAL32/Include/alFilter.h @@ -16,28 +16,10 @@ typedef struct { ALfloat history[1]; #endif } FILTER; -/* -static __inline ALfloat lpFilter4P(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; - output = output + (history[1]-output)*a; - history[1] = output; - output = output + (history[2]-output)*a; - history[2] = output; - output = output + (history[3]-output)*a; - history[3] = output; - return output; -} -*/ static __inline ALfloat lpFilter2P(FILTER *iir, ALuint offset, ALfloat input) { - ALfloat *history = &iir->history[offset]; + ALfloat *history = &iir->history[offset*2]; ALfloat a = iir->coeff; ALfloat output = input; @@ -48,7 +30,6 @@ 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]; @@ -60,24 +41,10 @@ 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]; + const ALfloat *history = &iir->history[offset*2]; ALfloat a = iir->coeff; ALfloat output = input; @@ -86,7 +53,6 @@ static __inline ALfloat lpFilter2PC(const FILTER *iir, ALuint offset, ALfloat in return output; } - static __inline ALfloat lpFilter1PC(FILTER *iir, ALuint offset, ALfloat input) { const ALfloat *history = &iir->history[offset]; |