summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-07-26 17:13:50 -0700
committerChris Robinson <[email protected]>2008-07-26 17:13:50 -0700
commit597e01153ebae150f734bcd640fb692bb69bdc05 (patch)
tree911dd8dc8d7d210615c71d041967597fc3db90f3 /Alc
parentd3e5fcd13e6fa597a74d93ef87738b5491cc4bdf (diff)
Use arrays instead of pointer-to-arrays for the low-pass filter
Diffstat (limited to 'Alc')
-rw-r--r--Alc/lpfilter.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/Alc/lpfilter.c b/Alc/lpfilter.c
index e10b15d7..2496f007 100644
--- a/Alc/lpfilter.c
+++ b/Alc/lpfilter.c
@@ -87,24 +87,9 @@ int InitLowPassFilter(ALCcontext *Context, FILTER *iir)
ProtoCoef[1].b1 = 1.847759;
ProtoCoef[1].b2 = 1.0;
- /*
- * Allocate array of z-domain coefficients for each filter section
- * plus filter gain variable
- */
- iir->coef = (float*)calloc(4*FILTER_SECTIONS + 1, sizeof(float));
- if(!iir->coef)
- {
- AL_PRINT("Unable to allocate coef array\n");
- return 1;
- }
-
- /* allocate history array */
- iir->history = (float*)calloc(2*FILTER_SECTIONS, sizeof(float));
- if(!iir->history) {
- AL_PRINT("\nUnable to allocate history array\n");
- return 1;
- }
-
+ /* Clear the coefficient and history arrays */
+ memset(iir->coef, 0, sizeof(iir->coef));
+ memset(iir->history, 0, sizeof(iir->history));
k = 1.0; /* Set overall filter gain */
coef = iir->coef + 1; /* Skip k, or gain */