[x265-commits] [x265] api: improve comment for bEnableCbfFastMode

Steve Borho steve at borho.org
Wed Oct 29 23:50:31 CET 2014


details:   http://hg.videolan.org/x265/rev/f834d2e8195f
branches:  
changeset: 8740:f834d2e8195f
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 29 12:40:35 2014 -0500
description:
api: improve comment for bEnableCbfFastMode
Subject: [x265] api: expose deblocking filter offsets as public params, deprecate --[no-]lft

details:   http://hg.videolan.org/x265/rev/f58a1cc0126a
branches:  
changeset: 8741:f58a1cc0126a
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 29 14:17:48 2014 -0500
description:
api: expose deblocking filter offsets as public params, deprecate --[no-]lft

It was always a bit unfortunate to base the deblock param name on loop filter
when HEVC has two (deblock and SAO).

Now we support --deblock=<int>:<int> and similar options as x264 does
Subject: [x265] search: nit

details:   http://hg.videolan.org/x265/rev/27827068b3ec
branches:  
changeset: 8742:27827068b3ec
user:      Ashok Kumar Mishra<ashok at multicorewareinc.com>
date:      Wed Oct 29 13:15:19 2014 +0530
description:
search: nit
Subject: [x265] fix rd=0,1

details:   http://hg.videolan.org/x265/rev/41220fab15c1
branches:  stable
changeset: 8743:41220fab15c1
user:      Satoshi Nakagawa <nakagawa424 at oki.com>
date:      Thu Oct 30 01:33:49 2014 +0900
description:
fix rd=0,1
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/210967feb8c3
branches:  
changeset: 8744:210967feb8c3
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 29 16:14:12 2014 -0500
description:
Merge with stable
Subject: [x265] docs: update preset table and various command line options

details:   http://hg.videolan.org/x265/rev/812ce345a14d
branches:  stable
changeset: 8745:812ce345a14d
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 29 17:34:07 2014 -0500
description:
docs: update preset table and various command line options
Subject: [x265] Merge with stable

details:   http://hg.videolan.org/x265/rev/31ed48cdbefe
branches:  
changeset: 8746:31ed48cdbefe
user:      Steve Borho <steve at borho.org>
date:      Wed Oct 29 17:50:05 2014 -0500
description:
Merge with stable

diffstat:

 doc/reST/cli.rst            |  32 +++++++++++++----
 doc/reST/lossless.rst       |  10 ++--
 doc/reST/presets.rst        |   7 +--
 source/CMakeLists.txt       |   2 +-
 source/common/param.cpp     |  29 +++++++++++++++-
 source/common/predict.cpp   |   7 +++-
 source/common/predict.h     |   1 +
 source/encoder/analysis.cpp |  49 +++++++++++++++++----------
 source/encoder/encoder.cpp  |   9 +---
 source/encoder/search.cpp   |  81 ++++++++++++++++++++++----------------------
 source/x265.cpp             |   8 ++-
 source/x265.h               |  12 +++++-
 12 files changed, 157 insertions(+), 90 deletions(-)

diffs (truncated from 541 to 300 lines):

diff -r fe3b88e11f44 -r 31ed48cdbefe doc/reST/cli.rst
--- a/doc/reST/cli.rst	Wed Oct 29 11:07:44 2014 -0500
+++ b/doc/reST/cli.rst	Wed Oct 29 17:50:05 2014 -0500
@@ -577,7 +577,9 @@ Spatial/intra options
 .. option:: --tskip-fast, --no-tskip-fast
 
 	Only evaluate transform skip for NxN intra predictions (4x4 blocks).
-	Only applicable if transform skip is enabled. Default disabled
+	Only applicable if transform skip is enabled. For chroma, only
+	evaluate if luma used tskip. Inter block tskip analysis is
+	unmodified. Default disabled
 
 .. option:: --strong-intra-smoothing, --no-strong-intra-smoothing
 
@@ -629,8 +631,8 @@ Mode decision / Analysis
 	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. Only applicable for RD
