[x265] [PATCH] api/cli: rename the scenecut bias option

gopi.satykrishna at multicorewareinc.com gopi.satykrishna at multicorewareinc.com
Wed Nov 2 07:22:18 CET 2016


# HG changeset patch
# User Gopi Satykrishna Akisetty <gopi.satykrishna at multicorewareinc.com>
# Date 1478067011 -19800
#      Wed Nov 02 11:40:11 2016 +0530
# Node ID 8b9d1cc0d49516470e4ee0138046b9898023d2d9
# Parent  1a5905a6379a496a9627bd2ff9d3b2de48b08d6b
api/cli: rename the scenecut bias option

diff -r 1a5905a6379a -r 8b9d1cc0d495 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Wed Nov 02 11:04:04 2016 +0530
+++ b/doc/reST/cli.rst	Wed Nov 02 11:40:11 2016 +0530
@@ -1163,7 +1163,7 @@
 	:option:`--scenecut` 0 or :option:`--no-scenecut` disables adaptive
 	I frame placement. Default 40
 
-.. option:: --bias-for-scenecut <0..100.0>
+.. option:: --scenecut-bias <0..100.0>
 
 	This value represents the percentage difference between the inter cost and
 	intra cost of a frame used in scenecut detection. For example, a value of 5 indicates,
diff -r 1a5905a6379a -r 8b9d1cc0d495 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Wed Nov 02 11:04:04 2016 +0530
+++ b/source/CMakeLists.txt	Wed Nov 02 11:40:11 2016 +0530
@@ -30,7 +30,7 @@
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 100)
+set(X265_BUILD 101)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r 1a5905a6379a -r 8b9d1cc0d495 source/common/param.cpp
--- a/source/common/param.cpp	Wed Nov 02 11:04:04 2016 +0530
+++ b/source/common/param.cpp	Wed Nov 02 11:40:11 2016 +0530
@@ -149,7 +149,7 @@
     param->bBPyramid = 1;
     param->scenecutThreshold = 40; /* Magic number pulled in from x264 */
     param->lookaheadSlices = 8;
-    param->bBiasForScenecut = 5.0;
+    param->scenecutBias = 5.0;
 
     /* Intra Coding Tools */
     param->bEnableConstrainedIntra = 0;
@@ -918,7 +918,7 @@
         OPT("opt-qp-pps") p->bOptQpPPS = atobool(value);
         OPT("opt-ref-list-length-pps") p->bOptRefListLengthPPS = atobool(value);
         OPT("multi-pass-opt-rps") p->bMultiPassOptRPS = atobool(value);
-        OPT("bias-for-scenecut") p->bBiasForScenecut = atof(value);
+        OPT("scenecut-bias") p->scenecutBias = atof(value);
 
         else
             return X265_PARAM_BAD_NAME;
@@ -1222,8 +1222,8 @@
           "Valid Logging level -1:none 0:error 1:warning 2:info 3:debug 4:full");
     CHECK(param->scenecutThreshold < 0,
           "scenecutThreshold must be greater than 0");
-    CHECK(param->bBiasForScenecut < 0 || 100 < param->bBiasForScenecut,
-           "bias-for-scenecut must be between 0 and 100");
+    CHECK(param->scenecutBias < 0 || 100 < param->scenecutBias,
+           "scenecut-bias must be between 0 and 100");
     CHECK(param->rdPenalty < 0 || param->rdPenalty > 2,
           "Valid penalty for 32x32 intra TU in non-I slices. 0:disabled 1:RD-penalty 2:maximum");
     CHECK(param->keyframeMax < -1,
@@ -1344,7 +1344,7 @@
     x265_log(param, X265_LOG_INFO, "ME / range / subpel / merge         : %s / %d / %d / %d\n",
              x265_motion_est_names[param->searchMethod], param->searchRange, param->subpelRefine, param->maxNumMergeCand);
     if (param->keyframeMax != INT_MAX || param->scenecutThreshold)
-        x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut / bias: %d / %d / %d / %.2lf\n", param->keyframeMin, param->keyframeMax, param->scenecutThreshold, param->bBiasForScenecut * 100);
+        x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut / bias: %d / %d / %d / %.2lf\n", param->keyframeMin, param->keyframeMax, param->scenecutThreshold, param->scenecutBias * 100);
     else
         x265_log(param, X265_LOG_INFO, "Keyframe min / max / scenecut       : disabled\n");
 
@@ -1471,7 +1471,7 @@
     s += sprintf(s, " keyint=%d", p->keyframeMax);
     s += sprintf(s, " min-keyint=%d", p->keyframeMin);
     s += sprintf(s, " scenecut=%d", p->scenecutThreshold);
-    s += sprintf(s, " bias-for-scenecut=%.2f", p->bBiasForScenecut);
+    s += sprintf(s, " scenecut-bias=%.2f", p->scenecutBias);
     s += sprintf(s, " rc-lookahead=%d", p->lookaheadDepth);
     s += sprintf(s, " lookahead-slices=%d", p->lookaheadSlices);
     s += sprintf(s, " bframes=%d", p->bframes);
diff -r 1a5905a6379a -r 8b9d1cc0d495 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed Nov 02 11:04:04 2016 +0530
+++ b/source/encoder/encoder.cpp	Wed Nov 02 11:40:11 2016 +0530
@@ -1924,7 +1924,7 @@
     m_bframeDelay = p->bframes ? (p->bBPyramid ? 2 : 1) : 0;
 
     p->bFrameBias = X265_MIN(X265_MAX(-90, p->bFrameBias), 100);
-    p->bBiasForScenecut = (double)(p->bBiasForScenecut / 100);
+    p->scenecutBias = (double)(p->scenecutBias / 100);
 
     if (p->logLevel < X265_LOG_INFO)
     {
diff -r 1a5905a6379a -r 8b9d1cc0d495 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Wed Nov 02 11:04:04 2016 +0530
+++ b/source/encoder/slicetype.cpp	Wed Nov 02 11:40:11 2016 +0530
@@ -1617,7 +1617,7 @@
 
     /* magic numbers pulled out of thin air */
     float threshMin = (float)(threshMax * 0.25);
-    double bias = m_param->bBiasForScenecut;
+    double bias = m_param->scenecutBias;
     if (bRealScenecut)
     {
         if (m_param->keyframeMin == m_param->keyframeMax)
diff -r 1a5905a6379a -r 8b9d1cc0d495 source/x265.h
--- a/source/x265.h	Wed Nov 02 11:04:04 2016 +0530
+++ b/source/x265.h	Wed Nov 02 11:40:11 2016 +0530
@@ -1331,7 +1331,7 @@
 
     /* This value represents the percentage difference between the inter cost and
     * intra cost of a frame used in scenecut detection. Default 5. */
-    double     bBiasForScenecut;
+    double     scenecutBias;
 
 } x265_param;
 
diff -r 1a5905a6379a -r 8b9d1cc0d495 source/x265cli.h
--- a/source/x265cli.h	Wed Nov 02 11:04:04 2016 +0530
+++ b/source/x265cli.h	Wed Nov 02 11:40:11 2016 +0530
@@ -121,7 +121,7 @@
     { "min-keyint",     required_argument, NULL, 'i' },
     { "scenecut",       required_argument, NULL, 0 },
     { "no-scenecut",          no_argument, NULL, 0 },
-    { "bias-for-scenecut", required_argument, NULL, 0 },
+    { "scenecut-bias",  required_argument, NULL, 0 },
     { "intra-refresh",        no_argument, NULL, 0 },
     { "rc-lookahead",   required_argument, NULL, 0 },
     { "lookahead-slices", required_argument, NULL, 0 },
@@ -368,7 +368,7 @@
     H0("-i/--min-keyint <integer>        Scenecuts closer together than this are coded as I, not IDR. Default: auto\n");
     H0("   --no-scenecut                 Disable adaptive I-frame decision\n");
     H0("   --scenecut <integer>          How aggressively to insert extra I-frames. Default %d\n", param->scenecutThreshold);
-    H1("   --bias-for-scenecut<0..100.0> Bias for scenecut detection. Default %.2f\n", param->bBiasForScenecut);
+    H1("   --scenecut-bias <0..100.0>    Bias for scenecut detection. Default %.2f\n", param->scenecutBias);
     H0("   --intra-refresh               Use Periodic Intra Refresh instead of IDR frames\n");
     H0("   --rc-lookahead <integer>      Number of frames for frame-type lookahead (determines encoder latency) Default %d\n", param->lookaheadDepth);
     H1("   --lookahead-slices <0..16>    Number of slices to use per lookahead cost estimate. Default %d\n", param->lookaheadSlices);


More information about the x265-devel mailing list