shithub: dav1d

Download patch

ref: 3d6479cee8170cbcc1b6c3cea7338e86b3594683
parent: d04d0a6cf61c14f65c6cb3c07bbc8096bab564db
author: Luc Trudeau <[email protected]>
date: Fri May 17 10:43:05 EDT 2019

Remove one multiply in Z2 filter top left

--- a/src/ipred_prepare_tmpl.c
+++ b/src/ipred_prepare_tmpl.c
@@ -191,14 +191,14 @@
     }
 
     if (av1_intra_prediction_edges[mode].needs_topleft) {
-        if (have_left) {
+        if (have_left)
             *topleft_out = have_top ? dst_top[-1] : dst[-1];
-        } else {
+        else
             *topleft_out = have_top ? *dst_top : (1 << bitdepth) >> 1;
-        }
+
         if (mode == Z2_PRED && tw + th >= 6 && filter_edge)
-            *topleft_out = (topleft_out[-1] * 5 + topleft_out[0] * 6 +
-                            topleft_out[1] * 5 + 8) >> 4;
+            *topleft_out = ((topleft_out[-1] + topleft_out[1]) * 5 +
+                            topleft_out[0] * 6 + 8) >> 4;
     }
 
     return mode;