diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index c1dced4d8f8f5cebe1aa840de1b79598ec009e98..02dbc955a35626231d80ad54249708d9356828d8 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -2214,6 +2214,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) #else if (((int)m_fQP < 38) && m_bUsePerceptQPA && !m_bUseAdaptiveQP && (m_iSourceWidth <= 2048) && (m_iSourceHeight <= 1280) #endif + #if WCG_EXT && ER_CHROMA_QP_WCG_PPS + && (!m_wcgChromaQpControl.enabled) + #endif #if MAX_TB_SIZE_SIGNALLING && ((1 << (m_log2MaxTbSize + 1)) == m_uiCTUSize) && (m_iSourceWidth > 512 || m_iSourceHeight > 320)) #else diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index b32a868382234ffd2bbf947dea7849274c6cf45d..8836fa7ec12eef02966b3c03044f616e30b6ef23 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -800,7 +800,11 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par #endif if (currTestMode.qp >= 0) { - updateLambda (&slice, currTestMode.qp, CS::isDualITree (*tempCS) || (partitioner.currDepth == 0)); + updateLambda (&slice, currTestMode.qp, + #if WCG_EXT && ER_CHROMA_QP_WCG_PPS + m_pcEncCfg->getWCGChromaQPControl().isEnabled(), + #endif + CS::isDualITree (*tempCS) || (partitioner.currDepth == 0)); } } #endif @@ -1077,9 +1081,15 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par } #if SHARP_LUMA_DELTA_QP || ENABLE_QPA_SUB_CTU -void EncCu::updateLambda (Slice* slice, const int dQP, const bool updateRdCostLambda) +void EncCu::updateLambda (Slice* slice, const int dQP, + #if WCG_EXT && ER_CHROMA_QP_WCG_PPS + const bool useWCGChromaControl, + #endif + const bool updateRdCostLambda) { -#if WCG_EXT && !ENABLE_QPA_SUB_CTU +#if WCG_EXT && ER_CHROMA_QP_WCG_PPS + if (useWCGChromaControl) + { int NumberBFrames = ( m_pcEncCfg->getGOPSize() - 1 ); int SHIFT_QP = 12; double dLambda_scale = 1.0 - Clip3( 0.0, 0.5, 0.05*(double)(slice->getPic()->fieldPic ? NumberBFrames/2 : NumberBFrames) ); @@ -1144,7 +1154,9 @@ void EncCu::updateLambda (Slice* slice, const int dQP, const bool updateRdCostLa int iQP = Clip3(-qpBDoffset, MAX_QP, (int)floor((double)dQP + 0.5)); m_pcSliceEncoder->setUpLambda(slice, dLambda, iQP); -#else + return; + } +#endif int iQP = dQP; const double oldQP = (double)slice->getSliceQpBase(); #if ENABLE_QPA_SUB_CTU @@ -1165,9 +1177,8 @@ void EncCu::updateLambda (Slice* slice, const int dQP, const bool updateRdCostLa { m_pcRdCost->setLambda (newLambda, slice->getSPS()->getBitDepths()); } -#endif } -#endif +#endif // SHARP_LUMA_DELTA_QP || ENABLE_QPA_SUB_CTU #if ENABLE_SPLIT_PARALLELISM //#undef DEBUG_PARALLEL_TIMINGS diff --git a/source/Lib/EncoderLib/EncCu.h b/source/Lib/EncoderLib/EncCu.h index 41a449efbb1fa22ad1a72873b2666f2a9a2df2e9..5a50a1c513beecc4a8c6fe16721721ab4c67dea6 100644 --- a/source/Lib/EncoderLib/EncCu.h +++ b/source/Lib/EncoderLib/EncCu.h @@ -142,9 +142,13 @@ private: int m_bestGbiIdx[2]; double m_bestGbiCost[2]; TriangleMotionInfo m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS]; - uint8_t m_triangleIdxBins[2][TRIANGLE_MAX_NUM_UNI_CANDS][TRIANGLE_MAX_NUM_UNI_CANDS]; + uint8_t m_triangleIdxBins[2][TRIANGLE_MAX_NUM_UNI_CANDS][TRIANGLE_MAX_NUM_UNI_CANDS]; #if SHARP_LUMA_DELTA_QP || ENABLE_QPA_SUB_CTU - void updateLambda ( Slice* slice, const int dQP, const bool updateRdCostLambda ); + void updateLambda ( Slice* slice, const int dQP, + #if WCG_EXT && ER_CHROMA_QP_WCG_PPS + const bool useWCGChromaControl, + #endif + const bool updateRdCostLambda ); #endif double m_sbtCostSave[2]; public: