changeset 661:a0901e38c564 libavcodec

fixing interlaced mpeg4 decoding
author michaelni
date Thu, 12 Sep 2002 18:28:17 +0000
parents b8e268337a1d
children 5a158f0d1981
files h263.c mpegvideo.c
diffstat 2 files changed, 14 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/h263.c	Thu Sep 12 15:22:14 2002 +0000
+++ b/h263.c	Thu Sep 12 18:28:17 2002 +0000
@@ -2722,7 +2722,7 @@
                         return -1;
 
                     s->mv[0][i][0] = mx;
-                    s->mv[0][i][1] = my*2;
+                    s->mv[0][i][1] = my;
                 }
             }else{
                 PRINT_MB_TYPE("P");
@@ -3194,7 +3194,9 @@
             goto not_coded;
         rl = &rl_intra;
         rl_vlc = rl_intra.rl_vlc[0];
-        if (s->ac_pred) {
+        if(s->alternate_scan)
+            scan_table = ff_alternate_vertical_scan; /* left */
+        else if (s->ac_pred) {
             if (dc_pred_dir == 0) 
                 scan_table = ff_alternate_vertical_scan; /* left */
             else
@@ -3211,7 +3213,12 @@
             return 0;
         }
         rl = &rl_inter;
-        scan_table = zigzag_direct;
+   
+        if(s->alternate_scan)
+            scan_table = ff_alternate_vertical_scan; /* left */
+        else
+            scan_table = zigzag_direct;
+
         if(s->mpeg_quant){
             qmul=1;
             qadd=0;
@@ -4054,8 +4061,8 @@
          if(!s->progressive_sequence){
              s->top_field_first= get_bits1(&s->gb);
              s->alternate_scan= get_bits1(&s->gb);
-//printf("top:%d alt:%d\n", s->top_field_first, s->alternate_scan);
-         }
+         }else
+             s->alternate_scan= 0;
      }
 
      if(s->pict_type == S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
@@ -4090,7 +4097,8 @@
          }else
              s->b_code=1;
 
-//printf("quant:%d fcode:%d bcode:%d type:%d size:%d\n", s->qscale, s->f_code, s->b_code, s->pict_type, s->gb.size);
+//printf("qpuant:%d fcode:%d bcode:%d type:%d size:%d pro:%d alt:%d\n", 
+//    s->qscale, s->f_code, s->b_code, s->pict_type, s->gb.size,s->progressive_sequence, s->alternate_scan);
          if(!s->scalability){
              if (s->shape!=RECT_SHAPE && s->pict_type!=I_TYPE) {
                  skip_bits1(&s->gb); // vop shape coding type
--- a/mpegvideo.c	Thu Sep 12 15:22:14 2002 +0000
+++ b/mpegvideo.c	Thu Sep 12 18:28:17 2002 +0000
@@ -1480,7 +1480,6 @@
                 motion_x = s->mv[0][0][0] + s->mv[0][1][0];
                 motion_y = s->mv[0][0][1] + s->mv[0][1][1];
                 motion_x = (motion_x>>1) | (motion_x&1);
-                motion_y = (motion_y>>1) | (motion_y&1);
             }
             /* no update if 8X8 because it has been done during parsing */
             s->motion_val[xy][0] = motion_x;