From 3116cb14d1aa9bafbb49af6820e3b04989872faf Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 30 Apr 2004 18:56:33 +0000 Subject: [PATCH] AMV bug workaround Originally committed as revision 3099 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/avcodec.h | 1 + libavcodec/h263.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index e6eb11f955..678ae5f7ae 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -841,6 +841,7 @@ typedef struct AVCodecContext { #define FF_BUG_XVID_ILACE 4 #define FF_BUG_UMP4 8 #define FF_BUG_NO_PADDING 16 +#define FF_BUG_AMV 32 #define FF_BUG_AC_VLC 0 ///< will be removed, libavcodec can now handle these non compliant files by default #define FF_BUG_QPEL_CHROMA 64 #define FF_BUG_STD_QPEL 128 diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 21185dc586..c1113f5bd2 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -3221,6 +3221,9 @@ static inline int get_amv(MpegEncContext *s, int n){ int x, y, mb_v, sum, dx, dy, shift; int len = 1 << (s->f_code + 4); const int a= s->sprite_warping_accuracy; + + if(s->workaround_bugs & FF_BUG_AMV) + len >>= s->quarter_sample; if(s->real_sprite_warping_points==1){ if(s->divx_version==500 && s->divx_build==413) -- GitLab