diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-12-05 23:21:39 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-12-05 23:21:39 +0000 |
commit | 423962dc0105530852c9a25c478efbb8de9bcdf4 (patch) | |
tree | 27159615668eb8da9b5b8082c59afcccd6e91d40 /libavcodec/rv10.c | |
parent | 20b02bc62801e34f2d561c2f77154604b52e6358 (diff) | |
download | ffmpeg-423962dc0105530852c9a25c478efbb8de9bcdf4.tar.gz |
next try at fixing rv20 decoding
Originally committed as revision 3728 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r-- | libavcodec/rv10.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index efba219a6a..663d8adb3d 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -350,6 +350,13 @@ static int rv20_decode_picture_header(MpegEncContext *s) } av_log(s->avctx, AV_LOG_DEBUG, "\n"); #endif +#if 0 + for(i=0; i<s->avctx->extradata_size; i++){ + av_log(s->avctx, AV_LOG_DEBUG, "%2X ", ((uint8_t*)s->avctx->extradata)[i]); + if(i%4==3) av_log(s->avctx, AV_LOG_DEBUG, " "); + } + av_log(s->avctx, AV_LOG_DEBUG, "\n"); +#endif if(s->avctx->sub_id == 0x30202002 || s->avctx->sub_id == 0x30203002){ if (get_bits(&s->gb, 3)){ @@ -396,18 +403,21 @@ static int rv20_decode_picture_header(MpegEncContext *s) // av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n"); // return -1; } - seq= get_bits(&s->gb, 15); - if (s->avctx->sub_id == 0x20201002 && 0 && get_bits(&s->gb, 1)){ - av_log(s->avctx, AV_LOG_ERROR, "unknown bit4 set\n"); -// return -1; + seq= get_bits(&s->gb, 14)<<1; + + if(s->avctx->extradata_size >= 4 && ((uint8_t*)s->avctx->extradata)[1]&1){ + get_bits(&s->gb, 1); } - if(s->avctx->sub_id == 0x20201002){ - mb_pos= ff_h263_decode_mba(s); - }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; + if(s->avctx->extradata_size >= 4 && ((uint8_t*)s->avctx->extradata)[1]&2){ + get_bits(&s->gb, 1); + } + if(s->avctx->extradata_size >= 4 && ((uint8_t*)s->avctx->extradata)[1]&4){ + get_bits(&s->gb, 2); } + + 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); @@ -508,7 +518,11 @@ static int rv10_decode_init(AVCodecContext *avctx) default: av_log(s->avctx, AV_LOG_ERROR, "unknown header %X\n", avctx->sub_id); } -//av_log(avctx, AV_LOG_DEBUG, "ver:%X\n", avctx->sub_id); + + if(avctx->debug & FF_DEBUG_PICT_INFO){ + av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", avctx->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1); + } + if (MPV_common_init(s) < 0) return -1; |