Go to the documentation of this file.
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 int bessel_init(FFBesselFilter *s, float n, float f0, float fs, int highpass)
#define fs(width, name, subs,...)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static float bessel_filter(FFBesselFilter *s, float x)