[Ffmpeg-devel] dts decoding broken?

Ian Caulfield ian.caulfield
Sat Feb 17 01:07:30 CET 2007


On 16/02/07, Andreas ?man <andreas at olebyn.nu> wrote:
> Uoti Urpala wrote:
> Here are some ideas from the top of my head.
>
> * avctx->channels should be replaced with an enum much like PixelFormat
> for video, or we collide with formats having the same amount of channels
> (such DTS_3F1R and DTS_2F2R). These enumerations implicitly specifies
> the number of channels, the channel locations (front, back, side,
> center, etc) and channel order (interleave offset in output data).
> Call it 'ChannelFormat' / 'ChannelLayout' or somthing.

Instead of an enum, I'd suggest having a bitmask of channel positions
- the latest dolby codecs such as DD+ and TrueHD can supply an
arbitrary combination of something like 20 different speaker positions
(although everything is still 5.1 at the moment). SMPTE RP226 has a
fairly comprehensive list of possible channels.

> * For presentation purposes we should always keep the original
> channellayout stored in the codeccontext.
>
> * It might also be worth pondering a way of letting the application say
> 'hey, i can handle these formats, give it your best downmix'. One way of
> doing this is by letting the application specify a bitmask of the
> soundformats it is willing to accept. This of course limits us to 32 (or
> 64 maybe) different channelformats, which might be a bad thing :/

Possibly the application supplies a bitmask of the channels it can
output, and then there's some code which can downmix or discard
various channels.

> I'm willing to give the channel-layout-code a try (assuming people
> think it's a wise thing to do)

I think it's wise - I currently have problems using MythTV to output
analogue 5.1 surround, as the avctx->channels variable is used to
indicate both the number of channels in the stream and the number of
channels to decode - Myth will set it to 6 to indicate it can decode 6
channels, but if an AC3 stream is stereo it will get set to 2, and if
the stream then changes to 5.1 it will be downmixed to stereo...

Ian




More information about the ffmpeg-devel mailing list