# HG changeset patch
# User Srikanth Kurapati
# Date 1588752449 -19800
#      Wed May 06 13:37:29 2020 +0530
# Node ID df0886d58b867e7bd219ec3f8197bab22417795c
# Parent  303ff9e4546d0052e7a4d359323f0aca84eedd68
EQT Updates.

1. Improves documentation in help and x265readthedocs for rskip cli options.
2. Renamed rskip variable in x265_param structure & rectified regression clis.
3. Removed rskip mode 3 which is same as mode 2 with min-cu-size 16.

diff -r 303ff9e4546d -r df0886d58b86 doc/reST/cli.rst
--- a/doc/reST/cli.rst  Wed Apr 15 18:44:54 2020 +0530
+++ b/doc/reST/cli.rst  Wed May 06 13:37:29 2020 +0530
@@ -845,31 +845,31 @@
        Measure 2Nx2N merge candidates first; if no residual is found, 
        additional modes at that depth are not analysed. Default disabled
 
-.. option:: --rskip <0|1|2|3>
-
-       This option determines early exit from CU depth recursion in modes 1, 2 
and 3. When a skip CU is
-       found, additional heuristics (depending on RD level and rskip mode) are 
used to decide whether
+.. option:: --rskip <0|1|2>
+
+       This option determines early exit from CU depth recursion in modes 1 
and 2. When a skip CU is
+       found, additional heuristics (depending on the RD level and rskip mode) 
are used to decide whether
        to terminate recursion. The following table summarizes the behavior.
        
        
+----------+------------+----------------------------------------------------------------+
        | RD Level | Rskip Mode |   Skip Recursion Heuristic                    
                 |
        
+==========+============+================================================================+
-       |   0 - 4  |      1     |   Neighbour costs.                            
                 |
+       |   0 - 4  |      1     |   Neighbour costs and CU homogenity.          
                 |
        
+----------+------------+----------------------------------------------------------------+
        |   5 - 6  |      1     |   Comparison with inter2Nx2N.                 
                 |
        
+----------+------------+----------------------------------------------------------------+
-       |   0 - 6  |      2     |   CU edge denstiy.                            
                 |
+       |   0 - 6  |      2     |   CU edge density.                            
                 |
        
+----------+------------+----------------------------------------------------------------+
-       |   0 - 6  |      3     |   CU edge denstiy with forceful skip for 
lower levels of CTU.  |
-       
+----------+------------+----------------------------------------------------------------+
-       
+
        Provides minimal quality degradation at good performance gains for 
non-zero modes.
        :option:`--rskip mode 0` means disabled. Default: 1, disabled when 
:option:`--tune grain` is used.
+       This is a integer value representing the edge-density percentage within 
the CU. Internally normalized to a number between 0.0 to 1.0 in x265. 
+       Recommended low thresholds for slow encodes and high for fast encodes.
 
 .. option:: --rskip-edge-threshold <0..100>
 
        Denotes the minimum expected edge-density percentage within the CU, 
below which the recursion is skipped.
-       Default: 5, requires :option:`--rskip mode 2|3` to be enabled.
+       Default: 5, requires :option:`--rskip mode 2` to be enabled.
 
 .. option:: --splitrd-skip, --no-splitrd-skip
 
diff -r 303ff9e4546d -r df0886d58b86 source/CMakeLists.txt
--- a/source/CMakeLists.txt     Wed Apr 15 18:44:54 2020 +0530
+++ b/source/CMakeLists.txt     Wed May 06 13:37:29 2020 +0530
@@ -29,7 +29,7 @@
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 191)
+set(X265_BUILD 192)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r 303ff9e4546d -r df0886d58b86 source/common/frame.cpp
--- a/source/common/frame.cpp   Wed Apr 15 18:44:54 2020 +0530
+++ b/source/common/frame.cpp   Wed May 06 13:37:29 2020 +0530
@@ -117,7 +117,7 @@
         m_thetaPic = X265_MALLOC(pixel, m_stride * (maxHeight + (m_lumaMarginY 
* 2)));
     }
 
