diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2009-11-28 18:57:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2009-11-28 18:57:12 +0000 |
commit | 1206f1d630e17c332390f62a5ebbe254ebfe1dd4 (patch) | |
tree | 1ccd24ddaf303b94320272fb9678ccdf073d7420 /libavcodec/mpeg12.c | |
parent | 191ad11e91b216627cde3aff6c0d475e477bd301 (diff) | |
download | ffmpeg-1206f1d630e17c332390f62a5ebbe254ebfe1dd4.tar.gz |
Inline mpeg_decode_extension, will simplify future changes.
Originally committed as revision 20641 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r-- | libavcodec/mpeg12.c | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 99d5093b22..aa075da605 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1579,35 +1579,6 @@ static void mpeg_decode_picture_coding_extension(Mpeg1Context *s1) dprintf(s->avctx, "progressive_frame=%d\n", s->progressive_frame); } -static void mpeg_decode_extension(AVCodecContext *avctx, - const uint8_t *buf, int buf_size) -{ - Mpeg1Context *s1 = avctx->priv_data; - MpegEncContext *s = &s1->mpeg_enc_ctx; - int ext_type; - - init_get_bits(&s->gb, buf, buf_size*8); - - ext_type = get_bits(&s->gb, 4); - switch(ext_type) { - case 0x1: - mpeg_decode_sequence_extension(s1); - break; - case 0x2: - mpeg_decode_sequence_display_extension(s1); - break; - case 0x3: - mpeg_decode_quant_matrix_extension(s); - break; - case 0x7: - mpeg_decode_picture_display_extension(s1); - break; - case 0x8: - mpeg_decode_picture_coding_extension(s1); - break; - } -} - static void exchange_uv(MpegEncContext *s){ DCTELEM (*tmp)[64]; @@ -2339,8 +2310,25 @@ static int decode_chunks(AVCodecContext *avctx, s2->pict_type=0; break; case EXT_START_CODE: - mpeg_decode_extension(avctx, - buf_ptr, input_size); + init_get_bits(&s2->gb, buf_ptr, input_size*8); + + switch(get_bits(&s2->gb, 4)) { + case 0x1: + mpeg_decode_sequence_extension(s); + break; + case 0x2: + mpeg_decode_sequence_display_extension(s); + break; + case 0x3: + mpeg_decode_quant_matrix_extension(s2); + break; + case 0x7: + mpeg_decode_picture_display_extension(s); + break; + case 0x8: + mpeg_decode_picture_coding_extension(s); + break; + } break; case USER_START_CODE: mpeg_decode_user_data(avctx, |