[Ffmpeg-devel] [RFC] Yet Another downmixer

Michael Niedermayer michaelni
Thu Mar 8 12:29:06 CET 2007


On Sun, Feb 18, 2007 at 04:20:58PM +0200, Kostya wrote:
> I'm working on DCA decoder and it also needs downminxing.
> In order not to duplicate code and efforts I present my
> vision of channel converting (based on imgconvert).
> Please give opinions if this approach is acceptable and
> should be developed or not.


> #include "avcodec.h"
> #include "downmix.h"
> static const int fmt_strides[AV_DM_COUNT] = {
>   1, 2, 3, 3, 4, 4, 5, 6
> };

i think we should primarely work with planar instead of packed data as planar
is closer to the internal structure of most >2 chanel codecs and it is MUCH
simpler for SIMD to deal with
also codecs which internally use planar should output planar, codecs which
internally use floats should output floats ...

based on this downmixing inside of a codec will likely always be working
with purely planar data, mostly float->float rarely int32_t->int32_t
also such internal downmixing only makes sense if it is faster than
external (done before a IMDCT and thus allows us to run fewer IMDCTs as
there are fewer channels left ...)

downmixing outside codecs will likely mostly be working on packed int16_t
-> packed int16_t as the codecs with planar and float likely are based on some
transforms and do downmixing internally ...

besides these your suggestion looks good

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070308/3d460ead/attachment.pgp>

More information about the ffmpeg-devel mailing list