[FFmpeg-devel] [PATCH] lavfi: port MPlayer's af_pan filter to libavfilter.

Nicolas George nicolas.george at normalesup.org
Sat Nov 5 15:26:12 CET 2011


Le quintidi 15 brumaire, an CCXX, Clément Bœsch a écrit :
> I wasn't able to contact the original author for a relicensing (I tried 5 or 6
> mails I could find, but none seemed valid), so I kept the GPL and the original
> (invalid) mail. It's OK with me to relicense to any preferred license if you
> are able to contact Anders Johansson and find an agreement with him.

It looks that there are only a few lines of quite trivial code kept from the
original. Maybe just reimplementing would be better?

> +    float gain_level[SWR_CH_MAX][SWR_CH_MAX];

Since the rest of the code uses int16_t, maybe using integers for the
coefficients too would be better? I believe that +7.8 fixed-point
coefficients would be enough for any use.

> +    // first parameter is the number of channels...
> +    nb_output_channels = strtol(args, NULL, 10);
> +    pan->out_channels_layout = av_get_default_channel_layout(nb_output_channels);

MPlayer has a fixed channel layout, but FFmpeg does not. Thus, I believe
that the user should be able to specify the channel layout.

Possibly, av_get_channel_layout could be extended to accept fancy notations
like "stereo+LFE+TBC" and also a single number.

(I am willing to do that, but I will be rather busy in the next ten days or
so.)

> +    int nb_input_channels = av_get_channel_layout_nb_channels(inlink->channel_layout);
> +    int nb_output_channels = av_get_channel_layout_nb_channels(pan->out_channels_layout);

Couldn't they be kept in the context structure rather than recomputed for
each call?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111105/fcad9709/attachment.asc>


More information about the ffmpeg-devel mailing list