24 #define BESSEL_I0_ITER 50 // default: 50 iterations of Bessel I0 approximation
31 double alpha2 = (alpha *
M_PI /
n) * (alpha *
M_PI / n);
35 for (i = 0; i <
n; i++) {
36 tmp = i * (n - i) * alpha2;
39 bessel = bessel * tmp / (j * j) + 1;
41 local_window[i] = sum;
45 for (i = 0; i <
n; i++)
46 window[i] = sqrt(local_window[i] / sum);
55 for (i = 0; i <
n; i++)
56 window[i] = (
int)floor(2147483647.0 * local_window[i] + 0.5);
av_cold void ff_kbd_window_init(float *window, float alpha, int n)
Generate a Kaiser-Bessel Derived Window.
Macro definitions for various function/variable attributes.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static double bessel(double x)
0th order modified bessel function of the first kind.
#define FF_KBD_WINDOW_MAX
Maximum window size for ff_kbd_window_init.
static double alpha(void *priv, double x, double y)
av_cold void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n)
simple assert() macros that are a bit more flexible than ISO C assert().