Mercurial > libavcodec.hg
comparison pngdec.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 | 06e12f9b93d7 |
children | eb37707704e4 |
comparison
equal
deleted
inserted
replaced
9998:6b229807a182 | 9999:c78fd9154378 |
---|---|
428 length = bytestream_get_be32(&s->bytestream); | 428 length = bytestream_get_be32(&s->bytestream); |
429 if (length > 0x7fffffff) | 429 if (length > 0x7fffffff) |
430 goto fail; | 430 goto fail; |
431 tag32 = bytestream_get_be32(&s->bytestream); | 431 tag32 = bytestream_get_be32(&s->bytestream); |
432 tag = bswap_32(tag32); | 432 tag = bswap_32(tag32); |
433 #ifdef DEBUG | 433 dprintf(avctx, "png: tag=%c%c%c%c length=%u\n", |
434 av_log(avctx, AV_LOG_DEBUG, "png: tag=%c%c%c%c length=%u\n", | 434 (tag & 0xff), |
435 (tag & 0xff), | 435 ((tag >> 8) & 0xff), |
436 ((tag >> 8) & 0xff), | 436 ((tag >> 16) & 0xff), |
437 ((tag >> 16) & 0xff), | 437 ((tag >> 24) & 0xff), length); |
438 ((tag >> 24) & 0xff), length); | |
439 #endif | |
440 switch(tag) { | 438 switch(tag) { |
441 case MKTAG('I', 'H', 'D', 'R'): | 439 case MKTAG('I', 'H', 'D', 'R'): |
442 if (length != 13) | 440 if (length != 13) |
443 goto fail; | 441 goto fail; |
444 s->width = bytestream_get_be32(&s->bytestream); | 442 s->width = bytestream_get_be32(&s->bytestream); |
452 s->compression_type = *s->bytestream++; | 450 s->compression_type = *s->bytestream++; |
453 s->filter_type = *s->bytestream++; | 451 s->filter_type = *s->bytestream++; |
454 s->interlace_type = *s->bytestream++; | 452 s->interlace_type = *s->bytestream++; |
455 crc = bytestream_get_be32(&s->bytestream); | 453 crc = bytestream_get_be32(&s->bytestream); |
456 s->state |= PNG_IHDR; | 454 s->state |= PNG_IHDR; |
457 #ifdef DEBUG | 455 dprintf(avctx, "width=%d height=%d depth=%d color_type=%d compression_type=%d filter_type=%d interlace_type=%d\n", |
458 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", | 456 s->width, s->height, s->bit_depth, s->color_type, |
459 s->width, s->height, s->bit_depth, s->color_type, | 457 s->compression_type, s->filter_type, s->interlace_type); |
460 s->compression_type, s->filter_type, s->interlace_type); | |
461 #endif | |
462 break; | 458 break; |
463 case MKTAG('I', 'D', 'A', 'T'): | 459 case MKTAG('I', 'D', 'A', 'T'): |
464 if (!(s->state & PNG_IHDR)) | 460 if (!(s->state & PNG_IHDR)) |
465 goto fail; | 461 goto fail; |
466 if (!(s->state & PNG_IDAT)) { | 462 if (!(s->state & PNG_IDAT)) { |
516 s->pass_row_size = ff_png_pass_row_size(s->pass, | 512 s->pass_row_size = ff_png_pass_row_size(s->pass, |
517 s->bits_per_pixel, | 513 s->bits_per_pixel, |
518 s->width); | 514 s->width); |
519 s->crow_size = s->pass_row_size + 1; | 515 s->crow_size = s->pass_row_size + 1; |
520 } | 516 } |
521 #ifdef DEBUG | 517 dprintf(avctx, "row_size=%d crow_size =%d\n", |
522 av_log(avctx, AV_LOG_DEBUG, "row_size=%d crow_size =%d\n", | 518 s->row_size, s->crow_size); |
523 s->row_size, s->crow_size); | |
524 #endif | |
525 s->image_buf = p->data[0]; | 519 s->image_buf = p->data[0]; |
526 s->image_linesize = p->linesize[0]; | 520 s->image_linesize = p->linesize[0]; |
527 /* copy the palette if needed */ | 521 /* copy the palette if needed */ |
528 if (s->color_type == PNG_COLOR_TYPE_PALETTE) | 522 if (s->color_type == PNG_COLOR_TYPE_PALETTE) |
529 memcpy(p->data[1], s->palette, 256 * sizeof(uint32_t)); | 523 memcpy(p->data[1], s->palette, 256 * sizeof(uint32_t)); |