[SCM] libav/experimental: 10l: reverse the biquad coefficients.
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 17:22:27 UTC 2013
The following commit has been merged in the experimental branch:
commit 98cfadd648bfb2ab48e4c18d832e946a1ba050c8
Author: Justin Ruggles <justin.ruggles at gmail.com>
Date: Fri Jan 21 20:59:20 2011 +0000
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 at jannau.net>
diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 832559c..46b4973 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
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list