[x265] [PATCH 2 of 2] Adding test bench code for chroma hps filter functions
nabajit at multicorewareinc.com
nabajit at multicorewareinc.com
Tue Nov 12 13:05:09 CET 2013
# HG changeset patch
# User Nabajit Deka
# Date 1384257859 -19800
# Tue Nov 12 17:34:19 2013 +0530
# Node ID 968f6df6d50f70d2a4cf569a8c0426f65d927b00
# Parent 6c6026676f0f6d6af270ede92bdc66aa0749f0c9
Adding test bench code for chroma hps filter functions.
diff -r 6c6026676f0f -r 968f6df6d50f source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp Tue Nov 12 17:30:35 2013 +0530
+++ b/source/test/ipfilterharness.cpp Tue Nov 12 17:34:19 2013 +0530
@@ -350,6 +350,38 @@
return true;
}
+bool IPFilterHarness::check_IPFilterChroma_ps_primitive(filter_ps_t ref, filter_ps_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; // Randomly generated dstStride
+
+ ref(pixel_buff + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_C_output_s,
+ rand_dstStride,
+ rand_coeffIdx
+ );
+
+ opt(pixel_buff + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_vec_output_s,
+ rand_dstStride,
+ rand_coeffIdx
+ );
+
+ if (memcmp(IPF_vec_output_s, IPF_C_output_s, ipf_t_size * sizeof(int16_t)))
+ return false;
+ }
+
+ return true;
+}
+
bool IPFilterHarness::check_IPFilterChroma_sp_primitive(filter_sp_t ref, filter_sp_t opt)
{
int rand_srcStride, rand_dstStride, rand_coeffIdx;
@@ -628,6 +660,14 @@
return false;
}
}
+ if (opt.chroma_hps[value])
+ {
+ if (!check_IPFilterChroma_ps_primitive(ref.chroma_hps[value], opt.chroma_hps[value]))
+ {
+ printf("chroma_hps[%s]", chromaPartStr[value]);
+ return false;
+ }
+ }
if (opt.chroma_vpp[value])
{
if (!check_IPFilterChroma_primitive(ref.chroma_vpp[value], opt.chroma_vpp[value]))
@@ -787,6 +827,12 @@
REPORT_SPEEDUP(opt.chroma_hpp[value], ref.chroma_hpp[value],
pixel_buff + srcStride, srcStride, IPF_vec_output_p, dstStride, 1);
}
+ if (opt.chroma_hps[value])
+ {
+ printf("chroma_hps[%s]", chromaPartStr[value]);
+ REPORT_SPEEDUP(opt.chroma_hps[value], ref.chroma_hps[value],
+ pixel_buff + srcStride, srcStride, IPF_vec_output_s, dstStride, 1);
+ }
if (opt.chroma_vpp[value])
{
printf("chroma_vpp[%s]", chromaPartStr[value]);
diff -r 6c6026676f0f -r 968f6df6d50f source/test/ipfilterharness.h
--- a/source/test/ipfilterharness.h Tue Nov 12 17:30:35 2013 +0530
+++ b/source/test/ipfilterharness.h Tue Nov 12 17:34:19 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_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_IPFilterLuma_primitive(filter_pp_t ref, filter_pp_t opt);
bool check_IPFilterLuma_ps_primitive(filter_ps_t ref, filter_ps_t opt);
More information about the x265-devel
mailing list