Commit 8b44de14 authored by Diego Biurrun's avatar Diego Biurrun

Change av_log() calls surrounded by '#ifdef DEBUG' into dprintf macros.

Originally committed as revision 19550 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 7881793d
...@@ -250,9 +250,7 @@ static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNEL ...@@ -250,9 +250,7 @@ static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNEL
exp_strategy[0][ch] = EXP_NEW; exp_strategy[0][ch] = EXP_NEW;
for(i=1;i<NB_BLOCKS;i++) { for(i=1;i<NB_BLOCKS;i++) {
exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2); exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2);
#ifdef DEBUG dprintf(NULL, "exp_diff=%d\n", exp_diff);
av_log(NULL, AV_LOG_DEBUG, "exp_diff=%d\n", exp_diff);
#endif
if (exp_diff > EXP_DIFF_THRESHOLD) if (exp_diff > EXP_DIFF_THRESHOLD)
exp_strategy[i][ch] = EXP_NEW; exp_strategy[i][ch] = EXP_NEW;
else else
......
...@@ -55,10 +55,8 @@ static int dvbsub_parse(AVCodecParserContext *s, ...@@ -55,10 +55,8 @@ static int dvbsub_parse(AVCodecParserContext *s,
uint8_t *p, *p_end; uint8_t *p, *p_end;
int len, buf_pos = 0; int len, buf_pos = 0;
#ifdef DEBUG dprintf(avctx, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
av_log(avctx, AV_LOG_INFO, "DVB parse packet pts=%"PRIx64", lpts=%"PRIx64", cpts=%"PRIx64":\n",
s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]); s->pts, s->last_pts, s->cur_frame_pts[s->cur_frame_start_index]);
#endif
#ifdef DEBUG_PACKET_CONTENTS #ifdef DEBUG_PACKET_CONTENTS
int i; int i;
...@@ -84,19 +82,15 @@ static int dvbsub_parse(AVCodecParserContext *s, ...@@ -84,19 +82,15 @@ static int dvbsub_parse(AVCodecParserContext *s,
{ {
if (pc->packet_index != pc->packet_start) if (pc->packet_index != pc->packet_start)
{ {
#ifdef DEBUG dprintf(avctx, "Discarding %d bytes\n",
av_log(avctx, AV_LOG_INFO, "Discarding %d bytes\n", pc->packet_index - pc->packet_start);
pc->packet_index - pc->packet_start);
#endif
} }
pc->packet_start = 0; pc->packet_start = 0;
pc->packet_index = 0; pc->packet_index = 0;
if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) { if (buf_size < 2 || buf[0] != 0x20 || buf[1] != 0x00) {
#ifdef DEBUG dprintf(avctx, "Bad packet header\n");
av_log(avctx, AV_LOG_INFO, "Bad packet header\n");
#endif
return -1; return -1;
} }
...@@ -153,9 +147,7 @@ static int dvbsub_parse(AVCodecParserContext *s, ...@@ -153,9 +147,7 @@ static int dvbsub_parse(AVCodecParserContext *s,
} else if (*p == 0xff) { } else if (*p == 0xff) {
if (p + 1 < p_end) if (p + 1 < p_end)
{ {
#ifdef DEBUG dprintf(avctx, "Junk at end of packet\n");
av_log(avctx, AV_LOG_INFO, "Junk at end of packet\n");
#endif
} }
pc->packet_index = p - pc->packet_buf; pc->packet_index = p - pc->packet_buf;
pc->in_packet = 0; pc->in_packet = 0;
......
...@@ -731,10 +731,8 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis ...@@ -731,10 +731,8 @@ static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDis
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
uint8_t *map_table; uint8_t *map_table;
#ifdef DEBUG dprintf(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
av_log(avctx, AV_LOG_INFO, "DVB pixel block size %d, %s field:\n", buf_size, top_bottom ? "bottom" : "top");
top_bottom ? "bottom" : "top");
#endif
#ifdef DEBUG_PACKET_CONTENTS #ifdef DEBUG_PACKET_CONTENTS
for (i = 0; i < buf_size; i++) { for (i = 0; i < buf_size; i++) {
...@@ -968,9 +966,7 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx, ...@@ -968,9 +966,7 @@ static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
YUV_TO_RGB1_CCIR(cb, cr); YUV_TO_RGB1_CCIR(cb, cr);
YUV_TO_RGB2_CCIR(r, g, b, y); YUV_TO_RGB2_CCIR(r, g, b, y);
#ifdef DEBUG dprintf(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
av_log(avctx, AV_LOG_INFO, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
#endif
if (depth & 0x80) if (depth & 0x80)
clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha); clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
...@@ -1046,15 +1042,11 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx, ...@@ -1046,15 +1042,11 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
region->bgcolor = (((*buf++) >> 2) & 3); region->bgcolor = (((*buf++) >> 2) & 3);
} }
#ifdef DEBUG dprintf(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
av_log(avctx, AV_LOG_INFO, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
#endif
if (fill) { if (fill) {
memset(region->pbuf, region->bgcolor, region->buf_size); memset(region->pbuf, region->bgcolor, region->buf_size);
#ifdef DEBUG dprintf(avctx, "Fill region (%d)\n", region->bgcolor);
av_log(avctx, AV_LOG_INFO, "Fill region (%d)\n", region->bgcolor);
#endif
} }
delete_region_display_list(ctx, region); delete_region_display_list(ctx, region);
...@@ -1115,9 +1107,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx, ...@@ -1115,9 +1107,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
ctx->time_out = *buf++; ctx->time_out = *buf++;
page_state = ((*buf++) >> 2) & 3; page_state = ((*buf++) >> 2) & 3;
#ifdef DEBUG dprintf(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
av_log(avctx, AV_LOG_INFO, "Page time out %ds, state %d\n", ctx->time_out, page_state);
#endif
if (page_state == 2) { if (page_state == 2) {
delete_state(ctx); delete_state(ctx);
...@@ -1155,9 +1145,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx, ...@@ -1155,9 +1145,7 @@ static void dvbsub_parse_page_segment(AVCodecContext *avctx,
ctx->display_list = display; ctx->display_list = display;
ctx->display_list_size++; ctx->display_list_size++;
#ifdef DEBUG dprintf(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
av_log(avctx, AV_LOG_INFO, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
#endif
} }
while (tmp_display_list) { while (tmp_display_list) {
...@@ -1405,10 +1393,8 @@ static int dvbsub_decode(AVCodecContext *avctx, ...@@ -1405,10 +1393,8 @@ static int dvbsub_decode(AVCodecContext *avctx,
*data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub); *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
break; break;
default: default:
#ifdef DEBUG dprintf(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
av_log(avctx, AV_LOG_INFO, "Subtitling segment type 0x%x, page id %d, length %d\n",
segment_type, page_id, segment_length); segment_type, page_id, segment_length);
#endif
break; break;
} }
} }
...@@ -1417,9 +1403,7 @@ static int dvbsub_decode(AVCodecContext *avctx, ...@@ -1417,9 +1403,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
} }
if (p != p_end) { if (p != p_end) {
#ifdef DEBUG dprintf(avctx, "Junk at end of packet\n");
av_log(avctx, AV_LOG_INFO, "Junk at end of packet\n");
#endif
return -1; return -1;
} }
......
...@@ -194,19 +194,15 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, ...@@ -194,19 +194,15 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
while ((cmd_pos + 2 + offset_size) < buf_size) { while ((cmd_pos + 2 + offset_size) < buf_size) {
date = AV_RB16(buf + cmd_pos); date = AV_RB16(buf + cmd_pos);
next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2); next_cmd_pos = READ_OFFSET(buf + cmd_pos + 2);
#ifdef DEBUG dprintf(NULL, "cmd_pos=0x%04x next=0x%04x date=%d\n",
av_log(NULL, AV_LOG_INFO, "cmd_pos=0x%04x next=0x%04x date=%d\n", cmd_pos, next_cmd_pos, date);
cmd_pos, next_cmd_pos, date);
#endif
pos = cmd_pos + 2 + offset_size; pos = cmd_pos + 2 + offset_size;
offset1 = -1; offset1 = -1;
offset2 = -1; offset2 = -1;
x1 = y1 = x2 = y2 = 0; x1 = y1 = x2 = y2 = 0;
while (pos < buf_size) { while (pos < buf_size) {
cmd = buf[pos++]; cmd = buf[pos++];
#ifdef DEBUG dprintf(NULL, "cmd=%02x\n", cmd);
av_log(NULL, AV_LOG_INFO, "cmd=%02x\n", cmd);
#endif
switch(cmd) { switch(cmd) {
case 0x00: case 0x00:
/* menu subpicture */ /* menu subpicture */
...@@ -239,9 +235,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, ...@@ -239,9 +235,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
alpha[1] = buf[pos + 1] >> 4; alpha[1] = buf[pos + 1] >> 4;
alpha[0] = buf[pos + 1] & 0x0f; alpha[0] = buf[pos + 1] & 0x0f;
pos += 2; pos += 2;
#ifdef DEBUG dprintf(NULL, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
av_log(NULL, AV_LOG_INFO, "alpha=%x%x%x%x\n", alpha[0],alpha[1],alpha[2],alpha[3]);
#endif
break; break;
case 0x05: case 0x05:
case 0x85: case 0x85:
...@@ -253,10 +247,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, ...@@ -253,10 +247,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
y2 = ((buf[pos + 4] & 0x0f) << 8) | buf[pos + 5]; y2 = ((buf[pos + 4] & 0x0f) << 8) | buf[pos + 5];
if (cmd & 0x80) if (cmd & 0x80)
is_8bit = 1; is_8bit = 1;
#ifdef DEBUG dprintf(NULL, "x1=%d x2=%d y1=%d y2=%d\n", x1, x2, y1, y2);
av_log(NULL, AV_LOG_INFO, "x1=%d x2=%d y1=%d y2=%d\n",
x1, x2, y1, y2);
#endif
pos += 6; pos += 6;
break; break;
case 0x06: case 0x06:
...@@ -264,9 +255,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, ...@@ -264,9 +255,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
goto fail; goto fail;
offset1 = AV_RB16(buf + pos); offset1 = AV_RB16(buf + pos);
offset2 = AV_RB16(buf + pos + 2); offset2 = AV_RB16(buf + pos + 2);
#ifdef DEBUG dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
av_log(NULL, AV_LOG_INFO, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
#endif
pos += 4; pos += 4;
break; break;
case 0x86: case 0x86:
...@@ -274,9 +263,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, ...@@ -274,9 +263,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
goto fail; goto fail;
offset1 = AV_RB32(buf + pos); offset1 = AV_RB32(buf + pos);
offset2 = AV_RB32(buf + pos + 4); offset2 = AV_RB32(buf + pos + 4);
#ifdef DEBUG dprintf(NULL, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
av_log(NULL, AV_LOG_INFO, "offset1=0x%04x offset2=0x%04x\n", offset1, offset2);
#endif
pos += 8; pos += 8;
break; break;
...@@ -299,9 +286,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, ...@@ -299,9 +286,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
case 0xff: case 0xff:
goto the_end; goto the_end;
default: default:
#ifdef DEBUG dprintf(NULL, "unrecognised subpicture command 0x%x\n", cmd);
av_log(NULL, AV_LOG_INFO, "unrecognised subpicture command 0x%x\n", cmd);
#endif
goto the_end; goto the_end;
} }
} }
...@@ -495,9 +480,9 @@ static int dvdsub_decode(AVCodecContext *avctx, ...@@ -495,9 +480,9 @@ static int dvdsub_decode(AVCodecContext *avctx,
goto no_subtitle; goto no_subtitle;
#if defined(DEBUG) #if defined(DEBUG)
av_log(NULL, AV_LOG_INFO, "start=%d ms end =%d ms\n", dprintf(NULL, "start=%d ms end =%d ms\n",
sub->start_display_time, sub->start_display_time,
sub->end_display_time); sub->end_display_time);
ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0], ppm_save("/tmp/a.ppm", sub->rects[0]->pict.data[0],
sub->rects[0]->w, sub->rects[0]->h, sub->rects[0]->pict.data[1]); sub->rects[0]->w, sub->rects[0]->h, sub->rects[0]->pict.data[1]);
#endif #endif
......
...@@ -552,10 +552,8 @@ static int h261_decode_frame(AVCodecContext *avctx, ...@@ -552,10 +552,8 @@ static int h261_decode_frame(AVCodecContext *avctx,
int ret; int ret;
AVFrame *pict = data; AVFrame *pict = data;
#ifdef DEBUG dprintf(avctx, "*****frame %d size=%d\n", avctx->frame_number, buf_size);
av_log(avctx, AV_LOG_DEBUG, "*****frame %d size=%d\n", avctx->frame_number, buf_size); dprintf(avctx, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
av_log(avctx, AV_LOG_DEBUG, "bytes=%x %x %x %x\n", buf[0], buf[1], buf[2], buf[3]);
#endif
s->flags= avctx->flags; s->flags= avctx->flags;
s->flags2= avctx->flags2; s->flags2= avctx->flags2;
......
...@@ -4586,9 +4586,7 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred) ...@@ -4586,9 +4586,7 @@ static int h263p_decode_umotion(MpegEncContext * s, int pred)
code >>= 1; code >>= 1;
code = (sign) ? (pred - code) : (pred + code); code = (sign) ? (pred - code) : (pred + code);
#ifdef DEBUG dprintf(s->avctx,"H.263+ UMV Motion = %d\n", code);
av_log( s->avctx, AV_LOG_DEBUG,"H.263+ UMV Motion = %d\n", code);
#endif
return code; return code;
} }
......
...@@ -1232,9 +1232,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end) ...@@ -1232,9 +1232,7 @@ static int find_marker(const uint8_t **pbuf_ptr, const uint8_t *buf_end)
} }
val = -1; val = -1;
found: found:
#ifdef DEBUG dprintf(NULL, "find_marker skipped %d bytes\n", skipped);
av_log(NULL, AV_LOG_VERBOSE, "find_marker skipped %d bytes\n", skipped);
#endif
*pbuf_ptr = buf_ptr; *pbuf_ptr = buf_ptr;
return val; return val;
} }
......
...@@ -126,10 +126,8 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) ...@@ -126,10 +126,8 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx)
s->sblimit = ff_mpa_sblimit_table[table]; s->sblimit = ff_mpa_sblimit_table[table];
s->alloc_table = ff_mpa_alloc_tables[table]; s->alloc_table = ff_mpa_alloc_tables[table];
#ifdef DEBUG dprintf(avctx, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n",
av_log(avctx, AV_LOG_DEBUG, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n", bitrate, freq, s->frame_size, table, s->frame_frac_incr);
bitrate, freq, s->frame_size, table, s->frame_frac_incr);
#endif
for(i=0;i<s->nb_channels;i++) for(i=0;i<s->nb_channels;i++)
s->samples_offset[i] = 0; s->samples_offset[i] = 0;
......
...@@ -430,13 +430,11 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -430,13 +430,11 @@ static int decode_frame(AVCodecContext *avctx,
goto fail; goto fail;
tag32 = bytestream_get_be32(&s->bytestream); tag32 = bytestream_get_be32(&s->bytestream);
tag = bswap_32(tag32); tag = bswap_32(tag32);
#ifdef DEBUG dprintf(avctx, "png: tag=%c%c%c%c length=%u\n",
av_log(avctx, AV_LOG_DEBUG, "png: tag=%c%c%c%c length=%u\n", (tag & 0xff),
(tag & 0xff), ((tag >> 8) & 0xff),
((tag >> 8) & 0xff), ((tag >> 16) & 0xff),
((tag >> 16) & 0xff), ((tag >> 24) & 0xff), length);
((tag >> 24) & 0xff), length);
#endif
switch(tag) { switch(tag) {
case MKTAG('I', 'H', 'D', 'R'): case MKTAG('I', 'H', 'D', 'R'):
if (length != 13) if (length != 13)
...@@ -454,11 +452,9 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -454,11 +452,9 @@ static int decode_frame(AVCodecContext *avctx,
s->interlace_type = *s->bytestream++; s->interlace_type = *s->bytestream++;
crc = bytestream_get_be32(&s->bytestream); crc = bytestream_get_be32(&s->bytestream);
s->state |= PNG_IHDR; s->state |= PNG_IHDR;
#ifdef DEBUG dprintf(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n",
av_log(avctx, AV_LOG_DEBUG, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n", s->width, s->height, s->bit_depth, s->color_type,
s->width, s->height, s->bit_depth, s->color_type, s->compression_type, s->filter_type, s->interlace_type);
s->compression_type, s->filter_type, s->interlace_type);
#endif
break; break;
case MKTAG('I', 'D', 'A', 'T'): case MKTAG('I', 'D', 'A', 'T'):
if (!(s->state & PNG_IHDR)) if (!(s->state & PNG_IHDR))
...@@ -518,10 +514,8 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -518,10 +514,8 @@ static int decode_frame(AVCodecContext *avctx,
s->width); s->width);
s->crow_size = s->pass_row_size + 1; s->crow_size = s->pass_row_size + 1;
} }
#ifdef DEBUG dprintf(avctx, "row_size=%d crow_size =%d\n",
av_log(avctx, AV_LOG_DEBUG, "row_size=%d crow_size =%d\n", s->row_size, s->crow_size);
s->row_size, s->crow_size);
#endif
s->image_buf = p->data[0]; s->image_buf = p->data[0];
s->image_linesize = p->linesize[0]; s->image_linesize = p->linesize[0];
/* copy the palette if needed */ /* copy the palette if needed */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment