Commit 86f7bbfd authored by Karsten Suehring's avatar Karsten Suehring

Merge branch 'ChromaQPOffsetDualTree' into 'master'

Increase chroma QP by 1 when trees are separate

See merge request jvet/VVCSoftware_BMS!13
parents 0b503fa4 6e38dbce
......@@ -172,6 +172,8 @@ Void EncApp::xInitLibCfg()
m_cEncLib.setDiffCuChromaQpOffsetDepth ( m_diffCuChromaQpOffsetDepth );
m_cEncLib.setChromaCbQpOffset ( m_cbQpOffset );
m_cEncLib.setChromaCrQpOffset ( m_crQpOffset );
m_cEncLib.setChromaCbQpOffsetDualTree ( m_cbQpOffsetDualTree );
m_cEncLib.setChromaCrQpOffsetDualTree ( m_crQpOffsetDualTree );
#if ER_CHROMA_QP_WCG_PPS
m_cEncLib.setWCGChromaQpControl ( m_wcgChromaQpControl );
#endif
......
......@@ -968,6 +968,8 @@ Bool EncAppCfg::parseCfg( Int argc, TChar* argv[] )
("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset")
("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset")
("CbQpOffsetDualTree", m_cbQpOffsetDualTree, 1, "Chroma Cb QP Offset for dual tree")
("CrQpOffsetDualTree", m_crQpOffsetDualTree, 1, "Chroma Cr QP Offset for dual tree")
#if ER_CHROMA_QP_WCG_PPS
("WCGPPSEnable", m_wcgChromaQpControl.enabled, false, "1: Enable the WCG PPS chroma modulation scheme. 0 (default) disabled")
("WCGPPSCbQpScale", m_wcgChromaQpControl.chromaCbQpScale, 1.0, "WCG PPS Chroma Cb QP Scale")
......@@ -2316,6 +2318,10 @@ Bool EncAppCfg::xCheckParameter()
xConfirmPara( m_cbQpOffset > 12, "Max. Chroma Cb QP Offset is 12" );
xConfirmPara( m_crQpOffset < -12, "Min. Chroma Cr QP Offset is -12" );
xConfirmPara( m_crQpOffset > 12, "Max. Chroma Cr QP Offset is 12" );
xConfirmPara( m_cbQpOffsetDualTree < -12, "Min. Chroma Cb QP Offset for dual tree is -12" );
xConfirmPara( m_cbQpOffsetDualTree > 12, "Max. Chroma Cb QP Offset for dual tree is 12" );
xConfirmPara( m_crQpOffsetDualTree < -12, "Min. Chroma Cr QP Offset for dual tree is -12" );
xConfirmPara( m_crQpOffsetDualTree > 12, "Max. Chroma Cr QP Offset for dual tree is 12" );
xConfirmPara( m_iQPAdaptationRange <= 0, "QP Adaptation Range must be more than 0" );
if (m_iDecodingRefreshType == 2)
......@@ -3077,8 +3083,8 @@ Void EncAppCfg::xPrintParameter()
#endif
msg( DETAILS, "Max dQP signaling depth : %d\n", m_iMaxCuDQPDepth);
msg( DETAILS, "Cb QP Offset : %d\n", m_cbQpOffset );
msg( DETAILS, "Cr QP Offset : %d\n", m_crQpOffset);
msg( DETAILS, "Cb QP Offset (dual tree) : %d (%d)\n", m_cbQpOffset, m_cbQpOffsetDualTree);
msg( DETAILS, "Cr QP Offset (dual tree) : %d (%d)\n", m_crQpOffset, m_crQpOffsetDualTree);
msg( DETAILS, "QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) );
msg( DETAILS, "GOP size : %d\n", m_iGOPSize );
msg( DETAILS, "Input bit depth : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] );
......
......@@ -172,6 +172,8 @@ protected:
Int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default)
Int m_crQpOffset; ///< Chroma Cr QP Offset (0:default)
int m_cbQpOffsetDualTree; ///< Chroma Cb QP Offset for dual tree (overwrite m_cbQpOffset for dual tree)
int m_crQpOffsetDualTree; ///< Chroma Cr QP Offset for dual tree (overwrite m_crQpOffset for dual tree)
#if ER_CHROMA_QP_WCG_PPS
WCGChromaQPControl m_wcgChromaQpControl; ///< Wide-colour-gamut chroma QP control.
#endif
......
......@@ -305,6 +305,8 @@ protected:
Int m_chromaCbQpOffset; // Chroma Cb QP Offset (0:default)
Int m_chromaCrQpOffset; // Chroma Cr Qp Offset (0:default)
int m_chromaCbQpOffsetDualTree; // Chroma Cb QP Offset for dual tree
int m_chromaCrQpOffsetDualTree; // Chroma Cr Qp Offset for dual tree
#if ER_CHROMA_QP_WCG_PPS
WCGChromaQPControl m_wcgChromaQpControl; ///< Wide-colour-gamut chroma QP control.
#endif
......@@ -832,6 +834,10 @@ public:
Void setChromaCbQpOffset ( Int i ) { m_chromaCbQpOffset = i; }
Void setChromaCrQpOffset ( Int i ) { m_chromaCrQpOffset = i; }
void setChromaCbQpOffsetDualTree ( int i ) { m_chromaCbQpOffsetDualTree = i; }
void setChromaCrQpOffsetDualTree ( int i ) { m_chromaCrQpOffsetDualTree = i; }
int getChromaCbQpOffsetDualTree () const { return m_chromaCbQpOffsetDualTree; }
int getChromaCrQpOffsetDualTree () const { return m_chromaCrQpOffsetDualTree; }
#if ER_CHROMA_QP_WCG_PPS
Void setWCGChromaQpControl ( const WCGChromaQPControl &ctrl ) { m_wcgChromaQpControl = ctrl; }
const WCGChromaQPControl &getWCGChromaQPControl () const { return m_wcgChromaQpControl; }
......
......@@ -2132,6 +2132,12 @@ Void EncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, PicList& rcListPic,
trySkipOrDecodePicture( decPic, encPic, *m_pcCfg, pcPic );
pcPic->cs->slice = pcSlice; // please keep this
if (pcSlice->getPPS()->getSliceChromaQpFlag() && CS::isDualITree(*pcSlice->getPic()->cs))
{
// overwrite chroma qp offset for dual tree
pcSlice->setSliceChromaQpDelta(COMPONENT_Cb, m_pcCfg->getChromaCbQpOffsetDualTree());
pcSlice->setSliceChromaQpDelta(COMPONENT_Cr, m_pcCfg->getChromaCrQpOffsetDualTree());
}
if( encPic )
// now compress (trial encode) the various slice segments (slices, and dependent slices)
{
......
......@@ -1318,6 +1318,10 @@ Void EncLib::xInitPPS(PPS &pps, const SPS &sps)
}
pps.setSliceChromaQpFlag(bChromaDeltaQPEnabled);
#endif
if (!pps.getSliceChromaQpFlag() && sps.getSpsNext().getUseDualITree())
{
pps.setSliceChromaQpFlag(m_chromaCbQpOffsetDualTree != 0 || m_chromaCrQpOffsetDualTree != 0);
}
#if HEVC_TILES_WPP
pps.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag );
......
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