[x265] [PATCH 2 of 3] improve rdoQuant() by use non-zero coeff group mask to reduce count of coeff scan

Min Chen chenm003 at 163.com
Tue Apr 14 15:19:17 CEST 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1429017542 -28800
# Node ID 639ba5cea135ed10b1f5a406e15a7e469f0ee68f
# Parent  a3697b210309ea109402a5a4895f8b4559884019
improve rdoQuant() by use non-zero coeff group mask to reduce count of coeff scan
---
 source/common/quant.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r a3697b210309 -r 639ba5cea135 source/common/quant.cpp
--- a/source/common/quant.cpp	Tue Apr 14 21:18:58 2015 +0800
+++ b/source/common/quant.cpp	Tue Apr 14 21:19:02 2015 +0800
@@ -996,13 +996,16 @@
             int subPos = subSet << LOG2_SCAN_SET_SIZE;
             int n;
 
+            if (!(sigCoeffGroupFlag64 & (1ULL << codeParams.scanCG[subSet])))
+                continue;
+
             /* measure distance between first and last non-zero coef in this
              * coding group */
             for (n = SCAN_SET_SIZE - 1; n >= 0; --n)
                 if (dstCoeff[codeParams.scan[n + subPos]])
                     break;
-            if (n < 0)
-                continue;
+
+            X265_CHECK(n >= 0, "non-zero coeff scan failuare!\n");
 
             int lastNZPosInCG = n;
 



More information about the x265-devel mailing list