Changeset 1588 in SHVCSoftware
- Timestamp:
- 23 Nov 2016, 01:44:46 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1579 r1588 1487 1487 Bool pocResettingFlag = false; 1488 1488 1489 if( pcSlice->getPocResetIdc() != 0)1489 if( pcSlice->getPocResetIdc() ) 1490 1490 { 1491 1491 if( pcSlice->getVPS()->getVpsPocLsbAlignedFlag() ) … … 1511 1511 { 1512 1512 // Check the base layer picture is IDR. If so, just set current POC equal to 0 (alignment of POC) 1513 if( ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) )1513 if( ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) && m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) ) 1514 1514 { 1515 1515 m_pcEncTop->setPocAdjustmentValue( pocCurr ); … … 3922 3922 if( slice->getSliceIdx() == 0 ) // First slice - compute, copy for other slices 3923 3923 { 3924 Int needReset= false;3925 Int resetDueToBL = false; 3924 Bool needReset = false, resetDueToBL = false; 3925 3926 3926 if( slice->getVPS()->getMaxLayers() > 1 ) 3927 3927 { 3928 3928 // If IRAP is refreshed in this access unit for base layer 3929 if( (m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 1 || m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) 3930 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3931 ) 3929 if( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() > 0 && pocCurr && m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) ) 3932 3930 { 3933 3931 // Check if the IRAP refresh interval of any layer does not match that of the base layer 3934 for(Int i = 1; i < slice->getVPS()->getMaxLayers(); i++) 3935 { 3936 Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 3937 Bool refreshTypeFlag = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() ); 3938 if( !(refreshIntervalFlag && refreshTypeFlag) ) 3932 for( Int i = 1; i < slice->getVPS()->getMaxLayers(); i++ ) 3933 { 3934 Bool refreshIntervalFlag = pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0; 3935 Bool refreshTypeFlag = m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType(); 3936 3937 if( !refreshIntervalFlag || !refreshTypeFlag ) 3939 3938 { 3940 3939 needReset = true; … … 3949 3948 { 3950 3949 // Check if EL IDRs results in POC Reset 3951 for(Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++) 3952 { 3953 Bool idrFlag = ( (m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2) 3954 && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3955 ); 3956 for(Int j = 0; j < slice->getVPS()->getMaxLayers(); j++) 3950 for( Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++ ) 3951 { 3952 Bool idrFlag = m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2 && pocCurr && m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 3953 3954 for( Int j = 0; j < slice->getVPS()->getMaxLayers(); j++ ) 3957 3955 { 3958 3956 if( j == i ) … … 3961 3959 } 3962 3960 3963 Bool idrOtherPicFlag = ( (m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2) 3964 && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3965 ); 3961 Bool idrOtherPicFlag = m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2 && pocCurr && m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 3966 3962 3967 3963 if( idrFlag != idrOtherPicFlag ) … … 3973 3969 } 3974 3970 } 3971 3975 3972 if( needReset ) 3976 3973 { … … 3997 3994 3998 3995 // Start a new POC reset period 3999 if (m_layerId == 0) // Assuming BL picture is always present at encoder; for other AU structures, need to change this3996 if( m_layerId == 0 ) // Assuming BL picture is always present at encoder; for other AU structures, need to change this 4000 3997 { 4001 3998 Int periodId = rand() % 64; 4002 m_lastPocPeriodId = (periodId == m_lastPocPeriodId) ? (periodId + 1) % 64 : periodId;3999 m_lastPocPeriodId = periodId == m_lastPocPeriodId ? (periodId + 1) % 64 : periodId; 4003 4000 4004 4001 for( UInt i = 0; i < m_pcCfg->getNumLayer(); i++ )
Note: See TracChangeset for help on using the changeset viewer.