[x265-commits] [x265] api: drop fast-cbf option

Steve Borho steve at borho.org
Thu Feb 12 17:36:01 CET 2015


details:   http://hg.videolan.org/x265/rev/9ab104096834
branches:  
changeset: 9348:9ab104096834
user:      Steve Borho <steve at borho.org>
date:      Wed Feb 11 16:15:33 2015 -0600
description:
api: drop fast-cbf option

Having a 'fast' option that only applied to --rd 5 and 6 was a tad silly. It was
not enabled by default at any preset and only had a marginal effect when used.
Users specifying preset veryslow are generally not interested in go faster
options.

This was an HM feature that we have been hanging on to unnecessarily. It is in
the way of some upcoming optimizations

diffstat:

 doc/reST/cli.rst            |   8 ------
 source/common/param.cpp     |   4 ---
 source/encoder/analysis.cpp |  60 ++++++++++++++++----------------------------
 source/encoder/encoder.cpp  |   6 ----
 source/x265.h               |   5 ---
 source/x265cli.h            |   1 -
 6 files changed, 22 insertions(+), 62 deletions(-)

diffs (178 lines):

diff -r 9590baa6cca3 -r 9ab104096834 doc/reST/cli.rst
--- a/doc/reST/cli.rst	Thu Feb 12 14:30:06 2015 +0530
+++ b/doc/reST/cli.rst	Wed Feb 11 16:15:33 2015 -0600
@@ -506,14 +506,6 @@ the prediction quad-tree.
 	Measure full CU size (2Nx2N) merge candidates first; if no residual
 	is found the analysis is short circuited. Default disabled
 
-.. option:: --fast-cbf, --no-fast-cbf
-
-	Short circuit analysis if a prediction is found that does not set
-	the coded block flag (aka: no residual was encoded).  It prevents
-	the encoder from perhaps finding other predictions that also have no
-	residual but require less signaling bits or have less distortion.
-	Only applicable for RD levels 5 and 6. Default disabled
-
 .. option:: --fast-intra, --no-fast-intra
 
 	Perform an initial scan of every fifth intra angular mode, then
