[FFmpeg-devel] [RFC] libavfilter audio API and related issues

S.N. Hemanth Meenakshisundaram smeenaks
Fri Jun 25 12:52:45 CEST 2010

Hi All,

I moved to Git and this is a first git test patch.

The changes in this patch are:

1. Fixes to audio filter framework code based on comments from last patch.

2. SampleFormat and ChannelLayout definitions moved to libavutil/audiofmt.h

3. Some channel layout and sample format utility functions copied to 
libavutil/audiodesc.h and audiodesc.c. Copies of these functions (with 
different names) still exist in libavcodec/utils.c and 
libavcodec/audioconvert.c, I haven't yet removed them to prevent 
breakage of existing code.

4. Libavfilter audio changes now dependent only on lavu and not on lavc.

5. Incomplete version of af_resample.c which does sample format 
conversion and will also do channel layout conversion.

Before that, I have a few questions on how to proceed:

1. lavc has a resample.c for the above operations (in conjunction with 
audioconvert.c) and also a resample2.c which does sample rate 
conversion. Is it ok to name this filter af_resample or should I name 
this one af_reformat and reserve the af_resample name for the sample 
rate conversion filter?

2. The current resample.c only accepts two channel input data - why? 
Depending on the file and codec, isn't it possible for input data to be 
more than two channels? Can I attempt adding multichannel input support 
or is there a reason it is not supported?

3. The current output sample format is always forced to S16. The channel 
layout conversion filters after this all assume that the individual 
samples are shorts. This needs to be fixed right? For example, I was 
thinking of changing stereo_to_mono function so it accepts an extra 
stride parameter and uses that to do its job irrespective of whether 
inputs are shorts (S16) or otherwise. Is this ok?

I still need to fix nits etc in af_resample. Will do those when 
finishing the channel layout conversion.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: af_resample.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100625/5c221e76/attachment.asc>

More information about the ffmpeg-devel mailing list