[x265] [PATCH] testbench: added cvt16to32_shl primitive function

dnyaneshwar at multicorewareinc.com dnyaneshwar at multicorewareinc.com
Thu Nov 28 12:27:15 CET 2013


# HG changeset patch
# User Dnyaneshwar G <dnyaneshwar at multicorewareinc.com>
# Date 1385637911 -19800
#      Thu Nov 28 16:55:11 2013 +0530
# Node ID 04cf7a0fbdae38b011447c2b63c4911d0d10b6ba
# Parent  2ba6c26c9febdc8c57d3014c0cf98d4897d3992d
testbench: added cvt16to32_shl primitive function

diff -r 2ba6c26c9feb -r 04cf7a0fbdae source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Thu Nov 28 15:04:04 2013 +0530
+++ b/source/test/pixelharness.cpp	Thu Nov 28 16:55:11 2013 +0530
@@ -420,6 +420,28 @@
     return true;
 }
 
+bool PixelHarness::check_cvt16to32_shl_t(cvt16to32_shl_t ref, cvt16to32_shl_t opt)
+{
+    ALIGN_VAR_16(int32_t, ref_dest[64 * 64]);
+    ALIGN_VAR_16(int32_t, opt_dest[64 * 64]);
+
+    int j = 0;
+    for (int i = 0; i < ITERS; i++)
+    {
+        int shift = (rand() % 7 + 1);
+
+        opt(opt_dest, sbuf1 + j, STRIDE, shift, STRIDE);
+        ref(ref_dest, sbuf1 + j, STRIDE, shift, STRIDE);
+
+        if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(int32_t)))
+            return false;
+
+        j += INCR;
+    }
+
+    return true;
+}
+
 bool PixelHarness::check_pixelavg_pp(pixelavg_pp_t ref, pixelavg_pp_t opt)
 {
     ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
@@ -962,6 +984,15 @@
         }
     }
 
+    if (opt.cvt16to32_shl)
+    {
+        if (!check_cvt16to32_shl_t(ref.cvt16to32_shl, opt.cvt16to32_shl))
+        {
+            printf("cvt16to32 failed!\n");
+            return false;
+        }
+    }
+
     if (opt.blockcpy_pp)
     {
         if (!check_blockcopy_pp(ref.blockcpy_pp, opt.blockcpy_pp))
@@ -1252,6 +1283,12 @@
         REPORT_SPEEDUP(opt.cvt32to16_shr, ref.cvt32to16_shr, sbuf1, ibuf1, 64, 5, 64);
     }
 
+    if (opt.cvt16to32_shl)
+    {
+        HEADER0("cvt16to32_shl");
+        REPORT_SPEEDUP(opt.cvt16to32_shl, ref.cvt16to32_shl, ibuf1, sbuf1, 64, 5, 64);
+    }
+
     if (opt.blockcpy_pp)
     {
         HEADER0("blockcpy_pp");
diff -r 2ba6c26c9feb -r 04cf7a0fbdae source/test/pixelharness.h
--- a/source/test/pixelharness.h	Thu Nov 28 15:04:04 2013 +0530
+++ b/source/test/pixelharness.h	Thu Nov 28 16:55:11 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_cvt16to32_shl_t(cvt16to32_shl_t ref, cvt16to32_shl_t opt);
     bool check_pixel_var(var_t ref, var_t opt);
     bool check_ssim_4x4x2_core(ssim_4x4x2_core_t ref, ssim_4x4x2_core_t opt);
     bool check_ssim_end(ssim_end4_t ref, ssim_end4_t opt);


More information about the x265-devel mailing list