[x265] [PATCH] testbench: upgrade for check_IPFilter_primitive, don't pass wrong (width, height, stride) to asm

Min Chen chenm003 at 163.com
Wed Oct 30 04:59:26 CET 2013


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1383105521 -28800
# Node ID a56061e605c13088bda1438ef63ec6fa514db91b
# Parent  c946d617fd9fbd2ae237d5ba7d8338a1a3f5ea7d
testbench: upgrade for check_IPFilter_primitive, don't pass wrong (width, height, stride) to asm

diff -r c946d617fd9f -r a56061e605c1 source/test/ipfilterharness.cpp
--- a/source/test/ipfilterharness.cpp	Tue Oct 29 15:16:28 2013 +0530
+++ b/source/test/ipfilterharness.cpp	Wed Oct 30 11:58:41 2013 +0800
@@ -160,14 +160,13 @@
 
 bool IPFilterHarness::check_IPFilter_primitive(ipfilter_sp_t ref, ipfilter_sp_t opt)
 {
-    int rand_height = rand() % 100;                 // Randomly generated Height
-    int rand_width = rand() % 100;                  // Randomly generated Width
-    int16_t rand_val, rand_srcStride, rand_dstStride;
+    int rand_val, rand_srcStride, rand_dstStride;
 
-    rand_width &= ~3;
+    for (int i = 0; i <= 1000; i++)
+    {
+        int rand_height = rand() % 100;                 // Randomly generated Height
+        int rand_width = rand() % 100;                  // Randomly generated Width
 
-    for (int i = 0; i <= 100; i++)
-    {
         memset(IPF_vec_output_p, 0, ipf_t_size);      // Initialize output buffer to zero
         memset(IPF_C_output_p, 0, ipf_t_size);        // Initialize output buffer to zero
 
@@ -175,6 +174,16 @@
         rand_srcStride = rand() % 100;              // Randomly generated srcStride
         rand_dstStride = rand() % 100;              // Randomly generated dstStride
 
+        rand_width &= ~3;
+        if (rand_width < 4)
+            rand_width = 4;
+
+        if (rand_height <= 0)
+            rand_height = 1;
+
+        if (rand_dstStride < rand_width)
+            rand_dstStride = rand_width;
+
         ref(short_buff + 3 * rand_srcStride,
             rand_srcStride,
             IPF_C_output_p,



More information about the x265-devel mailing list