[x265] [PATCH] Test bench: code for pixel_var

murugan at multicorewareinc.com murugan at multicorewareinc.com
Mon Nov 25 14:16:47 CET 2013


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1385385388 -19800
#      Mon Nov 25 18:46:28 2013 +0530
# Node ID 43da6ca15a61e18d033931ca58940d6794f6f8f8
# Parent  10f605bd053009c8c981c7529322fecd1e54af7b
Test bench: code for pixel_var

diff -r 10f605bd0530 -r 43da6ca15a61 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/test/pixelharness.cpp	Mon Nov 25 18:46:28 2013 +0530
@@ -632,6 +632,23 @@
     return true;
 }
 
+bool PixelHarness::check_pixel_var(var_t ref, var_t opt)
+{
+    int j = 0;
+
+    for (int i = 0; i < ITERS; i++)
+    {
+        uint64_t vres = opt(pbuf1, STRIDE);
+        uint64_t cres = ref(pbuf1, STRIDE);
+        if (vres != cres)
+            return false;
+
+        j += INCR;
+    }
+
+    return true;
+}
+
 bool PixelHarness::testPartition(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)
 {
     if (opt.satd[part])
@@ -759,6 +776,16 @@
             return false;
         }
     }
+
+    if (opt.var[part])
+    {
+        if (!check_pixel_var(ref.var[part], opt.var[part]))
+        {
+            printf("var[%s]: failed!\n", lumaPartStr[part]);
+            return false;
+        }
+    }
+
     for(int i = 0; i < X265_CSP_COUNT; i++)
     {
         if (opt.chroma[i].copy_pp[part])
@@ -1053,6 +1080,12 @@
         REPORT_SPEEDUP(opt.luma_add_ps[part], ref.luma_add_ps[part], pbuf1, FENC_STRIDE, pbuf2, sbuf1, STRIDE, STRIDE);
     }
 
+    if (opt.var[part])
+    {
+        HEADER("var[%s]", lumaPartStr[part]);
+        REPORT_SPEEDUP(opt.var[part], ref.var[part], pbuf1, STRIDE);
+    }
+
     for (int i = 0; i < X265_CSP_COUNT; i++)
     {
         if (opt.chroma[i].copy_pp[part])
diff -r 10f605bd0530 -r 43da6ca15a61 source/test/pixelharness.h
--- a/source/test/pixelharness.h	Fri Nov 22 14:59:34 2013 -0600
+++ b/source/test/pixelharness.h	Mon Nov 25 18:46:28 2013 +0530
@@ -60,6 +60,7 @@
     bool check_weightp(weightp_sp_t ref, weightp_sp_t opt);
     bool check_downscale_t(downscale_t ref, downscale_t opt);
     bool check_cvt32to16_shr_t(cvt32to16_shr_t ref, cvt32to16_shr_t opt);
+    bool check_pixel_var(var_t ref, var_t opt);
 
 public:
 


More information about the x265-devel mailing list