fixing interlaced mpeg4 decoding

Originally committed as revision 933 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 23 years ago
parent 8409b8fe74
commit b9d2bb5b2f
  1. 20
      libavcodec/h263.c
  2. 1
      libavcodec/mpegvideo.c

@ -2722,7 +2722,7 @@ int h263_decode_mb(MpegEncContext *s,
return -1; return -1;
s->mv[0][i][0] = mx; s->mv[0][i][0] = mx;
s->mv[0][i][1] = my*2; s->mv[0][i][1] = my;
} }
}else{ }else{
PRINT_MB_TYPE("P"); PRINT_MB_TYPE("P");
@ -3194,7 +3194,9 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
goto not_coded; goto not_coded;
rl = &rl_intra; rl = &rl_intra;
rl_vlc = rl_intra.rl_vlc[0]; 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) if (dc_pred_dir == 0)
scan_table = ff_alternate_vertical_scan; /* left */ scan_table = ff_alternate_vertical_scan; /* left */
else else
@ -3211,7 +3213,12 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
return 0; return 0;
} }
rl = &rl_inter; 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){ if(s->mpeg_quant){
qmul=1; qmul=1;
qadd=0; qadd=0;
@ -4054,8 +4061,8 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
if(!s->progressive_sequence){ if(!s->progressive_sequence){
s->top_field_first= get_bits1(&s->gb); s->top_field_first= get_bits1(&s->gb);
s->alternate_scan= 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)){ if(s->pict_type == S_TYPE && (s->vol_sprite_usage==STATIC_SPRITE || s->vol_sprite_usage==GMC_SPRITE)){
@ -4090,7 +4097,8 @@ int mpeg4_decode_picture_header(MpegEncContext * s)
}else }else
s->b_code=1; 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->scalability){
if (s->shape!=RECT_SHAPE && s->pict_type!=I_TYPE) { if (s->shape!=RECT_SHAPE && s->pict_type!=I_TYPE) {
skip_bits1(&s->gb); // vop shape coding type skip_bits1(&s->gb); // vop shape coding type

@ -1480,7 +1480,6 @@ void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
motion_x = s->mv[0][0][0] + s->mv[0][1][0]; 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_y = s->mv[0][0][1] + s->mv[0][1][1];
motion_x = (motion_x>>1) | (motion_x&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 */ /* no update if 8X8 because it has been done during parsing */
s->motion_val[xy][0] = motion_x; s->motion_val[xy][0] = motion_x;

Loading…
Cancel
Save