Commit 829fd694 authored by Xiang Li's avatar Xiang Li
Browse files

Merge branch 'JVET-O0258' into 'master'

JVET-O0258: Remove Chroma IBC when dualtree is used

See merge request jvet/VVCSoftware_VTM!706
parents 0e7914af 18aada6c
......@@ -1407,6 +1407,7 @@ const TransformUnit* CodingStructure::getTURestricted( const Position &pos, cons
}
}
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
IbcLumaCoverage CodingStructure::getIbcLumaCoverage(const CompArea& chromaArea) const
{
const unsigned int unitAreaSubBlock = MIN_PU_SIZE * MIN_PU_SIZE;
......@@ -1438,3 +1439,4 @@ IbcLumaCoverage CodingStructure::getIbcLumaCoverage(const CompArea& chromaArea)
return coverage;
}
#endif
\ No newline at end of file
......@@ -60,6 +60,7 @@ enum PictureType
PIC_RECON_WRAP,
NUM_PIC_TYPES
};
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
enum IbcLumaCoverage
{
IBC_LUMA_COVERAGE_FULL = 0,
......@@ -67,6 +68,7 @@ enum IbcLumaCoverage
IBC_LUMA_COVERAGE_NONE,
NUM_IBC_LUMA_COVERAGE,
};
#endif
extern XUCache g_globalUnitCache;
// ---------------------------------------------------------------------------
......@@ -153,7 +155,9 @@ public:
cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const;
cPUTraverser traversePUs(const UnitArea& _unit, const ChannelType _chType) const;
cTUTraverser traverseTUs(const UnitArea& _unit, const ChannelType _chType) const;
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
IbcLumaCoverage getIbcLumaCoverage(const CompArea& chromaArea) const;
#endif
// ---------------------------------------------------------------------------
// encoding search utilities
// ---------------------------------------------------------------------------
......
......@@ -387,6 +387,7 @@ void InterPrediction::xSubPuBio(PredictionUnit& pu, PelUnitBuf& predBuf, const R
}
}
}
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
{
// separated tree, chroma
......@@ -414,7 +415,7 @@ void InterPrediction::xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred)
}
}
}
#endif
void InterPrediction::xPredInterUni(const PredictionUnit& pu, const RefPicList& eRefPicList, PelUnitBuf& pcYuvPred, const bool& bi
, const bool& bioApplied
......@@ -1294,6 +1295,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
// dual tree handling for IBC as the only ref
if ((!luma || !chroma) && eRefPicList == REF_PIC_LIST_0)
{
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
if (!luma && chroma)
{
xChromaMC(pu, predBuf);
......@@ -1301,11 +1303,14 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
}
else // (luma && !chroma)
{
#endif
xPredInterUni(pu, eRefPicList, predBuf, false
, false
, luma, chroma);
return;
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
}
#endif
}
// else, go with regular MC below
CodingStructure &cs = *pu.cs;
......
......@@ -161,7 +161,9 @@ protected:
MotionInfo m_SubPuMiBuf[(MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1)];
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
void xChromaMC(PredictionUnit &pu, PelUnitBuf& pcYuvPred);
#endif
#if JVET_J0090_MEMORY_BANDWITH_MEASURE
CacheModel *m_cacheModel;
#endif
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE 1 // JVET-O0258 Remove chroma IBC when dualtree is used
#define JVET_O1161_IBC_MAX_SIZE 1 // Limit largest IBC luma CU size to 64x64 per discussion of JVET-O1161
#define JVET_O0315_RDPCM_INTRAMODE_ALIGN 1 // JVET-O0200/O0205/O0296/O0342/O0463/O0542: Intra prediction mode alignment for BDPCM
......
......@@ -955,8 +955,11 @@ void CABACReader::affine_amvr_mode( CodingUnit& cu, MergeCtx& mrgCtx )
void CABACReader::pred_mode( CodingUnit& cu )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__PRED_MODE );
#if JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
if (cu.cs->slice->getSPS()->getIBCFlag() && cu.chType != CHANNEL_TYPE_CHROMA)
#else
if (cu.cs->slice->getSPS()->getIBCFlag())
#endif
{
if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) )
{
......
......@@ -730,7 +730,11 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
void CABACWriter::pred_mode( const CodingUnit& cu )
{
#if JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
if (cu.cs->slice->getSPS()->getIBCFlag() && cu.chType != CHANNEL_TYPE_CHROMA)
#else
if (cu.cs->slice->getSPS()->getIBCFlag())
#endif
{
if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) )
{
......
......@@ -3258,9 +3258,10 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best
pu.interDir = 1; // use list 0 for IBC mode
pu.refIdx[REF_PIC_LIST_0] = MAX_NUM_REF; // last idx in the list
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
if (partitioner.chType == CHANNEL_TYPE_LUMA)
{
#endif
bool bValid = m_pcInterSearch->predIBCSearch(cu, partitioner, m_ctuIbcSearchRangeX, m_ctuIbcSearchRangeY, m_ibcHashMap);
if (bValid)
......@@ -3305,6 +3306,7 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best
tempCS->cost = MAX_DOUBLE;
tempCS->costDbOffset = 0;
}
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
}
// chroma CU ibc comp
else
......@@ -3372,7 +3374,8 @@ void EncCu::xCheckRDCostIBCMode(CodingStructure *&tempCS, CodingStructure *&best
tempCS->costDbOffset = 0;
}
}
}
#endif
}
// check ibc mode in encoder RD
//////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -1183,6 +1183,9 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
bool checkIbc = true;
if (partitioner.chType == CHANNEL_TYPE_CHROMA)
{
#if JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
checkIbc = false;
#else
IbcLumaCoverage ibcLumaCoverage = cs.getIbcLumaCoverage(cs.area.Cb());
switch (ibcLumaCoverage)
{
......@@ -1200,6 +1203,7 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
default:
THROW("Unknown IBC luma coverage type");
}
#endif
}
// Add coding modes here
// NOTE: Working back to front, as a stack, which is more efficient with the container
......
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