77 #define HUFFMAN_TABLE_SIZE (64 * 1024)
118 if ((w == 0) || (w > 1024))
123 if ((h == 0) || (h > 1024))
128 if (sample_rate && (sample_rate < 8000 || sample_rate > 48000))
133 if (number > 2 || sample_rate && !number)
138 if (number > 2 || sample_rate && !number)
158 unsigned int sample_rate, bytes_per_sample, channels;
175 if (sample_rate > 0) {
176 if (sample_rate < 14 || sample_rate > INT_MAX) {
180 if (bytes_per_sample < 1 || bytes_per_sample > 2) {
185 if (channels < 1 || channels > 2) {
226 st->
codec->
bit_rate = sample_rate * bytes_per_sample * 8 * channels;
228 if (bytes_per_sample == 1)
233 if (sample_rate % 14 != 0) {
235 bytes_per_sample * channels;
237 bytes_per_sample * channels;
240 (sample_rate / 14) * bytes_per_sample * channels;
256 unsigned int chunk_size;
261 unsigned char r,
g,
b;
262 unsigned char palette_buffer[768];
272 }
else if (command == 1) {
274 ret =
avio_read(pb, palette_buffer, 768);
277 }
else if (ret != 768) {
283 for (i = 0; i < 768; i++)
284 if (palette_buffer[i] > 63) {
289 for (i = 0; i < 256; i++) {
290 r = palette_buffer[i * 3 ] << palette_scale;
291 g = palette_buffer[i * 3 + 1] << palette_scale;
292 b = palette_buffer[i * 3 + 2] << palette_scale;
293 palette[i] = (0xFF
U << 24) | (r << 16) | (g << 8) | (b);
294 if (palette_scale == 2)
295 palette[i] |= palette[i] >> 6 & 0x30303;
304 if (chunk_size < 4 || chunk_size > INT_MAX - 4) {
314 else if (ret != chunk_size) {
355 int64_t timestamp,
int flags)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_free_packet(AVPacket *pkt)
Free a packet.
static int idcin_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
#define HUFFMAN_TABLE_SIZE
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
int index
stream index in AVFormatContext
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
int64_t avio_skip(AVIOContext *s, int64_t offset)
Skip given number of bytes forward.
#define AV_CH_LAYOUT_STEREO
int block_align
number of bytes per packet if constant and known or 0 Used by some WAV based audio codecs...
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
AVStream ** streams
A list of all streams in the file.
#define AVERROR_EOF
End of file.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
int duration
Duration of this packet in AVStream->time_base units, 0 if unknown.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
unsigned int avio_rl32(AVIOContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int idcin_read_packet(AVFormatContext *s, AVPacket *pkt)
int flags
A combination of AV_PKT_FLAG values.
uint64_t channel_layout
Audio channel layout.
AVCodecContext * codec
Codec context associated with this stream.
int buf_size
Size of buf except extra allocated bytes.
unsigned char * buf
Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero.
static int idcin_probe(AVProbeData *p)
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
int bit_rate
the average bitrate
audio channel layout utility functions
int width
picture width / height.
static int read_header(FFV1Context *f)
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
enum AVMediaType codec_type
int sample_rate
samples per second
AVIOContext * pb
I/O context.
static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
BYTE int const BYTE int int int height
int error
contains the error code or 0 if no error happened
This structure contains the data a format has to probe a file.
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base...
int eof_reached
true if eof reached
int channels
number of audio channels
void * priv_data
Format private data.
static int idcin_read_header(AVFormatContext *s)
AVInputFormat ff_idcin_demuxer
int avio_feof(AVIOContext *s)
feof() equivalent for AVIOContext.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, int size)
Allocate new information of a packet.
#define AV_CH_LAYOUT_MONO
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
This structure stores compressed data.