diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 43ff4cbb72fe5f43ceba3473bd4370f48868e24c..20555e5b1a2ae43703ac302e63e0b3c0b4e11ae0 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -62,9 +62,7 @@ Slice::Slice() , m_eNalUnitType ( NAL_UNIT_CODED_SLICE_IDR_W_RADL ) , m_eSliceType ( I_SLICE ) , m_iSliceQp ( 0 ) -#if !JVET_P1006_PICTURE_HEADER , m_ChromaQpAdjEnabled ( false ) -#endif , m_deblockingFilterDisable ( false ) , m_deblockingFilterOverrideFlag ( false ) , m_deblockingFilterBetaOffsetDiv2( 0 ) @@ -769,9 +767,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll) m_eSliceType = pSrc->m_eSliceType; m_iSliceQp = pSrc->m_iSliceQp; m_iSliceQpBase = pSrc->m_iSliceQpBase; -#if !JVET_P1006_PICTURE_HEADER m_ChromaQpAdjEnabled = pSrc->m_ChromaQpAdjEnabled; -#endif m_deblockingFilterDisable = pSrc->m_deblockingFilterDisable; m_deblockingFilterOverrideFlag = pSrc->m_deblockingFilterOverrideFlag; m_deblockingFilterBetaOffsetDiv2 = pSrc->m_deblockingFilterBetaOffsetDiv2; diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index 24fabd3896d9f8409cb22552bbdecd170847e496..3c802d42fabf8ec57f53c2a45cc68fbbb36c7859 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -2091,9 +2091,7 @@ private: SliceType m_eSliceType; int m_iSliceQp; int m_iSliceQpBase; -#if !JVET_P1006_PICTURE_HEADER bool m_ChromaQpAdjEnabled; -#endif bool m_deblockingFilterDisable; bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter @@ -2302,9 +2300,7 @@ public: bool getUseWeightedPrediction() const { return( (m_eSliceType==P_SLICE && testWeightPred()) || (m_eSliceType==B_SLICE && testWeightBiPred()) ); } int getSliceQpDelta() const { return m_iSliceQpDelta; } int getSliceChromaQpDelta(ComponentID compID) const { return isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID]; } -#if !JVET_P1006_PICTURE_HEADER bool getUseChromaQpAdj() const { return m_ChromaQpAdjEnabled; } -#endif bool getDeblockingFilterDisable() const { return m_deblockingFilterDisable; } bool getDeblockingFilterOverrideFlag() const { return m_deblockingFilterOverrideFlag; } int getDeblockingFilterBetaOffsetDiv2()const { return m_deblockingFilterBetaOffsetDiv2; } @@ -2344,9 +2340,7 @@ public: void setSliceQp( int i ) { m_iSliceQp = i; } void setSliceQpDelta( int i ) { m_iSliceQpDelta = i; } void setSliceChromaQpDelta( ComponentID compID, int i ) { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i; } -#if !JVET_P1006_PICTURE_HEADER void setUseChromaQpAdj( bool b ) { m_ChromaQpAdjEnabled = b; } -#endif void setDeblockingFilterDisable( bool b ) { m_deblockingFilterDisable= b; } void setDeblockingFilterOverrideFlag( bool b ) { m_deblockingFilterOverrideFlag = b; } void setDeblockingFilterBetaOffsetDiv2( int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index 5759db84091de43de74fb8341526641beccc4dd5..ae2554ab2923328761447f5922604bc608406829 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -454,11 +454,7 @@ bool CABACReader::coding_tree( CodingStructure& cs, Partitioner& partitioner, CU cuCtx.qgStart = true; cuCtx.isDQPCoded = false; } -#if JVET_P1006_PICTURE_HEADER - if( pps.getCuChromaQpOffsetEnabledFlag() && partitioner.currQgChromaEnable() ) -#else if( cs.slice->getUseChromaQpAdj() && partitioner.currQgChromaEnable() ) -#endif { cuCtx.isChromaQpAdjCoded = false; } @@ -471,11 +467,7 @@ bool CABACReader::coding_tree( CodingStructure& cs, Partitioner& partitioner, CU pCuCtxChroma->qgStart = true; pCuCtxChroma->isDQPCoded = false; } -#if JVET_P1006_PICTURE_HEADER - if (pps.getCuChromaQpOffsetEnabledFlag() && pPartitionerChroma->currQgChromaEnable()) -#else if (cs.slice->getUseChromaQpAdj() && pPartitionerChroma->currQgChromaEnable()) -#endif { pCuCtxChroma->isChromaQpAdjCoded = false; } @@ -1811,11 +1803,7 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_ cuCtx.isDQPCoded = true; } } -#if JVET_P1006_PICTURE_HEADER - if (cu.useEscape[compBegin] && cu.cs->pps->getCuChromaQpOffsetEnabledFlag() && !cuCtx.isChromaQpAdjCoded) -#else if (cu.useEscape[compBegin] && cu.cs->slice->getUseChromaQpAdj() && !cuCtx.isChromaQpAdjCoded) -#endif { if (!cu.isSepTree() || isChroma(tu.chType)) { @@ -3187,11 +3175,7 @@ void CABACReader::transform_unit( TransformUnit& tu, CUCtx& cuCtx, Partitioner& SizeType channelWidth = !cu.isSepTree() ? cu.lwidth() : cu.chromaSize().width; SizeType channelHeight = !cu.isSepTree() ? cu.lheight() : cu.chromaSize().height; -#if JVET_P1006_PICTURE_HEADER - if (cu.cs->pps->getCuChromaQpOffsetEnabledFlag() && (channelWidth > 64 || channelHeight > 64 || cbfChroma) && !cuCtx.isChromaQpAdjCoded) -#else if (cu.cs->slice->getUseChromaQpAdj() && (channelWidth > 64 || channelHeight > 64 || cbfChroma) && !cuCtx.isChromaQpAdjCoded) -#endif { cu_chroma_qp_offset(cu); cuCtx.isChromaQpAdjCoded = true; diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 13b6ca3b3f7c5fc3bf31b695cd50988a73c5c8da..94d71454b99a9b483e1c388179f7ad988d3b195c 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -3303,7 +3303,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para } } -#if !JVET_P1006_PICTURE_HEADER if (pps->getCuChromaQpOffsetEnabledFlag()) { READ_FLAG(uiCode, "cu_chroma_qp_offset_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0); @@ -3312,7 +3311,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para { pcSlice->setUseChromaQpAdj(false); } -#endif #if JVET_P1006_PICTURE_HEADER if( sps->getSAOEnabledFlag() && !picHeader->getSaoEnabledPresentFlag() ) diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 7337d0832e465beab88fb9f99e6e8d027f564bd7..68859306bfbb5574de2d741117f639357bcc8ae5 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -386,11 +386,7 @@ void CABACWriter::coding_tree(const CodingStructure& cs, Partitioner& partitione cuCtx.qgStart = true; cuCtx.isDQPCoded = false; } -#if JVET_P1006_PICTURE_HEADER - if( pps.getCuChromaQpOffsetEnabledFlag() && partitioner.currQgChromaEnable() ) -#else if( cs.slice->getUseChromaQpAdj() && partitioner.currQgChromaEnable() ) -#endif { cuCtx.isChromaQpAdjCoded = false; } @@ -402,11 +398,7 @@ void CABACWriter::coding_tree(const CodingStructure& cs, Partitioner& partitione pCuCtxChroma->qgStart = true; pCuCtxChroma->isDQPCoded = false; } -#if JVET_P1006_PICTURE_HEADER - if (pps.getCuChromaQpOffsetEnabledFlag() && pPartitionerChroma->currQgChromaEnable()) -#else if (cs.slice->getUseChromaQpAdj() && pPartitionerChroma->currQgChromaEnable()) -#endif { pCuCtxChroma->isChromaQpAdjCoded = false; } @@ -1538,11 +1530,7 @@ void CABACWriter::cu_palette_info(const CodingUnit& cu, ComponentID compBegin, u cuCtx.isDQPCoded = true; } } -#if JVET_P1006_PICTURE_HEADER - if (cu.useEscape[compBegin] && cu.cs->pps->getCuChromaQpOffsetEnabledFlag() && !cuCtx.isChromaQpAdjCoded) -#else if (cu.useEscape[compBegin] && cu.cs->slice->getUseChromaQpAdj() && !cuCtx.isChromaQpAdjCoded) -#endif { if (!CS::isDualITree(*tu.cs) || isChroma(tu.chType)) { @@ -2885,11 +2873,7 @@ void CABACWriter::transform_unit( const TransformUnit& tu, CUCtx& cuCtx, Partiti SizeType channelWidth = !cu.isSepTree() ? cu.lwidth() : cu.chromaSize().width; SizeType channelHeight = !cu.isSepTree() ? cu.lheight() : cu.chromaSize().height; -#if JVET_P1006_PICTURE_HEADER - if (cu.cs->pps->getCuChromaQpOffsetEnabledFlag() && (channelWidth > 64 || channelHeight > 64 || cbfChroma) && !cuCtx.isChromaQpAdjCoded) -#else if (cu.cs->slice->getUseChromaQpAdj() && (channelWidth > 64 || channelHeight > 64 || cbfChroma) && !cuCtx.isChromaQpAdjCoded) -#endif { cu_chroma_qp_offset(cu); cuCtx.isChromaQpAdjCoded = true; diff --git a/source/Lib/EncoderLib/EncCu.cpp b/source/Lib/EncoderLib/EncCu.cpp index 9c277891333be8648d820a5b073cb80e1a50e74f..71dfb3623c9ca154df7884c55ebcd5a9eca66b92 100644 --- a/source/Lib/EncoderLib/EncCu.cpp +++ b/source/Lib/EncoderLib/EncCu.cpp @@ -689,11 +689,7 @@ void EncCu::xCompressCU( CodingStructure*& tempCS, CodingStructure*& bestCS, Par m_cuChromaQpOffsetIdxPlus1 = 0; -#if JVET_P1006_PICTURE_HEADER - if( pps.getCuChromaQpOffsetEnabledFlag() ) -#else if( slice.getUseChromaQpAdj() ) -#endif { // TODO M0133 : double check encoder decisions with respect to chroma QG detection and actual encode int lgMinCuSize = sps.getLog2MinCodingBlockSize() + diff --git a/source/Lib/EncoderLib/EncSlice.cpp b/source/Lib/EncoderLib/EncSlice.cpp index fd79519489eb25ec03a6a61b9f509a748f63d61b..3c580bfb5081a9a9440343774f4bbb9562c7b61c 100644 --- a/source/Lib/EncoderLib/EncSlice.cpp +++ b/source/Lib/EncoderLib/EncSlice.cpp @@ -615,9 +615,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 ); rpcSlice->setSliceChromaQpDelta( JOINT_CbCr, 0 ); #endif -#if !JVET_P1006_PICTURE_HEADER rpcSlice->setUseChromaQpAdj( rpcSlice->getPPS()->getCuChromaQpOffsetEnabledFlag() ); -#endif rpcSlice->setNumRefIdx(REF_PIC_LIST_0, m_pcCfg->getRPLEntry(0, iGOPid).m_numRefPicsActive); rpcSlice->setNumRefIdx(REF_PIC_LIST_1, m_pcCfg->getRPLEntry(1, iGOPid).m_numRefPicsActive); diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index f3b7c7ad59e37092562d80c9df15fd5b2fcbc6af..8dfde8fb4b78a4319b4cdeebf202c8118abb7602 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -2208,12 +2208,10 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice ) CHECK(numberValidComponents < COMPONENT_Cr+1, "Too many valid components"); } -#if !JVET_P1006_PICTURE_HEADER if (pcSlice->getPPS()->getCuChromaQpOffsetEnabledFlag()) { WRITE_FLAG(pcSlice->getUseChromaQpAdj(), "cu_chroma_qp_offset_enabled_flag"); } -#endif #if JVET_P1006_PICTURE_HEADER if( pcSlice->getSPS()->getSAOEnabledFlag() && !picHeader->getSaoEnabledPresentFlag() )