-    if (param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    if (param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         uint32_t numCuInWidth = (param->sourceWidth + param->maxCUSize - 1) / 
param->maxCUSize;
         uint32_t numCuInHeight = (param->sourceHeight + param->maxCUSize - 1) 
/ param->maxCUSize;
@@ -283,7 +283,7 @@
         X265_FREE(m_thetaPic);
     }
 
-    if (m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    if (m_param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         X265_FREE_ZERO(m_edgeBitPlane);
         m_edgeBitPic = NULL;
diff -r 303ff9e4546d -r df0886d58b86 source/common/param.cpp
--- a/source/common/param.cpp   Wed Apr 15 18:44:54 2020 +0530
+++ b/source/common/param.cpp   Wed May 06 13:37:29 2020 +0530
@@ -198,7 +198,7 @@
     param->bEnableWeightedPred = 1;
     param->bEnableWeightedBiPred = 0;
     param->bEnableEarlySkip = 1;
-    param->enableRecursionSkip = 1;
+    param->recursionSkipMode = 1;
     param->edgeVarThreshold = 0.05f;
     param->bEnableAMP = 0;
     param->bEnableRectInter = 0;
@@ -548,7 +548,7 @@
             param->maxNumMergeCand = 5;
             param->searchMethod = X265_STAR_SEARCH;
             param->bEnableTransformSkip = 1;
-            param->enableRecursionSkip = 0;
+            param->recursionSkipMode = 0;
             param->maxNumReferences = 5;
             param->limitReferences = 0;
             param->lookaheadSlices = 0; // disabled for best quality
@@ -600,7 +600,7 @@
             param->rc.hevcAq = 0;
             param->rc.qpStep = 1;
             param->rc.bEnableGrain = 1;
-            param->enableRecursionSkip = 0;
+            param->recursionSkipMode = 0;
             param->psyRd = 4.0;
             param->psyRdoq = 10.0;
             param->bEnableSAO = 0;
@@ -704,7 +704,7 @@
     OPT("ref") p->maxNumReferences = atoi(value);
     OPT("fast-intra") p->bEnableFastIntra = atobool(value);
     OPT("early-skip") p->bEnableEarlySkip = atobool(value);
-    OPT("rskip") p->enableRecursionSkip = atoi(value);
+    OPT("rskip") p->recursionSkipMode = atoi(value);
     OPT("rskip-edge-threshold") p->edgeVarThreshold = atoi(value)/100.0f;
     OPT("me") p->searchMethod = parseName(value, x265_motion_est_names, 
bError);
     OPT("subme") p->subpelRefine = atoi(value);
@@ -922,7 +922,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("rskip") p->enableRecursionSkip = atoi(value);
+    OPT("rskip") p->recursionSkipMode = atoi(value);
     OPT("rdpenalty") p->rdPenalty = atoi(value);
     OPT("tskip") p->bEnableTransformSkip = atobool(value);
     OPT("no-tskip-fast") p->bEnableTSkipFast = atobool(value);
@@ -1603,9 +1603,9 @@
           "RDOQ Level is out of range");
     CHECK(param->dynamicRd < 0 || param->dynamicRd > x265_ADAPT_RD_STRENGTH,
           "Dynamic RD strength must be between 0 and 4");
-    CHECK(param->enableRecursionSkip > 3 || param->enableRecursionSkip < 0,
-          "Invalid Recursion skip mode. Valid modes 0,1,2,3");
-    if (param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    CHECK(param->recursionSkipMode > 2 || param->recursionSkipMode < 0,
+          "Invalid Recursion skip mode. Valid modes 0,1,2");
+    if (param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         CHECK(param->edgeVarThreshold < 0.0f || param->edgeVarThreshold > 1.0f,
               "Minimum edge density percentage for a CU should be an integer 
between 0 to 100");
@@ -1920,8 +1920,8 @@
     TOOLVAL(param->psyRdoq, "psy-rdoq=%.2lf");
     TOOLOPT(param->bEnableRdRefine, "rd-refine");
     TOOLOPT(param->bEnableEarlySkip, "early-skip");
-    TOOLVAL(param->enableRecursionSkip, "rskip mode=%d");
-    if (param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    TOOLVAL(param->recursionSkipMode, "rskip mode=%d");
+    if (param->recursionSkipMode == EDGE_BASED_RSKIP)
         TOOLVAL(param->edgeVarThreshold, "rskip-edge-threshold=%.2f");
     TOOLOPT(param->bEnableSplitRdSkip, "splitrd-skip");
     TOOLVAL(param->noiseReductionIntra, "nr-intra=%d");
@@ -2080,8 +2080,8 @@
     s += sprintf(s, " rd=%d", p->rdLevel);
     s += sprintf(s, " selective-sao=%d", p->selectiveSAO);
     BOOL(p->bEnableEarlySkip, "early-skip");
-    BOOL(p->enableRecursionSkip, "rskip");
-    if (p->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    BOOL(p->recursionSkipMode, "rskip");
+    if (p->recursionSkipMode == EDGE_BASED_RSKIP)
         s += sprintf(s, " rskip-edge-threshold=%f", p->edgeVarThreshold);
 
     BOOL(p->bEnableFastIntra, "fast-intra");
@@ -2391,7 +2391,7 @@
     dst->bSaoNonDeblocked = src->bSaoNonDeblocked;
     dst->rdLevel = src->rdLevel;
     dst->bEnableEarlySkip = src->bEnableEarlySkip;
-    dst->enableRecursionSkip = src->enableRecursionSkip;
+    dst->recursionSkipMode = src->recursionSkipMode;
     dst->edgeVarThreshold = src->edgeVarThreshold;
     dst->bEnableFastIntra = src->bEnableFastIntra;
     dst->bEnableTSkipFast = src->bEnableTSkipFast;
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp       Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/analysis.cpp       Wed May 06 13:37:29 2020 +0530
@@ -1272,7 +1272,7 @@
                     md.pred[PRED_SKIP].cu.initSubCU(parentCTU, cuGeom, qp);
                     checkMerge2Nx2N_rd0_4(md.pred[PRED_SKIP], 
md.pred[PRED_MERGE], cuGeom);
 
-                    skipRecursion = !!m_param->enableRecursionSkip && 
md.bestMode;
+                    skipRecursion = !!m_param->recursionSkipMode && 
md.bestMode;
                     if (m_param->rdLevel)
                         skipModes = m_param->bEnableEarlySkip && md.bestMode;
                 }
@@ -1296,7 +1296,7 @@
                     md.pred[PRED_SKIP].cu.initSubCU(parentCTU, cuGeom, qp);
                     checkMerge2Nx2N_rd0_4(md.pred[PRED_SKIP], 
md.pred[PRED_MERGE], cuGeom);
 
-                    skipRecursion = !!m_param->enableRecursionSkip && 
md.bestMode;
+                    skipRecursion = !!m_param->recursionSkipMode && 
md.bestMode;
                     if (m_param->rdLevel)
                         skipModes = m_param->bEnableEarlySkip && md.bestMode;
                 }
@@ -1314,24 +1314,23 @@
                 skipModes = (m_param->bEnableEarlySkip || m_refineLevel == 2)
                 && md.bestMode && md.bestMode->cu.isSkipped(0); // TODO: sa8d 
threshold per depth
         }
-        if (md.bestMode && m_param->enableRecursionSkip && !bCtuInfoCheck && 
!(m_param->bAnalysisType == AVC_INFO && m_param->analysisLoadReuseLevel == 7 && 
(m_modeFlag[0] || m_modeFlag[1])))
+        if (md.bestMode && m_param->recursionSkipMode && !bCtuInfoCheck && 
!(m_param->bAnalysisType == AVC_INFO && m_param->analysisLoadReuseLevel == 7 && 
(m_modeFlag[0] || m_modeFlag[1])))
         {
             skipRecursion = md.bestMode->cu.isSkipped(0);
             if (mightSplit && !skipRecursion)
             {
-                if (depth >= minDepth && m_param->enableRecursionSkip == 
RDCOST_BASED_RSKIP)
+                if (depth >= minDepth && m_param->recursionSkipMode == 
RDCOST_BASED_RSKIP)
                 {
                     if (depth)
                         skipRecursion = recursionDepthCheck(parentCTU, cuGeom, 
*md.bestMode);
                     if (m_bHD && !skipRecursion && m_param->rdLevel == 2 && 
md.fencYuv.m_size != MAX_CU_SIZE)
                         skipRecursion = complexityCheckCU(*md.bestMode);
                 }
-                else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && 
m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+                else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && 
m_param->recursionSkipMode == EDGE_BASED_RSKIP)
                 {
                     skipRecursion = complexityCheckCU(*md.bestMode);
                 }
-                else if (m_param->enableRecursionSkip > EDGE_BASED_RSKIP)
-                    skipRecursion = true;
+
             }
         }
         if (m_param->bAnalysisType == AVC_INFO && md.bestMode && 
cuGeom.numPartitions <= 16 && m_param->analysisLoadReuseLevel == 7)
@@ -1981,7 +1980,7 @@
                     checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, 
refMasks);
                     checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
-                    if (m_param->enableRecursionSkip && depth && 
m_modeDepth[depth - 1].bestMode)
+                    if (m_param->recursionSkipMode && depth && 
m_modeDepth[depth - 1].bestMode)
                         skipRecursion = md.bestMode && 
!md.bestMode->cu.getQtRootCbf(0);
                 }
                 if (m_param->analysisLoadReuseLevel > 4 && 
m_reusePartSize[cuGeom.absPartIdx] == SIZE_2Nx2N)
@@ -2005,7 +2004,7 @@
                     checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, 
refMasks);
                     checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
