[x265] [PATCH] Cleanup
pooja at multicorewareinc.com
pooja at multicorewareinc.com
Thu Sep 19 07:09:13 CEST 2019
# HG changeset patch
# User Pooja Venkatesan <pooja at multicorewareinc.com>
# Date 1568702243 -19800
# Tue Sep 17 12:07:23 2019 +0530
# Node ID c172006cc4e7b5d6347652c8b391deb100503be5
# Parent c4b098f973e6b0ee4aee3bf0d7b54da4e2734d42
Cleanup
This patch does the following:
1) Disable SAO by --no-sao option
2) Resolve gcc-9.2 warnings related to MV refinement levels
3) Update CLI docs
4) Remove MV refinement level-0 and set default to 1.
5) Fix spacing issues and indentations
diff -r c4b098f973e6 -r c172006cc4e7 doc/reST/cli.rst
--- a/doc/reST/cli.rst Tue Aug 13 10:51:21 2019 +0530
+++ b/doc/reST/cli.rst Tue Sep 17 12:07:23 2019 +0530
@@ -997,13 +997,15 @@
the encoder settings. It is recommended to use :option:`--refine-intra` 4 with dynamic
refinement. Default disabled.
-.. option:: --refine-mv <0..3>
+.. option:: --refine-mv <1..3>
Enables refinement of motion vector for scaled video. Evaluates the best
- motion vector based on the level selected. Default 0 - disabled.
+ motion vector based on the level selected. Default 1.
Level 1 - Search around scaled MV.
+
Level 2 - Level 1 + Search around best AMVP cand.
+
Level 3 - Level 2 + Search around the other AMVP cand.
Options which affect the transform unit quad-tree, sometimes referred to
@@ -1999,21 +2001,22 @@
.. option:: --selective-sao <0..4>
- Toggles SAO at slice level. Default 4.
-
- +--------------+---------------------------------------+
- | Level | Description |
- +==============+=======================================+
- | 0 | Disable SAO for all slices |
- +--------------+---------------------------------------+
- | 1 | Enable SAO only for I-slices |
- +--------------+---------------------------------------+
- | 2 | Enable SAO for I-slices & P-slices | |
- +--------------+---------------------------------------+
- | 3 | Enable SAO for all reference slices |
- +--------------+---------------------------------------+
- | 4 | Enable SAO for all slices |
- +--------------+---------------------------------------+
+ Toggles SAO at slice level. Default 0.
+
+ +--------------+------------------------------------------+
+ | Level | Description |
+ +==============+==========================================+
+ | 0 | Disable SAO for all slices |
+ +--------------+------------------------------------------+
+ | 1 | Enable SAO only for I-slices |
+ +--------------+------------------------------------------+
+ | 2 | Enable SAO for I-slices & P-slices |
+ +--------------+------------------------------------------+
+ | 3 | Enable SAO for all reference slices |
+ +--------------+------------------------------------------+
+ | 4 | Enable SAO for all slices |
+ +--------------+------------------------------------------+
+
VUI (Video Usability Information) options
=========================================
diff -r c4b098f973e6 -r c172006cc4e7 source/common/param.cpp
--- a/source/common/param.cpp Tue Aug 13 10:51:21 2019 +0530
+++ b/source/common/param.cpp Tue Sep 17 12:07:23 2019 +0530
@@ -185,12 +185,12 @@
param->searchMethod = X265_HEX_SEARCH;
param->subpelRefine = 2;
param->searchRange = 57;
- param->maxNumMergeCand = 3;
- param->limitReferences = 1;
+ param->maxNumMergeCand = 3;
+ param->limitReferences = 1;
param->limitModes = 0;
param->bEnableWeightedPred = 1;
param->bEnableWeightedBiPred = 0;
- param->bEnableEarlySkip = 1;
+ param->bEnableEarlySkip = 1;
param->bEnableRecursionSkip = 1;
param->bEnableAMP = 0;
param->bEnableRectInter = 0;
@@ -215,7 +215,7 @@
param->bEnableSAO = 1;
param->bSaoNonDeblocked = 0;
param->bLimitSAO = 0;
- param->selectiveSAO = 4;
+ param->selectiveSAO = 0;
/* Coding Quality */
param->cbQpOffset = 0;
@@ -229,7 +229,7 @@
param->analysisReuseFileName = NULL;
param->analysisSave = NULL;
param->analysisLoad = NULL;
- param->bIntraInBFrames = 1;
+ param->bIntraInBFrames = 1;
param->bLossless = 0;
param->bCULossless = 0;
param->bEnableTemporalSubLayers = 0;
@@ -318,7 +318,7 @@
param->intraRefine = 0;
param->interRefine = 0;
param->bDynamicRefine = 0;
- param->mvRefine = 0;
+ param->mvRefine = 1;
param->ctuDistortionRefine = 0;
param->bUseAnalysisFile = 1;
param->csvfpt = NULL;
@@ -376,7 +376,6 @@
param->subpelRefine = 0;
param->searchMethod = X265_DIA_SEARCH;
param->bEnableSAO = 0;
- param->selectiveSAO = 0;
param->bEnableSignHiding = 0;
param->bEnableWeightedPred = 0;
param->rdLevel = 2;
@@ -406,7 +405,6 @@
param->rc.hevcAq = 0;
param->rc.qgSize = 32;
param->bEnableSAO = 0;
- param->selectiveSAO = 0;
param->bEnableFastIntra = 1;
}
else if (!strcmp(preset, "veryfast"))
@@ -554,7 +552,6 @@
{
param->bEnableLoopFilter = 0;
param->bEnableSAO = 0;
- param->selectiveSAO = 0;
param->bEnableWeightedPred = 0;
param->bEnableWeightedBiPred = 0;
param->bIntraInBFrames = 0;
@@ -582,7 +579,6 @@
param->psyRd = 4.0;
param->psyRdoq = 10.0;
param->bEnableSAO = 0;
- param->selectiveSAO = 0;
param->rc.bEnableConstVbv = 1;
}
else if (!strcmp(tune, "animation"))
@@ -1659,8 +1655,8 @@
"Strict-cbr cannot be applied without specifying target bitrate or vbv bufsize");
CHECK((param->analysisSave || param->analysisLoad) && (param->analysisReuseLevel < 1 || param->analysisReuseLevel > 10),
"Invalid analysis refine level. Value must be between 1 and 10 (inclusive)");
- CHECK(param->analysisLoad && (param->mvRefine < 0 || param->mvRefine > 3),
- "Invalid mv refinement level. Value must be between 0 and 3 (inclusive)");
+ CHECK(param->analysisLoad && (param->mvRefine < 1 || param->mvRefine > 3),
+ "Invalid mv refinement level. Value must be between 1 and 3 (inclusive)");
CHECK(param->scaleFactor > 2, "Invalid scale-factor. Supports factor <= 2");
CHECK(param->rc.qpMax < QP_MIN || param->rc.qpMax > QP_MAX_MAX,
"qpmax exceeds supported range (0 to 69)");
@@ -1873,7 +1869,7 @@
}
TOOLOPT(param->bSaoNonDeblocked, "sao-non-deblock");
TOOLOPT(!param->bSaoNonDeblocked && param->bEnableSAO, "sao");
- if (param->selectiveSAO != 4)
+ if (param->selectiveSAO && param->selectiveSAO != 4)
TOOLOPT(param->selectiveSAO, "selective-sao");
TOOLOPT(param->rc.bStatWrite, "stats-write");
TOOLOPT(param->rc.bStatRead, "stats-read");
@@ -1984,7 +1980,7 @@
BOOL(p->bEnableSAO, "sao");
BOOL(p->bSaoNonDeblocked, "sao-non-deblock");
s += sprintf(s, " rd=%d", p->rdLevel);
- s += sprintf(s, "selective-sao=%d", p->selectiveSAO);
+ s += sprintf(s, " selective-sao=%d", p->selectiveSAO);
BOOL(p->bEnableEarlySkip, "early-skip");
BOOL(p->bEnableRecursionSkip, "rskip");
BOOL(p->bEnableFastIntra, "fast-intra");
@@ -2078,7 +2074,7 @@
if (p->masteringDisplayColorVolume)
s += sprintf(s, " master-display=%s", p->masteringDisplayColorVolume);
if (p->bEmitCLL)
- s += sprintf(s, "cll=%hu,%hu", p->maxCLL, p->maxFALL);
+ s += sprintf(s, " cll=%hu,%hu", p->maxCLL, p->maxFALL);
s += sprintf(s, " min-luma=%hu", p->minLuma);
s += sprintf(s, " max-luma=%hu", p->maxLuma);
s += sprintf(s, " log2-max-poc-lsb=%d", p->log2MaxPocLsb);
diff -r c4b098f973e6 -r c172006cc4e7 source/encoder/analysis.cpp
--- a/source/encoder/analysis.cpp Tue Aug 13 10:51:21 2019 +0530
+++ b/source/encoder/analysis.cpp Tue Sep 17 12:07:23 2019 +0530
@@ -2493,11 +2493,11 @@
{
MV outmv, mvpSelect[3];
mvpSelect[0] = interDataCTU->mv[list][cuIdx + part].word;
- switch (m_param->mvRefine)
+ if (m_param->mvRefine > 1)
{
- case 3: mvpSelect[2] = mode.amvpCand[list][ref][!(mode.cu.m_mvpIdx[list][pu.puAbsPartIdx])];
- case 2: mvpSelect[1] = mvp;
- default: break;
+ mvpSelect[1] = mvp;
+ if(m_param->mvRefine > 2)
+ mvpSelect[2] = mode.amvpCand[list][ref][!(mode.cu.m_mvpIdx[list][pu.puAbsPartIdx])];
}
searchMV(mode, list, ref, outmv, mvpSelect, numMvc, mvc);
mode.cu.setPUMv(list, outmv, pu.puAbsPartIdx, part);
diff -r c4b098f973e6 -r c172006cc4e7 source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp Tue Aug 13 10:51:21 2019 +0530
+++ b/source/encoder/encoder.cpp Tue Sep 17 12:07:23 2019 +0530
@@ -3006,20 +3006,6 @@
p->limitTU = 0;
}
- if (p->mvRefine)
- {
- if (!p->analysisLoad || p->analysisReuseLevel < 10)
- {
- x265_log(p, X265_LOG_WARNING, "MV refinement requires analysis load, analysis-reuse-level 10. Disabling MV refine.\n");
- p->mvRefine = 0;
- }
- }
- if (p->scaleFactor && p->analysisLoad && p->interRefine && p->analysisReuseLevel == 10 && !p->mvRefine)
- {
- x265_log(p, X265_LOG_WARNING, "Enabling MV refinement level 1 with scaling and analysis-reuse-level=10.\n");
- p->mvRefine = 1;
- }
-
if (p->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
{
if (!p->analysisLoad && !p->analysisSave)
diff -r c4b098f973e6 -r c172006cc4e7 source/encoder/search.cpp
--- a/source/encoder/search.cpp Tue Aug 13 10:51:21 2019 +0530
+++ b/source/encoder/search.cpp Tue Sep 17 12:07:23 2019 +0530
@@ -2246,13 +2246,7 @@
const MV* amvp = interMode.amvpCand[list][ref];
int mvpIdx = selectMVP(cu, pu, amvp, list, ref);
MV mvmin, mvmax, outmv, mvp;
- if (useAsMVP && !m_param->mvRefine)
- {
- mvp = interDataCTU->mv[list][cuIdx + puIdx].word;
- mvpIdx = interDataCTU->mvpIdx[list][cuIdx + puIdx];
- }
- else
- mvp = amvp[mvpIdx];
+ mvp = amvp[mvpIdx];
if (m_param->searchMethod == X265_SEA)
{
int puX = puIdx & 1;
@@ -2265,19 +2259,22 @@
int satdCost;
if (m_param->analysisMultiPassRefine && m_param->rc.bStatRead && mvpIdx == bestME[list].mvpIdx)
mvpIn = bestME[list].mv;
- if (useAsMVP && m_param->mvRefine)
+ if (useAsMVP)
{
MV bestmv, mvpSel[3];
int mvpIdxSel[3];
satdCost = m_me.COST_MAX;
- switch (m_param->mvRefine)
+ mvpSel[0] = interDataCTU->mv[list][cuIdx + puIdx].word;
+ mvpIdxSel[0] = interDataCTU->mvpIdx[list][cuIdx + puIdx];
+ if (m_param->mvRefine > 1)
{
- case 3: mvpSel[2] = interMode.amvpCand[list][ref][!mvpIdx];
+ mvpSel[1] = interMode.amvpCand[list][ref][mvpIdx];
+ mvpIdxSel[1] = mvpIdx;
+ if (m_param->mvRefine > 2)
+ {
+ mvpSel[2] = interMode.amvpCand[list][ref][!mvpIdx];
mvpIdxSel[2] = !mvpIdx;
- case 2: mvpSel[1] = interMode.amvpCand[list][ref][mvpIdx];
- mvpIdxSel[1] = mvpIdx;
- case 1: mvpSel[0] = interDataCTU->mv[list][cuIdx + puIdx].word;
- mvpIdxSel[0] = interDataCTU->mvpIdx[list][cuIdx + puIdx];
+ }
}
for (int cand = 0; cand < m_param->mvRefine; cand++)
{
diff -r c4b098f973e6 -r c172006cc4e7 source/x265cli.h
--- a/source/x265cli.h Tue Aug 13 10:51:21 2019 +0530
+++ b/source/x265cli.h Tue Sep 17 12:07:23 2019 +0530
@@ -549,7 +549,7 @@
" - 3 : Functionality of (1) + irrespective of size evaluate all inter modes.\n"
" Default:%d\n", param->interRefine);
H0(" --[no-]dynamic-refine Dynamically changes refine-inter level for each CU. Default %s\n", OPT(param->bDynamicRefine));
- H0(" --refine-mv <0..3> Enable mv refinement for load mode. Default %d\n", param->mvRefine);
+ H0(" --refine-mv <1..3> Enable mv refinement for load mode. Default %d\n", param->mvRefine);
H0(" --refine-ctu-distortion Store/normalize ctu distortion in analysis-save/load.\n"
" - 0 : Disabled.\n"
" - 1 : Store/Load ctu distortion to/from the file specified in analysis-save/load.\n"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: x265.patch
Type: text/x-patch
Size: 13502 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20190919/952e1784/attachment-0001.bin>
More information about the x265-devel
mailing list