[x265] [PATCH 2 of 3] testbench: fix bug in check_costCoeffRemain, use different data in every iteration

Min Chen chenm003 at 163.com
Thu Aug 27 02:13:09 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1440632252 25200
# Node ID fcb6d28d3d4f37a5b6c6acd47c4c35480a499b6a
# Parent  be9fbc8bf0d5e57949367293035d047d6a7d9da8
testbench: fix bug in check_costCoeffRemain, use different data in every iteration
---
 source/test/pixelharness.cpp |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff -r be9fbc8bf0d5 -r fcb6d28d3d4f source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Wed Aug 26 16:37:30 2015 -0700
+++ b/source/test/pixelharness.cpp	Wed Aug 26 16:37:32 2015 -0700
@@ -1719,11 +1719,12 @@
     }
     return true;
 }
+
 bool PixelHarness::check_costCoeffRemain(costCoeffRemain_t ref, costCoeffRemain_t opt)
 {
-    ALIGN_VAR_32(uint16_t, absCoeff[1 << MLS_CG_SIZE]);
-
-    for (int i = 0; i < (1 << MLS_CG_SIZE); i++)
+    ALIGN_VAR_32(uint16_t, absCoeff[(1 << MLS_CG_SIZE) + ITERS]);
+
+    for (int i = 0; i < (1 << MLS_CG_SIZE) + ITERS; i++)
     {
         absCoeff[i] = rand() & SHORT_MAX;
         // more coeff with value one
@@ -1737,14 +1738,14 @@
         int numNonZero = rand() % 17; //can be random, range[1, 16]
         for (k = 0; k < C1FLAG_NUMBER; k++)
         {
-            if (absCoeff[k] >= 2)
+            if (absCoeff[i + k] >= 2)
             {
                 break;
             }
         }
         firstC2Idx = k; // it is index of exact first coeff that value more than 2
-        int ref_sum = ref(absCoeff, numNonZero, firstC2Idx);
-        int opt_sum = (int)checked(opt, absCoeff, numNonZero, firstC2Idx);
+        int ref_sum = ref(absCoeff + i, numNonZero, firstC2Idx);
+        int opt_sum = (int)checked(opt, absCoeff + i, numNonZero, firstC2Idx);
         if (ref_sum != opt_sum)
             return false;
     }



More information about the x265-devel mailing list