[x265] [PATCH] search: add RDcost measurement of DeltaQP to lower rdLevels

deepthi at multicorewareinc.com deepthi at multicorewareinc.com
Wed Apr 8 08:41:10 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 801366f7096ea60e0491a874a1a257a714906bcb
# Parent  095ed87526e5964ad45949ec81903704451d79f8
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 095ed87526e5 -r 801366f7096e source/encoder/search.cpp
--- a/source/encoder/search.cpp	Tue Apr 07 09:42:31 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