diff -r 9590baa6cca3 -r 9ab104096834 source/common/param.cpp
--- a/source/common/param.cpp	Thu Feb 12 14:30:06 2015 +0530
+++ b/source/common/param.cpp	Wed Feb 11 16:15:33 2015 -0600
@@ -154,7 +154,6 @@ void x265_param_default(x265_param *para
     param->bEnableWeightedPred = 1;
     param->bEnableWeightedBiPred = 0;
     param->bEnableEarlySkip = 0;
-    param->bEnableCbfFastMode = 0;
     param->bEnableAMP = 0;
     param->bEnableRectInter = 0;
     param->rdLevel = 3;
@@ -581,7 +580,6 @@ int x265_param_parse(x265_param *p, cons
     OPT("max-merge") p->maxNumMergeCand = (uint32_t)atoi(value);
     OPT("temporal-mvp") p->bEnableTemporalMvp = atobool(value);
     OPT("early-skip") p->bEnableEarlySkip = atobool(value);
-    OPT("fast-cbf") p->bEnableCbfFastMode = atobool(value);
     OPT("rdpenalty") p->rdPenalty = atoi(value);
     OPT("tskip") p->bEnableTransformSkip = atobool(value);
     OPT("no-tskip-fast") p->bEnableTSkipFast = atobool(value);
@@ -1252,7 +1250,6 @@ void x265_print_params(x265_param *param
     if (param->psyRdoq > 0.)
         fprintf(stderr, "psy-rdoq=%.2lf ", param->psyRdoq);
     TOOLOPT(param->bEnableEarlySkip, "early-skip");
-    TOOLOPT(param->bEnableCbfFastMode, "fast-cbf");
     if (param->noiseReductionIntra)
         fprintf(stderr, "nr-intra=%d ", param->noiseReductionIntra);
     if (param->noiseReductionInter)
@@ -1307,7 +1304,6 @@ char *x265_param2string(x265_param *p)
     s += sprintf(s, " max-merge=%d", p->maxNumMergeCand);
     BOOL(p->bEnableTemporalMvp, "temporal-mvp");
     BOOL(p->bEnableEarlySkip, "early-skip");
-    BOOL(p->bEnableCbfFastMode, "fast-cbf");
     s += sprintf(s, " rdpenalty=%d", p->rdPenalty);
     BOOL(p->bEnableTransformSkip, "tskip");
     BOOL(p->bEnableTSkipFast, "tskip-fast");
diff -r 9590baa6cca3 -r 9ab104096834 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Thu Feb 12 14:30:06 2015 +0530
+++ b/source/encoder/analysis.cpp	Wed Feb 11 16:15:33 2015 -0600
@@ -1134,18 +1134,13 @@ void Analysis::compressInterCU_rd5_6(con
 
             if (m_param->bEnableRectInter)
             {
-                if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0))
-                {
-                    md.pred[PRED_Nx2N].cu.initSubCU(parentCTU, cuGeom);
-                    checkInter_rd5_6(md.pred[PRED_Nx2N], cuGeom, SIZE_Nx2N, false);
-                    checkBestMode(md.pred[PRED_Nx2N], cuGeom.depth);
-                }
-                if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0))
-                {
-                    md.pred[PRED_2NxN].cu.initSubCU(parentCTU, cuGeom);
-                    checkInter_rd5_6(md.pred[PRED_2NxN], cuGeom, SIZE_2NxN, false);
-                    checkBestMode(md.pred[PRED_2NxN], cuGeom.depth);
-                }
+                md.pred[PRED_Nx2N].cu.initSubCU(parentCTU, cuGeom);
+                checkInter_rd5_6(md.pred[PRED_Nx2N], cuGeom, SIZE_Nx2N, false);
+                checkBestMode(md.pred[PRED_Nx2N], cuGeom.depth);
+
+                md.pred[PRED_2NxN].cu.initSubCU(parentCTU, cuGeom);
+                checkInter_rd5_6(md.pred[PRED_2NxN], cuGeom, SIZE_2NxN, false);
+                checkBestMode(md.pred[PRED_2NxN], cuGeom.depth);
             }
 
             // Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
@@ -1166,38 +1161,27 @@ void Analysis::compressInterCU_rd5_6(con
 
                 if (bHor)
                 {
-                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0))
-                    {
-                        md.pred[PRED_2NxnU].cu.initSubCU(parentCTU, cuGeom);
-                        checkInter_rd5_6(md.pred[PRED_2NxnU], cuGeom, SIZE_2NxnU, bMergeOnly);
-                        checkBestMode(md.pred[PRED_2NxnU], cuGeom.depth);
-                    }
-                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0))
-                    {
-                        md.pred[PRED_2NxnD].cu.initSubCU(parentCTU, cuGeom);
-                        checkInter_rd5_6(md.pred[PRED_2NxnD], cuGeom, SIZE_2NxnD, bMergeOnly);
-                        checkBestMode(md.pred[PRED_2NxnD], cuGeom.depth);
-                    }
+                    md.pred[PRED_2NxnU].cu.initSubCU(parentCTU, cuGeom);
+                    checkInter_rd5_6(md.pred[PRED_2NxnU], cuGeom, SIZE_2NxnU, bMergeOnly);
+                    checkBestMode(md.pred[PRED_2NxnU], cuGeom.depth);
+
+                    md.pred[PRED_2NxnD].cu.initSubCU(parentCTU, cuGeom);
+                    checkInter_rd5_6(md.pred[PRED_2NxnD], cuGeom, SIZE_2NxnD, bMergeOnly);
+                    checkBestMode(md.pred[PRED_2NxnD], cuGeom.depth);
                 }
                 if (bVer)
                 {
-                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0))
-                    {
-                        md.pred[PRED_nLx2N].cu.initSubCU(parentCTU, cuGeom);
-                        checkInter_rd5_6(md.pred[PRED_nLx2N], cuGeom, SIZE_nLx2N, bMergeOnly);
-                        checkBestMode(md.pred[PRED_nLx2N], cuGeom.depth);
-                    }
-                    if (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0))
-                    {
-                        md.pred[PRED_nRx2N].cu.initSubCU(parentCTU, cuGeom);
-                        checkInter_rd5_6(md.pred[PRED_nRx2N], cuGeom, SIZE_nRx2N, bMergeOnly);
-                        checkBestMode(md.pred[PRED_nRx2N], cuGeom.depth);
-                    }
+                    md.pred[PRED_nLx2N].cu.initSubCU(parentCTU, cuGeom);
+                    checkInter_rd5_6(md.pred[PRED_nLx2N], cuGeom, SIZE_nLx2N, bMergeOnly);
+                    checkBestMode(md.pred[PRED_nLx2N], cuGeom.depth);
+
+                    md.pred[PRED_nRx2N].cu.initSubCU(parentCTU, cuGeom);
+                    checkInter_rd5_6(md.pred[PRED_nRx2N], cuGeom, SIZE_nRx2N, bMergeOnly);
+                    checkBestMode(md.pred[PRED_nRx2N], cuGeom.depth);
                 }
             }
 
