[FFmpeg-devel] [PATCH 2/2] avfilter: add flanger filter

Paul B Mahol onemda at gmail.com
Thu Jul 3 10:17:47 CEST 2014


On 7/1/14, Clement Boesch <u at pkh.me> wrote:
> On Tue, Jul 01, 2014 at 08:41:00AM +0000, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  libavfilter/Makefile     |   1 +
>>  libavfilter/af_flanger.c | 239
>> +++++++++++++++++++++++++++++++++++++++++++++++
>>  libavfilter/allfilters.c |   1 +
>>  3 files changed, 241 insertions(+)
>>  create mode 100644 libavfilter/af_flanger.c
>>
> [...]
>> +static int config_input(AVFilterLink *inlink)
>> +{
>> +    AVFilterContext *ctx = inlink->dst;
>> +    FlangerContext *s = ctx->priv;
>> +
>> +    s->max_samples = (s->delay_min + s->delay_depth) *
>> inlink->sample_rate + 2.5;
>> +    s->lfo_length  = inlink->sample_rate / s->speed;
>> +    s->delay_last  = av_calloc(inlink->channels,
>> sizeof(*s->delay_last));
>> +    s->lfo         = av_calloc(s->lfo_length, sizeof(*s->lfo));
>> +    if (!s->lfo || !s->delay_last)
>> +        return AVERROR(ENOMEM);
>> +
>
>> +    ff_generate_wave_table(s->wave_shape, AV_SAMPLE_FMT_FLT, s->lfo,
>> s->lfo_length,
>
> This filter seems to support only double, why request FMT_FLT here?
> (ff_generate_wave_table() seems to support DBL)
>
> [...]

Because that how it is done in sox effect.


More information about the ffmpeg-devel mailing list