[x265] [PATCH] add cli for Intra refresh
santhoshini at multicorewareinc.com
santhoshini at multicorewareinc.com
Fri Sep 25 08:57:22 CEST 2015
# HG changeset patch
# User Santhoshini Sekar<santhoshini at multicorewareinc.com>
# Date 1441626229 -19800
# Mon Sep 07 17:13:49 2015 +0530
# Node ID 65fabbf755e8c666108251e706dbea170fa1145e
# Parent 97b62cb57bfa171e50d3fa736527634bb507cbe5
add cli for Intra refresh
diff -r 97b62cb57bfa -r 65fabbf755e8 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 65fabbf755e8 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 65fabbf755e8 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")
{
@@ -1453,6 +1454,7 @@
BOOL(p->bSaoNonDeblocked, "sao-non-deblock");
BOOL(p->bBPyramid, "b-pyramid");
BOOL(p->rc.cuTree, "cutree");
+ BOOL(p->bIntraRefresh, "intra-refresh");
s += sprintf(s, " rc=%s", p->rc.rateControlMode == X265_RC_ABR ? (
p->rc.bStatRead ? "2 pass" : p->rc.bitrate == p->rc.vbvMaxBitrate ? "cbr" : "abr")
: p->rc.rateControlMode == X265_RC_CRF ? "crf" : "cqp");
diff -r 97b62cb57bfa -r 65fabbf755e8 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);
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 65fabbf755e8 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);
More information about the x265-devel
mailing list