IFF PBM/ILBM bitmap decoder. More...
#include "libavutil/imgutils.h"#include "bytestream.h"#include "avcodec.h"#include "get_bits.h"Go to the source code of this file.
Data Structures | |
| struct | IffContext |
Defines | |
| #define | LUT8_PART(plane, v) |
| #define | LUT8(plane) |
| #define | LUT32(plane) |
Functions | |
| static av_always_inline uint32_t | gray2rgb (const uint32_t x) |
| static int | ff_cmap_read_palette (AVCodecContext *avctx, uint32_t *pal) |
| Convert CMAP buffer (stored in extradata) to lavc palette format. | |
| static av_cold int | decode_init (AVCodecContext *avctx) |
| static void | decodeplane8 (uint8_t *dst, const uint8_t *buf, int buf_size, int plane) |
| Decode interleaved plane buffer up to 8bpp. | |
| static void | decodeplane32 (uint32_t *dst, const uint8_t *buf, int buf_size, int plane) |
| Decode interleaved plane buffer up to 24bpp. | |
| static int | decode_byterun (uint8_t *dst, int dst_size, const uint8_t *buf, const uint8_t *const buf_end) |
| Decode one complete byterun1 encoded line. | |
| static int | decode_frame_ilbm (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
| static int | decode_frame_byterun1 (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
| static av_cold int | decode_end (AVCodecContext *avctx) |
Variables | |
| static const uint64_t | plane8_lut [8][256] |
| static const uint32_t | plane32_lut [32][16 *4] |
| AVCodec | ff_iff_ilbm_decoder |
| AVCodec | ff_iff_byterun1_decoder |
IFF PBM/ILBM bitmap decoder.
Definition in file iff.c.
| #define LUT32 | ( | plane | ) |
{ \
0, 0, 0, 0, \
0, 0, 0, 1 << plane, \
0, 0, 1 << plane, 0, \
0, 0, 1 << plane, 1 << plane, \
0, 1 << plane, 0, 0, \
0, 1 << plane, 0, 1 << plane, \
0, 1 << plane, 1 << plane, 0, \
0, 1 << plane, 1 << plane, 1 << plane, \
1 << plane, 0, 0, 0, \
1 << plane, 0, 0, 1 << plane, \
1 << plane, 0, 1 << plane, 0, \
1 << plane, 0, 1 << plane, 1 << plane, \
1 << plane, 1 << plane, 0, 0, \
1 << plane, 1 << plane, 0, 1 << plane, \
1 << plane, 1 << plane, 1 << plane, 0, \
1 << plane, 1 << plane, 1 << plane, 1 << plane, \
}
| #define LUT8 | ( | plane | ) |
{ \
LUT8_PART(plane, 0x0000000), \
LUT8_PART(plane, 0x1000000), \
LUT8_PART(plane, 0x0010000), \
LUT8_PART(plane, 0x1010000), \
LUT8_PART(plane, 0x0000100), \
LUT8_PART(plane, 0x1000100), \
LUT8_PART(plane, 0x0010100), \
LUT8_PART(plane, 0x1010100), \
LUT8_PART(plane, 0x0000001), \
LUT8_PART(plane, 0x1000001), \
LUT8_PART(plane, 0x0010001), \
LUT8_PART(plane, 0x1010001), \
LUT8_PART(plane, 0x0000101), \
LUT8_PART(plane, 0x1000101), \
LUT8_PART(plane, 0x0010101), \
LUT8_PART(plane, 0x1010101), \
}
| #define LUT8_PART | ( | plane, | ||
| v | ||||
| ) |
AV_LE2NE64C(UINT64_C(0x0000000)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1000000)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0010000)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1010000)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0000100)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1000100)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0010100)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1010100)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0000001)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1000001)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0010001)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1010001)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0000101)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1000101)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x0010101)<<32 | v) << plane, \ AV_LE2NE64C(UINT64_C(0x1010101)<<32 | v) << plane
| static int decode_byterun | ( | uint8_t * | dst, | |
| int | dst_size, | |||
| const uint8_t * | buf, | |||
| const uint8_t *const | buf_end | |||
| ) | [static] |
Decode one complete byterun1 encoded line.
| dst | the destination buffer where to store decompressed bitstream | |
| dst_size | the destination plane size in bytes | |
| buf | the source byterun1 compressed bitstream | |
| buf_end | the EOF of source byterun1 compressed bitstream |
Definition at line 226 of file iff.c.
Referenced by decode_frame_byterun1().
| static av_cold int decode_end | ( | AVCodecContext * | avctx | ) | [static] |
| static int decode_frame_byterun1 | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| AVPacket * | avpkt | |||
| ) | [static] |
| static int decode_frame_ilbm | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| AVPacket * | avpkt | |||
| ) | [static] |
| static av_cold int decode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static void decodeplane32 | ( | uint32_t * | dst, | |
| const uint8_t * | buf, | |||
| int | buf_size, | |||
| int | plane | |||
| ) | [static] |
Decode interleaved plane buffer up to 24bpp.
| dst | Destination buffer | |
| buf | Source buffer | |
| buf_size | ||
| plane | plane number to decode as |
Definition at line 199 of file iff.c.
Referenced by decode_frame_byterun1(), and decode_frame_ilbm().
| static void decodeplane8 | ( | uint8_t * | dst, | |
| const uint8_t * | buf, | |||
| int | buf_size, | |||
| int | plane | |||
| ) | [static] |
Decode interleaved plane buffer up to 8bpp.
| dst | Destination buffer | |
| buf | Source buffer | |
| buf_size | ||
| plane | plane number to decode as |
Definition at line 182 of file iff.c.
Referenced by decode_frame_byterun1(), and decode_frame_ilbm().
| static int ff_cmap_read_palette | ( | AVCodecContext * | avctx, | |
| uint32_t * | pal | |||
| ) | [static] |
Convert CMAP buffer (stored in extradata) to lavc palette format.
Definition at line 122 of file iff.c.
Referenced by decode_frame_byterun1(), and decode_frame_ilbm().
| static av_always_inline uint32_t gray2rgb | ( | const uint32_t | x | ) | [static] |
Definition at line 115 of file iff.c.
Referenced by ff_cmap_read_palette().
{
.name = "iff_byterun1",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_IFF_BYTERUN1,
.priv_data_size = sizeof(IffContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame_byterun1,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("IFF ByteRun1"),
}
{
.name = "iff_ilbm",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_IFF_ILBM,
.priv_data_size = sizeof(IffContext),
.init = decode_init,
.close = decode_end,
.decode = decode_frame_ilbm,
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("IFF ILBM"),
}
const uint32_t plane32_lut[32][16 *4] [static] |
{
LUT32( 0), LUT32( 1), LUT32( 2), LUT32( 3),
LUT32( 4), LUT32( 5), LUT32( 6), LUT32( 7),
LUT32( 8), LUT32( 9), LUT32(10), LUT32(11),
LUT32(12), LUT32(13), LUT32(14), LUT32(15),
LUT32(16), LUT32(17), LUT32(18), LUT32(19),
LUT32(20), LUT32(21), LUT32(22), LUT32(23),
LUT32(24), LUT32(25), LUT32(26), LUT32(27),
LUT32(28), LUT32(29), LUT32(30), LUT32(31),
}
Definition at line 103 of file iff.c.
Referenced by decodeplane32().