diff options
Diffstat (limited to 'libavcodec/vp6.c')
-rw-r--r-- | libavcodec/vp6.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index f761aa7..6fd1f50 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -53,10 +53,10 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) int res = 0; int separated_coeff = buf[0] & 1; - s->framep[VP56_FRAME_CURRENT]->key_frame = !(buf[0] & 0x80); + s->frames[VP56_FRAME_CURRENT]->key_frame = !(buf[0] & 0x80); ff_vp56_init_dequant(s, (buf[0] >> 1) & 0x3F); - if (s->framep[VP56_FRAME_CURRENT]->key_frame) { + if (s->frames[VP56_FRAME_CURRENT]->key_frame) { sub_version = buf[1] >> 3; if (sub_version > 8) return AVERROR_INVALIDDATA; @@ -143,7 +143,7 @@ static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) buf += coeff_offset; buf_size -= coeff_offset; if (buf_size < 0) { - if (s->framep[VP56_FRAME_CURRENT]->key_frame) + if (s->frames[VP56_FRAME_CURRENT]->key_frame) avcodec_set_dimensions(s->avctx, 0, 0); return AVERROR_INVALIDDATA; } @@ -258,7 +258,7 @@ static int vp6_parse_coeff_models(VP56Context *s) if (vp56_rac_get_prob(c, vp6_dccv_pct[pt][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_dccv[pt][node] = def_prob[node]; - } else if (s->framep[VP56_FRAME_CURRENT]->key_frame) { + } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { model->coeff_dccv[pt][node] = def_prob[node]; } @@ -281,7 +281,7 @@ static int vp6_parse_coeff_models(VP56Context *s) if (vp56_rac_get_prob(c, vp6_ract_pct[ct][pt][cg][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_ract[pt][ct][cg][node] = def_prob[node]; - } else if (s->framep[VP56_FRAME_CURRENT]->key_frame) { + } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { model->coeff_ract[pt][ct][cg][node] = def_prob[node]; } @@ -594,9 +594,12 @@ static av_cold void vp6_decode_init_context(VP56Context *s); static av_cold int vp6_decode_init(AVCodecContext *avctx) { VP56Context *s = avctx->priv_data; + int ret; + + if ((ret = ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6, + avctx->codec->id == AV_CODEC_ID_VP6A)) < 0) + return ret; - ff_vp56_init(avctx, avctx->codec->id == AV_CODEC_ID_VP6, - avctx->codec->id == AV_CODEC_ID_VP6A); vp6_decode_init_context(s); if (s->has_alpha) { @@ -606,8 +609,6 @@ static av_cold int vp6_decode_init(AVCodecContext *avctx) ff_vp56_init_context(avctx, s->alpha_context, s->flip == -1, s->has_alpha); vp6_decode_init_context(s->alpha_context); - for (i = 0; i < 6; ++i) - s->alpha_context->framep[i] = s->framep[i]; } return 0; |