[FFmpeg-devel] [PATCH] mpeg12: reduce hwaccel-related code duplication.
Michael Niedermayer
michaelni at gmx.at
Sun Feb 24 18:06:08 CET 2013
On Sun, Feb 24, 2013 at 05:22:16PM +0100, Reimar Döffinger wrote:
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
> libavcodec/mpeg12.c | 17 ++++++-----------
> 1 file changed, 6 insertions(+), 11 deletions(-)
>
> 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 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx)
> } 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)
We already had a bug in h264 with get_pixels() due to it being
mis used for other things
so i think this should be solved differently or the function renamed
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The educated differ from the uneducated as much as the living from the
dead. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130224/558803d9/attachment.asc>
More information about the ffmpeg-devel
mailing list