changeset 1796:7186712b391e libavcodec

rv10/obmc fixes
author michael
date Mon, 09 Feb 2004 15:23:35 +0000
parents 920e6381e1fe
children fac680cf3008
files h263.c rv10.c
diffstat 2 files changed, 31 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Sun Feb 08 22:52:35 2004 +0000
+++ b/h263.c	Mon Feb 09 15:23:35 2004 +0000
@@ -3866,8 +3866,15 @@
             }
         }
 
+        /* decode each block */
+        for (i = 0; i < 6; i++) {
+            if (h263_decode_block(s, block[i], i, cbp&32) < 0)
+                return -1;
+            cbp+=cbp;
+        }
+
         if(s->obmc){
-            if(s->pict_type == P_TYPE && s->mb_x+1<s->mb_width)
+            if(s->pict_type == P_TYPE && s->mb_x+1<s->mb_width && s->mb_num_left != 1)
                 preview_obmc(s);
         }
     } else if(s->pict_type==B_TYPE) {
@@ -3957,6 +3964,13 @@
         }
           
         s->current_picture.mb_type[xy]= mb_type;
+
+        /* decode each block */
+        for (i = 0; i < 6; i++) {
+            if (h263_decode_block(s, block[i], i, cbp&32) < 0)
+                return -1;
+            cbp+=cbp;
+        }
     } else { /* I-Frame */
         do{
             cbpc = get_vlc2(&s->gb, intra_MCBPC_vlc.table, INTRA_MCBPC_VLC_BITS, 2);
@@ -3989,13 +4003,13 @@
         if (dquant) {
             h263_decode_dquant(s);
         }
-    }
-
-    /* decode each block */
-    for (i = 0; i < 6; i++) {
-        if (h263_decode_block(s, block[i], i, cbp&32) < 0)
-            return -1;
-        cbp+=cbp;
+
+        /* decode each block */
+        for (i = 0; i < 6; i++) {
+            if (h263_decode_block(s, block[i], i, cbp&32) < 0)
+                return -1;
+            cbp+=cbp;
+        }
     }
 end:
 
--- a/rv10.c	Sun Feb 08 22:52:35 2004 +0000
+++ b/rv10.c	Mon Feb 09 15:23:35 2004 +0000
@@ -449,6 +449,12 @@
         s->h263_long_vectors=0;
         s->low_delay=1;
         break;
+    case 0x10002000:
+        s->rv10_version= 3;
+        s->h263_long_vectors=1;
+        s->low_delay=1;
+        s->obmc=1;
+        break;
     case 0x10003000:
         s->rv10_version= 3;
         s->h263_long_vectors=1;
@@ -586,13 +592,14 @@
     s->block_wrap[5]= s->mb_width + 2;
     ff_init_block_index(s);
     /* decode each macroblock */
-    for(i=0;i<mb_count;i++) {
+
+    for(s->mb_num_left= mb_count; s->mb_num_left>0; s->mb_num_left--) {
         int ret;
         ff_update_block_index(s);
 #ifdef DEBUG
         printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
 #endif
-        
+
 	s->dsp.clear_blocks(s->block[0]);
         s->mv_dir = MV_DIR_FORWARD;
         s->mv_type = MV_TYPE_16X16;