-            if ((m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames) &&
-                (!m_param->bEnableCbfFastMode || md.bestMode->cu.getQtRootCbf(0)))
+            if (m_slice->m_sliceType != B_SLICE || m_param->bIntraInBFrames)
             {
                 md.pred[PRED_INTRA].cu.initSubCU(parentCTU, cuGeom);
                 checkIntra(md.pred[PRED_INTRA], cuGeom, SIZE_2Nx2N, NULL, NULL);
diff -r 9590baa6cca3 -r 9ab104096834 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Thu Feb 12 14:30:06 2015 +0530
+++ b/source/encoder/encoder.cpp	Wed Feb 11 16:15:33 2015 -0600
@@ -1556,12 +1556,6 @@ void Encoder::configure(x265_param *p)
         p->bBPyramid = 0;
 
     /* Disable features which are not supported by the current RD level */
-    if (p->rdLevel < 5)
-    {
-        if (p->bEnableCbfFastMode)      /* impossible */
-            x265_log(p, X265_LOG_WARNING, "--fast-cbf disabled, requires --rdlevel 5 or higher\n");
-        p->bEnableCbfFastMode = 0;
-    }
     if (p->rdLevel < 4)
         p->psyRdoq = 0;                 /* impossible */
     if (p->rdLevel < 3)
diff -r 9590baa6cca3 -r 9ab104096834 source/x265.h
--- a/source/x265.h	Thu Feb 12 14:30:06 2015 +0530
+++ b/source/x265.h	Wed Feb 11 16:15:33 2015 -0600
@@ -740,11 +740,6 @@ typedef struct x265_param
      * efficiency at a major cost of performance. Default is no RDO (0) */
     int       rdLevel;
 
-    /* Enable the use of `coded block flags` (flags set to true when a residual
-     * has been coded for a given block) to avoid intra analysis in likely skip
-     * blocks. Only applicable in RD levels 5 and 6. Default is disabled */
-    int       bEnableCbfFastMode;
-
     /* Enable early skip decisions to avoid intra and inter analysis in likely
      * skip blocks. Default is disabled */
     int       bEnableEarlySkip;
diff -r 9590baa6cca3 -r 9ab104096834 source/x265cli.h
--- a/source/x265cli.h	Thu Feb 12 14:30:06 2015 +0530
+++ b/source/x265cli.h	Wed Feb 11 16:15:33 2015 -0600
@@ -273,7 +273,6 @@ static void showHelp(x265_param *param)
     H0("   --[no-]psy-rd <0..2.0>        Strength of psycho-visual rate distortion optimization, 0 to disable. Default %.1f\n", param->psyRd);
     H0("   --[no-]psy-rdoq <0..50.0>     Strength of psycho-visual optimization in quantization, 0 to disable. Default %.1f\n", param->psyRdoq);
     H0("   --[no-]early-skip             Enable early SKIP detection. Default %s\n", OPT(param->bEnableEarlySkip));
-    H1("   --[no-]fast-cbf               Enable early outs based on whether residual is coded. Default %s\n", OPT(param->bEnableCbfFastMode));
     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-commits mailing list