summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorPeter Ross <pross@xvid.org>2011-11-27 12:10:38 +1100
committerMichael Niedermayer <michaelni@gmx.at>2011-11-27 03:11:08 +0100
commit3d977edb043c59e7a4aca8555e29f01caa2ee1fe (patch)
tree20bb691ad3f28611d22f64e2fd4d88e10ff8787f /libavcodec
parentb4886795108e319a5b3a88370e90207d9c15a01e (diff)
HAM6/HAM8 support for IFF ACBM decoder
Based on patch by ami_stuff Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/iff.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 30a3f6f766..2836d2fea3 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -450,6 +450,19 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
buf += s->planesize;
}
}
+ } else if (s->ham) { // HAM to PIX_FMT_BGR32
+ memset(s->frame.data[0], 0, avctx->height * s->frame.linesize[0]);
+ for(y = 0; y < avctx->height; y++) {
+ uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];
+ memset(s->ham_buf, 0, s->planesize * 8);
+ for (plane = 0; plane < s->bpp; plane++) {
+ const uint8_t * start = buf + (plane * avctx->height + y) * s->planesize;
+ if (start >= buf_end)
+ break;
+ decodeplane8(s->ham_buf, start, FFMIN(s->planesize, buf_end - start), plane);
+ }
+ decode_ham_plane32((uint32_t *) row, s->ham_buf, s->ham_palbuf, s->planesize);
+ }
}
} else if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved
if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) {