Commit 771ed2d2 authored by Xiang Li's avatar Xiang Li
Browse files

Merge branch 'ezhizng/VVCSoftware_VTM-JVET_O0219'

parents a7e1529d b94a4ebe
......@@ -354,7 +354,11 @@ void TrQuant::xInvLfnst( const TransformUnit &tu, const ComponentID compID )
if( PU::isLMCMode( tu.cs->getPU( area.pos(), toChannelType( compID ) )->intraDir[ toChannelType( compID ) ] ) )
{
#if JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE
intraMode = PU::getCoLocatedIntraLumaMode( *tu.cs->getPU( area.pos(), toChannelType( compID ) ) );
#else
intraMode = PLANAR_IDX;
#endif
}
CHECK( intraMode >= NUM_INTRA_MODE - 1, "Invalid intra mode" );
......@@ -462,7 +466,11 @@ void TrQuant::xFwdLfnst( const TransformUnit &tu, const ComponentID compID, cons
if( PU::isLMCMode( tu.cs->getPU( area.pos(), toChannelType( compID ) )->intraDir[ toChannelType( compID ) ] ) )
{
#if JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE
intraMode = PU::getCoLocatedIntraLumaMode( *tu.cs->getPU( area.pos(), toChannelType( compID ) ) );
#else
intraMode = PLANAR_IDX;
#endif
}
CHECK( intraMode >= NUM_INTRA_MODE - 1, "Invalid intra mode" );
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE 1
#define JVET_O0426_MRL_REF_SAMPLES_DC_MODE 1 // JVET-O0426: align MRL reference samples used for DC intra mode prediction
#define JVET_O0366_AFFINE_BCW 1 // JVET-O0366: Simplifications on BCW index derivation process
......
......@@ -767,10 +767,14 @@ void PU::getIntraChromaCandModes( const PredictionUnit &pu, unsigned modeList[NU
modeList[6] = MDLM_T_IDX;
modeList[7] = DM_CHROMA_IDX;
#if JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE
const uint32_t lumaMode = getCoLocatedIntraLumaMode(pu);
#else
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;
const uint32_t lumaMode = PU::getIntraDirLuma( *lumaPU );
#endif
for( int i = 0; i < 4; i++ )
{
if( lumaMode == modeList[i] )
......@@ -841,11 +845,15 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT
if( uiIntraMode == DM_CHROMA_IDX && !isLuma( chType ) )
{
#if JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE
uiIntraMode = getCoLocatedIntraLumaMode(pu);
#else
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 );
uiIntraMode = PU::getIntraDirLuma( lumaPU );
#endif
}
if( pu.chromaFormat == CHROMA_422 && !isLuma( chType ) && uiIntraMode < NUM_LUMA_MODE ) // map directional, planar and dc
{
......@@ -854,6 +862,17 @@ uint32_t PU::getFinalIntraMode( const PredictionUnit &pu, const ChannelType &chT
return uiIntraMode;
}
#if JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE
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 = CS::isDualITree( *pu.cs ) ? *pu.cs->picture->cs->getPU( refPos, CHANNEL_TYPE_LUMA ) : *pu.cs->getPU( topLeftPos, CHANNEL_TYPE_LUMA );
return PU::getIntraDirLuma( lumaPU );
}
#endif
int PU::getWideAngIntraMode( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID )
{
if( dirMode < 2 )
......
......@@ -136,6 +136,9 @@ namespace PU
AvailableInfo getAvailableInfoLuma (const PredictionUnit &pu);
void getIntraChromaCandModes (const PredictionUnit &pu, unsigned modeList[NUM_CHROMA_MODE]);
uint32_t getFinalIntraMode (const PredictionUnit &pu, const ChannelType &chType);
#if JVET_O0219_LFNST_TRANSFORM_SET_FOR_LMCMODE
uint32_t getCoLocatedIntraLumaMode (const PredictionUnit &pu);
#endif
int getWideAngIntraMode ( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID );
void getInterMergeCandidates (const PredictionUnit &pu, MergeCtx& mrgCtx,
int mmvdList,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment