[x265] [PATCH 01 of 18] [slices] new option --slices

Min Chen chenm003 at 163.com
Thu Sep 1 01:13:26 CEST 2016


# HG changeset patch
# User Min Chen <min.chen at multicorewareinc.com>
# Date 1472668671 18000
# Node ID cc9c2243e589d6bb41c9eb5518000826f8970551
# Parent  49a0d1176aef5bc6330fcfd39b4589616c174f0a
[slices] new option --slices
---
 source/common/param.cpp |    6 ++++++
 source/x265.h           |    3 +++
 source/x265cli.h        |    1 +
 3 files changed, 10 insertions(+), 0 deletions(-)

diff -r 49a0d1176aef -r cc9c2243e589 source/common/param.cpp
--- a/source/common/param.cpp	Wed Jul 27 21:47:20 2016 +0200
+++ b/source/common/param.cpp	Wed Aug 31 13:37:51 2016 -0500
@@ -251,6 +251,7 @@
     param->maxFALL = 0;
     param->minLuma = 0;
     param->maxLuma = PIXEL_MAX;
+    param->maxSlices = 1;
 }
 
 int x265_param_default_preset(x265_param* param, const char* preset, const char* tune)
@@ -888,6 +889,7 @@
     OPT("min-luma") p->minLuma = (uint16_t)atoi(value);
     OPT("max-luma") p->maxLuma = (uint16_t)atoi(value);
     OPT("uhd-bd") p->uhdBluray = atobool(value);
+    OPT("slices") p->maxSlices = atoi(value);
     else
         bExtraParams = true;
     if (bExtraParams)
@@ -1223,6 +1225,8 @@
         "qpmax exceeds supported range (0 to 69)");
     CHECK(param->rc.qpMin < QP_MIN || param->rc.qpMin > QP_MAX_MAX,
         "qpmin exceeds supported range (0 to 69)");
+    CHECK(1 > param->maxSlices || param->maxSlices > ((param->sourceHeight + param->maxCUSize - 1) / param->maxCUSize),
+        "The slices can not be more than rows");
     return check_failed;
 }
 
@@ -1373,6 +1377,8 @@
     TOOLOPT(param->bEnableFastIntra, "fast-intra");
     TOOLOPT(param->bEnableStrongIntraSmoothing, "strong-intra-smoothing");
     TOOLVAL(param->lookaheadSlices, "lslices=%d");
+    if (param->maxSlices > 1)
+        TOOLVAL(param->maxSlices, "slices=%d");
     if (param->bEnableLoopFilter)
     {
         if (param->deblockingFilterBetaOffset || param->deblockingFilterTCOffset)
diff -r 49a0d1176aef -r cc9c2243e589 source/x265.h
--- a/source/x265.h	Wed Jul 27 21:47:20 2016 +0200
+++ b/source/x265.h	Wed Aug 31 13:37:51 2016 -0500
@@ -1294,6 +1294,9 @@
      * value to that value. */
     uint16_t maxLuma;
 
+    /* Maximum count of Slices of picture, the value range is [1, maximum rows] */
+    unsigned int maxSlices;
+
 } x265_param;
 
 /* x265_param_alloc:
diff -r 49a0d1176aef -r cc9c2243e589 source/x265cli.h
--- a/source/x265cli.h	Wed Jul 27 21:47:20 2016 +0200
+++ b/source/x265cli.h	Wed Aug 31 13:37:51 2016 -0500
@@ -232,6 +232,7 @@
     { "no-temporal-layers",   no_argument, NULL, 0 },
     { "qg-size",        required_argument, NULL, 0 },
     { "recon-y4m-exec", required_argument, NULL, 0 },
+    { "slices",         required_argument, NULL, 0 },
     { 0, 0, 0, 0 },
     { 0, 0, 0, 0 },
     { 0, 0, 0, 0 },



More information about the x265-devel mailing list