Commit da9126df authored by Kenneth Andersson's avatar Kenneth Andersson

Also added parameters ALFAllowPredefinedFilters and CCALFStrength and note on...

Also added parameters ALFAllowPredefinedFilters and CCALFStrength and note on that that refinement of quantized filter coefficients not is used.
parent 76407775
......@@ -88,7 +88,6 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 1
ALF : 1
ALFStrength : 1.0
IBC : 0 # turned off in CTC
AllowDisFracMMVD : 1
AffineAmvr : 0
......@@ -111,7 +110,9 @@ FastLFNST : 1
# Encoder optimization tools
AffineAmvrEncOpt : 0
ALFStrength : 1.0
ALFAllowPredefinedFilters : 1
CCALFStrength : 1.0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -111,7 +111,6 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 1
ALF : 1
ALFStrength : 1.0
CIIP : 1
IBC : 0 # turned off in CTC
AllowDisFracMMVD : 1
......@@ -137,6 +136,9 @@ FastLocalDualTreeMode : 2
# Encoder optimization tools
AffineAmvrEncOpt : 0
MmvdDisNum : 6
ALFStrength : 1.0
ALFAllowPredefinedFilters : 1
CCALFStrength : 1.0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -112,7 +112,6 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 1
ALF : 1
ALFStrength : 1.0
BCW : 1
BcwFast : 1
CIIP : 1
......@@ -141,6 +140,9 @@ FastLocalDualTreeMode : 2
# Encoder optimization tools
AffineAmvrEncOpt : 0
MmvdDisNum : 6
ALFStrength : 1.0
ALFAllowPredefinedFilters : 1
CCALFStrength : 1.0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -140,7 +140,6 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 1
ALF : 1
ALFStrength : 1.0
BCW : 1
BcwFast : 1
BIO : 1
......@@ -174,7 +173,9 @@ ChromaTS : 1
AffineAmvrEncOpt : 1
MmvdDisNum : 6
TemporalFilter : 1
ALFStrength : 1.0
ALFAllowPredefinedFilters : 1
CCALFStrength : 1.0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -124,7 +124,6 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 1
ALF : 1
ALFStrength : 1.0
BCW : 1
BcwFast : 1
BIO : 1
......@@ -158,7 +157,9 @@ ChromaTS : 1
AffineAmvrEncOpt : 1
MmvdDisNum : 6
TemporalFilter : 1
ALFStrength : 1.0
ALFAllowPredefinedFilters : 1
CCALFStrength : 1.0
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
\documentclass[a4paper,11pt]{jvetdoc}
\documentclass[a4paper,11pt]{jvetdoc}
\usepackage{geometry}[2010/02/12]
......@@ -2891,7 +2891,13 @@ Value shall be in the range 1..8.
\Option{ALFStrength} &
%\ShortOption{\None} &
\Default{1.0} &
Enables control of ALF filter strength. The parameter scales the magnitudes of the ALF filter coefficients for both luma and chroma. Valid values are in the range 0.0 to 1.0.
Enables control of ALF filter strength. The parameter scales the magnitudes of the ALF filter coefficients for both luma and chroma. Valid values are in the range 0.0 to 1.0. NOTE: Refinement of quantized filter coefficents is not used when ALFStrength is different from 1.0. To ensure reduced filter strength the parameter ALFAllowPredefinedFilters should also be set to false.
\\
\Option{ALFAllowPredefinedFilters} &
%\ShortOption{\None} &
\Default{true} &
Enables use of pre-defined filters for ALF.
\\
\Option{CCALF} &
......@@ -2906,6 +2912,12 @@ Enables cross-component ALF.
QP threshold above which the encoder reduces cross-component ALF usage.
\\
\Option{CCALFStrength} &
%\ShortOption{\None} &
\Default{1.0} &
Enables control of CCALF filter strength. The parameter scales the magnitudes of the CCALF filter coefficients. Valid values are in the range 0.0 to 1.0. NOTE: Refinement of quantized filter coefficents is not used when CCALFStrength is different from 1.0.
\\
\Option{SMVD} &
%\ShortOption{\None} &
\Default{false} &
......
......@@ -1050,6 +1050,8 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseALF ( m_alf );
#if JVET_T0064
m_cEncLib.setALFStrength (m_alfStrength);
m_cEncLib.setCCALFStrength (m_ccalfStrength);
m_cEncLib.setALFAllowPredefinedFilters (m_alfAllowPredefinedFilters);
#endif
m_cEncLib.setUseCCALF ( m_ccalf );
m_cEncLib.setCCALFQpThreshold ( m_ccalfQpThreshold );
......
......@@ -1404,7 +1404,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("EnsureWppBitEqual", m_ensureWppBitEqual, false, "Ensure the results are equal to results with WPP-style parallelism, even if WPP is off")
( "ALF", m_alf, true, "Adaptive Loop Filter\n" )
#if JVET_T0064
("ALFStrength", m_alfStrength, 1.0, "Adaptive Loop Filter strength. The parameter scales the magnitudes of the ALF filter coefficients for both luma and chroma. Valid range is 0.0 <= ALFStrength <= 1.0")
("ALFStrength", m_alfStrength, 1.0, "Adaptive Loop Filter strength. The parameter scales the magnitudes of the ALF filter coefficients for both luma and chroma. Valid range is 0.0 <= ALFStrength <= 1.0")
("ALFAllowPredefinedFilters", m_alfAllowPredefinedFilters, true, "Allow use of predefined filters for ALF")
("CCALFStrength", m_ccalfStrength, 1.0, "Cross-component Adaptive Loop Filter strength. The parameter scales the magnitudes of the CCALF filter coefficients. Valid range is 0.0 <= CCALFStrength <= 1.0")
#endif
( "CCALF", m_ccalf, true, "Cross-component Adaptive Loop Filter" )
( "CCALFQpTh", m_ccalfQpThreshold, 37, "QP threshold above which encoder reduces CCALF usage")
......@@ -2771,6 +2773,11 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara(m_alfStrength < 0.0, "ALFStrength is less than 0. Valid range is 0.0 <= ALFStrength <= 1.0" );
xConfirmPara(m_alfStrength > 1.0, "ALFStrength is greater than 1. Valid range is 0.0 <= ALFStrength <= 1.0" );
}
if (m_ccalf)
{
xConfirmPara(m_ccalfStrength < 0.0, "CCALFStrength is less than 0. Valid range is 0.0 <= CCALFStrength <= 1.0");
xConfirmPara(m_ccalfStrength > 1.0, "CCALFStrength is greater than 1. Valid range is 0.0 <= CCALFStrength <= 1.0");
}
#endif
if (m_ccalf && (m_chromaFormatIDC == CHROMA_400))
{
......
......@@ -696,6 +696,8 @@ protected:
bool m_alf; ///< Adaptive Loop Filter
#if JVET_T0064
double m_alfStrength;
bool m_alfAllowPredefinedFilters;
double m_ccalfStrength;
#endif
bool m_ccalf;
int m_ccalfQpThreshold;
......
......@@ -1901,7 +1901,11 @@ void EncAdaptiveLoopFilter::roundFiltCoeffCCALF(int16_t *filterCoeffQuant, doubl
int best_index = 0;
for(int k = 0; k < CCALF_CANDS_COEFF_NR; k++)
{
#if JVET_T0064
double err = ((filterCoeff[i] * m_encCfg->getCCALFStrength()) * sign * factor - CCALF_SMALL_TAB[k]);
#else
double err = (filterCoeff[i] * sign * factor - CCALF_SMALL_TAB[k]);
#endif
err = err*err;
if(err < best_err)
{
......@@ -2732,7 +2736,7 @@ void EncAdaptiveLoopFilter::alfEncoderCtb(CodingStructure& cs, AlfParam& alfPar
int iBestFilterSetIdx = 0;
#if JVET_T0064
int firstFilterSetIdx = 0;
if (m_encCfg->getALFStrength() != 1.0)
if (!m_encCfg->getALFAllowPredefinedFilters())
{
firstFilterSetIdx = NUM_FIXED_FILTER_SETS;
}
......@@ -3355,6 +3359,12 @@ void EncAdaptiveLoopFilter::deriveCcAlfFilterCoeff( ComponentID compID, const Pe
// Refine quanitzation
int modified = 1;
#if JVET_T0064
if (m_encCfg->getCCALFStrength() != 1.0)
{
modified = 0;
}
#endif
double errRef = m_alfCovarianceFrameCcAlf[compID - 1][0][filterIdx].calcErrorForCcAlfCoeffs(filterCoeffInt, size, (m_scaleBits+1));
while (modified)
{
......
......@@ -740,6 +740,8 @@ protected:
bool m_alf; ///< Adaptive Loop Filter
#if JVET_T0064
double m_alfStrength;
bool m_alfAllowPredefinedFilters;
double m_ccalfStrength;
#endif
bool m_ccalf;
int m_ccalfQpThreshold;
......@@ -1927,8 +1929,12 @@ public:
void setUseALF( bool b ) { m_alf = b; }
bool getUseALF() const { return m_alf; }
#if JVET_T0064
void setALFStrength( double s) { m_alfStrength = s; }
void setALFStrength( double s) { m_alfStrength = s; }
double getALFStrength() const { return m_alfStrength; }
void setALFAllowPredefinedFilters(bool b) { m_alfAllowPredefinedFilters = b; }
bool getALFAllowPredefinedFilters() const { return m_alfAllowPredefinedFilters; }
void setCCALFStrength(double s) { m_ccalfStrength = s; }
double getCCALFStrength() const { return m_ccalfStrength; }
#endif
void setUseCCALF( bool b ) { m_ccalf = b; }
bool getUseCCALF() const { return m_ccalf; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment