summaryrefslogtreecommitdiff
path: root/libavcodec/iff.c
diff options
context:
space:
mode:
authorPiotr Bandurski <ami_stuff@o2.pl>2012-03-08 23:34:36 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-03-09 01:55:45 +0100
commitaf55a9d80a6f50a806a40ca1641de1372d64ee99 (patch)
tree34448f8e1c3c1c3df07f97a23430f7649e5be943 /libavcodec/iff.c
parent520cf053385a317d236b402e7ddac9a48c60f7b9 (diff)
iff: add support for IFF DEEP
Fixes trac #1045. Thanks to Peter Ross for his help with this patch. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/iff.c')
-rw-r--r--libavcodec/iff.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 2185946649..9b0960447e 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++ ) {