Mercurial > libavcodec.hg
comparison iirfilter.c @ 9943:2cd0d1447bd3 libavcodec
Fix declarations of complex numbers
Complex numbers must be declared using a base type of float, double,
or long double.
author | mru |
---|---|
date | Thu, 09 Jul 2009 10:16:00 +0000 |
parents | e9d9d946f213 |
children | 12cf93d4b282 |
comparison
equal
deleted
inserted
replaced
9942:f91d6810f983 | 9943:2cd0d1447bd3 |
---|---|
54 float stopband, float ripple) | 54 float stopband, float ripple) |
55 { | 55 { |
56 int i, j, size; | 56 int i, j, size; |
57 FFIIRFilterCoeffs *c; | 57 FFIIRFilterCoeffs *c; |
58 double wa; | 58 double wa; |
59 complex p[MAXORDER + 1]; | 59 double complex p[MAXORDER + 1]; |
60 | 60 |
61 if(filt_type != FF_FILTER_TYPE_BUTTERWORTH || filt_mode != FF_FILTER_MODE_LOWPASS) | 61 if(filt_type != FF_FILTER_TYPE_BUTTERWORTH || filt_mode != FF_FILTER_MODE_LOWPASS) |
62 return NULL; | 62 return NULL; |
63 if(order <= 1 || (order & 1) || order > MAXORDER || cutoff_ratio >= 1.0) | 63 if(order <= 1 || (order & 1) || order > MAXORDER || cutoff_ratio >= 1.0) |
64 return NULL; | 64 return NULL; |
76 | 76 |
77 p[0] = 1.0; | 77 p[0] = 1.0; |
78 for(i = 1; i <= order; i++) | 78 for(i = 1; i <= order; i++) |
79 p[i] = 0.0; | 79 p[i] = 0.0; |
80 for(i = 0; i < order; i++){ | 80 for(i = 0; i < order; i++){ |
81 complex zp; | 81 double complex zp; |
82 double th = (i + (order >> 1) + 0.5) * M_PI / order; | 82 double th = (i + (order >> 1) + 0.5) * M_PI / order; |
83 zp = cexp(I*th) * wa; | 83 zp = cexp(I*th) * wa; |
84 zp = (zp + 2.0) / (zp - 2.0); | 84 zp = (zp + 2.0) / (zp - 2.0); |
85 | 85 |
86 for(j = order; j >= 1; j--) | 86 for(j = order; j >= 1; j--) |