[FFmpeg-devel] [PATCH] avfilter: add firequalizer filter
Paul B Mahol
onemda at gmail.com
Thu Feb 18 21:52:41 CET 2016
> + center = s->fir_len / 2;
> +
> + for (k = 0; k <= center; k++) {
> + double u = k * (M_PI/center);
> + double win;
> + switch (s->wfunc) {
> + case WFUNC_RECTANGULAR:
> + win = 1.0;
> + break;
> + case WFUNC_HANN:
> + win = 0.5 + 0.5 * cos(u);
> + break;
> + case WFUNC_HAMMING:
> + win = 0.53836 + 0.46164 * cos(u);
> + break;
> + case WFUNC_BLACKMAN:
> + win = 0.48 + 0.5 * cos(u) + 0.02 * cos(2*u);
> + break;
> + case WFUNC_NUTTALL3:
> + win = 0.40897 + 0.5 * cos(u) + 0.09103 * cos(2*u);
> + break;
> + case WFUNC_MNUTTALL3:
> + win = 0.4243801 + 0.4973406 * cos(u) + 0.0782793 * cos(2*u);
> + break;
> + case WFUNC_NUTTALL:
> + win = 0.355768 + 0.487396 * cos(u) + 0.144232 * cos(2*u) + 0.012604 * cos(3*u);
> + break;
> + case WFUNC_BNUTTALL:
> + win = 0.3635819 + 0.4891775 * cos(u) + 0.1365995 * cos(2*u) + 0.0106411 * cos(3*u);
> + break;
> + case WFUNC_BHARRIS:
> + win = 0.35875 + 0.48829 * cos(u) + 0.14128 * cos(2*u) + 0.01168 * cos(3*u);
> + break;
What about using libavfilter/window_func.c ?
Still LGTM.
More information about the ffmpeg-devel
mailing list