[FFmpeg-devel] Some ideas for a tiny set of audio conversion functions..

Andreas Öman andreas
Sun Nov 18 16:51:55 CET 2007

Michael Niedermayer wrote:

> the data/stride for the src is strangely duplicated for each dst
> also the convertion stuff (which channel to which and what gain) is in the
> same struct as the instance specific stuff (data/stride)
> these should be seperated!
> also src/dst data/stride could be stored in 2 arrays
> like videos data[][]/linesize[] in AVFrame

Here is another idea.

Some thoughts...

I don't know how useful arbitrary strides are for audio.
Unless someone has a good reason for having them i think
we could stick with 'variant 2' below, i.e. just specifying
if the audio is stored in planar or interleaved mode.
It is more flexible with strides yes, but is it ever going
to be used?

I also changed the mixing stuff to a matrix.
It's a bit more flexible but OTOH it might be a little more
code to figure out when to use special case optimized code.
(Do we need to check if the supplied matrix is an identity
matrix or can we just assume that NULL is always used for that,

I also envision that in the future we might just pass
'AVAFrame' directly to audio decoders instead of
an (uint16_t *) and then let avcodec_decode_audio take care
of the conversion. Same for encoding.
Then we might add avcodec_decode_audio3() that passes
this AVAFrame directly to the user.

However, initially, I don't intend to make any API/ABI

-------------- next part --------------
A non-text attachment was scrubbed...
Name: aconv2.c
Type: text/x-csrc
Size: 1479 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071118/dc34b728/attachment.c>

More information about the ffmpeg-devel mailing list