-                    if (m_param->enableRecursionSkip && depth && 
m_modeDepth[depth - 1].bestMode)
+                    if (m_param->recursionSkipMode && depth && 
m_modeDepth[depth - 1].bestMode)
                         skipRecursion = md.bestMode && 
!md.bestMode->cu.getQtRootCbf(0);
                 }
             }
@@ -2024,12 +2023,10 @@
             checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, 
refMasks);
             checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
-            if (m_param->enableRecursionSkip == RDCOST_BASED_RSKIP && depth && 
m_modeDepth[depth - 1].bestMode)
+            if (m_param->recursionSkipMode == RDCOST_BASED_RSKIP && depth && 
m_modeDepth[depth - 1].bestMode)
                 skipRecursion = md.bestMode && 
!md.bestMode->cu.getQtRootCbf(0);
-            else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && 
m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+            else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && 
m_param->recursionSkipMode == EDGE_BASED_RSKIP)
                 skipRecursion = md.bestMode && complexityCheckCU(*md.bestMode);
-            else if (m_param->enableRecursionSkip > EDGE_BASED_RSKIP)
-                skipRecursion = true;
         }
         if (m_param->bAnalysisType == AVC_INFO && md.bestMode && 
cuGeom.numPartitions <= 16 && m_param->analysisLoadReuseLevel == 7)
             skipRecursion = true;
@@ -3538,7 +3535,7 @@
 
 bool Analysis::complexityCheckCU(const Mode& bestMode)
 {
-    if (m_param->enableRecursionSkip == RDCOST_BASED_RSKIP)
+    if (m_param->recursionSkipMode == RDCOST_BASED_RSKIP)
     {
         uint32_t mean = 0;
         uint32_t homo = 0;
@@ -3563,8 +3560,8 @@
     }
     else
     {
-        int blockType = bestMode.cu.m_log2CUSize[0] - 2;
-        int shift = bestMode.cu.m_log2CUSize[0] * 2;
+        int blockType = bestMode.cu.m_log2CUSize[0] - LOG2_UNIT_SIZE;
+        int shift = bestMode.cu.m_log2CUSize[0] * LOG2_UNIT_SIZE;
         intptr_t stride = m_frame->m_fencPic->m_stride;
         intptr_t blockOffsetLuma = bestMode.cu.m_cuPelX + bestMode.cu.m_cuPelY 
* stride;
         uint64_t sum_ss = primitives.cu[blockType].var(m_frame->m_edgeBitPic + 
blockOffsetLuma, stride);
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp        Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/encoder.cpp        Wed May 06 13:37:29 2020 +0530
@@ -1757,7 +1757,7 @@
                         }
                     }
                 }
