diff options
author | Chris Robinson <[email protected]> | 2011-05-18 18:52:47 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-18 18:52:47 -0700 |
commit | b838d123f899359e791450271d09324668f2d25c (patch) | |
tree | b1f79d6d7342910c14a87da5e874c4fcd3be5f45 /OpenAL32/Include | |
parent | 1d3926e1872657da9b0490cff233454b583ff964 (diff) |
Multiply the history offset in the filtering funcitons
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]; |