diff options
author | James Almer <jamrial@gmail.com> | 2023-04-12 13:58:54 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-05-04 18:48:22 -0300 |
commit | dc7bd7c5a5ad5ea800dfb63cc5dd15670d065527 (patch) | |
tree | 91cd3a4ae8b34601f34ff98aa4beb1ac1b5b28c2 /libavcodec/vp5.c | |
parent | cc11191fda0471017b03c1434d6d8cb79f6914e5 (diff) |
avcodec: use the new AVFrame key_frame flag in all decoders and encoders
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/vp5.c')
-rw-r--r-- | libavcodec/vp5.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index 579333506a..78d4b38ce3 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -44,10 +44,13 @@ static int vp5_parse_header(VP56Context *s, const uint8_t *buf, int buf_size) ret = ff_vpx_init_range_decoder(&s->c, buf, buf_size); if (ret < 0) return ret; - s->frames[VP56_FRAME_CURRENT]->key_frame = !vpx_rac_get(c); + if (!vpx_rac_get(c)) + s->frames[VP56_FRAME_CURRENT]->flags |= AV_FRAME_FLAG_KEY; + else + s->frames[VP56_FRAME_CURRENT]->flags &= ~AV_FRAME_FLAG_KEY; vpx_rac_get(c); ff_vp56_init_dequant(s, vp56_rac_gets(c, 6)); - if (s->frames[VP56_FRAME_CURRENT]->key_frame) + if (s->frames[VP56_FRAME_CURRENT]->flags & AV_FRAME_FLAG_KEY) { int render_x, render_y; @@ -148,7 +151,7 @@ static int vp5_parse_coeff_models(VP56Context *s) if (vpx_rac_get_prob_branchy(c, vp5_dccv_pct[pt][node])) { def_prob[node] = vp56_rac_gets_nn(c, 7); model->coeff_dccv[pt][node] = def_prob[node]; - } else if (s->frames[VP56_FRAME_CURRENT]->key_frame) { + } else if (s->frames[VP56_FRAME_CURRENT]->flags & AV_FRAME_FLAG_KEY) { model->coeff_dccv[pt][node] = def_prob[node]; } @@ -159,7 +162,7 @@ static int vp5_parse_coeff_models(VP56Context *s) if (vpx_rac_get_prob_branchy(c, vp5_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->frames[VP56_FRAME_CURRENT]->key_frame) { + } else if (s->frames[VP56_FRAME_CURRENT]->flags & AV_FRAME_FLAG_KEY) { model->coeff_ract[pt][ct][cg][node] = def_prob[node]; } |