shithub: dav1d

Download patch

ref: b0ef764306decd63a18f2c961b1c602e77760323
parent: 29cae6043acff914247069a3b87205f4c3b641dc
author: Martin Storsjö <[email protected]>
date: Wed Feb 6 06:10:34 EST 2019

checkasm: cdef: Don't use uninitialized buffer contents for the test

This makes sure the test actually is deterministic based on the
seed value.

--- a/tests/checkasm/cdef.c
+++ b/tests/checkasm/cdef.c
@@ -53,9 +53,6 @@
     if (check_func(fn, "%s_%dbpc", name, BITDEPTH)) {
         for (int dir = 0; dir < 8; dir++) {
             for (enum CdefEdgeFlags edges = 0; edges <= 0xf; edges++) {
-                memcpy(a_src, src, (10 * 16 + 8) * sizeof(pixel));
-                memcpy(c_src, src, (10 * 16 + 8) * sizeof(pixel));
-
 #if BITDEPTH == 16
                 const int bitdepth_max = rnd() & 1 ? 0x3ff : 0xfff;
 #else
@@ -65,6 +62,9 @@
                 init_tmp(src, 10 * 16 + 8, bitdepth_max);
                 init_tmp(top, 16 * 2 + 8, bitdepth_max);
                 init_tmp((pixel *) left,8 * 2, bitdepth_max);
+
+                memcpy(a_src, src, (10 * 16 + 8) * sizeof(pixel));
+                memcpy(c_src, src, (10 * 16 + 8) * sizeof(pixel));
 
                 const int lvl = 1 + (rnd() % 62);
                 const int damping = 3 + (rnd() & 3) + bitdepth_min_8;