You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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>
This commit is contained in:
committed by
Anton Khirnov
parent
dc3fe45fca
commit
a451324ddd
@@ -64,7 +64,7 @@ static int vp9_frame_alloc(AVCodecContext *avctx, VP9Frame *f)
|
||||
f->mv = (VP9MVRefPair*)f->mv_buf->data;
|
||||
|
||||
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);
|
||||
|
||||
return 0;
|
||||
|
@@ -70,6 +70,7 @@ 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]]))) {
|
||||
if (!s->errorres) {
|
||||
uint8_t *refsegmap = s->frames[LAST_FRAME].segmentation_map;
|
||||
int pred = MAX_SEGMENT - 1;
|
||||
int x;
|
||||
@@ -82,6 +83,9 @@ static void decode_mode(VP9Context *s, VP9Block *const b)
|
||||
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);
|
||||
|
Reference in New Issue
Block a user