36#define SMACKER_PAL 0x01
37#define SMACKER_FLAG_RING_FRAME 0x01
38#define SMACKER_FLAG_Y_INTERLACE (1 << 1)
39#define SMACKER_FLAG_Y_DOUBLE (1 << 2)
71 0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
72 0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
73 0x41, 0x45, 0x49, 0x4D, 0x51, 0x55, 0x59, 0x5D,
74 0x61, 0x65, 0x69, 0x6D, 0x71, 0x75, 0x79, 0x7D,
75 0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9A, 0x9E,
76 0xA2, 0xA6, 0xAA, 0xAE, 0xB2, 0xB6, 0xBA, 0xBE,
77 0xC3, 0xC7, 0xCB, 0xCF, 0xD3, 0xD7, 0xDB, 0xDF,
78 0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF
107 if (magic !=
MKTAG(
'S',
'M',
'K',
'2') && magic !=
MKTAG(
'S',
'M',
'K',
'4'))
113 if (pts_inc > INT_MAX / 100 || pts_inc == INT_MIN) {
121 if (smk->
frames > 0xFFFFFF) {
129 if (treesize >= UINT_MAX/4) {
146 av_reduce(&tbase, &pts_inc, tbase, pts_inc, (1UL << 31) - 1);
164 "Cannot allocate %"PRIu32
" bytes of extradata\n",
172 for (
i = 0;
i < 7;
i++) {
258 uint8_t *pal = smk->
pal;
261 memcpy(oldpal, pal, 768);
274 sz += (t & 0x7F) + 1;
275 pal += ((t & 0x7F) + 1) * 3;
276 }
else if (t & 0x40) {
279 if (off + j > 0x100) {
281 "Invalid palette update, offset=%d length=%d extends beyond palette size\n",
287 while (j-- && sz < 256) {
288 *pal++ = oldpal[off + 0];
289 *pal++ = oldpal[off + 1];
290 *pal++ = oldpal[off + 2];
307 if (smk->
flags & (1 <<
i)) {
354 memcpy(
pkt->data + 1, smk->
pal, 768);
386 if (timestamp < 0 || timestamp >= smk->
frames)
402 memset(smk->
pal, 0,
sizeof(smk->
pal));
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
#define AVIO_SEEKABLE_NORMAL
Seeking works like for a local file.
int avio_feof(AVIOContext *s)
Similar to feof() but also returns nonzero on read errors.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
unsigned int avio_rl32(AVIOContext *s)
unsigned int avio_rl24(AVIOContext *s)
int avio_r8(AVIOContext *s)
int ffio_read_size(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
static int read_probe(const AVProbeData *p)
Public libavutil channel layout APIs header.
#define FFERROR_REDO
Returned by demuxers to indicate that data was consumed but discarded (ignored streams or junk data).
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_CODEC_ID_BINKAUDIO_DCT
@ AV_CODEC_ID_BINKAUDIO_RDFT
@ AVDISCARD_ALL
discard all
#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.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, int size, int distance, int flags)
Add an index entry into a sorted list.
int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags)
Get the index for a specific timestamp.
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
#define MKTAG(a, b, c, d)
Memory handling functions.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
int nb_channels
Number of channels in this layout.
This struct describes the properties of an encoded stream.
int extradata_size
Size of the extradata content in bytes.
int height
The height of the video frame in pixels.
int bits_per_coded_sample
The number of bits per sample in the codedwords.
AVChannelLayout ch_layout
The channel layout and number of channels.
int width
The width of the video frame in pixels.
enum AVMediaType codec_type
General type of the encoded data.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
uint8_t * extradata
Extra binary data needed for initializing the decoder, codec-dependent.
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
int sample_rate
The number of audio samples per second.
This structure stores compressed data.
This structure contains the data a format has to probe a file.
Rational number (pair of numerator and denominator).
AVCodecParameters * codecpar
Codec parameters associated with this stream.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown)
int64_t duration
Decoding: duration of the stream, in stream time base.
int index
stream index in AVFormatContext
int64_t data_offset
offset of the first packet
AVIndexEntry * index_entries
Only used if the format does not support seeking natively.
#define av_malloc_array(a, b)