[x265] [PATCH 1 of 3] improve rdoQuant() by reduce count of code group scan

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


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1429017538 -28800
# Node ID a3697b210309ea109402a5a4895f8b4559884019
# Parent  4987a630b0d12638c1994afc7c21b9bc44282498
improve rdoQuant() by reduce count of code group scan
---
 source/common/quant.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff -r 4987a630b0d1 -r a3697b210309 source/common/quant.cpp
--- a/source/common/quant.cpp	Tue Apr 14 13:41:40 2015 +0800
+++ b/source/common/quant.cpp	Tue Apr 14 21:18:58 2015 +0800
@@ -981,6 +981,7 @@
         dstCoeff[blkPos] = (int16_t)((level ^ mask) - mask);
     }
 
+    // TODO: use fast block fill, it is slower in less coeff transform block
     /* clean uncoded coefficients */
     for (int pos = bestLastIdx; pos <= lastScanPos; pos++)
         dstCoeff[codeParams.scan[pos]] = 0;
@@ -988,8 +989,9 @@
     /* rate-distortion based sign-hiding */
     if (cu.m_slice->m_pps->bSignHideEnabled && numSig >= 2)
     {
+        const int realLastScanPos = (bestLastIdx - 1) >> LOG2_SCAN_SET_SIZE;
         int lastCG = true;
-        for (int subSet = cgLastScanPos; subSet >= 0; subSet--)
+        for (int subSet = realLastScanPos; subSet >= 0; subSet--)
         {
             int subPos = subSet << LOG2_SCAN_SET_SIZE;
             int n;



More information about the x265-devel mailing list