[x265] [PATCH 2 of 2] Adding test bench code for luma vss filter functions

nabajit at multicorewareinc.com nabajit at multicorewareinc.com
Fri Nov 15 13:15:35 CET 2013


# HG changeset patch
# User Nabajit Deka
# Date 1384517700 -19800
#      Fri Nov 15 17:45:00 2013 +0530
# Node ID b918110fd337178a1cf3616989c65a1e0ed14776
# Parent  df47be7d93bbec09aa70446cf369fde2f5f1933d
Adding test bench code for luma vss filter functions.

diff -r df47be7d93bb -r b918110fd337 source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp	Fri Nov 15 17:43:44 2013 +0530
+++ b/source/test/ipfilterharness.cpp	Fri Nov 15 17:45:00 2013 +0530
@@ -528,6 +528,36 @@
     return true;
 }
 
+bool IPFilterHarness::check_IPFilterLuma_ss_primitive(filter_ss_t ref, filter_ss_t opt)
+{
+    int rand_srcStride, rand_dstStride, rand_coeffIdx;
+
+    for (int i = 0; i <= 100; i++)
+    {
+        rand_coeffIdx = rand() % 3;                // Random coeffIdex in the filter
+
+        rand_srcStride = rand() % 100;             // Randomly generated srcStride
+        rand_dstStride = rand() % 100 + 64;        // Randomly generated dstStride
+
+        ref(short_buff + 3 * rand_srcStride,
+            rand_srcStride,
+            IPF_C_output_s,
+            rand_dstStride,
+            rand_coeffIdx);
+
+        opt(short_buff + 3 * rand_srcStride,
+            rand_srcStride,
+            IPF_vec_output_s,
+            rand_dstStride,
+            rand_coeffIdx);
+
+        if (memcmp(IPF_C_output_s, IPF_vec_output_s, ipf_t_size * sizeof(int16_t)))
+            return false;
+    }
+
+    return true;
+}
+
 bool IPFilterHarness::check_IPFilterLumaHV_primitive(filter_hv_pp_t ref, filter_hv_pp_t opt)
 {
     int rand_srcStride, rand_dstStride, rand_coeffIdxX, rand_coeffIdxY;
@@ -676,6 +706,14 @@
                 return false;
             }
         }
+        if (opt.luma_vss[value])
+        {
+            if (!check_IPFilterLuma_ss_primitive(ref.luma_vss[value], opt.luma_vss[value]))
+            {
+                printf("luma_vss[%s]", lumaPartStr[value]);
+                return false;
+            }
+        }
     }
 
     for (int value = 0; value < NUM_CHROMA_PARTITIONS; value++)
@@ -855,6 +893,14 @@
                            IPF_vec_output_p, dstStride, 1);
         }
 
+        if (opt.luma_vss[value])
+        {
+            printf("luma_vss[%s]\t", lumaPartStr[value]);
+            REPORT_SPEEDUP(opt.luma_vss[value], ref.luma_vss[value],
+                           short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
+                           IPF_vec_output_s, dstStride, 1);
+        }
+
         if (opt.luma_hvpp[value])
         {
             printf("luma_hv [%s]\t", lumaPartStr[value]);
diff -r df47be7d93bb -r b918110fd337 source/test/ipfilterharness.h
--- a/source/test/ipfilterharness.h	Fri Nov 15 17:43:44 2013 +0530
+++ b/source/test/ipfilterharness.h	Fri Nov 15 17:45:00 2013 +0530
@@ -54,6 +54,7 @@
     bool check_IPFilterLuma_primitive(filter_pp_t ref, filter_pp_t opt);
     bool check_IPFilterLuma_ps_primitive(filter_ps_t ref, filter_ps_t opt);
     bool check_IPFilterLuma_sp_primitive(filter_sp_t ref, filter_sp_t opt);
+    bool check_IPFilterLuma_ss_primitive(filter_ss_t ref, filter_ss_t opt);
     bool check_IPFilterLumaHV_primitive(filter_hv_pp_t ref, filter_hv_pp_t opt);
 
 public:


More information about the x265-devel mailing list