changeset 450:0d990115524d libavcodec

bugfix
author michaelni
date Sat, 01 Jun 2002 23:18:44 +0000
parents 7b2f23b5dcdd
children 1228bf19299b
files rv10.c
diffstat 1 files changed, 25 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rv10.c	Sat Jun 01 14:34:29 2002 +0000
+++ b/rv10.c	Sat Jun 01 23:18:44 2002 +0000
@@ -430,9 +430,27 @@
     s->rv10_first_dc_coded[0] = 0;
     s->rv10_first_dc_coded[1] = 0;
     s->rv10_first_dc_coded[2] = 0;
-    
+
+    s->block_wrap[0]=
+    s->block_wrap[1]=
+    s->block_wrap[2]=
+    s->block_wrap[3]= s->mb_width*2 + 2;
+    s->block_wrap[4]=
+    s->block_wrap[5]= s->mb_width + 2;
+    s->block_index[0]= s->block_wrap[0]*(s->mb_y*2 + 1) - 1 + s->mb_x*2;
+    s->block_index[1]= s->block_wrap[0]*(s->mb_y*2 + 1)     + s->mb_x*2;
+    s->block_index[2]= s->block_wrap[0]*(s->mb_y*2 + 2) - 1 + s->mb_x*2;
+    s->block_index[3]= s->block_wrap[0]*(s->mb_y*2 + 2)     + s->mb_x*2;
+    s->block_index[4]= s->block_wrap[4]*(s->mb_y + 1)                    + s->block_wrap[0]*(s->mb_height*2 + 2) + s->mb_x;
+    s->block_index[5]= s->block_wrap[4]*(s->mb_y + 1 + s->mb_height + 2) + s->block_wrap[0]*(s->mb_height*2 + 2) + s->mb_x;
     /* decode each macroblock */
     for(i=0;i<mb_count;i++) {
+        s->block_index[0]+=2;
+        s->block_index[1]+=2;
+        s->block_index[2]+=2;
+        s->block_index[3]+=2;
+        s->block_index[4]++;
+        s->block_index[5]++;
 #ifdef DEBUG
         printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y);
 #endif
@@ -450,6 +468,12 @@
         if (++s->mb_x == s->mb_width) {
             s->mb_x = 0;
             s->mb_y++;
+            s->block_index[0]= s->block_wrap[0]*(s->mb_y*2 + 1) - 1;
+            s->block_index[1]= s->block_wrap[0]*(s->mb_y*2 + 1);
+            s->block_index[2]= s->block_wrap[0]*(s->mb_y*2 + 2) - 1;
+            s->block_index[3]= s->block_wrap[0]*(s->mb_y*2 + 2);
+            s->block_index[4]= s->block_wrap[4]*(s->mb_y + 1)                    + s->block_wrap[0]*(s->mb_height*2 + 2);
+            s->block_index[5]= s->block_wrap[4]*(s->mb_y + 1 + s->mb_height + 2) + s->block_wrap[0]*(s->mb_height*2 + 2);
         }
     }