[x265] [PATCH] recursion-skip: add option to skip/force recursion of compressInter for higher depths

kavitha at multicorewareinc.com kavitha at multicorewareinc.com
Mon Feb 22 12:33:41 CET 2016


# HG changeset patch
# User Kavitha Sampath <kavitha at multicorewareinc.com>
# Date 1455875475 -19800
#      Fri Feb 19 15:21:15 2016 +0530
# Node ID 9f30ae437b447ac25545347dd49244d761de144e
# Parent  c2228fb8151ddce111a75fb1c02b25eca5a68604
recursion-skip: add option to skip/force recursion of compressInter for higher depths

diff -r c2228fb8151d -r 9f30ae437b44 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Fri Feb 19 09:50:42 2016 +0530
+++ b/doc/reST/cli.rst	Fri Feb 19 15:21:15 2016 +0530
@@ -725,6 +725,12 @@
 	Measure 2Nx2N merge candidates first; if no residual is found, 
 	additional modes at that depth are not analysed. Default disabled
 
+.. option:: --recursion-skip, --no-recursion-skip
+
+	Analyse inter modes for current depth and skip analysis of
+	higher depth for skip CUs. If disabled, force analysis for higher
+	depth even if CU is skipped. Default enabled.
+
 .. option:: --fast-intra, --no-fast-intra
 
 	Perform an initial scan of every fifth intra angular mode, then
diff -r c2228fb8151d -r 9f30ae437b44 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Fri Feb 19 09:50:42 2016 +0530
+++ b/source/CMakeLists.txt	Fri Feb 19 15:21:15 2016 +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 81)
+set(X265_BUILD 82)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r c2228fb8151d -r 9f30ae437b44 source/common/param.cpp
--- a/source/common/param.cpp	Fri Feb 19 09:50:42 2016 +0530
+++ b/source/common/param.cpp	Fri Feb 19 15:21:15 2016 +0530
@@ -164,6 +164,7 @@
     param->bEnableWeightedPred = 1;
     param->bEnableWeightedBiPred = 0;
     param->bEnableEarlySkip = 0;
+    param->bEnableRecursionSkip = 1;
     param->bEnableAMP = 0;
     param->bEnableRectInter = 0;
     param->rdLevel = 3;
@@ -617,6 +618,7 @@
     OPT("max-merge") p->maxNumMergeCand = (uint32_t)atoi(value);
     OPT("temporal-mvp") p->bEnableTemporalMvp = atobool(value);
     OPT("early-skip") p->bEnableEarlySkip = atobool(value);
+    OPT("recursion-skip") p->bEnableRecursionSkip = atobool(value);
     OPT("rdpenalty") p->rdPenalty = atoi(value);
     OPT("tskip") p->bEnableTransformSkip = atobool(value);
     OPT("no-tskip-fast") p->bEnableTSkipFast = atobool(value);
@@ -1338,6 +1340,7 @@
     TOOLVAL(param->psyRdoq, "psy-rdoq=%.2lf");
     TOOLOPT(param->bEnableRdRefine, "rd-refine");
     TOOLOPT(param->bEnableEarlySkip, "early-skip");
+    TOOLOPT(param->bEnableRecursionSkip, "recursion-skip");
     TOOLVAL(param->noiseReductionIntra, "nr-intra=%d");
     TOOLVAL(param->noiseReductionInter, "nr-inter=%d");
     TOOLOPT(param->bEnableTSkipFast, "tskip-fast");
@@ -1402,6 +1405,7 @@
 
     TOOLCMP(param->bEnableTemporalMvp, reconfiguredParam->bEnableTemporalMvp, "tmvp=%d", reconfiguredParam->bEnableTemporalMvp);
     TOOLCMP(param->bEnableEarlySkip, reconfiguredParam->bEnableEarlySkip, "early-skip=%d", reconfiguredParam->bEnableEarlySkip);
+    TOOLCMP(param->bEnableRecursionSkip, reconfiguredParam->bEnableRecursionSkip, "recursion-skip=%d", reconfiguredParam->bEnableRecursionSkip);
     x265_log(param, X265_LOG_INFO, "tools:%s\n", buf);
 }
 
@@ -1433,6 +1437,7 @@
     s += sprintf(s, " max-merge=%d", p->maxNumMergeCand);
     BOOL(p->bEnableTemporalMvp, "temporal-mvp");
     BOOL(p->bEnableEarlySkip, "early-skip");
