...
 
Commits (2)
......@@ -1964,7 +1964,6 @@ SPS::SPS()
#if JVET_M0427_INLOOP_RESHAPER
, m_lumaReshapeEnable (false)
#endif
// KJS: BEGIN former SPSNext parameters
, m_AMVREnabledFlag ( false )
, m_LMChroma ( false )
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
......@@ -1987,11 +1986,9 @@ SPS::SPS()
, m_LadfQpOffset { 0 }
, m_LadfIntervalLowerBound { 0 }
#endif
, m_compositeRefEnabled ( false )
#if !JVET_M0483_IBC
, m_IBCMode ( 0 )
#endif
// KJS: END former SPSNext parameters
{
for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
......
......@@ -949,9 +949,8 @@ private:
#if JVET_M0427_INLOOP_RESHAPER
bool m_lumaReshapeEnable;
#endif
// KJS: BEGIN former SPSNext parameters
bool m_AMVREnabledFlag;
bool m_LMChroma; // 17
bool m_LMChroma;
#if JVET_M0142_CCLM_COLLOCATED_CHROMA
bool m_cclmCollocatedChromaFlag;
#endif
......@@ -977,12 +976,9 @@ private:
int m_LadfIntervalLowerBound[MAX_LADF_INTERVALS];
#endif
bool m_compositeRefEnabled; //composite longterm reference
#if !JVET_M0483_IBC
unsigned m_IBCMode;
#endif
// KJS: END former SPSNext parameters
public:
......@@ -1217,7 +1213,6 @@ public:
uint8_t getMaxSbtSize() const { return m_MaxSbtSize; }
#endif
// KJS: BEGIN former SPSNext parameters
void setAMVREnabledFlag ( bool b ) { m_AMVREnabledFlag = b; }
bool getAMVREnabledFlag () const { return m_AMVREnabledFlag; }
void setUseAffine ( bool b ) { m_Affine = b; }
......@@ -1262,10 +1257,7 @@ public:
void setLadfIntervalLowerBound( int value, int idx ) { m_LadfIntervalLowerBound[ idx ] = value; }
int getLadfIntervalLowerBound( int idx ) const { return m_LadfIntervalLowerBound[ idx ]; }
#endif
// KJS: this is encoder only, right?
void setUseCompositeRef(bool b) { m_compositeRefEnabled = b; }
bool getUseCompositeRef() const { return m_compositeRefEnabled; }
void setUseMHIntra ( bool b ) { m_MHIntra = b; }
bool getUseMHIntra () const { return m_MHIntra; }
void setUseTriangle ( bool b ) { m_Triangle = b; }
......@@ -1274,7 +1266,6 @@ public:
void setIBCMode (unsigned IBCMode) { m_IBCMode = IBCMode; }
unsigned getIBCMode () const { return m_IBCMode; }
#endif
// KJS: END former SPSNext parameters
};
......
......@@ -1549,7 +1549,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
setNewestBgPOC(pocCurr);
setLastLTRefPoc(pocCurr);
}
else if (pcPic->cs->sps->getUseCompositeRef() && getLastLTRefPoc() >= 0 && getEncodedLTRef()==false && !getPicBg()->getSpliceFull() && (pocCurr - getLastLTRefPoc()) > (m_pcCfg->getFrameRate() * 2))
else if (m_pcCfg->getUseCompositeRef() && getLastLTRefPoc() >= 0 && getEncodedLTRef()==false && !getPicBg()->getSpliceFull() && (pocCurr - getLastLTRefPoc()) > (m_pcCfg->getFrameRate() * 2))
{
setUseLTRef(false);
setPrepareLTRef(false);
......@@ -1558,7 +1558,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
setLastLTRefPoc(-1);
}
if (pcPic->cs->sps->getUseCompositeRef() && m_picBg->getSpliceFull() && getUseLTRef())
if (m_pcCfg->getUseCompositeRef() && m_picBg->getSpliceFull() && getUseLTRef())
{
m_pcEncLib->selectReferencePictureSet(pcSlice, pocCurr, iGOPid, m_bgPOC);
}
......@@ -1672,7 +1672,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
pcSlice->setNumRefIdx(REF_PIC_LIST_0, std::min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive, pcSlice->getRPS()->getNumberOfPictures()));
pcSlice->setNumRefIdx(REF_PIC_LIST_1, std::min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive, pcSlice->getRPS()->getNumberOfPictures()));
}
if (pcPic->cs->sps->getUseCompositeRef() && getPrepareLTRef()) {
if (m_pcCfg->getUseCompositeRef() && getPrepareLTRef()) {
arrangeCompositeReference(pcSlice, rcListPic, pocCurr);
}
#if JVET_M0483_IBC==0
......@@ -2467,7 +2467,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
pcPic->slices[s]->setAlfSliceParam( alfSliceParam );
}
}
if (pcPic->cs->sps->getUseCompositeRef() && getPrepareLTRef())
if (m_pcCfg->getUseCompositeRef() && getPrepareLTRef())
{
updateCompositeReference(pcSlice, rcListPic, pocCurr);
}
......@@ -2743,7 +2743,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
#endif
m_bFirst = false;
m_iNumPicCoded++;
if (!(pcPic->cs->sps->getUseCompositeRef() && isEncodeLtRef))
if (!(m_pcCfg->getUseCompositeRef() && isEncodeLtRef))
m_totalCoded ++;
/* logging: insert a newline at end of picture period */
......
......@@ -224,7 +224,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
omp_set_nested( true );
#endif
if (sps0.getUseCompositeRef())
if (getUseCompositeRef())
{
sps0.setLongTermRefsPresent(true);
}
......@@ -255,7 +255,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
xInitPPS(pps1, sps0);
}
#endif
if (sps0.getUseCompositeRef())
if (getUseCompositeRef())
{
PPS &pps2 = *(m_ppsMap.allocatePS(2));
xInitPPS(pps2, sps0);
......@@ -337,6 +337,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
m_iSearchRange,
m_bipredSearchRange,
m_motionEstimationSearchMethod,
getUseCompositeRef(),
m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, &m_cRdCost, cabacEstimator, getCtxCache()
#if JVET_M0427_INLOOP_RESHAPER
, &m_cReshaper
......@@ -365,7 +366,7 @@ void EncLib::init( bool isFieldCoding, AUWriterIf* auWriterIf )
#if ENABLE_WPP_PARALLELISM
m_entropyCodingSyncContextStateVec.resize( pps0.pcv->heightInCtus );
#endif
if (sps0.getUseCompositeRef())
if (getUseCompositeRef())
{
Picture *picBg = new Picture;
picBg->create(sps0.getChromaFormatIdc(), Size(sps0.getPicWidthInLumaSamples(), sps0.getPicHeightInLumaSamples()), sps0.getMaxCUWidth(), sps0.getMaxCUWidth() + 16, false);
......@@ -909,7 +910,6 @@ void EncLib::xInitSPS(SPS &sps)
sps.setMaxSbtSize ( m_iSourceWidth >= 1920 ? 64 : 32 );
}
#endif
sps.setUseCompositeRef ( m_compositeRefEnabled );
sps.setUseGBi ( m_GBi );
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
sps.setLadfEnabled ( m_LadfEnabled );
......
......@@ -275,8 +275,8 @@ void EncSlice::initEncSlice(Picture* pcPic, const int pocLast, const int pocCurr
rpcSlice->setSliceBits(0);
rpcSlice->setPic( pcPic );
rpcSlice->initSlice();
int multipleFactor = pcPic->cs->sps->getUseCompositeRef() ? 2 : 1;
if (pcPic->cs->sps->getUseCompositeRef() && isEncodeLtRef)
int multipleFactor = m_pcCfg->getUseCompositeRef() ? 2 : 1;
if (m_pcCfg->getUseCompositeRef() && isEncodeLtRef)
{
rpcSlice->setPicOutputFlag(false);
}
......
......@@ -194,6 +194,7 @@ void InterSearch::init( EncCfg* pcEncCfg,
int iSearchRange,
int bipredSearchRange,
MESearchMethod motionEstimationSearchMethod,
bool useCompositeRef,
const uint32_t maxCUWidth,
const uint32_t maxCUHeight,
const uint32_t maxTotalCUDepth,
......@@ -215,6 +216,7 @@ void InterSearch::init( EncCfg* pcEncCfg,
m_motionEstimationSearchMethod = motionEstimationSearchMethod;
m_CABACEstimator = CABACEstimator;
m_CtxCache = ctxCache;
m_useCompositeRef = useCompositeRef;
#if JVET_M0427_INLOOP_RESHAPER
m_pcReshape = pcReshape;
#endif
......@@ -2991,7 +2993,7 @@ void InterSearch::xMotionEstimation(PredictionUnit& pu, PelUnitBuf& origBuf, Ref
cStruct.inCtuSearch = false;
cStruct.zeroMV = false;
{
if (pu.cs->sps->getUseCompositeRef() && pu.cs->slice->getRefPic(eRefPicList, iRefIdxPred)->longTerm)
if (m_useCompositeRef && pu.cs->slice->getRefPic(eRefPicList, iRefIdxPred)->longTerm)
{
cStruct.inCtuSearch = true;
}
......@@ -3116,7 +3118,7 @@ void InterSearch::xSetSearchRange ( const PredictionUnit& pu,
sr.right = mvBR.hor;
sr.bottom = mvBR.ver;
if (pu.cs->sps->getUseCompositeRef() && cStruct.inCtuSearch)
if (m_useCompositeRef && cStruct.inCtuSearch)
{
Position posRB = pu.Y().bottomRight();
Position posTL = pu.Y().topLeft();
......@@ -3817,7 +3819,7 @@ void InterSearch::xPatternSearchFracDIF(
#endif
if (cStruct.imvShift || (pu.cs->sps->getUseCompositeRef() && cStruct.zeroMV))
if (cStruct.imvShift || (m_useCompositeRef && cStruct.zeroMV))
{
m_pcRdCost->setDistParam( m_cDistParam, *cStruct.pcPatternKey, cStruct.piRefY + iOffset, cStruct.iRefStride, m_lumaClpRng.bd, COMPONENT_Y, 0, 1, m_pcEncCfg->getUseHADME() && !bIsLosslessCoded );
ruiCost = m_cDistParam.distFunc( m_cDistParam );
......
......@@ -164,6 +164,7 @@ protected:
bool m_isInitialized;
unsigned int m_numBVs, m_numBV16s;
Mv m_acBVs[IBC_NUM_CANDIDATES];
bool m_useCompositeRef;
#if JVET_M0140_SBT
Distortion m_estMinDistSbt[NUMBER_SBT_MODE + 1]; // estimated minimum SSE value of the PU if using a SBT mode
uint8_t m_sbtRdoOrder[NUMBER_SBT_MODE]; // order of SBT mode in RDO
......@@ -181,6 +182,7 @@ public:
int iSearchRange,
int bipredSearchRange,
MESearchMethod motionEstimationSearchMethod,
bool useCompositeRef,
const uint32_t maxCUWidth,
const uint32_t maxCUHeight,
const uint32_t maxTotalCUDepth,
......