78#define HUFFMAN_TABLE_SIZE (64 * 1024)
97 unsigned int number, sample_rate;
119 if ((
w == 0) || (
w > 1024))
124 if ((
h == 0) || (
h > 1024))
128 sample_rate =
AV_RL32(&p->buf[8]);
129 if (sample_rate && (sample_rate < 8000 || sample_rate > 48000))
134 if (number > 2 || sample_rate && !number)
139 if (number > 2 || sample_rate && !number)
146 if (
i+12 > p->buf_size ||
AV_RL32(&p->buf[
i+8]) !=
w*
h)
159 unsigned int sample_rate, bytes_per_sample,
channels;
169 if (
s->pb->eof_reached) {
176 if (sample_rate > 0) {
177 if (sample_rate < 14 || sample_rate > INT_MAX) {
181 if (bytes_per_sample < 1 || bytes_per_sample > 2) {
227 if (bytes_per_sample == 1)
232 if (sample_rate % 14 != 0) {
239 (sample_rate / 14) * bytes_per_sample *
channels;
255 unsigned int chunk_size;
260 unsigned char r,
g,
b;
261 unsigned char palette_buffer[768];
262 uint32_t palette[256];
273 ret =
avio_read(pb, palette_buffer, 768);
276 }
else if (ret != 768) {
282 for (
i = 0;
i < 768;
i++)
283 if (palette_buffer[
i] > 63) {
288 for (
i = 0;
i < 256;
i++) {
289 r = palette_buffer[
i * 3 ] << palette_scale;
290 g = palette_buffer[
i * 3 + 1] << palette_scale;
291 b = palette_buffer[
i * 3 + 2] << palette_scale;
292 palette[
i] = (0xFFU << 24) | (
r << 16) | (
g << 8) | (
b);
293 if (palette_scale == 2)
294 palette[
i] |= palette[
i] >> 6 & 0x30303;
298 if (
s->pb->eof_reached) {
303 if (chunk_size < 4 || chunk_size > INT_MAX - 4) {
313 else if (ret != chunk_size) {
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
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.
int avio_read(AVIOContext *s, unsigned char *buf, int size)
Read size bytes from AVIOContext into buf.
unsigned int avio_rl32(AVIOContext *s)
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.
void avpriv_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp)
Update cur_dts of all streams based on the given timestamp and AVStream.
int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size)
Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end which is always set to 0 and f...
static int read_header(FFV1Context *f, RangeCoder *c)
@ AV_PKT_DATA_PALETTE
An AV_PKT_DATA_PALETTE side data packet contains exactly AVPALETTE_SIZE bytes worth of palette.
uint8_t * av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, size_t size)
Allocate new information of a packet.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
AVStream * avformat_new_stream(AVFormatContext *s, const struct AVCodec *c)
Add a new stream to a media file.
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_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...
static int idcin_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int idcin_read_header(AVFormatContext *s)
static int idcin_read_packet(AVFormatContext *s, AVPacket *pkt)
static int idcin_probe(const AVProbeData *p)
#define HUFFMAN_TABLE_SIZE
#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)
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.
int64_t bit_rate
The average bitrate of the encoded data (in bits per second).
enum AVMediaType codec_type
General type of the encoded data.
int block_align
The number of bytes per coded audio frame, required by some formats.
uint32_t codec_tag
Additional information about the codec (corresponds to the AVI FOURCC).
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.
AVCodecParameters * codecpar
Codec parameters associated with this stream.
int index
stream index in AVFormatContext
int64_t start_time
Decoding: pts of the first frame of the stream in presentation order, in stream time base.
static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)