[FFmpeg-devel] [PATCH]VDPAU patch for MPEG1/2 decoding, round 1

Carl Eugen Hoyos cehoyos
Mon Jan 5 17:06:22 CET 2009


Reimar D?ffinger <Reimar.Doeffinger <at> stud.uni-karlsruhe.de> writes:

> > +    if(avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU){
> 
> IMO CODEC_CAP_HWACCEL_VDPAU should not be used at all, checking codec_id
> seems like the sanest way to me currently.

Of course, changed locally.

> > +        avctx->idct_algo = FF_IDCT_SIMPLE;
> > +        if(avctx->sub_id == 1)
> > +            avctx->pix_fmt = PIX_FMT_VDPAU_MPEG1;
> > +        else
> > +            avctx->pix_fmt = PIX_FMT_VDPAU_MPEG2;
> > +    }else if(avctx->xvmc_acceleration)
> > +        avctx->pix_fmt = avctx->get_format(avctx,pixfmt_xvmc_mpg2_420);
> > +    else{
> > +        if(s->chroma_format <  2)
> > +            avctx->pix_fmt = PIX_FMT_YUV420P;
//avctx->get_format(avctx,pixfmt_yuv_420);
> > +        else if(s->chroma_format == 2)
> > +            avctx->pix_fmt = PIX_FMT_YUV422P;
//avctx->get_format(avctx,pixfmt_yuv_422);
> > +        else if(s->chroma_format >  2)
> > +            avctx->pix_fmt = PIX_FMT_YUV444P;
//avctx->get_format(avctx,pixfmt_yuv_444);
> > +    }
> > +}    
> 
> Also this should either be factored out before or after adding VDPAU
> support, but not in the same patch.

I will send a patch for the factorisation.

> Also the IDCT should be set at the same place and in the same way as for
> XVMC.

Wouldn't that complicate the patch?

> > Index: libavcodec/vdpau_render.h
> > ===================================================================
> > --- libavcodec/vdpau_render.h	(revision 16437)
> > +++ libavcodec/vdpau_render.h	(working copy)
> > @@ -70,6 +70,7 @@
> >  
> >      /** picture parameter information for all supported codecs */
> >      union VdpPictureInfo {
> > +        VdpPictureInfoMPEG1Or2 mpeg;
> 
> What is 10r2 supposed to mean?

It is how NVIDIA calls the Picture parameter information struct in the VDPAU
header /usr/include/vdpau/vdpau.h

Thanks for the comments, Carl Eugen





More information about the ffmpeg-devel mailing list