[x265] [PATCH 3 of 6] param: log rc states of m_param in x265_param2string

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Sun Jun 15 20:50:55 CEST 2014


# HG changeset patch
# User Aarthi Thirumalai<aarthi at multicorewareinc.com>
# Date 1402857250 -19800
#      Mon Jun 16 00:04:10 2014 +0530
# Node ID 5c2aee7700a3e222989fadabcb9ba9b1b3291fbd
# Parent  d1f636a6dc0a11657bb25be650de60345c2952c8
param: log rc states of m_param in x265_param2string

diff -r d1f636a6dc0a -r 5c2aee7700a3 source/common/param.cpp
--- a/source/common/param.cpp	Mon Jun 16 00:01:17 2014 +0530
+++ b/source/common/param.cpp	Mon Jun 16 00:04:10 2014 +0530
@@ -1247,8 +1247,6 @@
     s += sprintf(s, " ref=%d", p->maxNumReferences);
     BOOL(p->bEnableWeightedPred, "weightp");
     BOOL(p->bEnableWeightedBiPred, "weightb");
-    s += sprintf(s, " bitrate=%d", p->rc.bitrate);
-    s += sprintf(s, " qp=%d", p->rc.qp);
     s += sprintf(s, " aq-mode=%d", p->rc.aqMode);
     s += sprintf(s, " aq-strength=%.2f", p->rc.aqStrength);
     s += sprintf(s, " cbqpoffs=%d", p->cbQpOffset);
@@ -1261,8 +1259,32 @@
     s += sprintf(s, " sao-lcu-opt=%d", p->saoLcuBasedOptimization);
     s += sprintf(s, " b-pyramid=%d", p->bBPyramid);
     BOOL(p->rc.cuTree, "cutree");
+    s += sprintf(s, " rc=%s", p->rc.rateControlMode == X265_RC_ABR ? (
+         p->rc.statRead ? "2 pass" : p->rc.bitrate == p->rc.vbvMaxBitrate ? "cbr" : "abr")
+         : p->rc.rateControlMode == X265_RC_CRF ? "crf" : "cqp");
+    if (p->rc.rateControlMode == X265_RC_ABR || p->rc.rateControlMode == X265_RC_CRF)
+    {
+        if (p->rc.rateControlMode == X265_RC_CRF )
+            s += sprintf(s, " crf=%.1f", p->rc.rfConstant);
+        else
+            s += sprintf(s, " bitrate=%d ratetol=%.1f",
+                         p->rc.bitrate, p->rc.rateTolerance);
+        s += sprintf(s, " qcomp=%.2f qpmin=%d qpmax=%d qpstep=%d",
+                     p->rc.qCompress, MIN_QP, MAX_QP, p->rc.qpStep);
+        if (p->rc.statRead)
+            s += sprintf( s, " cplxblur=%.1f qblur=%.1f",
+                          p->rc.complexityBlur, p->rc.qblur);
+        if (p->rc.vbvBufferSize)
+        {
+            s += sprintf(s, " vbv_maxrate=%d vbv_bufsize=%d",
+                          p->rc.vbvMaxBitrate, p->rc.vbvBufferSize);
+            if (p->rc.rateControlMode == X265_RC_CRF)
+                s += sprintf(s, " crf_max=%.1f", p->rc.rfConstantMax);
+        }
+    }
+    else if (p->rc.rateControlMode == X265_RC_CQP)
+        s += sprintf(s, " qp=%d", p->rc.qp);
 #undef BOOL
-
     return buf;
 }
 }


More information about the x265-devel mailing list