From 848de6c1923820f1de49ed7875d6c8877d0c321c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 5 Jun 2015 22:48:33 +0100 Subject: [PATCH] mpeg4video: Signal unsupported GMC with more than one warp point --- libavcodec/avcodec.h | 1 + libavcodec/mpeg4videodec.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a36b675fba..880284d5bd 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2612,6 +2612,7 @@ typedef struct AVCodecContext { #define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. #define FF_BUG_TRUNCATED 16384 #define FF_BUG_IEDGE 32768 +#define FF_BUG_GMC_UNSUPPORTED (1<<30) /** * strictly follow the standard (MPEG-4, ...). diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 055afabc7e..fa208660c8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2662,6 +2662,9 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) if (ctx->divx_version >= 0) s->workaround_bugs |= FF_BUG_HPEL_CHROMA; + + if (ctx->num_sprite_warping_points > 1) + s->workaround_bugs |= FF_BUG_GMC_UNSUPPORTED; } if (s->workaround_bugs & FF_BUG_STD_QPEL) { @@ -2686,6 +2689,7 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx) s->workaround_bugs, ctx->lavc_build, ctx->xvid_build, ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : ""); + avctx->workaround_bugs = s->workaround_bugs; if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 && s->codec_id == AV_CODEC_ID_MPEG4 && avctx->idct_algo == FF_IDCT_AUTO) { -- 2.20.1