diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index bc7565f63ae2fca7ecc45bbe03c3a2f554f860e1..eede39cb4307f248d5e1546fd3f8495236503f78 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -60,6 +60,7 @@ #define JVET_L0266_HMVP 1 //History-based MVP #define JVET_L0553_FIX_INITQP 1 +#define JVET_L0053_L0272_DM 1 // use center position of luma block to derive DM #define JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN 1 // Subsampled Laplacian calculation diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 0b5c05c9aab405a428ee7a5164af0b3bf9f05a91..217ac49b644006ddf60a01974b8f733f7bf84441 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -396,7 +396,13 @@ void PU::getIntraChromaCandModes( const PredictionUnit &pu, unsigned modeList[NU modeList[5] = DM_CHROMA_IDX; #endif +#if JVET_L0053_L0272_DM + 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 = CS::isDualITree( *pu.cs ) ? pu.cs->picture->cs->getPU( refPos, CHANNEL_TYPE_LUMA ) : &pu; +#else const PredictionUnit *lumaPU = CS::isDualITree( *pu.cs ) ? pu.cs->picture->cs->getPU( pu.blocks[pu.chType].lumaPos(), CHANNEL_TYPE_LUMA ) : &pu; +#endif const uint32_t lumaMode = lumaPU->intraDir[CHANNEL_TYPE_LUMA]; for( int i = 0; i < 4; i++ ) { @@ -503,7 +509,13 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT if( uiIntraMode == DM_CHROMA_IDX && !isLuma( chType ) ) { +#if JVET_L0053_L0272_DM + 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 = CS::isDualITree( *pu.cs ) ? *pu.cs->picture->cs->getPU( refPos, CHANNEL_TYPE_LUMA ) : *pu.cs->getPU( topLeftPos, CHANNEL_TYPE_LUMA ); +#else const PredictionUnit &lumaPU = CS::isDualITree( *pu.cs ) ? *pu.cs->picture->cs->getPU( pu.blocks[chType].lumaPos(), CHANNEL_TYPE_LUMA ) : *pu.cs->getPU( pu.blocks[chType].lumaPos(), CHANNEL_TYPE_LUMA ); +#endif uiIntraMode = lumaPU.intraDir[0]; } if( pu.chromaFormat == CHROMA_422 && !isLuma( chType ) )