changeset 2330:380b62dce6ec libavcodec

simplify
author michael
date Thu, 28 Oct 2004 17:34:14 +0000
parents bae9c6de090b
children 5690ce009ebd
files h261.c
diffstat 1 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/h261.c	Thu Oct 28 17:21:34 2004 +0000
+++ b/h261.c	Thu Oct 28 17:34:14 2004 +0000
@@ -596,7 +596,7 @@
 
 static int h261_decode_mb(H261Context *h){
     MpegEncContext * const s = &h->s;
-    int i, cbp, xy, old_mtype;
+    int i, cbp, xy;
 
     cbp = 63;
     // Read mba
@@ -634,7 +634,6 @@
     s->dsp.clear_blocks(s->block[0]);
 
     // Read mtype
-    old_mtype = h->mtype;
     h->mtype = get_vlc2(&s->gb, h261_mtype_vlc.table, H261_MTYPE_VLC_BITS, 2);
     h->mtype = h261_mtype_map[h->mtype];
 
@@ -654,7 +653,7 @@
         // 2) evaluating MVD for macroblocks in which MBA does not represent a difference of 1;
         // 3) MTYPE of the previous macroblock was not MC.
         if ( ( h->current_mba == 1 ) || ( h->current_mba == 12 ) || ( h->current_mba == 23 ) ||
-             ( h->mba_diff != 1) || ( !IS_16X16 ( old_mtype ) ))
+             ( h->mba_diff != 1))
         {
             h->current_mv_x = 0;
             h->current_mv_y = 0;
@@ -662,6 +661,9 @@
 
         h->current_mv_x= decode_mv_component(&s->gb, h->current_mv_x);
         h->current_mv_y= decode_mv_component(&s->gb, h->current_mv_y);
+    }else{
+        h->current_mv_x = 0;
+        h->current_mv_y = 0;
     }
 
     // Read cbp
@@ -678,14 +680,8 @@
     s->mv_dir = MV_DIR_FORWARD;
     s->mv_type = MV_TYPE_16X16;
     s->current_picture.mb_type[xy]= MB_TYPE_16x16 | MB_TYPE_L0;
-    if(IS_16X16 ( h->mtype )){
-        s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
-        s->mv[0][0][1] = h->current_mv_y * 2;
-    }
-    else{
-        h->current_mv_x = s->mv[0][0][0] = 0;
-        h->current_mv_x = s->mv[0][0][1] = 0;
-    }
+    s->mv[0][0][0] = h->current_mv_x * 2;//gets divided by 2 in motion compensation
+    s->mv[0][0][1] = h->current_mv_y * 2;
 
 intra:
     /* decode each block */