diff mpeg12.c @ 11531:31033caa5344 libavcodec

Change ref_index structure so it matches how its organized in h264. Also revert the related error concealment hotfix.
author michael
date Tue, 23 Mar 2010 02:17:04 +0000
parents 2029a714b794
children 8a4984c5cacc
line wrap: on
line diff
--- a/mpeg12.c	Mon Mar 22 21:12:31 2010 +0000
+++ b/mpeg12.c	Tue Mar 23 02:17:04 2010 +0000
@@ -1760,6 +1760,7 @@
         if(s->current_picture.motion_val[0] && !s->encoding){ //note motion_val is normally NULL unless we want to extract the MVs
             const int wrap = s->b8_stride;
             int xy = s->mb_x*2 + s->mb_y*2*wrap;
+            int b8_xy= 4*(s->mb_x + s->mb_y*s->mb_stride);
             int motion_x, motion_y, dir, i;
 
             for(i=0; i<2; i++){
@@ -1778,11 +1779,12 @@
                     s->current_picture.motion_val[dir][xy    ][1] = motion_y;
                     s->current_picture.motion_val[dir][xy + 1][0] = motion_x;
                     s->current_picture.motion_val[dir][xy + 1][1] = motion_y;
-                    s->current_picture.ref_index [dir][xy    ]=
-                    s->current_picture.ref_index [dir][xy + 1]= s->field_select[dir][i];
+                    s->current_picture.ref_index [dir][b8_xy    ]=
+                    s->current_picture.ref_index [dir][b8_xy + 1]= s->field_select[dir][i];
                     assert(s->field_select[dir][i]==0 || s->field_select[dir][i]==1);
                 }
                 xy += wrap;
+                b8_xy +=2;
             }
         }