-                if (m_param->enableRecursionSkip >= EDGE_BASED_RSKIP && 
m_param->bHistBasedSceneCut)
+                if (m_param->recursionSkipMode == EDGE_BASED_RSKIP && 
m_param->bHistBasedSceneCut)
                 {
                     pixel* src = m_edgePic;
                     primitives.planecopy_pp_shr(src, 
inFrame->m_fencPic->m_picWidth, inFrame->m_edgeBitPic, 
inFrame->m_fencPic->m_stride,
@@ -2425,7 +2425,7 @@
         encParam->maxNumReferences = param->maxNumReferences; // never uses 
more refs than specified in stream headers
         encParam->bEnableFastIntra = param->bEnableFastIntra;
         encParam->bEnableEarlySkip = param->bEnableEarlySkip;
-        encParam->enableRecursionSkip = param->enableRecursionSkip;
+        encParam->recursionSkipMode = param->recursionSkipMode;
         encParam->searchMethod = param->searchMethod;
         /* Scratch buffer prevents me_range from being increased for esa/tesa 
*/
         if (param->searchRange < encParam->searchRange)
@@ -3413,7 +3413,7 @@
         p->maxNumReferences = zone->maxNumReferences;
         p->bEnableFastIntra = zone->bEnableFastIntra;
         p->bEnableEarlySkip = zone->bEnableEarlySkip;
-        p->enableRecursionSkip = zone->enableRecursionSkip;
+        p->recursionSkipMode = zone->recursionSkipMode;
         p->searchMethod = zone->searchMethod;
         p->searchRange = zone->searchRange;
         p->subpelRefine = zone->subpelRefine;
@@ -5715,7 +5715,7 @@
     TOOLCMP(oldParam->maxNumReferences, newParam->maxNumReferences, "ref=%d to 
%d\n");
     TOOLCMP(oldParam->bEnableFastIntra, newParam->bEnableFastIntra, 
"fast-intra=%d to %d\n");
     TOOLCMP(oldParam->bEnableEarlySkip, newParam->bEnableEarlySkip, 
"early-skip=%d to %d\n");
-    TOOLCMP(oldParam->enableRecursionSkip, newParam->enableRecursionSkip, 
"rskip=%d to %d\n");
+    TOOLCMP(oldParam->recursionSkipMode, newParam->recursionSkipMode, 
"rskip=%d to %d\n");
     TOOLCMP(oldParam->searchMethod, newParam->searchMethod, "me=%d to %d\n");
     TOOLCMP(oldParam->searchRange, newParam->searchRange, "merange=%d to 
%d\n");
     TOOLCMP(oldParam->subpelRefine, newParam->subpelRefine, "subme= %d to 
%d\n");
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp   Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/frameencoder.cpp   Wed May 06 13:37:29 2020 +0530
@@ -448,7 +448,7 @@
     m_ssimCnt = 0;
     memset(&(m_frame->m_encData->m_frameStats), 0, 
sizeof(m_frame->m_encData->m_frameStats));
 
-    if (!m_param->bHistBasedSceneCut && m_param->rc.aqMode != X265_AQ_EDGE && 
m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    if (!m_param->bHistBasedSceneCut && m_param->rc.aqMode != X265_AQ_EDGE && 
m_param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         int height = m_frame->m_fencPic->m_picHeight;
         int width = m_frame->m_fencPic->m_picWidth;
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp      Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/slicetype.cpp      Wed May 06 13:37:29 2020 +0530
@@ -519,7 +519,7 @@
                 if (param->rc.aqMode == X265_AQ_EDGE)
                     edgeFilter(curFrame, param);
 
-                if (param->rc.aqMode == X265_AQ_EDGE && 
!param->bHistBasedSceneCut && param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+                if (param->rc.aqMode == X265_AQ_EDGE && 
!param->bHistBasedSceneCut && param->recursionSkipMode == EDGE_BASED_RSKIP)
                 {
                     pixel* src = curFrame->m_edgePic + 
curFrame->m_fencPic->m_lumaMarginY * curFrame->m_fencPic->m_stride + 
curFrame->m_fencPic->m_lumaMarginX;
                     primitives.planecopy_pp_shr(src, 
curFrame->m_fencPic->m_stride, curFrame->m_edgeBitPic,
diff -r 303ff9e4546d -r df0886d58b86 source/test/regression-tests.txt
--- a/source/test/regression-tests.txt  Wed Apr 15 18:44:54 2020 +0530
+++ b/source/test/regression-tests.txt  Wed May 06 13:37:29 2020 +0530
@@ -166,10 +166,6 @@
 crowd_run_1920x1080_50.yuv, --preset fast --ctu 64 --rskip 2 
--rskip-edge-threshold 5 --aq-mode 4
 crowd_run_1920x1080_50.yuv, --preset slow --ctu 32 --rskip 2 
--rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1
 crowd_run_1920x1080_50.yuv, --preset slower --ctu 16 --rskip 2 
--rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1 --aq-mode 4
-crowd_run_1920x1080_50.yuv, --preset faster --ctu 32 --rskip 3 
--rskip-edge-threshold 5
-crowd_run_1920x1080_50.yuv, --preset fast --ctu 64 --rskip 3 
--rskip-edge-threshold 5 --aq-mode 4
-crowd_run_1920x1080_50.yuv, --preset slow --ctu 32 --rskip 3 
--rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1
-crowd_run_1920x1080_50.yuv, --preset slower --ctu 16 --rskip 3 
--rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1 --aq-mode 4
  
 # Main12 intraCost overflow bug test
 720p50_parkrun_ter.y4m,--preset medium
diff -r 303ff9e4546d -r df0886d58b86 source/x265.h
--- a/source/x265.h     Wed Apr 15 18:44:54 2020 +0530
+++ b/source/x265.h     Wed May 06 13:37:29 2020 +0530
@@ -1259,7 +1259,7 @@
 
     /* Enable early CU size decisions to avoid recursing to higher depths.
      * Default is enabled */
-    int       enableRecursionSkip;
+    int       recursionSkipMode;
 
     /* Use a faster search method to find the best intra mode. Default is 0 */
     int       bEnableFastIntra;
diff -r 303ff9e4546d -r df0886d58b86 source/x265cli.cpp
--- a/source/x265cli.cpp        Wed Apr 15 18:44:54 2020 +0530
+++ b/source/x265cli.cpp        Wed May 06 13:37:29 2020 +0530
@@ -126,9 +126,9 @@
         H0("   --[no-]ssim-rd                Enable ssim rate distortion 
optimization, 0 to disable. Default %s\n", OPT(param->bSsimRd));
         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("   --rskip <mode>                Set mode for early exit from 
recursion. Mode 1: exit using rdcost. Mode 2: exit using edge density. Mode 3: 
exit using edge density with forceful skip for small sized CU's."
-            "                                          Mode 0: disabled. 
Default %s\n", OPT(param->enableRecursionSkip));
-        H1("   --rskip-edge-threshold        Threshold in terms of percentage 
(integer of range [0,100]) for minimum edge density in CUs to prun the 
recursion depth. Applicable only for rskip modes 2 and 3. Default: %.f\n", 
param->edgeVarThreshold*100.0f);
+        H0("   --rskip <mode>                Set mode for early exit from 
recursion. Mode 1: exit using rdcost & CU homogenity. Mode 2: exit using CU 
edge density.\n"
+            "                                 Mode 0: disabled. Default %d\n", 
param->recursionSkipMode);
+        H1("   --rskip-edge-threshold        Threshold in terms of percentage 
(integer of range [0,100]) for minimum edge density in CUs used to prun the 
recursion depth. Applicable only for rskip mode 2. Value is preset dependent. 
Default: %.f\n", param->edgeVarThreshold*100.0f);
         H1("   --[no-]tskip-fast             Enable fast intra transform 
skipping. Default %s\n", OPT(param->bEnableTSkipFast));
         H1("   --[no-]splitrd-skip           Enable skipping split RD analysis 
when sum of split CU rdCost larger than one split CU rdCost for Intra CU. 
Default %s\n", OPT(param->bEnableSplitRdSkip));
         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");
# HG changeset patch
# User Srikanth Kurapati
# Date 1588752449 -19800
#      Wed May 06 13:37:29 2020 +0530
# Node ID df0886d58b867e7bd219ec3f8197bab22417795c
# Parent  303ff9e4546d0052e7a4d359323f0aca84eedd68
EQT Updates.

1. Improves documentation in help and x265readthedocs for rskip cli options.
2. Renamed rskip variable in x265_param structure & rectified regression clis.
3. Removed rskip mode 3 which is same as mode 2 with min-cu-size 16.

diff -r 303ff9e4546d -r df0886d58b86 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Wed Apr 15 18:44:54 2020 +0530
+++ b/doc/reST/cli.rst	Wed May 06 13:37:29 2020 +0530
@@ -845,31 +845,31 @@
 	Measure 2Nx2N merge candidates first; if no residual is found, 
 	additional modes at that depth are not analysed. Default disabled
 
-.. option:: --rskip <0|1|2|3>
-
-	This option determines early exit from CU depth recursion in modes 1, 2 and 3. When a skip CU is
-	found, additional heuristics (depending on RD level and rskip mode) are used to decide whether
+.. option:: --rskip <0|1|2>
+
+	This option determines early exit from CU depth recursion in modes 1 and 2. When a skip CU is
+	found, additional heuristics (depending on the RD level and rskip mode) are used to decide whether
 	to terminate recursion. The following table summarizes the behavior.
 	
 	+----------+------------+----------------------------------------------------------------+
 	| RD Level | Rskip Mode |   Skip Recursion Heuristic                                     |
 	+==========+============+================================================================+
-	|   0 - 4  |      1     |   Neighbour costs.                                             |
+	|   0 - 4  |      1     |   Neighbour costs and CU homogenity.                           |
 	+----------+------------+----------------------------------------------------------------+
 	|   5 - 6  |      1     |   Comparison with inter2Nx2N.                                  |
 	+----------+------------+----------------------------------------------------------------+
-	|   0 - 6  |      2     |   CU edge denstiy.                                             |
+	|   0 - 6  |      2     |   CU edge density.                                             |
 	+----------+------------+----------------------------------------------------------------+
-	|   0 - 6  |      3     |   CU edge denstiy with forceful skip for lower levels of CTU.  |
-	+----------+------------+----------------------------------------------------------------+
-	
+
 	Provides minimal quality degradation at good performance gains for non-zero modes.
 	:option:`--rskip mode 0` means disabled. Default: 1, disabled when :option:`--tune grain` is used.
+	This is a integer value representing the edge-density percentage within the CU. Internally normalized to a number between 0.0 to 1.0 in x265. 
+	Recommended low thresholds for slow encodes and high for fast encodes.
 
 .. option:: --rskip-edge-threshold <0..100>
 
 	Denotes the minimum expected edge-density percentage within the CU, below which the recursion is skipped.
-	Default: 5, requires :option:`--rskip mode 2|3` to be enabled.
+	Default: 5, requires :option:`--rskip mode 2` to be enabled.
 
 .. option:: --splitrd-skip, --no-splitrd-skip
 
diff -r 303ff9e4546d -r df0886d58b86 source/CMakeLists.txt
--- a/source/CMakeLists.txt	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/CMakeLists.txt	Wed May 06 13:37:29 2020 +0530
@@ -29,7 +29,7 @@
 option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
 mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 191)
+set(X265_BUILD 192)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r 303ff9e4546d -r df0886d58b86 source/common/frame.cpp
--- a/source/common/frame.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/common/frame.cpp	Wed May 06 13:37:29 2020 +0530
@@ -117,7 +117,7 @@
         m_thetaPic = X265_MALLOC(pixel, m_stride * (maxHeight + (m_lumaMarginY * 2)));
     }
 
-    if (param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    if (param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         uint32_t numCuInWidth = (param->sourceWidth + param->maxCUSize - 1) / param->maxCUSize;
         uint32_t numCuInHeight = (param->sourceHeight + param->maxCUSize - 1) / param->maxCUSize;
@@ -283,7 +283,7 @@
         X265_FREE(m_thetaPic);
     }
 
-    if (m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    if (m_param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         X265_FREE_ZERO(m_edgeBitPlane);
         m_edgeBitPic = NULL;
diff -r 303ff9e4546d -r df0886d58b86 source/common/param.cpp
--- a/source/common/param.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/common/param.cpp	Wed May 06 13:37:29 2020 +0530
@@ -198,7 +198,7 @@
     param->bEnableWeightedPred = 1;
     param->bEnableWeightedBiPred = 0;
     param->bEnableEarlySkip = 1;
-    param->enableRecursionSkip = 1;
+    param->recursionSkipMode = 1;
     param->edgeVarThreshold = 0.05f;
     param->bEnableAMP = 0;
     param->bEnableRectInter = 0;
@@ -548,7 +548,7 @@
             param->maxNumMergeCand = 5;
             param->searchMethod = X265_STAR_SEARCH;
             param->bEnableTransformSkip = 1;
-            param->enableRecursionSkip = 0;
+            param->recursionSkipMode = 0;
             param->maxNumReferences = 5;
             param->limitReferences = 0;
             param->lookaheadSlices = 0; // disabled for best quality
@@ -600,7 +600,7 @@
             param->rc.hevcAq = 0;
             param->rc.qpStep = 1;
             param->rc.bEnableGrain = 1;
-            param->enableRecursionSkip = 0;
+            param->recursionSkipMode = 0;
             param->psyRd = 4.0;
             param->psyRdoq = 10.0;
             param->bEnableSAO = 0;
@@ -704,7 +704,7 @@
     OPT("ref") p->maxNumReferences = atoi(value);
     OPT("fast-intra") p->bEnableFastIntra = atobool(value);
     OPT("early-skip") p->bEnableEarlySkip = atobool(value);
-    OPT("rskip") p->enableRecursionSkip = atoi(value);
+    OPT("rskip") p->recursionSkipMode = atoi(value);
     OPT("rskip-edge-threshold") p->edgeVarThreshold = atoi(value)/100.0f;
     OPT("me") p->searchMethod = parseName(value, x265_motion_est_names, bError);
     OPT("subme") p->subpelRefine = atoi(value);
@@ -922,7 +922,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("rskip") p->enableRecursionSkip = atoi(value);
+    OPT("rskip") p->recursionSkipMode = atoi(value);
     OPT("rdpenalty") p->rdPenalty = atoi(value);
     OPT("tskip") p->bEnableTransformSkip = atobool(value);
     OPT("no-tskip-fast") p->bEnableTSkipFast = atobool(value);
@@ -1603,9 +1603,9 @@
           "RDOQ Level is out of range");
     CHECK(param->dynamicRd < 0 || param->dynamicRd > x265_ADAPT_RD_STRENGTH,
           "Dynamic RD strength must be between 0 and 4");
-    CHECK(param->enableRecursionSkip > 3 || param->enableRecursionSkip < 0,
-          "Invalid Recursion skip mode. Valid modes 0,1,2,3");
-    if (param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    CHECK(param->recursionSkipMode > 2 || param->recursionSkipMode < 0,
+          "Invalid Recursion skip mode. Valid modes 0,1,2");
+    if (param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         CHECK(param->edgeVarThreshold < 0.0f || param->edgeVarThreshold > 1.0f,
               "Minimum edge density percentage for a CU should be an integer between 0 to 100");
@@ -1920,8 +1920,8 @@
     TOOLVAL(param->psyRdoq, "psy-rdoq=%.2lf");
     TOOLOPT(param->bEnableRdRefine, "rd-refine");
     TOOLOPT(param->bEnableEarlySkip, "early-skip");
-    TOOLVAL(param->enableRecursionSkip, "rskip mode=%d");
-    if (param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    TOOLVAL(param->recursionSkipMode, "rskip mode=%d");
+    if (param->recursionSkipMode == EDGE_BASED_RSKIP)
         TOOLVAL(param->edgeVarThreshold, "rskip-edge-threshold=%.2f");
     TOOLOPT(param->bEnableSplitRdSkip, "splitrd-skip");
     TOOLVAL(param->noiseReductionIntra, "nr-intra=%d");
@@ -2080,8 +2080,8 @@
     s += sprintf(s, " rd=%d", p->rdLevel);
     s += sprintf(s, " selective-sao=%d", p->selectiveSAO);
     BOOL(p->bEnableEarlySkip, "early-skip");
-    BOOL(p->enableRecursionSkip, "rskip");
-    if (p->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    BOOL(p->recursionSkipMode, "rskip");
+    if (p->recursionSkipMode == EDGE_BASED_RSKIP)
         s += sprintf(s, " rskip-edge-threshold=%f", p->edgeVarThreshold);
 
     BOOL(p->bEnableFastIntra, "fast-intra");
@@ -2391,7 +2391,7 @@
     dst->bSaoNonDeblocked = src->bSaoNonDeblocked;
     dst->rdLevel = src->rdLevel;
     dst->bEnableEarlySkip = src->bEnableEarlySkip;
-    dst->enableRecursionSkip = src->enableRecursionSkip;
+    dst->recursionSkipMode = src->recursionSkipMode;
     dst->edgeVarThreshold = src->edgeVarThreshold;
     dst->bEnableFastIntra = src->bEnableFastIntra;
     dst->bEnableTSkipFast = src->bEnableTSkipFast;
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/analysis.cpp	Wed May 06 13:37:29 2020 +0530
@@ -1272,7 +1272,7 @@
                     md.pred[PRED_SKIP].cu.initSubCU(parentCTU, cuGeom, qp);
                     checkMerge2Nx2N_rd0_4(md.pred[PRED_SKIP], md.pred[PRED_MERGE], cuGeom);
 
-                    skipRecursion = !!m_param->enableRecursionSkip && md.bestMode;
+                    skipRecursion = !!m_param->recursionSkipMode && md.bestMode;
                     if (m_param->rdLevel)
                         skipModes = m_param->bEnableEarlySkip && md.bestMode;
                 }
@@ -1296,7 +1296,7 @@
                     md.pred[PRED_SKIP].cu.initSubCU(parentCTU, cuGeom, qp);
                     checkMerge2Nx2N_rd0_4(md.pred[PRED_SKIP], md.pred[PRED_MERGE], cuGeom);
 
-                    skipRecursion = !!m_param->enableRecursionSkip && md.bestMode;
+                    skipRecursion = !!m_param->recursionSkipMode && md.bestMode;
                     if (m_param->rdLevel)
                         skipModes = m_param->bEnableEarlySkip && md.bestMode;
                 }
@@ -1314,24 +1314,23 @@
                 skipModes = (m_param->bEnableEarlySkip || m_refineLevel == 2)
                 && md.bestMode && md.bestMode->cu.isSkipped(0); // TODO: sa8d threshold per depth
         }
-        if (md.bestMode && m_param->enableRecursionSkip && !bCtuInfoCheck && !(m_param->bAnalysisType == AVC_INFO && m_param->analysisLoadReuseLevel == 7 && (m_modeFlag[0] || m_modeFlag[1])))
+        if (md.bestMode && m_param->recursionSkipMode && !bCtuInfoCheck && !(m_param->bAnalysisType == AVC_INFO && m_param->analysisLoadReuseLevel == 7 && (m_modeFlag[0] || m_modeFlag[1])))
         {
             skipRecursion = md.bestMode->cu.isSkipped(0);
             if (mightSplit && !skipRecursion)
             {
-                if (depth >= minDepth && m_param->enableRecursionSkip == RDCOST_BASED_RSKIP)
+                if (depth >= minDepth && m_param->recursionSkipMode == RDCOST_BASED_RSKIP)
                 {
                     if (depth)
                         skipRecursion = recursionDepthCheck(parentCTU, cuGeom, *md.bestMode);
                     if (m_bHD && !skipRecursion && m_param->rdLevel == 2 && md.fencYuv.m_size != MAX_CU_SIZE)
                         skipRecursion = complexityCheckCU(*md.bestMode);
                 }
-                else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+                else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && m_param->recursionSkipMode == EDGE_BASED_RSKIP)
                 {
                     skipRecursion = complexityCheckCU(*md.bestMode);
                 }
-                else if (m_param->enableRecursionSkip > EDGE_BASED_RSKIP)
-                    skipRecursion = true;
+
             }
         }
         if (m_param->bAnalysisType == AVC_INFO && md.bestMode && cuGeom.numPartitions <= 16 && m_param->analysisLoadReuseLevel == 7)
@@ -1981,7 +1980,7 @@
                     checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, refMasks);
                     checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
-                    if (m_param->enableRecursionSkip && depth && m_modeDepth[depth - 1].bestMode)
+                    if (m_param->recursionSkipMode && depth && m_modeDepth[depth - 1].bestMode)
                         skipRecursion = md.bestMode && !md.bestMode->cu.getQtRootCbf(0);
                 }
                 if (m_param->analysisLoadReuseLevel > 4 && m_reusePartSize[cuGeom.absPartIdx] == SIZE_2Nx2N)
@@ -2005,7 +2004,7 @@
                     checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, refMasks);
                     checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
-                    if (m_param->enableRecursionSkip && depth && m_modeDepth[depth - 1].bestMode)
+                    if (m_param->recursionSkipMode && depth && m_modeDepth[depth - 1].bestMode)
                         skipRecursion = md.bestMode && !md.bestMode->cu.getQtRootCbf(0);
                 }
             }
@@ -2024,12 +2023,10 @@
             checkInter_rd5_6(md.pred[PRED_2Nx2N], cuGeom, SIZE_2Nx2N, refMasks);
             checkBestMode(md.pred[PRED_2Nx2N], cuGeom.depth);
 
-            if (m_param->enableRecursionSkip == RDCOST_BASED_RSKIP && depth && m_modeDepth[depth - 1].bestMode)
+            if (m_param->recursionSkipMode == RDCOST_BASED_RSKIP && depth && m_modeDepth[depth - 1].bestMode)
                 skipRecursion = md.bestMode && !md.bestMode->cu.getQtRootCbf(0);
-            else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+            else if (cuGeom.log2CUSize >= MAX_LOG2_CU_SIZE - 1 && m_param->recursionSkipMode == EDGE_BASED_RSKIP)
                 skipRecursion = md.bestMode && complexityCheckCU(*md.bestMode);
-            else if (m_param->enableRecursionSkip > EDGE_BASED_RSKIP)
-                skipRecursion = true;
         }
         if (m_param->bAnalysisType == AVC_INFO && md.bestMode && cuGeom.numPartitions <= 16 && m_param->analysisLoadReuseLevel == 7)
             skipRecursion = true;
@@ -3538,7 +3535,7 @@
 
 bool Analysis::complexityCheckCU(const Mode& bestMode)
 {
-    if (m_param->enableRecursionSkip == RDCOST_BASED_RSKIP)
+    if (m_param->recursionSkipMode == RDCOST_BASED_RSKIP)
     {
         uint32_t mean = 0;
         uint32_t homo = 0;
@@ -3563,8 +3560,8 @@
     }
     else
     {
-        int blockType = bestMode.cu.m_log2CUSize[0] - 2;
-        int shift = bestMode.cu.m_log2CUSize[0] * 2;
+        int blockType = bestMode.cu.m_log2CUSize[0] - LOG2_UNIT_SIZE;
+        int shift = bestMode.cu.m_log2CUSize[0] * LOG2_UNIT_SIZE;
         intptr_t stride = m_frame->m_fencPic->m_stride;
         intptr_t blockOffsetLuma = bestMode.cu.m_cuPelX + bestMode.cu.m_cuPelY * stride;
         uint64_t sum_ss = primitives.cu[blockType].var(m_frame->m_edgeBitPic + blockOffsetLuma, stride);
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/encoder.cpp	Wed May 06 13:37:29 2020 +0530
@@ -1757,7 +1757,7 @@
                         }
                     }
                 }
-                if (m_param->enableRecursionSkip >= EDGE_BASED_RSKIP && m_param->bHistBasedSceneCut)
+                if (m_param->recursionSkipMode == EDGE_BASED_RSKIP && m_param->bHistBasedSceneCut)
                 {
                     pixel* src = m_edgePic;
                     primitives.planecopy_pp_shr(src, inFrame->m_fencPic->m_picWidth, inFrame->m_edgeBitPic, inFrame->m_fencPic->m_stride,
@@ -2425,7 +2425,7 @@
         encParam->maxNumReferences = param->maxNumReferences; // never uses more refs than specified in stream headers
         encParam->bEnableFastIntra = param->bEnableFastIntra;
         encParam->bEnableEarlySkip = param->bEnableEarlySkip;
-        encParam->enableRecursionSkip = param->enableRecursionSkip;
+        encParam->recursionSkipMode = param->recursionSkipMode;
         encParam->searchMethod = param->searchMethod;
         /* Scratch buffer prevents me_range from being increased for esa/tesa */
         if (param->searchRange < encParam->searchRange)
@@ -3413,7 +3413,7 @@
         p->maxNumReferences = zone->maxNumReferences;
         p->bEnableFastIntra = zone->bEnableFastIntra;
         p->bEnableEarlySkip = zone->bEnableEarlySkip;
-        p->enableRecursionSkip = zone->enableRecursionSkip;
+        p->recursionSkipMode = zone->recursionSkipMode;
         p->searchMethod = zone->searchMethod;
         p->searchRange = zone->searchRange;
         p->subpelRefine = zone->subpelRefine;
@@ -5715,7 +5715,7 @@
     TOOLCMP(oldParam->maxNumReferences, newParam->maxNumReferences, "ref=%d to %d\n");
     TOOLCMP(oldParam->bEnableFastIntra, newParam->bEnableFastIntra, "fast-intra=%d to %d\n");
     TOOLCMP(oldParam->bEnableEarlySkip, newParam->bEnableEarlySkip, "early-skip=%d to %d\n");
-    TOOLCMP(oldParam->enableRecursionSkip, newParam->enableRecursionSkip, "rskip=%d to %d\n");
+    TOOLCMP(oldParam->recursionSkipMode, newParam->recursionSkipMode, "rskip=%d to %d\n");
     TOOLCMP(oldParam->searchMethod, newParam->searchMethod, "me=%d to %d\n");
     TOOLCMP(oldParam->searchRange, newParam->searchRange, "merange=%d to %d\n");
     TOOLCMP(oldParam->subpelRefine, newParam->subpelRefine, "subme= %d to %d\n");
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/frameencoder.cpp
--- a/source/encoder/frameencoder.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/frameencoder.cpp	Wed May 06 13:37:29 2020 +0530
@@ -448,7 +448,7 @@
     m_ssimCnt = 0;
     memset(&(m_frame->m_encData->m_frameStats), 0, sizeof(m_frame->m_encData->m_frameStats));
 
-    if (!m_param->bHistBasedSceneCut && m_param->rc.aqMode != X265_AQ_EDGE && m_param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+    if (!m_param->bHistBasedSceneCut && m_param->rc.aqMode != X265_AQ_EDGE && m_param->recursionSkipMode == EDGE_BASED_RSKIP)
     {
         int height = m_frame->m_fencPic->m_picHeight;
         int width = m_frame->m_fencPic->m_picWidth;
diff -r 303ff9e4546d -r df0886d58b86 source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/encoder/slicetype.cpp	Wed May 06 13:37:29 2020 +0530
@@ -519,7 +519,7 @@
                 if (param->rc.aqMode == X265_AQ_EDGE)
                     edgeFilter(curFrame, param);
 
-                if (param->rc.aqMode == X265_AQ_EDGE && !param->bHistBasedSceneCut && param->enableRecursionSkip >= EDGE_BASED_RSKIP)
+                if (param->rc.aqMode == X265_AQ_EDGE && !param->bHistBasedSceneCut && param->recursionSkipMode == EDGE_BASED_RSKIP)
                 {
                     pixel* src = curFrame->m_edgePic + curFrame->m_fencPic->m_lumaMarginY * curFrame->m_fencPic->m_stride + curFrame->m_fencPic->m_lumaMarginX;
                     primitives.planecopy_pp_shr(src, curFrame->m_fencPic->m_stride, curFrame->m_edgeBitPic,
diff -r 303ff9e4546d -r df0886d58b86 source/test/regression-tests.txt
--- a/source/test/regression-tests.txt	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/test/regression-tests.txt	Wed May 06 13:37:29 2020 +0530
@@ -166,10 +166,6 @@
 crowd_run_1920x1080_50.yuv, --preset fast --ctu 64 --rskip 2 --rskip-edge-threshold 5 --aq-mode 4
 crowd_run_1920x1080_50.yuv, --preset slow --ctu 32 --rskip 2 --rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1
 crowd_run_1920x1080_50.yuv, --preset slower --ctu 16 --rskip 2 --rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1 --aq-mode 4
-crowd_run_1920x1080_50.yuv, --preset faster --ctu 32 --rskip 3 --rskip-edge-threshold 5
-crowd_run_1920x1080_50.yuv, --preset fast --ctu 64 --rskip 3 --rskip-edge-threshold 5 --aq-mode 4
-crowd_run_1920x1080_50.yuv, --preset slow --ctu 32 --rskip 3 --rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1
-crowd_run_1920x1080_50.yuv, --preset slower --ctu 16 --rskip 3 --rskip-edge-threshold 5 --hist-scenecut --hist-threshold 0.1 --aq-mode 4
  
 # Main12 intraCost overflow bug test
 720p50_parkrun_ter.y4m,--preset medium
diff -r 303ff9e4546d -r df0886d58b86 source/x265.h
--- a/source/x265.h	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/x265.h	Wed May 06 13:37:29 2020 +0530
@@ -1259,7 +1259,7 @@
 
     /* Enable early CU size decisions to avoid recursing to higher depths.
      * Default is enabled */
-    int       enableRecursionSkip;
+    int       recursionSkipMode;
 
     /* Use a faster search method to find the best intra mode. Default is 0 */
     int       bEnableFastIntra;
diff -r 303ff9e4546d -r df0886d58b86 source/x265cli.cpp
--- a/source/x265cli.cpp	Wed Apr 15 18:44:54 2020 +0530
+++ b/source/x265cli.cpp	Wed May 06 13:37:29 2020 +0530
@@ -126,9 +126,9 @@
         H0("   --[no-]ssim-rd                Enable ssim rate distortion optimization, 0 to disable. Default %s\n", OPT(param->bSsimRd));
         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("   --rskip <mode>                Set mode for early exit from recursion. Mode 1: exit using rdcost. Mode 2: exit using edge density. Mode 3: exit using edge density with forceful skip for small sized CU's."
-            "                                          Mode 0: disabled. Default %s\n", OPT(param->enableRecursionSkip));
-        H1("   --rskip-edge-threshold        Threshold in terms of percentage (integer of range [0,100]) for minimum edge density in CUs to prun the recursion depth. Applicable only for rskip modes 2 and 3. Default: %.f\n", param->edgeVarThreshold*100.0f);
+        H0("   --rskip <mode>                Set mode for early exit from recursion. Mode 1: exit using rdcost & CU homogenity. Mode 2: exit using CU edge density.\n"
+            "                                 Mode 0: disabled. Default %d\n", param->recursionSkipMode);
+        H1("   --rskip-edge-threshold        Threshold in terms of percentage (integer of range [0,100]) for minimum edge density in CUs used to prun the recursion depth. Applicable only for rskip mode 2. Value is preset dependent. Default: %.f\n", param->edgeVarThreshold*100.0f);
         H1("   --[no-]tskip-fast             Enable fast intra transform skipping. Default %s\n", OPT(param->bEnableTSkipFast));
         H1("   --[no-]splitrd-skip           Enable skipping split RD analysis when sum of split CU rdCost larger than one split CU rdCost for Intra CU. Default %s\n", OPT(param->bEnableSplitRdSkip));
         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");
_______________________________________________
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to