22 #ifndef AVCODEC_OPUSENC_UTILS_H 23 #define AVCODEC_OPUSENC_UTILS_H 39 float c, cfreq, w0, k1, k2;
42 c = (1.0f/sqrtf(sqrtf(pow(2.0f, 1.0f/n) - 3.0f/4.0f) - 0.5f))/sqrtf(3.0f);
44 unstable = (cfreq <= 0.0f || cfreq >= 1.0f/4.0f);
46 c = sqrtf(3.0f)*sqrtf(sqrtf(pow(2.0f, 1.0f/n) - 3.0f/4.0f) - 0.5f);
47 cfreq = 0.5f - c*f0/fs;
48 unstable = (cfreq <= 3.0f/8.0f || cfreq >= 1.0f/2.0f);
51 w0 = tanf(
M_PI*cfreq);
55 s->
a[0] = k2/(1.0f + k1 + k2);
56 s->
a[1] = 2.0f * s->
a[0];
58 s->
b[0] = 2.0f * s->
a[0] * (1.0f/k2 - 1.0f);
59 s->
b[1] = 1.0f - (s->
a[0] + s->
a[1] + s->
a[2] + s->
b[0]);
83 s->
y[0] = s->
a[0]*s->
x[0] + s->
a[1]*s->
x[1] + s->
a[2]*s->
x[2] + s->
b[0]*s->
y[1] + s->
b[1]*s->
y[2];
static int bessel_reinit(FFBesselFilter *s, float n, float f0, float fs, int highpass)
static float bessel_filter(FFBesselFilter *s, float x)
static int bessel_init(FFBesselFilter *s, float n, float f0, float fs, int highpass)