[x265] [PATCH] Test bench code for transpose routine

murugan at multicorewareinc.com murugan at multicorewareinc.com
Mon Nov 18 14:29:43 CET 2013


# HG changeset patch
# User Murugan Vairavel <murugan at multicorewareinc.com>
# Date 1384781360 -19800
#      Mon Nov 18 18:59:20 2013 +0530
# Node ID a4735d0fe4759c72a3af408a43723f219688eeb4
# Parent  be8373f115dd7f152588ba8c575ad10dc6f5afb1
Test bench code for transpose routine

diff -r be8373f115dd -r a4735d0fe475 source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Mon Nov 18 17:51:16 2013 +0530
+++ b/source/test/pixelharness.cpp	Mon Nov 18 18:59:20 2013 +0530
@@ -632,6 +632,29 @@
     return true;
 }
 
+bool PixelHarness::check_transpose(transpose_t ref, transpose_t opt)
+{
+    ALIGN_VAR_16(pixel, ref_dest[64 * 64]);
+    ALIGN_VAR_16(pixel, opt_dest[64 * 64]);
+
+    memset(ref_dest, 0, sizeof(ref_dest));
+    memset(opt_dest, 0, sizeof(opt_dest));
+
+    int j = 0;
+    for (int i = 0; i < ITERS; i++)
+    {
+        opt(opt_dest, pbuf1 + j, STRIDE);
+        ref(ref_dest, pbuf1 + j, STRIDE);
+
+        if (memcmp(ref_dest, opt_dest, 64 * 64 * sizeof(pixel)))
+            return false;
+
+        j += INCR;
+    }
+
+    return true;
+}
+
 bool PixelHarness::testPartition(int part, const EncoderPrimitives& ref, const EncoderPrimitives& opt)
 {
     if (opt.satd[part])
@@ -859,6 +882,14 @@
                 return false;
             }
         }
+        if (opt.transpose[i])
+        {
+            if (!check_transpose(ref.transpose[i], opt.transpose[i]))
+            {
+                printf("transpose[%dx%d] failed\n", 4 << i, 4 << i);
+                return false;
+            }
+        }
     }
 
     if (opt.cvt32to16_shr)
@@ -1129,6 +1160,11 @@
             printf("blkfill[%dx%d]", 4 << i, 4 << i);
             REPORT_SPEEDUP(opt.blockfill_s[i], ref.blockfill_s[i], sbuf1, 64, SHORT_MAX);
         }
+        if (opt.transpose[i])
+        {
+            printf("transpose[%dx%d]", 4 << i, 4 << i);
+            REPORT_SPEEDUP(opt.transpose[i], ref.transpose[i], pbuf1, pbuf2, STRIDE);
+        }
     }
 
     if (opt.cvt32to16_shr)
diff -r be8373f115dd -r a4735d0fe475 source/test/pixelharness.h
--- a/source/test/pixelharness.h	Mon Nov 18 17:51:16 2013 +0530
+++ b/source/test/pixelharness.h	Mon Nov 18 18:59:20 2013 +0530
@@ -64,6 +64,7 @@
     bool check_pixel_sub_ps(pixel_sub_ps_t ref, pixel_sub_ps_t opt);
 
     bool check_pixel_scale_pp(scale_t ref, scale_t opt);
+    bool check_transpose(transpose_t ref, transpose_t opt);
 public:
 
     PixelHarness();


More information about the x265-devel mailing list