[x265] [PATCH] testbench: Added stress test cases for chroma_pp, chroma_ps and chroma_hps filter functions
nabajit at multicorewareinc.com
nabajit at multicorewareinc.com
Tue Feb 11 13:16:54 CET 2014
# HG changeset patch
# User Nabajit Deka
# Date 1391425643 -19800
# Mon Feb 03 16:37:23 2014 +0530
# Node ID 6ddbfe6da720c7f4e9ee3869596b8328795eb21f
# Parent e6e9310bc545a84fd30533fc7739912c55179d17
testbench: Added stress test cases for chroma_pp, chroma_ps and chroma_hps filter functions
diff -r e6e9310bc545 -r 6ddbfe6da720 source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp Tue Feb 11 15:20:54 2014 +0530
+++ b/source/test/ipfilterharness.cpp Mon Feb 03 16:37:23 2014 +0530
@@ -151,28 +151,31 @@
bool IPFilterHarness::check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_t opt)
{
- int rand_srcStride, rand_dstStride, rand_coeffIdx;
+ int rand_srcStride, rand_dstStride;
- for (int i = 0; i <= 100; i++)
+ for (int i = 0; i < ITERS; i++)
{
- rand_coeffIdx = rand() % 8; // Random coeffIdex in the filter
+ int index = i % TEST_CASES;
- rand_srcStride = rand() % 100; // Randomly generated srcStride
- rand_dstStride = rand() % 100; // Randomly generated dstStride
+ for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+ {
+ rand_srcStride = rand() % 100; // Randomly generated srcStride
+ rand_dstStride = rand() % 100; // Randomly generated dstStride
- opt(pixel_buff + 3 * rand_srcStride,
- rand_srcStride,
- IPF_vec_output_p,
- rand_dstStride,
- rand_coeffIdx);
- ref(pixel_buff + 3 * rand_srcStride,
- rand_srcStride,
- IPF_C_output_p,
- rand_dstStride,
- rand_coeffIdx);
+ opt(pixel_test_buff[index] + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_vec_output_p,
+ rand_dstStride,
+ coeffIdx);
+ ref(pixel_test_buff[index] + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_C_output_p,
+ rand_dstStride,
+ coeffIdx);
- if (memcmp(IPF_vec_output_p, IPF_C_output_p, ipf_t_size))
- return false;
+ if (memcmp(IPF_vec_output_p, IPF_C_output_p, ipf_t_size))
+ return false;
+ }
}
return true;
@@ -180,29 +183,32 @@
bool IPFilterHarness::check_IPFilterChroma_ps_primitive(filter_ps_t ref, filter_ps_t opt)
{
- int rand_srcStride, rand_dstStride, rand_coeffIdx;
+ int rand_srcStride, rand_dstStride;
- for (int i = 0; i <= 100; i++)
+ for (int i = 0; i < ITERS; i++)
{
- rand_coeffIdx = rand() % 8; // Random coeffIdex in the filter
+ int index = i % TEST_CASES;
- rand_srcStride = rand() % 100; // Randomly generated srcStride
- rand_dstStride = rand() % 100; // Randomly generated dstStride
+ for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+ {
+ 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);
+ ref(pixel_test_buff[index] + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_C_output_s,
+ rand_dstStride,
+ coeffIdx);
- opt(pixel_buff + 3 * rand_srcStride,
- rand_srcStride,
- IPF_vec_output_s,
- rand_dstStride,
- rand_coeffIdx);
+ opt(pixel_test_buff[index] + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_vec_output_s,
+ rand_dstStride,
+ coeffIdx);
- if (memcmp(IPF_vec_output_s, IPF_C_output_s, ipf_t_size * sizeof(int16_t)))
- return false;
+ if (memcmp(IPF_vec_output_s, IPF_C_output_s, ipf_t_size * sizeof(int16_t)))
+ return false;
+ }
}
return true;
@@ -210,33 +216,37 @@
bool IPFilterHarness::check_IPFilterChroma_hps_primitive(filter_hps_t ref, filter_hps_t opt)
{
- int rand_srcStride, rand_dstStride, rand_coeffIdx, rand_isRowExt;
+ int rand_srcStride, rand_dstStride;
- for (int i = 0; i <= 100; i++)
+ for (int i = 0; i < ITERS; i++)
{
- rand_coeffIdx = rand() % 8; // Random coeffIdex in the filter
- rand_isRowExt = rand() % 2; // 0 : Interpolate W x H
- // 1 : Interpolate W x (H + 3)
+ int index = i % TEST_CASES;
- rand_srcStride = rand() % 100; // Randomly generated srcStride
- rand_dstStride = rand() % 100; // Randomly generated dstStride
+ for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+ {
+ for (int isRowExt = 0; isRowExt < 2; isRowExt++) // 0 : Interpolate W x H, 1 : Interpolate W x (H + 7)
+ {
+ 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,
- rand_isRowExt);
+ ref(pixel_test_buff[index] + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_C_output_s,
+ rand_dstStride,
+ coeffIdx,
+ isRowExt);
- opt(pixel_buff + 3 * rand_srcStride,
- rand_srcStride,
- IPF_vec_output_s,
- rand_dstStride,
- rand_coeffIdx,
- rand_isRowExt);
+ opt(pixel_test_buff[index] + 3 * rand_srcStride,
+ rand_srcStride,
+ IPF_vec_output_s,
+ rand_dstStride,
+ coeffIdx,
+ isRowExt);
- if (memcmp(IPF_vec_output_s, IPF_C_output_s, ipf_t_size * sizeof(int16_t)))
- return false;
+ if (memcmp(IPF_vec_output_s, IPF_C_output_s, ipf_t_size * sizeof(int16_t)))
+ return false;
+ }
+ }
}
return true;
More information about the x265-devel
mailing list