38 int res,
profile, keyframe, invisible;
45 if (profile == 3) profile +=
get_bits1(&gb);
96 return s->
n_frames > 0 ? *out_size : size ;
99 marker = data[size - 1];
100 if ((marker & 0xe0) == 0xc0) {
101 int nbytes = 1 + ((marker >> 3) & 0x3);
102 int n_frames = 1 + (marker & 0x7), idx_sz = 2 + n_frames * nbytes;
104 if (size >= idx_sz && data[size - idx_sz] == marker) {
105 const uint8_t *idx = data + size + 1 - idx_sz;
109 #define case_n(a, rd) \
111 while (n_frames--) { \
114 if (sz == 0 || sz > size) { \
118 av_log(avctx, AV_LOG_ERROR, \
119 "Invalid superframe packet size: %u frame size: %d\n", \
127 s->n_frames = n_frames; \
129 s->size[n_frames] = sz; \
134 parse_frame(ctx, *out_data, *out_size); \
135 return s->n_frames > 0 ? *out_size : full_size
155 .parser_parse =
parse,
AVCodecParser ff_vp9_parser
ptrdiff_t const GLvoid * data
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int parse(AVCodecParserContext *ctx, AVCodecContext *avctx, const uint8_t **out_data, int *out_size, const uint8_t *data, int size)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
bitstream reader API header.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_RL24
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
static unsigned int get_bits1(GetBitContext *s)
static int parse_frame(AVCodecParserContext *ctx, const uint8_t *buf, int size)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
#define AV_NOPTS_VALUE
Undefined timestamp value.