diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-11-27 15:33:13 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-11-27 15:35:41 +0100 |
commit | 551ca67afe7555368758c4aab476978689380a6d (patch) | |
tree | fca9a5b7f8fd62272eafc978ae5dbbaba260dfdd | |
parent | ca90d83c1e468aee1a249976c05250f157e475e9 (diff) | |
download | ffmpeg-551ca67afe7555368758c4aab476978689380a6d.tar.gz |
avfilter/af_acrossover: fix single pole allpass coefficients
-rw-r--r-- | libavfilter/af_acrossover.c | 7 |
1 files 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.; |