-	levels 5 and 6. Default disabled
+	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
 
@@ -670,15 +672,15 @@ Mode decision / Analysis
 	+=======+===============================================================+
 	| 0     | sa8d mode and split decisions, intra w/ source pixels         |
 	+-------+---------------------------------------------------------------+
-	| 1     | recon generated (better intra), RDO merge residual            |
+	| 1     | recon generated (better intra), RDO merge/skip selection      |
 	+-------+---------------------------------------------------------------+
-	| 2     | RDO splits and merge residual choice                          |
+	| 2     | RDO splits and merge/skip selection                           |
 	+-------+---------------------------------------------------------------+
 	| 3     | RDO mode and split decisions                                  |
 	+-------+---------------------------------------------------------------+
 	| 4     | Adds RDO Quant                                                |
 	+-------+---------------------------------------------------------------+
-	| 5     | Adds RDO prediction decisions, enables intra modes in B slices|
+	| 5     | Adds RDO prediction decisions                                 |
 	+-------+---------------------------------------------------------------+
 	| 6     | Currently same as 5                                           |
 	+-------+---------------------------------------------------------------+
@@ -1038,9 +1040,23 @@ Quality, rate control and rate distortio
 Loop filters
 ============
 
-.. option:: --lft, --no-lft
+.. option:: --deblock=<int>:<int>, --no-deblock
 
-	Toggle deblocking loop filter, default enabled
+	Toggle deblocking loop filter, optionally specify deblocking
+	strength offsets.
+
+	<int>:<int> - parsed as tC offset and Beta offset
+	<int>,<int> - parsed as tC offset and Beta offset
+	<int>       - both tC and Beta offsets assigned the same value
+
+	If unspecified, the offsets default to 0. The offsets must be in a
+	range of -6 (lowest strength) to 6 (highest strength).
+
+	To disable the deblocking filter entirely, use --no-deblock or
+	--deblock=false. Default enabled, with both offsets defaulting to 0
+
+	If deblocking is disabled, or the offsets are non-zero, these
+	changes from the default configuration are signaled in the PPS.
 
 .. option:: --sao, --no-sao
 
diff -r fe3b88e11f44 -r 31ed48cdbefe doc/reST/lossless.rst
--- a/doc/reST/lossless.rst	Wed Oct 29 11:07:44 2014 -0500
+++ b/doc/reST/lossless.rst	Wed Oct 29 17:50:05 2014 -0500
@@ -155,8 +155,8 @@ Transform Skip
 
 A somewhat related feature, :option:`--tskip` tells the encoder to
 evaluate transform-skip (bypass DCT but with quantization still enabled)
-when coding small intra blocks. This feature is intended to improve the
-coding efficiency of screen content (aka: text on a screen) and is not
-really intended for lossless coding.  This feature should only be
-enabled if the content has a lot of very sharp edges in it, and is
-mostly unrelated to lossless coding.
+when coding small 4x4 transform blocks. This feature is intended to
+improve the coding efficiency of screen content (aka: text on a screen)
+and is not really intended for lossless coding.  This feature should
+only be enabled if the content has a lot of very sharp edges in it, and
+is mostly unrelated to lossless coding.
diff -r fe3b88e11f44 -r 31ed48cdbefe doc/reST/presets.rst
--- a/doc/reST/presets.rst	Wed Oct 29 11:07:44 2014 -0500
+++ b/doc/reST/presets.rst	Wed Oct 29 17:50:05 2014 -0500
@@ -50,7 +50,7 @@ The presets adjust encoder parameters to
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | fast-intra   |    1      |     1     |    1     |   1    |  1   |    0   |  0   |   0    |    0     |    0    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
-| fast-cbf     |    1      |     1     |    1     |   1    |  0   |    0   |  0   |   0    |    0     |    0    |
+| b-intra      |    0      |     0     |    0     |   0    |  0   |    0   |  0   |   1    |    1     |    1    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | sao          |    0      |     0     |    1     |   1    |  1   |    1   |  1   |   1    |    1     |    1    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
@@ -66,15 +66,14 @@ The presets adjust encoder parameters to
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | rdLevel      |    2      |     2     |    2     |   2    |  2   |    3   |  4   |   6    |    6     |    6    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
-| lft          |    0      |     1     |    1     |   1    |  1   |    1   |  1   |   1    |    1     |    1    |
+| deblock      |    0      |     1     |    1     |   1    |  1   |    1   |  1   |   1    |    1     |    1    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | tu-intra     |    1      |     1     |    1     |   1    |  1   |    1   |  1   |   2    |    3     |    4    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 | tu-inter     |    1      |     1     |    1     |   1    |  1   |    1   |  1   |   2    |    3     |    4    |
 +--------------+-----------+-----------+----------+--------+------+--------+------+--------+----------+---------+
 
