shithub: dav1d

Download patch

ref: 63f96a1f9b5e62d2dd53c1435765e21ffb84ad23
parent: 1787089d4a951d00e343eb97b99f212cccdab3f8
author: Luc Trudeau <[email protected]>
date: Sun Mar 29 06:47:16 EDT 2020

const correctness in itx_1d

--- a/src/itx_1d.c
+++ b/src/itx_1d.c
@@ -119,13 +119,13 @@
         t7a = ((in1 * (4017 - 4096) + in7 *  799          + 2048) >> 12) + in1;
     }
 
-    int t4  = CLIP(t4a + t5a);
-        t5a = CLIP(t4a - t5a);
-    int t7  = CLIP(t7a + t6a);
-        t6a = CLIP(t7a - t6a);
+    const int t4  = CLIP(t4a + t5a);
+              t5a = CLIP(t4a - t5a);
+    const int t7  = CLIP(t7a + t6a);
+              t6a = CLIP(t7a - t6a);
 
-    int t5  = ((t6a - t5a) * 181 + 128) >> 8;
-    int t6  = ((t6a + t5a) * 181 + 128) >> 8;
+    const int t5  = ((t6a - t5a) * 181 + 128) >> 8;
+    const int t6  = ((t6a + t5a) * 181 + 128) >> 8;
 
     const int t0 = c[0 * stride];
     const int t1 = c[2 * stride];
@@ -812,23 +812,23 @@
     const int in4 = in[4 * in_s], in5 = in[5 * in_s];
     const int in6 = in[6 * in_s], in7 = in[7 * in_s];
 
-    int t0a = (((4076 - 4096) * in7 +   401         * in0 + 2048) >> 12) + in7;
-    int t1a = ((  401         * in7 - (4076 - 4096) * in0 + 2048) >> 12) - in0;
-    int t2a = (((3612 - 4096) * in5 +  1931         * in2 + 2048) >> 12) + in5;
-    int t3a = (( 1931         * in5 - (3612 - 4096) * in2 + 2048) >> 12) - in2;
-    int t4a =  ( 1299         * in3 +  1583         * in4 + 1024) >> 11;
-    int t5a =  ( 1583         * in3 -  1299         * in4 + 1024) >> 11;
-    int t6a = (( 1189         * in1 + (3920 - 4096) * in6 + 2048) >> 12) + in6;
-    int t7a = (((3920 - 4096) * in1 -  1189         * in6 + 2048) >> 12) + in1;
+    const int t0a = (((4076 - 4096) * in7 +   401         * in0 + 2048) >> 12) + in7;
+    const int t1a = ((  401         * in7 - (4076 - 4096) * in0 + 2048) >> 12) - in0;
+    const int t2a = (((3612 - 4096) * in5 +  1931         * in2 + 2048) >> 12) + in5;
+    const int t3a = (( 1931         * in5 - (3612 - 4096) * in2 + 2048) >> 12) - in2;
+          int t4a =  ( 1299         * in3 +  1583         * in4 + 1024) >> 11;
+          int t5a =  ( 1583         * in3 -  1299         * in4 + 1024) >> 11;
+          int t6a = (( 1189         * in1 + (3920 - 4096) * in6 + 2048) >> 12) + in6;
+          int t7a = (((3920 - 4096) * in1 -  1189         * in6 + 2048) >> 12) + in1;
 
-    int t0 = CLIP(t0a + t4a);
-    int t1 = CLIP(t1a + t5a);
-    int t2 = CLIP(t2a + t6a);
-    int t3 = CLIP(t3a + t7a);
-    int t4 = CLIP(t0a - t4a);
-    int t5 = CLIP(t1a - t5a);
-    int t6 = CLIP(t2a - t6a);
-    int t7 = CLIP(t3a - t7a);
+    const int t0 = CLIP(t0a + t4a);
+    const int t1 = CLIP(t1a + t5a);
+          int t2 = CLIP(t2a + t6a);
+          int t3 = CLIP(t3a + t7a);
+    const int t4 = CLIP(t0a - t4a);
+    const int t5 = CLIP(t1a - t5a);
+          int t6 = CLIP(t2a - t6a);
+          int t7 = CLIP(t3a - t7a);
 
     t4a = (((3784 - 4096) * t4 +  1567         * t5 + 2048) >> 12) + t4;
     t5a = (( 1567         * t4 - (3784 - 4096) * t5 + 2048) >> 12) - t5;