summaryrefslogtreecommitdiff
path: root/libavcodec/gifdec.c
diff options
context:
space:
mode:
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>2011-01-25 00:16:36 +0000
committerMans Rullgard <mans@mansr.com>2011-01-25 00:25:50 +0000
commit73a0b19ba39a4aca79a768feeacd83307a62836e (patch)
treee77ab8517aa7c507e435d73e8f92e6dcd7a2ef7a /libavcodec/gifdec.c
parenta6d1bd05c906fc7ad34fae1029a45ec3cbcc4fcc (diff)
Don't check for DEBUG before using dprintf.
The dprintf macro is no-op when DEBUG is unset, so there is no need to put it conditional to DEBUG. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/gifdec.c')
-rw-r--r--libavcodec/gifdec.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 4cc80017e8..9820a063fc 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -76,9 +76,8 @@ static int gif_read_image(GifState *s)
is_interleaved = flags & 0x40;
has_local_palette = flags & 0x80;
bits_per_pixel = (flags & 0x07) + 1;
-#ifdef DEBUG
+
dprintf(s->avctx, "gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height);
-#endif
if (has_local_palette) {
bytestream_get_buffer(&s->bytestream, s->local_palette, 3 * (1 << bits_per_pixel));
@@ -163,9 +162,9 @@ static int gif_read_extension(GifState *s)
/* extension */
ext_code = bytestream_get_byte(&s->bytestream);
ext_len = bytestream_get_byte(&s->bytestream);
-#ifdef DEBUG
+
dprintf(s->avctx, "gif: ext_code=0x%x len=%d\n", ext_code, ext_len);
-#endif
+
switch(ext_code) {
case 0xf9:
if (ext_len != 4)
@@ -179,11 +178,11 @@ static int gif_read_extension(GifState *s)
else
s->transparent_color_index = -1;
s->gce_disposal = (gce_flags >> 2) & 0x7;
-#ifdef DEBUG
+
dprintf(s->avctx, "gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n",
gce_flags, s->gce_delay,
s->transparent_color_index, s->gce_disposal);
-#endif
+
ext_len = bytestream_get_byte(&s->bytestream);
break;
}
@@ -194,9 +193,8 @@ static int gif_read_extension(GifState *s)
for (i = 0; i < ext_len; i++)
bytestream_get_byte(&s->bytestream);
ext_len = bytestream_get_byte(&s->bytestream);
-#ifdef DEBUG
+
dprintf(s->avctx, "gif: ext_len1=%d\n", ext_len);
-#endif
}
return 0;
}
@@ -232,11 +230,11 @@ static int gif_read_header1(GifState *s)
s->bits_per_pixel = (v & 0x07) + 1;
s->background_color_index = bytestream_get_byte(&s->bytestream);
bytestream_get_byte(&s->bytestream); /* ignored */
-#ifdef DEBUG
+
dprintf(s->avctx, "gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
s->screen_width, s->screen_height, s->bits_per_pixel,
has_global_palette);
-#endif
+
if (has_global_palette) {
n = 1 << s->bits_per_pixel;
if (s->bytestream_end < s->bytestream + n * 3)
@@ -250,9 +248,9 @@ static int gif_parse_next_image(GifState *s)
{
while (s->bytestream < s->bytestream_end) {
int code = bytestream_get_byte(&s->bytestream);
-#ifdef DEBUG
+
dprintf(s->avctx, "gif: code=%02x '%c'\n", code, code);
-#endif
+
switch (code) {
case ',':
return gif_read_image(s);