<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><DIV>I suggest use a array to replace pixel_buff_min and pixel_buff_max, so we can wasy to increment more test case in future</DIV>
<DIV><BR>At 2014-01-27 20:07:19,nabajit@multicorewareinc.com wrote:<BR>># HG changeset patch<BR>># User Nabajit Deka<BR>># Date 1390824412 -19800<BR>>#      Mon Jan 27 17:36:52 2014 +0530<BR>># Node ID 00c0d3e09e3e2180df8675f0a715b2bb2830b7ef<BR>># Parent  b59b1e579f78b4c29c0c1491e6198a63ba1d597f<BR>>Stress test case for luma_pp.<BR>><BR>>diff -r b59b1e579f78 -r 00c0d3e09e3e source/test/ipfilterharness.cpp<BR>>--- a/source/test/ipfilterharness.cpp    Mon Jan 27 00:10:56 2014 -0600<BR>>+++ b/source/test/ipfilterharness.cpp Mon Jan 27 17:36:52 2014 +0530<BR>>@@ -36,14 +36,17 @@<BR>> IPFilterHarness::IPFilterHarness()<BR>> {<BR>>     ipf_t_size = 200 * 200;<BR>>+<BR>>     pixel_buff = (pixel*)malloc(ipf_t_size * sizeof(pixel));     // Assuming max_height = max_width = max_srcStride = max_dstStride = 100<BR>>+    pixel_buff_min = (pixel*)malloc(ipf_t_size * sizeof(pixel));<BR>>+    pixel_buff_max = (pixel*)malloc(ipf_t_size * sizeof(pixel));<BR>>     short_buff = (int16_t*)X265_MALLOC(int16_t, ipf_t_size);<BR>>     IPF_vec_output_s = (int16_t*)malloc(ipf_t_size * sizeof(int16_t)); // Output Buffer1<BR>>     IPF_C_output_s = (int16_t*)malloc(ipf_t_size * sizeof(int16_t));   // Output Buffer2<BR>>     IPF_vec_output_p = (pixel*)malloc(ipf_t_size * sizeof(pixel)); // Output Buffer1<BR>>     IPF_C_output_p = (pixel*)malloc(ipf_t_size * sizeof(pixel));   // Output Buffer2<BR>> <BR>>-    if (!pixel_buff || !short_buff || !IPF_vec_output_s || !IPF_vec_output_p || !IPF_C_output_s || !IPF_C_output_p)<BR>>+    if (!pixel_buff || !pixel_buff_min || !pixel_buff_max || !short_buff || !IPF_vec_output_s || !IPF_vec_output_p || !IPF_C_output_s || !IPF_C_output_p)<BR>>     {<BR>>         fprintf(stderr, "init_IPFilter_buffers: malloc failed, unable to initiate tests!\n");<BR>>         exit(-1);<BR>>@@ -62,6 +65,9 @@<BR>>         pixel_buff[i] = (pixel)(rand() &  ((1 << 8) - 1));<BR>>         short_buff[i] = (int16_t)(isPositive) * (rand() &  SHRT_MAX);<BR>>     }<BR>>+<BR>>+    memset(pixel_buff_min, PIXEL_MIN, ipf_t_size);<BR>>+    memset(pixel_buff_max, PIXEL_MAX, ipf_t_size);<BR>> }<BR>> <BR>> IPFilterHarness::~IPFilterHarness()<BR>>@@ -276,7 +282,6 @@<BR>>     for (int i = 0; i <= 100; i++)<BR>>     {<BR>>         rand_coeffIdx = rand() % 3;                // Random coeffIdex in the filter<BR>>-<BR>>         rand_srcStride = rand() % 100;             // Randomly generated srcStride<BR>>         rand_dstStride = rand() % 100 + 64;        // Randomly generated dstStride<BR>> <BR>>@@ -295,6 +300,49 @@<BR>>             return false;<BR>>     }<BR>> <BR>>+    //Stress test for min input<BR>>+    for (int i = 0; i < 3; i++)<BR>>+    {<BR>>+        rand_coeffIdx = i;<BR>>+        rand_srcStride = rand() % 100;             // Randomly generated srcStride<BR>>+        rand_dstStride = rand() % 100 + 64;        // Randomly generated dstStride<BR>>+<BR>>+        opt(pixel_buff_min,<BR>>+            rand_srcStride,<BR>>+            IPF_vec_output_p,<BR>>+            rand_dstStride,<BR>>+            rand_coeffIdx);<BR>>+        ref(pixel_buff_min,<BR>>+            rand_srcStride,<BR>>+            IPF_C_output_p,<BR>>+            rand_dstStride,<BR>>+            rand_coeffIdx);<BR>>+<BR>>+        if (memcmp(IPF_vec_output_p, IPF_C_output_p, ipf_t_size))<BR>>+        {<BR>>+            printf("luma_pp stress test(min) failed\n");<BR>>+            return false;<BR>>+        }<BR>>+<BR>>+    //Stress test for max input<BR>>+        opt(pixel_buff_max,<BR>>+            rand_srcStride,<BR>>+            IPF_vec_output_p,<BR>>+            rand_dstStride,<BR>>+            rand_coeffIdx);<BR>>+        ref(pixel_buff_max,<BR>>+            rand_srcStride,<BR>>+            IPF_C_output_p,<BR>>+            rand_dstStride,<BR>>+            rand_coeffIdx);<BR>>+<BR>>+        if (memcmp(IPF_vec_output_p, IPF_C_output_p, ipf_t_size))<BR>>+        {<BR>>+            printf("luma_pp stress test(max) failed\n");<BR>>+            return false;<BR>>+        }<BR>>+    }<BR>>+<BR>>     return true;<BR>> }<BR>> <BR>>diff -r b59b1e579f78 -r 00c0d3e09e3e source/test/ipfilterharness.h<BR>>--- a/source/test/ipfilterharness.h        Mon Jan 27 00:10:56 2014 -0600<BR>>+++ b/source/test/ipfilterharness.h   Mon Jan 27 17:36:52 2014 +0530<BR>>@@ -33,7 +33,7 @@<BR>> {<BR>> protected:<BR>> <BR>>-    pixel *pixel_buff;<BR>>+    pixel *pixel_buff, *pixel_buff_min, *pixel_buff_max;<BR>>     int16_t *short_buff;<BR>> <BR>>     pixel *IPF_vec_output_p, *IPF_C_output_p;<BR>>diff -r b59b1e579f78 -r 00c0d3e09e3e source/test/testharness.h<BR>>--- a/source/test/testharness.h     Mon Jan 27 00:10:56 2014 -0600<BR>>+++ b/source/test/testharness.h       Mon Jan 27 17:36:52 2014 +0530<BR>>@@ -36,6 +36,7 @@<BR>> #define BIT_DEPTH 8<BR>> #endif<BR>> #define PIXEL_MAX ((1 << BIT_DEPTH) - 1)<BR>>+#define PIXEL_MIN 0<BR>> #define SHORT_MAX  32767<BR>> #define SHORT_MIN -32767<BR>> <BR>>_______________________________________________<BR>>x265-devel mailing list<BR>>x265-devel@videolan.org<BR>>https://mailman.videolan.org/listinfo/x265-devel<BR></DIV></div>