aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/iirfilter.c
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2011-01-21 20:59:20 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-01-23 19:32:07 +0100
commitff5eded449c32ef46489a9225445801837beb6a6 (patch)
treeee51cd3ca8c6915e01bf0cf82ec7b3c0cc25f3df /libavcodec/iirfilter.c
parentba0dd9e8ffed02a89ce5f0c5110cede6f07896ba (diff)
downloadffmpeg-ff5eded449c32ef46489a9225445801837beb6a6.tar.gz
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)
Diffstat (limited to 'libavcodec/iirfilter.c')
-rw-r--r--libavcodec/iirfilter.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 832559cfea..46b4973f85 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -137,15 +137,15 @@ static int biquad_init_coeffs(void *avc, struct FFIIRFilterCoeffs *c,
if (filt_mode == FF_FILTER_MODE_HIGHPASS) {
c->gain = ((1.0 + cos_w0) / 2.0) / a0;
- x0 = (-(1.0 + cos_w0)) / a0;
- x1 = ((1.0 + cos_w0) / 2.0) / a0;
+ x0 = ((1.0 + cos_w0) / 2.0) / a0;
+ x1 = (-(1.0 + cos_w0)) / a0;
} else { // FF_FILTER_MODE_LOWPASS
c->gain = ((1.0 - cos_w0) / 2.0) / a0;
- x0 = (1.0 - cos_w0) / a0;
- x1 = ((1.0 - cos_w0) / 2.0) / a0;
+ x0 = ((1.0 - cos_w0) / 2.0) / a0;
+ x1 = (1.0 - cos_w0) / a0;
}
- c->cy[0] = (2.0 * cos_w0) / a0;
- c->cy[1] = (-1.0 + (sin_w0 / 2.0)) / a0;
+ c->cy[0] = (-1.0 + (sin_w0 / 2.0)) / a0;
+ c->cy[1] = (2.0 * cos_w0) / a0;
// divide by gain to make the x coeffs integers.
// during filtering, the delay state will include the gain multiplication