shithub: dav1d

Download patch

ref: 7bbc5e3d5c22d5c154cc523b899480d65798d547
parent: dfaa2a101f67f2850f880f28cc77d791966b8a3a
author: Luc Trudeau <ltrudeau@twoorioles.com>
date: Tue Oct 8 03:52:11 EDT 2019

Remove branch when changing bit in LR edges mask

--- a/src/lr_apply_tmpl.c
+++ b/src/lr_apply_tmpl.c
@@ -177,12 +177,8 @@
     }
 
     while (y + stripe_h <= row_h) {
-        // TODO Look into getting rid of the this if
-        if (y + stripe_h == row_h) {
-            edges &= ~LR_HAVE_BOTTOM;
-        } else {
-            edges |= LR_HAVE_BOTTOM;
-        }
+        // Change HAVE_BOTTOM bit in edges to (y + stripe_h != row_h)
+        edges ^= (-(y + stripe_h != row_h) ^ edges) & LR_HAVE_BOTTOM;
         if (lr->type == DAV1D_RESTORATION_WIENER) {
             dsp->lr.wiener(p, p_stride, left, lpf, lpf_stride, unit_w, stripe_h,
                            filterh, filterv, edges HIGHBD_CALL_SUFFIX);