31 #include "libavutil/avassert.h"
32 #include "libavutil/channel_layout.h"
33 #include "libavutil/intreadwrite.h"
34 #include "libavutil/dict.h"
39 #define ID_8SVX MKTAG('8','S','V','X')
40 #define ID_16SV MKTAG('1','6','S','V')
41 #define ID_MAUD MKTAG('M','A','U','D')
42 #define ID_MHDR MKTAG('M','H','D','R')
43 #define ID_MDAT MKTAG('M','D','A','T')
44 #define ID_VHDR MKTAG('V','H','D','R')
45 #define ID_ATAK MKTAG('A','T','A','K')
46 #define ID_RLSE MKTAG('R','L','S','E')
47 #define ID_CHAN MKTAG('C','H','A','N')
48 #define ID_PBM MKTAG('P','B','M',' ')
49 #define ID_ILBM MKTAG('I','L','B','M')
50 #define ID_BMHD MKTAG('B','M','H','D')
51 #define ID_DGBL MKTAG('D','G','B','L')
52 #define ID_CAMG MKTAG('C','A','M','G')
53 #define ID_CMAP MKTAG('C','M','A','P')
54 #define ID_ACBM MKTAG('A','C','B','M')
55 #define ID_DEEP MKTAG('D','E','E','P')
56 #define ID_RGB8 MKTAG('R','G','B','8')
57 #define ID_RGBN MKTAG('R','G','B','N')
59 #define ID_FORM MKTAG('F','O','R','M')
60 #define ID_ANNO MKTAG('A','N','N','O')
61 #define ID_AUTH MKTAG('A','U','T','H')
62 #define ID_CHRS MKTAG('C','H','R','S')
63 #define ID_COPYRIGHT MKTAG('(','c',')',' ')
64 #define ID_CSET MKTAG('C','S','E','T')
65 #define ID_FVER MKTAG('F','V','E','R')
66 #define ID_NAME MKTAG('N','A','M','E')
67 #define ID_TEXT MKTAG('T','E','X','T')
68 #define ID_ABIT MKTAG('A','B','I','T')
69 #define ID_BODY MKTAG('B','O','D','Y')
70 #define ID_DBOD MKTAG('D','B','O','D')
71 #define ID_DPEL MKTAG('D','P','E','L')
72 #define ID_DLOC MKTAG('D','L','O','C')
73 #define ID_TVDC MKTAG('T','V','D','C')
87 #define IFF_EXTRA_VIDEO_SIZE 41
113 const char *
const tag,
114 const unsigned data_size)
148 static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
149 static const uint8_t deep_rgba[] = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
150 static const uint8_t deep_bgra[] = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
151 static const uint8_t deep_argb[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8};
152 static const uint8_t deep_abgr[] = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8};
160 uint32_t chunk_id, data_size;
161 uint32_t screenmode = 0, num, den;
162 unsigned transparency = 0;
163 unsigned masking = 0;
184 const char *metadata_tag = NULL;
197 if (data_size >= 16) {
253 if (data_size < 3 || data_size > 768 || data_size % 3) {
278 if (data_size >= 14) {
282 if (data_size >= 16) {
289 if (data_size < 4 || (data_size & 3))
291 if ((fmt_size =
avio_read(pb, fmt,
sizeof(fmt))) < 0)
329 if (data_size <
sizeof(iff->
tvdc))
337 case ID_TEXT: metadata_tag =
"comment";
break;
338 case ID_AUTH: metadata_tag =
"artist";
break;
340 case ID_NAME: metadata_tag =
"title";
break;
344 if ((res =
get_metadata(s, metadata_tag, data_size)) < 0) {
404 if ((screenmode & 0x800 ) && iff->
bpp <= 8) {
405 iff->
ham = iff->
bpp > 6 ? 6 : 4;
408 iff->
flags = (screenmode & 0x80 ) && iff->
bpp <= 8;
422 bytestream_put_byte(&buf, iff->
bpp);
423 bytestream_put_byte(&buf, iff->
ham);
424 bytestream_put_byte(&buf, iff->
flags);
426 bytestream_put_byte(&buf, iff->
masking);
463 bytestream_put_be16(&buf, 2);
unsigned transparency
transparency color index in palette
#define AVERROR_PATCHWELCOME
unsigned ham
0 if non-HAM or number of hold bits (6 for bpp > 6, 4 otherwise)
packed RGB 8:8:8, 24bpp, RGBRGB...
AVCodecContext * codec
Codec context associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
unsigned maud_compression
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
#define AV_CH_LAYOUT_STEREO
svx8_compression_type svx8_compression
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
if((e=av_dict_get(options,"", NULL, AV_DICT_IGNORE_SUFFIX)))
uint8_t tvdc[32]
TVDC lookup table.
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_get_bits_per_sample(enum AVCodecID codec_id)
Return codec bits per sample.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
void * priv_data
Format private data.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
unsigned flags
1 for EHB, 0 is no extra half darkening
int bit_rate
the average bitrate
#define AV_DICT_DONT_STRDUP_VAL
Take ownership of a value that's been allocated with av_malloc() and chilren.
int width
picture width / height.
void * av_malloc(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
static int read_header(FFV1Context *f)
enum AVMediaType codec_type
unsigned bpp
bits per plane to decode (differs from bits_per_coded_sample if HAM)
int sample_rate
samples per second
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
AVIOContext * pb
I/O context.
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)
Set the given entry in *pm, overwriting an existing entry.
This structure contains the data a format has to probe a file.
unsigned bitmap_compression
delta compression method used
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define AVERROR_INVALIDDATA
int channels
number of audio channels
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define av_assert0(cond)
assert() equivalent, that is always enabled.
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
unsigned masking
masking method used