Commit ac4a915f authored by Yin Zhao's avatar Yin Zhao
Browse files

fix compilation errors by code merging and harmonize with...

fix compilation errors by code merging and harmonize with JVET_O0119_BASE_PALETTE_444, JVET_O0502_ISP_CLEANUP, JVET_O0472_LFNST_SIGNALLING_LAST_SCAN_POS, JVET_O0545_MAX_TB_SIGNALLING
parent 398cb89d
......@@ -670,7 +670,11 @@ bool CABACReader::coding_tree( CodingStructure& cs, Partitioner& partitioner, CU
uint32_t compBegin;
uint32_t numComp;
bool jointPLT = false;
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.isSepTree())
#else
if (CS::isDualITree(*cu.cs))
#endif
{
if (isLuma(partitioner.chType))
{
......@@ -846,7 +850,11 @@ bool CABACReader::coding_unit( CodingUnit &cu, Partitioner &partitioner, CUCtx&
if (CU::isPLT(cu))
{
cs.addTU(cu, partitioner.chType);
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.isSepTree())
#else
if (CS::isDualITree(*cu.cs))
#endif
{
if (isLuma(partitioner.chType))
{
......@@ -1213,7 +1221,19 @@ void CABACReader::pred_mode( CodingUnit& cu )
else
{
#if JVET_O0119_BASE_PALETTE_444
#if JVET_O0050_LOCAL_DUAL_TREE
if( cu.isConsInter() )
{
cu.predMode = MODE_INTER;
return;
}
#endif
#if JVET_O0050_LOCAL_DUAL_TREE
if ( cu.cs->slice->isIntra() || (cu.lwidth() == 4 && cu.lheight() == 4) || cu.isConsIntra() )
#else
if ( cu.cs->slice->isIntra() || (cu.lwidth() == 4 && cu.lheight() == 4) )
#endif
{
cu.predMode = MODE_INTRA;
if (cu.cs->slice->getSPS()->getPLTMode() && cu.lwidth() <= 64 && cu.lheight() <= 64)
......@@ -1904,7 +1924,11 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_
// void inter_pred_idc ( pu );
if (cu.useEscape[compBegin] && cu.cs->pps->getUseDQP() && !cuCtx.isDQPCoded)
{
#if JVET_O0050_LOCAL_DUAL_TREE
if (!cu.isSepTree() || isLuma(tu.chType))
#else
if (!CS::isDualITree(*tu.cs) || isLuma(tu.chType))
#endif
{
cu_qp_delta(cu, cuCtx.qp, cu.qp);
cuCtx.qp = cu.qp;
......@@ -1917,7 +1941,11 @@ void CABACReader::cu_palette_info(CodingUnit& cu, ComponentID compBegin, uint32_
if (cu.cs->slice->getUseChromaQpAdj() && !cu.transQuantBypass && !cuCtx.isChromaQpAdjCoded)
#endif
{
#if JVET_O0050_LOCAL_DUAL_TREE
if (!cu.isSepTree() || isChroma(tu.chType))
#else
if (!CS::isDualITree(*tu.cs) || isChroma(tu.chType))
#endif
{
cu_chroma_qp_offset(cu);
cuCtx.isChromaQpAdjCoded = true;
......
......@@ -425,7 +425,11 @@ void DecCu::xReconIntraQT( CodingUnit &cu )
#if JVET_O0119_BASE_PALETTE_444
if (CU::isPLT(cu))
{
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.isSepTree())
#else
if (CS::isDualITree(*cu.cs))
#endif
{
if (cu.chType == CHANNEL_TYPE_LUMA)
{
......
......@@ -680,7 +680,11 @@ void CABACWriter::coding_unit( const CodingUnit& cu, Partitioner& partitioner, C
#if JVET_O0119_BASE_PALETTE_444
if (CU::isPLT(cu))
{
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.isSepTree())
#else
if (CS::isDualITree(*cu.cs))
#endif
{
if (isLuma(partitioner.chType))
{
......@@ -769,13 +773,13 @@ void CABACWriter::cu_skip_flag( const CodingUnit& cu )
{
#if JVET_O1161_IBC_MAX_SIZE
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.lwidth() < 128 && cu.lheight() < 128 && !cu.isConsInter()) // // disable IBC mode larger than 64x64 and disable IBC when only allowing inter mode
if (cu.lwidth() < 128 && cu.lheight() < 128 && !cu.isConsInter()) // disable IBC mode larger than 64x64 and disable IBC when only allowing inter mode
#else
if (cu.lwidth() < 128 && cu.lheight() < 128) // disable IBC mode larger than 64x64
#endif
#else
#if JVET_O0050_LOCAL_DUAL_TREE
if ((cu.lwidth() < 128 || cu.lheight() < 128) && !cu.isConsInter()) // // disable 128x128 IBC mode and disable IBC when only allowing inter mode
if ((cu.lwidth() < 128 || cu.lheight() < 128) && !cu.isConsInter()) // disable 128x128 IBC mode and disable IBC when only allowing inter mode
#else
if (cu.lwidth() < 128 || cu.lheight() < 128) // disable 128x128 IBC mode
#endif
......@@ -922,13 +926,18 @@ void CABACWriter::pred_mode( const CodingUnit& cu )
else
{
#if JVET_O0050_LOCAL_DUAL_TREE
if( cu.isConsIntra() || cu.isConsInter() )
if( cu.isConsInter() )
{
assert( (cu.isConsIntra() && cu.predMode == MODE_INTRA) || (cu.isConsInter() && cu.predMode == MODE_INTER) );
assert( CU::isInter( cu ) );
return;
}
#endif
#if JVET_O0050_LOCAL_DUAL_TREE
if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) || cu.isConsIntra() )
#else
if ( cu.cs->slice->isIntra() || ( cu.lwidth() == 4 && cu.lheight() == 4 ) )
#endif
{
#if JVET_O0119_BASE_PALETTE_444
if (cu.cs->slice->getSPS()->getPLTMode() && cu.lwidth() <= 64 && cu.lheight() <= 64)
......@@ -3604,6 +3613,7 @@ void CABACWriter::residual_lfnst_mode( const CodingUnit& cu, CUCtx& cuCtx )
#else
if( cu.firstTU->mtsIdx < MTS_DST7_DST7 && CS::isDualITree( *cu.cs ) ) cctx++;
#endif
#endif
#endif
const uint32_t idxLFNST = cu.lfnstIdx;
......
......@@ -650,7 +650,11 @@ void EncCu::xCompressCU( CodingStructure *&tempCS, CodingStructure *&bestCS, Par
uint32_t compBegin;
uint32_t numComp;
bool jointPLT = false;
#if JVET_O0050_LOCAL_DUAL_TREE
if (partitioner.isSepTree( *tempCS ))
#else
if (CS::isDualITree(*bestCS))
#endif
{
if (isLuma(partitioner.chType))
{
......@@ -1867,8 +1871,13 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
{
#if JVET_O0502_ISP_CLEANUP
//the Intra SubPartitions mode uses the value of the best cost so far (luma if it is the fast version) to avoid test non-necessary lines
#if JVET_O0050_LOCAL_DUAL_TREE
double bestCostSoFar = partitioner.isSepTree(*tempCS) ? m_modeCtrl->getBestCostWithoutSplitFlags() : bestCU && bestCU->predMode == MODE_INTRA ? bestCS->lumaCost : bestCS->cost;
if (partitioner.isSepTree(*tempCS) && encTestMode.maxCostAllowed < bestCostSoFar)
#else
double bestCostSoFar = CS::isDualITree(*tempCS) ? m_modeCtrl->getBestCostWithoutSplitFlags() : bestCU && bestCU->predMode == MODE_INTRA ? bestCS->lumaCost : bestCS->cost;
if (CS::isDualITree(*tempCS) && encTestMode.maxCostAllowed < bestCostSoFar)
#endif
{
bestCostSoFar = encTestMode.maxCostAllowed;
}
......@@ -1878,6 +1887,7 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
const double bestCostSoFar = partitioner.isSepTree( *tempCS ) ? m_modeCtrl->getBestCostWithoutSplitFlags() : bestCU && bestCU->predMode == MODE_INTRA ? bestCS->lumaCost : bestCS->cost;
#else
const double bestCostSoFar = CS::isDualITree( *tempCS ) ? m_modeCtrl->getBestCostWithoutSplitFlags() : bestCU && bestCU->predMode == MODE_INTRA ? bestCS->lumaCost : bestCS->cost;
#endif
#endif
validCandRet = m_pcIntraSearch->estIntraPredLumaQT( cu, partitioner, bestCostSoFar, mtsFlag, startMTSIdx[ trGrpIdx ], endMTSIdx[ trGrpIdx ], ( trGrpIdx > 0 ) );
if( sps.getUseLFNST() && ( !validCandRet || ( cu.ispMode && cu.firstTU->cbf[ COMPONENT_Y ] == 0 ) ) )
......@@ -1989,7 +1999,11 @@ void EncCu::xCheckRDCostIntra( CodingStructure *&tempCS, CodingStructure *&bestC
#if JVET_O0472_LFNST_SIGNALLING_LAST_SCAN_POS
if( lfnstIdx && !cuCtx.lfnstLastScanPos )
{
#if JVET_O0050_LOCAL_DUAL_TREE
bool cbfAtZeroDepth = cu.isSepTree() ? cu.rootCbf : std::min( cu.firstTU->blocks[ 1 ].width, cu.firstTU->blocks[ 1 ].height ) < 4 ? TU::getCbfAtDepth( *cu.firstTU, COMPONENT_Y, 0 ) : cu.rootCbf;
#else
bool cbfAtZeroDepth = CS::isDualITree( *tempCS ) ? cu.rootCbf : std::min( cu.firstTU->blocks[ 1 ].width, cu.firstTU->blocks[ 1 ].height ) < 4 ? TU::getCbfAtDepth( *cu.firstTU, COMPONENT_Y, 0 ) : cu.rootCbf;
#endif
if( cbfAtZeroDepth )
{
tempCS->cost = MAX_DOUBLE;
......@@ -2210,7 +2224,11 @@ void EncCu::xCheckPLT(CodingStructure *&tempCS, CodingStructure *&bestCS, Partit
tempCS->addTU(CS::getArea(*tempCS, tempCS->area, partitioner.chType), partitioner.chType);
// Search
tempCS->dist = 0;
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.isSepTree())
#else
if (CS::isDualITree(*tempCS))
#endif
{
if (isLuma(partitioner.chType))
{
......@@ -2245,7 +2263,11 @@ void EncCu::xCheckPLT(CodingStructure *&tempCS, CodingStructure *&bestCS, Partit
CUCtx cuCtx;
cuCtx.isDQPCoded = true;
cuCtx.isChromaQpAdjCoded = true;
#if JVET_O0050_LOCAL_DUAL_TREE
if (cu.isSepTree())
#else
if (CS::isDualITree(*tempCS))
#endif
{
if (isLuma(partitioner.chType))
{
......
......@@ -6350,7 +6350,11 @@ void InterSearch::xEncodeInterResidualQT(CodingStructure &cs, Partitioner &parti
if( cu.chromaFormat != CHROMA_400
#if JVET_O0545_MAX_TB_SIGNALLING
#if JVET_O0050_LOCAL_DUAL_TREE
&& (!cu.isSepTree() || isChroma(partitioner.chType))
#else
&& (!CS::isDualITree(cs) || isChroma(partitioner.chType))
#endif
#endif
)
{
......
Markdown is supported
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