diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2004-12-13 11:41:59 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-12-13 11:41:59 +0000 |
commit | 74679f5c1ced93085602d1974f25fb8dfe7d760c (patch) | |
tree | 545f5812c0b230c82b4a00a7545ae89c7758d149 /libavcodec/rv10.c | |
parent | f48c0551caea82150111eb10829117ae13f4d87a (diff) | |
download | ffmpeg-74679f5c1ced93085602d1974f25fb8dfe7d760c.tar.gz |
another try at fixing rv20 ...
Originally committed as revision 3749 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r-- | libavcodec/rv10.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 6b332e4a19..4a6bf0f72e 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -429,28 +429,21 @@ static int rv20_decode_picture_header(MpegEncContext *s) } if(s->avctx->has_b_frames){ - int f1=9; - int f2=9; - int f3=9; + int f=9; + int v= s->avctx->extradata_size >= 4 ? ((uint8_t*)s->avctx->extradata)[1] : 0; if (get_bits(&s->gb, 1)){ av_log(s->avctx, AV_LOG_ERROR, "unknown bit3 set\n"); // return -1; } seq= get_bits(&s->gb, 14)<<1; - - if(s->avctx->extradata_size >= 4 && ((uint8_t*)s->avctx->extradata)[1]&1){ - f1= get_bits(&s->gb, 1); - } - if(s->avctx->extradata_size >= 4 && ((uint8_t*)s->avctx->extradata)[1]&2){ - f2= get_bits(&s->gb, 1); - } - if(s->avctx->extradata_size >= 4 && ((uint8_t*)s->avctx->extradata)[1]&4){ - f3= get_bits(&s->gb, 2); + + if(v>1){ + f= get_bits(&s->gb, av_log2(v-1)+1); } if(s->avctx->debug & FF_DEBUG_PICT_INFO){ - av_log(s->avctx, AV_LOG_DEBUG, "F %d %d %d\n", f1,f2,f3); + av_log(s->avctx, AV_LOG_DEBUG, "F %d\n", f); } mb_pos= get_bits(&s->gb, av_log2(s->mb_num-1)+1); |