[FFmpeg-devel] [RFC] LPCM 24 bits support

Michael Niedermayer michaelni
Wed May 7 21:19:14 CEST 2008


On Wed, May 07, 2008 at 08:00:14PM +0200, Lars T?uber wrote:
> On Sat, 3 May 2008 17:52:12 +0200 Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > > @@ -492,6 +498,18 @@
> > >              *samples++ = s->table[*src++];
> > >          }
> > >          break;
> > > +    case CODEC_ID_PCM_DVD:
> > > +        if(avctx->bits_per_sample != 20 && avctx->bits_per_sample != 24) {
> > > +            av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
> > > +            return -1;
> > > +        }
> > > +        n = buf_size / (avctx->channels * 2 * avctx->bits_per_sample / 8);
> > > +        while (n--) {
> > > +            for (c=0; c < 2*avctx->channels; c++)
> > > +                *samples++ = bytestream_get_be16(&src);
> > > +            src+= 
> > 
> > > +                  avctx->channels * (avctx->bits_per_sample-16) / 4;
> > 
> > that could be calculated outside of the loop.
> > 
> > and iam fine with the rest that i do maintain
> 
> Like this?
[...]
> @@ -492,6 +498,20 @@ static int pcm_decode_frame(AVCodecConte
>              *samples++ = s->table[*src++];
>          }
>          break;
> +    case CODEC_ID_PCM_DVD:
> +        if(avctx->bits_per_sample != 20 && avctx->bits_per_sample != 24) {
> +            av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
> +            return -1;
> +        } else {
> +            uint8_t jump = avctx->channels * (avctx->bits_per_sample-16) / 4;

int please


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080507/cb4f77b8/attachment.pgp>



More information about the ffmpeg-devel mailing list