diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2018-11-19 00:42:42 +0300 |
---|---|---|
committer | Janne Grunau <janne-vlc@jannau.net> | 2018-11-19 01:03:51 +0300 |
commit | 9202089979a8dc0d5890288201f2e6e38b0aed49 (patch) | |
tree | e60630228e9809c83db897a7c553c71aa2f6ebaf | |
parent | c496fab4abbc8ec28fa575d38119d35eaffb91bb (diff) |
Don't initialize the LR values if LR is disabled for a plane
Also fix a calculation for u_idx. Fixes 5646860283281408 of #183.
-rw-r--r-- | src/decode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/decode.c b/src/decode.c index 89cda0a..12e7520 100644 --- a/src/decode.c +++ b/src/decode.c @@ -2241,6 +2241,9 @@ static void setup_tile(Dav1dTileState *const ts, ((ts->tiling.col_start & 16) >> 4); } for (int p = 0; p < 3; p++) { + if (f->frame_hdr.restoration.type[p] == RESTORATION_NONE) + continue; + if (f->frame_hdr.super_res.enabled) { const int ss_hor = p && f->cur.p.layout != DAV1D_PIXEL_LAYOUT_I444; const int d = f->frame_hdr.super_res.width_scale_denominator; @@ -2248,7 +2251,7 @@ static void setup_tile(Dav1dTileState *const ts, const int rnd = (8 << unit_size_log2) - 1, shift = unit_size_log2 + 3; const int x = ((4 * ts->tiling.col_start * d >> ss_hor) + rnd) >> shift; const int px_x = x << (unit_size_log2 + ss_hor); - const int u_idx = unit_idx + ((px_x & 64) >> 1); + const int u_idx = unit_idx + ((px_x & 64) >> 6); ts->lr_ref[p] = &f->lf.lr_mask[sb_idx + (px_x >> 7)].lr[p][u_idx]; } else { ts->lr_ref[p] = &f->lf.lr_mask[sb_idx].lr[p][unit_idx]; |