28 #include "libavutil/bswap.h"
29 #include "libavutil/channel_layout.h"
30 #include "libavutil/intreadwrite.h"
34 #define SMACKER_PAL 0x01
35 #define SMACKER_FLAG_RING_FRAME 0x01
84 0x00, 0x04, 0x08, 0x0C, 0x10, 0x14, 0x18, 0x1C,
85 0x20, 0x24, 0x28, 0x2C, 0x30, 0x34, 0x38, 0x3C,
86 0x41, 0x45, 0x49, 0x4D, 0x51, 0x55, 0x59, 0x5D,
87 0x61, 0x65, 0x69, 0x6D, 0x71, 0x75, 0x79, 0x7D,
88 0x82, 0x86, 0x8A, 0x8E, 0x92, 0x96, 0x9A, 0x9E,
89 0xA2, 0xA6, 0xAA, 0xAE, 0xB2, 0xB6, 0xBA, 0xBE,
90 0xC3, 0xC7, 0xCB, 0xCF, 0xD3, 0xD7, 0xDB, 0xDF,
91 0xE3, 0xE7, 0xEB, 0xEF, 0xF3, 0xF7, 0xFB, 0xFF
97 if(p->
buf[0] ==
'S' && p->
buf[1] ==
'M' && p->
buf[2] ==
'K'
98 && (p->
buf[3] ==
'2' || p->
buf[3] ==
'4'))
123 for(i = 0; i < 7; i++)
137 for(i = 0; i < 7; i++) {
143 if(smk->
frames > 0xFFFFFF) {
153 for(i = 0; i < smk->
frames; i++) {
156 for(i = 0; i < smk->
frames; i++) {
181 for(i = 0; i < 7; i++) {
220 "Cannot allocate %"PRIu32
" bytes of extradata\n",
263 int size, sz, t, off, j, pos;
267 memcpy(oldpal, pal, 768);
277 sz += (t & 0x7F) + 1;
278 pal += ((t & 0x7F) + 1) * 3;
282 if (off + j > 0x100) {
284 "Invalid palette update, offset=%d length=%d extends beyond palette size\n",
289 while(j-- && sz < 256) {
290 *pal++ = oldpal[off + 0];
291 *pal++ = oldpal[off + 1];
292 *pal++ = oldpal[off + 2];
309 for(i = 0; i < 7; i++) {
315 if (!size || size > frame_size) {
334 if (frame_size < 0 || frame_size >= INT_MAX/2)
340 pkt->
data[0] = palchange;
341 memcpy(pkt->
data + 1, smk->
pal, 768);
343 if(ret != frame_size)
347 pkt->
size = ret + 769;
371 for(i = 0; i < 7; i++)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
AVCodecContext * codec
Codec context associated with this stream.
int index
stream index in AVFormatContext
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
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
int av_reallocp(void *ptr, size_t size)
Allocate or reallocate a block of memory.
#define AVERROR_EOF
End of file.
static av_cold int read_close(AVFormatContext *ctx)
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.
static const uint8_t frame_size[4]
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.
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. ...
uint64_t channel_layout
Audio channel layout.
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
#define FF_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
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)
8 bit with PIX_FMT_RGB32 palette
enum AVMediaType codec_type
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)
This structure contains the data a format has to probe a file.
#define MKTAG(a, b, c, d)
int64_t duration
Decoding: duration of the stream, in stream time base.
int eof_reached
true if eof reached
int channels
number of audio channels
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...