aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alFilter.h37
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) */