[x265] [PATCH 3 of 3] add cli for Intra refresh

Steve Borho steve at borho.org
Fri Sep 25 07:23:51 CEST 2015


On 09/24, santhoshini at multicorewareinc.com wrote:
> # HG changeset patch
> # User Santhoshini Sekar<santhoshini at multicorewareinc.com>
> # Date 1441626229 -19800
> #      Mon Sep 07 17:13:49 2015 +0530
> # Node ID 5520b8f17c5fc53f5d0afcb0e2df59eb8a4785b6
> # Parent  97b62cb57bfa171e50d3fa736527634bb507cbe5
> add cli for Intra refresh
> 
> diff -r 97b62cb57bfa -r 5520b8f17c5f doc/reST/cli.rst
> --- a/doc/reST/cli.rst	Wed Sep 16 14:26:59 2015 +0530
> +++ b/doc/reST/cli.rst	Mon Sep 07 17:13:49 2015 +0530
> @@ -1087,7 +1087,8 @@
>  
>  	Max intra period in frames. A special case of infinite-gop (single
>  	keyframe at the beginning of the stream) can be triggered with
> -	argument -1. Use 1 to force all-intra. Default 250
> +	argument -1. Use 1 to force all-intra. When intra-refresh is enabled
> +	it specifies the interval between which refresh sweeps happen. Default 250
>  
>  .. option:: --min-keyint, -i <integer>
>  
> @@ -1106,6 +1107,14 @@
>  	:option:`--scenecut` 0 or :option:`--no-scenecut` disables adaptive
>  	I frame placement. Default 40
>  
> +.. option:: --intra-refresh
> +
> +	Enables Periodic Intra Refresh(PIR) instead of keyframe insertion.
> +	PIR can replace keyframes by inserting a column of intra blocks in 
> +	non-keyframes, that move across the video from one side to the other
> +	and thereby refresh the image but over a period of multiple 
> +	frames instead of a single keyframe.
> +
>  .. option:: --rc-lookahead <integer>
>  
>  	Number of frames for slice-type decision lookahead (a key
> diff -r 97b62cb57bfa -r 5520b8f17c5f source/CMakeLists.txt
> --- a/source/CMakeLists.txt	Wed Sep 16 14:26:59 2015 +0530
> +++ b/source/CMakeLists.txt	Mon Sep 07 17:13:49 2015 +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 75)
> +set(X265_BUILD 76)
>  configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
>                 "${PROJECT_BINARY_DIR}/x265.def")
>  configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
> diff -r 97b62cb57bfa -r 5520b8f17c5f source/common/param.cpp
> --- a/source/common/param.cpp	Wed Sep 16 14:26:59 2015 +0530
> +++ b/source/common/param.cpp	Mon Sep 07 17:13:49 2015 +0530
> @@ -612,6 +612,7 @@
>      OPT2("constrained-intra", "cip") p->bEnableConstrainedIntra = atobool(value);
>      OPT("fast-intra") p->bEnableFastIntra = atobool(value);
>      OPT("open-gop") p->bOpenGOP = atobool(value);
> +    OPT("intra-refresh") p->bIntraRefresh = atobool(value);
>      OPT("lookahead-slices") p->lookaheadSlices = atoi(value);
>      OPT("scenecut")
>      {
> diff -r 97b62cb57bfa -r 5520b8f17c5f source/encoder/ratecontrol.cpp
> --- a/source/encoder/ratecontrol.cpp	Wed Sep 16 14:26:59 2015 +0530
> +++ b/source/encoder/ratecontrol.cpp	Mon Sep 07 17:13:49 2015 +0530
> @@ -455,6 +455,7 @@
>                  CMP_OPT_FIRST_PASS("open-gop", m_param->bOpenGOP);
>                  CMP_OPT_FIRST_PASS("keyint", m_param->keyframeMax);
>                  CMP_OPT_FIRST_PASS("scenecut", m_param->scenecutThreshold);
> +                CMP_OPT_FIRST_PASS("intra_refresh", m_param->bIntraRefresh);

for this to work intra-refresh must be in param2string

>                  if ((p = strstr(opts, "b-adapt=")) != 0 && sscanf(p, "b-adapt=%d", &i) && i >= X265_B_ADAPT_NONE && i <= X265_B_ADAPT_TRELLIS)
>                  {
> diff -r 97b62cb57bfa -r 5520b8f17c5f source/x265cli.h
> --- a/source/x265cli.h	Wed Sep 16 14:26:59 2015 +0530
> +++ b/source/x265cli.h	Mon Sep 07 17:13:49 2015 +0530
> @@ -116,6 +116,7 @@
>      { "min-keyint",     required_argument, NULL, 'i' },
>      { "scenecut",       required_argument, NULL, 0 },
>      { "no-scenecut",          no_argument, NULL, 0 },
> +    { "intra-refresh",        no_argument, NULL, 0 },
>      { "rc-lookahead",   required_argument, NULL, 0 },
>      { "lookahead-slices", required_argument, NULL, 0 },
>      { "bframes",        required_argument, NULL, 'b' },
> @@ -329,6 +330,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);
> +    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);
>      H0("   --bframes <integer>           Maximum number of consecutive b-frames (now it only enables B GOP structure) Default %d\n", param->bframes);
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel

-- 
Steve Borho


More information about the x265-devel mailing list