[x265] [PATCH] slicetype: remove --refresh and use --open-gop(default: enable)
Deepthi Nandakumar
deepthi at multicorewareinc.com
Fri Jan 3 11:49:29 CET 2014
We'd like to request any relevant feedback on this patch. Essentially,
we're removing the refresh parameter, since it conflicts with the openGOP
parameter.
By default, an openGOP will be enabled, which means we could have both
RADL/RASL following CRA pictures. The encoder could control the references,
and thus ensure that all leading pictures are decodable (ie that they are
always RADL). But IMO, this destroys the purpose of openGOP (?).
Thoughts/opinions welcome.
Thanks,
Deepthi
On Tue, Dec 17, 2013 at 1:17 PM, <kavitha at multicorewareinc.com> wrote:
> # HG changeset patch
> # User Kavitha Sampath <kavitha at multicorewareinc.com>
> # Date 1387266260 -19800
> # Tue Dec 17 13:14:20 2013 +0530
> # Node ID 17bb20c49d67b1d9d02770e7b5dff8381199c527
> # Parent 4b0163d06ba19d433749a659365b4364c32c8eae
> slicetype: remove --refresh and use --open-gop(default: enable)
>
> diff -r 4b0163d06ba1 -r 17bb20c49d67 source/common/common.cpp
> --- a/source/common/common.cpp Sat Dec 14 23:27:48 2013 +0530
> +++ b/source/common/common.cpp Tue Dec 17 13:14:20 2013 +0530
> @@ -157,10 +157,9 @@
> param->tuQTMaxIntraDepth = 1;
>
> /* Coding Structure */
> - param->decodingRefreshType = 1;
> param->keyframeMin = 0;
> param->keyframeMax = 250;
> - param->bOpenGOP = 0;
> + param->bOpenGOP = 1;
> param->bframes = 4;
> param->lookaheadDepth = 20;
> param->bFrameAdaptive = X265_B_ADAPT_TRELLIS;
> @@ -694,7 +693,7 @@
> OPT("tskip-fast") p->bEnableTSkipFast = bvalue;
> OPT("strong-intra-smoothing") p->bEnableStrongIntraSmoothing = bvalue;
> OPT("constrained-intra") p->bEnableConstrainedIntra = bvalue;
> - OPT("refresh") p->decodingRefreshType = atoi(value);
> + OPT("open-gop") p->bOpenGOP = bvalue;
> OPT("keyint") p->keyframeMax = atoi(value);
> OPT("rc-lookahead") p->lookaheadDepth = atoi(value);
> OPT("bframes") p->bframes = atoi(value);
> @@ -774,7 +773,7 @@
> BOOL(p->bEnableTSkipFast, "tskip-fast");
> BOOL(p->bEnableStrongIntraSmoothing, "strong-intra-smoothing");
> BOOL(p->bEnableConstrainedIntra, "constrained-intra");
> - s += sprintf(s, " refresh=%d", p->decodingRefreshType);
> + BOOL(p->bOpenGOP, "open-gop");
> s += sprintf(s, " keyint=%d", p->keyframeMax);
> s += sprintf(s, " rc-lookahead=%d", p->lookaheadDepth);
> s += sprintf(s, " bframes=%d", p->bframes);
> diff -r 4b0163d06ba1 -r 17bb20c49d67 source/encoder/dpb.cpp
> --- a/source/encoder/dpb.cpp Sat Dec 14 23:27:48 2013 +0530
> +++ b/source/encoder/dpb.cpp Tue Dec 17 13:14:20 2013 +0530
> @@ -379,11 +379,11 @@
> }
> if (pic->m_lowres.bKeyframe)
> {
> - if (m_cfg->param.decodingRefreshType == 1)
> + if (m_cfg->param.bOpenGOP)
> {
> return NAL_UNIT_CODED_SLICE_CRA;
> }
> - else if (m_cfg->param.decodingRefreshType == 2)
> + else
> {
> return NAL_UNIT_CODED_SLICE_IDR_W_RADL;
> }
> diff -r 4b0163d06ba1 -r 17bb20c49d67 source/encoder/slicetype.cpp
> --- a/source/encoder/slicetype.cpp Sat Dec 14 23:27:48 2013 +0530
> +++ b/source/encoder/slicetype.cpp Tue Dec 17 13:14:20 2013 +0530
> @@ -1059,7 +1059,7 @@
> // if (!cfg->param.bIntraRefresh)
> for (int j = keyint_limit + 1; j <= num_frames; j +=
> cfg->param.keyframeMax)
> {
> - frames[j]->sliceType = X265_TYPE_I;
> + frames[j]->sliceType = X265_TYPE_KEYFRAME;
> reset_start = X265_MIN(reset_start, j + 1);
> }
>
> diff -r 4b0163d06ba1 -r 17bb20c49d67 source/x265.cpp
> --- a/source/x265.cpp Sat Dec 14 23:27:48 2013 +0530
> +++ b/source/x265.cpp Tue Dec 17 13:14:20 2013 +0530
> @@ -110,7 +110,8 @@
> { "tskip-fast", no_argument, NULL, 0 },
> { "no-constrained-intra", no_argument, NULL, 0 },
> { "constrained-intra", no_argument, NULL, 0 },
> - { "refresh", required_argument, NULL, 0 },
> + { "no-open-gop", no_argument, NULL, 0 },
> + { "open-gop", no_argument, NULL, 0 },
> { "keyint", required_argument, NULL, 'i' },
> { "rc-lookahead", required_argument, NULL, 0 },
> { "bframes", required_argument, NULL, 'b' },
> @@ -303,7 +304,7 @@
> H0(" --[no-]strong-intra-smoothing Enable strong intra smoothing
> for 32x32 blocks. Default %s\n", OPT(param->bEnableStrongIntraSmoothing));
> H0(" --[no-]constrained-intra Constrained intra prediction
> (use only intra coded reference pixels) Default %s\n",
> OPT(param->bEnableConstrainedIntra));
> H0("\nSlice decision options:\n");
> - H0(" --refresh Intra refresh type - 0:none,
> 1:CDR, 2:IDR (default: CDR) Default %d\n", param->decodingRefreshType);
> + H0(" --[no-]open-gop Enable openGOP, allows I slice
> to be non-IDR. Default %s\n", OPT(param->bOpenGOP));
> H0("-i/--keyint Max intra period in frames.
> Default %d\n", param->keyframeMax);
> H0(" --rc-lookahead Number of frames for frame-type
> lookahead (determines encoder latency) Default %d\n",
> param->lookaheadDepth);
> H0(" --bframes Maximum number of consecutive
> b-frames (now it only enables B GOP structure) Default %d\n",
> param->bframes);
> diff -r 4b0163d06ba1 -r 17bb20c49d67 source/x265.h
> --- a/source/x265.h Sat Dec 14 23:27:48 2013 +0530
> +++ b/source/x265.h Tue Dec 17 13:14:20 2013 +0530
> @@ -336,15 +336,11 @@
>
> /*== GOP Structure and Lokoahead ==*/
>
> - /* Determine the intra refresh style your decoder will use. (0:none,
> 1:CDR,
> - * 2:IDR). Defaults to CDR */
> - int decodingRefreshType;
> -
> /* Enable open GOP - meaning I slices are not necessariy IDR and thus
> frames
> * encoded after an I slice may reference frames encoded prior to the
> I
> * frame which have remained in the decoded picture buffer. Open GOP
> * generally has better compression efficiency and negligable encoder
> - * performance impact, but the use case may preclude it. Default
> false */
> + * performance impact, but the use case may preclude it. Default
> true */
> int bOpenGOP;
>
> /* Minimum keyframe distance or intra period in number of frames. Can
> be
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20140103/202ec28a/attachment.html>
More information about the x265-devel
mailing list