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++)
......
......@@ -791,6 +791,8 @@ public:
class SPS;
// Deprecated: SPSNext is going to be removed! Do not add any parameters to SPSNext
class SPSNext
{
private:
......@@ -799,9 +801,7 @@ private:
bool m_NextEnabled;
//===== tool enabling flags (4 bytes - NOTE: last flag must be used for new extensions) =====
bool m_LargeCTU; // 5
bool m_SubPuMvp;
bool m_IMV; // 9
bool m_BIO;
bool m_DisableMotionCompression; // 13
bool m_LMChroma; // 17
#if JVET_M0464_UNI_MTS
......@@ -833,19 +833,14 @@ public:
private:
//===== additional parameters =====
// qtbt
// sub-pu merging
int m_subPuMrgMode;
//imv
ImvMode m_ImvMode;
// multi type tree (QTBT + triple split)
unsigned m_MTTMode;
bool m_compositeRefEnabled; //composite longterm reference
bool m_compositeRefEnabled; //composite longterm reference
unsigned m_CPRMode;
// ADD_NEW_TOOL : (sps extension) add tool enabling flags and associated parameters here
public:
SPSNext( SPS& sps );
......@@ -857,17 +852,12 @@ public:
//===== tool enabling flags and extension bit =====
void setUseLargeCTU ( bool b ) { m_LargeCTU = b; }
bool getUseLargeCTU () const { return m_LargeCTU; }
bool getUseSubPuMvp() const { return m_SubPuMvp; }
void setSubPuMvpMode(int n) { m_subPuMrgMode = n; m_SubPuMvp = n != 0; }
bool getUseATMVP() const { return (m_subPuMrgMode & 1) == 1; }
void setUseIMV ( bool b ) { m_IMV = b; }
bool getUseIMV () const { return m_IMV; }
void setUseAffine ( bool b ) { m_Affine = b; }
bool getUseAffine () const { return m_Affine; }
void setUseAffineType ( bool b ) { m_AffineType = b; }
bool getUseAffineType () const { return m_AffineType; }
void setUseBIO(bool b) { m_BIO = b; }
bool getUseBIO() const { return m_BIO; }
void setDisableMotCompress ( bool b ) { m_DisableMotionCompression = b; }
bool getDisableMotCompress () const { return m_DisableMotionCompression; }
bool getMTTEnabled () const { return m_MTTEnabled; }
......@@ -906,8 +896,6 @@ public:
void setImvMode(ImvMode m) { m_ImvMode = m; m_IMV = m != 0; }
ImvMode getImvMode () const { return m_ImvMode; }
// multi type tree
unsigned getMTTMode () const { return m_MTTMode; }
void setMTTMode ( unsigned mode ) { m_MTTMode = mode; m_MTTEnabled = ( m_MTTMode != 0 ); }
......@@ -921,8 +909,6 @@ public:
bool getUseTriangle () const { return m_Triangle; }
void setCPRMode (unsigned CPRMode) { m_CPRMode = CPRMode; }
unsigned getCPRMode () const { return m_CPRMode; }
// ADD_NEW_TOOL : (sps extension) add access functions for tool enabling flags and associated parameters here
};
......@@ -985,10 +971,9 @@ private:
uint32_t m_uiQuadtreeTULog2MinSize;
uint32_t m_uiQuadtreeTUMaxDepthInter;
uint32_t m_uiQuadtreeTUMaxDepthIntra;
bool m_usePCM;
bool m_pcmEnabledFlag;
uint32_t m_pcmLog2MaxSize;
uint32_t m_uiPCMLog2MinSize;
bool m_useAMP;
// Parameter
BitDepths m_bitDepths;
......@@ -996,6 +981,9 @@ private:
int m_pcmBitDepths[MAX_NUM_CHANNEL_TYPE];
bool m_bPCMFilterDisableFlag;
bool m_sbtmvpEnabledFlag;
bool m_bdofEnabledFlag;
uint32_t m_uiBitsForPOC;
uint32_t m_numLongTermRefPicSPS;
uint32_t m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
......@@ -1003,7 +991,7 @@ private:
// Max physical transform size
uint32_t m_uiMaxTrSize;
bool m_bUseSAO;
bool m_saoEnabledFlag;
bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
......@@ -1029,9 +1017,9 @@ private:
static const int m_winUnitY[NUM_CHROMA_FORMAT];
PTL m_pcPTL;
bool m_useALF;
bool m_alfEnabledFlag;
bool m_useWrapAround;
bool m_wrapAroundEnabledFlag;
unsigned m_wrapAroundOffset;
public:
......@@ -1147,16 +1135,14 @@ public:
uint32_t getMaxCUHeight() const { return m_uiMaxCUHeight; }
void setMaxCodingDepth( uint32_t u ) { m_uiMaxCodingDepth = u; }
uint32_t getMaxCodingDepth() const { return m_uiMaxCodingDepth; }
void setUsePCM( bool b ) { m_usePCM = b; }
bool getUsePCM() const { return m_usePCM; }
void setPCMEnabledFlag( bool b ) { m_pcmEnabledFlag = b; }
bool getPCMEnabledFlag() const { return m_pcmEnabledFlag; }
void setPCMLog2MaxSize( uint32_t u ) { m_pcmLog2MaxSize = u; }
uint32_t getPCMLog2MaxSize() const { return m_pcmLog2MaxSize; }
void setPCMLog2MinSize( uint32_t u ) { m_uiPCMLog2MinSize = u; }
uint32_t getPCMLog2MinSize() const { return m_uiPCMLog2MinSize; }
void setBitsForPOC( uint32_t u ) { m_uiBitsForPOC = u; }
uint32_t getBitsForPOC() const { return m_uiBitsForPOC; }
bool getUseAMP() const { return m_useAMP; }
void setUseAMP( bool b ) { m_useAMP = b; }
void setQuadtreeTULog2MaxSize( uint32_t u ) { m_uiQuadtreeTULog2MaxSize = u; }
uint32_t getQuadtreeTULog2MaxSize() const { return m_uiQuadtreeTULog2MaxSize; }
void setQuadtreeTULog2MinSize( uint32_t u ) { m_uiQuadtreeTULog2MinSize = u; }
......@@ -1188,11 +1174,20 @@ public:
int getQpBDOffset(ChannelType type) const { return m_qpBDOffset[type]; }
void setQpBDOffset(ChannelType type, int i) { m_qpBDOffset[type] = i; }
void setUseSAO(bool bVal) { m_bUseSAO = bVal; }
bool getUseSAO() const { return m_bUseSAO; }
void setSAOEnabledFlag(bool bVal) { m_saoEnabledFlag = bVal; }
bool getSAOEnabledFlag() const { return m_saoEnabledFlag; }
bool getALFEnabledFlag() const { return m_alfEnabledFlag; }
void setALFEnabledFlag( bool b ) { m_alfEnabledFlag = b; }
uint32_t getMaxTLayers() const { return m_uiMaxTLayers; }
void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; }
bool getSBTMVPEnabledFlag() const { return m_sbtmvpEnabledFlag; }
void setSBTMVPEnabledFlag(bool b) { m_sbtmvpEnabledFlag = b; }
void setBDOFEnabledFlag(bool b) { m_bdofEnabledFlag = b; }
bool getBDOFEnabledFlag() const { return m_bdofEnabledFlag; }
uint32_t getMaxTLayers() const { return m_uiMaxTLayers; }
void setMaxTLayers( uint32_t uiMaxTLayers ) { CHECK( uiMaxTLayers > MAX_TLAYER, "Invalid number T-layers" ); m_uiMaxTLayers = uiMaxTLayers; }
bool getTemporalIdNestingFlag() const { return m_bTemporalIdNestingFlag; }
void setTemporalIdNestingFlag( bool bValue ) { m_bTemporalIdNestingFlag = bValue; }
......@@ -1232,11 +1227,8 @@ public:
const SPSNext& getSpsNext() const { return m_spsNextExtension; }
SPSNext& getSpsNext() { return m_spsNextExtension; }
bool getUseALF() const { return m_useALF; }
void setUseALF( bool b ) { m_useALF = b; }
void setUseWrapAround(bool b) { m_useWrapAround = b; }
bool getUseWrapAround() const { return m_useWrapAround; }
void setWrapAroundEnabledFlag(bool b) { m_wrapAroundEnabledFlag = b; }
bool getWrapAroundEnabledFlag() const { return m_wrapAroundEnabledFlag; }
void setWrapAroundOffset(unsigned offset) { m_wrapAroundOffset = offset; }
unsigned getWrapAroundOffset() const { return m_wrapAroundOffset; }
};
......
......@@ -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" );