[x265] [PATCH 2 of 7] search: add RDcost measurement of DeltaQP to lower rdLevels
deepthi at multicorewareinc.com
deepthi at multicorewareinc.com
Sat Apr 18 08:22:04 CEST 2015
# HG changeset patch
# User Deepthi Nandakumar <deepthi at multicorewareinc.com>
# Date 1428474170 -19800
# Wed Apr 08 11:52:50 2015 +0530
# Node ID a30aaefa68de138b8fc2745ba02a3bcaaf42acff
# Parent c20bac870095b72d025f7f2916bd82844e586004
search: add RDcost measurement of DeltaQP to lower rdLevels
This is a follow-on patch to 75d6c2588e34, which changed outputs at rdLevels > 4.
This patch may change outputs at lower rdLevels as well.
diff -r c20bac870095 -r a30aaefa68de source/encoder/search.cpp
--- a/source/encoder/search.cpp Sat Apr 18 11:16:08 2015 +0530
+++ b/source/encoder/search.cpp Wed Apr 08 11:52:50 2015 +0530
@@ -3444,12 +3444,26 @@
{
if (cu.getQtRootCbf(0))
{
- mode.contexts.resetBits();
- mode.contexts.codeDeltaQP(cu, 0);
- uint32_t bits = mode.contexts.getNumberOfWrittenBits();
- mode.mvBits += bits;
- mode.totalBits += bits;
- updateModeCost(mode);
+ if (m_param->rdLevel >= 3)
+ {
+ mode.contexts.resetBits();
+ mode.contexts.codeDeltaQP(cu, 0);
+ uint32_t bits = mode.contexts.getNumberOfWrittenBits();
+ mode.mvBits += bits;
+ mode.totalBits += bits;
+ updateModeCost(mode);
+ }
+ else if (m_param->rdLevel <= 1)
+ {
+ mode.sa8dBits++;
+ mode.sa8dCost = m_rdCost.calcRdSADCost(mode.distortion, mode.sa8dBits);
+ }
+ else
+ {
+ mode.mvBits++;
+ mode.totalBits++;
+ updateModeCost(mode);
+ }
}
else
cu.setQPSubParts(cu.getRefQP(0), 0, cuGeom.depth);
@@ -3475,12 +3489,26 @@
}
if (hasResidual)
{
- mode.contexts.resetBits();
- mode.contexts.codeDeltaQP(cu, 0);
- uint32_t bits = mode.contexts.getNumberOfWrittenBits();
- mode.mvBits += bits;
- mode.totalBits += bits;
- updateModeCost(mode);
+ if (m_param->rdLevel >= 3)
+ {
+ mode.contexts.resetBits();
+ mode.contexts.codeDeltaQP(cu, 0);
+ uint32_t bits = mode.contexts.getNumberOfWrittenBits();
+ mode.mvBits += bits;
+ mode.totalBits += bits;
+ updateModeCost(mode);
+ }
+ else if (m_param->rdLevel <= 1)
+ {
+ mode.sa8dBits++;
+ mode.sa8dCost = m_rdCost.calcRdSADCost(mode.distortion, mode.sa8dBits);
+ }
+ else
+ {
+ mode.mvBits++;
+ mode.totalBits++;
+ updateModeCost(mode);
+ }
/* For all zero CBF sub-CUs, reset QP to RefQP (so that deltaQP is not signalled).
When the non-zero CBF sub-CU is found, stop */
cu.setQPSubCUs(cu.getRefQP(0), 0, cuGeom.depth);
More information about the x265-devel
mailing list