]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpeg12.c
cosmetics: make all references to AC-3 capitalized and hyphenated
[ffmpeg] / libavcodec / mpeg12.c
index adeb2fa651846ef1576f4d4edb57762f437247a2..bb59f5455f63a12443767f8a719a926b0dae0bd5 100644 (file)
@@ -80,16 +80,22 @@ static const enum PixelFormat pixfmt_xvmc_mpg2_420[] = {
 
 uint8_t ff_mpeg12_static_rl_table_store[2][2][2*MAX_RUN + MAX_LEVEL + 3];
 
+
+#define INIT_2D_VLC_RL(rl, static_size)\
+{\
+    static RL_VLC_ELEM rl_vlc_table[static_size];\
+    INIT_VLC_STATIC(&rl.vlc, TEX_VLC_BITS, rl.n + 2,\
+             &rl.table_vlc[0][1], 4, 2,\
+             &rl.table_vlc[0][0], 4, 2, static_size);\
+\
+    rl.rl_vlc[0]= rl_vlc_table;\
+    init_2d_vlc_rl(&rl);\
+}
+
 static void init_2d_vlc_rl(RLTable *rl)
 {
     int i;
 
-    init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2,
-             &rl->table_vlc[0][1], 4, 2,
-             &rl->table_vlc[0][0], 4, 2, 1);
-
-        rl->rl_vlc[0]= av_mallocz_static(rl->vlc.table_size*sizeof(RL_VLC_ELEM));
-
     for(i=0; i<rl->vlc.table_size; i++){
         int code= rl->vlc.table[i][0];
         int len = rl->vlc.table[i][1];
@@ -178,8 +184,8 @@ static void init_vlcs(void)
         init_rl(&ff_rl_mpeg1, ff_mpeg12_static_rl_table_store[0]);
         init_rl(&ff_rl_mpeg2, ff_mpeg12_static_rl_table_store[1]);
 
-        init_2d_vlc_rl(&ff_rl_mpeg1);
-        init_2d_vlc_rl(&ff_rl_mpeg2);
+        INIT_2D_VLC_RL(ff_rl_mpeg1, 680);
+        INIT_2D_VLC_RL(ff_rl_mpeg2, 674);
     }
 }
 
@@ -2150,7 +2156,7 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
     int drop_frame_flag;
     int time_code_hours, time_code_minutes;
     int time_code_seconds, time_code_pictures;
-    int broken_link;
+    int closed_gop, broken_link;
 
     init_get_bits(&s->gb, buf, buf_size*8);
 
@@ -2162,15 +2168,16 @@ static void mpeg_decode_gop(AVCodecContext *avctx,
     time_code_seconds = get_bits(&s->gb,6);
     time_code_pictures = get_bits(&s->gb,6);
 
+    closed_gop  = get_bits1(&s->gb);
     /*broken_link indicate that after editing the
       reference frames of the first B-Frames after GOP I-Frame
       are missing (open gop)*/
     broken_link = get_bits1(&s->gb);
 
     if(s->avctx->debug & FF_DEBUG_PICT_INFO)
-        av_log(s->avctx, AV_LOG_DEBUG, "GOP (%2d:%02d:%02d.[%02d]) broken_link=%d\n",
+        av_log(s->avctx, AV_LOG_DEBUG, "GOP (%2d:%02d:%02d.[%02d]) closed_gop=%d broken_link=%d\n",
             time_code_hours, time_code_minutes, time_code_seconds,
-            time_code_pictures, broken_link);
+            time_code_pictures, closed_gop, broken_link);
 }
 /**
  * finds the end of the current frame in the bitstream.
@@ -2438,7 +2445,7 @@ AVCodec mpeg1video_decoder = {
     mpeg_decode_frame,
     CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
     .flush= ff_mpeg_flush,
-    .long_name= "MPEG-1 video",
+    .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
 };
 
 AVCodec mpeg2video_decoder = {
@@ -2452,7 +2459,7 @@ AVCodec mpeg2video_decoder = {
     mpeg_decode_frame,
     CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
     .flush= ff_mpeg_flush,
-    .long_name= "MPEG-2 video",
+    .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"),
 };
 
 //legacy decoder
@@ -2467,7 +2474,7 @@ AVCodec mpegvideo_decoder = {
     mpeg_decode_frame,
     CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY,
     .flush= ff_mpeg_flush,
-    .long_name= "MPEG-1 video",
+    .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"),
 };
 
 #ifdef HAVE_XVMC
@@ -2501,7 +2508,7 @@ AVCodec mpeg_xvmc_decoder = {
     mpeg_decode_frame,
     CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED| CODEC_CAP_HWACCEL | CODEC_CAP_DELAY,
     .flush= ff_mpeg_flush,
-    .long_name = "MPEG-1 video XvMC (X-Video Motion Compensation)",
+    .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video XvMC (X-Video Motion Compensation)"),
 };
 
 #endif