Browse code

10l: reverse the biquad coefficients.

I did not notice that the filter implementation uses a reversed history state.

Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
(cherry picked from commit 98cfadd648bfb2ab48e4c18d832e946a1ba050c8)

Justin Ruggles authored on 2011/01/22 05:59:20
Showing 1 changed files
... ...
@@ -137,15 +137,15 @@ static int biquad_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c,
137 137
 
138 138
     if (filt_mode == FF_FILTER_MODE_HIGHPASS) {
139 139
         c->gain  =  ((1.0 + cos_w0) / 2.0)  / a0;
140
-        x0       = (-(1.0 + cos_w0))        / a0;
141
-        x1       =  ((1.0 + cos_w0) / 2.0)  / a0;
140
+        x0       =  ((1.0 + cos_w0) / 2.0)  / a0;
141
+        x1       = (-(1.0 + cos_w0))        / a0;
142 142
     } else { // FF_FILTER_MODE_LOWPASS
143 143
         c->gain  =  ((1.0 - cos_w0) / 2.0)  / a0;
144
-        x0       =   (1.0 - cos_w0)         / a0;
145
-        x1       =  ((1.0 - cos_w0) / 2.0)  / a0;
144
+        x0       =  ((1.0 - cos_w0) / 2.0)  / a0;
145
+        x1       =   (1.0 - cos_w0)         / a0;
146 146
     }
147
-    c->cy[0] =  (2.0 *  cos_w0)        / a0;
148
-    c->cy[1] = (-1.0 + (sin_w0 / 2.0)) / a0;
147
+    c->cy[0] = (-1.0 + (sin_w0 / 2.0)) / a0;
148
+    c->cy[1] =  (2.0 *  cos_w0)        / a0;
149 149
 
150 150
     // divide by gain to make the x coeffs integers.
151 151
     // during filtering, the delay state will include the gain multiplication