]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvbsubdec.c
Remove unnecessary header inclusion directives.
[ffmpeg] / libavcodec / dvbsubdec.c
index ac6bd1393f59859d25f72cd862bb1e3b4d5cf1d8..54c74b5b41a19369445b48b6d52ec5930ce16f8c 100644 (file)
@@ -731,10 +731,8 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
                          0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
     uint8_t *map_table;
 
-#ifdef DEBUG
-    av_log(avctx, AV_LOG_INFO, "DVB pixel block size %d, %s field:\n", buf_size,
-                top_bottom ? "bottom" : "top");
-#endif
+    dprintf(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
+            top_bottom ? "bottom" : "top");
 
 #ifdef DEBUG_PACKET_CONTENTS
     for (i = 0; i < buf_size; i++) {
@@ -968,9 +966,7 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
         YUV_TO_RGB1_CCIR(cb, cr);
         YUV_TO_RGB2_CCIR(r, g, b, y);
 
-#ifdef DEBUG
-        av_log(avctx, AV_LOG_INFO, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
-#endif
+        dprintf(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
 
         if (depth & 0x80)
             clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
@@ -1046,15 +1042,11 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
             region->bgcolor = (((*buf++) >> 2) & 3);
     }
 
-#ifdef DEBUG
-    av_log(avctx, AV_LOG_INFO, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
-#endif
+    dprintf(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
 
     if (fill) {
         memset(region->pbuf, region->bgcolor, region->buf_size);
-#ifdef DEBUG
-        av_log(avctx, AV_LOG_INFO, "Fill region (%d)\n", region->bgcolor);
-#endif
+        dprintf(avctx, "Fill region (%d)\n", region->bgcolor);
     }
 
     delete_region_display_list(ctx, region);
@@ -1115,9 +1107,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
     ctx->time_out = *buf++;
     page_state = ((*buf++) >> 2) & 3;
 
-#ifdef DEBUG
-    av_log(avctx, AV_LOG_INFO, "Page time out %ds, state %d\n", ctx->time_out, page_state);
-#endif
+    dprintf(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
 
     if (page_state == 2) {
         delete_state(ctx);
@@ -1155,9 +1145,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
         ctx->display_list = display;
         ctx->display_list_size++;
 
-#ifdef DEBUG
-        av_log(avctx, AV_LOG_INFO, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
-#endif
+        dprintf(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
     }
 
     while (tmp_display_list) {
@@ -1326,7 +1314,7 @@ static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
             break;
         }
 
-        rect->pict.data[1] = av_malloc((1 << region->depth) * sizeof(uint32_t));
+        rect->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
         memcpy(rect->pict.data[1], clut_table, (1 << region->depth) * sizeof(uint32_t));
 
         rect->pict.data[0] = av_malloc(region->buf_size);
@@ -1405,10 +1393,8 @@ static int dvbsub_decode(AVCodecContext *avctx,
                 *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
                 break;
             default:
-#ifdef DEBUG
-                av_log(avctx, AV_LOG_INFO, "Subtitling segment type 0x%x, page id %d, length %d\n",
+                dprintf(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
                         segment_type, page_id, segment_length);
-#endif
                 break;
             }
         }
@@ -1417,9 +1403,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
     }
 
     if (p != p_end) {
-#ifdef DEBUG
-        av_log(avctx, AV_LOG_INFO, "Junk at end of packet\n");
-#endif
+        dprintf(avctx, "Junk at end of packet\n");
         return -1;
     }
 
@@ -1429,7 +1413,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
 
 AVCodec dvbsub_decoder = {
     "dvbsub",
-    CODEC_TYPE_SUBTITLE,
+    AVMEDIA_TYPE_SUBTITLE,
     CODEC_ID_DVB_SUBTITLE,
     sizeof(DVBSubContext),
     dvbsub_init_decoder,