Go to the documentation of this file.
22 #ifndef AVCODEC_OPUS_ENC_UTILS_H
23 #define AVCODEC_OPUS_ENC_UTILS_H
42 float c, cfreq, w0, k1, k2;
47 unstable = (cfreq <= 0.0f || cfreq >= 1.0f/4.0f);
50 cfreq = 0.5f -
c*f0/
fs;
51 unstable = (cfreq <= 3.0f/8.0f || cfreq >= 1.0f/2.0f);
54 w0 = tanf(
M_PI*cfreq);
58 s->a[0] = k2/(1.0f + k1 + k2);
59 s->a[1] = 2.0f *
s->a[0];
61 s->b[0] = 2.0f *
s->a[0] * (1.0f/k2 - 1.0f);
62 s->b[1] = 1.0f - (
s->a[0] +
s->a[1] +
s->a[2] +
s->b[0]);
86 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 float bessel_filter(FFBesselFilter *s, float x)
#define fs(width, name, subs,...)
static __device__ float sqrtf(float a)
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 int bessel_init(FFBesselFilter *s, float n, float f0, float fs, int highpass)
static int bessel_reinit(FFBesselFilter *s, float n, float f0, float fs, int highpass)