diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 99a0accfc1c82332738121c3c58236120036bb76..a8a24e85ca0a1dc206a68bed46084151e4e45e59 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -61,9 +61,7 @@ Slice::Slice() , m_eSliceType ( I_SLICE ) , m_iSliceQp ( 0 ) , m_ChromaQpAdjEnabled ( false ) -#if JVET_Q0346_LMCS_ENABLE_IN_SH , m_lmcsEnabledFlag ( 0 ) -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH , m_explicitScalingListUsed ( 0 ) #endif @@ -167,9 +165,7 @@ void Slice::initSlice() m_colFromL0Flag = true; m_colourPlaneId = 0; m_colRefIdx = 0; -#if JVET_Q0346_LMCS_ENABLE_IN_SH m_lmcsEnabledFlag = 0; -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH m_explicitScalingListUsed = 0; #endif @@ -1023,9 +1019,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll) m_independentSliceIdx = pSrc->m_independentSliceIdx; m_nextSlice = pSrc->m_nextSlice; m_clpRngs = pSrc->m_clpRngs; -#if JVET_Q0346_LMCS_ENABLE_IN_SH m_lmcsEnabledFlag = pSrc->m_lmcsEnabledFlag; -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH m_explicitScalingListUsed = pSrc->m_explicitScalingListUsed; #endif diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 34b58a56a4168df094e76d8bf019e16cded63248..924851a43de3f867612f141883b374af1e541726 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -2552,9 +2552,7 @@ private: int m_iSliceQp; int m_iSliceQpBase; bool m_ChromaQpAdjEnabled; -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool m_lmcsEnabledFlag; -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH bool m_explicitScalingListUsed; #endif @@ -2708,11 +2706,9 @@ public: bool getPendingRasInit() const { return m_pendingRasInit; } void setPendingRasInit( bool val ) { m_pendingRasInit = val; } -#if JVET_Q0346_LMCS_ENABLE_IN_SH void setLmcsEnabledFlag(bool b) { m_lmcsEnabledFlag = b; } bool getLmcsEnabledFlag() { return m_lmcsEnabledFlag; } const bool getLmcsEnabledFlag() const { return m_lmcsEnabledFlag; } -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH void setExplicitScalingListUsed(bool b) { m_explicitScalingListUsed = b; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 3a09d8840880a33b3e777f7589903bb72f70bd38..9fb0fc6c34ea79b6b1df08e1846440af02d55bc4 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -132,7 +132,6 @@ -#define JVET_Q0346_LMCS_ENABLE_IN_SH 1 // JVET-Q0346 aspect 1: LMCS enabled flag in SH #define JVET_Q0346_SCALING_LIST_USED_IN_SH 1 // JVET-Q0346 aspect 2: Scaling list used flag in SH diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index e59c44ea7ac0730d23e001a636fb765acb5428e6..ffd9bb8cfbf1938bbd4fb3547b3cf55a8951699b 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -241,11 +241,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) } } const Slice &slice = *cs.slice; -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); -#else - bool flag = slice.getPicHeader()->getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); -#endif if (flag && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (compID != COMPONENT_Y) && (tu.cbf[COMPONENT_Cb] || tu.cbf[COMPONENT_Cr])) { const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size())); @@ -311,11 +307,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); PelBuf tmpPred; #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#endif { #if REUSE_CU_RESULTS { @@ -332,11 +324,7 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) #if !KEEP_PRED_AND_RESI_SIGNALS pReco.copyFrom( piPred ); #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#endif { #if REUSE_CU_RESULTS { @@ -364,11 +352,7 @@ void DecCu::xIntraRecACTBlk(TransformUnit& tu) CHECK(tu.cu->ispMode, "adaptive color transform cannot be applied to ISP"); CHECK(pu.intraDir[CHANNEL_TYPE_CHROMA] != DM_CHROMA_IDX, "chroma should use DM mode for adaptive color transform"); -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); -#else - bool flag = slice.getPicHeader()->getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); -#endif if (flag && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (tu.cbf[COMPONENT_Cb] || tu.cbf[COMPONENT_Cr])) { const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size())); @@ -450,11 +434,7 @@ void DecCu::xIntraRecACTBlk(TransformUnit& tu) PelBuf piReco = cs.getRecoBuf(area); PelBuf tmpPred; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#endif { CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); tmpPred = m_tmpStorageLCU->getBuf(tmpArea); @@ -464,11 +444,7 @@ void DecCu::xIntraRecACTBlk(TransformUnit& tu) piPred.reconstruct(piPred, piResi, tu.cu->cs->slice->clpRng(compID)); piReco.copyFrom(piPred); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || slice.isIntra()) && compID == COMPONENT_Y) -#endif { piPred.copyFrom(tmpPred); } @@ -717,11 +693,7 @@ void DecCu::xReconInter(CodingUnit &cu) if (cu.firstPU->ciipFlag) { -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (cu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { cu.cs->getPredBuf(*cu.firstPU).Y().rspSignal(m_pcReshape->getFwdLUT()); } @@ -753,11 +725,7 @@ void DecCu::xReconInter(CodingUnit &cu) CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); PelBuf tmpPred; #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { #if REUSE_CU_RESULTS if (cs.pcv->isEncoder) @@ -775,11 +743,7 @@ void DecCu::xReconInter(CodingUnit &cu) cs.getResiBuf( cu ).reconstruct( cs.getPredBuf( cu ), cs.getResiBuf( cu ), cs.slice->clpRngs() ); cs.getRecoBuf( cu ).copyFrom ( cs.getResiBuf( cu ) ); #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { #if REUSE_CU_RESULTS if (cs.pcv->isEncoder) @@ -792,11 +756,7 @@ void DecCu::xReconInter(CodingUnit &cu) else { cs.getRecoBuf(cu).copyClip(cs.getPredBuf(cu), cs.slice->clpRngs()); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && !cu.firstPU->ciipFlag && !CU::isIBC(cu)) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && !cu.firstPU->ciipFlag && !CU::isIBC(cu)) -#endif { cs.getRecoBuf(cu).get(COMPONENT_Y).rspSignal(m_pcReshape->getFwdLUT()); } @@ -850,13 +810,8 @@ void DecCu::xDecodeInterTU( TransformUnit & currTU, const ComponentID compID ) //===== reconstruction ===== const Slice &slice = *cs.slice; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && isChroma(compID) && (TU::getCbf(currTU, compID) || currTU.jointCbCr) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && currTU.blocks[compID].width * currTU.blocks[compID].height > 4) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && (TU::getCbf(currTU, compID) || currTU.jointCbCr) - && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && currTU.blocks[compID].width * currTU.blocks[compID].height > 4) -#endif { resiBuf.scaleSignal(currTU.getChromaAdj(), 0, currTU.cu->cs->slice->clpRng(compID)); } @@ -885,11 +840,7 @@ void DecCu::xDecodeInterTexture(CodingUnit &cu) { CodingStructure &cs = *cu.cs; const Slice &slice = *cs.slice; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (compID == COMPONENT_Y) && (currTU.cbf[COMPONENT_Cb] || currTU.cbf[COMPONENT_Cr])) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (compID == COMPONENT_Y) && (currTU.cbf[COMPONENT_Cb] || currTU.cbf[COMPONENT_Cr])) -#endif { const CompArea &areaY = currTU.blocks[COMPONENT_Y]; int adj = m_pcReshape->calculateChromaAdjVpduNei(currTU, areaY); diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp index 997b1715529d15ff9a67f62fb2ac360ddffb5944..b82f7362ef658491b4e0556e35b7dffa7e968422 100644 --- a/source/Lib/DecoderLib/DecLib.cpp +++ b/source/Lib/DecoderLib/DecLib.cpp @@ -2072,11 +2072,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl { if (m_bFirstSliceInPicture) m_sliceLmcsApsId = -1; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pcSlice->getLmcsEnabledFlag()) -#else - if (pcSlice->getPicHeader()->getLmcsEnabledFlag()) -#endif { APS* lmcsAPS = pcSlice->getPicHeader()->getLmcsAPS(); if (m_sliceLmcsApsId == -1) @@ -2094,11 +2090,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl memcpy(tInfo.reshaperModelBinCWDelta, sInfo.reshaperModelBinCWDelta, sizeof(int)*(PIC_CODE_CW_BINS)); tInfo.maxNbitsNeededDeltaCW = sInfo.maxNbitsNeededDeltaCW; tInfo.chrResScalingOffset = sInfo.chrResScalingOffset; -#if JVET_Q0346_LMCS_ENABLE_IN_SH tInfo.setUseSliceReshaper(pcSlice->getLmcsEnabledFlag()); -#else - tInfo.setUseSliceReshaper(pcSlice->getPicHeader()->getLmcsEnabledFlag()); -#endif tInfo.setSliceReshapeChromaAdj(pcSlice->getPicHeader()->getLmcsChromaResidualScaleFlag()); tInfo.setSliceReshapeModelPresentFlag(true); } @@ -2109,11 +2101,7 @@ bool DecLib::xDecodeSlice(InputNALUnit &nalu, int &iSkipFrame, int iPOCLastDispl tInfo.setSliceReshapeChromaAdj(false); tInfo.setSliceReshapeModelPresentFlag(false); } -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pcSlice->getLmcsEnabledFlag()) -#else - if (pcSlice->getPicHeader()->getLmcsEnabledFlag()) -#endif { m_cReshaper.constructReshaper(); } diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 6d232436041f894e800f35ca33d5a5827da55b52..4a8fb5908f976ef31469097143364172c62d659b 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -3953,7 +3953,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, PicHeader* picHeader, Par READ_FLAG(uiCode, "slice_ts_residual_coding_disabled_flag"); pcSlice->setTSResidualCodingDisabledFlag(uiCode != 0); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (picHeader->getLmcsEnabledFlag()) { READ_FLAG(uiCode, "slice_lmcs_enabled_flag"); @@ -3963,7 +3962,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, PicHeader* picHeader, Par { pcSlice->setLmcsEnabledFlag(false); } -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH if (picHeader->getExplicitScalingListEnabledFlag()) { diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index c3fcef15b76a3ecb2cc75fecc566f54ef792f46b..3f4df464df3aff7041ecdf3ce0094d96542da894 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -2260,11 +2260,7 @@ void EncCu::xFillPCMBuffer( CodingUnit &cu ) const CPelBuf source = tu.cs->getOrgBuf( compArea ); PelBuf destination = tu.getPcmbuf( compID ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (tu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#else - if (tu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#endif { CompArea tmpArea(COMPONENT_Y, compArea.chromaFormat, Position(0, 0), compArea.size()); PelBuf tempOrgBuf = m_tmpStorageLCU->getBuf(tmpArea); @@ -2575,32 +2571,20 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& m_pcIntraSearch->switchBuffer(pu, COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt)); } pu.cs->getPredBuf(pu).copyFrom(acMergeTmpBuffer[mergeCand]); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (pu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT()); } m_pcIntraSearch->geneWeightedPred(COMPONENT_Y, pu.cs->getPredBuf(pu).Y(), pu, m_pcIntraSearch->getPredictorPtr2(COMPONENT_Y, intraCnt)); // calculate cost -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (pu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getInvLUT()); } distParam.cur = pu.cs->getPredBuf(pu).Y(); Distortion sadValue = distParam.distFunc(distParam); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (pu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { pu.cs->getPredBuf(pu).Y().rspSignal(m_pcReshape->getFwdLUT()); } @@ -2812,11 +2796,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *& uint32_t bufIdx = 0; PelBuf tmpBuf = tempCS->getPredBuf(pu).Y(); tmpBuf.copyFrom(acMergeTmpBuffer[uiMergeCand].Y()); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (pu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { tmpBuf.rspSignal(m_pcReshape->getFwdLUT()); } @@ -3791,11 +3771,7 @@ void EncCu::xCheckRDCostIBCModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct Picture* refPic = pu.cu->slice->getPic(); const CPelBuf refBuf = refPic->getRecoBuf(pu.blocks[COMPONENT_Y]); const Pel* piRefSrch = refBuf.buf; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (tempCS->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (tempCS->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() ) -#endif { const CompArea &area = cu.blocks[COMPONENT_Y]; CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); @@ -4430,11 +4406,7 @@ void EncCu::xCalDebCost( CodingStructure &cs, Partitioner &partitioner, bool cal //Copy current CU's reco to Deblock Pic Buffer const CompArea& curCompArea = currCsArea.block( compId ); picDbBuf.getBuf( curCompArea ).copyFrom( cs.getRecoBuf( curCompArea ) ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId)) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId)) -#endif { picDbBuf.getBuf( curCompArea ).rspSignal( m_pcReshape->getInvLUT() ); } @@ -4444,11 +4416,7 @@ void EncCu::xCalDebCost( CodingStructure &cs, Partitioner &partitioner, bool cal { const CompArea& compArea = areaLeft.block(compId); picDbBuf.getBuf( compArea ).copyFrom( cs.picture->getRecoBuf( compArea ) ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId)) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId)) -#endif { picDbBuf.getBuf( compArea ).rspSignal( m_pcReshape->getInvLUT() ); } @@ -4458,11 +4426,7 @@ void EncCu::xCalDebCost( CodingStructure &cs, Partitioner &partitioner, bool cal { const CompArea& compArea = areaTop.block( compId ); picDbBuf.getBuf( compArea ).copyFrom( cs.picture->getRecoBuf( compArea ) ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId)) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getSliceReshaperInfo().getUseSliceReshaper() && isLuma(compId)) -#endif { picDbBuf.getBuf( compArea ).rspSignal( m_pcReshape->getInvLUT() ); } @@ -4533,13 +4497,8 @@ Distortion EncCu::getDistortionDb( CodingStructure &cs, CPelBuf org, CPelBuf rec #if WCG_EXT m_pcRdCost->setChromaFormat(cs.sps->getChromaFormatIdc()); CPelBuf orgLuma = cs.picture->getOrigBuf( cs.area.blocks[COMPONENT_Y] ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#else - if ( m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( - m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#endif { if ( compID == COMPONENT_Y && !afterDb && !m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()) { @@ -4554,11 +4513,7 @@ Distortion EncCu::getDistortionDb( CodingStructure &cs, CPelBuf org, CPelBuf rec dist += m_pcRdCost->getDistPart( org, reco, cs.sps->getBitDepth( toChannelType( compID ) ), compID, DF_SSE_WTD, &orgLuma ); } } -#if JVET_Q0346_LMCS_ENABLE_IN_SH else if (m_pcEncCfg->getLmcs() && cs.slice->getLmcsEnabledFlag() && cs.slice->isIntra()) //intra slice -#else - else if (m_pcEncCfg->getLmcs() && cs.picHeader->getLmcsEnabledFlag() && cs.slice->isIntra()) //intra slice -#endif { if ( compID == COMPONENT_Y && afterDb ) { @@ -5051,13 +5006,8 @@ void EncCu::xReuseCachedResult( CodingStructure *&tempCS, CodingStructure *&best CPelBuf org = tempCS->getOrgBuf ( compID ); #if WCG_EXT -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( m_pcEncCfg->getLmcs() && (tempCS->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( - m_pcEncCfg->getLmcs() && (tempCS->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#endif { const CPelBuf orgLuma = tempCS->getOrgBuf(tempCS->area.blocks[COMPONENT_Y]); if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index 8e069e88b178fc2863138006ed8103e777a15964..ebfeae2d556f1918c9366da5f99ff12ce3e4ac7b 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -1842,15 +1842,6 @@ void EncGOP::xPicInitLMCS(Picture *pic, PicHeader *picHeader, Slice *slice) m_pcReshaper->setCTUFlag(false); -#if !JVET_Q0346_LMCS_ENABLE_IN_SH - //reshape original signal - if (m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()) - { - pic->getOrigBuf(COMPONENT_Y).rspSignal(m_pcReshaper->getFwdLUT()); - m_pcReshaper->setSrcReshaped(true); - m_pcReshaper->setRecReshaped(true); - } -#endif } else { @@ -1885,9 +1876,7 @@ void EncGOP::xPicInitLMCS(Picture *pic, PicHeader *picHeader, Slice *slice) //set all necessary information in LMCS APS and picture header picHeader->setLmcsEnabledFlag(m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()); -#if JVET_Q0346_LMCS_ENABLE_IN_SH slice->setLmcsEnabledFlag(m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()); -#endif picHeader->setLmcsChromaResidualScaleFlag(m_pcReshaper->getSliceReshaperInfo().getSliceReshapeChromaAdj() == 1); if (m_pcReshaper->getSliceReshaperInfo().getSliceReshapeModelPresentFlag()) { @@ -2761,7 +2750,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, pcSlice->setSliceSubPicId( pcPic->cs->pps->getSubPic( subPicIdx ).getSubPicID() ); } -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (pcPic->cs->sps->getUseLmcs()) { pcSlice->setLmcsEnabledFlag(picHeader->getLmcsEnabledFlag()); @@ -2782,7 +2770,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, } } } -#endif m_pcSliceEncoder->precompressSlice( pcPic ); m_pcSliceEncoder->compressSlice ( pcPic, false, false ); @@ -2807,7 +2794,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, CodingStructure& cs = *pcPic->cs; pcSlice = pcPic->slices[0]; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.sps->getUseLmcs() && m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()) { picHeader->setLmcsEnabledFlag(true); @@ -2832,23 +2818,6 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, m_pcReshaper->setRecReshaped(false); pcPic->getOrigBuf().copyFrom(pcPic->getTrueOrigBuf()); } -#else - if (pcSlice->getSPS()->getUseLmcs() && m_pcReshaper->getSliceReshaperInfo().getUseSliceReshaper()) - { - picHeader->setLmcsEnabledFlag(true); -#if JVET_Q0346_LMCS_ENABLE_IN_SH - pcSlice->setLmcsEnabledFlag(true); -#endif - int apsId = std::min<int>( 3, m_pcEncLib->getVPS() == nullptr ? 0 : m_pcEncLib->getVPS()->getGeneralLayerIdx( m_pcEncLib->getLayerId() ) ); - - picHeader->setLmcsAPSId(apsId); - CHECK((m_pcReshaper->getRecReshaped() == false), "Rec picture is not reshaped!"); - pcPic->getRecoBuf(COMPONENT_Y).rspSignal(m_pcReshaper->getInvLUT()); - m_pcReshaper->setRecReshaped(false); - - pcPic->getOrigBuf().copyFrom(pcPic->getTrueOrigBuf()); - } -#endif // create SAO object based on the picture size if( pcSlice->getSPS()->getSAOEnabledFlag() ) diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index d677b6f54c560c0b57c2aa30f4e8c4497c2892f6..dc620443125975ddf8ef52d0098cd2db68219118 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -1264,11 +1264,7 @@ void InterSearch::xIBCEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, CPelBuf* pcPatternKey = &tmpPattern; PelBuf tmpOrgLuma; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if ((pu.cs->slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#else - if ((pu.cs->picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#endif { const CompArea &area = pu.blocks[COMPONENT_Y]; CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); @@ -6500,11 +6496,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par const UnitArea relativeUnitArea(tu.chromaFormat, Area(tuPos, tu.Y().size())); const Slice &slice = *cs.slice; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && !(CS::isDualITree(cs) && slice.isIntra() && tu.cu->predMode == MODE_IBC)) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && !(CS::isDualITree(cs) && slice.isIntra() && tu.cu->predMode==MODE_IBC )) -#endif { const CompArea &areaY = tu.blocks[COMPONENT_Y]; int adj = m_pcReshape->calculateChromaAdjVpduNei(tu, areaY); @@ -6653,11 +6645,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par #if RDOQ_CHROMA_LAMBDA m_pcTrQuant->selectLambda(compID); #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag()) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag()) -#endif { double cRescale = (double)(1 << CSCALE_FP_PREC) / (double)(tu.getChromaAdj()); m_pcTrQuant->setLambda(m_pcTrQuant->getLambda() / (cRescale*cRescale)); @@ -6682,11 +6670,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par crossComponentPrediction( tu, compID, lumaResi, resiBuf, resiBuf, false ); } #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width * tu.blocks[compID].height > 4) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4) -#endif { PelBuf resiBuf = csFull->getResiBuf(compArea); resiBuf.scaleSignal(tu.getChromaAdj(), 1, tu.cu->cs->slice->clpRng(compID)); @@ -6818,11 +6802,7 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par CPelBuf orgResiBuf = csFull->getOrgResiBuf(compArea); m_pcTrQuant->invTransformNxN(tu, compID, resiBuf, cQP); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width * tu.blocks[compID].height > 4) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[compID].width*tu.blocks[compID].height > 4) -#endif { resiBuf.scaleSignal(tu.getChromaAdj(), 0, tu.cu->cs->slice->clpRng(compID)); } @@ -6947,13 +6927,8 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par (TU::getCbf(tu, COMPONENT_Cr) && tu.mtsIdx[COMPONENT_Cr] == MTS_SKIP && !TU::getCbf(tu, COMPONENT_Cb)) || (TU::getCbf(tu, COMPONENT_Cb) && tu.mtsIdx[COMPONENT_Cb] == MTS_SKIP && TU::getCbf(tu, COMPONENT_Cr) && tu.mtsIdx[COMPONENT_Cr] == MTS_SKIP); const int channelBitDepth = sps.getBitDepth(toChannelType(COMPONENT_Cb)); -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool reshape = slice.getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && tu.blocks[COMPONENT_Cb].width * tu.blocks[COMPONENT_Cb].height > 4; -#else - bool reshape = slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() - && tu.blocks[COMPONENT_Cb].width * tu.blocks[COMPONENT_Cb].height > 4; -#endif double minCostCbCr = minCost[COMPONENT_Cb] + minCost[COMPONENT_Cr]; if (colorTransFlag) { @@ -7371,11 +7346,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa cs.getResiBuf().fill(0); { cs.getRecoBuf().copyFrom(cs.getPredBuf() ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) && !cu.firstPU->ciipFlag && !CU::isIBC(cu)) -#else - if (m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) && !cu.firstPU->ciipFlag && !CU::isIBC(cu)) -#endif { cs.getRecoBuf().Y().rspSignal(m_pcReshape->getFwdLUT()); } @@ -7396,13 +7367,8 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa CPelBuf reco = cs.getRecoBuf (compID); CPelBuf org = cs.getOrgBuf (compID); #if WCG_EXT -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( - m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) ) -#endif { const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] ); if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) @@ -7440,11 +7406,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa if (luma) { cs.getResiBuf().bufs[0].copyFrom(cs.getOrgBuf().bufs[0]); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { const CompArea &areaY = cu.Y(); CompArea tmpArea(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size()); @@ -7698,11 +7660,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa if (luma) { -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cu.rootCbf && cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (cu.rootCbf && cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { const CompArea &areaY = cu.Y(); CompArea tmpArea(COMPONENT_Y, areaY.chromaFormat, Position(0, 0), areaY.size()); @@ -7717,11 +7675,7 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa else { cs.getRecoBuf().bufs[0].reconstruct(cs.getPredBuf().bufs[0], cs.getResiBuf().bufs[0], cs.slice->clpRngs().comp[0]); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && !cu.firstPU->ciipFlag && !CU::isIBC(cu)) -#else - if (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && !cu.firstPU->ciipFlag && !CU::isIBC(cu)) -#endif { cs.getRecoBuf().bufs[0].rspSignal(m_pcReshape->getFwdLUT()); } @@ -7747,13 +7701,8 @@ void InterSearch::encodeResAndCalcRdInterCU(CodingStructure &cs, Partitioner &pa CPelBuf org = cs.getOrgBuf (compID); #if WCG_EXT -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( - m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#endif { const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] ); if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled()) ) diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index 7249f3cce0033b21480e50bcd44588f9d21c8577..662028dea9c0b735fe6078de461fe7d2a8720538 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -515,11 +515,7 @@ bool IntraSearch::estIntraPredLumaQT(CodingUnit &cu, Partitioner &partitioner, c DistParam distParamSad; DistParam distParamHad; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (cu.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#else - if (cu.slice->getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()) -#endif { CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); PelBuf tmpOrg = m_tmpStorageLCU.getBuf(tmpArea); @@ -1572,11 +1568,7 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo TransformUnit &tu = *cs.getTU(partitioner.chType); uint32_t height = cu.block(compBegin).height; uint32_t width = cu.block(compBegin).width; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#else - if (m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#endif { cs.getPredBuf().copyFrom(cs.getOrgBuf()); cs.getPredBuf().Y().rspSignal(m_pcReshape->getFwdLUT()); @@ -1716,13 +1708,8 @@ void IntraSearch::PLTSearch(CodingStructure &cs, Partitioner& partitioner, Compo CPelBuf reco = cs.getRecoBuf(compID); CPelBuf org = cs.getOrgBuf(compID); #if WCG_EXT -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || ( - m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag()))) -#endif { const CPelBuf orgLuma = cs.getOrgBuf(cs.area.blocks[COMPONENT_Y]); @@ -1797,11 +1784,7 @@ void IntraSearch::preCalcPLTIndexRD(CodingStructure& cs, Partitioner& partitione for (int comp = compBegin; comp < (compBegin + numComp); comp++) { CompArea area = cu.blocks[comp]; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#else - if (m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#endif { orgBuf[comp] = cs.getPredBuf(area); } @@ -2305,11 +2288,7 @@ void IntraSearch::calcPixelPred(CodingStructure& cs, Partitioner& partitioner, u for (int comp = compBegin; comp < (compBegin + numComp); comp++) { CompArea area = cu.blocks[comp]; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#else - if (m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#endif { orgBuf[comp] = cs.getPredBuf(area); } @@ -2408,11 +2387,7 @@ void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, for (int comp = compBegin; comp < (compBegin + numComp); comp++) { CompArea area = cu.blocks[comp]; -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLmcs() && (cs.slice->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#else - if (m_pcEncCfg->getLmcs() && (cs.picHeader->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag())) -#endif { orgBuf[comp] = cs.getPredBuf(area); } @@ -3159,20 +3134,12 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp //DTRACE_PEL_BUF( D_PRED, piPred, tu, tu.cu->predMode, COMPONENT_Y ); const Slice &slice = *cs.slice; -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); -#else - bool flag = slice.getPicHeader()->getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())); -#endif if (isLuma(compID)) { //===== get residual signal ===== piResi.copyFrom( piOrg ); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#endif { CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea); @@ -3383,11 +3350,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp } #endif -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#endif { CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0,0), area.size()); PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea); @@ -3406,13 +3369,8 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp //===== update distortion ===== #if WCG_EXT -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getLmcs() && slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getLmcs() - && slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))) -#endif { const CPelBuf orgLuma = cs.getOrgBuf( cs.area.blocks[COMPONENT_Y] ); if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) @@ -3480,11 +3438,7 @@ void IntraSearch::xIntraCodingACTTUBlock(TransformUnit &tu, const ComponentID &c m_pcTrQuant->selectLambda(compID); } -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool flag = slice.getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())) && (tu.blocks[compID].width*tu.blocks[compID].height > 4); -#else - bool flag = slice.getPicHeader()->getLmcsEnabledFlag() && (slice.isIntra() || (!slice.isIntra() && m_pcReshape->getCTUFlag())) && (tu.blocks[compID].width*tu.blocks[compID].height > 4); -#endif if (flag && isChroma(compID) && slice.getPicHeader()->getLmcsChromaResidualScaleFlag()) { int cResScaleInv = tu.getChromaAdj(); @@ -4352,11 +4306,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti } piResi.copyFrom(piOrg); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (slice.getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#else - if (slice.getPicHeader()->getLmcsEnabledFlag() && m_pcReshape->getCTUFlag() && compID == COMPONENT_Y) -#endif { CompArea tmpArea(COMPONENT_Y, area.chromaFormat, Position(0, 0), area.size()); PelBuf tmpPred = m_tmpStorageLCU.getBuf(tmpArea); @@ -4672,11 +4622,7 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti tu.jointCbCr = 0; -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool doReshaping = (slice.getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (slice.isIntra() || m_pcReshape->getCTUFlag()) && (cbArea.width * cbArea.height > 4)); -#else - bool doReshaping = (slice.getPicHeader()->getLmcsEnabledFlag() && slice.getPicHeader()->getLmcsChromaResidualScaleFlag() && (slice.isIntra() || m_pcReshape->getCTUFlag()) && (cbArea.width * cbArea.height > 4)); -#endif if (doReshaping) { const Area area = tu.Y().valid() ? tu.Y() : Area(recalcPosition(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].pos()), recalcSize(tu.chromaFormat, tu.chType, CHANNEL_TYPE_LUMA, tu.blocks[tu.chType].size())); @@ -4815,13 +4761,8 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti piReco.reconstruct(piPred, piResi, cs.slice->clpRng(compID)); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getLmcs() & slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getLmcs() - & slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))) -#endif { const CPelBuf orgLuma = csFull->getOrgBuf(csFull->area.blocks[COMPONENT_Y]); if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) @@ -4927,13 +4868,8 @@ bool IntraSearch::xRecurIntraCodingACTQT(CodingStructure &cs, Partitioner &parti PelBuf piResi = invColorTransResidual.bufs[compID]; piReco.reconstruct(piPred, piResi, cs.slice->clpRng(compID)); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getLmcs() & slice.getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))) -#else - if (m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled() || (m_pcEncCfg->getLmcs() - & slice.getPicHeader()->getLmcsEnabledFlag() && (m_pcReshape->getCTUFlag() || (isChroma(compID) && m_pcEncCfg->getReshapeIntraCMD())))) -#endif { const CPelBuf orgLuma = csFull->getOrgBuf(csFull->area.blocks[COMPONENT_Y]); if (compID == COMPONENT_Y && !(m_pcEncCfg->getLumaLevelToDeltaQPMapping().isEnabled())) @@ -5172,13 +5108,8 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio resiCr.subtract( piPredCr ); //----- get reshape parameter ---- -#if JVET_Q0346_LMCS_ENABLE_IN_SH bool doReshaping = ( cs.slice->getLmcsEnabledFlag() && cs.picHeader->getLmcsChromaResidualScaleFlag() && (cs.slice->isIntra() || m_pcReshape->getCTUFlag()) && (cbArea.width * cbArea.height > 4) ); -#else - bool doReshaping = ( cs.picHeader->getLmcsEnabledFlag() && cs.picHeader->getLmcsChromaResidualScaleFlag() - && (cs.slice->isIntra() || m_pcReshape->getCTUFlag()) && (cbArea.width * cbArea.height > 4) ); -#endif if( doReshaping ) { const Area area = currTU.Y().valid() ? currTU.Y() : Area(recalcPosition(currTU.chromaFormat, currTU.chType, CHANNEL_TYPE_LUMA, currTU.blocks[currTU.chType].pos()), recalcSize(currTU.chromaFormat, currTU.chType, CHANNEL_TYPE_LUMA, currTU.blocks[currTU.chType].size())); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 6d04553f90bfebeb388fb9409146212815edf0e1..12decfd3ae2b578b8892f97792a13049da139c80 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -2512,12 +2512,10 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) WRITE_FLAG(pcSlice->getTSResidualCodingDisabledFlag() ? 1 : 0, "slice_ts_residual_coding_disabled_flag"); -#if JVET_Q0346_LMCS_ENABLE_IN_SH if (picHeader->getLmcsEnabledFlag()) { WRITE_FLAG(pcSlice->getLmcsEnabledFlag(), "slice_lmcs_enabled_flag"); } -#endif #if JVET_Q0346_SCALING_LIST_USED_IN_SH if (picHeader->getExplicitScalingListEnabledFlag())