]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
simplify ff_h263_round_chroma()
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 11 Jul 2007 22:05:25 +0000 (22:05 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 11 Jul 2007 22:05:25 +0000 (22:05 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9602 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/mpegvideo.h

index b1c2f9373186c16c87c26fbd95303b2895bc1651..fde3aaeacd619681156948cca7ed78ca47e71241 100644 (file)
@@ -765,14 +765,9 @@ static inline int get_bits_diff(MpegEncContext *s){
 static inline int ff_h263_round_chroma(int x){
     static const uint8_t h263_chroma_roundtab[16] = {
     //  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
-        0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
+        0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1,
     };
-    if (x >= 0)
-        return  (h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1));
-    else {
-        x = -x;
-        return -(h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1));
-    }
+    return h263_chroma_roundtab[x & 0xf] + (x >> 3);
 }
 
 /* motion_est.c */