-Placebo mode further enables transform-skip prediction analysis
-(lossless).
+Placebo mode enables transform-skip prediction evaluation.
 
 Tuning
 ======
diff -r fe3b88e11f44 -r 31ed48cdbefe source/CMakeLists.txt
--- a/source/CMakeLists.txt	Wed Oct 29 11:07:44 2014 -0500
+++ b/source/CMakeLists.txt	Wed Oct 29 17:50:05 2014 -0500
@@ -21,7 +21,7 @@ include(CheckSymbolExists)
 include(CheckCXXCompilerFlag)
 
 # X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 35)
+set(X265_BUILD 36)
 configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
                "${PROJECT_BINARY_DIR}/x265.def")
 configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
diff -r fe3b88e11f44 -r 31ed48cdbefe source/common/param.cpp
--- a/source/common/param.cpp	Wed Oct 29 11:07:44 2014 -0500
+++ b/source/common/param.cpp	Wed Oct 29 17:50:05 2014 -0500
@@ -623,7 +623,22 @@ int x265_param_parse(x265_param *p, cons
     OPT("psy-rdoq") p->psyRdoq = atof(value);
     OPT("signhide") p->bEnableSignHiding = atobool(value);
     OPT("b-intra") p->bIntraInBFrames = atobool(value);
-    OPT("lft") p->bEnableLoopFilter = atobool(value);
+    OPT("lft") p->bEnableLoopFilter = atobool(value); /* DEPRECATED */
+    OPT("deblock")
+    {
+        if (2 == sscanf(value, "%d:%d", &p->deblockingFilterTCOffset, &p->deblockingFilterBetaOffset) ||
+            2 == sscanf(value, "%d,%d", &p->deblockingFilterTCOffset, &p->deblockingFilterBetaOffset))
+        {
+            p->bEnableLoopFilter = true;
+        }
+        else if (sscanf(value, "%d", &p->deblockingFilterTCOffset))
+        {
+            p->bEnableLoopFilter = 1;
+            p->deblockingFilterBetaOffset = p->deblockingFilterTCOffset;
+        }
+        else
+            p->bEnableLoopFilter = atobool(value);
+    }
     OPT("sao") p->bEnableSAO = atobool(value);
     OPT("sao-non-deblock") p->bSaoNonDeblocked = atobool(value);
     OPT("ssim") p->bEnableSsim = atobool(value);
@@ -960,6 +975,10 @@ int x265_check_params(x265_param *param)
           "Aq-Mode is out of range");
     CHECK(param->rc.aqStrength < 0 || param->rc.aqStrength > 3,
           "Aq-Strength is out of range");
+    CHECK(param->deblockingFilterTCOffset < -6 || param->deblockingFilterTCOffset > 6,
+          "deblocking filter tC offset must be in the range of -6 to +6");
+    CHECK(param->deblockingFilterBetaOffset < -6 || param->deblockingFilterBetaOffset > 6,
+          "deblocking filter Beta offset must be in the range of -6 to +6");
     CHECK(param->psyRd < 0 || 2.0 < param->psyRd, "Psy-rd strength must be between 0 and 2.0");
     CHECK(param->psyRdoq < 0 || 10.0 < param->psyRdoq, "Psy-rdoq strength must be between 0 and 10.0");
     CHECK(param->bEnableWavefront < 0, "WaveFrontSynchro cannot be negative");
