xvid qpel bug workaround
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 22 Oct 2002 18:55:20 +0000 (18:55 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 22 Oct 2002 18:55:20 +0000 (18:55 +0000)
Originally committed as revision 1063 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/avcodec.h
libavcodec/h263dec.c
libavcodec/mpegvideo.c

index 86d9b6f..b84c905 100644 (file)
@@ -426,6 +426,7 @@ typedef struct AVCodecContext {
 #define FF_BUG_UMP4             8
 #define FF_BUG_NO_PADDING       16
 #define FF_BUG_AC_VLC           32
+#define FF_BUG_QPEL_CHROMA      64
 //#define FF_BUG_FAKE_SCALABILITY 16 //autodetection should work 100%
         
     /**
index b8ea14c..653a2a8 100644 (file)
@@ -372,6 +372,10 @@ uint64_t time= rdtsc();
             s->workaround_bugs|= FF_BUG_UMP4;
             s->workaround_bugs|= FF_BUG_AC_VLC;
         }
+
+        if(s->divx_version){
+            s->workaround_bugs|= FF_BUG_QPEL_CHROMA;
+        }
 //printf("padding_bug_score: %d\n", s->padding_bug_score);
 #if 0
         if(s->divx_version==500)
index dff8fff..7fadcc2 100644 (file)
@@ -1384,7 +1384,7 @@ static inline void qpel_motion(MpegEncContext *s,
     if(field_based){
         mx= motion_x/2;
         my= motion_y>>1;
-    }else if(s->divx_version){
+    }else if(s->workaround_bugs&FF_BUG_QPEL_CHROMA){
         mx= (motion_x>>1)|(motion_x&1);
         my= (motion_y>>1)|(motion_y&1);
     }else{