diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-12-21 20:06:59 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-12-21 20:06:59 +0000 |
commit | 8135f8df524706b9760c699a7bc13417acd8a516 (patch) | |
tree | b39edd17d609b211f512415c8c626a79bd0bdf58 /libavcodec/rv10.c | |
parent | bed1707c9c274831173902542aaef1f8428e6331 (diff) |
rv20 / h263 b frame fix
Originally committed as revision 2628 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r-- | libavcodec/rv10.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 6e591bbde0..01623c730a 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -378,12 +378,17 @@ static int rv20_decode_picture_header(MpegEncContext *s) if(s->avctx->has_b_frames){ if (get_bits(&s->gb, 1)){ - av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n"); +// av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n"); // return -1; } seq= get_bits(&s->gb, 15); - }else + mb_pos= get_bits(&s->gb, av_log2(s->mb_num-1)+1); + s->mb_x= mb_pos % s->mb_width; + s->mb_y= mb_pos / s->mb_width; + }else{ seq= get_bits(&s->gb, 8)*128; + mb_pos= ff_h263_decode_mba(s); + } //printf("%d\n", seq); seq |= s->time &~0x7FFF; if(seq - s->time > 0x4000) seq -= 0x8000; @@ -404,7 +409,6 @@ static int rv20_decode_picture_header(MpegEncContext *s) } // printf("%d %d %d %d %d\n", seq, (int)s->time, (int)s->last_non_b_time, s->pp_time, s->pb_time); - mb_pos= ff_h263_decode_mba(s); s->no_rounding= get_bits1(&s->gb); s->f_code = 1; @@ -648,6 +652,10 @@ static int rv10_decode_frame(AVCodecContext *avctx, if( rv10_decode_packet(avctx, buf, buf_size) < 0 ) return -1; } + + if(s->pict_type == B_TYPE){ //FIXME remove after cleaning mottion_val indexing + memset(s->current_picture.motion_val[0], 0, sizeof(int16_t)*2*(s->mb_width*2+2)*(s->mb_height*2+2)); + } if(s->mb_y>=s->mb_height){ MPV_frame_end(s); |