36 #define IS_MARKER(state, i, buf, buf_size) \
37 ((state == DCA_MARKER_14B_LE && (i < buf_size-2) && (buf[i+1] & 0xF0) == 0xF0 && buf[i+2] == 0x07) \
38 || (state == DCA_MARKER_14B_BE && (i < buf_size-2) && buf[i+1] == 0x07 && (buf[i+2] & 0xF0) == 0xF0) \
39 || state == DCA_MARKER_RAW_LE || state == DCA_MARKER_RAW_BE)
57 for (i = 0; i < buf_size; i++) {
58 state = (state << 8) | buf[i];
72 for (; i < buf_size; i++) {
74 state = (state << 8) | buf[i];
105 const uint8_t ** poutbuf,
int *poutbuf_size,
106 const uint8_t * buf,
int buf_size)
124 *poutbuf_size = buf_size;
static av_cold int dca_parse_init(AVCodecParserContext *s)
static int dca_find_frame_end(DCAParseContext *pc1, const uint8_t *buf, int buf_size)
Find the end of the current frame in the bitstream.
#define DCA_HD_MARKER
DCA-HD specific block starts with this marker.
AVCodecParser ff_dca_parser
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
#define IS_MARKER(state, i, buf, buf_size)
void ff_parse_close(AVCodecParserContext *s)
struct DCAParseContext DCAParseContext
static int dca_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
main external API structure.
uint32_t state
contains the last few bytes in MSB order
#define PARSER_FLAG_COMPLETE_FRAMES