Commit a451324d authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Anton Khirnov

vp9: ignore reference segmentation map if error_resilience flag is set.

Fixes ffvp9_fails_where_libvpx.succeeds.webm.

Bug-Id: ffmpeg/3849.
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent dc3fe45f
...@@ -64,7 +64,7 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f) ...@@ -64,7 +64,7 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f)
f->mv = (VP9MVRefPair*)f->mv_buf->data; f->mv = (VP9MVRefPair*)f->mv_buf->data;
if (s->segmentation.enabled && !s->segmentation.update_map && if (s->segmentation.enabled && !s->segmentation.update_map &&
!s->keyframe && !s->intraonly) !s->keyframe && !s->intraonly && !s->errorres)
memcpy(f->segmentation_map, s->frames[LAST_FRAME].segmentation_map, sz); memcpy(f->segmentation_map, s->frames[LAST_FRAME].segmentation_map, sz);
return 0; return 0;
......
...@@ -70,18 +70,22 @@ static void decode_mode(VP9Context *s, VP9Block *const b) ...@@ -70,18 +70,22 @@ static void decode_mode(VP9Context *s, VP9Block *const b)
vp56_rac_get_prob_branchy(&s->c, vp56_rac_get_prob_branchy(&s->c,
s->prob.segpred[s->above_segpred_ctx[col] + s->prob.segpred[s->above_segpred_ctx[col] +
s->left_segpred_ctx[row7]]))) { s->left_segpred_ctx[row7]]))) {
uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map; if (!s->errorres) {
int pred = MAX_SEGMENT - 1; uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map;
int x; int pred = MAX_SEGMENT - 1;
int x;
if (!s->last_uses_2pass)
ff_thread_await_progress(&s->frames[LAST_FRAME].tf, row >> 3, 0); if (!s->last_uses_2pass)
ff_thread_await_progress(&s->frames[LAST_FRAME].tf, row >> 3, 0);
for (y = 0; y < h4; y++)
for (x = 0; x < w4; x++) for (y = 0; y < h4; y++)
pred = FFMIN(pred, for (x = 0; x < w4; x++)
refsegmap[(y + row) * 8 * s->sb_cols + x + col]); pred = FFMIN(pred,
b->seg_id = pred; refsegmap[(y + row) * 8 * s->sb_cols + x + col]);
b->seg_id = pred;
} else {
b->seg_id = 0;
}
memset(&s->above_segpred_ctx[col], 1, w4); memset(&s->above_segpred_ctx[col], 1, w4);
memset(&s->left_segpred_ctx[row7], 1, h4); memset(&s->left_segpred_ctx[row7], 1, h4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment