diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp index 10742839ae5a586cedc738e5fd463880424facfd..d35a8d39029316bd1d65eb014c692381e41f39bd 100644 --- a/source/Lib/CommonLib/IntraPrediction.cpp +++ b/source/Lib/CommonLib/IntraPrediction.cpp @@ -221,9 +221,7 @@ void IntraPrediction::predIntraAng( const ComponentID compId, PelBuf &piPred, co const int iWidth = piPred.width; const int iHeight = piPred.height; CHECK(iWidth == 2, "Width of 2 is not supported"); -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE CHECK(PU::isMIP(pu, toChannelType(compId)), "We should not get here for MIP."); -#endif const uint32_t uiDirMode = isLuma( compId ) && pu.cu->bdpcmMode ? BDPCM_IDX : !isLuma(compId) && pu.cu->bdpcmModeChroma ? BDPCM_IDX : PU::getFinalIntraMode(pu, channelType); CHECK( floorLog2(iWidth) < 2 && pu.cs->pcv->noChroma2x2, "Size not allowed" ); @@ -1802,32 +1800,20 @@ void IntraPrediction::initIntraMip( const PredictionUnit &pu, const CompArea &ar // prepare input (boundary) data for prediction CHECK( m_ipaParam.refFilterFlag, "ERROR: unfiltered refs expected for MIP" ); -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE Pel *ptrSrc = getPredictorPtr(area.compID); const int srcStride = m_refBufferStride[area.compID]; const int srcHStride = 2; m_matrixIntraPred.prepareInputForPred(CPelBuf(ptrSrc, srcStride, srcHStride), area, pu.cu->slice->getSPS()->getBitDepth(toChannelType(area.compID)), area.compID); -#else - Pel *ptrSrc = getPredictorPtr( COMPONENT_Y ); - const int srcStride = m_refBufferStride[COMPONENT_Y]; - const int srcHStride = 2; - - m_matrixIntraPred.prepareInputForPred( CPelBuf( ptrSrc, srcStride, srcHStride ), area, pu.cu->slice->getSPS()->getBitDepth( CHANNEL_TYPE_LUMA ) ); -#endif } void IntraPrediction::predIntraMip( const ComponentID compId, PelBuf &piPred, const PredictionUnit &pu ) { -#if !JVET_R0350_MIP_CHROMA_444_SINGLETREE - CHECK( compId != COMPONENT_Y, "Error: chroma not supported" ); -#endif CHECK( piPred.width > MIP_MAX_WIDTH || piPred.height > MIP_MAX_HEIGHT, "Error: block size not supported for MIP" ); CHECK( piPred.width != (1 << floorLog2(piPred.width)) || piPred.height != (1 << floorLog2(piPred.height)), "Error: expecting blocks of size 2^M x 2^N" ); // generate mode-specific prediction -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE uint32_t modeIdx = MAX_NUM_MIP_MODE; bool transposeFlag = false; if (compId == COMPONENT_Y) @@ -1848,16 +1834,9 @@ void IntraPrediction::predIntraMip( const ComponentID compId, PelBuf &piPred, co const int bitDepth = pu.cu->slice->getSPS()->getBitDepth(toChannelType(compId)); CHECK(modeIdx >= getNumModesMip(piPred), "Error: Wrong MIP mode index"); -#else - const int bitDepth = pu.cu->slice->getSPS()->getBitDepth( CHANNEL_TYPE_LUMA ); -#endif static_vector<int, MIP_MAX_WIDTH* MIP_MAX_HEIGHT> predMip( piPred.width * piPred.height ); -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE m_matrixIntraPred.predBlock(predMip.data(), modeIdx, transposeFlag, bitDepth, compId); -#else - m_matrixIntraPred.predBlock( predMip.data(), pu.intraDir[CHANNEL_TYPE_LUMA], pu.mipTransposedFlag, bitDepth ); -#endif for( int y = 0; y < piPred.height; y++ ) { diff --git a/source/Lib/CommonLib/MatrixIntraPrediction.cpp b/source/Lib/CommonLib/MatrixIntraPrediction.cpp index cad260400e7365aaf2d963a2f85c34f251dd934e..b8296b1bd01a768c3a02d7709019938856f80c37 100644 --- a/source/Lib/CommonLib/MatrixIntraPrediction.cpp +++ b/source/Lib/CommonLib/MatrixIntraPrediction.cpp @@ -43,9 +43,7 @@ MatrixIntraPrediction::MatrixIntraPrediction(): -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE m_component(MAX_NUM_COMPONENT), -#endif m_reducedBoundary (MIP_MAX_INPUT_SIZE), m_reducedBoundaryTransposed(MIP_MAX_INPUT_SIZE), m_inputOffset ( 0 ), @@ -61,16 +59,11 @@ MatrixIntraPrediction::MatrixIntraPrediction(): { } -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE void MatrixIntraPrediction::prepareInputForPred(const CPelBuf &pSrc, const Area &block, const int bitDepth, const ComponentID compId) { m_component = compId; -#else -void MatrixIntraPrediction::prepareInputForPred(const CPelBuf &pSrc, const Area& block, const int bitDepth) -{ -#endif // Step 1: Save block size and calculate dependent values initPredBlockParams(block); @@ -124,16 +117,11 @@ void MatrixIntraPrediction::prepareInputForPred(const CPelBuf &pSrc, const Area& } } -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE void MatrixIntraPrediction::predBlock(int *const result, const int modeIdx, const bool transpose, const int bitDepth, const ComponentID compId) { CHECK(m_component != compId, "Boundary has not been prepared for this component."); -#else -void MatrixIntraPrediction::predBlock(int* const result, const int modeIdx, const bool transpose, const int bitDepth) -{ -#endif const bool needUpsampling = ( m_upsmpFactorHor > 1 ) || ( m_upsmpFactorVer > 1 ); const uint8_t* matrix = getMatrixData(modeIdx); diff --git a/source/Lib/CommonLib/MatrixIntraPrediction.h b/source/Lib/CommonLib/MatrixIntraPrediction.h index 2b69661e3bdd16e67bc2878a72fc80eb885bf794..4bbd750d3b90b06ab5142b5bbf5e89614a8b30b7 100644 --- a/source/Lib/CommonLib/MatrixIntraPrediction.h +++ b/source/Lib/CommonLib/MatrixIntraPrediction.h @@ -50,20 +50,13 @@ class MatrixIntraPrediction public: MatrixIntraPrediction(); -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE void prepareInputForPred(const CPelBuf &pSrc, const Area &block, const int bitDepth, const ComponentID compId); void predBlock(int *const result, const int modeIdx, const bool transpose, const int bitDepth, const ComponentID compId); -#else - void prepareInputForPred(const CPelBuf &pSrc, const Area& block, const int bitDepth); - void predBlock(int* const result, const int modeIdx, const bool transpose, const int bitDepth); -#endif private: -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE ComponentID m_component; -#endif static_vector<int, MIP_MAX_INPUT_SIZE> m_reducedBoundary; // downsampled boundary of a block static_vector<int, MIP_MAX_INPUT_SIZE> m_reducedBoundaryTransposed; // downsampled, transposed boundary of a block int m_inputOffset; diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index dae1297d20222d28815618db4c73e7a13435c22b..fc378ad7c67db513bd934a3ec286e456a2c15709 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -134,7 +134,6 @@ -#define JVET_R0350_MIP_CHROMA_444_SINGLETREE 1 // JVET-R0350: MIP for chroma in case of 4:4:4 format and single tree #define JVET_R0347_MTT_SIZE_CONSTRAIN 1 // JVET-R0347: Set upper limit of minQtSize and maxTtSize to 64, set upper limit of maxBtSize to 64 in chroma-tree diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 865f3268ae3f5448df38cf7e7c4a7530c8503664..753a70c2c5be82f257409f8aad163589644151bd 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -611,7 +611,6 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType bool PU::isMIP(const PredictionUnit &pu, const ChannelType &chType) { -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE if (chType == CHANNEL_TYPE_LUMA) { // Default case if chType is omitted. @@ -621,17 +620,12 @@ bool PU::isMIP(const PredictionUnit &pu, const ChannelType &chType) { return isDMChromaMIP(pu) && (pu.intraDir[CHANNEL_TYPE_CHROMA] == DM_CHROMA_IDX); } -#else - return (chType == CHANNEL_TYPE_LUMA && pu.cu->mipFlag); -#endif } -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE bool PU::isDMChromaMIP(const PredictionUnit &pu) { return !pu.cu->isSepTree() && (pu.chromaFormat == CHROMA_444) && getCoLocatedLumaPU(pu).cu->mipFlag; } -#endif uint32_t PU::getIntraDirLuma( const PredictionUnit &pu ) { @@ -658,14 +652,12 @@ void PU::getIntraChromaCandModes( const PredictionUnit &pu, unsigned modeList[NU modeList[6] = MDLM_T_IDX; modeList[7] = DM_CHROMA_IDX; -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE // If Direct Mode is MIP, mode cannot be already in the list. if (isDMChromaMIP(pu)) { return; } -#endif const uint32_t lumaMode = getCoLocatedIntraLumaMode(pu); for( int i = 0; i < 4; i++ ) { @@ -722,7 +714,6 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT return uiIntraMode; } -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE const PredictionUnit &PU::getCoLocatedLumaPU(const PredictionUnit &pu) { Position topLeftPos = pu.blocks[pu.chType].lumaPos(); @@ -738,16 +729,6 @@ uint32_t PU::getCoLocatedIntraLumaMode(const PredictionUnit &pu) { return PU::getIntraDirLuma(PU::getCoLocatedLumaPU(pu)); } -#else -uint32_t PU::getCoLocatedIntraLumaMode( const PredictionUnit &pu ) -{ - Position topLeftPos = pu.blocks[pu.chType].lumaPos(); - Position refPos = topLeftPos.offset( pu.blocks[pu.chType].lumaSize().width >> 1, pu.blocks[pu.chType].lumaSize().height >> 1 ); - const PredictionUnit &lumaPU = pu.cu->isSepTree() ? *pu.cs->picture->cs->getPU( refPos, CHANNEL_TYPE_LUMA ) : *pu.cs->getPU( topLeftPos, CHANNEL_TYPE_LUMA ); - - return PU::getIntraDirLuma( lumaPU ); -} -#endif int PU::getWideAngle( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ) { diff --git a/source/Lib/CommonLib/UnitTools.h b/source/Lib/CommonLib/UnitTools.h index a201b500e9864ae59bd8535f165b5dfda6574af4..b73d2d5d77288ff167e2765572fcc6206357cadf 100644 --- a/source/Lib/CommonLib/UnitTools.h +++ b/source/Lib/CommonLib/UnitTools.h @@ -130,14 +130,10 @@ namespace PU int getLMSymbolList(const PredictionUnit &pu, int *modeList); int getIntraMPMs(const PredictionUnit &pu, unsigned *mpm, const ChannelType &channelType = CHANNEL_TYPE_LUMA); bool isMIP (const PredictionUnit &pu, const ChannelType &chType = CHANNEL_TYPE_LUMA); -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE bool isDMChromaMIP (const PredictionUnit &pu); -#endif uint32_t getIntraDirLuma (const PredictionUnit &pu); void getIntraChromaCandModes (const PredictionUnit &pu, unsigned modeList[NUM_CHROMA_MODE]); -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE const PredictionUnit &getCoLocatedLumaPU(const PredictionUnit &pu); -#endif uint32_t getFinalIntraMode (const PredictionUnit &pu, const ChannelType &chType); uint32_t getCoLocatedIntraLumaMode (const PredictionUnit &pu); int getWideAngle ( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ); diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index f20067774d51d6d3562b483a18a6f64f0205e9cc..71deb0ca487eafdc9a5762ce65696b28621753e2 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -4946,7 +4946,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio predIntraChromaLM( COMPONENT_Cb, piPredCb, pu, cbArea, predMode ); predIntraChromaLM( COMPONENT_Cr, piPredCr, pu, crArea, predMode ); } -#if JVET_R0350_MIP_CHROMA_444_SINGLETREE else if (PU::isMIP(pu, CHANNEL_TYPE_CHROMA)) { initIntraMip(pu, cbArea); @@ -4955,7 +4954,6 @@ ChromaCbfs IntraSearch::xRecurIntraChromaCodingQT( CodingStructure &cs, Partitio initIntraMip(pu, crArea); predIntraMip(COMPONENT_Cr, piPredCr, pu); } -#endif else { predIntraAng( COMPONENT_Cb, piPredCb, pu);