diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 408886b4546730c308de9f98bf6d168bca79e825..226c717f5356f6f201348cbfcbfd0adee787c7be 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -175,7 +175,6 @@ void EncApp::xInitLibCfg() } } } -#if JVET_Q0786_PTL_only CHECK( m_numPtlsInVps == 0, "There has to be at least one PTL structure in the VPS." ); vps.setNumPtls ( m_numPtlsInVps ); vps.setPtPresentFlag (0, 1); @@ -205,7 +204,6 @@ void EncApp::xInitLibCfg() ptls[i].setLevelIdc (m_levelPtl[i]); } vps.setProfileTierLevel(ptls); -#endif vps.setVPSExtensionFlag ( false ); #if !JVET_Q0814_DPB m_cEncLib.setVPS(&vps); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 1915d9bd9bc8fdfe32a6c8bef4731e1389b343d2..97b7b5be5634b94c9233d90a4655d838857a3a0f 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1422,9 +1422,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ( "OlsModeIdc", m_olsModeIdc, 0, "Output layer set mode") ( "NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets") ( "OlsOutputLayer%d", m_olsOutputLayerStr, string(""), MAX_VPS_LAYERS, "Output layer index of i-th OLS") -#if JVET_Q0786_PTL_only ( "NumPTLsInVPS", m_numPtlsInVps, 1, "Number of profile_tier_level structures in VPS" ) -#endif ; opts.addOptions() @@ -1445,7 +1443,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry()); } -#if JVET_Q0786_PTL_only for(int i = 0; i < MAX_NUM_OLSS; i++) { std::ostringstream cOSS1; @@ -1456,7 +1453,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) cOSS2<<"OlsPTLIdx"<<i; opts.addOptions()(cOSS2.str(), m_olsPtlIdx[i], 0); } -#endif po::setDefaults(opts); po::ErrorReporter err; diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index c284d7be7dadb7f18d1de9762ee85ce611512af8..432df395122a9cd09cd3986621359d659f14c168 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -762,11 +762,9 @@ protected: int m_numOutputLayerSets; std::string m_olsOutputLayerStr[MAX_VPS_LAYERS]; -#if JVET_Q0786_PTL_only int m_numPtlsInVps; Level::Name m_levelPtl[MAX_NUM_OLSS]; int m_olsPtlIdx[MAX_NUM_OLSS]; -#endif #if EXTENSION_360_VIDEO TExt360AppEncCfg m_ext360; diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 3259b0ee1503b733e4ea4ed7909f7aff1a2c13a8..45e6046cfbb67b8789357bf0c44d99b5b7048739 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -2039,9 +2039,7 @@ VPS::VPS() , m_vpsEachLayerIsAnOlsFlag (1) , m_vpsOlsModeIdc (0) , m_vpsNumOutputLayerSets (1) -#if JVET_Q0786_PTL_only , m_vpsNumPtls (1) -#endif , m_vpsExtensionFlag() , m_vpsGeneralHrdParamsPresentFlag(false) , m_vpsSublayerCpbParamsPresentFlag(false) @@ -2070,14 +2068,12 @@ VPS::VPS() { m_vpsOlsOutputLayerFlag[i][j] = 0; } -#if JVET_Q0786_PTL_only if(i == 0) m_ptPresentFlag[i] = 1; else m_ptPresentFlag[i] = 0; m_ptlMaxTemporalId[i] = m_vpsMaxSubLayers - 1; m_olsPtlIdx[i] = 0; -#endif m_hrdMaxTid[i] = m_vpsMaxSubLayers - 1; m_olsHrdIdx[i] = 0; } diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index f33f2fb9984b0ca691919a73cfa86960ec0c45fa..6d7b9c30a715b06ee2e211ee2d72eb383a3f9410 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -934,13 +934,11 @@ private: uint32_t m_directRefLayerIdx[MAX_VPS_LAYERS][MAX_VPS_LAYERS]; uint32_t m_generalLayerIdx[MAX_VPS_LAYERS]; -#if JVET_Q0786_PTL_only uint32_t m_vpsNumPtls; bool m_ptPresentFlag[MAX_NUM_OLSS]; uint32_t m_ptlMaxTemporalId[MAX_NUM_OLSS]; std::vector<ProfileTierLevel> m_vpsProfileTierLevel; uint32_t m_olsPtlIdx[MAX_NUM_OLSS]; -#endif // stores index ( ilrp_idx within 0 .. NumDirectRefLayers ) of the dependent reference layers uint32_t m_interLayerRefIdx[MAX_VPS_LAYERS][MAX_VPS_LAYERS]; @@ -1022,7 +1020,6 @@ public: bool getOlsOutputLayerFlag(uint32_t ols, uint32_t layer) const { return m_vpsOlsOutputLayerFlag[ols][layer]; } void setOlsOutputLayerFlag(uint32_t ols, uint32_t layer, bool t) { m_vpsOlsOutputLayerFlag[ols][layer] = t; } -#if JVET_Q0786_PTL_only uint32_t getNumPtls() const { return m_vpsNumPtls; } void setNumPtls(uint32_t val) { m_vpsNumPtls = val; } @@ -1037,7 +1034,6 @@ public: uint32_t getOlsPtlIdx(int idx) const { return m_olsPtlIdx[idx]; } void setOlsPtlIdx(int idx, uint32_t val) { m_olsPtlIdx[idx] = val; } -#endif bool getVPSExtensionFlag() const { return m_vpsExtensionFlag; } void setVPSExtensionFlag(bool t) { m_vpsExtensionFlag = t; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 18e899ebbcfd350d9d2ea79f5faba8655cdc848d..1791934a0c7905d587e16a4843615ec78c991854 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -76,7 +76,6 @@ -#define JVET_Q0786_PTL_only 1 // JVET-Q0786: modifications to VPS syntax - PTL part only (signal PTL for single layer OLSs) #define JVET_P0116_POC_MSB 1 // JVET-P0116: use POC MSB cycle signalling for independent layers,to support of mixed IRAP and non-IRAP pictures within an AU diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 19e635994c71c80ae241976542648da1884cc1b0..c7c87453ab87847f442aa83c9eeff123b7f514ef 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -1429,11 +1429,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) if (pcSPS->getPtlDpbHrdParamsPresentFlag()) { -#if JVET_Q0786_PTL_only parseProfileTierLevel(pcSPS->getProfileTierLevel(), true, pcSPS->getMaxTLayers() - 1); -#else - parseProfileTierLevel(pcSPS->getProfileTierLevel(), pcSPS->getMaxTLayers() - 1); -#endif } @@ -2311,11 +2307,7 @@ void HLSyntaxReader::parseDCI(DCI* dci) ptls.resize(numPTLs); for (int i = 0; i < numPTLs; i++) { -#if JVET_Q0786_PTL_only parseProfileTierLevel(&ptls[i], true, 0); -#else - parseProfileTierLevel(&ptls[i], 0); -#endif } dci->setProfileTierLevel(ptls); @@ -2352,11 +2344,7 @@ void HLSyntaxReader::parseDPS(DPS* dps) ptls.resize(numPTLs); for (int i=0; i<numPTLs; i++) { -#if JVET_Q0786_PTL_only parseProfileTierLevel(&ptls[i], true, 0); -#else - parseProfileTierLevel(&ptls[i], dps->getMaxSubLayersMinus1()); -#endif } dps->setProfileTierLevel(ptls); @@ -2461,7 +2449,6 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) } } -#if JVET_Q0786_PTL_only pcVPS->deriveOutputLayerSets(); READ_CODE(8, uiCode, "vps_num_ptls_minus1"); pcVPS->setNumPtls(uiCode + 1); for (int i = 0; i < pcVPS->getNumPtls(); i++) @@ -2508,7 +2495,6 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) else pcVPS->setOlsPtlIdx(i, 0); } -#endif #if JVET_Q0814_DPB if( !pcVPS->getAllIndependentLayersFlag() ) @@ -2563,9 +2549,6 @@ void HLSyntaxReader::parseVPS(VPS* pcVPS) } } -#if !JVET_Q0786_PTL_only - pcVPS->deriveOutputLayerSets(); -#endif for( int i = 0; i < pcVPS->getTotalNumOLSs(); i++ ) { @@ -5045,30 +5028,18 @@ void HLSyntaxReader::parseConstraintInfo(ConstraintInfo *cinfo) } -#if JVET_Q0786_PTL_only void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, bool profileTierPresentFlag, int maxNumSubLayersMinus1) -#else -void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubLayersMinus1) -#endif { uint32_t symbol; -#if JVET_Q0786_PTL_only if(profileTierPresentFlag) { READ_CODE(7 , symbol, "general_profile_idc" ); ptl->setProfileIdc (Profile::Name(symbol)); READ_FLAG( symbol, "general_tier_flag" ); ptl->setTierFlag (symbol ? Level::HIGH : Level::MAIN); parseConstraintInfo( ptl->getConstraintInfo() ); } -#else - READ_CODE(7 , symbol, "general_profile_idc" ); ptl->setProfileIdc (Profile::Name(symbol)); - READ_FLAG( symbol, "general_tier_flag" ); ptl->setTierFlag (symbol ? Level::HIGH : Level::MAIN); - - parseConstraintInfo( ptl->getConstraintInfo() ); -#endif READ_CODE( 8, symbol, "general_level_idc" ); ptl->setLevelIdc( Level::Name( symbol ) ); -#if JVET_Q0786_PTL_only if(profileTierPresentFlag) { READ_CODE(8, symbol, "num_sub_profiles"); @@ -5079,15 +5050,6 @@ void HLSyntaxReader::parseProfileTierLevel(ProfileTierLevel *ptl, int maxNumSubL READ_CODE(32, symbol, "general_sub_profile_idc[i]"); ptl->setSubProfileIdc(i, symbol); } } -#else - READ_CODE(8, symbol, "num_sub_profiles"); - uint8_t numSubProfiles = symbol; - ptl->setNumSubProfile( numSubProfiles ); - for (int i = 0; i < numSubProfiles; i++) - { - READ_CODE(32, symbol, "general_sub_profile_idc[i]"); ptl->setSubProfileIdc(i, symbol); - } -#endif for (int i = 0; i < maxNumSubLayersMinus1; i++) { diff --git a/source/Lib/DecoderLib/VLCReader.h b/source/Lib/DecoderLib/VLCReader.h index a9298d10eb8eeec4acd64cebe05cb898a72c0bac..ff32f98adf456effb91fbf911f9e4820dc0f96c7 100644 --- a/source/Lib/DecoderLib/VLCReader.h +++ b/source/Lib/DecoderLib/VLCReader.h @@ -170,11 +170,7 @@ public: void parseScalingListAps ( APS* pcAPS ); void parseVUI ( VUI* pcVUI, SPS* pcSPS ); void parseConstraintInfo (ConstraintInfo *cinfo); -#if JVET_Q0786_PTL_only void parseProfileTierLevel(ProfileTierLevel *ptl, bool profileTierPresentFlag, int maxNumSubLayersMinus1); -#else - void parseProfileTierLevel ( ProfileTierLevel *ptl, int maxNumSubLayersMinus1); -#endif void parseOlsHrdParameters(GeneralHrdParams* generalHrd, OlsHrdParams *olsHrd, uint32_t firstSubLayer, uint32_t tempLevelHigh); void parseGeneralHrdParameters(GeneralHrdParams *generalHrd); #if JVET_Q0775_PH_IN_SH diff --git a/source/Lib/EncoderLib/EncLib.cpp b/source/Lib/EncoderLib/EncLib.cpp index d61e53cd17d0747e4b4292f64767932ca9433e66..8bae8a4047d505f64399cf500989bb56f2a83324 100644 --- a/source/Lib/EncoderLib/EncLib.cpp +++ b/source/Lib/EncoderLib/EncLib.cpp @@ -1054,9 +1054,6 @@ void EncLib::xInitVPS( const SPS& sps ) { // The SPS must have already been set up. // set the VPS profile information. -#if !JVET_Q0786_PTL_only - m_vps->setMaxSubLayers( sps.getMaxTLayers() ); -#endif m_vps->m_olsHrdParams.clear(); m_vps->m_olsHrdParams.resize(m_vps->getNumOlsHrdParamsMinus1(), std::vector<OlsHrdParams>(m_vps->getMaxSubLayers())); @@ -1140,9 +1137,6 @@ void EncLib::xInitVPS(VPS& vps, const SPS& sps) { // The SPS must have already been set up. // set the VPS profile information. -#if !JVET_Q0786_PTL_only - vps.setMaxSubLayers(sps.getMaxTLayers()); -#endif } #endif @@ -1594,11 +1588,9 @@ void EncLib::xInitSPS( SPS& sps, VPS& vps ) for( int i = 0; i < m_vps->getMaxLayers(); ++i ) { -#if JVET_Q0786_PTL_only //Bug fix to make the decoder run with configfile layers.cfg if(m_vps->getIndependentLayerFlag(i) == 1) sps.setInterLayerPresentFlag(0); -#endif CHECK((m_vps->getIndependentLayerFlag(i) == 1) && (sps.getInterLayerPresentFlag() != 0), " When vps_independent_layer_flag[GeneralLayerIdx[nuh_layer_id ]] is equal to 1, the value of inter_layer_ref_pics_present_flag shall be equal to 0."); } #endif @@ -1610,11 +1602,9 @@ void EncLib::xInitSPS( SPS& sps, VPS& vps ) sps.setInterLayerPresentFlag( vps.getMaxLayers() > 1 && !vps.getAllIndependentLayersFlag() ); for (unsigned int i = 0; i < vps.getMaxLayers(); ++i) { -#if JVET_Q0786_PTL_only //Bug fix to make the decoder run with configfile layers.cfg if(vps.getIndependentLayerFlag(i) == 1) sps.setInterLayerPresentFlag(0); -#endif CHECK((vps.getIndependentLayerFlag(i) == 1) && (sps.getInterLayerPresentFlag() != 0), " When vps_independent_layer_flag[GeneralLayerIdx[nuh_layer_id ]] is equal to 1, the value of inter_layer_ref_pics_present_flag shall be equal to 0."); } #endif diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index e929f29238592d949341959dbbb39d0a08696789..c53728a6a0454e2b9390dbe9155061a8d095ee2e 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -921,11 +921,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) if (pcSPS->getPtlDpbHrdParamsPresentFlag()) { -#if JVET_Q0786_PTL_only codeProfileTierLevel(pcSPS->getProfileTierLevel(), true, pcSPS->getMaxTLayers() - 1); -#else - codeProfileTierLevel(pcSPS->getProfileTierLevel(), pcSPS->getMaxTLayers() - 1); -#endif } WRITE_FLAG(pcSPS->getGDREnabledFlag(), "gdr_enabled_flag"); @@ -1551,11 +1547,7 @@ void HLSWriter::codeDCI(const DCI* dci) for (int i = 0; i < numPTLs; i++) { ProfileTierLevel ptl = dci->getProfileTierLevel(i); -#if JVET_Q0786_PTL_only codeProfileTierLevel(&ptl, true, 0); -#else - codeProfileTierLevel(&ptl, 0); -#endif } WRITE_FLAG(0, "dci_extension_flag"); @@ -1578,11 +1570,7 @@ void HLSWriter::codeDPS( const DPS* dps ) for (int i=0; i< numPTLs; i++) { ProfileTierLevel ptl = dps->getProfileTierLevel(i); -#if JVET_Q0786_PTL_only codeProfileTierLevel( &ptl, true, 0 ); -#else - codeProfileTierLevel( &ptl, dps->getMaxSubLayersMinus1() ); -#endif } WRITE_FLAG( 0, "dps_extension_flag" ); xWriteRbspTrailingBits(); @@ -1644,7 +1632,6 @@ void HLSWriter::codeVPS(const VPS* pcVPS) } } -#if JVET_Q0786_PTL_only int totalNumOlss = pcVPS->getTotalNumOLSs(); WRITE_CODE(pcVPS->getNumPtls() - 1, 8, "vps_num_ptls_minus1"); for (int i = 0; i < pcVPS->getNumPtls(); i++) @@ -1670,7 +1657,6 @@ void HLSWriter::codeVPS(const VPS* pcVPS) if(pcVPS->getNumPtls() > 1) WRITE_CODE(pcVPS->getOlsPtlIdx(i), 8, "ols_ptl_idx"); } -#endif #if JVET_Q0814_DPB if( !pcVPS->getAllIndependentLayersFlag() ) @@ -3213,29 +3199,17 @@ void HLSWriter::codeConstraintInfo ( const ConstraintInfo* cinfo ) WRITE_FLAG(cinfo->getNoApsConstraintFlag() ? 1 : 0, "no_aps_constraint_flag"); } -#if JVET_Q0786_PTL_only void HLSWriter::codeProfileTierLevel ( const ProfileTierLevel* ptl, bool profileTierPresentFlag, int maxNumSubLayersMinus1 ) -#else -void HLSWriter::codeProfileTierLevel ( const ProfileTierLevel* ptl, int maxNumSubLayersMinus1 ) -#endif { -#if JVET_Q0786_PTL_only if(profileTierPresentFlag) { WRITE_CODE( int(ptl->getProfileIdc()), 7 , "general_profile_idc" ); WRITE_FLAG( ptl->getTierFlag()==Level::HIGH, "general_tier_flag" ); codeConstraintInfo( ptl->getConstraintInfo() ); } -#else - WRITE_CODE( int(ptl->getProfileIdc()), 7 , "general_profile_idc" ); - WRITE_FLAG( ptl->getTierFlag()==Level::HIGH, "general_tier_flag" ); - - codeConstraintInfo( ptl->getConstraintInfo() ); -#endif WRITE_CODE( int( ptl->getLevelIdc() ), 8, "general_level_idc" ); -#if JVET_Q0786_PTL_only if(profileTierPresentFlag) { WRITE_CODE(ptl->getNumSubProfile(), 8, "num_sub_profiles"); @@ -3244,13 +3218,6 @@ void HLSWriter::codeProfileTierLevel ( const ProfileTierLevel* ptl, int maxN WRITE_CODE(ptl->getSubProfileIdc(i) , 32, "general_sub_profile_idc[i]"); } } -#else - WRITE_CODE(ptl->getNumSubProfile(), 8, "num_sub_profiles"); - for (int i = 0; i < ptl->getNumSubProfile(); i++) - { - WRITE_CODE(ptl->getSubProfileIdc(i) , 32, "general_sub_profile_idc[i]"); - } -#endif for (int i = 0; i < maxNumSubLayersMinus1; i++) { diff --git a/source/Lib/EncoderLib/VLCWriter.h b/source/Lib/EncoderLib/VLCWriter.h index 0652696a762983f05a66d10217ac72da5bee8f21..a24a6da532f9e13e81220ab7d3bf98430aa086f5 100644 --- a/source/Lib/EncoderLib/VLCWriter.h +++ b/source/Lib/EncoderLib/VLCWriter.h @@ -143,11 +143,7 @@ public: #endif void codeSliceHeader ( Slice* pcSlice ); void codeConstraintInfo ( const ConstraintInfo* cinfo ); -#if JVET_Q0786_PTL_only void codeProfileTierLevel ( const ProfileTierLevel* ptl, bool profileTierPresentFlag, int maxNumSubLayersMinus1 ); -#else - void codeProfileTierLevel ( const ProfileTierLevel* ptl, int maxNumSubLayersMinus1 ); -#endif void codeOlsHrdParameters(const GeneralHrdParams * generalHrd, const OlsHrdParams *olsHrd , const uint32_t firstSubLayer, const uint32_t maxNumSubLayersMinus1); void codeGeneralHrdparameters(const GeneralHrdParams *hrd);