[x265] [PATCH 01/12] Test: Remove check for unused coeffIdx in ipfilter tests

Hari Limaye hari.limaye at arm.com
Fri Aug 30 19:18:55 UTC 2024


The luma (8-tap) and chroma (4-tap) interpolation primitives are only
called with non-zero values of coeffIdx. This patch alters the tests for
these primitives so that they do not check with a coeffIdx of zero, in
order to allow this unused path to be omitted from SIMD optimised
primitives without causing test failures.
---
 source/test/ipfilterharness.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/source/test/ipfilterharness.cpp b/source/test/ipfilterharness.cpp
index bd33678b1..1cc91d671 100644
--- a/source/test/ipfilterharness.cpp
+++ b/source/test/ipfilterharness.cpp
@@ -67,7 +67,7 @@ bool IPFilterHarness::check_IPFilterChroma_primitive(filter_pp_t ref, filter_pp_
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 8; coeffIdx++)
         {
             rand_srcStride = rand() % 100 + 2;
             rand_dstStride = rand() % 100 + 64;
@@ -102,7 +102,7 @@ bool IPFilterHarness::check_IPFilterChroma_ps_primitive(filter_ps_t ref, filter_
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 8; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -144,7 +144,7 @@ bool IPFilterHarness::check_IPFilterChroma_hps_primitive(filter_hps_t ref, filte
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 8; coeffIdx++)
         {
             // 0 : Interpolate W x H, 1 : Interpolate W x (H + 7)
             for (int isRowExt = 0; isRowExt < 2; isRowExt++)
@@ -185,7 +185,7 @@ bool IPFilterHarness::check_IPFilterChroma_sp_primitive(filter_sp_t ref, filter_
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 8; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -220,7 +220,7 @@ bool IPFilterHarness::check_IPFilterChroma_ss_primitive(filter_ss_t ref, filter_
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 8; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 8; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -255,7 +255,7 @@ bool IPFilterHarness::check_IPFilterLuma_primitive(filter_pp_t ref, filter_pp_t
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 4; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 4; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -290,7 +290,7 @@ bool IPFilterHarness::check_IPFilterLuma_ps_primitive(filter_ps_t ref, filter_ps
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 4; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 4; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -325,7 +325,7 @@ bool IPFilterHarness::check_IPFilterLuma_hps_primitive(filter_hps_t ref, filter_
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 4; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 4; coeffIdx++)
         {
             // 0 : Interpolate W x H, 1 : Interpolate W x (H + 7)
             for (int isRowExt = 0; isRowExt < 2; isRowExt++)
@@ -366,7 +366,7 @@ bool IPFilterHarness::check_IPFilterLuma_sp_primitive(filter_sp_t ref, filter_sp
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 4; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 4; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -401,7 +401,7 @@ bool IPFilterHarness::check_IPFilterLuma_ss_primitive(filter_ss_t ref, filter_ss
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdx = 0; coeffIdx < 4; coeffIdx++)
+        for (int coeffIdx = 1; coeffIdx < 4; coeffIdx++)
         {
             rand_srcStride = rand() % 100;
             rand_dstStride = rand() % 100 + 64;
@@ -436,9 +436,9 @@ bool IPFilterHarness::check_IPFilterLumaHV_primitive(filter_hv_pp_t ref, filter_
     {
         int index = i % TEST_CASES;
 
-        for (int coeffIdxX = 0; coeffIdxX < 4; coeffIdxX++)
+        for (int coeffIdxX = 1; coeffIdxX < 4; coeffIdxX++)
         {
-            for (int coeffIdxY = 0; coeffIdxY < 4; coeffIdxY++)
+            for (int coeffIdxY = 1; coeffIdxY < 4; coeffIdxY++)
             {
                 rand_srcStride = rand() % 100;
                 rand_dstStride = rand() % 100 + 64;
-- 
2.42.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Test-Remove-check-for-unused-coeffIdx-in-ipfilter-te.patch
Type: text/x-patch
Size: 5343 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20240830/e0a8054f/attachment.bin>


More information about the x265-devel mailing list