[x265] [PATCH] slicetype: remove --refresh and use --open-gop(default: enable)

kavitha at multicorewareinc.com kavitha at multicorewareinc.com
Tue Dec 17 08:47:57 CET 2013


# 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


More information about the x265-devel mailing list