39 int res,
profile, keyframe, invisible;
46 if (profile == 3) profile +=
get_bits1(&gb);
97 size_sum += s->
size[i];
100 if (size_sum != size) {
112 return s->
n_frames > 0 ? *out_size : size ;
115 marker = data[size - 1];
116 if ((marker & 0xe0) == 0xc0) {
117 int nbytes = 1 + ((marker >> 3) & 0x3);
118 int n_frames = 1 + (marker & 0x7), idx_sz = 2 + n_frames * nbytes;
120 if (size >= idx_sz && data[size - idx_sz] == marker) {
121 const uint8_t *idx = data + size + 1 - idx_sz;
125 #define case_n(a, rd) \
127 while (n_frames--) { \
130 if (sz == 0 || sz > size) { \
134 av_log(avctx, AV_LOG_ERROR, \
135 "Invalid superframe packet size: %u frame size: %d\n", \
143 s->n_frames = n_frames; \
145 s->size[n_frames] = sz; \
150 s->marker_size = size; \
151 parse_frame(ctx, *out_data, *out_size); \
152 return s->n_frames > 0 ? *out_size : full_size
172 .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.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
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.