Commit df96f22d authored by Diego Biurrun's avatar Diego Biurrun

Replace custom debug output functions by av_dlog().

parent 752207e3
......@@ -46,14 +46,6 @@
#define PALETTE_COUNT 256
/* debugging support */
#define DEBUG_INTERPLAY 0
#if DEBUG_INTERPLAY
#define debug_interplay(x,...) av_log(NULL, AV_LOG_DEBUG, x, __VA_ARGS__)
#else
static inline void debug_interplay(const char *format, ...) { }
#endif
typedef struct IpvideoContext {
AVCodecContext *avctx;
......@@ -141,7 +133,7 @@ static int ipvideo_decode_block_opcode_0x2(IpvideoContext *s)
y = 8 + ((B - 56) / 29);
}
debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
av_dlog(NULL, " motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
return copy_from(s, &s->second_last_frame, x, y);
}
......@@ -169,7 +161,7 @@ static int ipvideo_decode_block_opcode_0x3(IpvideoContext *s)
y = -( 8 + ((B - 56) / 29));
}
debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
av_dlog(NULL, " motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
return copy_from(s, &s->current_frame, x, y);
}
......@@ -192,7 +184,7 @@ static int ipvideo_decode_block_opcode_0x4(IpvideoContext *s)
x = -8 + BL;
y = -8 + BH;
debug_interplay (" motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
av_dlog(NULL, " motion byte = %d, (x, y) = (%d, %d)\n", B, x, y);
return copy_from(s, &s->last_frame, x, y);
}
......@@ -207,7 +199,7 @@ static int ipvideo_decode_block_opcode_0x5(IpvideoContext *s)
x = *s->stream_ptr++;
y = *s->stream_ptr++;
debug_interplay (" motion bytes = %d, %d\n", x, y);
av_dlog(NULL, " motion bytes = %d, %d\n", x, y);
return copy_from(s, &s->last_frame, x, y);
}
......@@ -588,7 +580,7 @@ static int ipvideo_decode_block_opcode_0x6_16(IpvideoContext *s)
x = *s->stream_ptr++;
y = *s->stream_ptr++;
debug_interplay (" motion bytes = %d, %d\n", x, y);
av_dlog(NULL, " motion bytes = %d, %d\n", x, y);
return copy_from(s, &s->second_last_frame, x, y);
}
......@@ -965,7 +957,7 @@ static void ipvideo_decode_opcodes(IpvideoContext *s)
static int frame = 0;
GetBitContext gb;
debug_interplay("------------------ frame %d\n", frame);
av_dlog(NULL, "------------------ frame %d\n", frame);
frame++;
if (!s->is_16bpp) {
......@@ -991,8 +983,8 @@ static void ipvideo_decode_opcodes(IpvideoContext *s)
for (x = 0; x < s->avctx->width; x += 8) {
opcode = get_bits(&gb, 4);
debug_interplay(" block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
x, y, opcode, s->stream_ptr);
av_dlog(NULL, " block @ (%3d, %3d): encoding 0x%X, data ptr @ %p\n",
x, y, opcode, s->stream_ptr);
if (!s->is_16bpp) {
s->pixel_ptr = s->current_frame.data[0] + x
......
This diff is collapsed.
......@@ -90,14 +90,6 @@
#define CPLZ_TAG MKBETAG('C', 'P', 'L', 'Z')
#define VPTZ_TAG MKBETAG('V', 'P', 'T', 'Z')
#define VQA_DEBUG 0
#if VQA_DEBUG
#define vqa_debug printf
#else
static inline void vqa_debug(const char *format, ...) { }
#endif
typedef struct VqaContext {
AVCodecContext *avctx;
......@@ -212,7 +204,7 @@ static void decode_format80(const unsigned char *src, int src_size,
while (src_index < src_size) {
vqa_debug(" opcode %02X: ", src[src_index]);
av_dlog(NULL, " opcode %02X: ", src[src_index]);
/* 0x80 means that frame is finished */
if (src[src_index] == 0x80)
......@@ -231,7 +223,7 @@ static void decode_format80(const unsigned char *src, int src_size,
src_index += 2;
src_pos = AV_RL16(&src[src_index]);
src_index += 2;
vqa_debug("(1) copy %X bytes from absolute pos %X\n", count, src_pos);
av_dlog(NULL, "(1) copy %X bytes from absolute pos %X\n", count, src_pos);
CHECK_COUNT();
for (i = 0; i < count; i++)
dest[dest_index + i] = dest[src_pos + i];
......@@ -243,7 +235,7 @@ static void decode_format80(const unsigned char *src, int src_size,
count = AV_RL16(&src[src_index]);
src_index += 2;
color = src[src_index++];
vqa_debug("(2) set %X bytes to %02X\n", count, color);
av_dlog(NULL, "(2) set %X bytes to %02X\n", count, color);
CHECK_COUNT();
memset(&dest[dest_index], color, count);
dest_index += count;
......@@ -253,7 +245,7 @@ static void decode_format80(const unsigned char *src, int src_size,
count = (src[src_index++] & 0x3F) + 3;
src_pos = AV_RL16(&src[src_index]);
src_index += 2;
vqa_debug("(3) copy %X bytes from absolute pos %X\n", count, src_pos);
av_dlog(NULL, "(3) copy %X bytes from absolute pos %X\n", count, src_pos);
CHECK_COUNT();
for (i = 0; i < count; i++)
dest[dest_index + i] = dest[src_pos + i];
......@@ -262,7 +254,7 @@ static void decode_format80(const unsigned char *src, int src_size,
} else if (src[src_index] > 0x80) {
count = src[src_index++] & 0x3F;
vqa_debug("(4) copy %X bytes from source to dest\n", count);
av_dlog(NULL, "(4) copy %X bytes from source to dest\n", count);
CHECK_COUNT();
memcpy(&dest[dest_index], &src[src_index], count);
src_index += count;
......@@ -273,7 +265,7 @@ static void decode_format80(const unsigned char *src, int src_size,
count = ((src[src_index] & 0x70) >> 4) + 3;
src_pos = AV_RB16(&src[src_index]) & 0x0FFF;
src_index += 2;
vqa_debug("(5) copy %X bytes from relpos %X\n", count, src_pos);
av_dlog(NULL, "(5) copy %X bytes from relpos %X\n", count, src_pos);
CHECK_COUNT();
for (i = 0; i < count; i++)
dest[dest_index + i] = dest[dest_index - src_pos + i];
......
This diff is collapsed.
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