[x265] [PATCH 3 of 3] Adding test bench code for chroma vss filter functions

nabajit at multicorewareinc.com nabajit at multicorewareinc.com
Fri Nov 15 12:31:28 CET 2013


# HG changeset patch
# User Nabajit Deka
# Date 1384515039 -19800
#      Fri Nov 15 17:00:39 2013 +0530
# Node ID 7d42727cd87856e593f294ececcac218110d388a
# Parent  583a306d9d644682c966b7e25a1ddd30c1aa2455
Adding test bench code for chroma vss filter functions

diff -r 583a306d9d64 -r 7d42727cd878 source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp	Fri Nov 15 16:54:33 2013 +0530
+++ b/source/test/ipfilterharness.cpp	Fri Nov 15 17:00:39 2013 +0530
@@ -410,6 +410,36 @@
     return true;
 }
 
+bool IPFilterHarness::check_IPFilterChroma_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() % 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_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_IPFilterLuma_primitive(filter_pp_t ref, filter_pp_t opt)
 {
     int rand_srcStride, rand_dstStride, rand_coeffIdx;
@@ -690,6 +720,14 @@
                 return false;
             }
         }
+        if (opt.chroma_vss[value])
+        {
+            if (!check_IPFilterChroma_ss_primitive(ref.chroma_vss[value], opt.chroma_vss[value]))
+            {
+                printf("chroma_vss[%s]", chromaPartStr[value]);
+                return false;
+            }
+        }
     }
 
     for (int value = 0; value < NUM_LUMA_PARTITIONS; value++)
@@ -860,5 +898,12 @@
                            short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
                            IPF_vec_output_p, dstStride, 1);
         }
+        if (opt.chroma_vss[value])
+        {
+            printf("chroma_vss[%s]", chromaPartStr[value]);
+            REPORT_SPEEDUP(opt.chroma_vss[value], ref.chroma_vss[value],
+                           short_buff + maxVerticalfilterHalfDistance * srcStride, srcStride,
+                           IPF_vec_output_s, dstStride, 1);
+        }
     }
 }
diff -r 583a306d9d64 -r 7d42727cd878 source/test/ipfilterharness.h
--- a/source/test/ipfilterharness.h	Fri Nov 15 16:54:33 2013 +0530
+++ b/source/test/ipfilterharness.h	Fri Nov 15 17:00:39 2013 +0530
@@ -50,6 +50,7 @@
     bool check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_t opt);
     bool check_IPFilterChroma_ps_primitive(filter_ps_t ref, filter_ps_t opt);
     bool check_IPFilterChroma_sp_primitive(filter_sp_t ref, filter_sp_t opt);
+    bool check_IPFilterChroma_ss_primitive(filter_ss_t ref, filter_ss_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