Commit 727288bd authored by Karsten Suehring's avatar Karsten Suehring

first part of SPS syntax alignment:

- sps_sao_enabled_flag
- sps_alf_enabled_flag
- pcm_enabled_flag
- pcm_sample_bit_depth_luma_minus1
- pcm_sample_bit_depth_chroma_minus1
- log2_min_pcm_luma_coding_block_size_minus3
- log2_diff_max_min_pcm_luma_coding_block_size
- pcm_loop_filter_disabled_flag
- sps_ref_wraparound_enabled_flag
- sps_ref_wraparound_offset
- sps_temporal_mvp_enabled_flag
- sps_sbtmvp_enabled_flag
- sps_bdof_enabled_flag
parent e880934c
......@@ -48,7 +48,6 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
......
......@@ -56,7 +56,6 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
......
......@@ -56,7 +56,6 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
......
......@@ -70,7 +70,6 @@ InternalBitDepth : 10 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
TransformSkipLog2MaxSize : 5
......
......@@ -141,7 +141,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setAccessUnitDelimiter ( m_AccessUnitDelimiter );
m_cEncLib.setMaxTempLayer ( m_maxTempLayer );
m_cEncLib.setUseAMP( m_enableAMP );
//===== Slice ========
......
......@@ -993,7 +993,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("DeblockingFilterMetric", m_DeblockingFilterMetric, false)
#endif
// Coding tools
("AMP", m_enableAMP, true, "Enable asymmetric motion partitions")
("CrossComponentPrediction", m_crossComponentPredictionEnabledFlag, false, "Enable the use of cross-component prediction (not valid in V1 profiles)")
("ReconBasedCrossCPredictionEstimate", m_reconBasedCrossCPredictionEstimate, false, "When determining the alpha value for cross-component prediction, use the decoded residual rather than the pre-transform encoder-side residual")
("SaoLumaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_LUMA], 0, "Specify the luma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
......@@ -1927,8 +1926,6 @@ bool EncAppCfg::xCheckParameter()
#endif
xConfirmPara( m_LMChroma, "LMChroma only allowed with NEXT profile" );
xConfirmPara( m_LargeCTU, "Large CTU is only allowed with NEXT profile" );
xConfirmPara( m_SubPuMvpMode != 0, "Sub-PU motion vector prediction is only allowed with NEXT profile" );
xConfirmPara( m_BIO, "BIO only allowed with NEXT profile" );
xConfirmPara( m_DisableMotionCompression, "Disable motion data compression only allowed with NEXT profile" );
xConfirmPara( m_MTT, "Multi type tree is only allowed with NEXT profile" );
xConfirmPara( m_ImvMode, "IMV is only allowed with NEXT profile" );
......
......@@ -148,7 +148,6 @@ protected:
bool m_transformSkipRotationEnabledFlag; ///< control flag for transform-skip/transquant-bypass residual rotation
bool m_transformSkipContextEnabledFlag; ///< control flag for transform-skip/transquant-bypass single significance map context
bool m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES];///< control flags for residual DPCM
bool m_enableAMP;
bool m_persistentRiceAdaptationEnabledFlag; ///< control flag for Golomb-Rice parameter adaptation over each slice
bool m_cabacBypassAlignmentEnabledFlag;
......
......@@ -426,7 +426,7 @@ void InterPrediction::xPredInterBi(PredictionUnit& pu, PelUnitBuf &pcYuvPred)
const Slice &slice = *pu.cs->slice;
bool bioApplied = false;
if (pu.cs->sps->getSpsNext().getUseBIO())
if (pu.cs->sps->getBDOFEnabledFlag())
{
if (pu.cu->affine || m_subPuMC)
{
......@@ -686,7 +686,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
roundAffineMv(iMvScaleTmpHor, iMvScaleTmpVer, shift);
// clip and scale
if (sps.getUseWrapAround())
if (sps.getWrapAroundEnabledFlag())
{
m_storedMv[h / AFFINE_MIN_BLOCK_SIZE * MVBUFFER_SIZE + w / AFFINE_MIN_BLOCK_SIZE].set(iMvScaleTmpHor, iMvScaleTmpVer);
Mv tmpMv(iMvScaleTmpHor, iMvScaleTmpVer);
......@@ -710,7 +710,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
m_storedMv[((h << iScaleY) / AFFINE_MIN_BLOCK_SIZE + 1)* MVBUFFER_SIZE + ((w << iScaleX) / AFFINE_MIN_BLOCK_SIZE + 1)] +
Mv(2, 2));
curMv.set(curMv.getHor() >> 2, curMv.getVer() >> 2);
if (sps.getUseWrapAround())
if (sps.getWrapAroundEnabledFlag())
{
clipMv(curMv, Position(pu.Y().x + (w << iScaleX), pu.Y().y + (h << iScaleY)), Size(blockWidth << iScaleX, blockHeight << iScaleY), sps);
}
......
......@@ -554,7 +554,7 @@ void LoopFilter::xEdgeFilterLuma(const CodingUnit& cu, const DeblockEdgeDir edge
unsigned uiBsAbsIdx = 0, uiBs = 0;
int iOffset, iSrcStep;
bool bPCMFilter = (sps.getUsePCM() && sps.getPCMFilterDisableFlag()) ? true : false;
bool bPCMFilter = (sps.getPCMEnabledFlag() && sps.getPCMFilterDisableFlag()) ? true : false;
bool bPartPNoFilter = false;
bool bPartQNoFilter = false;
int betaOffsetDiv2 = slice.getDeblockingFilterBetaOffsetDiv2();
......@@ -704,7 +704,7 @@ void LoopFilter::xEdgeFilterChroma(const CodingUnit& cu, const DeblockEdgeDir ed
int iOffset, iSrcStep;
unsigned uiLoopLength;
bool bPCMFilter = (sps.getUsePCM() && sps.getPCMFilterDisableFlag()) ? true : false;
bool bPCMFilter = (sps.getPCMEnabledFlag() && sps.getPCMFilterDisableFlag()) ? true : false;
bool bPartPNoFilter = false;
bool bPartQNoFilter = false;
const int tcOffsetDiv2 = slice.getDeblockingFilterTcOffsetDiv2();
......
......@@ -61,7 +61,7 @@ void clipMv( Mv& rcMv, const Position& pos,
int iVerMax = ( sps.getPicHeightInLumaSamples() + iOffset - ( int ) pos.y - 1 ) << iMvShift;
int iVerMin = ( -( int ) sps.getMaxCUHeight() - iOffset - ( int ) pos.y + 1 ) << iMvShift;
if( sps.getUseWrapAround() )
if( sps.getWrapAroundEnabledFlag() )
{
int iHorMax = ( sps.getPicWidthInLumaSamples() + sps.getMaxCUWidth() - size.width + iOffset - ( int ) pos.x - 1 ) << iMvShift;
int iHorMin = ( -( int ) sps.getMaxCUWidth() - iOffset - ( int ) pos.x + 1 ) << iMvShift;
......
......@@ -1004,7 +1004,7 @@ void Picture::extendPicBorder()
Pel* pi = piTxt;
// do left and right margins
if (cs->sps->getUseWrapAround())
if (cs->sps->getWrapAroundEnabledFlag())
{
int xoffset = cs->sps->getWrapAroundOffset() >> getComponentScaleX( compID, cs->area.chromaFormat );
for (int y = 0; y < p.height; y++)
......
......@@ -614,7 +614,7 @@ void SampleAdaptiveOffset::SAOProcess( CodingStructure& cs, SAOBlkParam* saoBlkP
void SampleAdaptiveOffset::xPCMLFDisableProcess(CodingStructure& cs)
{
const PreCalcValues& pcv = *cs.pcv;
const bool bPCMFilter = (cs.sps->getUsePCM() && cs.sps->getPCMFilterDisableFlag()) ? true : false;
const bool bPCMFilter = (cs.sps->getPCMEnabledFlag() && cs.sps->getPCMFilterDisableFlag()) ? true : false;
if( bPCMFilter || cs.pps->getTransquantBypassEnabledFlag() )
{
......
......@@ -1733,9 +1733,7 @@ SPSNext::SPSNext( SPS& sps )
, m_NextEnabled ( false )
// disable all tool enabling flags by default
, m_LargeCTU ( false )
, m_SubPuMvp ( false )
, m_IMV ( false )
, m_BIO ( false )
, m_DisableMotionCompression ( false )
, m_LMChroma ( false )
#if JVET_M0464_UNI_MTS
......@@ -1761,7 +1759,6 @@ SPSNext::SPSNext( SPS& sps )
#endif
// default values for additional parameters
, m_subPuMrgMode ( 0 )
, m_ImvMode ( IMV_OFF )
, m_MTTMode ( 0 )
, m_compositeRefEnabled ( false )
......@@ -1814,14 +1811,16 @@ SPS::SPS()
, m_uiQuadtreeTUMaxDepthInter ( 0)
, m_uiQuadtreeTUMaxDepthIntra ( 0)
// Tool list
, m_usePCM (false)
, m_pcmEnabledFlag (false)
, m_pcmLog2MaxSize ( 5)
, m_uiPCMLog2MinSize ( 7)
, m_bPCMFilterDisableFlag (false)
, m_sbtmvpEnabledFlag (false)
, m_bdofEnabledFlag (false)
, m_uiBitsForPOC ( 8)
, m_numLongTermRefPicSPS ( 0)
, m_uiMaxTrSize ( 32)
, m_bUseSAO (false)
, m_saoEnabledFlag (false)
, m_bTemporalIdNestingFlag (false)
#if HEVC_USE_SCALING_LISTS
, m_scalingListEnabledFlag (false)
......@@ -1832,7 +1831,7 @@ SPS::SPS()
, m_vuiParametersPresentFlag (false)
, m_vuiParameters ()
, m_spsNextExtension (*this)
, m_useWrapAround (false)
, m_wrapAroundEnabledFlag (false)
, m_wrapAroundOffset ( 0)
{
for(int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
......
This diff is collapsed.
......@@ -2664,7 +2664,7 @@ void PU::getAffineMergeCand( const PredictionUnit &pu, AffineMergeCtx& affMrgCtx
affMrgCtx.numValidMergeCand = 0;
affMrgCtx.maxNumMergeCand = maxNumAffineMergeCand;
bool enableSubPuMvp = slice.getSPS()->getSpsNext().getUseSubPuMvp() && !(slice.getPOC() == slice.getRefPic(REF_PIC_LIST_0, 0)->getPOC() && slice.isIRAP());
bool enableSubPuMvp = slice.getSPS()->getSBTMVPEnabledFlag() && !(slice.getPOC() == slice.getRefPic(REF_PIC_LIST_0, 0)->getPOC() && slice.isIRAP());
bool isAvailableSubPu = false;
if ( enableSubPuMvp && slice.getEnableTMVPFlag() )
{
......
......@@ -149,7 +149,7 @@ bool CABACReader::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
AlfSliceParam& alfSliceParam = cs.slice->getAlfSliceParam();
if( cs.sps->getUseALF() && ( alfSliceParam.enabledFlag[COMPONENT_Y] || alfSliceParam.enabledFlag[COMPONENT_Cb] || alfSliceParam.enabledFlag[COMPONENT_Cr] ) )
if( cs.sps->getALFEnabledFlag() && ( alfSliceParam.enabledFlag[COMPONENT_Y] || alfSliceParam.enabledFlag[COMPONENT_Cb] || alfSliceParam.enabledFlag[COMPONENT_Cr] ) )
{
const PreCalcValues& pcv = *cs.pcv;
......@@ -231,7 +231,7 @@ void CABACReader::sao( CodingStructure& cs, unsigned ctuRsAddr )
{
const SPS& sps = *cs.sps;
if( !sps.getUseSAO() )
if( !sps.getSAOEnabledFlag() )
{
return;
}
......@@ -944,7 +944,7 @@ void CABACReader::pred_mode( CodingUnit& cu )
void CABACReader::pcm_flag( CodingUnit& cu, Partitioner &partitioner )
{
const SPS& sps = *cu.cs->sps;
if( !sps.getUsePCM() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize())
if( !sps.getPCMEnabledFlag() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize())
|| partitioner.currArea().lheight() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lheight() < (1 << sps.getPCMLog2MinSize()) )
{
cu.ipcm = false;
......@@ -1406,7 +1406,7 @@ void CABACReader::subblock_merge_flag( CodingUnit& cu )
return;
}
if ( !cu.cs->slice->isIntra() && (cu.cs->sps->getSpsNext().getUseAffine() || cu.cs->sps->getSpsNext().getUseSubPuMvp()) && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8 )
if ( !cu.cs->slice->isIntra() && (cu.cs->sps->getSpsNext().getUseAffine() || cu.cs->sps->getSBTMVPEnabledFlag()) && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8 )
{
RExt__DECODER_DEBUG_BIT_STATISTICS_CREATE_SET( STATS__CABAC_BITS__AFFINE_FLAG );
......@@ -1478,7 +1478,7 @@ void CABACReader::merge_idx( PredictionUnit& pu )
{
if ( m_BinDecoder.decodeBin( Ctx::AffMergeIdx() ) )
{
bool useExtCtx = pu.cs->sps->getSpsNext().getUseSubPuMvp();
bool useExtCtx = pu.cs->sps->getSBTMVPEnabledFlag();
pu.mergeIdx++;
for ( ; pu.mergeIdx < numCandminus1; pu.mergeIdx++ )
{
......
......@@ -458,7 +458,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
if (pu.mmvdMergeFlag || pu.cu->mmvdSkip)
{
CHECK(pu.mhIntraFlag == true, "invalid MHIntra");
if (pu.cs->sps->getSpsNext().getUseSubPuMvp())
if (pu.cs->sps->getSBTMVPEnabledFlag())
{
Size bufSize = g_miScaling.scale(pu.lumaSize());
mrgCtx.subPuMvpMiBuf = MotionBuf(m_SubPuMiBuf, bufSize);
......@@ -486,7 +486,7 @@ void DecCu::xDeriveCUMV( CodingUnit &cu )
if( pu.cu->affine )
{
AffineMergeCtx affineMergeCtx;
if ( pu.cs->sps->getSpsNext().getUseSubPuMvp() )
if ( pu.cs->sps->getSBTMVPEnabledFlag() )
{
Size bufSize = g_miScaling.scale( pu.lumaSize() );
mrgCtx.subPuMvpMiBuf = MotionBuf( m_SubPuMiBuf, bufSize );
......
......@@ -168,12 +168,12 @@ bool tryDecodePicture( Picture* pcEncPic, const int expectedPoc, const std::stri
pcEncPic->cs->slice = pcEncPic->slices.back();
if ( pic->cs->sps->getUseSAO() )
if ( pic->cs->sps->getSAOEnabledFlag() )
{
pcEncPic->copySAO( *pic, 0 );
}
if( pic->cs->sps->getUseALF() )
if( pic->cs->sps->getALFEnabledFlag() )
{
for( int compIdx = 0; compIdx < MAX_NUM_COMPONENT; compIdx++ )
{
......@@ -187,7 +187,7 @@ bool tryDecodePicture( Picture* pcEncPic, const int expectedPoc, const std::stri
}
pcDecLib->executeLoopFilters();
if ( pic->cs->sps->getUseSAO() )
if ( pic->cs->sps->getSAOEnabledFlag() )
{
pcEncPic->copySAO( *pic, 1 );
}
......@@ -511,12 +511,12 @@ void DecLib::executeLoopFilters()
// deblocking filter
m_cLoopFilter.loopFilterPic( cs );
if( cs.sps->getUseSAO() )
if( cs.sps->getSAOEnabledFlag() )
{
m_cSAO.SAOProcess( cs, cs.picture->getSAO() );
}
if( cs.sps->getUseALF() )
if( cs.sps->getALFEnabledFlag() )
{
m_cALF.ALFProcess( cs, cs.slice->getAlfSliceParam() );
}
......@@ -772,7 +772,7 @@ void DecLib::xActivateParameterSets()
m_cSliceDecoder.create();
if( sps->getUseALF() )
if( sps->getALFEnabledFlag() )
{
m_cALF.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCodingDepth(), sps->getBitDepths().recon );
}
......
......@@ -789,9 +789,7 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
// tool enabling flags
READ_FLAG( symbol, "large_ctu_flag" ); spsNext.setUseLargeCTU ( symbol != 0 );
READ_FLAG( symbol, "subpu_tmvp_flag" ); spsNext.setSubPuMvpMode (symbol);
READ_FLAG( symbol, "imv_enable_flag" ); spsNext.setUseIMV ( symbol != 0 );
READ_FLAG( symbol, "bio_enable_flag" ); spsNext.setUseBIO ( symbol != 0 );
READ_FLAG( symbol, "disable_motion_compression_flag" ); spsNext.setDisableMotCompress ( symbol != 0 );
READ_FLAG( symbol, "lm_chroma_enabled_flag" ); spsNext.setUseLMChroma ( symbol != 0 );
#if JVET_M0464_UNI_MTS
......@@ -821,14 +819,6 @@ void HLSyntaxReader::parseSPSNext( SPSNext& spsNext, const bool usePCM )
READ_FLAG( symbol, "reserved_flag" ); CHECK( symbol, "reserved flag not 0!" );
#endif
// additional parameters
if( spsNext.getUseSubPuMvp() )
{
int subPuMode = 1;
spsNext.setSubPuMvpMode( subPuMode );
}
if( spsNext.getUseIMV() )
{
READ_UVLC( symbol, "imv_mode_minus1" ); spsNext.setImvMode( ImvMode( symbol + 1 ) );
......@@ -1019,8 +1009,39 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_UVLC( uiCode, "log2_diff_max_min_luma_transform_block_size" ); pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() );
pcSPS->setMaxTrSize( 1<<(uiCode + pcSPS->getQuadtreeTULog2MinSize()) );
READ_FLAG( uiCode, "sps_alf_enable_flag" ); pcSPS->setUseALF( uiCode );
READ_FLAG( uiCode, "sps_sao_enabled_flag" ); pcSPS->setSAOEnabledFlag ( uiCode ? true : false );
READ_FLAG( uiCode, "sps_alf_enabled_flag" ); pcSPS->setALFEnabledFlag ( uiCode ? true : false );
READ_FLAG( uiCode, "pcm_enabled_flag" ); pcSPS->setPCMEnabledFlag( uiCode ? true : false );
if( pcSPS->getPCMEnabledFlag() )
{
READ_CODE( 4, uiCode, "pcm_sample_bit_depth_luma_minus1" ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_LUMA, 1 + uiCode );
READ_CODE( 4, uiCode, "pcm_sample_bit_depth_chroma_minus1" ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_CHROMA, 1 + uiCode );
READ_UVLC( uiCode, "log2_min_pcm_luma_coding_block_size_minus3" ); pcSPS->setPCMLog2MinSize ( uiCode+3 );
READ_UVLC( uiCode, "log2_diff_max_min_pcm_luma_coding_block_size" ); pcSPS->setPCMLog2MaxSize ( uiCode+pcSPS->getPCMLog2MinSize() );
READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false );
}
READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false );
if (pcSPS->getWrapAroundEnabledFlag())
{
READ_UVLC(uiCode, "sps_ref_wraparound_offset"); pcSPS->setWrapAroundOffset( uiCode );
}
READ_FLAG( uiCode, "sps_temporal_mvp_enabled_flag" ); pcSPS->setSPSTemporalMVPEnabledFlag(uiCode);
if ( pcSPS->getSPSTemporalMVPEnabledFlag() )
{
READ_FLAG( uiCode, "sps_sbtmvp_enabled_flag" ); pcSPS->setSBTMVPEnabledFlag ( uiCode != 0 );
}
else
{
pcSPS->setSBTMVPEnabledFlag(false);
}
READ_FLAG( uiCode, "sps_bdof_enable_flag" ); pcSPS->setBDOFEnabledFlag ( uiCode != 0 );
#if HEVC_USE_SCALING_LISTS
READ_FLAG( uiCode, "scaling_list_enabled_flag" ); pcSPS->setScalingListFlag ( uiCode );
if(pcSPS->getScalingListFlag())
......@@ -1032,24 +1053,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
}
}
#endif
READ_FLAG( uiCode, "amp_enabled_flag" ); pcSPS->setUseAMP( uiCode );
READ_FLAG( uiCode, "sample_adaptive_offset_enabled_flag" ); pcSPS->setUseSAO ( uiCode ? true : false );
READ_FLAG( uiCode, "pcm_enabled_flag" ); pcSPS->setUsePCM( uiCode ? true : false );
if( pcSPS->getUsePCM() )
{
READ_CODE( 4, uiCode, "pcm_sample_bit_depth_luma_minus1" ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_LUMA, 1 + uiCode );
READ_CODE( 4, uiCode, "pcm_sample_bit_depth_chroma_minus1" ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_CHROMA, 1 + uiCode );
READ_UVLC( uiCode, "log2_min_pcm_luma_coding_block_size_minus3" ); pcSPS->setPCMLog2MinSize (uiCode+3);
READ_UVLC( uiCode, "log2_diff_max_min_pcm_luma_coding_block_size" ); pcSPS->setPCMLog2MaxSize ( uiCode+pcSPS->getPCMLog2MinSize() );
READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false );
}
READ_FLAG(uiCode, "ref_wraparound_enabled_flag"); pcSPS->setUseWrapAround( uiCode ? true : false );
if (pcSPS->getUseWrapAround())
{
READ_UVLC(uiCode, "ref_wraparound_offset"); pcSPS->setWrapAroundOffset( uiCode );
}
READ_UVLC( uiCode, "num_short_term_ref_pic_sets" );
CHECK(uiCode > 64, "Invalid code");
......@@ -1076,8 +1079,6 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->setUsedByCurrPicLtSPSFlag(k, uiCode?1:0);
}
}
READ_FLAG( uiCode, "sps_temporal_mvp_enabled_flag" ); pcSPS->setSPSTemporalMVPEnabledFlag(uiCode);
#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
READ_FLAG( uiCode, "strong_intra_smoothing_enable_flag" ); pcSPS->setUseStrongIntraSmoothing(uiCode);
......@@ -1142,7 +1143,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
case SPS_EXT__NEXT:
{
CHECK( !pcSPS->getSpsNext().nextToolsEnabled(), "Got SPS Next extension in non NEXT profile" );
parseSPSNext( pcSPS->getSpsNext(), pcSPS->getUsePCM() );
parseSPSNext( pcSPS->getSpsNext(), pcSPS->getPCMEnabledFlag() );
break;
}
default:
......@@ -1517,7 +1518,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
pcSlice->setEnableTMVPFlag(false);
}
}
if(sps->getUseSAO())
if(sps->getSAOEnabledFlag())
{
READ_FLAG(uiCode, "slice_sao_luma_flag"); pcSlice->setSaoEnabledFlag(CHANNEL_TYPE_LUMA, (bool)uiCode);
......@@ -1527,7 +1528,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
}
}
if( sps->getUseALF() )
if( sps->getALFEnabledFlag() )
{
alf( pcSlice->getAlfSliceParam() );
}
......@@ -1746,11 +1747,11 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
READ_UVLC(uiCode, "six_minus_max_num_merge_cand");
pcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode);
if ( sps->getSpsNext().getUseSubPuMvp() && !sps->getSpsNext().getUseAffine() ) // ATMVP only
if ( sps->getSBTMVPEnabledFlag() && !sps->getSpsNext().getUseAffine() ) // ATMVP only
{
pcSlice->setMaxNumAffineMergeCand( 1 );
}
else if ( !sps->getSpsNext().getUseSubPuMvp() && !sps->getSpsNext().getUseAffine() ) // both off
else if ( !sps->getSBTMVPEnabledFlag() && !sps->getSpsNext().getUseAffine() ) // both off
{
pcSlice->setMaxNumAffineMergeCand( 0 );
}
......@@ -1838,7 +1839,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
pcSlice->setDeblockingFilterTcOffsetDiv2 ( 0 );
}
bool isSAOEnabled = sps->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA)));
bool isSAOEnabled = sps->getSAOEnabledFlag() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA)));
bool isDBFEnabled = (!pcSlice->getDeblockingFilterDisable());
if(pps->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled ))
......
......@@ -215,7 +215,7 @@ void CABACWriter::coding_tree_unit( CodingStructure& cs, const UnitArea& area, i
void CABACWriter::sao( const Slice& slice, unsigned ctuRsAddr )
{
const SPS& sps = *slice.getSPS();
if( !sps.getUseSAO() )
if( !sps.getSAOEnabledFlag() )
{
return;
}
......@@ -803,7 +803,7 @@ void CABACWriter::pcm_data( const CodingUnit& cu, Partitioner& partitioner )
void CABACWriter::pcm_flag( const CodingUnit& cu, Partitioner& partitioner )
{
const SPS& sps = *cu.cs->sps;
if( !sps.getUsePCM() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize())
if( !sps.getPCMEnabledFlag() || partitioner.currArea().lwidth() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lwidth() < (1 << sps.getPCMLog2MinSize())
|| partitioner.currArea().lheight() > (1 << sps.getPCMLog2MaxSize()) || partitioner.currArea().lheight() < (1 << sps.getPCMLog2MinSize()) )
{
return;
......@@ -1377,7 +1377,7 @@ void CABACWriter::subblock_merge_flag( const CodingUnit& cu )
return;
}
if ( !cu.cs->slice->isIntra() && (cu.cs->sps->getSpsNext().getUseAffine() || cu.cs->sps->getSpsNext().getUseATMVP()) && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8 )
if ( !cu.cs->slice->isIntra() && (cu.cs->sps->getSpsNext().getUseAffine() || cu.cs->sps->getSBTMVPEnabledFlag()) && cu.lumaSize().width >= 8 && cu.lumaSize().height >= 8 )
{
unsigned ctxId = DeriveCtx::CtxAffineFlag( cu );
m_BinEncoder.encodeBin( cu.affine, Ctx::AffineFlag( ctxId ) );
......@@ -1459,7 +1459,7 @@ void CABACWriter::merge_idx( const PredictionUnit& pu )
}
else
{
bool useExtCtx = pu.cs->sps->getSpsNext().getUseSubPuMvp();
bool useExtCtx = pu.cs->sps->getSBTMVPEnabledFlag();
m_BinEncoder.encodeBin( 1, Ctx::AffMergeIdx() );
for ( unsigned idx = 1; idx < numCandminus1; idx++ )
{
......@@ -2749,7 +2749,7 @@ void CABACWriter::codeAlfCtuEnableFlag( CodingStructure& cs, uint32_t ctuRsAddr,
{
AlfSliceParam& alfSliceParam = alfParam ? (*alfParam) : cs.slice->getAlfSliceParam();
if( cs.sps->getUseALF() && alfSliceParam.enabledFlag[compIdx] )
if( cs.sps->getALFEnabledFlag() && alfSliceParam.enabledFlag[compIdx] )
{
const PreCalcValues& pcv = *cs.pcv;
int frame_width_in_ctus = pcv.widthInCtus;
......
......@@ -188,7 +188,6 @@ protected:
// TODO: We need to have a common sliding mechanism used by both the encoder and decoder
int m_maxTempLayer; ///< Max temporal layer
bool m_useAMP;
unsigned m_CTUSize;
bool m_useSplitConsOverride;
unsigned m_uiMinQT[3]; //0: I slice; 1: P/B slice, 2: I slice chroma
......@@ -801,8 +800,6 @@ public:
void setQuadtreeTUMaxDepthInter ( uint32_t u ) { m_uiQuadtreeTUMaxDepthInter = u; }
void setQuadtreeTUMaxDepthIntra ( uint32_t u ) { m_uiQuadtreeTUMaxDepthIntra = u; }
void setUseAMP( bool b ) { m_useAMP = b; }
//====== Loop/Deblock Filter ========
void setLoopFilterDisable ( bool b ) { m_bLoopFilterDisable = b; }
void setLoopFilterOffsetInPPS ( bool b ) { m_loopFilterOffsetInPPS = b; }
......
......@@ -1582,7 +1582,7 @@ void EncCu::xCheckRDCostMerge2Nx2N( CodingStructure *&tempCS, CodingStructure *&
MergeCtx mergeCtx;
const SPS &sps = *tempCS->sps;
if( sps.getSpsNext().getUseSubPuMvp() )
if( sps.getSBTMVPEnabledFlag() )
{
Size bufSize = g_miScaling.scale( tempCS->area.lumaSize() );
mergeCtx.subPuMvpMiBuf = MotionBuf( m_SubPuMiBuf, bufSize );
......@@ -2390,7 +2390,7 @@ void EncCu::xCheckRDCostAffineMerge2Nx2N( CodingStructure *&tempCS, CodingStruct
const SPS &sps = *tempCS->sps;
MergeCtx mrgCtx;
if ( sps.getSpsNext().getUseSubPuMvp() )
if ( sps.getSBTMVPEnabledFlag() )
{
Size bufSize = g_miScaling.scale( tempCS->area.lumaSize() );
mrgCtx.subPuMvpMiBuf = MotionBuf( m_SubPuMiBuf, bufSize );
......@@ -2664,7 +2664,7 @@ void EncCu::xCheckRDCostCPRModeMerge2Nx2N(CodingStructure *&tempCS, CodingStruct
MergeCtx mergeCtx;
if (sps.getSpsNext().getUseSubPuMvp())
if (sps.getSBTMVPEnabledFlag())
{
Size bufSize = g_miScaling.scale(tempCS->area.lumaSize());
mergeCtx.subPuMvpMiBuf = MotionBuf(m_SubPuMiBuf, bufSize);
......
......@@ -1983,14 +1983,14 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
pcPic->m_uEnerHpCtu.resize( numberOfCtusInFrame );
pcPic->m_iOffsetCtu.resize( numberOfCtusInFrame );
#endif
if (pcSlice->getSPS()->getUseSAO())
if (pcSlice->getSPS()->getSAOEnabledFlag())
{
pcPic->resizeSAO( numberOfCtusInFrame, 0 );
pcPic->resizeSAO( numberOfCtusInFrame, 1 );
}
// it is used for signalling during CTU mode decision, i.e. before ALF processing
if( pcSlice->getSPS()->getUseALF() )
if( pcSlice->getSPS()->getALFEnabledFlag() )
{
pcPic->resizeAlfCtuEnableFlag( numberOfCtusInFrame );
std::memset( pcSlice->getAlfSliceParam().enabledFlag, false, sizeof( pcSlice->getAlfSliceParam().enabledFlag ) );
......@@ -2087,7 +2087,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
pcSlice = pcPic->slices[0];
// SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas
if( pcSlice->getSPS()->getUseSAO() && m_pcCfg->getSaoCtuBoundary() )
if( pcSlice->getSPS()->getSAOEnabledFlag() && m_pcCfg->getSaoCtuBoundary() )
{
m_pcSAO->getPreDBFStatistics( cs );
}
......@@ -2113,7 +2113,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
DTRACE_UPDATE( g_trace_ctx, ( std::make_pair( "final", 1 ) ) );
if( pcSlice->getSPS()->getUseSAO() )
if( pcSlice->getSPS()->getSAOEnabledFlag() )
{
bool sliceEnabled[MAX_NUM_COMPONENT];
m_pcSAO->initCABACEstimator( m_pcEncLib->getCABACEncoder(), m_pcEncLib->getCtxCache(), pcSlice );
......@@ -2136,7 +2136,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
}
}
if( pcSlice->getSPS()->getUseALF() )
if( pcSlice->getSPS()->getALFEnabledFlag() )
{
AlfSliceParam alfSliceParam;
m_pcALF->initCABACEstimator( m_pcEncLib->getCABACEncoder(), m_pcEncLib->getCtxCache(), pcSlice );
......@@ -2172,7 +2172,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
}
}
#endif
if( pcSlice->getSPS()->getUseSAO() )
if( pcSlice->getSPS()->getSAOEnabledFlag() )
{
m_pcSAO->disabledRate( *pcPic->cs, pcPic->getSAO(1), m_pcCfg->getSaoEncodingRate(), m_pcCfg->getSaoEncodingRateChroma());
}
......
......@@ -851,10 +851,10 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setUseLargeCTU ( m_LargeCTU );
sps.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
sps.setUseDualITree ( m_dualITree );
sps.getSpsNext().setSubPuMvpMode ( m_SubPuMvpMode );
sps.setSBTMVPEnabledFlag ( m_SubPuMvpMode );
sps.getSpsNext().setImvMode ( ImvMode(m_ImvMode) );
sps.getSpsNext().setUseIMV ( m_ImvMode != IMV_OFF );
sps.getSpsNext().setUseBIO ( m_BIO );
sps.setBDOFEnabledFlag ( m_BIO );
sps.getSpsNext().setUseAffine ( m_Affine );
sps.getSpsNext().setUseAffineType ( m_AffineType );
sps.getSpsNext().setDisableMotCompress ( m_DisableMotionCompression );
......@@ -891,7 +891,7 @@ void EncLib::xInitSPS(SPS &sps)
sps.getSpsNext().setCPRMode ( m_CPRMode );
sps.setUseWrapAround ( m_wrapAround );
sps.setWrapAroundEnabledFlag ( m_wrapAround );
sps.setWrapAroundOffset ( m_wrapAroundOffset );
// ADD_NEW_TOOL : (encoder lib) set tool enabling flags and associated parameters here
......@@ -906,7 +906,7 @@ void EncLib::xInitSPS(SPS &sps)
sps.setLog2MinCodingBlockSize(log2MinCUSize);
sps.setPCMLog2MinSize (m_uiPCMLog2MinSize);
sps.setUsePCM ( m_usePCM );
sps.setPCMEnabledFlag ( m_usePCM );
sps.setPCMLog2MaxSize( m_pcmLog2MaxSize );
sps.setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize );
......@@ -918,8 +918,6 @@ void EncLib::xInitSPS(SPS &sps)
sps.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize );
sps.setUseAMP ( m_useAMP );
for (uint32_t channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
{
sps.setBitDepth (ChannelType(channelType), m_bitDepth[channelType] );
......@@ -927,7 +925,7 @@ void EncLib::xInitSPS(SPS &sps)
sps.setPCMBitDepth (ChannelType(channelType), m_PCMBitDepth[channelType] );
}
sps.setUseSAO( m_bUseSAO );
sps.setSAOEnabledFlag( m_bUseSAO );
sps.setMaxTLayers( m_maxTempLayer );
sps.setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false );
......@@ -945,7 +943,7 @@ void EncLib::xInitSPS(SPS &sps)
#if HEVC_USE_INTRA_SMOOTHING_T32 || HEVC_USE_INTRA_SMOOTHING_T64
sps.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );
#endif
sps.setUseALF( m_alf );
sps.setALFEnabledFlag( m_alf );
sps.setVuiParametersPresentFlag(getVuiParametersPresentFlag());
if (sps.getVuiParametersPresentFlag())
......
......@@ -1112,7 +1112,7 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
m_ComprCUCtxList.back().testModes.push_back( { ETM_MERGE_TRIANGLE, ETO_STANDARD, qp, lossless } );
}
m_ComprCUCtxList.back().testModes.push_back( { ETM_MERGE_SKIP, ETO_STANDARD, qp, lossless } );
if ( cs.sps->getSpsNext().getUseAffine() || cs.sps->getSpsNext().getUseSubPuMvp() )
if ( cs.sps->getSpsNext().getUseAffine() || cs.sps->getSBTMVPEnabledFlag() )
{
m_ComprCUCtxList.back().testModes.push_back( { ETM_AFFINE, ETO_STANDARD, qp, lossless } );
}
......@@ -1126,7 +1126,7 @@ void EncModeCtrlMTnoRQT::initCULevel( Partitioner &partitioner, const CodingStru
m_ComprCUCtxList.back().testModes.push_back( { ETM_MERGE_TRIANGLE, ETO_STANDARD, qp, lossless } );
}
m_ComprCUCtxList.back().testModes.push_back( { ETM_MERGE_SKIP, ETO_STANDARD, qp, lossless } );
if ( cs.sps->getSpsNext().getUseAffine() || cs.sps->getSpsNext().getUseSubPuMvp() )
if ( cs.sps->getSpsNext().getUseAffine() || cs.sps->getSBTMVPEnabledFlag() )
{
m_ComprCUCtxList.back().testModes.push_back( { ETM_AFFINE, ETO_STANDARD, qp, lossless } );
}
......@@ -1294,7 +1294,7 @@ bool EncModeCtrlMTnoRQT::tryMode( const EncTestMode& encTestmode, const CodingSt
}
// PCM MODES
return sps.getUsePCM() && width <= ( 1 << sps.getPCMLog2MaxSize() ) && width >= ( 1 << sps.getPCMLog2MinSize() );
return sps.getPCMEnabledFlag() && width <= ( 1 << sps.getPCMLog2MaxSize() ) && width >= ( 1 << sps.getPCMLog2MinSize() );
}
else if (encTestmode.type == ETM_CPR || encTestmode.type == ETM_CPR_MERGE)
{
......
......@@ -1543,7 +1543,7 @@ void InterSearch::predInterSearch(CodingUnit& cu, Partitioner& partitioner)
CHECK(pu.cu != &cu, "PU is contained in another CU");
if (cu.cs->sps->getSpsNext().getUseSubPuMvp())
if (cu.cs->sps->getSBTMVPEnabledFlag())
{
Size bufSize = g_miScaling.scale(pu.lumaSize());
mergeCtx.subPuMvpMiBuf = MotionBuf(m_SubPuMiBuf, bufSize);
......