From 0f4253f24d80346c4afea3e09e0db906c04aad3d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 28 Oct 2018 12:03:10 -0400 Subject: [PATCH] Backup extra 8 pixels at bottom of frame Fixes #112. --- src/lr_apply_tmpl.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lr_apply_tmpl.c b/src/lr_apply_tmpl.c index 03cc44c9..f2bf6075 100644 --- a/src/lr_apply_tmpl.c +++ b/src/lr_apply_tmpl.c @@ -218,10 +218,6 @@ static void lr_sbrow(const Dav1dFrameContext *const f, pixel *p, const int y, // Merge last restoration unit if its height is < half_unit_size if (ruy > 0) ruy -= (ruy << unit_size_log2) + half_unit_size > h; - // The first stripe of the frame is shorter by 8 luma pixel rows. - const int filter_h = - imin(((1 << (6 + f->seq_hdr.sb128)) - 8 * !y) >> ss_ver, h - y); - pixel pre_lr_border[2][128 + 8 /* maximum sbrow height is 128 + 8 rows offset */][4]; int unit_w = unit_size, bit = 0; @@ -248,7 +244,7 @@ static void lr_sbrow(const Dav1dFrameContext *const f, pixel *p, const int y, // FIXME Don't backup if the next restoration unit is RESTORE_NONE // This also requires not restoring in the same conditions. if (edges & LR_HAVE_RIGHT) { - backup4xU(pre_lr_border[bit], p + unit_w - 4, p_stride, filter_h); + backup4xU(pre_lr_border[bit], p + unit_w - 4, p_stride, row_h - y); } if (lr->type != RESTORATION_NONE) { lr_stripe(f, p, pre_lr_border[!bit], x, y, plane, unit_w, row_h, lr, edges);