ONE
} VC1ParseSearchState;
-typedef struct {
+typedef struct VC1ParseContext {
ParseContext pc;
VC1Context v;
uint8_t prev_start_code;
break;
}
+ s->format = vpc->v.chromaformat == 1 ? AV_PIX_FMT_YUV420P
+ : AV_PIX_FMT_NONE;
+ if (avctx->width && avctx->height) {
+ s->width = avctx->width;
+ s->height = avctx->height;
+ s->coded_width = FFALIGN(avctx->coded_width, 16);
+ s->coded_height = FFALIGN(avctx->coded_height, 16);
+ }
}
static int vc1_parse(AVCodecParserContext *s,
uint8_t *unesc_buffer = vpc->unesc_buffer;
size_t unesc_index = vpc->unesc_index;
VC1ParseSearchState search_state = vpc->search_state;
+ int start_code_found = 0;
int next = END_NOT_FOUND;
int i = vpc->bytes_to_skip;
next = 0;
}
while (i < buf_size) {
- int start_code_found = 0;
uint8_t b;
+ start_code_found = 0;
while (i < buf_size && unesc_index < UNESCAPED_THRESHOLD) {
b = buf[i++];
unesc_buffer[unesc_index++] = b;
* the start code we've already seen, or cause extra bytes to be
* inserted at the start of the unescaped buffer. */
vpc->bytes_to_skip = 4;
- if (next < 0)
+ if (next < 0 && start_code_found)
vpc->bytes_to_skip += next;
*poutbuf = buf;