summaryrefslogtreecommitdiff
path: root/libavcodec/dvdsubdec.c
diff options
context:
space:
mode:
authorsoftworkz <softworkz@hotmail.com>2022-05-28 14:52:18 +0000
committerMarton Balint <cus@passwd.hu>2022-06-08 22:27:50 +0200
commit830f49cb9dc3b3086d1cd3dab9b1dcebbde9d048 (patch)
tree7e0f166088927a361bb66f56c991b70a51151262 /libavcodec/dvdsubdec.c
parent22ab2a375dcac2c9247f099cfef71ca9236a72b1 (diff)
downloadffmpeg-830f49cb9dc3b3086d1cd3dab9b1dcebbde9d048.tar.gz
avcodec/dvdsubdec, dvbsubdec: remove bitmap dumping in DEBUG builds
It's been a regular annoyance and often undesired. There will be a subtitle filter which allows to dump individual subtitle bitmaps. Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavcodec/dvdsubdec.c')
-rw-r--r--libavcodec/dvdsubdec.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index b54073393e..97f366cc74 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -43,9 +43,6 @@ typedef struct DVDSubContext
int buf_size;
int forced_subs_only;
uint8_t used_color[256];
-#ifdef DEBUG
- int sub_id;
-#endif
} DVDSubContext;
static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t *rgba, int num_values)
@@ -499,38 +496,6 @@ static int find_smallest_bounding_rectangle(DVDSubContext *ctx, AVSubtitle *s)
return 1;
}
-#ifdef DEBUG
-#define ALPHA_MIX(A,BACK,FORE) (((255-(A)) * (BACK) + (A) * (FORE)) / 255)
-static void ppm_save(const char *filename, uint8_t *bitmap, int w, int h,
- uint32_t *rgba_palette)
-{
- int x, y, alpha;
- uint32_t v;
- int back[3] = {0, 255, 0}; /* green background */
- FILE *f;
-
- f = fopen(filename, "w");
- if (!f) {
- perror(filename);
- return;
- }
- fprintf(f, "P6\n"
- "%d %d\n"
- "%d\n",
- w, h, 255);
- for(y = 0; y < h; y++) {
- for(x = 0; x < w; x++) {
- v = rgba_palette[bitmap[y * w + x]];
- alpha = v >> 24;
- putc(ALPHA_MIX(alpha, back[0], (v >> 16) & 0xff), f);
- putc(ALPHA_MIX(alpha, back[1], (v >> 8) & 0xff), f);
- putc(ALPHA_MIX(alpha, back[2], (v >> 0) & 0xff), f);
- }
- }
- fclose(f);
-}
-#endif
-
static int append_to_cached_buf(AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
@@ -588,19 +553,6 @@ static int dvdsub_decode(AVCodecContext *avctx, AVSubtitle *sub,
if (ctx->forced_subs_only && !(sub->rects[0]->flags & AV_SUBTITLE_FLAG_FORCED))
goto no_subtitle;
-#if defined(DEBUG)
- {
- char ppm_name[32];
-
- snprintf(ppm_name, sizeof(ppm_name), "/tmp/%05d.ppm", ctx->sub_id++);
- ff_dlog(NULL, "start=%d ms end =%d ms\n",
- sub->start_display_time,
- sub->end_display_time);
- ppm_save(ppm_name, sub->rects[0]->data[0],
- sub->rects[0]->w, sub->rects[0]->h, (uint32_t*) sub->rects[0]->data[1]);
- }
-#endif
-
ctx->buf_size = 0;
*data_size = 1;
return buf_size;