MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / cavs_parse_frame

Function cavs_parse_frame

libavcodec/cavs_parser.c:123–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static int cavs_parse_frame(AVCodecParserContext *s, AVCodecContext *avctx,
124 const uint8_t *buf, int buf_size)
125{
126 GetBitContext gb;
127 const uint8_t *buf_end;
128 const uint8_t *buf_ptr;
129 uint32_t stc = -1;
130
131 s->key_frame = 0;
132 s->pict_type = AV_PICTURE_TYPE_NONE;
133
134 if (buf_size == 0)
135 return 0;
136
137 buf_ptr = buf;
138 buf_end = buf + buf_size;
139 for (;;) {
140 buf_ptr = avpriv_find_start_code(buf_ptr, buf_end, &stc);
141 if ((stc & 0xFFFFFE00) || buf_ptr == buf_end)
142 return 0;
143 switch (stc) {
144 case CAVS_START_CODE:
145 if (init_get_bits8(&gb, buf_ptr, buf_end - buf_ptr) < 0)
146 return 0;
147 parse_seq_header(s, avctx, &gb);
148 break;
149 case PIC_I_START_CODE:
150 s->key_frame = 1;
151 s->pict_type = AV_PICTURE_TYPE_I;
152 break;
153 default:
154 break;
155 }
156 }
157}
158
159static int cavsvideo_parse(AVCodecParserContext *s,
160 AVCodecContext *avctx,

Callers 1

cavsvideo_parseFunction · 0.85

Calls 3

avpriv_find_start_codeFunction · 0.85
init_get_bits8Function · 0.85
parse_seq_headerFunction · 0.85

Tested by

no test coverage detected