[x265] [PATCH] test bench : Added stress test case for luma_pp filter function

chen chenm003 at 163.com
Thu Jan 30 15:16:45 CET 2014


Framework is right
in future, we need design specially input data to check our function.
At 2014-01-30 21:45:51,nabajit at multicorewareinc.com wrote:
># HG changeset patch
># User Nabajit Deka
># Date 1391089526 -19800
>#      Thu Jan 30 19:15:26 2014 +0530
># Node ID d6fd8178649e5c4add3572931948053a975eff42
># Parent  e879873ce926a4b58c111b8e9cdd5fb2692bcb54
>test bench : Added stress test case for luma_pp filter function
>
>diff -r e879873ce926 -r d6fd8178649e source/test/ipfilterharness.cpp
>--- a/source/test/ipfilterharness.cpp	Thu Jan 30 06:46:23 2014 +0530
>+++ b/source/test/ipfilterharness.cpp	Thu Jan 30 19:15:26 2014 +0530
>@@ -31,6 +31,9 @@
> #include <string.h>
> #include <limits.h>
> 
>+#define ITERS  100
>+#define TEST_CASES 3
>+
> using namespace x265;
> 
> IPFilterHarness::IPFilterHarness()
>@@ -43,12 +46,35 @@
>     IPF_vec_output_p = (pixel*)malloc(ipf_t_size * sizeof(pixel)); // Output Buffer1
>     IPF_C_output_p = (pixel*)malloc(ipf_t_size * sizeof(pixel));   // Output Buffer2
> 
>-    if (!pixel_buff || !short_buff || !IPF_vec_output_s || !IPF_vec_output_p || !IPF_C_output_s || !IPF_C_output_p)
>+    /*Array of pixel buffers*/
>+    pixel_test_buff = (pixel**)X265_MALLOC(pixel*, TEST_CASES);
>+
>+    if (!pixel_buff || !short_buff || !IPF_vec_output_s || !IPF_vec_output_p || !IPF_C_output_s || !IPF_C_output_p || !pixel_test_buff)
>     {
>         fprintf(stderr, "init_IPFilter_buffers: malloc failed, unable to initiate tests!\n");
>         exit(-1);
>     }
> 
>+    for (int i = 0; i < TEST_CASES; i++)
>+    {
>+        pixel_test_buff[i] = (pixel*)X265_MALLOC(pixel, ipf_t_size);
>+        if (!pixel_test_buff[i])
>+        {
>+            fprintf(stderr, "init_IPFilter_buffers: malloc failed, unable to initiate tests!\n");
>+            exit(-1);
>+        }
>+    }
>+
>+    /*[0] --- Random values  */
>+    for (int i = 0; i < ipf_t_size * sizeof(pixel); i++)
>+        pixel_test_buff[0][i] = rand() & PIXEL_MAX;
>+
>+    /*[1] --- Minimum       */
>+    memset(pixel_test_buff[1], PIXEL_MIN, ipf_t_size * sizeof(pixel));
>+
>+    /*[2] --- Maximum       */
>+    memset(pixel_test_buff[2], PIXEL_MAX, ipf_t_size * sizeof(pixel));
>+
>     memset(IPF_C_output_p, 0xCD, ipf_t_size);
>     memset(IPF_vec_output_p, 0xCD, ipf_t_size);
>     memset(IPF_C_output_s, 0xCD, ipf_t_size * sizeof(int16_t));
>@@ -72,6 +98,11 @@
>     free(IPF_C_output_p);
>     X265_FREE(short_buff);
>     free(pixel_buff);
>+    for (int i = 0; i < TEST_CASES; i++)
>+    {
>+        X265_FREE(pixel_test_buff[i]);
>+    }
>+    X265_FREE(pixel_test_buff);
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140130/29deadf5/attachment-0001.html>


More information about the x265-devel mailing list