[x265] [PATCH] testbench: fix bug on seed 0x55EFB6F4, the numNonZero can't be Zero

Min Chen chenm003 at 163.com
Wed Sep 9 18:40:48 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1441816841 18000
# Node ID 809fcb9bb23cab7c1bcd263ffd2ff1806c959871
# Parent  365f7ed4d89628d49cd6af8d81d4edc01f73ffad
testbench: fix bug on seed 0x55EFB6F4, the numNonZero can't be Zero
---
 source/test/pixelharness.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff -r 365f7ed4d896 -r 809fcb9bb23c source/test/pixelharness.cpp
--- a/source/test/pixelharness.cpp	Tue Sep 08 16:38:01 2015 +0530
+++ b/source/test/pixelharness.cpp	Wed Sep 09 11:40:41 2015 -0500
@@ -1788,6 +1788,11 @@
                 numNonZero++;
             }
         }
+        if (numNonZero == 0)
+        {
+            numNonZero = 1;
+            absCoeff[0] = 1;
+        }
 
         int ref_sum = ref(absCoeff, (intptr_t)numNonZero, ref_baseCtx, (intptr_t)rand_offset);
         int opt_sum = (int)checked(opt, absCoeff, (intptr_t)numNonZero, opt_baseCtx, (intptr_t)rand_offset);



More information about the x265-devel mailing list