[FFmpeg-devel] [PATCH] mpeg12: reduce hwaccel-related code duplication.

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Feb 24 18:19:08 CET 2013


Hi Michael!

Michael Niedermayer <michaelni <at> gmx.at> writes:

> > diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
> > index 2ef3360..85cf068 100644
> > --- a/libavcodec/mpeg12.c
> > +++ b/libavcodec/mpeg12.c
> > @@ -1245,6 +1245,12 @@
> >          } else if (!avctx->xvmc_acceleration) {
> >              avctx->xvmc_acceleration = 2;
> >          }
> > +        avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
> > +        // until then pix_fmt may be changed right after codec init
> > +        if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT ||
> > +            avctx->hwaccel || uses_vdpau(avctx))
> > +            if (avctx->idct_algo == FF_IDCT_AUTO)
> > +                avctx->idct_algo = FF_IDCT_SIMPLE;
> >          return res;
> >      } else if(s->chroma_format == 2)
> >          return AV_PIX_FMT_YUV422P;
> 
> with that mpeg_get_pixelformat would do more than just getting the
> pixel format (which is suggested by its name)

Just in case you did not realize (as I did not realize 
originally):
The patches arrived out-of-order, the important - and 
first - patch is "mpeg12: Fix non-hwaccel VDPAU decode."

Carl Eugen



More information about the ffmpeg-devel mailing list