diff --git a/source/Lib/CommonLib/DepQuant.cpp b/source/Lib/CommonLib/DepQuant.cpp index 2e6c36d3b8a19dbaaa9d4ec1f2b9905f7fddedf6..06b168d49d34180587b0b1a270779124527e44db 100644 --- a/source/Lib/CommonLib/DepQuant.cpp +++ b/source/Lib/CommonLib/DepQuant.cpp @@ -1573,10 +1573,11 @@ DepQuant::~DepQuant() void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pSrc, TCoeff &uiAbsSum, const QpParam &cQP, const Ctx& ctx ) { + const bool useRegularResidualCoding = tu.cu->slice->getTSResidualCodingDisabledFlag() || tu.mtsIdx[compID] != MTS_SKIP; #if JVET_R0271_SLICE_LEVEL_DQ_SDH_RRC - if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.cu->slice->getTSResidualCodingDisabledFlag() || tu.mtsIdx[compID] != MTS_SKIP) ) + if( tu.cs->slice->getDepQuantEnabledFlag() && useRegularResidualCoding ) #else - if( tu.cs->picHeader->getDepQuantEnabledFlag() && (tu.cu->slice->getTSResidualCodingDisabledFlag() || tu.mtsIdx[compID] != MTS_SKIP) ) + if( tu.cs->picHeader->getDepQuantEnabledFlag() && useRegularResidualCoding ) #endif { //===== scaling matrix ==== @@ -1603,10 +1604,11 @@ void DepQuant::quant( TransformUnit &tu, const ComponentID &compID, const CCoeff void DepQuant::dequant( const TransformUnit &tu, CoeffBuf &dstCoeff, const ComponentID &compID, const QpParam &cQP ) { + const bool useRegularResidualCoding = tu.cu->slice->getTSResidualCodingDisabledFlag() || tu.mtsIdx[compID] != MTS_SKIP; #if JVET_R0271_SLICE_LEVEL_DQ_SDH_RRC - if( tu.cs->slice->getDepQuantEnabledFlag() && (tu.cu->slice->getTSResidualCodingDisabledFlag() || tu.mtsIdx[compID] != MTS_SKIP) ) + if( tu.cs->slice->getDepQuantEnabledFlag() && useRegularResidualCoding ) #else - if( tu.cs->picHeader->getDepQuantEnabledFlag() && (tu.cu->slice->getTSResidualCodingDisabledFlag() || tu.mtsIdx[compID] != MTS_SKIP) ) + if( tu.cs->picHeader->getDepQuantEnabledFlag() && useRegularResidualCoding ) #endif { const int qpDQ = cQP.Qp(tu.mtsIdx[compID] == MTS_SKIP) + 1;