Commit a2932e98 authored by Christopher Hollmann's avatar Christopher Hollmann
Browse files

JVET-R0143: Disable TSRC for lossless coding via configuration parameter

parent a4adea01
......@@ -20,3 +20,5 @@ BIO : 0
PROF : 0
Log2MaxTbSize : 5
InternalBitDepth : 0
TSRCdisableLL : 1
......@@ -2660,6 +2660,12 @@ Specifies location of a chroma sample relatively to the luma sample in vertical
\end{tabular}
\\
\Option{TSRCdisableLL} &
%\ShortOption{\None} &
\Default{1} &
Enables or disables the use of Transform Skip Residual Coding for lossless compression.
\\
\end{OptionTableNoShorthand}
%%
......
......@@ -748,6 +748,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setInitialCpbFullness ( m_RCInitialCpbFullness );
#endif
m_cEncLib.setCostMode ( m_costMode );
#if JVET_R0143_TSRCdisableLL
m_cEncLib.setTSRCdisableLL ( m_TSRCdisableLL );
#endif
m_cEncLib.setUseRecalculateQPAccordingToLambda ( m_recalculateQPAccordingToLambda );
m_cEncLib.setDCIEnabled ( m_DCIEnabled );
m_cEncLib.setVuiParametersPresentFlag ( m_vuiParametersPresentFlag );
......
......@@ -1138,6 +1138,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
( "RCInitialCpbFullness", m_RCInitialCpbFullness, 0.9, "Rate control: initial CPB fullness" )
#endif
("CostMode", m_costMode, COST_STANDARD_LOSSY, "Use alternative cost functions: choose between 'lossy', 'sequence_level_lossless', 'lossless' (which forces QP to " MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP) ") and 'mixed_lossless_lossy' (which used QP'=" MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME) " for pre-estimates of transquant-bypass blocks).")
#if JVET_R0143_TSRCdisableLL
("TSRCdisableLL", m_TSRCdisableLL, true, "Disable TSRC for lossless coding" )
#endif
("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case")
("HrdParametersPresent,-hrd", m_hrdParametersPresentFlag, false, "Enable generation of hrd_parameters()")
("VuiParametersPresent,-vui", m_vuiParametersPresentFlag, false, "Enable generation of vui_parameters()")
......
......@@ -622,6 +622,9 @@ protected:
std::string m_scalingListFileName; ///< quantization matrix file name
bool m_disableScalingMatrixForLfnstBlks;
CostMode m_costMode; ///< Cost mode to use
#if JVET_R0143_TSRCdisableLL
bool m_TSRCdisableLL; ///< disable TSRC for lossless
#endif
bool m_recalculateQPAccordingToLambda; ///< recalculate QP value according to the lambda value
......
......@@ -52,6 +52,8 @@
//########### place macros to be removed in next cycle below this line ###############
#define JVET_R0143_TSRCdisableLL 1 // JVET-R0143: disable TSRC for lossless coding
#define JVET_R0233_CCALF_LINE_BUFFER_REDUCTION 1 // JVET-R0233 method 2: Line buffer reduction for CCALF
#define JVET_Q0471_CHROMA_QT_SPLIT 1 // JVET-Q0471: Chroma QT split
......
......@@ -651,7 +651,9 @@ protected:
double m_RCInitialCpbFullness;
#endif
CostMode m_costMode; ///< The cost function to use, primarily when considering lossless coding.
#if JVET_R0143_TSRCdisableLL
bool m_TSRCdisableLL; ///< Disable TSRC for lossless
#endif
DCI m_dci;
bool m_DCIEnabled; ///< enable Decoding Capability Information (DCI)
......@@ -1687,8 +1689,10 @@ public:
#endif
CostMode getCostMode( ) const { return m_costMode; }
void setCostMode(CostMode m ) { m_costMode = m; }
#if JVET_R0143_TSRCdisableLL
bool getTSRCdisableLL () { return m_TSRCdisableLL; }
void setTSRCdisableLL ( bool b ) { m_TSRCdisableLL = b; }
#endif
void setDCI(DCI *p) { m_dci = *p; }
DCI* getDCI() { return &m_dci; }
......
......@@ -339,7 +339,11 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
picHeader->setPicOutputFlag(true);
}
rpcSlice->setPOC( pocCurr );
#if JVET_R0143_TSRCdisableLL
if( ( m_pcCfg->getCostMode() == COST_LOSSLESS_CODING ) && m_pcCfg->getTSRCdisableLL() )
#else
if( m_pcCfg->getCostMode() == COST_LOSSLESS_CODING )
#endif
{
rpcSlice->setTSResidualCodingDisabledFlag(true);
}
......
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