comparison dvbsubdec.c @ 9999:c78fd9154378 libavcodec

Change av_log() calls surrounded by '#ifdef DEBUG' into dprintf macros.
author diego
date Thu, 30 Jul 2009 21:00:08 +0000
parents 50327500e065
children 8ac9bc10b485
comparison
equal deleted inserted replaced
9998:6b229807a182 9999:c78fd9154378
729 uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff}; 729 uint8_t map2to8[] = {0x00, 0x77, 0x88, 0xff};
730 uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 730 uint8_t map4to8[] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
731 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}; 731 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
732 uint8_t *map_table; 732 uint8_t *map_table;
733 733
734 #ifdef DEBUG 734 dprintf(avctx, "DVB pixel block size %d, %s field:\n", buf_size,
735 av_log(avctx, AV_LOG_INFO, "DVB pixel block size %d, %s field:\n", buf_size, 735 top_bottom ? "bottom" : "top");
736 top_bottom ? "bottom" : "top");
737 #endif
738 736
739 #ifdef DEBUG_PACKET_CONTENTS 737 #ifdef DEBUG_PACKET_CONTENTS
740 for (i = 0; i < buf_size; i++) { 738 for (i = 0; i < buf_size; i++) {
741 if (i % 16 == 0) 739 if (i % 16 == 0)
742 av_log(avctx, AV_LOG_INFO, "0x%08p: ", buf+i); 740 av_log(avctx, AV_LOG_INFO, "0x%08p: ", buf+i);
966 alpha = 0xff; 964 alpha = 0xff;
967 965
968 YUV_TO_RGB1_CCIR(cb, cr); 966 YUV_TO_RGB1_CCIR(cb, cr);
969 YUV_TO_RGB2_CCIR(r, g, b, y); 967 YUV_TO_RGB2_CCIR(r, g, b, y);
970 968
971 #ifdef DEBUG 969 dprintf(avctx, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
972 av_log(avctx, AV_LOG_INFO, "clut %d := (%d,%d,%d,%d)\n", entry_id, r, g, b, alpha);
973 #endif
974 970
975 if (depth & 0x80) 971 if (depth & 0x80)
976 clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha); 972 clut->clut4[entry_id] = RGBA(r,g,b,255 - alpha);
977 if (depth & 0x40) 973 if (depth & 0x40)
978 clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha); 974 clut->clut16[entry_id] = RGBA(r,g,b,255 - alpha);
1044 region->bgcolor = (((*buf++) >> 4) & 15); 1040 region->bgcolor = (((*buf++) >> 4) & 15);
1045 else 1041 else
1046 region->bgcolor = (((*buf++) >> 2) & 3); 1042 region->bgcolor = (((*buf++) >> 2) & 3);
1047 } 1043 }
1048 1044
1049 #ifdef DEBUG 1045 dprintf(avctx, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
1050 av_log(avctx, AV_LOG_INFO, "Region %d, (%dx%d)\n", region_id, region->width, region->height);
1051 #endif
1052 1046
1053 if (fill) { 1047 if (fill) {
1054 memset(region->pbuf, region->bgcolor, region->buf_size); 1048 memset(region->pbuf, region->bgcolor, region->buf_size);
1055 #ifdef DEBUG 1049 dprintf(avctx, "Fill region (%d)\n", region->bgcolor);
1056 av_log(avctx, AV_LOG_INFO, "Fill region (%d)\n", region->bgcolor);
1057 #endif
1058 } 1050 }
1059 1051
1060 delete_region_display_list(ctx, region); 1052 delete_region_display_list(ctx, region);
1061 1053
1062 while (buf + 5 < buf_end) { 1054 while (buf + 5 < buf_end) {
1113 return; 1105 return;
1114 1106
1115 ctx->time_out = *buf++; 1107 ctx->time_out = *buf++;
1116 page_state = ((*buf++) >> 2) & 3; 1108 page_state = ((*buf++) >> 2) & 3;
1117 1109
1118 #ifdef DEBUG 1110 dprintf(avctx, "Page time out %ds, state %d\n", ctx->time_out, page_state);
1119 av_log(avctx, AV_LOG_INFO, "Page time out %ds, state %d\n", ctx->time_out, page_state);
1120 #endif
1121 1111
1122 if (page_state == 2) { 1112 if (page_state == 2) {
1123 delete_state(ctx); 1113 delete_state(ctx);
1124 } 1114 }
1125 1115
1153 1143
1154 display->next = ctx->display_list; 1144 display->next = ctx->display_list;
1155 ctx->display_list = display; 1145 ctx->display_list = display;
1156 ctx->display_list_size++; 1146 ctx->display_list_size++;
1157 1147
1158 #ifdef DEBUG 1148 dprintf(avctx, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
1159 av_log(avctx, AV_LOG_INFO, "Region %d, (%d,%d)\n", region_id, display->x_pos, display->y_pos);
1160 #endif
1161 } 1149 }
1162 1150
1163 while (tmp_display_list) { 1151 while (tmp_display_list) {
1164 display = tmp_display_list; 1152 display = tmp_display_list;
1165 1153
1403 break; 1391 break;
1404 case DVBSUB_DISPLAY_SEGMENT: 1392 case DVBSUB_DISPLAY_SEGMENT:
1405 *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub); 1393 *data_size = dvbsub_display_end_segment(avctx, p, segment_length, sub);
1406 break; 1394 break;
1407 default: 1395 default:
1408 #ifdef DEBUG 1396 dprintf(avctx, "Subtitling segment type 0x%x, page id %d, length %d\n",
1409 av_log(avctx, AV_LOG_INFO, "Subtitling segment type 0x%x, page id %d, length %d\n",
1410 segment_type, page_id, segment_length); 1397 segment_type, page_id, segment_length);
1411 #endif
1412 break; 1398 break;
1413 } 1399 }
1414 } 1400 }
1415 1401
1416 p += segment_length; 1402 p += segment_length;
1417 } 1403 }
1418 1404
1419 if (p != p_end) { 1405 if (p != p_end) {
1420 #ifdef DEBUG 1406 dprintf(avctx, "Junk at end of packet\n");
1421 av_log(avctx, AV_LOG_INFO, "Junk at end of packet\n");
1422 #endif
1423 return -1; 1407 return -1;
1424 } 1408 }
1425 1409
1426 return buf_size; 1410 return buf_size;
1427 } 1411 }