Mercurial > libavcodec.hg
comparison lcldec.c @ 9750:a87706453840 libavcodec
Get rid of extradata casts, it already has the right uint8_t * type
author | reimar |
---|---|
date | Sun, 31 May 2009 09:12:17 +0000 |
parents | 4a4192578b60 |
children | 705efd6ddaab |
comparison
equal
deleted
inserted
replaced
9749:4a4192578b60 | 9750:a87706453840 |
---|---|
483 if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { | 483 if (avcodec_check_dimensions(avctx, avctx->width, avctx->height) < 0) { |
484 return 1; | 484 return 1; |
485 } | 485 } |
486 | 486 |
487 /* Check codec type */ | 487 /* Check codec type */ |
488 if ((avctx->codec_id == CODEC_ID_MSZH && *((char *)avctx->extradata + 7) != CODEC_MSZH) || | 488 if ((avctx->codec_id == CODEC_ID_MSZH && avctx->extradata[7] != CODEC_MSZH) || |
489 (avctx->codec_id == CODEC_ID_ZLIB && *((char *)avctx->extradata + 7) != CODEC_ZLIB)) { | 489 (avctx->codec_id == CODEC_ID_ZLIB && avctx->extradata[7] != CODEC_ZLIB)) { |
490 av_log(avctx, AV_LOG_ERROR, "Codec id and codec type mismatch. This should not happen.\n"); | 490 av_log(avctx, AV_LOG_ERROR, "Codec id and codec type mismatch. This should not happen.\n"); |
491 } | 491 } |
492 | 492 |
493 /* Detect image type */ | 493 /* Detect image type */ |
494 switch (c->imgtype = *((char *)avctx->extradata + 4)) { | 494 switch (c->imgtype = avctx->extradata[4]) { |
495 case IMGTYPE_YUV111: | 495 case IMGTYPE_YUV111: |
496 c->decomp_size = basesize * 3; | 496 c->decomp_size = basesize * 3; |
497 max_decomp_size = max_basesize * 3; | 497 max_decomp_size = max_basesize * 3; |
498 avctx->pix_fmt = PIX_FMT_YUV444P; | 498 avctx->pix_fmt = PIX_FMT_YUV444P; |
499 av_log(avctx, AV_LOG_INFO, "Image type is YUV 1:1:1.\n"); | 499 av_log(avctx, AV_LOG_INFO, "Image type is YUV 1:1:1.\n"); |
532 av_log(avctx, AV_LOG_ERROR, "Unsupported image format %d.\n", c->imgtype); | 532 av_log(avctx, AV_LOG_ERROR, "Unsupported image format %d.\n", c->imgtype); |
533 return 1; | 533 return 1; |
534 } | 534 } |
535 | 535 |
536 /* Detect compression method */ | 536 /* Detect compression method */ |
537 c->compression = *((char *)avctx->extradata + 5); | 537 c->compression = avctx->extradata[5]; |
538 switch (avctx->codec_id) { | 538 switch (avctx->codec_id) { |
539 case CODEC_ID_MSZH: | 539 case CODEC_ID_MSZH: |
540 switch (c->compression) { | 540 switch (c->compression) { |
541 case COMP_MSZH: | 541 case COMP_MSZH: |
542 av_log(avctx, AV_LOG_INFO, "Compression enabled.\n"); | 542 av_log(avctx, AV_LOG_INFO, "Compression enabled.\n"); |
586 return 1; | 586 return 1; |
587 } | 587 } |
588 } | 588 } |
589 | 589 |
590 /* Detect flags */ | 590 /* Detect flags */ |
591 c->flags = *((char *)avctx->extradata + 6); | 591 c->flags = avctx->extradata[6]; |
592 if (c->flags & FLAG_MULTITHREAD) | 592 if (c->flags & FLAG_MULTITHREAD) |
593 av_log(avctx, AV_LOG_INFO, "Multithread encoder flag set.\n"); | 593 av_log(avctx, AV_LOG_INFO, "Multithread encoder flag set.\n"); |
594 if (c->flags & FLAG_NULLFRAME) | 594 if (c->flags & FLAG_NULLFRAME) |
595 av_log(avctx, AV_LOG_INFO, "Nullframe insertion flag set.\n"); | 595 av_log(avctx, AV_LOG_INFO, "Nullframe insertion flag set.\n"); |
596 if ((avctx->codec_id == CODEC_ID_ZLIB) && (c->flags & FLAG_PNGFILTER)) | 596 if ((avctx->codec_id == CODEC_ID_ZLIB) && (c->flags & FLAG_PNGFILTER)) |