[x265] [PATCH] Add max-ausize-factor option to control the maximum AU size defined in specification

Ashok Kumar Mishra ashok at multicorewareinc.com
Mon Mar 5 11:00:31 CET 2018


On Mon, Mar 5, 2018 at 3:12 PM, Divya Manivannan <divya at multicorewareinc.com
> wrote:

> # HG changeset patch
> # User Divya Manivannan <divya at multicorewareinc.com>
> # Date 1519726842 -19800
> #      Tue Feb 27 15:50:42 2018 +0530
> # Node ID 59c02e68410fcb2846cd7a021e2639f96e0a9609
> # Parent  4c0d8a22625d0b13a9808329cb9bf8c03f7c6035
> Add max-ausize-factor option to control the maximum AU size defined in
> specification
>
> diff -r 4c0d8a22625d -r 59c02e68410f doc/reST/cli.rst
> --- a/doc/reST/cli.rst  Thu Jan 25 11:37:21 2018 +0530
> +++ b/doc/reST/cli.rst  Tue Feb 27 15:50:42 2018 +0530
> @@ -1857,6 +1857,11 @@
>         the more bits it will try to spend on signaling information (motion
>         vectors and splits) and less on residual. This feature is intended
>         for experimentation.
> +
> +.. option:: --max-ausize-factor <float>
> +
> +        It controls the maximum AU size defined in specification. It
> represents
> +        the percentage of maximum AU size used. Default is 1. Range is
> 0.5 to 1.
>
>  Loop filters
>  ============
> diff -r 4c0d8a22625d -r 59c02e68410f source/CMakeLists.txt
> --- a/source/CMakeLists.txt     Thu Jan 25 11:37:21 2018 +0530
> +++ b/source/CMakeLists.txt     Tue Feb 27 15:50:42 2018 +0530
> @@ -29,7 +29,7 @@
>  option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
>  mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
>  # X265_BUILD must be incremented each time the public API is changed
> -set(X265_BUILD 152)
> +set(X265_BUILD 153)
>  configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
>                 "${PROJECT_BINARY_DIR}/x265.def")
>  configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
> diff -r 4c0d8a22625d -r 59c02e68410f source/common/param.cpp
> --- a/source/common/param.cpp   Thu Jan 25 11:37:21 2018 +0530
> +++ b/source/common/param.cpp   Tue Feb 27 15:50:42 2018 +0530
> @@ -295,6 +295,7 @@
>      param->forceFlush = 0;
>      param->bDisableLookahead = 0;
>      param->bCopyPicToFrame = 1;
> +    param->maxAUSizeFactor = 1;
>
>      /* DCT Approximations */
>      param->bLowPassDct = 0;
> @@ -1012,6 +1013,7 @@
>          OPT("analysis-save") p->analysisSave = strdup(value);
>          OPT("analysis-load") p->analysisLoad = strdup(value);
>          OPT("radl") p->radl = atoi(value);
> +        OPT("max-ausize-factor") p->maxAUSizeFactor = atof(value);
>          else
>              return X265_PARAM_BAD_NAME;
>      }
> @@ -1367,6 +1369,8 @@
>          "Invalid refine-inter value, refine-inter levels 0 to 3
> supported");
>      CHECK(param->intraRefine > 4 || param->intraRefine < 0,
>          "Invalid refine-intra value, refine-intra levels 0 to 3
> supported");
> +    CHECK(param->maxAUSizeFactor < 0.5 || param->maxAUSizeFactor > 1.0,
> +        "Supported factor for controlling max AU size is from 0.5 to 1");
>  #if !X86_64
>      CHECK(param->searchMethod == X265_SEA && (param->sourceWidth > 840 ||
> param->sourceHeight > 480),
>          "SEA motion search does not support resolutions greater than 480p
> in 32 bit build");
> @@ -1740,6 +1744,7 @@
>      BOOL(p->bLowPassDct, "lowpass-dct");
>      s += sprintf(s, " refine-mv-type=%d", p->bMVType);
>      s += sprintf(s, " copy-pic=%d", p->bCopyPicToFrame);
> +    s += sprintf(s, " max-ausize-factor=%.1f", p->maxAUSizeFactor);
>  #undef BOOL
>      return buf;
>  }
> diff -r 4c0d8a22625d -r 59c02e68410f source/encoder/ratecontrol.cpp
> --- a/source/encoder/ratecontrol.cpp    Thu Jan 25 11:37:21 2018 +0530
> +++ b/source/encoder/ratecontrol.cpp    Tue Feb 27 15:50:42 2018 +0530
> @@ -1302,6 +1302,7 @@
>                  /* 1.5 * MaxLumaSr * (AuCpbRemovalTime[ n ] -
> AuCpbRemovalTime[ n - 1 ]) / MinCr */
>                  rce->frameSizeMaximum = 8 * 1.5 * enc->m_vps.ptl.maxLumaSrForLevel
> * m_frameDuration / mincr;
>              }
> +            rce->frameSizeMaximum *= m_param->maxAUSizeFactor;
>          }
>      }
>      if (!m_isAbr && m_2pass && m_param->rc.rateControlMode == X265_RC_CRF)
> diff -r 4c0d8a22625d -r 59c02e68410f source/x265.h
> --- a/source/x265.h     Thu Jan 25 11:37:21 2018 +0530
> +++ b/source/x265.h     Tue Feb 27 15:50:42 2018 +0530
> @@ -1548,6 +1548,11 @@
>
>      /*Number of RADL pictures allowed in front of IDR*/
>      int radl;
> +
> +    /* This value controls the maximum AU size defined in specification
> +     * It represents the percentage of maximum AU size used.
> +     * Default is 1 (which is 100%). Range is 0.5 to 1. */
> +    double maxAUSizeFactor;
>  } x265_param;
>
>  /* x265_param_alloc:
> diff -r 4c0d8a22625d -r 59c02e68410f source/x265cli.h
> --- a/source/x265cli.h  Thu Jan 25 11:37:21 2018 +0530
> +++ b/source/x265cli.h  Tue Feb 27 15:50:42 2018 +0530
> @@ -293,6 +293,7 @@
>      { "refine-mv-type", required_argument, NULL, 0 },
>      { "copy-pic",             no_argument, NULL, 0 },
>      { "no-copy-pic",          no_argument, NULL, 0 },
> +    { "max-ausize-factor", required_argument, NULL, 0 },
>      { 0, 0, 0, 0 },
>      { 0, 0, 0, 0 },
>      { 0, 0, 0, 0 },
> @@ -516,6 +517,8 @@
>      H1("                                 MAX_MAX_QP+1 floats for lambda
> table, then again for lambda2 table\n");
>      H1("                                 Blank lines and lines starting
> with hash(#) are ignored\n");
>      H1("                                 Comma is considered to be
> white-space\n");
> +    H0("   --max-ausize-factor <float>   This value controls the maximum
> AU size defined in specification.\n");
> +    H0("                                 It represents the percentage of
> maximum AU size used. Default %.1f\n", param->maxAUSizeFactor);
>      H0("\nLoop filters (deblock and SAO):\n");
>      H0("   --[no-]deblock                Enable Deblocking Loop Filter,
> optionally specify tC:Beta offsets Default %s\n",
> OPT(param->bEnableLoopFilter));
>      H0("   --[no-]sao                    Enable Sample Adaptive Offset.
> Default %s\n", OPT(param->bEnableSAO));
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
>
Pushed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20180305/944c96eb/attachment.html>


More information about the x265-devel mailing list