[MPlayer-dev-eng] [PATCH] channel reordering for 6ch audio
Uoti Urpala
uoti.urpala at pp1.inet.fi
Sun Jul 30 17:00:39 CEST 2006
On Sun, 2006-07-30 at 17:45 +0400, Alexander 'Lazy Ranma' Ponyatikh
wrote:
> >> ae_lavc.c
> >> Native order: L C R SL SR LFE
> > So lavc has a native order? Did you verify that all lavc codecs use the
> > same one?
>
> I tried all codecs listed in man, but only ac3 accepted 6ch input.
Ok, but without an explicit decision to make that the official lavc
order it might break in the future.
> > +++ libmpcodecs/ad_pcm.c (working copy)
> > [Code allocating and using a temp buffer to reorder the data]
>
> > Wouldn't it be simpler to read each channel separately to its correct
> > location?
>
> True. Here is a new patch.
The channels seem to be in interleaved order (I didn't pay attention to
that the last time). Using memcpy to copy individual samples is very
inefficient, as would anything that calls a function for each sample.
This is true for the other patches too. Also I think you should return a
multiple of samplesize*channels; returning "read" doesn't make sense if
any partial results are reordered so that the caller can't even know
which bytes are actually read and which undefined (though this'll
probably change anyway if it's rewritten in a more efficient way).
More information about the MPlayer-dev-eng
mailing list