@@ -1156,7 +1175,13 @@ void x265_print_params(x265_param *param
     TOOLOPT(param->bEnableCbfFastMode, "cfm");
     if (param->noiseReduction)
         fprintf(stderr, "nr=%d ", param->noiseReduction);
-    TOOLOPT(param->bEnableLoopFilter, "lft");
+    if (param->bEnableLoopFilter)
+    {
+        if (param->deblockingFilterBetaOffset || param->deblockingFilterTCOffset)
+            fprintf(stderr, "deblock(tC=%d:B=%d) ", param->deblockingFilterTCOffset, param->deblockingFilterBetaOffset);
+        else
+            TOOLOPT(param->bEnableLoopFilter, "deblock");
+    }
     if (param->bEnableSAO)
         fprintf(stderr, "sao%s ", param->bSaoNonDeblocked ? "-non-deblock" : "");
     TOOLOPT(param->bEnableSignHiding, "signhide");
diff -r fe3b88e11f44 -r 31ed48cdbefe source/common/predict.cpp
--- a/source/common/predict.cpp	Wed Oct 29 11:07:44 2014 -0500
+++ b/source/common/predict.cpp	Wed Oct 29 17:50:05 2014 -0500
@@ -144,12 +144,17 @@ void Predict::predIntraChromaAng(pixel* 
     primitives.intra_pred[dirMode][sizeIdx](dst, stride, left, above, dirMode, 0);
 }
 
-void Predict::prepMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx)
+void Predict::initMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx)
 {
     m_predSlice = cu.m_slice;
     cu.getPartIndexAndSize(partIdx, m_puAbsPartIdx, m_puWidth, m_puHeight);
     m_ctuAddr = cu.m_cuAddr;
     m_cuAbsPartIdx = cuGeom.encodeIdx;
+}
+
+void Predict::prepMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx)
+{
+    initMotionCompensation(cu, cuGeom, partIdx);
 
     m_refIdx0      = cu.m_refIdx[0][m_puAbsPartIdx];
     m_clippedMv[0] = cu.m_mv[0][m_puAbsPartIdx];
diff -r fe3b88e11f44 -r 31ed48cdbefe source/common/predict.h
--- a/source/common/predict.h	Wed Oct 29 11:07:44 2014 -0500
+++ b/source/common/predict.h	Wed Oct 29 17:50:05 2014 -0500
@@ -117,6 +117,7 @@ public:
 public:
 
     /* prepMotionCompensation needs to be called to prepare MC with CU-relevant data */
+    void initMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx);
     void prepMotionCompensation(const CUData& cu, const CUGeom& cuGeom, int partIdx);
     void motionCompensation(Yuv& predYuv, bool bLuma, bool bChroma);
 
diff -r fe3b88e11f44 -r 31ed48cdbefe source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp	Wed Oct 29 11:07:44 2014 -0500
+++ b/source/encoder/analysis.cpp	Wed Oct 29 17:50:05 2014 -0500
@@ -901,6 +901,7 @@ void Analysis::compressInterCU_rd0_4(con
                         residualTransformQuantIntra(*md.bestMode, cuGeom, initTrDepth, 0, tuDepthRange);
                         getBestIntraModeChroma(*md.bestMode, cuGeom);
                         residualQTIntraChroma(*md.bestMode, cuGeom, 0, 0);
+                        md.bestMode->reconYuv.copyFromPicYuv(*m_frame->m_reconPicYuv, cu.m_cuAddr, cuGeom.encodeIdx); // TODO:
                     }
                 }
             }
@@ -909,7 +910,7 @@ void Analysis::compressInterCU_rd0_4(con
         if (m_bTryLossless)
             tryLossless(cuGeom);
 
-        if (mightSplit && m_param->rdLevel > 1)
+        if (mightSplit)
             addSplitFlagCost(*md.bestMode, cuGeom.depth);
     }
 
