[FFmpeg-devel] [PATCH] make pcm_dvd use the full bit depth

Lars Täuber lars.taeuber
Tue Aug 12 20:58:48 CEST 2008


Hi Michael,


On Tue, 12 Aug 2008 20:31:04 +0200 Michael Niedermayer <michaelni at gmx.at> wrote:
> On Tue, Aug 12, 2008 at 07:26:35PM +0200, Lars T?uber wrote:
> >                  for (c=0; c < 2*avctx->channels; c++)
> > +                    dst_int32_t[c] = bytestream_get_be16(&src);
> > +                for (c=0; c < avctx->channels; c++) {
> > +                    *dst_int32_t++ = (*src   &0xf0) << 8;
> > +                    *dst_int32_t++ = (*src++ &0x0f) << 12;
> > +                }
> >              }
> 
> for (c=0; c < 2*avctx->channels; c=2) {
>     dst_int32_t[c  ] = (bytestream_get_be16(&src16)<<16) + ((*src   &0xf0)<<8);
>     dst_int32_t[c+1] = (bytestream_get_be16(&src16)<<16) + ((*src++ &0x0f)<<12);
> }

besides the fact that my patch didn't work you seem to misinterpret the interleaving of PCM_DVD
see: http://wiki.multimedia.cx/index.php?title=PCM#24-Bit_PCM

The least significant [4|8] bits are after a the 16-bit values of all channels.
Take a 6 channel pcm as example.

And I don't understand the meaning of ?&src16?. Or is this just a typo?

> for (c=0; c < 2*avctx->channels; c++) 
>     dst_int32_t[c] = (bytestream_get_be16(&src16)<<16) + (src[c]<<8);

Same here.

Lars




More information about the ffmpeg-devel mailing list