summaryrefslogtreecommitdiff
path: root/libavcodec/vp9block.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2014-08-12 18:11:05 -0400
committerAnton Khirnov <anton@khirnov.net>2016-10-04 10:54:07 +0200
commita451324dddf5d2ab4bcd6aa0f546596f71bdada3 (patch)
treea88600218b73f967f1089cddb4f3f4af8c493129 /libavcodec/vp9block.c
parentdc3fe45fca9c10c4af6bfcf48eb7b81968892ef9 (diff)
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: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vp9block.c')
-rw-r--r--libavcodec/vp9block.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/libavcodec/vp9block.c b/libavcodec/vp9block.c
index 9b0d836adc..cd40c38989 100644
--- a/libavcodec/vp9block.c
+++ b/libavcodec/vp9block.c
@@ -70,18 +70,22 @@ static void decode_mode(VP9Context *s, VP9Block *const b)
vp56_rac_get_prob_branchy(&s->c,
s->prob.segpred[s->above_segpred_ctx[col] +
s->left_segpred_ctx[row7]]))) {
- uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map;
- int pred = MAX_SEGMENT - 1;
- int x;
-
- 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++)
- pred = FFMIN(pred,
- refsegmap[(y + row) * 8 * s->sb_cols + x + col]);
- b->seg_id = pred;
+ if (!s->errorres) {
+ uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map;
+ int pred = MAX_SEGMENT - 1;
+ int x;
+
+ 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++)
+ pred = FFMIN(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->left_segpred_ctx[row7], 1, h4);