shithub: dav1d

Download patch

ref: 48d9c68300045e3b760b532f5e320e902299a406
parent: b338afc5217f6ce90d40ee922962fd8ea88698fc
author: Luc Trudeau <[email protected]>
date: Fri Feb 15 16:22:38 EST 2019

Clipping in the second weight of SGRProj is useless

It was found by Christopher "Monty" Montgomery that when a value
between 224 and 96 is clipped between -32 and 95, the resulting
value will always be 95.

--- a/src/decode.c
+++ b/src/decode.c
@@ -2415,7 +2415,7 @@
         lr->sgr_weights[1] = dav1d_sgr_params[idx][1] ?
             dav1d_msac_decode_subexp(&ts->msac,
                 ts->lr_ref[p]->sgr_weights[1] + 32, 128, 4) - 32 :
-            iclip(128 - lr->sgr_weights[0], -32, 95);
+            95;
         memcpy(lr->filter_v, ts->lr_ref[p]->filter_v, sizeof(lr->filter_v));
         memcpy(lr->filter_h, ts->lr_ref[p]->filter_h, sizeof(lr->filter_h));
         ts->lr_ref[p] = lr;