[x265] [PATCH 3 of 3] improve rdoQuant() by block fill on non-zero coeff group
Min Chen
chenm003 at 163.com
Tue Apr 14 15:19:18 CEST 2015
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1429017546 -28800
# Node ID 18697529da8a22d57b961c021fdc5019bf20b39c
# Parent 639ba5cea135ed10b1f5a406e15a7e469f0ee68f
improve rdoQuant() by block fill on non-zero coeff group
---
source/common/quant.cpp | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff -r 639ba5cea135 -r 18697529da8a source/common/quant.cpp
--- a/source/common/quant.cpp Tue Apr 14 21:19:02 2015 +0800
+++ b/source/common/quant.cpp Tue Apr 14 21:19:06 2015 +0800
@@ -981,10 +981,20 @@
dstCoeff[blkPos] = (int16_t)((level ^ mask) - mask);
}
- // TODO: use fast block fill, it is slower in less coeff transform block
+ // Average 49.62 pixels
/* clean uncoded coefficients */
- for (int pos = bestLastIdx; pos <= lastScanPos; pos++)
+ for (int pos = bestLastIdx; pos <= fastMin(lastScanPos, (bestLastIdx | (SCAN_SET_SIZE - 1))); pos++)
+ {
dstCoeff[codeParams.scan[pos]] = 0;
+ }
+ for (int pos = (bestLastIdx & ~(SCAN_SET_SIZE - 1)) + SCAN_SET_SIZE; pos <= lastScanPos; pos += SCAN_SET_SIZE)
+ {
+ const uint32_t blkPos = codeParams.scan[pos];
+ memset(&dstCoeff[blkPos + 0 * trSize], 0, 4 * sizeof(*dstCoeff));
+ memset(&dstCoeff[blkPos + 1 * trSize], 0, 4 * sizeof(*dstCoeff));
+ memset(&dstCoeff[blkPos + 2 * trSize], 0, 4 * sizeof(*dstCoeff));
+ memset(&dstCoeff[blkPos + 3 * trSize], 0, 4 * sizeof(*dstCoeff));
+ }
/* rate-distortion based sign-hiding */
if (cu.m_slice->m_pps->bSignHideEnabled && numSig >= 2)
More information about the x265-devel
mailing list