+    BOOL(p->bEnableRecursionSkip, "recursion-skip");
     s += sprintf(s, " rdpenalty=%d", p->rdPenalty);
     BOOL(p->bEnableTransformSkip, "tskip");
     BOOL(p->bEnableTSkipFast, "tskip-fast");
diff -r c2228fb8151d -r 9f30ae437b44 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Fri Feb 19 09:50:42 2016 +0530
+++ b/source/encoder/analysis.cpp	Fri Feb 19 15:21:15 2016 +0530
@@ -931,6 +931,7 @@
             foundSkip = recursionDepthCheck(parentCTU, cuGeom, *md.bestMode);
     }
 
+    foundSkip = foundSkip && m_param->bEnableRecursionSkip;
     /* Step 2. Evaluate each of the 4 split sub-blocks in series */
     if (mightSplit && !foundSkip)
     {
@@ -1416,6 +1417,7 @@
         earlyskip = m_param->bEnableEarlySkip && foundSkip;
     }
 
+    foundSkip = foundSkip && m_param->bEnableRecursionSkip;
     // estimate split cost
     /* Step 2. Evaluate each of the 4 split sub-blocks in series */
     if (mightSplit && !foundSkip)
diff -r c2228fb8151d -r 9f30ae437b44 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Fri Feb 19 09:50:42 2016 +0530
+++ b/source/encoder/encoder.cpp	Fri Feb 19 15:21:15 2016 +0530
@@ -890,6 +890,7 @@
     encParam->deblockingFilterBetaOffset = param->deblockingFilterBetaOffset;
     encParam->bEnableFastIntra = param->bEnableFastIntra;
     encParam->bEnableEarlySkip = param->bEnableEarlySkip;
+    encParam->bEnableRecursionSkip = param->bEnableRecursionSkip;
     encParam->bEnableTemporalMvp = param->bEnableTemporalMvp;
     /* Scratch buffer prevents me_range from being increased for esa/tesa
     if (param->searchMethod < X265_FULL_SEARCH || param->searchMethod < encParam->searchRange)
diff -r c2228fb8151d -r 9f30ae437b44 source/x265.h
--- a/source/x265.h	Fri Feb 19 09:50:42 2016 +0530
+++ b/source/x265.h	Fri Feb 19 15:21:15 2016 +0530
@@ -937,6 +937,10 @@
      * skip blocks. Default is disabled */
     int       bEnableEarlySkip;
 
+    /* Enable recursion skip decisions to avoid recurrent compressInter calls for
+     * higher depths. Default is enabled */
+    int       bEnableRecursionSkip;
+
     /* Use a faster search method to find the best intra mode. Default is 0 */
     int       bEnableFastIntra;
 
diff -r c2228fb8151d -r 9f30ae437b44 source/x265cli.h
--- a/source/x265cli.h	Fri Feb 19 09:50:42 2016 +0530
+++ b/source/x265cli.h	Fri Feb 19 15:21:15 2016 +0530
@@ -96,6 +96,8 @@
     { "amp",                  no_argument, NULL, 0 },
     { "no-early-skip",        no_argument, NULL, 0 },
     { "early-skip",           no_argument, NULL, 0 },
+    { "no-recursion-skip",    no_argument, NULL, 0 },
+    { "recursion-skip",       no_argument, NULL, 0 },
     { "no-fast-cbf",          no_argument, NULL, 0 },
     { "fast-cbf",             no_argument, NULL, 0 },
     { "no-tskip",             no_argument, NULL, 0 },
@@ -308,6 +310,7 @@
     H0("   --[no-]psy-rdoq <0..50.0>     Strength of psycho-visual optimization in RDO quantization, 0 to disable. Default %.1f\n", param->psyRdoq);
     H0("   --[no-]rd-refine              Enable QP based RD refinement for rd levels 5 and 6. Default %s\n", OPT(param->bEnableRdRefine));
     H0("   --[no-]early-skip             Enable early SKIP detection. Default %s\n", OPT(param->bEnableEarlySkip));
+    H0("   --[no-]recursion-skip         Enable recursion SKIP detection. Default %s\n", OPT(param->bEnableRecursionSkip));
     H1("   --[no-]tskip-fast             Enable fast intra transform skipping. Default %s\n", OPT(param->bEnableTSkipFast));
     H1("   --nr-intra <integer>          An integer value in range of 0 to 2000, which denotes strength of noise reduction in intra CUs. Default 0\n");
     H1("   --nr-inter <integer>          An integer value in range of 0 to 2000, which denotes strength of noise reduction in inter CUs. Default 0\n");


More information about the x265-devel mailing list