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.0
f, 1.0
f/n) - 3.0
f/4.0
f) - 0.5
f))/sqrtf(3.0
f);
44 unstable = (cfreq <= 0.0f || cfreq >= 1.0f/4.0f);
46 c = sqrtf(3.0
f)*sqrtf(sqrtf(pow(2.0
f, 1.0
f/n) - 3.0
f/4.0
f) - 0.5
f);
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)
#define fs(width, name, subs,...)
static int bessel_init(FFBesselFilter *s, float n, float f0, float fs, int highpass)