Commit 12f859bf authored by Jeeva Raj A's avatar Jeeva Raj A

Add slice level BDOF DMVR disable flag

parent 5804363c
......@@ -495,7 +495,11 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
pu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
bool bioApplied = false;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pu.cs->sps->getBDOFEnabledFlag() && (!pu.cs->slice->getDisBdofDmvrFlag()))
#else
if (pu.cs->sps->getBDOFEnabledFlag())
#endif
{
if (pu.cu->affine || m_subPuMC)
{
......@@ -1341,7 +1345,11 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
pu.cs->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
bool bioApplied = false;
const Slice &slice = *pu.cs->slice;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pu.cs->sps->getBDOFEnabledFlag() && (!pu.cs->slice->getDisBdofDmvrFlag()))
#else
if (pu.cs->sps->getBDOFEnabledFlag())
#endif
{
if (pu.cu->affine || m_subPuMC)
......
......@@ -83,6 +83,9 @@ Slice::Slice()
, m_maxNumAffineMergeCand ( 0 )
, m_maxNumTriangleCand ( 0 )
, m_disFracMMVD ( false )
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
, m_disBdofDmvrFlag ( false )
#endif
, m_uiTLayer ( 0 )
, m_bTLayerSwitchingFlag ( false )
, m_sliceMode ( NO_SLICES )
......@@ -193,6 +196,9 @@ void Slice::initSlice()
m_bFinalized=false;
m_disFracMMVD = false;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
m_disBdofDmvrFlag = false;
#endif
m_substreamSizes.clear();
m_cabacInitFlag = false;
#if JVET_O0105_ICT
......@@ -695,6 +701,9 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_maxNumAffineMergeCand = pSrc->m_maxNumAffineMergeCand;
m_maxNumTriangleCand = pSrc->m_maxNumTriangleCand;
m_disFracMMVD = pSrc->m_disFracMMVD;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
m_disBdofDmvrFlag = pSrc->m_disBdofDmvrFlag;
#endif
if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag;
m_uiMinQTSize = pSrc->m_uiMinQTSize;
......@@ -1401,6 +1410,9 @@ SPS::SPS()
, m_sbtmvpEnabledFlag (false)
, m_bdofEnabledFlag (false)
, m_fpelMmvdEnabledFlag ( false )
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
, m_BdofDmvrSlicePresentFlag ( false )
#endif
, m_uiBitsForPOC ( 8)
, m_numLongTermRefPicSPS ( 0)
#if MAX_TB_SIZE_SIGNALLING
......
......@@ -713,6 +713,9 @@ private:
bool m_sbtmvpEnabledFlag;
bool m_bdofEnabledFlag;
bool m_fpelMmvdEnabledFlag;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
bool m_BdofDmvrSlicePresentFlag;
#endif
uint32_t m_uiBitsForPOC;
uint32_t m_numLongTermRefPicSPS;
uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
......@@ -911,6 +914,10 @@ public:
void setUseDMVR(bool b) { m_DMVR = b; }
bool getUseMMVD()const { return m_MMVD; }
void setUseMMVD(bool b) { m_MMVD = b; }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
bool getBdofDmvrSlicePresentFlag()const { return m_BdofDmvrSlicePresentFlag; }
void setBdofDmvrSlicePresentFlag(bool b) { m_BdofDmvrSlicePresentFlag = b; }
#endif
uint32_t getMaxTLayers() const { return m_uiMaxTLayers; }
void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; }
......@@ -1438,6 +1445,9 @@ private:
uint32_t m_maxNumAffineMergeCand;
uint32_t m_maxNumTriangleCand;
bool m_disFracMMVD;
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
bool m_disBdofDmvrFlag;
#endif
double m_lambdas[MAX_NUM_COMPONENT];
bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF];
......@@ -1685,6 +1695,10 @@ public:
uint32_t getMaxNumTriangleCand() const { return m_maxNumTriangleCand;}
void setDisFracMMVD( bool val ) { m_disFracMMVD = val; }
bool getDisFracMMVD() const { return m_disFracMMVD; }
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
void setDisBdofDmvrFlag(bool val) { m_disBdofDmvrFlag = val; }
bool getDisBdofDmvrFlag() const { return m_disBdofDmvrFlag; }
#endif
void setNoOutputPriorPicsFlag( bool val ) { m_noOutputPriorPicsFlag = val; }
bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; }
......
......@@ -120,6 +120,9 @@
#define JVET_O0108_DIS_DMVR_BDOF_CIIP 1 // JVET_O0108 CE9-2.2: disable DMVR and BDOF for CIIP
#define JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG 1 // JVET-O1140 slice level disable flag for BDOF and DMVR
#define FIX_DB_MAX_TRANSFORM_SIZE 1
#define MRG_SHARELIST_SHARSIZE 32
......
......@@ -1597,13 +1597,17 @@ void PU::getInterMergeCandidates( const PredictionUnit &pu, MergeCtx& mrgCtx,
}
bool PU::checkDMVRCondition(const PredictionUnit& pu)
{
WPScalingParam *wp0;
WPScalingParam *wp1;
int refIdx0 = pu.refIdx[REF_PIC_LIST_0];
int refIdx1 = pu.refIdx[REF_PIC_LIST_1];
pu.cu->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
pu.cu->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
WPScalingParam *wp0;
WPScalingParam *wp1;
int refIdx0 = pu.refIdx[REF_PIC_LIST_0];
int refIdx1 = pu.refIdx[REF_PIC_LIST_1];
pu.cu->slice->getWpScaling(REF_PIC_LIST_0, refIdx0, wp0);
pu.cu->slice->getWpScaling(REF_PIC_LIST_1, refIdx1, wp1);
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pu.cs->sps->getUseDMVR() && (!pu.cs->slice->getDisBdofDmvrFlag()))
#else
if (pu.cs->sps->getUseDMVR())
#endif
{
return pu.mergeFlag
&& pu.mergeType == MRG_TYPE_DEFAULT_N
......
......@@ -1254,7 +1254,12 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{
READ_FLAG( uiCode, "sps_fpel_mmvd_enabled_flag" ); pcSPS->setFpelMmvdEnabledFlag ( uiCode != 0 );
}
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pcSPS->getBDOFEnabledFlag() || pcSPS->getUseDMVR())
{
READ_FLAG(uiCode, "sps_fpel_mmvd_enabled_flag"); pcSPS->setBdofDmvrSlicePresentFlag(uiCode != 0);
}
#endif
READ_FLAG( uiCode, "triangle_flag" ); pcSPS->setUseTriangle ( uiCode != 0 );
READ_FLAG( uiCode, "sps_mip_flag"); pcSPS->setUseMIP ( uiCode != 0 );
......@@ -1985,6 +1990,13 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
READ_FLAG( uiCode, "tile_group_fracmmvd_disabled_flag" );
pcSlice->setDisFracMMVD( uiCode ? true : false );
}
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (sps->getBdofDmvrSlicePresentFlag())
{
READ_FLAG(uiCode, "tile_group_bdof_dmvr_disabled_flag");
pcSlice->setDisBdofDmvrFlag(uiCode ? true : false);
}
#endif
if (sps->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
{
READ_UVLC(uiCode, "max_num_merge_cand_minus_max_num_triangle_cand");
......
......@@ -931,6 +931,9 @@ void EncLib::xInitSPS(SPS &sps)
sps.setUseTriangle ( m_Triangle );
sps.setUseMMVD ( m_MMVD );
sps.setFpelMmvdEnabledFlag (( m_MMVD ) ? m_allowDisFracMMVD : false);
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
sps.setBdofDmvrSlicePresentFlag(m_DMVR || m_BIO);
#endif
sps.setAffineAmvrEnabledFlag ( m_AffineAmvr );
sps.setUseDMVR ( m_DMVR );
......
......@@ -847,7 +847,12 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
{
WRITE_FLAG( pcSPS->getFpelMmvdEnabledFlag() ? 1 : 0, "sps_fpel_mmvd_enabled_flag" );
}
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if(pcSPS->getBDOFEnabledFlag() || pcSPS->getUseDMVR())
{
WRITE_FLAG(pcSPS->getBdofDmvrSlicePresentFlag() ? 1 : 0, "sps_bdof_dmvr_slice_level_present_flag");
}
#endif
WRITE_FLAG( pcSPS->getUseTriangle() ? 1: 0, "triangle_flag" );
WRITE_FLAG( pcSPS->getUseMIP() ? 1: 0, "sps_mip_flag" );
......@@ -1367,6 +1372,12 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
{
WRITE_FLAG( pcSlice->getDisFracMMVD(), "tile_group_fracmmvd_disabled_flag" );
}
#if JVET_O1140_SLICE_DISABLE_BDOF_DMVR_FLAG
if (pcSlice->getSPS()->getBdofDmvrSlicePresentFlag())
{
WRITE_FLAG(pcSlice->getDisBdofDmvrFlag(), "tile_group_bdof_dmvr_disabled_flag");
}
#endif
if (pcSlice->getSPS()->getUseTriangle() && pcSlice->getMaxNumMergeCand() >= 2)
{
CHECK(pcSlice->getMaxNumMergeCand() < pcSlice->getMaxNumTriangleCand(), "Incorrrect max number of triangle candidates!");
......
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