Commit 910aaf87 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0632_AFFINE_MERGE

parent 77ab4d79
......@@ -320,9 +320,7 @@ void EncApp::xInitLibCfg()
m_cEncLib.setPCMLog2MaxSize ( m_pcmLog2MaxSize);
m_cEncLib.setMaxNumMergeCand ( m_maxNumMergeCand );
#if JVET_L0632_AFFINE_MERGE
m_cEncLib.setMaxNumAffineMergeCand ( m_maxNumAffineMergeCand );
#endif
//====== Weighted Prediction ========
m_cEncLib.setUseWP ( m_useWeightedPred );
......
......@@ -1072,9 +1072,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("SignHideFlag,-SBH", m_signDataHidingEnabledFlag, false )
#endif
("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates")
#if JVET_L0632_AFFINE_MERGE
("MaxNumAffineMergeCand", m_maxNumAffineMergeCand, 5u, "Maximum number of affine merge candidates")
#endif
/* Misc. */
("SEIDecodedPictureHash,-dph", tmpDecodedPictureHashSEIMappedType, 0, "Control generation of decode picture hash SEI messages\n"
"\t3: checksum\n"
......@@ -2271,7 +2269,6 @@ bool EncAppCfg::xCheckParameter()
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_L0632_AFFINE_MERGE
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." );
#if JVET_L0369_SUBBLOCK_MERGE
......@@ -2279,7 +2276,6 @@ bool EncAppCfg::xCheckParameter()
{
m_maxNumAffineMergeCand = m_SubPuMvpMode;
}
#endif
#endif
xConfirmPara( m_EMT < 0 || m_EMT >3, "EMT must be 0, 1, 2 or 3" );
......@@ -3028,9 +3024,7 @@ void EncAppCfg::xPrintParameter()
}
msg( DETAILS, "Max Num Merge Candidates : %d\n", m_maxNumMergeCand );
#if JVET_L0632_AFFINE_MERGE
msg( DETAILS, "Max Num Affine Merge Candidates : %d\n", m_maxNumAffineMergeCand );
#endif
msg( DETAILS, "\n");
msg( VERBOSE, "TOOL CFG: ");
......
......@@ -443,9 +443,7 @@ protected:
uint32_t m_log2ParallelMergeLevel; ///< Parallel merge estimation region
uint32_t m_maxNumMergeCand; ///< Max number of merge candidates
#if JVET_L0632_AFFINE_MERGE
uint32_t m_maxNumAffineMergeCand; ///< Max number of affine merge candidates
#endif
int m_TMVPModeId;
bool m_depQuantEnabledFlag;
......
......@@ -139,9 +139,7 @@ static const int AMVP_MAX_NUM_CANDS = 2; ///< AMVP
static const int AMVP_MAX_NUM_CANDS_MEM = 3; ///< AMVP: advanced motion vector prediction - max number of candidates
static const int AMVP_DECIMATION_FACTOR = 2;
static const int MRG_MAX_NUM_CANDS = 7; ///< MERGE
#if JVET_L0632_AFFINE_MERGE
static const int AFFINE_MRG_MAX_NUM_CANDS = 5; ///< AFFINE MERGE
#endif
static const int MAX_TLAYER = 7; ///< Explicit temporal layer QP offset - max number of temporal layer
......@@ -359,9 +357,7 @@ static const int FAST_SKIP_DEPTH = 2;
static const double PBINTRA_RATIO = 1.1;
static const int NUM_MRG_SATD_CAND = 4;
static const double MRG_FAST_RATIO = 1.25;
#if JVET_L0632_AFFINE_MERGE
static const int NUM_AFF_MRG_SATD_CAND = 1;
#endif
static const double AMAXBT_TH32 = 15.0;
static const double AMAXBT_TH64 = 30.0;
......
......@@ -274,7 +274,6 @@ public:
void setMergeInfo( PredictionUnit& pu, int candIdx );
};
#if JVET_L0632_AFFINE_MERGE
class AffineMergeCtx
{
public:
......@@ -293,7 +292,6 @@ public:
MergeType mergeType[AFFINE_MRG_MAX_NUM_CANDS];
#endif
};
#endif
namespace DeriveCtx
......
......@@ -490,7 +490,6 @@ const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
#endif
});
#if JVET_L0632_AFFINE_MERGE
const CtxSet ContextSetCfg::AffMergeIdx = ContextSetCfg::addCtxSet
( {
#if TRAINED_CABAC_INIT_TABLES
......@@ -503,7 +502,6 @@ const CtxSet ContextSetCfg::AffMergeIdx = ContextSetCfg::addCtxSet
{ CNU, CNU, CNU, CNU, CNU, },
#endif
} );
#endif
const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
({
......
......@@ -172,9 +172,7 @@ public:
static const CtxSet MmvdStepMvpIdx;
static const CtxSet AffineFlag;
static const CtxSet AffineType;
#if JVET_L0632_AFFINE_MERGE
static const CtxSet AffMergeIdx;
#endif
static const CtxSet Mvd;
static const CtxSet TransSubdivFlag;
static const CtxSet QtRootCbf;
......
......@@ -88,9 +88,7 @@ Slice::Slice()
, m_handleCraAsBlaFlag ( false )
, m_colRefIdx ( 0 )
, m_maxNumMergeCand ( 0 )
#if JVET_L0632_AFFINE_MERGE
, m_maxNumAffineMergeCand ( 0 )
#endif
, m_uiTLayer ( 0 )
, m_bTLayerSwitchingFlag ( false )
, m_sliceMode ( NO_SLICES )
......@@ -206,9 +204,7 @@ void Slice::initSlice()
}
m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
#if JVET_L0632_AFFINE_MERGE
m_maxNumAffineMergeCand = AFFINE_MRG_MAX_NUM_CANDS;
#endif
m_bFinalized=false;
......@@ -870,9 +866,7 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_subPuMvpSubBlkLog2Size = pSrc->m_subPuMvpSubBlkLog2Size;
#endif
m_maxNumMergeCand = pSrc->m_maxNumMergeCand;
#if JVET_L0632_AFFINE_MERGE
m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand;
#endif
if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag;
......
......@@ -1660,9 +1660,7 @@ private:
uint32_t m_colRefIdx;
uint32_t m_maxNumMergeCand;
#if JVET_L0632_AFFINE_MERGE
uint32_t m_maxNumAffineMergeCand;
#endif
double m_lambdas[MAX_NUM_COMPONENT];
......@@ -1904,10 +1902,8 @@ public:
);
void setMaxNumMergeCand(uint32_t val ) { m_maxNumMergeCand = val; }
uint32_t getMaxNumMergeCand() const { return m_maxNumMergeCand; }
#if JVET_L0632_AFFINE_MERGE
void setMaxNumAffineMergeCand( uint32_t val ) { m_maxNumAffineMergeCand = val; }
uint32_t getMaxNumAffineMergeCand() const { return m_maxNumAffineMergeCand; }
#endif
void setNoOutputPriorPicsFlag( bool val ) { m_noOutputPriorPicsFlag = val; }
bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; }
......
......@@ -82,10 +82,7 @@
#define JVET_L0632_AFFINE_MERGE 1 // L0142/L0632: Affine merge list construction
#if JVET_L0632_AFFINE_MERGE
#define JVET_L0369_SUBBLOCK_MERGE 1 // Moving ATMVP into the sub-block merge list
#endif
#define REUSE_CU_RESULTS 1
......
......@@ -2624,7 +2624,6 @@ bool PU::isBipredRestriction(const PredictionUnit &pu)
return false;
}
#if JVET_L0632_AFFINE_MERGE
void PU::getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgType )
{
int cuW = pu.Y().width;
......@@ -3269,99 +3268,6 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
}
}
}
#else
const PredictionUnit* getFirstAvailableAffineNeighbour( const PredictionUnit &pu )
{
const Position posLT = pu.Y().topLeft();
const Position posRT = pu.Y().topRight();
const Position posLB = pu.Y().bottomLeft();
const PredictionUnit* puLeft = pu.cs->getPURestricted( posLB.offset( -1, 0 ), pu, pu.chType );
if( puLeft && puLeft->cu->affine )
{
return puLeft;
}
const PredictionUnit* puAbove = pu.cs->getPURestricted( posRT.offset( 0, -1 ), pu, pu.chType );
if( puAbove && puAbove->cu->affine )
{
return puAbove;
}
const PredictionUnit* puAboveRight = pu.cs->getPURestricted( posRT.offset( 1, -1 ), pu, pu.chType );
if( puAboveRight && puAboveRight->cu->affine )
{
return puAboveRight;
}
const PredictionUnit *puLeftBottom = pu.cs->getPURestricted( posLB.offset( -1, 1 ), pu, pu.chType );
if( puLeftBottom && puLeftBottom->cu->affine )
{
return puLeftBottom;
}
const PredictionUnit *puAboveLeft = pu.cs->getPURestricted( posLT.offset( -1, -1 ), pu, pu.chType );
if( puAboveLeft && puAboveLeft->cu->affine )
{
return puAboveLeft;
}
return nullptr;
}
bool PU::isAffineMrgFlagCoded( const PredictionUnit &pu )
{
if ( pu.cu->lumaSize().width < 8 || pu.cu->lumaSize().height < 8 )
{
return false;
}
return getFirstAvailableAffineNeighbour( pu ) != nullptr;
}
void PU::getAffineMergeCand( const PredictionUnit &pu, MvField(*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, unsigned char &gbiIdx, int &numValidMergeCand )
{
for ( int mvNum = 0; mvNum < 3; mvNum++ )
{
mvFieldNeighbours[0][mvNum].setMvField( Mv(), -1 );
mvFieldNeighbours[1][mvNum].setMvField( Mv(), -1 );
}
const PredictionUnit* puFirstNeighbour = getFirstAvailableAffineNeighbour( pu );
if( puFirstNeighbour == nullptr )
{
numValidMergeCand = -1;
gbiIdx = GBI_DEFAULT;
return;
}
else
{
numValidMergeCand = 1;
}
// get Inter Dir
interDirNeighbours = puFirstNeighbour->getMotionInfo().interDir;
pu.cu->affineType = puFirstNeighbour->cu->affineType;
// derive Mv from neighbor affine block
Mv cMv[3];
if ( interDirNeighbours != 2 )
{
xInheritedAffineMv( pu, puFirstNeighbour, REF_PIC_LIST_0, cMv );
for ( int mvNum = 0; mvNum < 3; mvNum++ )
{
mvFieldNeighbours[0][mvNum].setMvField( cMv[mvNum], puFirstNeighbour->refIdx[0] );
}
}
if ( pu.cs->slice->isInterB() )
{
if ( interDirNeighbours != 1 )
{
xInheritedAffineMv( pu, puFirstNeighbour, REF_PIC_LIST_1, cMv );
for ( int mvNum = 0; mvNum < 3; mvNum++ )
{
mvFieldNeighbours[1][mvNum].setMvField( cMv[mvNum], puFirstNeighbour->refIdx[1] );
}
}
}
gbiIdx = puFirstNeighbour->cu->GBiIdx;
}
#endif
void PU::setAllAffineMvField( PredictionUnit &pu, MvField *mvField, RefPicList eRefList )
{
......
......@@ -139,13 +139,8 @@ namespace PU
bool isBipredRestriction (const PredictionUnit &pu);
void spanMotionInfo ( PredictionUnit &pu, const MergeCtx &mrgCtx = MergeCtx() );
void applyImv ( PredictionUnit &pu, MergeCtx &mrgCtx, InterPrediction *interPred = NULL );
#if JVET_L0632_AFFINE_MERGE
void getAffineControlPointCand( const PredictionUnit &pu, MotionInfo mi[4], bool isAvailable[4], int verIdx[4], int modelIdx, int verNum, AffineMergeCtx& affMrgCtx );
void getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx, const int mrgCandIdx = -1 );
#else
void getAffineMergeCand (const PredictionUnit &pu, MvField(*mvFieldNeighbours)[3], unsigned char &interDirNeighbours, unsigned char &gbiIdx, int &numValidMergeCand);
bool isAffineMrgFlagCoded (const PredictionUnit &pu );
#endif
void setAllAffineMvField ( PredictionUnit &pu, MvField *mvField, RefPicList eRefList );
void setAllAffineMv ( PredictionUnit &pu, Mv affLT, Mv affRT, Mv affLB, RefPicList eRefList
, bool setHighPrec = false
......
......@@ -882,13 +882,7 @@ void writeAllCodedData(const CodingStructure & cs, const UnitArea & ctuArea)
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::InterDir), pu.interDir);
}
#if JVET_L0632_AFFINE_MERGE
if (!cu.cs->slice->isIntra() && cu.cs->sps->getSpsNext().getUseAffine() && cu.lumaSize().width > 8 && cu.lumaSize().height > 8)
#else
if (!(cu.cs->slice->isIntra() || !cu.cs->sps->getSpsNext().getUseAffine())
&& !(!cu.firstPU->mergeFlag && !(cu.lumaSize().width > 8 && cu.lumaSize().height > 8))
&& !(cu.firstPU->mergeFlag && !PU::isAffineMrgFlagCoded(*cu.firstPU)))
#endif
{
DTRACE_BLOCK_SCALAR(g_trace_ctx, D_BLOCK_STATISTICS_CODED, pu, GetBlockStatisticName(BlockStatistic::AffineFlag), pu.cu->affine);
if (cu.affine && !cu.firstPU->mergeFlag && cu.cs->sps->getSpsNext().getUseAffineType())
......
......@@ -1339,11 +1339,7 @@ void CABACReader::affine_flag( CodingUnit& cu )
return;
}
#if JVET_L0632_AFFINE_MERGE
if ( cu.firstPU->mergeFlag && !(cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8) )
#else
if( cu.firstPU->mergeFlag && !PU::isAffineMrgFlagCoded( *cu.firstPU ) )
#endif
{
return;
}
......@@ -1389,12 +1385,6 @@ void CABACReader::merge_flag( PredictionUnit& pu )
void CABACReader::merge_data( PredictionUnit& pu )
{
#if !JVET_L0632_AFFINE_MERGE
if ( pu.cu->affine )
{
return;
}
#endif
if (pu.cu->mmvdSkip)
{
......@@ -1409,7 +1399,6 @@ void CABACReader::merge_idx( PredictionUnit& pu )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__MERGE_INDEX );
#if JVET_L0632_AFFINE_MERGE
if ( pu.cu->affine )
{
int numCandminus1 = int( pu.cs->slice->getMaxNumAffineMergeCand() ) - 1;
......@@ -1443,7 +1432,6 @@ void CABACReader::merge_idx( PredictionUnit& pu )
}
else
{
#endif
int numCandminus1 = int( pu.cs->slice->getMaxNumMergeCand() ) - 1;
pu.mergeIdx = 0;
......@@ -1478,9 +1466,7 @@ void CABACReader::merge_idx( PredictionUnit& pu )
}
}
DTRACE( g_trace_ctx, D_SYNTAX, "merge_idx() merge_idx=%d\n", pu.mergeIdx );
#if JVET_L0632_AFFINE_MERGE
}
#endif
}
void CABACReader::mmvd_merge_idx(PredictionUnit& pu)
......
......@@ -463,9 +463,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
}
#endif
#if !JVET_L0632_AFFINE_MERGE
uint8_t gbiIdx = GBI_DEFAULT;
#endif
if( pu.mergeFlag )
{
......@@ -499,7 +496,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
{
if( pu.cu->affine )
{
#if JVET_L0632_AFFINE_MERGE
AffineMergeCtx affineMergeCtx;
#if JVET_L0369_SUBBLOCK_MERGE
if ( pu.cs->sps->getSpsNext().getUseSubPuMvp() )
......@@ -516,14 +512,6 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
#if JVET_L0369_SUBBLOCK_MERGE
pu.mergeType = affineMergeCtx.mergeType[pu.mergeIdx];
#endif
#else
pu.mergeIdx = 0;
MvField affineMvField[2][3];
unsigned char interDirNeighbours;
int numValidMergeCand;
PU::getAffineMergeCand( pu, affineMvField, interDirNeighbours, gbiIdx, numValidMergeCand);
pu.interDir = interDirNeighbours;
#endif
#if JVET_L0369_SUBBLOCK_MERGE
if ( pu.mergeType == MRG_TYPE_SUBPU_ATMVP )
{
......@@ -537,18 +525,11 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
{
if( pu.cs->slice->getNumRefIdx( RefPicList( i ) ) > 0 )
{
#if JVET_L0632_AFFINE_MERGE
MvField* mvField = affineMergeCtx.mvFieldNeighbours[(pu.mergeIdx << 1) + i];
#else
MvField* mvField = affineMvField[i];
#endif
pu.mvpIdx[i] = 0;
pu.mvpNum[i] = 0;
pu.mvd[i] = Mv();
PU::setAllAffineMvField( pu, mvField, RefPicList( i ) );
#if !JVET_L0632_AFFINE_MERGE
pu.cu->GBiIdx = gbiIdx;
#endif
}
}
#if JVET_L0369_SUBBLOCK_MERGE
......
......@@ -1895,7 +1895,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
pcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode - ( sps->getSpsNext().getUseSubPuMvp() ? 0 : 2 ) );
#endif
#if JVET_L0632_AFFINE_MERGE
#if JVET_L0369_SUBBLOCK_MERGE
if ( sps->getSpsNext().getUseSubPuMvp() && !sps->getSpsNext().getUseAffine() ) // ATMVP only
{
......@@ -1912,7 +1911,6 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
READ_UVLC( uiCode, "five_minus_max_num_affine_merge_cand" );
pcSlice->setMaxNumAffineMergeCand( AFFINE_MRG_MAX_NUM_CANDS - uiCode );
}
#endif
}
READ_SVLC( iCode, "slice_qp_delta" );
......
......@@ -1317,11 +1317,7 @@ void CABACWriter::affine_flag( const CodingUnit& cu )
return;
}
#if JVET_L0632_AFFINE_MERGE
if ( cu.firstPU->mergeFlag && !(cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8) )
#else
if( cu.firstPU->mergeFlag && !PU::isAffineMrgFlagCoded( *cu.firstPU ) )
#endif
{
return;
}
......@@ -1392,14 +1388,7 @@ void CABACWriter::imv_mode( const CodingUnit& cu )
void CABACWriter::merge_idx( const PredictionUnit& pu )
{
#if !JVET_L0632_AFFINE_MERGE
if ( pu.cu->affine )
{
return;
}
#endif
#if JVET_L0632_AFFINE_MERGE
if ( pu.cu->affine )
{
int numCandminus1 = int( pu.cs->slice->getMaxNumAffineMergeCand() ) - 1;
......@@ -1436,7 +1425,6 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
}
else
{
#endif
if( pu.cu->triangle )
{
if( pu.mergeIdx < 2 )
......@@ -1476,9 +1464,7 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
}
}
DTRACE( g_trace_ctx, D_SYNTAX, "merge_idx() merge_idx=%d\n", pu.mergeIdx );
#if JVET_L0632_AFFINE_MERGE
}
#endif
}
void CABACWriter::mmvd_merge_idx(const PredictionUnit& pu)
{
......
......@@ -464,9 +464,7 @@ protected:
WeightedPredictionMethod m_weightedPredictionMethod;
uint32_t m_log2ParallelMergeLevelMinus2; ///< Parallel merge estimation region
uint32_t m_maxNumMergeCand; ///< Maximum number of merge candidates
#if JVET_L0632_AFFINE_MERGE
uint32_t m_maxNumAffineMergeCand; ///< Maximum number of affine merge candidates
#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
......@@ -1234,10 +1232,8 @@ public:
uint32_t getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; }
void setMaxNumMergeCand ( uint32_t u ) { m_maxNumMergeCand = u; }
uint32_t getMaxNumMergeCand () { return m_maxNumMergeCand; }
#if JVET_L0632_AFFINE_MERGE
void setMaxNumAffineMergeCand ( uint32_t u ) { m_maxNumAffineMergeCand = u; }
uint32_t getMaxNumAffineMergeCand () { return m_maxNumAffineMergeCand; }
#endif
#if HEVC_USE_SCALING_LISTS
void setUseScalingListId ( ScalingListMode u ) { m_useScalingListId = u; }
ScalingListMode getUseScalingListId () { return m_useScalingListId; }
......
......@@ -2411,7 +2411,6 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
return;
}
#if JVET_L0632_AFFINE_MERGE
const Slice &slice = *tempCS->slice;
CHECK( slice.getSliceType() == I_SLICE, "Affine Merge modes not available for I-slices" );
......@@ -2685,68 +2684,6 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
}
}
}
#else
MvField affineMvField[2][3];
unsigned char interDirNeighbours;
int numValidMergeCand;
bool hasNoResidual = false;
uint8_t gbiIdx = GBI_DEFAULT;
tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
CodingUnit &cu = tempCS->addCU( tempCS->area, partitioner.chType );
partitioner.setCUData( cu );
cu.slice = tempCS->slice;
#if HEVC_TILES_WPP
cu.tileIdx = tempCS->picture->tileMap->getTileIdxMap( tempCS->area.lumaPos() );
#endif
cu.skip = false;
cu.mmvdSkip = false;
cu.partSize = encTestMode.partSize;
cu.affine = true;
cu.predMode = MODE_INTER;
cu.transQuantBypass = encTestMode.lossless;
cu.chromaQpAdj = cu.transQuantBypass ? 0 : m_cuChromaQpOffsetIdxPlus1;
cu.qp = encTestMode.qp;
CU::addPUs( cu );
cu.firstPU->mergeFlag = true;
cu.firstPU->mergeIdx = 0;
PU::getAffineMergeCand( *cu.firstPU, affineMvField, interDirNeighbours, gbiIdx, numValidMergeCand );
if( numValidMergeCand == -1 )
{
return;
}
cu.firstPU->interDir = interDirNeighbours;
PU::setAllAffineMvField( *cu.firstPU, affineMvField[REF_PIC_LIST_0], REF_PIC_LIST_0 );
PU::setAllAffineMvField( *cu.firstPU, affineMvField[REF_PIC_LIST_1], REF_PIC_LIST_1 );
cu.GBiIdx = gbiIdx;
PU::spanMotionInfo( *cu.firstPU );
m_pcInterSearch->motionCompensation( cu );
xEncodeInterResidual(tempCS, bestCS, partitioner, encTestMode, 0
, NULL
, 1
, &hasNoResidual);
if( ! (encTestMode.lossless || hasNoResidual) )
{
tempCS->initStructData( encTestMode.qp, encTestMode.lossless );
tempCS->copyStructure( *bestCS, partitioner.chType );
tempCS->getPredBuf().copyFrom( bestCS->getPredBuf() );
xEncodeInterResidual(tempCS, bestCS, partitioner, encTestMode, 1
, NULL
, 1
, &hasNoResidual);
}
#endif
}
#if JVET_L0293_CPR
//////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -672,9 +672,7 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
#endif
rpcSlice->setMaxNumMergeCand ( m_pcCfg->getMaxNumMergeCand() );
#if JVET_L0632_AFFINE_MERGE
rpcSlice->setMaxNumAffineMergeCand( m_pcCfg->getMaxNumAffineMergeCand() );
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
#if JVET_L0217_L0678_SPS_CLEANUP
rpcSlice->setSplitConsOverrideFlag(false);
......
......@@ -1366,7 +1366,6 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
WRITE_UVLC( MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand() - ( pcSlice->getSPS()->getSpsNext().getUseSubPuMvp() ? 0 : 2 ), pcSlice->getSPS()->getSpsNext().getUseSubPuMvp() ? "seven_minus_max_num_merge_cand" : "five_minus_max_num_merge_cand" );
#endif
#if JVET_L0632_AFFINE_MERGE
#if JVET_L0369_SUBBLOCK_MERGE
if ( pcSlice->getSPS()->getSpsNext().getUseSubPuMvp() && !pcSlice->getSPS()->getSpsNext().getUseAffine() ) // ATMVP only
{
......@@ -1384,7 +1383,6 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
CHECK( pcSlice->getMaxNumAffineMergeCand() > AFFINE_MRG_MAX_NUM_CANDS, "More affine merge candidates signalled than supported" );
WRITE_UVLC( AFFINE_MRG_MAX_NUM_CANDS - pcSlice->getMaxNumAffineMergeCand(), "five_minus_max_num_affine_merge_cand" );
}
#endif
}
int iCode = pcSlice->getSliceQp() - ( pcSlice->getPPS()->getPicInitQPMinus26() + 26 );
WRITE_SVLC( iCode, "slice_qp_delta" );
......
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