Commit d251cf40 authored by Dmytro Rusanovskyy's avatar Dmytro Rusanovskyy
Browse files

Changes to address SW coordinators comments.

parent a5c2cd0e
Pipeline #6873 passed with stage
in 45 minutes and 26 seconds
......@@ -141,9 +141,9 @@ ALFAllowPredefinedFilters : 1
ALFStrengthTargetLuma : 1.0
ALFStrengthTargetChroma : 1.0
CCALFStrengthTarget : 1.0
EncDbOpt : 1
UseChromaCostFactorOffset : 1
UseFastDecisionTT : 1
EncDbOpt : 1
SplitPredictAdaptMode : 1
DisableFastTTfromBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
......
......@@ -144,9 +144,9 @@ ALFAllowPredefinedFilters : 1
ALFStrengthTargetLuma : 1.0
ALFStrengthTargetChroma : 1.0
CCALFStrengthTarget : 1.0
EncDbOpt : 1
UseChromaCostFactorOffset : 1
UseFastDecisionTT : 1
EncDbOpt : 1
SplitPredictAdaptMode : 1
DisableFastTTfromBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
......
......@@ -178,8 +178,8 @@ TemporalFilterStrengthFrame4 : 0.3 # Enable filter at every 8th frame wi
TemporalFilterStrengthFrame8 : 0.95 # Enable filter at every 8th frame with given strength
TemporalFilterStrengthFrame16 : 1.5 # Enable filter at every 16th frame with given strength, longer intervals has higher priority
EncDbOpt : 1
UseChromaCostFactorOffset : 1
UseFastDecisionTT : 1
SplitPredictAdaptMode : 1
DisableFastTTfromBT : 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
......
......@@ -2070,6 +2070,25 @@ Controls intra coding speedup introducted with local dual tree mode.
\end{tabular}
\\
\Option{SplitPredictAdaptMode} &
%\ShortOption{\None} &
\Default{0} &
Control mode for split cost prediction, 0..2 (Default: 0)"
\par
\begin{tabular}{cp{0.45\textwidth}}
0 & QP based cost prediction.\\
1 & QP and component type (luma/chroma) based cost prediction.\\
2 & Cost prediction based on QP, component type and split type.\\
\end{tabular}
\\
\Option{DisableFastTTfromBT} &
%\ShortOption{\None} &
\Default{false} &
Disable fast decision for TT from BT."
\par
\\
\end{OptionTableNoShorthand}
......
......@@ -821,8 +821,8 @@ void EncApp::xInitLibCfg()
m_cEncLib.setUseISP ( m_ISP );
m_cEncLib.setUseFastISP ( m_useFastISP );
#if JVET_Y0126_PERFORMANCE
m_cEncLib.setUseChromaCostFactorOffset (m_useChromaCostFactorOffset);
m_cEncLib.setUseFastDecisionTT (m_useFastDecisionTT);
m_cEncLib.setFastAdaptCostPredMode (m_fastAdaptCostPredMode);
m_cEncLib.setDisableFastDecisionTT (m_disableFastDecisionTT);
#endif
// set internal bit-depth and constants
......
......@@ -1047,8 +1047,8 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("FastMIP", m_useFastMIP, false, "Fast encoder search for MIP (matrix-based intra prediction)")
("FastLocalDualTreeMode", m_fastLocalDualTreeMode, 0, "Fast intra pass coding for local dual-tree in intra coding region, 0: off, 1: use threshold, 2: one intra mode only")
#if JVET_Y0126_PERFORMANCE
("UseChromaCostFactorOffset", m_useChromaCostFactorOffset, false, "Enable offset for calculation chroma cost factor in partitioning")
("UseFastDecisionTT", m_useFastDecisionTT, false, "Enable fast decision for TT from BT")
("SplitPredictAdaptMode", m_fastAdaptCostPredMode, 0, "Mode for split cost prediction, 0..2 (Default: 0)" )
("DisableFastTTfromBT", m_disableFastDecisionTT, false, "Disable fast decision for TT from BT")
#endif
// Unit definition parameters
("MaxCUWidth", m_uiMaxCUWidth, 64u)
......@@ -3603,6 +3603,10 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_fastLocalDualTreeMode < 0 || m_fastLocalDualTreeMode > 2, "FastLocalDualTreeMode must be in range [0..2]" );
#if JVET_Y0126_PERFORMANCE
xConfirmPara( m_fastAdaptCostPredMode < 0 || m_fastAdaptCostPredMode > 2, "FastAdaptCostPredMode must be in range [0..2]" );
#endif
int extraRPLs = 0;
bool hasFutureRef = false;
//start looping through frames in coding order until we can verify that the GOP structure is correct.
......
......@@ -256,8 +256,8 @@ protected:
bool m_ISP;
bool m_useFastISP; ///< flag for enabling fast methods for ISP
#if JVET_Y0126_PERFORMANCE
bool m_useChromaCostFactorOffset; ///< flag for enabling chroma cost factor offset for partitioning
bool m_useFastDecisionTT; ///< flag for enabling fast decision for TT from BT
int m_fastAdaptCostPredMode; ///< mode for cost prediction, 0..2
bool m_disableFastDecisionTT; ///< flag for disabling fast decision for TT from BT
#endif
// coding quality
......
......@@ -411,8 +411,8 @@ protected:
bool m_useFastMIP;
int m_fastLocalDualTreeMode;
#if JVET_Y0126_PERFORMANCE
bool m_useChromaCostFactorOffset;
bool m_useFastDecisionTT;
int m_fastAdaptCostPredMode;
bool m_disableFastDecisionTT;
#endif
uint32_t m_log2MaxTbSize;
......@@ -1370,13 +1370,13 @@ public:
bool getUseMIP () const { return m_MIP; }
void setUseFastMIP ( bool b ) { m_useFastMIP = b; }
bool getUseFastMIP () const { return m_useFastMIP; }
void setFastLocalDualTreeMode ( int i ) { m_fastLocalDualTreeMode = i; }
int getFastLocalDualTreeMode () const { return m_fastLocalDualTreeMode; }
void setFastLocalDualTreeMode ( int i ) { m_fastLocalDualTreeMode = i; }
int getFastLocalDualTreeMode () const { return m_fastLocalDualTreeMode; }
#if JVET_Y0126_PERFORMANCE
void setUseChromaCostFactorOffset (bool i) { m_useChromaCostFactorOffset = i; }
bool getUseChromaCostFactorOffset () const { return m_useChromaCostFactorOffset; }
void setUseFastDecisionTT (bool i) { m_useFastDecisionTT = i; }
bool getUseFastDecisionTT () const { return m_useFastDecisionTT; }
void setFastAdaptCostPredMode (int i) { m_fastAdaptCostPredMode = i; }
int getFastAdaptCostPredMode () const { return m_fastAdaptCostPredMode; }
void setDisableFastDecisionTT (bool i) { m_disableFastDecisionTT = i; }
bool getDisableFastDecisionTT () const { return m_disableFastDecisionTT; }
#endif
void setLog2MaxTbSize ( uint32_t u ) { m_log2MaxTbSize = u; }
......
......@@ -1105,17 +1105,40 @@ void EncCu::xCheckModeSplit(CodingStructure *&tempCS, CodingStructure *&bestCS,
m_CABACEstimator->mode_constraint( split, *tempCS, partitioner, modeTypeChild );
#if JVET_Y0126_PERFORMANCE
double factor = (tempCS->currQP[partitioner.chType] > 30 ? 1.1 : 1.075);
if ( m_pcEncCfg->getUseChromaCostFactorOffset() ) {
factor += (isChroma(partitioner.chType) ? 0.2 : 0.0);
double costTemp = 0;
if( m_pcEncCfg->getFastAdaptCostPredMode() == 2 )
{
int numChild = 3;
if( split == CU_VERT_SPLIT || split == CU_HORZ_SPLIT )
numChild--;
else if( split == CU_QUAD_SPLIT )
numChild++;
int64_t approxBits = numChild << SCALE_BITS;
const double factor = ( tempCS->currQP[partitioner.chType] > 30 ? 1.11 : 1.085 )
+ ( isChroma( partitioner.chType ) ? 0.2 : 0.0 );
costTemp = m_pcRdCost->calcRdCost( uint64_t( m_CABACEstimator->getEstFracBits() + approxBits + ( ( bestCS->fracBits ) / factor ) ), Distortion( bestCS->dist / factor ) ) + bestCS->costDbOffset / factor;
}
#else
const double factor = ( tempCS->currQP[partitioner.chType] > 30 ? 1.1 : 1.075 );
else if ( m_pcEncCfg->getFastAdaptCostPredMode() == 1)
{
const double factor = ( tempCS->currQP[partitioner.chType] > 30 ? 1.1 : 1.075 )
+ (isChroma(partitioner.chType) ? 0.2 : 0.0);
costTemp = m_pcRdCost->calcRdCost( uint64_t( m_CABACEstimator->getEstFracBits() + ( ( bestCS->fracBits ) / factor ) ), Distortion( bestCS->dist / factor ) ) + bestCS->costDbOffset / factor;
}
else
{
#endif
const double factor = ( tempCS->currQP[partitioner.chType] > 30 ? 1.1 : 1.075 );
costTemp = m_pcRdCost->calcRdCost( uint64_t( m_CABACEstimator->getEstFracBits() + ( ( bestCS->fracBits ) / factor ) ), Distortion( bestCS->dist / factor ) ) + bestCS->costDbOffset / factor;
#if JVET_Y0126_PERFORMANCE
}
tempCS->useDbCost = m_pcEncCfg->getUseEncDbOpt();
if (!tempCS->useDbCost)
CHECK(bestCS->costDbOffset != 0, "error");
const double cost = m_pcRdCost->calcRdCost( uint64_t( m_CABACEstimator->getEstFracBits() + ( ( bestCS->fracBits ) / factor ) ), Distortion( bestCS->dist / factor ) ) + bestCS->costDbOffset / factor;
if( !tempCS->useDbCost )
CHECK( bestCS->costDbOffset != 0, "error" );
const double cost = costTemp;
#endif
m_CABACEstimator->getCtx() = SubCtx( Ctx::SplitFlag, ctxStartSP );
m_CABACEstimator->getCtx() = SubCtx( Ctx::SplitQtFlag, ctxStartQt );
......
......@@ -2022,32 +2022,33 @@ bool EncModeCtrlMTnoRQT::useModeResult( const EncTestMode& encTestmode, CodingSt
cuECtx.set( MAX_QT_SUB_DEPTH, maxQtD );
}
#if JVET_Y0126_PERFORMANCE
if ( !m_pcEncCfg->getUseFastDecisionTT() ) {
if( !m_pcEncCfg->getDisableFastDecisionTT() )
{
#endif
int maxMtD = tempCS->pcv->getMaxBtDepth(*tempCS->slice, partitioner.chType) + partitioner.currImplicitBtDepth;
if (encTestmode.type == ETM_SPLIT_BT_H)
{
if (tempCS->cus.size() > 2)
{
int h_2 = tempCS->area.blocks[partitioner.chType].height / 2;
int cu1_h = tempCS->cus.front()->blocks[partitioner.chType].height;
int cu2_h = tempCS->cus.back()->blocks[partitioner.chType].height;
cuECtx.set(DO_TRIH_SPLIT, cu1_h < h_2 || cu2_h < h_2 || partitioner.currMtDepth + 1 == maxMtD);
}
}
else if (encTestmode.type == ETM_SPLIT_BT_V)
{
if (tempCS->cus.size() > 2)
{
int w_2 = tempCS->area.blocks[partitioner.chType].width / 2;
int cu1_w = tempCS->cus.front()->blocks[partitioner.chType].width;
int cu2_w = tempCS->cus.back()->blocks[partitioner.chType].width;
cuECtx.set(DO_TRIV_SPLIT, cu1_w < w_2 || cu2_w < w_2 || partitioner.currMtDepth + 1 == maxMtD);
}
}
int maxMtD = tempCS->pcv->getMaxBtDepth( *tempCS->slice, partitioner.chType ) + partitioner.currImplicitBtDepth;
if( encTestmode.type == ETM_SPLIT_BT_H )
{
if( tempCS->cus.size() > 2 )
{
int h_2 = tempCS->area.blocks[partitioner.chType].height / 2;
int cu1_h = tempCS->cus.front()->blocks[partitioner.chType].height;
int cu2_h = tempCS->cus.back()->blocks[partitioner.chType].height;
cuECtx.set( DO_TRIH_SPLIT, cu1_h < h_2 || cu2_h < h_2 || partitioner.currMtDepth + 1 == maxMtD );
}
}
else if( encTestmode.type == ETM_SPLIT_BT_V )
{
if( tempCS->cus.size() > 2 )
{
int w_2 = tempCS->area.blocks[partitioner.chType].width / 2;
int cu1_w = tempCS->cus.front()->blocks[partitioner.chType].width;
int cu2_w = tempCS->cus.back()->blocks[partitioner.chType].width;
cuECtx.set( DO_TRIV_SPLIT, cu1_w < w_2 || cu2_w < w_2 || partitioner.currMtDepth + 1 == maxMtD );
}
}
#if JVET_Y0126_PERFORMANCE
}
#endif
......
Supports Markdown
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