[FFmpeg-devel] [PATCH] avfilter: add firequalizer filter

Muhammad Faiz mfcc64 at gmail.com
Mon Feb 22 18:49:43 CET 2016


On Fri, Feb 19, 2016 at 11:52 PM, Muhammad Faiz <mfcc64 at gmail.com> wrote:
> On Fri, Feb 19, 2016 at 3:52 AM, Paul B Mahol <onemda at gmail.com> wrote:
>>> +        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 ?
>
> My version calculate half-length zero centered window. Incompatible
> with ff_generate_window_func()
>
>>
>> Still LGTM.

Pushed

Thank's


More information about the ffmpeg-devel mailing list