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

Min Chen chenm003 at 163.com
Wed Sep 9 18:42:16 CEST 2015


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

diff -r 365f7ed4d896 -r 8a926b6dcd7f 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:42:14 2015 -0500
@@ -2,6 +2,7 @@
  * Copyright (C) 2013 x265 project
  *
  * Authors: Steve Borho <steve at borho.org>
+ *          Min Chen <chenm003 at 163.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1788,6 +1789,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