diff options
author | Chris Robinson <[email protected]> | 2008-07-26 17:13:50 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-07-26 17:13:50 -0700 |
commit | 597e01153ebae150f734bcd640fb692bb69bdc05 (patch) | |
tree | 911dd8dc8d7d210615c71d041967597fc3db90f3 /Alc | |
parent | d3e5fcd13e6fa597a74d93ef87738b5491cc4bdf (diff) |
Use arrays instead of pointer-to-arrays for the low-pass filter
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/lpfilter.c | 21 |
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 */ |