#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) |
#define | DECODE_HAM_PLANE32(x) |
Enumerations | |
enum | mask_type { MASK_NONE, MASK_HAS_MASK, MASK_HAS_TRANSPARENT_COLOR, MASK_LASSO } |
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 int | extract_header (AVCodecContext *const avctx, const AVPacket *const avpkt) |
Extracts the IFF extra context and updates internal decoder structures. | |
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 void | decode_ham_plane32 (uint32_t *dst, const uint8_t *buf, const uint32_t *const pal, unsigned buf_size) |
Converts one line of HAM6/8-encoded chunky buffer 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 |
Definition in file iff.c.
#define DECODE_HAM_PLANE32 | ( | x | ) |
#define LUT32 | ( | plane | ) |
Value:
{ \ 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 | ) |
Value:
{ \ 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 | ) |
Value:
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
enum mask_type |
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 403 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 void decode_ham_plane32 | ( | uint32_t * | dst, | |
const uint8_t * | buf, | |||
const uint32_t *const | pal, | |||
unsigned | buf_size | |||
) | [static] |
Converts one line of HAM6/8-encoded chunky buffer to 24bpp.
dst | the destination 24bpp buffer | |
buf | the source 8bpp chunky buffer | |
pal | the HAM decode table | |
buf_size | the plane size in bytes |
Definition at line 379 of file iff.c.
Referenced by decode_frame_byterun1(), and decode_frame_ilbm().
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 343 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 326 of file iff.c.
Referenced by decode_frame_byterun1(), and decode_frame_ilbm().
static int extract_header | ( | AVCodecContext *const | avctx, | |
const AVPacket *const | avpkt | |||
) | [static] |
Extracts the IFF extra context and updates internal decoder structures.
avctx | the AVCodecContext where to extract extra context to | |
avpkt | the AVPacket to extract extra context from or NULL to use avctx |
Definition at line 174 of file iff.c.
Referenced by decode_frame_byterun1(), decode_frame_ilbm(), and decode_init().
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 138 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] |
Initial value:
{ "iff_byterun1", AVMEDIA_TYPE_VIDEO, CODEC_ID_IFF_BYTERUN1, sizeof(IffContext), decode_init, NULL, decode_end, decode_frame_byterun1, CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("IFF ByteRun1"), }
Initial value:
{ "iff_ilbm", AVMEDIA_TYPE_VIDEO, CODEC_ID_IFF_ILBM, sizeof(IffContext), decode_init, NULL, decode_end, decode_frame_ilbm, CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("IFF ILBM"), }
const uint32_t plane32_lut[32][16 *4] [static] |
Initial value:
{ 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 119 of file iff.c.
Referenced by decodeplane32().
const uint64_t plane8_lut[8][256] [static] |