diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-09-12 18:28:17 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-09-12 18:28:17 +0000 |
commit | b9d2bb5b2fa19c089c1fd6b75ec1525339d3d95c (patch) | |
tree | 78d5068f850ef617d96f35d76c62dc19f97cf85f /libavcodec | |
parent | 8409b8fe74e8e13d28dd84a144a856081647b275 (diff) | |
download | ffmpeg-b9d2bb5b2fa19c089c1fd6b75ec1525339d3d95c.tar.gz |
fixing interlaced mpeg4 decoding
Originally committed as revision 933 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h263.c | 20 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 1 |
2 files changed, 14 insertions, 7 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 18f867b86a..882f0ba294 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -2722,7 +2722,7 @@ int h263_decode_mb(MpegEncContext *s, 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 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, 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 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, 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 @@ int mpeg4_decode_picture_header(MpegEncContext * s) 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 @@ int mpeg4_decode_picture_header(MpegEncContext * s) }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 diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 7be76e0371..1693b484a1 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -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_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; |