@@ -961,7 +962,7 @@ void Analysis::compressInterCU_rd0_4(con
         if (mightNotSplit)
             addSplitFlagCost(*splitPred, cuGeom.depth);
         else if (m_param->rdLevel <= 1)
-            splitPred->sa8dCost = m_rdCost.calcRdSADCost(splitPred->distortion, splitPred->totalBits);
+            splitPred->sa8dCost = m_rdCost.calcRdSADCost(splitPred->distortion, splitPred->sa8dBits);
         else
             updateModeCost(*splitPred);
 
@@ -1412,8 +1413,6 @@ void Analysis::encodeResidue(const CUDat
     uint32_t absPartIdx = cuGeom.encodeIdx;
     int sizeIdx = cuGeom.log2CUSize - 2;
 
-    /* at RD 0, the prediction pixels are accumulated into the top depth predYuv */
-    Yuv& predYuv = m_modeDepth[0].bestMode->predYuv;
     Yuv& fencYuv = m_modeDepth[0].fencYuv;
 
     /* reuse the bestMode data structures at the current depth */
@@ -1426,18 +1425,13 @@ void Analysis::encodeResidue(const CUDat
 
     if (cu.m_predMode[0] == MODE_INTRA)
     {
-        uint32_t initTrDepth = cu.m_partSize[0] == SIZE_2Nx2N ? 0 : 1;
-
         uint32_t tuDepthRange[2];
         cu.getIntraTUQtDepthRange(tuDepthRange, 0);
 
+        uint32_t initTrDepth = cu.m_partSize[0] == SIZE_NxN;
         residualTransformQuantIntra(*bestMode, cuGeom, initTrDepth, 0, tuDepthRange);
         getBestIntraModeChroma(*bestMode, cuGeom);
         residualQTIntraChroma(*bestMode, cuGeom, 0, 0);
-
-        /* copy the reconstructed part to the recon pic for later intra
-         * predictions */
-        reconYuv.copyToPicYuv(*m_frame->m_reconPicYuv, cu.m_cuAddr, absPartIdx);
     }
     else if (cu.m_predMode[0] == MODE_INTER)
     {
@@ -1447,16 +1441,22 @@ void Analysis::encodeResidue(const CUDat
 
         ShortYuv& resiYuv = m_rqt[cuGeom.depth].tmpResiYuv;
 
+        /* at RD 0, the prediction pixels are accumulated into the top depth predYuv */
+        Yuv& predYuv = m_modeDepth[0].bestMode->predYuv;
+        pixel* predY = predYuv.getLumaAddr(absPartIdx);
+        pixel* predU = predYuv.getCbAddr(absPartIdx);
+        pixel* predV = predYuv.getCrAddr(absPartIdx);
+
         primitives.luma_sub_ps[sizeIdx](resiYuv.m_buf[0], resiYuv.m_size,
-                                        fencYuv.getLumaAddr(absPartIdx), predYuv.getLumaAddr(absPartIdx),
+                                        fencYuv.getLumaAddr(absPartIdx), predY,
                                         fencYuv.m_size, predYuv.m_size);
 
         primitives.chroma[m_csp].sub_ps[sizeIdx](resiYuv.m_buf[1], resiYuv.m_csize,
-                                        fencYuv.getCbAddr(absPartIdx), predYuv.getCbAddr(absPartIdx),
+                                        fencYuv.getCbAddr(absPartIdx), predU,
                                         fencYuv.m_csize, predYuv.m_csize);
 
         primitives.chroma[m_csp].sub_ps[sizeIdx](resiYuv.m_buf[2], resiYuv.m_csize,
-                                        fencYuv.getCrAddr(absPartIdx), predYuv.getCrAddr(absPartIdx),
+                                        fencYuv.getCrAddr(absPartIdx), predV,
                                         fencYuv.m_csize, predYuv.m_csize);
 
         uint32_t tuDepthRange[2];
@@ -1466,23 +1466,36 @@ void Analysis::encodeResidue(const CUDat


More information about the x265-commits mailing list