diff options
author | ami_stuff <ami_stuff@o2.pl> | 2011-11-21 20:31:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-11-21 23:06:53 +0100 |
commit | cf14c822275301209c307fb35351d5c9833b7a3b (patch) | |
tree | 644fe2d4a1211d489f5e70ab3c042ccd25c281ea | |
parent | 7f6a0190963f99c9b90dc58f17f8d450d2a4f98e (diff) | |
download | ffmpeg-cf14c822275301209c307fb35351d5c9833b7a3b.tar.gz |
[PATCH] IFF Amiga Continuous Bitmap (ACBM)decoder
Some sample IFF ACBM files can be found here:
http://aminet.net/package/dev/basic/ABdemos
Thanks to Peter Ross for his help with this patch.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | libavcodec/iff.c | 13 | ||||
-rw-r--r-- | libavformat/iff.c | 5 |
3 files changed, 17 insertions, 2 deletions
@@ -123,6 +123,7 @@ easier to use. The changes are: - OS X Video Decoder Acceleration (VDA) support - compact and csv output in ffprobe - pan audio filter +- IFF Amiga Continuous Bitmap (ACBM) decoder version 0.8: diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 39fa7323f0..c4c614ed4e 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -440,7 +440,18 @@ static int decode_frame_ilbm(AVCodecContext *avctx, } s->init = 1; - if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved + if (avctx->codec_tag == MKTAG('A','C','B','M')) { + if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + memset(s->frame.data[0], 0, avctx->height * s->frame.linesize[0]); + for (plane = 0; plane < s->bpp; plane++) { + for(y = 0; y < avctx->height && buf < buf_end; y++ ) { + uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; + decodeplane8(row, buf, FFMIN(s->planesize, buf_end - buf), plane); + buf += 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) { for(y = 0; y < avctx->height; y++ ) { uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; diff --git a/libavformat/iff.c b/libavformat/iff.c index 7601d6d73b..a816af580b 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -43,6 +43,7 @@ #define ID_BMHD MKTAG('B','M','H','D') #define ID_CAMG MKTAG('C','A','M','G') #define ID_CMAP MKTAG('C','M','A','P') +#define ID_ACBM MKTAG('A','C','B','M') #define ID_FORM MKTAG('F','O','R','M') #define ID_ANNO MKTAG('A','N','N','O') @@ -53,6 +54,7 @@ #define ID_FVER MKTAG('F','V','E','R') #define ID_NAME MKTAG('N','A','M','E') #define ID_TEXT MKTAG('T','E','X','T') +#define ID_ABIT MKTAG('A','B','I','T') #define ID_BODY MKTAG('B','O','D','Y') #define ID_ANNO MKTAG('A','N','N','O') @@ -118,7 +120,7 @@ static int iff_probe(AVProbeData *p) const uint8_t *d = p->buf; if ( AV_RL32(d) == ID_FORM && - (AV_RL32(d+8) == ID_8SVX || AV_RL32(d+8) == ID_PBM || AV_RL32(d+8) == ID_ILBM) ) + (AV_RL32(d+8) == ID_8SVX || AV_RL32(d+8) == ID_PBM || AV_RL32(d+8) == ID_ILBM || AV_RL32(d+8) == ID_ACBM) ) return AVPROBE_SCORE_MAX; return 0; } @@ -166,6 +168,7 @@ static int iff_read_header(AVFormatContext *s, } break; + case ID_ABIT: case ID_BODY: iff->body_pos = avio_tell(pb); iff->body_size = data_size; |