[x265] [PATCH] pixelHarness: add testharness code for estimateCUPropagateCost

santhoshini at multicorewareinc.com santhoshini at multicorewareinc.com
Fri Jan 30 06:12:02 CET 2015


# HG changeset patch
# User Santhoshini Sekar<santhoshini at multicorewareinc.com>
# Date 1422440917 -19800
#      Wed Jan 28 15:58:37 2015 +0530
# Node ID 76c6b079e6b363d42073f09144e255d5ad1dc863
# Parent  5e5dc3763f6386da9722903033a2b9dd263a5226
pixelHarness: add testharness code for estimateCUPropagateCost

diff -r 5e5dc3763f63 -r 76c6b079e6b3 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Thu Jan 29 10:37:54 2015 -0600
+++ b/source/test/pixelharness.cpp	Wed Jan 28 15:58:37 2015 +0530
@@ -1048,6 +1048,34 @@
     return true;
 }
 
+bool PixelHarness::check_cutree_propagate_cost(cutree_propagate_cost ref, cutree_propagate_cost opt)
+{
+    ALIGN_VAR_16(int, ref_dest[64 * 64]);
+    ALIGN_VAR_16(int, opt_dest[64 * 64]);
+
+    memset(ref_dest, 0xCD, sizeof(ref_dest));
+    memset(opt_dest, 0xCD, sizeof(opt_dest));
+
+    double fps = 1.0;
+    int width = 16 + rand() % 64;
+    int j = 0;
+
+    for (int i = 0; i < ITERS; i++)
+    {
+        int index = i % TEST_CASES;
+        checked(opt, opt_dest, ushort_test_buff[index] + j, int_test_buff[index] + j, ushort_test_buff[index] + j, int_test_buff[index] + j, &fps, width);
+        ref(ref_dest, ushort_test_buff[index] + j, int_test_buff[index] + j, ushort_test_buff[index] + j, int_test_buff[index] + j, &fps, width);
+
+        if (memcmp(ref_dest, opt_dest, width * sizeof(pixel)))
+            return false;
+
+        reportfail();
+        j += INCR;
+    }
+
+    return true;
+}
+
 bool PixelHarness::check_psyCost_pp(pixelcmp_t ref, pixelcmp_t opt)
 {
     int j = 0, index1, index2, optres, refres;
@@ -1608,6 +1636,15 @@
         }
     }
 
+    if (opt.propagateCost)
+    {
+        if (!check_cutree_propagate_cost(ref.propagateCost, opt.propagateCost))
+        {
+            printf("propagateCost failed\n");
+            return false;
+        }
+    }
+
     return true;
 }
 
@@ -1947,4 +1984,10 @@
         HEADER0("planecopy_cp");
         REPORT_SPEEDUP(opt.planecopy_cp, ref.planecopy_cp, uchar_test_buff[0], 64, pbuf1, 64, 64, 64, 2);
     }
+
+    if (opt.propagateCost)
+    {
+        HEADER0("propagateCost");
+        REPORT_SPEEDUP(opt.propagateCost, ref.propagateCost, ibuf1, ushort_test_buff[0], int_test_buff[0], ushort_test_buff[0], int_test_buff[0], double_test_buff[0], 80);
+    }
 }
diff -r 5e5dc3763f63 -r 76c6b079e6b3 source/test/pixelharness.h
--- a/source/test/pixelharness.h	Thu Jan 29 10:37:54 2015 -0600
+++ b/source/test/pixelharness.h	Wed Jan 28 15:58:37 2015 +0530
@@ -63,6 +63,7 @@
     int      int_test_buff[TEST_CASES][BUFFSIZE];
     uint16_t ushort_test_buff[TEST_CASES][BUFFSIZE];
     uint8_t  uchar_test_buff[TEST_CASES][BUFFSIZE];
+    double  double_test_buff[TEST_CASES][BUFFSIZE];
 
     bool check_pixelcmp(pixelcmp_t ref, pixelcmp_t opt);
     bool check_pixelcmp_ss(pixelcmp_ss_t ref, pixelcmp_ss_t opt);
@@ -99,6 +100,7 @@
     bool check_saoCuOrgB0_t(saoCuOrgB0_t ref, saoCuOrgB0_t opt);
     bool check_planecopy_sp(planecopy_sp_t ref, planecopy_sp_t opt);
     bool check_planecopy_cp(planecopy_cp_t ref, planecopy_cp_t opt);
+    bool check_cutree_propagate_cost(cutree_propagate_cost ref, cutree_propagate_cost opt);
     bool check_psyCost_pp(pixelcmp_t ref, pixelcmp_t opt);
     bool check_psyCost_ss(pixelcmp_ss_t ref, pixelcmp_ss_t opt);
     bool check_calSign(sign_t ref, sign_t opt);


More information about the x265-devel mailing list