avfilter/af_acrossover: fix single pole allpass coefficients

This commit is contained in:
Paul B Mahol 2020-11-27 15:33:13 +01:00
parent ca90d83c1e
commit 551ca67afe
1 changed files with 4 additions and 3 deletions

View File

@ -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.;