diff options
author | Thierry Foucu <tfoucu@gmail.com> | 2011-07-20 20:33:23 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-07-21 09:33:34 -0700 |
commit | 0637e50579c77ce16373a45dc173aa449e3a8011 (patch) | |
tree | 556d58396e08faef18d9201e58ebc45eb387a0d3 | |
parent | 364d64275c66ac3b6dff699e80c167b6815e8f57 (diff) | |
download | ffmpeg-0637e50579c77ce16373a45dc173aa449e3a8011.tar.gz |
mpeg4: decode Level Profile for MPEG4 Part 2.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
-rw-r--r-- | libavcodec/mpeg4videodec.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index df0191dc9f..b48f44d998 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1523,6 +1523,22 @@ static int mpeg4_decode_gop_header(MpegEncContext * s, GetBitContext *gb){ return 0; } +static int mpeg4_decode_profile_level(MpegEncContext * s, GetBitContext *gb){ + int profile_and_level_indication; + + profile_and_level_indication = get_bits(gb, 8); + + s->avctx->profile = (profile_and_level_indication & 0xf0) >> 4; + s->avctx->level = (profile_and_level_indication & 0x0f); + + // for Simple profile, level 0 + if (s->avctx->profile == 0 && s->avctx->level == 8) { + s->avctx->level = 0; + } + + return 0; +} + static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){ int width, height, vo_ver_id; @@ -2177,6 +2193,9 @@ int ff_mpeg4_decode_picture_header(MpegEncContext * s, GetBitContext *gb) else if(startcode == GOP_STARTCODE){ mpeg4_decode_gop_header(s, gb); } + else if(startcode == VOS_STARTCODE){ + mpeg4_decode_profile_level(s, gb); + } else if(startcode == VOP_STARTCODE){ break; } |