Commit 34d05ab7 authored by Xiang Li's avatar Xiang Li Committed by Frank Bossen
Browse files

Merge branch 'jvet-n0400-trianglenum' of...

Merge branch 'jvet-n0400-trianglenum' of https://vcgit.hhi.fraunhofer.de/XiangLi/VVCSoftware_VTM into jvet-n0400-trianglenum
parent d7e09714
......@@ -1229,6 +1229,12 @@ $}
Specifies the maximum number of merge candidates to use.
\\
\Option{MaxNumTriangleCand} &
%\ShortOption{\None} &
\Default{5} &
Specifies the maximum number of triangle merge candidates to use.
\\
\Option{DisableIntraInInter} &
%\ShortOption{\None} &
\Default{0} &
......
......@@ -368,6 +368,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setPCMLog2MaxSize ( m_pcmLog2MaxSize);
m_cEncLib.setMaxNumMergeCand ( m_maxNumMergeCand );
m_cEncLib.setMaxNumAffineMergeCand ( m_maxNumAffineMergeCand );
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
m_cEncLib.setMaxNumTriangleCand ( m_maxNumTriangleCand );
#endif
//====== Weighted Prediction ========
m_cEncLib.setUseWP ( m_useWeightedPred );
......
......@@ -1107,6 +1107,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
#endif
("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates")
("MaxNumAffineMergeCand", m_maxNumAffineMergeCand, 5u, "Maximum number of affine merge candidates")
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
("MaxNumTriangleCand", m_maxNumTriangleCand, 5u, "Maximum number of triangle candidates")
#endif
/* Misc. */
("SEIDecodedPictureHash,-dph", tmpDecodedPictureHashSEIMappedType, 0, "Control generation of decode picture hash SEI messages\n"
"\t3: checksum\n"
......@@ -2306,6 +2309,11 @@ bool EncAppCfg::xCheckParameter()
#endif
xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater.");
xConfirmPara( m_maxNumMergeCand > MRG_MAX_NUM_CANDS, "MaxNumMergeCand must be no more than MRG_MAX_NUM_CANDS." );
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
xConfirmPara( m_maxNumTriangleCand > TRIANGLE_MAX_NUM_UNI_CANDS, "MaxNumTriangleCand must be no more than TRIANGLE_MAX_NUM_UNI_CANDS." );
xConfirmPara( m_maxNumTriangleCand > m_maxNumMergeCand, "MaxNumTriangleCand must be no more than MaxNumMergeCand." );
xConfirmPara( 0 < m_maxNumTriangleCand && m_maxNumTriangleCand < 2, "MaxNumTriangleCand must be no less than 2 unless MaxNumTriangleCand is 0." );
#endif
xConfirmPara( m_maxNumAffineMergeCand < 1, "MaxNumAffineMergeCand must be 1 or greater." );
xConfirmPara( m_maxNumAffineMergeCand > AFFINE_MRG_MAX_NUM_CANDS, "MaxNumAffineMergeCand must be no more than AFFINE_MRG_MAX_NUM_CANDS." );
......@@ -3073,6 +3081,9 @@ void EncAppCfg::xPrintParameter()
msg( DETAILS, "Max Num Merge Candidates : %d\n", m_maxNumMergeCand );
msg( DETAILS, "Max Num Affine Merge Candidates : %d\n", m_maxNumAffineMergeCand );
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
msg( DETAILS, "Max Num Triangle Merge Candidates : %d\n", m_maxNumTriangleCand );
#endif
msg( DETAILS, "\n");
msg( VERBOSE, "TOOL CFG: ");
......
......@@ -488,6 +488,9 @@ protected:
uint32_t m_log2ParallelMergeLevel; ///< Parallel merge estimation region
uint32_t m_maxNumMergeCand; ///< Max number of merge candidates
uint32_t m_maxNumAffineMergeCand; ///< Max number of affine merge candidates
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
uint32_t m_maxNumTriangleCand;
#endif
int m_TMVPModeId;
bool m_depQuantEnabledFlag;
......
......@@ -415,9 +415,17 @@ static const int MAX_LADF_INTERVALS = 5; /// max n
static const int NTAPS_BILINEAR = 2; ///< Number of taps for bilinear filter
static const int ATMVP_SUB_BLOCK_SIZE = 3; ///< sub-block size for ATMVP
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
static const int TRIANGLE_MAX_NUM_UNI_CANDS = 6;
#else
static const int TRIANGLE_MAX_NUM_UNI_CANDS = 5;
#endif
static const int TRIANGLE_MAX_NUM_CANDS_MEM = 7;
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
static const int TRIANGLE_MAX_NUM_CANDS = TRIANGLE_MAX_NUM_UNI_CANDS * (TRIANGLE_MAX_NUM_UNI_CANDS - 1) * 2;
#else
static const int TRIANGLE_MAX_NUM_CANDS = 40;
#endif
static const int TRIANGLE_MAX_NUM_SATD_CANDS = 3;
static const int TRIANGLE_MIN_SIZE = 8 * 8;
......
......@@ -90,6 +90,9 @@ Slice::Slice()
, m_colRefIdx ( 0 )
, m_maxNumMergeCand ( 0 )
, m_maxNumAffineMergeCand ( 0 )
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
, m_maxNumTriangleCand ( 0 )
#endif
, m_disFracMMVD ( false )
, m_uiTLayer ( 0 )
, m_bTLayerSwitchingFlag ( false )
......@@ -862,6 +865,9 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_enableTMVPFlag = pSrc->m_enableTMVPFlag;
m_maxNumMergeCand = pSrc->m_maxNumMergeCand;
m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand;
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
m_maxNumTriangleCand = pSrc->m_maxNumTriangleCand;
#endif
m_disFracMMVD = pSrc->m_disFracMMVD;
if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag;
......
......@@ -1801,6 +1801,9 @@ private:
uint32_t m_colRefIdx;
uint32_t m_maxNumMergeCand;
uint32_t m_maxNumAffineMergeCand;
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
uint32_t m_maxNumTriangleCand;
#endif
bool m_disFracMMVD;
double m_lambdas[MAX_NUM_COMPONENT];
......@@ -2056,6 +2059,10 @@ public:
uint32_t getMaxNumMergeCand() const { return m_maxNumMergeCand; }
void setMaxNumAffineMergeCand( uint32_t val ) { m_maxNumAffineMergeCand = val; }
uint32_t getMaxNumAffineMergeCand() const { return m_maxNumAffineMergeCand; }
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
void setMaxNumTriangleCand(uint32_t val) { m_maxNumTriangleCand = val;}
uint32_t getMaxNumTriangleCand() const { return m_maxNumTriangleCand;}
#endif
void setDisFracMMVD( bool val ) { m_disFracMMVD = val; }
bool getDisFracMMVD() const { return m_disFracMMVD; }
void setNoOutputPriorPicsFlag( bool val ) { m_noOutputPriorPicsFlag = val; }
......
......@@ -50,6 +50,8 @@
#include <assert.h>
#include <cassert>
#define JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM 1 // JVET-N0400, JVET-N0447, JVET-N0500, JVET-N0851, align triangle merge candidate number and regular merge candidate number
#define JVET_N0413_RDPCM 1 // Residual DPCM JVET-N0413/N0214
#define JVET_N0866_UNIF_TRFM_SEL_IMPL_MTS_ISP 1 // JVET-N0866: unified transform derivation for ISP and implicit MTS (combining JVET-N0172, JVET-N0375, JVET-N0419 and JVET-N0420)
......
......@@ -1861,8 +1861,15 @@ void CABACReader::merge_idx( PredictionUnit& pu )
}
return decIdx;
};
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
const int maxNumTriangleCand = pu.cs->slice->getMaxNumTriangleCand();
CHECK(maxNumTriangleCand < 2, "Incorrect max number of triangle candidates");
candIdx0 = decodeOneIdx(maxNumTriangleCand - 1);
candIdx1 = decodeOneIdx(maxNumTriangleCand - 2);
#else
candIdx0 = decodeOneIdx(TRIANGLE_MAX_NUM_UNI_CANDS - 1);
candIdx1 = decodeOneIdx(TRIANGLE_MAX_NUM_UNI_CANDS - 2);
#endif
candIdx1 += candIdx1 >= candIdx0 ? 1 : 0;
DTRACE( g_trace_ctx, D_SYNTAX, "merge_idx() triangle_split_dir=%d\n", splitDir );
DTRACE( g_trace_ctx, D_SYNTAX, "merge_idx() triangle_idx0=%d\n", candIdx0 );
......@@ -2196,6 +2203,13 @@ void CABACReader::triangle_mode( CodingUnit& cu )
return;
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
if (cu.cs->slice->getMaxNumTriangleCand() < 2)
{
return;
}
#endif
#if JVET_N600_AMVR_TPM_CTX_REDUCTION
cu.triangle = m_BinDecoder.decodeBin( Ctx::TriangleFlag(0) );
#else
......
......@@ -1915,6 +1915,18 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
READ_FLAG( uiCode, "tile_group_fracmmvd_disabled_flag" );
pcSlice->setDisFracMMVD( uiCode ? true : false );
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
if (sps->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
{
READ_UVLC(uiCode, "max_num_merge_cand_minus_max_num_triangle_cand");
CHECK(pcSlice->getMaxNumMergeCand() < uiCode, "Incorrrect max number of triangle candidates!");
pcSlice->setMaxNumTriangleCand((uint32_t)(pcSlice->getMaxNumMergeCand() - uiCode));
}
else
{
pcSlice->setMaxNumTriangleCand(0);
}
#endif
}
READ_SVLC( iCode, "slice_qp_delta" );
......
......@@ -1796,6 +1796,13 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
candIdx1 -= candIdx1 < candIdx0 ? 0 : 1;
auto encodeOneIdx = [this](uint8_t mrgIdx, int numCandminus1)
{
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
if (numCandminus1 == 0)
{
CHECK(mrgIdx, "Incorrect index!");
return;
}
#endif
if(mrgIdx == 0)
{
this->m_BinEncoder.encodeBin( 0, Ctx::MergeIdx() );
......@@ -1815,8 +1822,17 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
}
};
m_BinEncoder.encodeBinEP(splitDir);
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
const int maxNumTriangleCand = pu.cs->slice->getMaxNumTriangleCand();
CHECK(maxNumTriangleCand < 2, "Incorrect max number of triangle candidates");
CHECK(candIdx0 >= maxNumTriangleCand, "Incorrect candIdx0");
CHECK(candIdx1 >= maxNumTriangleCand, "Incorrect candIdx1");
encodeOneIdx(candIdx0, maxNumTriangleCand - 1);
encodeOneIdx(candIdx1, maxNumTriangleCand - 2);
#else
encodeOneIdx(candIdx0, TRIANGLE_MAX_NUM_UNI_CANDS - 1);
encodeOneIdx(candIdx1, TRIANGLE_MAX_NUM_UNI_CANDS - 2);
#endif
return;
}
int numCandminus1 = int( pu.cs->slice->getMaxNumMergeCand() ) - 1;
......@@ -2096,6 +2112,13 @@ void CABACWriter::triangle_mode( const CodingUnit& cu )
return;
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
if (cu.cs->slice->getMaxNumTriangleCand() < 2)
{
return;
}
#endif
#if JVET_N600_AMVR_TPM_CTX_REDUCTION
m_BinEncoder.encodeBin( cu.triangle, Ctx::TriangleFlag(0) );
#else
......
......@@ -491,6 +491,9 @@ protected:
uint32_t m_log2ParallelMergeLevelMinus2; ///< Parallel merge estimation region
uint32_t m_maxNumMergeCand; ///< Maximum number of merge candidates
uint32_t m_maxNumAffineMergeCand; ///< Maximum number of affine merge candidates
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
uint32_t m_maxNumTriangleCand;
#endif
#if HEVC_USE_SCALING_LISTS
ScalingListMode m_useScalingListId; ///< Using quantization matrix i.e. 0=off, 1=default, 2=file.
std::string m_scalingListFileName; ///< quantization matrix file name
......@@ -1288,6 +1291,10 @@ public:
uint32_t getMaxNumMergeCand () { return m_maxNumMergeCand; }
void setMaxNumAffineMergeCand ( uint32_t u ) { m_maxNumAffineMergeCand = u; }
uint32_t getMaxNumAffineMergeCand () { return m_maxNumAffineMergeCand; }
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
void setMaxNumTriangleCand ( uint32_t u ) { m_maxNumTriangleCand = u; }
uint32_t getMaxNumTriangleCand () { return m_maxNumTriangleCand; }
#endif
#if HEVC_USE_SCALING_LISTS
void setUseScalingListId ( ScalingListMode u ) { m_useScalingListId = u; }
ScalingListMode getUseScalingListId () { return m_useScalingListId; }
......
......@@ -65,7 +65,11 @@ extern std::recursive_mutex g_cache_mutex;
// ====================================================================================================================
// Constructor / destructor / create / destroy
// ====================================================================================================================
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
EncCu::EncCu() : m_triangleModeTest
#else
const TriangleMotionInfo EncCu::m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS] =
#endif
{
TriangleMotionInfo( 0, 1, 0 ), TriangleMotionInfo( 1, 0, 1 ), TriangleMotionInfo( 1, 0, 2 ), TriangleMotionInfo( 0, 0, 1 ), TriangleMotionInfo( 0, 2, 0 ),
TriangleMotionInfo( 1, 0, 3 ), TriangleMotionInfo( 1, 0, 4 ), TriangleMotionInfo( 1, 1, 0 ), TriangleMotionInfo( 0, 3, 0 ), TriangleMotionInfo( 0, 4, 0 ),
......@@ -75,7 +79,12 @@ const TriangleMotionInfo EncCu::m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS] =
TriangleMotionInfo( 1, 3, 4 ), TriangleMotionInfo( 1, 4, 0 ), TriangleMotionInfo( 1, 3, 1 ), TriangleMotionInfo( 1, 2, 3 ), TriangleMotionInfo( 1, 4, 1 ),
TriangleMotionInfo( 0, 4, 1 ), TriangleMotionInfo( 0, 2, 3 ), TriangleMotionInfo( 1, 4, 2 ), TriangleMotionInfo( 0, 3, 2 ), TriangleMotionInfo( 1, 4, 3 ),
TriangleMotionInfo( 0, 3, 1 ), TriangleMotionInfo( 0, 2, 4 ), TriangleMotionInfo( 1, 2, 4 ), TriangleMotionInfo( 0, 4, 2 ), TriangleMotionInfo( 0, 3, 4 ),
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
}
{}
#else
};
#endif
void EncCu::create( EncCfg* encCfg )
{
......@@ -130,6 +139,40 @@ void EncCu::create( EncCfg* encCfg )
{
m_acRealMergeBuffer[ui].create(chromaFormat, Area(0, 0, uiMaxWidth, uiMaxHeight));
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
const unsigned maxNumTriangleCand = encCfg->getMaxNumTriangleCand();
for (unsigned i = 0; i < maxNumTriangleCand; i++)
{
for (unsigned j = 0; j < maxNumTriangleCand; j++)
{
if (i == j)
continue;
uint8_t idxBits0 = i + (i == maxNumTriangleCand - 1 ? 0 : 1);
uint8_t candIdx1Enc = j - (j > i ? 1 : 0);
uint8_t idxBits1 = candIdx1Enc + (candIdx1Enc == maxNumTriangleCand - 2 ? 0 : 1);
m_triangleIdxBins[1][i][j] = m_triangleIdxBins[0][i][j] = 1 + idxBits0 + idxBits1;
}
}
if (maxNumTriangleCand != 5)
{
// update the table
int index = 0;
for (unsigned i = 0; i < maxNumTriangleCand; i++)
{
for (unsigned j = 0; j < maxNumTriangleCand; j++)
{
if (i == j)
continue;
for (unsigned dir = 0; dir < 2; dir++, index++)
{
m_triangleModeTest[index].m_splitDir = dir;
m_triangleModeTest[index].m_candIdx0 = i;
m_triangleModeTest[index].m_candIdx1 = j;
}
}
}
}
#else
for( unsigned ui = 0; ui < TRIANGLE_MAX_NUM_UNI_CANDS; ui++ )
{
for( unsigned uj = 0; uj < TRIANGLE_MAX_NUM_UNI_CANDS; uj++ )
......@@ -142,6 +185,7 @@ void EncCu::create( EncCfg* encCfg )
m_triangleIdxBins[1][ui][uj] = m_triangleIdxBins[0][ui][uj] = 1 + idxBits0 + idxBits1;
}
}
#endif
for( unsigned ui = 0; ui < TRIANGLE_MAX_NUM_CANDS; ui++ )
{
m_acTriangleWeightedBuffer[ui].create( chromaFormat, Area( 0, 0, uiMaxWidth, uiMaxHeight ) );
......@@ -2383,6 +2427,11 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
const Slice &slice = *tempCS->slice;
const SPS &sps = *tempCS->sps;
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
if (slice.getMaxNumTriangleCand() < 2)
return;
#endif
CHECK( slice.getSliceType() != B_SLICE, "Triangle mode is only applied to B-slices" );
tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
......@@ -2405,6 +2454,9 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
PelUnitBuf triangleWeightedBuffer[TRIANGLE_MAX_NUM_CANDS];
static_vector<uint8_t, TRIANGLE_MAX_NUM_CANDS> triangleRdModeList;
static_vector<double, TRIANGLE_MAX_NUM_CANDS> tianglecandCostList;
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
uint8_t numTriangleCandComb = slice.getMaxNumTriangleCand() * (slice.getMaxNumTriangleCand() - 1) * 2;
#endif
if( auto blkCache = dynamic_cast< CacheBlkInfoCtrl* >( m_modeCtrl ) )
{
......@@ -2446,7 +2498,12 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
#endif
PU::getTriangleMergeCandidates( pu, triangleMrgCtx );
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
const uint8_t maxNumTriangleCand = pu.cs->slice->getMaxNumTriangleCand();
for (uint8_t mergeCand = 0; mergeCand < maxNumTriangleCand; mergeCand++)
#else
for( uint8_t mergeCand = 0; mergeCand < TRIANGLE_MAX_NUM_UNI_CANDS; mergeCand++ )
#endif
{
triangleBuffer[mergeCand] = m_acMergeBuffer[mergeCand].getBuf(localUnitArea);
triangleMrgCtx.setMergeInfo( pu, mergeCand );
......@@ -2464,6 +2521,9 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
bool tempBufSet = bestIsSkip ? false : true;
triangleNumMrgSATDCand = bestIsSkip ? TRIANGLE_MAX_NUM_CANDS : TRIANGLE_MAX_NUM_SATD_CANDS;
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
triangleNumMrgSATDCand = min(triangleNumMrgSATDCand, numTriangleCandComb);
#endif
if( bestIsSkip )
{
for( uint8_t i = 0; i < TRIANGLE_MAX_NUM_CANDS; i++ )
......@@ -2502,6 +2562,10 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
numTriangleCandidate = TRIANGLE_MAX_NUM_CANDS;
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
numTriangleCandidate = min(numTriangleCandidate, numTriangleCandComb);
#endif
for( uint8_t mergeCand = 0; mergeCand < numTriangleCandidate; mergeCand++ )
{
bool splitDir = m_triangleModeTest[mergeCand].m_splitDir;
......@@ -2564,6 +2628,11 @@ void EncCu::xCheckRDCostMergeTriangle2Nx2N( CodingStructure *&tempCS, CodingStru
tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
triangleNumMrgSATDCand = min(triangleNumMrgSATDCand, (uint8_t)triangleRdModeList.size());
#endif
m_bestModeUpdated = tempCS->useDbCost = bestCS->useDbCost = false;
{
uint8_t iteration;
......
......@@ -74,6 +74,9 @@ struct TriangleMotionInfo
uint8_t m_candIdx1;
TriangleMotionInfo ( uint8_t splitDir, uint8_t candIdx0, uint8_t candIdx1 ): m_splitDir(splitDir), m_candIdx0(candIdx0), m_candIdx1(candIdx1) { }
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
TriangleMotionInfo() { m_splitDir = m_candIdx0 = m_candIdx1 = 0; }
#endif
};
class EncCu
: DecCu
......@@ -133,7 +136,11 @@ private:
#endif
int m_bestGbiIdx[2];
double m_bestGbiCost[2];
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
TriangleMotionInfo m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS];
#else
static const TriangleMotionInfo m_triangleModeTest[TRIANGLE_MAX_NUM_CANDS];
#endif
uint8_t m_triangleIdxBins[2][TRIANGLE_MAX_NUM_UNI_CANDS][TRIANGLE_MAX_NUM_UNI_CANDS];
#if SHARP_LUMA_DELTA_QP || ENABLE_QPA_SUB_CTU
void updateLambda ( Slice* slice, const int dQP, const bool updateRdCostLambda );
......@@ -163,6 +170,9 @@ public:
IbcHashMap& getIbcHashMap() { return m_ibcHashMap; }
EncCfg* getEncCfg() const { return m_pcEncCfg; }
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
EncCu();
#endif
~EncCu();
protected:
......
......@@ -732,6 +732,9 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
#endif
rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() );
rpcSlice->setMaxNumAffineMergeCand( m_pcCfg->getMaxNumAffineMergeCand() );
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
rpcSlice->setMaxNumTriangleCand ( m_pcCfg->getMaxNumTriangleCand() );
#endif
rpcSlice->setSplitConsOverrideFlag(false);
rpcSlice->setMinQTSize( rpcSlice->getSPS()->getMinQTSize(eSliceType));
rpcSlice->setMaxBTDepth( rpcSlice->isIntra() ? rpcSlice->getSPS()->getMaxBTDepthI() : rpcSlice->getSPS()->getMaxBTDepth() );
......
......@@ -1386,6 +1386,17 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
{
WRITE_FLAG( pcSlice->getDisFracMMVD(), "tile_group_fracmmvd_disabled_flag" );
}
#if JVET_N0400_SIGNAL_TRIANGLE_CAND_NUM
if (pcSlice->getSPS()->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
{
CHECK(pcSlice->getMaxNumMergeCand() < pcSlice->getMaxNumTriangleCand(), "Incorrrect max number of triangle candidates!");
WRITE_UVLC(pcSlice->getMaxNumMergeCand() - pcSlice->getMaxNumTriangleCand(), "max_num_merge_cand_minus_max_num_triangle_cand");
}
else
{
pcSlice->setMaxNumTriangleCand(0);
}
#endif
}
int iCode = pcSlice->getSliceQp() - ( pcSlice->getPPS()->getPicInitQPMinus26() + 26 );
WRITE_SVLC( iCode, "slice_qp_delta" );
......
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