aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rv10.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-11-30 18:08:35 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-11-30 18:08:35 +0000
commit473c7582a5009805f1b830659d625800524c53e9 (patch)
treef666fab2bc6e08a6a620673bcb752c540d936a6f /libavcodec/rv10.c
parent43dc0bfd2ecb7e634255d74c13715b771e471892 (diff)
downloadffmpeg-473c7582a5009805f1b830659d625800524c53e9.tar.gz
rv20 sub_id == 0x20200002 support
Originally committed as revision 2546 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/rv10.c')
-rw-r--r--libavcodec/rv10.c40
1 files changed, 25 insertions, 15 deletions
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index ad0bb602f8..790f2366dc 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -339,18 +339,20 @@ static int rv10_decode_picture_header(MpegEncContext *s)
static int rv20_decode_picture_header(MpegEncContext *s)
{
- int pb_frame, seq, mb_pos;
- int i;
-
- if (get_bits(&s->gb, 1))
- s->pict_type = P_TYPE;
- else
- s->pict_type = I_TYPE;
-
- pb_frame = get_bits(&s->gb, 2);
-
- if (pb_frame){
- av_log(s->avctx, AV_LOG_ERROR, "pb frame not supported\n");
+ int seq, mb_pos, i;
+
+ i= get_bits(&s->gb, 2);
+ switch(i){
+ case 0: s->pict_type= I_TYPE; break;
+ case 2: s->pict_type= P_TYPE; break;
+ case 3: s->pict_type= B_TYPE; break;
+ default:
+ av_log(s->avctx, AV_LOG_ERROR, "unknown frame type\n");
+ return -1;
+ }
+
+ if (get_bits(&s->gb, 1)){
+ av_log(s->avctx, AV_LOG_ERROR, "unknown bit set\n");
return -1;
}
@@ -359,8 +361,11 @@ static int rv20_decode_picture_header(MpegEncContext *s)
av_log(s->avctx, AV_LOG_ERROR, "error, qscale:0\n");
return -1;
}
-
- seq= get_bits(&s->gb, 8);
+
+ if(s->avctx->sub_id == 0x20200002)
+ seq= get_bits(&s->gb, 16);
+ else
+ seq= get_bits(&s->gb, 8);
for(i=0; i<6; i++){
if(s->mb_width*s->mb_height < ff_mba_max[i]) break;
@@ -379,10 +384,15 @@ static int rv20_decode_picture_header(MpegEncContext *s)
// s->modified_quant=1;
if(s->avctx->debug & FF_DEBUG_PICT_INFO){
- av_log(s->avctx, AV_LOG_INFO, "num:%3d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
+ av_log(s->avctx, AV_LOG_INFO, "num:%5d x:%2d y:%2d type:%d qscale:%2d rnd:%d\n",
seq, s->mb_x, s->mb_y, s->pict_type, s->qscale, s->no_rounding);
}
+ if (s->pict_type == B_TYPE){
+ av_log(s->avctx, AV_LOG_ERROR, "b frame not supported\n");
+ return -1;
+ }
+
return s->mb_width*s->mb_height - mb_pos;
}