diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-01-20 20:37:24 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-01-20 20:37:24 +0000 |
commit | f943e1383d7e2730c668ab28c2f1b181a944919e (patch) | |
tree | bed3d21871d86e4bf2173bb5e6689d31c550f4cb /libavcodec/mpeg12.c | |
parent | d0162d09d0ab0f5d6e7ed2834367cccefce69738 (diff) | |
download | ffmpeg-f943e1383d7e2730c668ab28c2f1b181a944919e.tar.gz |
trying to fix mb skip bug in mpeg1/2 if slices are not used
Originally committed as revision 1482 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index e7c59a3645..5ef4e06280 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -767,6 +767,8 @@ static int mpeg_decode_mb(MpegEncContext *s, dprintf("decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y); + assert(s->mb_skiped==0); + if (--s->mb_incr != 0) { /* skip mb */ s->mb_intra = 0; @@ -779,15 +781,18 @@ static int mpeg_decode_mb(MpegEncContext *s, s->mv[0][0][0] = s->mv[0][0][1] = 0; s->last_mv[0][0][0] = s->last_mv[0][0][1] = 0; s->last_mv[0][1][0] = s->last_mv[0][1][1] = 0; + s->mb_skiped = 1; } else { /* if B type, reuse previous vectors and directions */ s->mv[0][0][0] = s->last_mv[0][0][0]; s->mv[0][0][1] = s->last_mv[0][0][1]; s->mv[1][0][0] = s->last_mv[1][0][0]; s->mv[1][0][1] = s->last_mv[1][0][1]; + + if((s->mv[0][0][0]|s->mv[0][0][1]|s->mv[1][0][0]|s->mv[1][0][1])==0) + s->mb_skiped = 1; } - s->mb_skiped = 1; return 0; } @@ -1670,7 +1675,7 @@ static int mpeg_decode_slice(AVCodecContext *avctx, return DECODE_SLICE_FATAL_ERROR; if(s->avctx->debug&FF_DEBUG_PICT_INFO){ - printf("qp:%d fc:%d%d%d%d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n", + printf("qp:%d fc:%2d%2d%2d%2d %s %s %s %s dc:%d pstruct:%d fdct:%d cmv:%d qtype:%d ivlc:%d rff:%d %s\n", s->qscale, s->mpeg_f_code[0][0],s->mpeg_f_code[0][1],s->mpeg_f_code[1][0],s->mpeg_f_code[1][1], s->pict_type == I_TYPE ? "I" : (s->pict_type == P_TYPE ? "P" : (s->pict_type == B_TYPE ? "B" : "S")), s->progressive_sequence ? "pro" :"", s->alternate_scan ? "alt" :"", s->top_field_first ? "top" :"", |