diff options
author | Paul B Mahol <onemda@gmail.com> | 2019-11-22 20:24:29 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-11-22 20:24:29 +0100 |
commit | f2a01b4c8bf6e40ad3b700901449338bc713bd59 (patch) | |
tree | 320d4709a8c8c40541589e3fbfe73d91e02e3fbb /libavfilter | |
parent | eecc45cea50fedc918fc7cac908fdfc6baefd241 (diff) | |
download | ffmpeg-f2a01b4c8bf6e40ad3b700901449338bc713bd59.tar.gz |
avfilter/af_aiir: fix biquads normalization
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_aiir.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/libavfilter/af_aiir.c b/libavfilter/af_aiir.c index e22f814cc7..55828c1a82 100644 --- a/libavfilter/af_aiir.c +++ b/libavfilter/af_aiir.c @@ -594,16 +594,21 @@ static int decompose_zp2biquads(AVFilterContext *ctx, int channels) iir->ab[1][2 * nearest_zero.a] = iir->ab[1][2 * nearest_zero.a + 1] = NAN; iir->ab[1][2 * nearest_zero.b] = iir->ab[1][2 * nearest_zero.b + 1] = NAN; - iir->biquads[current_biquad].a[0] = a[4]; - iir->biquads[current_biquad].a[1] = a[2]; - iir->biquads[current_biquad].a[2] = a[0]; - iir->biquads[current_biquad].b[0] = b[4]; - iir->biquads[current_biquad].b[1] = b[2]; - iir->biquads[current_biquad].b[2] = b[0]; + iir->biquads[current_biquad].a[0] = 1.; + iir->biquads[current_biquad].a[1] = a[2] / a[4]; + iir->biquads[current_biquad].a[2] = a[0] / a[4]; + iir->biquads[current_biquad].b[0] = b[4] / a[4]; + iir->biquads[current_biquad].b[1] = b[2] / a[4]; + iir->biquads[current_biquad].b[2] = b[0] / a[4]; factor = (iir->biquads[current_biquad].a[0] + iir->biquads[current_biquad].a[1] + - iir->biquads[current_biquad].a[2]) / 4; + iir->biquads[current_biquad].a[2]) / + (iir->biquads[current_biquad].b[0] + + iir->biquads[current_biquad].b[1] + + iir->biquads[current_biquad].b[2]); + + av_log(ctx, AV_LOG_VERBOSE, "factor=%f\n", factor); iir->biquads[current_biquad].b[0] *= factor; iir->biquads[current_biquad].b[1] *= factor; |