[x265] [PATCH 1 of 5] improve codeCoeffNxN by bypass check on one coeff block

Min Chen chenm003 at 163.com
Tue May 12 01:42:23 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1431386739 25200
# Node ID 278b3fbc397fc02049145156997a5217bb902083
# Parent  3700169eb622204e7476d8b56772771b4f4e52c1
improve codeCoeffNxN by bypass check on one coeff block
---
 source/encoder/entropy.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff -r 3700169eb622 -r 278b3fbc397f source/encoder/entropy.cpp
--- a/source/encoder/entropy.cpp	Thu May 07 10:18:17 2015 +0800
+++ b/source/encoder/entropy.cpp	Mon May 11 16:25:39 2015 -0700
@@ -1554,7 +1554,7 @@
         }
 
         // encode significant_coeff_flag
-        if (sigCoeffGroupFlag64 & cgBlkPosMask)
+        if ((scanPosSigOff >= 0) && (sigCoeffGroupFlag64 & cgBlkPosMask))
         {
             X265_CHECK((log2TrSize != 2) || (log2TrSize == 2 && subSet == 0), "log2TrSize and subSet mistake!\n");
             const int patternSigCtx = Quant::calcPatternSigCtx(sigCoeffGroupFlag64, cgPosX, cgPosY, cgBlkPos, (trSize >> MLS_CG_LOG2_SIZE));
@@ -1612,6 +1612,7 @@
                 tmpCoeff[i * MLS_CG_SIZE + 3] = (uint16_t)abs(coeff[blkPosBase + i * trSize + 3]);
             }
 
+            X265_CHECK(scanPosSigOff >= 0, "scanPosSigOff check failure\n");
             if (m_bitIf)
             {
                 if (log2TrSize == 2)



More information about the x265-devel mailing list