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

aarthi at multicorewareinc.com aarthi at multicorewareinc.com
Tue Jun 17 16:38:45 CEST 2014


# HG changeset patch
# User Aarthi Thirumalai<aarthi at multicorewareinc.com>
# Date 1403010147 -19800
#      Tue Jun 17 18:32:27 2014 +0530
# Node ID 4bccab85e50bbe15ba7e9d757381b3fc014a357f
# Parent  68023103bf2f9cbf23c5b3f8fd7f4f42b4d3bd4f
param: log rc states of m_param in x265_param2string

diff -r 68023103bf2f -r 4bccab85e50b source/common/param.cpp
--- a/source/common/param.cpp	Tue Jun 17 17:20:46 2014 +0530
+++ b/source/common/param.cpp	Tue Jun 17 18:32:27 2014 +0530
@@ -1235,8 +1235,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);
@@ -1247,10 +1245,40 @@
     BOOL(p->bEnableSAO, "sao");
     s += sprintf(s, " sao-lcu-bounds=%d", p->saoLcuBoundary);
     s += sprintf(s, " sao-lcu-opt=%d", p->saoLcuBasedOptimization);
-    s += sprintf(s, " b-pyramid=%d", p->bBPyramid);
+    BOOL(p->bBPyramid, "b-pyramid");
     BOOL(p->rc.cuTree, "cutree");
+    s += sprintf(s, " rc=%s", p->rc.rateControlMode == X265_RC_ABR ? (
+         p->rc.statInFileName ? "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.statInFileName)
+            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);
+    if (!(p->rc.rateControlMode == X265_RC_CQP && p->rc.qp == 0))
+    {
+        s += sprintf(s, " ip_ratio=%.2f", p->rc.ipFactor);
+        if (p->bframes)
+            s += sprintf(s, " pb_ratio=%.2f", p->rc.pbFactor);
+    }
 #undef BOOL
-
     return buf;
 }
 }


More information about the x265-devel mailing list