[x265] [PATCH 2 of 2] rc: scale down intra costs to predict bits when bitdepth > 8

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Thu Sep 24 10:26:57 CEST 2015


# HG changeset patch
# User Aarthi Thirumalai
# Date 1442909471 -19800
#      Tue Sep 22 13:41:11 2015 +0530
# Branch stable
# Node ID 2f296fbb7f8a688024653db39f89861c9f232c80
# Parent  c44b32bc7c906456ad242dd237831ec96c1f5c3d
rc: scale down intra costs to predict bits when bitdepth > 8.

diff -r c44b32bc7c90 -r 2f296fbb7f8a source/encoder/ratecontrol.cpp
--- a/source/encoder/ratecontrol.cpp	Tue Sep 22 13:40:07 2015 +0530
+++ b/source/encoder/ratecontrol.cpp	Tue Sep 22 13:41:11 2015 +0530
@@ -1928,6 +1928,7 @@
             else if (picType == P_SLICE)
             {
                 intraCostForPendingCus = curEncData.m_rowStat[row].intraSatdForVbv - curEncData.m_rowStat[row].diagIntraSatd;
+                intraCostForPendingCus >>= X265_DEPTH - 8;
                 /* Our QP is lower than the reference! */
                 double pred_intra = predictSize(rce->rowPred[1], qScale, intraCostForPendingCus);
                 /* Sum: better to overestimate than underestimate by using only one of the two predictors. */
@@ -1963,7 +1964,7 @@
             uint64_t intraRowSatdCost = curEncData.m_rowStat[row].diagIntraSatd;
             if (row == 1)
                 intraRowSatdCost += curEncData.m_rowStat[0].diagIntraSatd;
-
+            intraRowSatdCost >>= X265_DEPTH - 8;
             updatePredictor(rce->rowPred[1], qScaleVbv, (double)intraRowSatdCost, encodedBits);
         }
     }


More information about the x265-devel mailing list