[FFmpeg-cvslog] avfilter/af_acrossover: fix single pole allpass coefficients
Paul B Mahol
git at videolan.org
Fri Nov 27 16:36:05 EET 2020
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Nov 27 15:33:13 2020 +0100| [551ca67afe7555368758c4aab476978689380a6d] | committer: Paul B Mahol
avfilter/af_acrossover: fix single pole allpass coefficients
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=551ca67afe7555368758c4aab476978689380a6d
---
libavfilter/af_acrossover.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c
index 98bd6fe7a9..550d4ddbaf 100644
--- a/libavfilter/af_acrossover.c
+++ b/libavfilter/af_acrossover.c
@@ -209,10 +209,11 @@ static void set_ap(BiquadContext *b, double fc, double q, double sr)
static void set_ap1(BiquadContext *b, double fc, double sr)
{
- double omega = M_PI * fc / sr;
- double K = tan(omega);
+ double omega = 0.5 * M_PI * fc / sr + M_PI_4;
+ double cosine = cos(omega);
+ double sine = sin(omega);
- b->a1 = -(1. - K) / (1. + K);
+ b->a1 = -cosine / sine;
b->a2 = 0.;
b->b0 = -b->a1;
b->b1 = 1.;
More information about the ffmpeg-cvslog
mailing list