Commit 5bdd8774 authored by Hongbin Liu's avatar Hongbin Liu

move sps_fracmmvd_disabled_flag from SPSNext to SPS.

parent 8eb0aa20
......@@ -1873,6 +1873,9 @@ SPS::SPS()
, m_bPCMFilterDisableFlag (false)
, m_sbtmvpEnabledFlag (false)
, m_bdofEnabledFlag (false)
#if JVET_M0255_FRACMMVD_SWITCH
, m_disFracMmvdEnabledFlag ( false )
#endif
, m_uiBitsForPOC ( 8)
, m_numLongTermRefPicSPS ( 0)
, m_uiMaxTrSize ( 32)
......
......@@ -919,10 +919,6 @@ public:
bool getUseTriangle () const { return m_Triangle; }
void setIBCMode (unsigned IBCMode) { m_IBCMode = IBCMode; }
unsigned getIBCMode () const { return m_IBCMode; }
#if JVET_M0255_FRACMMVD_SWITCH
void setAllowDisFracMMVD ( bool b ) { allowDisFracMMVD = b; }
bool getAllowDisFracMMVD () const { return allowDisFracMMVD; }
#endif
};
......@@ -997,7 +993,9 @@ private:
bool m_sbtmvpEnabledFlag;
bool m_bdofEnabledFlag;
#if JVET_M0255_FRACMMVD_SWITCH
bool m_disFracMmvdEnabledFlag;
#endif
uint32_t m_uiBitsForPOC;
uint32_t m_numLongTermRefPicSPS;
uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
......@@ -1200,6 +1198,11 @@ public:
void setBDOFEnabledFlag(bool b) { m_bdofEnabledFlag = b; }
bool getBDOFEnabledFlag() const { return m_bdofEnabledFlag; }
#if JVET_M0255_FRACMMVD_SWITCH
bool getDisFracMmvdEnabledFlag() const { return m_disFracMmvdEnabledFlag; }
void setDisFracMmvdEnabledFlag( bool b ) { m_disFracMmvdEnabledFlag = 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; }
......
......@@ -818,9 +818,6 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
}
READ_FLAG( symbol, "mtt_enabled_flag" ); spsNext.setMTTMode ( symbol );
READ_FLAG( symbol, "mhintra_flag" ); spsNext.setUseMHIntra ( symbol != 0 );
#if JVET_M0255_FRACMMVD_SWITCH
READ_FLAG( symbol, "sps_fracmmvd_disabled_flag" ); spsNext.setAllowDisFracMMVD ( symbol != 0 );
#endif
READ_FLAG( symbol, "triangle_flag" ); spsNext.setUseTriangle ( symbol != 0 );
#if ENABLE_WPP_PARALLELISM
READ_FLAG( symbol, "next_dqp_enabled_flag" ); spsNext.setUseNextDQP ( symbol != 0 );
......@@ -1050,7 +1047,10 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
}
READ_FLAG( uiCode, "sps_bdof_enable_flag" ); pcSPS->setBDOFEnabledFlag ( uiCode != 0 );
#if JVET_M0255_FRACMMVD_SWITCH
READ_FLAG( uiCode, "sps_fracmmvd_disabled_flag" ); pcSPS->setDisFracMmvdEnabledFlag ( uiCode != 0 );
#endif
#if HEVC_USE_SCALING_LISTS
READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode );
if(pcSPS->getScalingListFlag())
......@@ -1771,7 +1771,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
pcSlice->setMaxNumAffineMergeCand( AFFINE_MRG_MAX_NUM_CANDS - uiCode );
}
#if JVET_M0255_FRACMMVD_SWITCH
if ( sps->getSpsNext().getAllowDisFracMMVD() )
if ( sps->getDisFracMmvdEnabledFlag() )
{
READ_FLAG( uiCode, "tile_group_fracmmvd_disabled_flag" );
pcSlice->setDisFracMMVD( uiCode ? true : false );
......
......@@ -160,7 +160,7 @@ public:
void setMergeBestSATDCost(double cost) { m_mergeBestSATDCost = cost; }
double getMergeBestSATDCost() { return m_mergeBestSATDCost; }
#if JVET_M0255_FRACMMVD_SWITCH
IbcHashMap& getCprHashMap() { return m_ibcHashMap; }
IbcHashMap& getIbcHashMap() { return m_ibcHashMap; }
EncCfg* getEncCfg() const { return m_pcEncCfg; }
#endif
......
......@@ -892,7 +892,7 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setUseMHIntra ( m_MHIntra );
sps.getSpsNext().setUseTriangle ( m_Triangle );
#if JVET_M0255_FRACMMVD_SWITCH
sps.getSpsNext().setAllowDisFracMMVD ( m_allowDisFracMMVD );
sps.setDisFracMmvdEnabledFlag ( m_allowDisFracMMVD );
#endif
sps.getSpsNext().setIBCMode ( m_IBCMode );
......
......@@ -1401,7 +1401,7 @@ void EncSlice::checkDisFracMmvd( Picture* pcPic, uint32_t startCtuTsAddr, uint32
uint32_t totalCtu = 0;
uint32_t hashRatio = 0;
if ( !pcSlice->getSPS()->getSpsNext().getAllowDisFracMMVD() )
if ( !pcSlice->getSPS()->getDisFracMmvdEnabledFlag() )
{
return;
}
......@@ -1419,7 +1419,7 @@ void EncSlice::checkDisFracMmvd( Picture* pcPic, uint32_t startCtuTsAddr, uint32
const Position pos ( ctuXPosInCtus * pcv.maxCUWidth, ctuYPosInCtus * pcv.maxCUHeight );
const UnitArea ctuArea( cs.area.chromaFormat, Area( pos.x, pos.y, pcv.maxCUWidth, pcv.maxCUHeight ) );
hashRatio += m_pcCuEncoder->getCprHashMap().getHashHitRatio( ctuArea.Y() );
hashRatio += m_pcCuEncoder->getIbcHashMap().getHashHitRatio( ctuArea.Y() );
totalCtu++;
}
......@@ -1480,10 +1480,10 @@ void EncSlice::encodeCtus( Picture* pcPic, const bool bCompressEntireSlice, cons
}
#endif
#if JVET_M0255_FRACMMVD_SWITCH
if ( pcSlice->getSPS()->getSpsNext().getAllowDisFracMMVD() ||
if ( pcSlice->getSPS()->getDisFracMmvdEnabledFlag() ||
( pcSlice->getSPS()->getSpsNext().getIBCMode() && m_pcCuEncoder->getEncCfg()->getIBCHashSearch() ) )
{
m_pcCuEncoder->getCprHashMap().rebuildPicHashMap( cs.picture->getOrigBuf() );
m_pcCuEncoder->getIbcHashMap().rebuildPicHashMap( cs.picture->getOrigBuf() );
}
checkDisFracMmvd( pcPic, startCtuTsAddr, boundingCtuTsAddr );
#endif
......
......@@ -559,9 +559,6 @@ void HLSWriter::codeSPSNext( const SPSNext& spsNext, const bool usePCM )
WRITE_FLAG( spsNext.getMTTEnabled() ? 1 : 0, "mtt_enabled_flag" );
WRITE_FLAG( spsNext.getUseMHIntra() ? 1 : 0, "mhintra_flag" );
#if JVET_M0255_FRACMMVD_SWITCH
WRITE_FLAG( spsNext.getAllowDisFracMMVD() ? 1 : 0, "sps_fracmmvd_disabled_flag" );
#endif
WRITE_FLAG( spsNext.getUseTriangle() ? 1: 0, "triangle_flag" );
#if ENABLE_WPP_PARALLELISM
WRITE_FLAG( spsNext.getUseNextDQP(), "next_dqp_enabled_flag" );
......@@ -724,6 +721,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
}
WRITE_FLAG( pcSPS->getBDOFEnabledFlag() ? 1 : 0, "sps_bdof_enabled_flag" );
#if JVET_M0255_FRACMMVD_SWITCH
WRITE_FLAG( pcSPS->getDisFracMmvdEnabledFlag() ? 1 : 0, "sps_fracmmvd_disabled_flag" );
#endif
#if HEVC_USE_SCALING_LISTS
WRITE_FLAG( pcSPS->getScalingListFlag() ? 1 : 0, "scaling_list_enabled_flag" );
......@@ -1289,7 +1289,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
WRITE_UVLC( AFFINE_MRG_MAX_NUM_CANDS - pcSlice->getMaxNumAffineMergeCand(), "five_minus_max_num_affine_merge_cand" );
}
#if JVET_M0255_FRACMMVD_SWITCH
if ( pcSlice->getSPS()->getSpsNext().getAllowDisFracMMVD() )
if ( pcSlice->getSPS()->getDisFracMmvdEnabledFlag() )
{
WRITE_FLAG( pcSlice->getDisFracMMVD(), "tile_group_fracmmvd_disabled_flag" );
}
......
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