|static int ||frame_header_is_valid (AVCodecContext *avctx, const uint8_t *buf, FLACFrameInfo *fi)|
|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. |
|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. |
|static int ||find_headers_search_validate (FLACParseContext *fpc, int offset)|
|static int ||find_headers_search (FLACParseContext *fpc, uint8_t *buf, int buf_size, int search_start)|
|static int ||find_new_headers (FLACParseContext *fpc, int search_start)|
|static int ||check_header_mismatch (FLACParseContext *fpc, FLACHeaderMarker *header, FLACHeaderMarker *child, int log_level_offset)|
|static int ||score_header (FLACParseContext *fpc, FLACHeaderMarker *header)|
| ||Score a header. |
|static void ||score_sequences (FLACParseContext *fpc)|
|static int ||get_best_header (FLACParseContext *fpc, const uint8_t **poutbuf, int *poutbuf_size)|
|static int ||flac_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)|
|static av_cold int ||flac_parse_init (AVCodecParserContext *c)|
|static void ||flac_parse_close (AVCodecParserContext *c)|
The FLAC parser buffers input until FLAC_MIN_HEADERS has been found. Each time it finds and verifies a CRC-8 header it sees which of the FLAC_MAX_SEQUENTIAL_HEADERS that came before it have a valid CRC-16 footer that ends at the newly found header. Headers are scored by FLAC_HEADER_BASE_SCORE plus the max of its crc-verified children, penalized by changes in sample rate, frame number, etc. The parser returns the frame with the highest score.
Definition in file flac_parser.c.
Non-destructive fast fifo pointer fetching Returns a pointer from the specified offset.
If possible the pointer points within the fifo buffer. Otherwise (if it would cause a wrap around,) a pointer to a user-specified buffer is used. The pointer can be NULL. In any case it will be reallocated to hold the size. If the returned pointer will be used after subsequent calls to flac_fifo_read_wrap then the subsequent calls should pass in a different wrap_buf so as to not overwrite the contents of the previous wrap_buf. This function is based on av_fifo_generic_read, which is why there is a comment about a memory barrier for SMP.
Definition at line 113 of file flac_parser.c.
Referenced by find_headers_search_validate(), flac_parse(), and get_best_header().
Score a header.
Give FLAC_HEADER_BASE_SCORE points to a frame for existing. If it has children, (subsequent frames of which the preceding CRC footer validates against this one,) then take the maximum score of the children, with a penalty of FLAC_HEADER_CHANGED_PENALTY applied for each change to bps, sample rate, channels, but not decorrelation mode, or blocksize, because it can change often.
Definition at line 397 of file flac_parser.c.
Referenced by score_sequences().