shithub: dav1d

Download patch

ref: 0f4253f24d80346c4afea3e09e0db906c04aad3d
parent: 172f277b56a221ef504179b95542c5bb9e468166
author: Ronald S. Bultje <rsbultje@gmail.com>
date: Sun Oct 28 08:03:10 EDT 2018

Backup extra 8 pixels at bottom of frame

Fixes #112.

--- a/src/lr_apply_tmpl.c
+++ b/src/lr_apply_tmpl.c
@@ -218,10 +218,6 @@
     // 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 @@
         // 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);