diff motion_est.c @ 1938:e2501e6e7ff7 libavcodec

unify table indexing (motion_val,dc_val,ac_val,coded_block changed) minor +-1 bugfix
author michael
date Fri, 16 Apr 2004 01:01:45 +0000
parents 129236143f2e
children a3c60fa850dc
line wrap: on
line diff
--- a/motion_est.c	Wed Apr 14 13:13:31 2004 +0000
+++ b/motion_est.c	Fri Apr 16 01:01:45 2004 +0000
@@ -733,7 +733,7 @@
         s->current_picture.motion_val[0][mot_xy+1][0]= mx;
         s->current_picture.motion_val[0][mot_xy+1][1]= my;
 
-        mot_xy += s->block_wrap[0];
+        mot_xy += s->b8_stride;
         s->current_picture.motion_val[0][mot_xy  ][0]= mx;
         s->current_picture.motion_val[0][mot_xy  ][1]= my;
         s->current_picture.motion_val[0][mot_xy+1][0]= mx;
@@ -780,7 +780,7 @@
         int pred_x4, pred_y4;
         int dmin4;
         static const int off[4]= {2, 1, 1, -1};
-        const int mot_stride = s->block_wrap[0];
+        const int mot_stride = s->b8_stride;
         const int mot_xy = s->block_index[block];
         const int block_x= (block&1);
         const int block_y= (block>>1);
@@ -1102,7 +1102,7 @@
     case ME_X1:
     case ME_EPZS:
        {
-            const int mot_stride = s->block_wrap[0];
+            const int mot_stride = s->b8_stride;
             const int mot_xy = s->block_index[0];
 
             P_LEFT[0]       = s->current_picture.motion_val[0][mot_xy - 1][0];
@@ -1252,7 +1252,7 @@
                 int mean;
                 
                 if(s->out_format == FMT_H263){
-                    mean= (s->dc_val[i][mb_x + (mb_y+1)*(s->mb_width+2)] + 4)>>3; //FIXME not exact but simple ;)
+                    mean= (s->dc_val[i][mb_x + mb_y*s->b8_stride] + 4)>>3; //FIXME not exact but simple ;)
                 }else{
                     mean= (s->last_dc[i] + 4)>>3;
                 }
@@ -1809,11 +1809,11 @@
     
 //printf("%d no:%d %d//\n", clip, noclip, f_code);
     if(s->flags&CODEC_FLAG_4MV){
-        const int wrap= 2+ s->mb_width*2;
+        const int wrap= s->b8_stride;
 
         /* clip / convert to intra 8x8 type MVs */
         for(y=0; y<s->mb_height; y++){
-            int xy= (y*2 + 1)*wrap + 1;
+            int xy= y*2*wrap;
             int i= y*s->mb_stride;
             int x;