[x265] [PATCH 2 of 2] Adding test bench code for chroma vsp filter functions

nabajit at multicorewareinc.com nabajit at multicorewareinc.com
Tue Nov 12 11:47:30 CET 2013


# HG changeset patch
# User Nabajit Deka
# Date 1384253174 -19800
#      Tue Nov 12 16:16:14 2013 +0530
# Node ID fd23a50d6336fc3fef6466c9a8f1baa0e3a2228b
# Parent  e7f2a2ca3eb5b02c7683a108e94ab5ad7b9a7081
Adding test bench code for chroma vsp filter functions.

diff -r e7f2a2ca3eb5 -r fd23a50d6336 source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp	Tue Nov 12 16:07:05 2013 +0530
+++ b/source/test/ipfilterharness.cpp	Tue Nov 12 16:16:14 2013 +0530
@@ -332,8 +332,6 @@
         rand_srcStride = rand() % 100;              // Randomly generated srcStride
         rand_dstStride = rand() % 100;              // Randomly generated dstStride
 
-        // maxVerticalfilterHalfDistance = 3
-
         opt(pixel_buff + 3 * rand_srcStride,
             rand_srcStride,
             IPF_vec_output_p,
@@ -352,6 +350,36 @@
     return true;
 }
 
+bool IPFilterHarness::check_IPFilterChroma_sp_primitive(filter_sp_t ref, filter_sp_t opt)
+{
+    int rand_srcStride, rand_dstStride, rand_coeffIdx;
+
+    for (int i = 0; i <= 100; i++)
+    {
+        rand_coeffIdx = rand() % 8;                 // Random coeffIdex in the filter
+
+        rand_srcStride = rand() % 100;              // Randomly generated srcStride
+        rand_dstStride = rand() % 100 + 32;         // Randomly generated dstStride
+
+        ref(short_buff + 3 * rand_srcStride,
+            rand_srcStride,
+            IPF_C_output_p,
+            rand_dstStride,
+            rand_coeffIdx);
+
+        opt(short_buff + 3 * rand_srcStride,
+            rand_srcStride,
+            IPF_vec_output_p,
+            rand_dstStride,
+            rand_coeffIdx);
+
+        if (memcmp(IPF_vec_output_p, IPF_C_output_p, ipf_t_size))
+            return false;
+    }
+
+    return true;
+}
+
 bool IPFilterHarness::check_IPFilterLuma_primitive(filter_pp_t ref, filter_pp_t opt)
 {
     int rand_srcStride, rand_dstStride, rand_coeffIdx;
@@ -419,7 +447,7 @@
         rand_coeffIdx = rand() % 3;                // Random coeffIdex in the filter
 
         rand_srcStride = rand() % 100;             // Randomly generated srcStride
-        rand_dstStride = 64 ;//rand() % 100 + 64;        // Randomly generated dstStride
+        rand_dstStride = rand() % 100 + 64;        // Randomly generated dstStride
 
         ref(short_buff + 3 * rand_srcStride,
             rand_srcStride,
@@ -608,6 +636,14 @@
                 return false;
             }
         }
+        if (opt.chroma_vsp[value])
+        {
+            if (!check_IPFilterChroma_sp_primitive(ref.chroma_vsp[value], opt.chroma_vsp[value]))
+            {
+                printf("chroma_vsp[%s]", chromaPartStr[value]);
+                return false;
+            }
+        }
     }
 
     for (int value = 0; value < NUM_LUMA_PARTITIONS; value++)
@@ -758,5 +794,12 @@
                            pixel_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_p, dstStride, 1);
         }
+        if (opt.chroma_vsp[value])
+        {
+            printf("chroma_vsp[%s]", chromaPartStr[value]);
+            REPORT_SPEEDUP(opt.chroma_vsp[value], ref.chroma_vsp[value],
+                           short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
+                           IPF_vec_output_p, dstStride, 1);
+        }
     }
 }
diff -r e7f2a2ca3eb5 -r fd23a50d6336 source/test/ipfilterharness.h
--- a/source/test/ipfilterharness.h	Tue Nov 12 16:07:05 2013 +0530
+++ b/source/test/ipfilterharness.h	Tue Nov 12 16:16:14 2013 +0530
@@ -48,6 +48,7 @@
     bool check_IPFilter_primitive(ipfilter_s2p_t ref, ipfilter_s2p_t opt);
     bool check_IPFilter_primitive(ipfilter_ss_t ref, ipfilter_ss_t opt, int isChroma);
     bool check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_t opt);
+    bool check_IPFilterChroma_sp_primitive(filter_sp_t ref, filter_sp_t opt);
     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);


More information about the x265-devel mailing list