[x265] [PATCH] clean asm findPosLast() output buffer to avoid debug check failure

Min Chen chenm003 at 163.com
Mon Apr 20 06:41:31 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1429504876 -28800
# Node ID bc9631ab9d36475c7d625fc9272ee0ddd7f5bfd7
# Parent  fa7494f2af81a513aa18222b9d6fdc7728090dac
clean asm findPosLast() output buffer to avoid debug check failure
---
 source/common/quant.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff -r fa7494f2af81 -r bc9631ab9d36 source/common/quant.cpp
--- a/source/common/quant.cpp	Mon Apr 20 12:41:13 2015 +0800
+++ b/source/common/quant.cpp	Mon Apr 20 12:41:16 2015 +0800
@@ -579,6 +579,12 @@
     uint16_t coeffSign[MLS_GRP_NUM];    // bit mask map for non-zero coeff sign
     uint16_t coeffFlag[MLS_GRP_NUM];    // bit mask map for non-zero coeff
 
+#if CHECKED_BUILD || _DEBUG
+    // clean output buffer, the asm version of findPosLast Never output anything after latest non-zero coeff group
+    memset(coeffNum, 0, sizeof(coeffNum));
+    memset(coeffSign, 0, sizeof(coeffNum));
+    memset(coeffFlag, 0, sizeof(coeffNum));
+#endif
     const int lastScanPos = primitives.findPosLast(codeParams.scan, dstCoeff, coeffSign, coeffFlag, coeffNum, numSig);
     const int cgLastScanPos = (lastScanPos >> LOG2_SCAN_SET_SIZE);
 



More information about the x265-devel mailing list