[x265] [PATCH 2 of 3] Testbench: Check correctness of SEA integral horizontal functions for all possible strides

jayashri at multicorewareinc.com jayashri at multicorewareinc.com
Fri Jun 16 10:56:30 CEST 2017


# HG changeset patch
# User Jayashri Murugan <jayashri at multicorewareinc.com>
# Date 1497506817 -19800
#      Thu Jun 15 11:36:57 2017 +0530
# Node ID 3a4f769d3f27b7e7d02e52e9acee3afa9988fbf4
# Parent  4a7d62d8908dd41d0b88d9bfd72e95aae5cb3489
Testbench: Check correctness of SEA integral horizontal functions for all possible strides

diff -r 4a7d62d8908d -r 3a4f769d3f27 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Fri Jun 09 14:52:03 2017 +0530
+++ b/source/test/pixelharness.cpp	Thu Jun 15 11:36:57 2017 +0530
@@ -2043,25 +2043,31 @@
 
 bool PixelHarness::check_integral_inith(integralh_t ref, integralh_t opt)
 {
-    intptr_t srcStep = 64;
+    /* Since stride is always a multiple of 8 and data movement in AVX2 is 16 elements at a time for 8 bit pixel, we need
+     * to check correctness for two cases: stride multiple of 16 and stride not a multiple of 16; fine for High bit depth
+     * where data movement in AVX2 is 8 elements at a time */
+    intptr_t srcStep[2] = { 56, 64 };
     int j = 0;
     uint32_t dst_ref[BUFFSIZE] = { 0 };
     uint32_t dst_opt[BUFFSIZE] = { 0 };
 
     int padx = 4;
     int pady = 4;
-    uint32_t *dst_ref_ptr = dst_ref + srcStep * pady + padx;
-    uint32_t *dst_opt_ptr = dst_opt + srcStep * pady + padx;
-    for (int k = 0; k < ITERS; k++)
+    for (int l = 0; l < 2; l++)
     {
-        ref(dst_ref_ptr, pixel_test_buff[0], srcStep);
-        checked(opt, dst_opt_ptr, pixel_test_buff[0], srcStep);
-
-        if (memcmp(dst_ref, dst_opt, sizeof(uint32_t) * BUFFSIZE))
-            return false;
-
-        reportfail()
-            j += INCR;
+        uint32_t *dst_ref_ptr = dst_ref + srcStep[l] * pady + padx;
+        uint32_t *dst_opt_ptr = dst_opt + srcStep[l] * pady + padx;
+        for (int k = 0; k < ITERS; k++)
+        {
+            ref(dst_ref_ptr, pixel_test_buff[0], srcStep[l]);
+            checked(opt, dst_opt_ptr, pixel_test_buff[0], srcStep[l]);
+
+            if (memcmp(dst_ref, dst_opt, sizeof(uint32_t) * BUFFSIZE))
+                return false;
+
+            reportfail()
+                j += INCR;
+        }
     }
     return true;
 }


More information about the x265-devel mailing list