Mercurial > libavcodec.hg
comparison gifdec.c @ 4056:55efd8b39474 libavcodec
printf -> dprintf
author | bcoudurier |
---|---|
date | Sun, 22 Oct 2006 15:11:51 +0000 |
parents | a76659cf76d3 |
children | ba767c63a07f |
comparison
equal
deleted
inserted
replaced
4055:a76659cf76d3 | 4056:55efd8b39474 |
---|---|
234 flags = bytestream_get_byte(&s->bytestream); | 234 flags = bytestream_get_byte(&s->bytestream); |
235 is_interleaved = flags & 0x40; | 235 is_interleaved = flags & 0x40; |
236 has_local_palette = flags & 0x80; | 236 has_local_palette = flags & 0x80; |
237 bits_per_pixel = (flags & 0x07) + 1; | 237 bits_per_pixel = (flags & 0x07) + 1; |
238 #ifdef DEBUG | 238 #ifdef DEBUG |
239 printf("gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height); | 239 dprintf("gif: image x=%d y=%d w=%d h=%d\n", left, top, width, height); |
240 #endif | 240 #endif |
241 | 241 |
242 if (has_local_palette) { | 242 if (has_local_palette) { |
243 bytestream_get_buffer(&s->bytestream, s->local_palette, 3 * (1 << bits_per_pixel)); | 243 bytestream_get_buffer(&s->bytestream, s->local_palette, 3 * (1 << bits_per_pixel)); |
244 palette = s->local_palette; | 244 palette = s->local_palette; |
327 | 327 |
328 /* extension */ | 328 /* extension */ |
329 ext_code = bytestream_get_byte(&s->bytestream); | 329 ext_code = bytestream_get_byte(&s->bytestream); |
330 ext_len = bytestream_get_byte(&s->bytestream); | 330 ext_len = bytestream_get_byte(&s->bytestream); |
331 #ifdef DEBUG | 331 #ifdef DEBUG |
332 printf("gif: ext_code=0x%x len=%d\n", ext_code, ext_len); | 332 dprintf("gif: ext_code=0x%x len=%d\n", ext_code, ext_len); |
333 #endif | 333 #endif |
334 switch(ext_code) { | 334 switch(ext_code) { |
335 case 0xf9: | 335 case 0xf9: |
336 if (ext_len != 4) | 336 if (ext_len != 4) |
337 goto discard_ext; | 337 goto discard_ext; |
343 s->transparent_color_index = gce_transparent_index; | 343 s->transparent_color_index = gce_transparent_index; |
344 else | 344 else |
345 s->transparent_color_index = -1; | 345 s->transparent_color_index = -1; |
346 s->gce_disposal = (gce_flags >> 2) & 0x7; | 346 s->gce_disposal = (gce_flags >> 2) & 0x7; |
347 #ifdef DEBUG | 347 #ifdef DEBUG |
348 printf("gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n", | 348 dprintf("gif: gce_flags=%x delay=%d tcolor=%d disposal=%d\n", |
349 gce_flags, s->gce_delay, | 349 gce_flags, s->gce_delay, |
350 s->transparent_color_index, s->gce_disposal); | 350 s->transparent_color_index, s->gce_disposal); |
351 #endif | 351 #endif |
352 ext_len = bytestream_get_byte(&s->bytestream); | 352 ext_len = bytestream_get_byte(&s->bytestream); |
353 break; | 353 break; |
358 while (ext_len != 0) { | 358 while (ext_len != 0) { |
359 for (i = 0; i < ext_len; i++) | 359 for (i = 0; i < ext_len; i++) |
360 bytestream_get_byte(&s->bytestream); | 360 bytestream_get_byte(&s->bytestream); |
361 ext_len = bytestream_get_byte(&s->bytestream); | 361 ext_len = bytestream_get_byte(&s->bytestream); |
362 #ifdef DEBUG | 362 #ifdef DEBUG |
363 printf("gif: ext_len1=%d\n", ext_len); | 363 dprintf("gif: ext_len1=%d\n", ext_len); |
364 #endif | 364 #endif |
365 } | 365 } |
366 return 0; | 366 return 0; |
367 } | 367 } |
368 | 368 |
393 has_global_palette = (v & 0x80); | 393 has_global_palette = (v & 0x80); |
394 s->bits_per_pixel = (v & 0x07) + 1; | 394 s->bits_per_pixel = (v & 0x07) + 1; |
395 s->background_color_index = bytestream_get_byte(&s->bytestream); | 395 s->background_color_index = bytestream_get_byte(&s->bytestream); |
396 bytestream_get_byte(&s->bytestream); /* ignored */ | 396 bytestream_get_byte(&s->bytestream); /* ignored */ |
397 #ifdef DEBUG | 397 #ifdef DEBUG |
398 printf("gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n", | 398 dprintf("gif: screen_w=%d screen_h=%d bpp=%d global_palette=%d\n", |
399 s->screen_width, s->screen_height, s->bits_per_pixel, | 399 s->screen_width, s->screen_height, s->bits_per_pixel, |
400 has_global_palette); | 400 has_global_palette); |
401 #endif | 401 #endif |
402 if (has_global_palette) { | 402 if (has_global_palette) { |
403 n = 1 << s->bits_per_pixel; | 403 n = 1 << s->bits_per_pixel; |
411 int ret, code; | 411 int ret, code; |
412 | 412 |
413 for (;;) { | 413 for (;;) { |
414 code = bytestream_get_byte(&s->bytestream); | 414 code = bytestream_get_byte(&s->bytestream); |
415 #ifdef DEBUG | 415 #ifdef DEBUG |
416 printf("gif: code=%02x '%c'\n", code, code); | 416 dprintf("gif: code=%02x '%c'\n", code, code); |
417 #endif | 417 #endif |
418 switch (code) { | 418 switch (code) { |
419 case ',': | 419 case ',': |
420 if (gif_read_image(s) < 0) | 420 if (gif_read_image(s) < 0) |
421 return -1; | 421 return -1; |