From af55a9d80a6f50a806a40ca1641de1372d64ee99 Mon Sep 17 00:00:00 2001 From: Piotr Bandurski Date: Thu, 8 Mar 2012 23:34:36 +0100 Subject: iff: add support for IFF DEEP Fixes trac #1045. Thanks to Peter Ross for his help with this patch. Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer --- libavcodec/iff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libavcodec/iff.c') diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 2185946..9b09604 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -316,7 +316,8 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) || (avctx->extradata_size >= 2 && palette_size) ? PIX_FMT_PAL8 : PIX_FMT_GRAY8; } else if (avctx->bits_per_coded_sample <= 32) { - avctx->pix_fmt = PIX_FMT_BGR32; + if (avctx->codec_tag != MKTAG('D','E','E','P')) + avctx->pix_fmt = PIX_FMT_BGR32; } else { return AVERROR_INVALIDDATA; } @@ -503,6 +504,13 @@ static int decode_frame_ilbm(AVCodecContext *avctx, decode_ham_plane32((uint32_t *) row, s->ham_buf, s->ham_palbuf, s->planesize); } } + } else if (avctx->codec_tag == MKTAG('D','E','E','P')) { + int raw_width = avctx->width * (av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]) >> 3); + for(y = 0; y < avctx->height && buf < buf_end; y++ ) { + uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]]; + memcpy(row, buf, FFMIN(raw_width, buf_end - buf)); + buf += raw_width; + } } else if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { for(y = 0; y < avctx->height; y++ ) { -- cgit v1.1