diff --git a/source/App/EncoderApp/EncApp.cpp b/source/App/EncoderApp/EncApp.cpp index 4455577ea319e6ab8f6049f1f514e5e0f7d9e60a..d83bec23dfb835e3beee10ab58d4facb88b8c725 100644 --- a/source/App/EncoderApp/EncApp.cpp +++ b/source/App/EncoderApp/EncApp.cpp @@ -161,7 +161,7 @@ void EncApp::xInitLibCfg() m_cEncLib.setDecodingRefreshType ( m_iDecodingRefreshType ); m_cEncLib.setGOPSize ( m_iGOPSize ); #if JVET_N0494_DRAP - m_cEncLib.setDrapPeriod ( m_iDrapPeriod ); + m_cEncLib.setDrapPeriod ( m_drapPeriod ); #endif m_cEncLib.setReWriteParamSets ( m_rewriteParamSets ); m_cEncLib.setRPLList0 ( m_RPLList0); @@ -463,7 +463,7 @@ void EncApp::xInitLibCfg() m_cEncLib.setRecoveryPointSEIEnabled ( m_recoveryPointSEIEnabled ); #endif #if JVET_N0494_DRAP - m_cEncLib.setDependentRAPIndicationSEIEnabled ( m_iDrapPeriod > 0 ); + m_cEncLib.setDependentRAPIndicationSEIEnabled ( m_drapPeriod > 0 ); #endif m_cEncLib.setBufferingPeriodSEIEnabled ( m_bufferingPeriodSEIEnabled ); m_cEncLib.setPictureTimingSEIEnabled ( m_pictureTimingSEIEnabled ); diff --git a/source/App/EncoderApp/EncAppCfg.cpp b/source/App/EncoderApp/EncAppCfg.cpp index 4978f7d1454d44d3a42dcdb7463509f4dab2958b..686a6c088547546f57504877d25d9a6a24c4a64b 100644 --- a/source/App/EncoderApp/EncAppCfg.cpp +++ b/source/App/EncoderApp/EncAppCfg.cpp @@ -1018,7 +1018,7 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] ) ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)") ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") #if JVET_N0494_DRAP - ("DRAPPeriod", m_iDrapPeriod, 0, "DRAP period in frames (0: disable Dependent RAP indication SEI messages)") + ("DRAPPeriod", m_drapPeriod, 0, "DRAP period in frames (0: disable Dependent RAP indication SEI messages)") #endif ("ReWriteParamSets", m_rewriteParamSets, false, "Enable rewriting of Parameter sets before every (intra) random access point") //Alias with same name as in HM @@ -2583,7 +2583,7 @@ bool EncAppCfg::xCheckParameter() xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); #if JVET_N0494_DRAP - xConfirmPara( m_iDrapPeriod < 0, "DRAP period must be greater or equal to 0" ); + xConfirmPara( m_drapPeriod < 0, "DRAP period must be greater or equal to 0" ); #endif xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" ); #if HEVC_SEI @@ -3353,8 +3353,8 @@ bool EncAppCfg::xCheckParameter() } #endif #if JVET_N0494_DRAP - xConfirmPara(m_iDrapPeriod > 0 && m_PPSRefPicListSPSIdc0 > 0, "PPSRefPicListSPSIdc0 shall be 0 when DRAP is used. This can be fixed by setting PPSorSliceMode=0."); - xConfirmPara(m_iDrapPeriod > 0 && m_PPSRefPicListSPSIdc1 > 0, "PPSRefPicListSPSIdc1 shall be 0 when DRAP is used. This can be fixed by setting PPSorSliceMode=0."); + xConfirmPara(m_drapPeriod > 0 && m_PPSRefPicListSPSIdc0 > 0, "PPSRefPicListSPSIdc0 shall be 0 when DRAP is used. This can be fixed by setting PPSorSliceMode=0."); + xConfirmPara(m_drapPeriod > 0 && m_PPSRefPicListSPSIdc1 > 0, "PPSRefPicListSPSIdc1 shall be 0 when DRAP is used. This can be fixed by setting PPSorSliceMode=0."); #endif #if HEVC_SEI @@ -3545,7 +3545,7 @@ void EncAppCfg::xPrintParameter() msg( DETAILS, "Intra period : %d\n", m_iIntraPeriod ); msg( DETAILS, "Decoding refresh type : %d\n", m_iDecodingRefreshType ); #if JVET_N0494_DRAP - msg( DETAILS, "DRAP period : %d\n", m_iDrapPeriod ); + msg( DETAILS, "DRAP period : %d\n", m_drapPeriod ); #endif #if QP_SWITCHING_FOR_PARALLEL if (m_qpIncrementAtSourceFrame.bPresent) diff --git a/source/App/EncoderApp/EncAppCfg.h b/source/App/EncoderApp/EncAppCfg.h index 539f2b5fc213b7ca88dfb650095aa7cd7884abe7..0e337c4cc207d964fcac0bc3773612c86029ac39 100644 --- a/source/App/EncoderApp/EncAppCfg.h +++ b/source/App/EncoderApp/EncAppCfg.h @@ -180,7 +180,7 @@ protected: int m_iDecodingRefreshType; ///< random access type int m_iGOPSize; ///< GOP size of hierarchical structure #if JVET_N0494_DRAP - int m_iDrapPeriod; ///< period of dependent RAP pictures + int m_drapPeriod; ///< period of dependent RAP pictures #endif bool m_rewriteParamSets; ///< Flag to enable rewriting of parameter sets at random access points RPLEntry m_RPLList0[MAX_GOP]; ///< the RPL entries from the config file diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp index 9351e237ca3d52f34d81d44f4798c4bfbbfb1f53..91a62fd6fc3fcfac1afaf12cf1e0fd48524fb4b7 100644 --- a/source/Lib/CommonLib/Picture.cpp +++ b/source/Lib/CommonLib/Picture.cpp @@ -739,7 +739,7 @@ Picture::Picture() fieldPic = false; topField = false; #if JVET_N0494_DRAP - precedingDRAP = false; + precedingDRAP = false; #endif for( int i = 0; i < MAX_NUM_CHANNEL_TYPE; i++ ) { diff --git a/source/Lib/CommonLib/Picture.h b/source/Lib/CommonLib/Picture.h index 27b9dbae09879c84a6faca400ef630a950e0646c..15769a6df3f26fb14a879eeff7b70df0cc270d5c 100644 --- a/source/Lib/CommonLib/Picture.h +++ b/source/Lib/CommonLib/Picture.h @@ -272,7 +272,7 @@ public: bool fieldPic; int m_prevQP[MAX_NUM_CHANNEL_TYPE]; #if JVET_N0494_DRAP - int precedingDRAP; // preceding a DRAP picture in decoding order + bool precedingDRAP; // preceding a DRAP picture in decoding order #endif int poc; diff --git a/source/Lib/CommonLib/Slice.cpp b/source/Lib/CommonLib/Slice.cpp index 1398c3395803c003e2457d9b97fb01605eb68dc1..3e0784593e2dab552828355eaa372168ba29fe05 100644 --- a/source/Lib/CommonLib/Slice.cpp +++ b/source/Lib/CommonLib/Slice.cpp @@ -217,10 +217,10 @@ void Slice::initSlice() #endif m_enableTMVPFlag = true; #if JVET_N0494_DRAP - m_bEnableDRAPSEI = false; - m_bUseLTforDRAP = false; - m_bIsDRAP = false; - m_iLatestDRAPPOC = MAX_INT; + m_enableDRAPSEI = false; + m_useLTforDRAP = false; + m_isDRAP = false; + m_latestDRAPPOC = MAX_INT; #endif #if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB resetTileGroupAlfEnabledFlag(); @@ -1101,20 +1101,20 @@ int Slice::checkThatAllRefPicsAreAvailable(PicList& rcListPic, const ReferencePi } #if JVET_N0494_DRAP -bool Slice::isPOCInRefPicList(const ReferencePictureList *rpl, int iPOC ) +bool Slice::isPOCInRefPicList(const ReferencePictureList *rpl, int poc ) { for (int i = 0; i < rpl->getNumberOfLongtermPictures() + rpl->getNumberOfShorttermPictures(); i++) { if (rpl->isRefPicLongterm(i)) { - if (iPOC == rpl->getRefPicIdentifier(i)) + if (poc == rpl->getRefPicIdentifier(i)) { return true; } } else { - if (iPOC == getPOC() - rpl->getRefPicIdentifier(i)) + if (poc == getPOC() - rpl->getRefPicIdentifier(i)) { return true; } @@ -1125,8 +1125,10 @@ bool Slice::isPOCInRefPicList(const ReferencePictureList *rpl, int iPOC ) bool Slice::isPocRestrictedByDRAP( int poc, bool precedingDRAPInDecodingOrder ) { - if ( !getEnableDRAPSEI() ) + if (!getEnableDRAPSEI()) + { return false; + } return ( isDRAP() && poc != getAssociatedIRAPPOC() ) || ( cvsHasPreviousDRAP() && getPOC() > getLatestDRAPPOC() && (precedingDRAPInDecodingOrder || poc < getLatestDRAPPOC()) ); } @@ -1134,7 +1136,9 @@ bool Slice::isPocRestrictedByDRAP( int poc, bool precedingDRAPInDecodingOrder ) void Slice::checkConformanceForDRAP( uint32_t temporalId ) { if (!(isDRAP() || cvsHasPreviousDRAP())) + { return; + } if (isDRAP()) { diff --git a/source/Lib/CommonLib/Slice.h b/source/Lib/CommonLib/Slice.h index f46e971eda90a1b0e0c07464bdbbbeb2be846685..052e007d220d25476e2ad733a740fcaf5112f92e 100644 --- a/source/Lib/CommonLib/Slice.h +++ b/source/Lib/CommonLib/Slice.h @@ -1644,10 +1644,10 @@ private: int m_iAssociatedIRAP; NalUnitType m_iAssociatedIRAPType; #if JVET_N0494_DRAP - bool m_bEnableDRAPSEI; - bool m_bUseLTforDRAP; - bool m_bIsDRAP; - int m_iLatestDRAPPOC; + bool m_enableDRAPSEI; + bool m_useLTforDRAP; + bool m_isDRAP; + int m_latestDRAPPOC; #endif const ReferencePictureList* m_pRPL0; //< pointer to RPL for L0, either in the SPS or the local RPS in the same slice header const ReferencePictureList* m_pRPL1; //< pointer to RPL for L1, either in the SPS or the local RPS in the same slice header @@ -1913,17 +1913,17 @@ public: bool isInterP() const { return m_eSliceType == P_SLICE; } #if JVET_N0494_DRAP - bool getEnableDRAPSEI () const { return m_bEnableDRAPSEI; } - void setEnableDRAPSEI ( bool b ) { m_bEnableDRAPSEI = b; } - bool getUseLTforDRAP () const { return m_bUseLTforDRAP; } - void setUseLTforDRAP ( bool b ) { m_bUseLTforDRAP = b; } - bool isDRAP () const { return m_bIsDRAP; } - void setDRAP ( bool b ) { m_bIsDRAP = b; } - void setLatestDRAPPOC ( int i ) { m_iLatestDRAPPOC = i; } - int getLatestDRAPPOC () const { return m_iLatestDRAPPOC; } - bool cvsHasPreviousDRAP() const { return m_iLatestDRAPPOC != MAX_INT; } + bool getEnableDRAPSEI () const { return m_enableDRAPSEI; } + void setEnableDRAPSEI ( bool b ) { m_enableDRAPSEI = b; } + bool getUseLTforDRAP () const { return m_useLTforDRAP; } + void setUseLTforDRAP ( bool b ) { m_useLTforDRAP = b; } + bool isDRAP () const { return m_isDRAP; } + void setDRAP ( bool b ) { m_isDRAP = b; } + void setLatestDRAPPOC ( int i ) { m_latestDRAPPOC = i; } + int getLatestDRAPPOC () const { return m_latestDRAPPOC; } + bool cvsHasPreviousDRAP() const { return m_latestDRAPPOC != MAX_INT; } bool isPocRestrictedByDRAP( int poc, bool precedingDRAPinDecodingOrder ); - bool isPOCInRefPicList( const ReferencePictureList *rpl, int iPOC ); + bool isPOCInRefPicList( const ReferencePictureList *rpl, int poc ); void checkConformanceForDRAP( uint32_t temporalId ); #endif diff --git a/source/Lib/EncoderLib/EncCfg.h b/source/Lib/EncoderLib/EncCfg.h index e83d113c563f8fb2f5fbe61d00aadcfe6bf10064..e975e023ba23266a846855d0d15c1aa49f786b73 100644 --- a/source/Lib/EncoderLib/EncCfg.h +++ b/source/Lib/EncoderLib/EncCfg.h @@ -259,7 +259,7 @@ protected: int m_maxDecPicBuffering[MAX_TLAYER]; int m_numReorderPics[MAX_TLAYER]; #if JVET_N0494_DRAP - int m_iDrapPeriod; + int m_drapPeriod; #endif int m_iQP; // if (AdaptiveQP == OFF) @@ -875,7 +875,7 @@ public: void setMaxDecPicBuffering ( uint32_t u, uint32_t tlayer ) { m_maxDecPicBuffering[tlayer] = u; } void setNumReorderPics ( int i, uint32_t tlayer ) { m_numReorderPics[tlayer] = i; } #if JVET_N0494_DRAP - void setDrapPeriod (int iDrapPeriod) { m_iDrapPeriod = iDrapPeriod; } + void setDrapPeriod (int drapPeriod) { m_drapPeriod = drapPeriod; } #endif void setBaseQP ( int i ) { m_iQP = i; } @@ -1175,7 +1175,7 @@ public: int getMaxDecPicBuffering (uint32_t tlayer) { return m_maxDecPicBuffering[tlayer]; } int getNumReorderPics (uint32_t tlayer) { return m_numReorderPics[tlayer]; } #if JVET_N0494_DRAP - int getDrapPeriod () { return m_iDrapPeriod; } + int getDrapPeriod () { return m_drapPeriod; } #endif #if X0038_LAMBDA_FROM_QP_CAPABILITY int getIntraQPOffset () const { return m_intraQPOffset; } diff --git a/source/Lib/EncoderLib/EncGOP.cpp b/source/Lib/EncoderLib/EncGOP.cpp index fee7487cbf3dd5a3c990cc73322fcf66895a3251..15ed11afbc237531af0a43ca5e2d363feea05b11 100644 --- a/source/Lib/EncoderLib/EncGOP.cpp +++ b/source/Lib/EncoderLib/EncGOP.cpp @@ -89,7 +89,7 @@ EncGOP::EncGOP() m_bFirst = true; m_iLastRecoveryPicPOC = 0; #if JVET_N0494_DRAP - m_iLatestDRAPPOC = MAX_INT; + m_latestDRAPPOC = MAX_INT; #endif m_lastRasPoc = MAX_INT; @@ -2053,25 +2053,25 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic, #if JVET_N0494_DRAP pcSlice->setEnableDRAPSEI(m_pcEncLib->getDependentRAPIndicationSEIEnabled()); - if (m_pcEncLib->getDependentRAPIndicationSEIEnabled()) + if (m_pcEncLib->getDependentRAPIndicationSEIEnabled()) { // Only mark the picture as DRAP if all of the following applies: // 1) DRAP indication SEI messages are enabled // 2) The current picture is not an intra picture // 3) The current picture is in the DRAP period // 4) The current picture is a trailing picture - pcSlice->setDRAP(m_pcEncLib->getDependentRAPIndicationSEIEnabled() && m_pcEncLib->getDrapPeriod() > 0 && !pcSlice->isIntra() && - pocCurr % m_pcEncLib->getDrapPeriod() == 0 && pocCurr > pcSlice->getAssociatedIRAPPOC()); + pcSlice->setDRAP(m_pcEncLib->getDependentRAPIndicationSEIEnabled() && m_pcEncLib->getDrapPeriod() > 0 && !pcSlice->isIntra() && + pocCurr % m_pcEncLib->getDrapPeriod() == 0 && pocCurr > pcSlice->getAssociatedIRAPPOC()); if (pcSlice->isDRAP()) { int pocCycle = 1 << (pcSlice->getSPS()->getBitsForPOC()); int deltaPOC = pocCurr > pcSlice->getAssociatedIRAPPOC() ? pocCurr - pcSlice->getAssociatedIRAPPOC() : pocCurr - ( pcSlice->getAssociatedIRAPPOC() & (pocCycle -1) ); CHECK(deltaPOC > (pocCycle >> 1), "Use a greater value for POC wraparound to enable a POC distance between IRAP and DRAP of " << deltaPOC << "."); - m_iLatestDRAPPOC = pocCurr; + m_latestDRAPPOC = pocCurr; pcSlice->setTLayer(0); // Force DRAP picture to have temporal layer 0 } - pcSlice->setLatestDRAPPOC(m_iLatestDRAPPOC); + pcSlice->setLatestDRAPPOC(m_latestDRAPPOC); pcSlice->setUseLTforDRAP(false); // When set, sets the associated IRAP as long-term in RPL0 at slice level, unless the associated IRAP is already included in RPL0 or RPL1 defined in SPS PicList::iterator iterPic = rcListPic.begin(); diff --git a/source/Lib/EncoderLib/EncGOP.h b/source/Lib/EncoderLib/EncGOP.h index 7c2b1d2a5745fdc448ea69c037061db23930f15a..792b4e4471e9bc1d8bb254e47c9ecf2fd5dd8f42 100644 --- a/source/Lib/EncoderLib/EncGOP.h +++ b/source/Lib/EncoderLib/EncGOP.h @@ -130,7 +130,7 @@ private: bool m_bFirst; int m_iLastRecoveryPicPOC; #if JVET_N0494_DRAP - int m_iLatestDRAPPOC; + int m_latestDRAPPOC; #endif int m_lastRasPoc;