changeset 10588:96b9deb2adb1 libavcodec

Inline mpeg_decode_extension, will simplify future changes.
author michael
date Sat, 28 Nov 2009 18:57:12 +0000
parents 62533f2e6f5a
children 02c7c0a5ad7d
files mpeg12.c
diffstat 1 files changed, 19 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Sat Nov 28 14:17:28 2009 +0000
+++ b/mpeg12.c	Sat Nov 28 18:57:12 2009 +0000
@@ -1579,35 +1579,6 @@
     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 @@
                 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,