FFmpeg
|
flac_parser.c
Go to the documentation of this file.
573 && av_fifo_realloc2(fpc->fifo_buf, (read_end - read_start) + 2*av_fifo_size(fpc->fifo_buf)) < 0) {
static int frame_header_is_valid(AVCodecContext *avctx, const uint8_t *buf, FLACFrameInfo *fi)
Definition: flac_parser.c:91
Definition: start.py:1
struct FLACHeaderMarker FLACHeaderMarker
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205
uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)
Calculate the CRC of a block.
Definition: crc.c:275
Definition: libavcodec/avcodec.h:393
struct FLACParseContext FLACParseContext
AVFifoBuffer * fifo_buf
buffer to store all data until headers can be verified
Definition: flac_parser.c:84
int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int(*func)(void *, void *, int))
Feed data from a user-supplied callback to an AVFifoBuffer.
Definition: libavutil/fifo.c:96
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
int best_header_valid
flag set when the parser returns junk; if set return best_header next time
Definition: flac_parser.c:82
int nb_headers_found
number of headers found in the last flac_parse() call
Definition: flac_parser.c:79
const AVCRC * av_crc_get_table(AVCRCId crc_id)
Get an initialized standard CRC table.
Definition: crc.c:261
Definition: flac_parser.c:58
static int get_best_header(FLACParseContext *fpc, const uint8_t **poutbuf, int *poutbuf_size)
Definition: flac_parser.c:446
#define FLAC_MAX_SEQUENTIAL_HEADERS
maximum number of adjacent headers that compare CRCs against each other
Definition: flac_parser.c:42
static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition: flac_parser.c:479
Definition: flac.h:83
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:183
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given block if it is not large enough, otherwise do nothing.
Definition: libavcodec/utils.c:63
FLAC (Free Lossless Audio Codec) decoder/demuxer common functions.
int ff_flac_decode_frame_header(AVCodecContext *avctx, GetBitContext *gb, FLACFrameInfo *fi, int log_level_offset)
Validate and decode a frame header.
Definition: flac.c:50
Definition: libavcodec/avcodec.h:3883
struct FLACHeaderMarker * next
next CRC-8 verified header that immediately follows this one in the bytestream
Definition: flac_parser.c:65
FLACHeaderMarker * headers
linked-list that starts at the first CRC-8 verified header within buffer
Definition: flac_parser.c:76
#define FLAC_MIN_HEADERS
minimum number of headers buffered and checked before returning frames
Definition: flac_parser.c:44
static uint8_t * flac_fifo_read_wrap(FLACParseContext *fpc, int offset, int len, uint8_t **wrap_buf, int *allocated_size)
Non-destructive fast fifo pointer fetching Returns a pointer from the specified offset.
Definition: flac_parser.c:112
Definition: libavcodec/avcodec.h:3747
Definition: fifo.h:31
int av_fifo_space(AVFifoBuffer *f)
Return the amount of space in bytes in the AVFifoBuffer, that is the amount of data you can write int...
Definition: libavutil/fifo.c:57
int max_score
maximum score found after checking each child that has a valid CRC
Definition: flac_parser.c:62
static int find_headers_search_validate(FLACParseContext *fpc, int offset)
Definition: flac_parser.c:163
Definition: flac_parser.c:73
int av_fifo_realloc2(AVFifoBuffer *f, unsigned int new_size)
Resize an AVFifoBuffer.
Definition: libavutil/fifo.c:62
a very simple circular buffer FIFO implementation
static int find_new_headers(FLACParseContext *fpc, int search_start)
Definition: flac_parser.c:225
void ff_flac_set_channel_layout(AVCodecContext *avctx)
Definition: flac.c:196
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:73
static int score_header(FLACParseContext *fpc, FLACHeaderMarker *header)
Score a header.
Definition: flac_parser.c:396
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:379
int * link_penalty
pointer to array of local scores between this header and the one at a distance equal array position ...
Definition: flac_parser.c:60
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Buffer references ownership and permissions
int av_fifo_size(AVFifoBuffer *f)
Return the amount of data in bytes in the AVFifoBuffer, that is the amount of data you can read from ...
Definition: libavutil/fifo.c:52
Definition: get_bits.h:54
static int find_headers_search(FLACParseContext *fpc, uint8_t *buf, int buf_size, int search_start)
Definition: flac_parser.c:201
Definition: crc.h:32
AVFifoBuffer * av_fifo_alloc(unsigned int size)
Initialize an AVFifoBuffer.
Definition: libavutil/fifo.c:25
int is_var_size
specifies if the stream uses variable block sizes or a fixed block size; also determines the meaning ...
Definition: flac.h:88
static uint8_t * flac_fifo_read(FLACParseContext *fpc, int offset, int *len)
Return a pointer in the fifo buffer where the offset starts at until the wrap point or end of request...
Definition: flac_parser.c:152
struct FLACHeaderMarker * best_child
following frame header with which this frame has the best score with
Definition: flac_parser.c:68
void av_fifo_drain(AVFifoBuffer *f, int size)
Discard data from the FIFO.
Definition: libavutil/fifo.c:142
static int check_header_mismatch(FLACParseContext *fpc, FLACHeaderMarker *header, FLACHeaderMarker *child, int log_level_offset)
Definition: flac_parser.c:269
Generated on Mon Nov 18 2024 06:51:54 for FFmpeg by 1.8.11