Changeset 1317 in 3DVCSoftware for branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 4 Sep 2015, 21:28:58 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r1313 r1317 6 6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 9 * 9 10 * Redistribution and use in source and binary forms, with or without … … 112 113 , m_encCABACTableIdx (I_SLICE) 113 114 #if NH_MV 114 , m_availableForTMVPRefFlag ( true )115 115 , m_refPicSetInterLayer0 ( NULL ) 116 116 , m_refPicSetInterLayer1 ( NULL ) … … 121 121 , m_isDepth (false) 122 122 #endif 123 #if !H_MV_HLS7_GEN123 #if NH_MV 124 124 , m_pocResetFlag (false) 125 #endif126 #if NH_MV127 125 , m_crossLayerBlaFlag (false) 128 126 #endif … … 134 132 , m_pocResetIdc (0) 135 133 , m_pocResetPeriodId (0) 134 , m_hasPocResetPeriodIdPresent (false) 136 135 , m_fullPocResetFlag (false) 137 136 , m_pocLsbVal (0) 138 , m_pocMsb ValPresentFlag(false)139 , m_pocMsb Val(0)137 , m_pocMsbCycleValPresentFlag (false) 138 , m_pocMsbCycleVal (0) 140 139 , m_pocMsbValRequiredFlag (false) 141 140 #endif … … 155 154 #endif 156 155 { 156 157 #if NH_MV 158 m_shortTermRefPicSetIdx = 0; 159 m_numLongTermSps = 0; 160 m_numLongTermPics = 0; 161 for (Int i = 0; i < MAX_NUM_PICS_RPS; i++) 162 { 163 m_ltIdxSps [i] = 0; 164 m_deltaPocMsbCycleLt[i] = 0; 165 } 166 setSliceTemporalMvpEnabledFlag( false ); 167 #endif 157 168 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 158 169 { … … 790 801 #endif 791 802 803 792 804 Int TComSlice::getNumRpsCurrTempList() const 793 805 { … … 806 818 } 807 819 #if NH_MV 808 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();820 numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics(); 809 821 #endif 810 822 return numRpsCurrTempList; … … 1097 1109 m_pcVPS = pSrc->m_pcVPS; 1098 1110 #endif 1099 m_pRPS = pSrc->m_pRPS; m_iLastIDR = pSrc->m_iLastIDR; 1111 m_pRPS = pSrc->m_pRPS; 1112 m_iLastIDR = pSrc->m_iLastIDR; 1100 1113 1101 1114 m_pcPic = pSrc->m_pcPic; … … 1155 1168 #if NH_MV 1156 1169 // Additional slice header syntax elements 1157 #if !H_MV_HLS7_GEN1158 1170 m_pocResetFlag = pSrc->m_pocResetFlag; 1159 #endif1160 1171 m_discardableFlag = pSrc->m_discardableFlag; 1161 1172 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; … … 2670 2681 } 2671 2682 } 2672 #endif 2673 2683 2684 #endif 2674 2685 #endif // NH_MV 2675 2686 … … 2719 2730 , m_uiBitsForPOC ( 8) 2720 2731 , m_numLongTermRefPicSPS ( 0) 2732 #if NH_MV 2733 , m_numShortTermRefPicSets ( 0) 2734 #endif 2721 2735 , m_uiMaxTrSize ( 32) 2722 2736 , m_bUseSAO (false) … … 2750 2764 for ( Int i = 0; i < MAX_TLAYER; i++ ) 2751 2765 { 2766 #if NH_MV 2767 m_uiSpsMaxLatencyIncreasePlus1[i] = 0; 2768 #else 2752 2769 m_uiMaxLatencyIncrease[i] = 0; 2770 #endif 2753 2771 m_uiMaxDecPicBuffering[i] = 1; 2754 2772 m_numReorderPics[i] = 0; … … 3081 3099 Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder ) 3082 3100 { 3083 const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));3084 3085 3101 if ( getMultiLayerExtSpsFlag() ) 3086 3102 { 3103 const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx )); 3087 3104 Int layerIdx = 0; 3088 3105 while (layerIdx < (Int) targetDecLayerIdList.size() ) … … 3109 3126 // This preliminary fix needs to be checked. 3110 3127 assert( getNumReorderPics( i ) == maxNumReorderPics ); 3111 assert( get MaxLatencyIncrease( i ) == maxLatencyIncreasePlus1 );3128 assert( getSpsMaxLatencyIncreasePlus1( i ) == maxLatencyIncreasePlus1 ); 3112 3129 3113 3130 } … … 3117 3134 setMaxDecPicBuffering( maxDecPicBufferingMinus1 + 1 , i); 3118 3135 setNumReorderPics ( maxNumReorderPics, i ); 3119 set MaxLatencyIncrease( maxLatencyIncreasePlus1 -1 , i);3136 setSpsMaxLatencyIncreasePlus1( maxLatencyIncreasePlus1 , i); 3120 3137 } 3121 3138 } … … 3412 3429 } 3413 3430 } 3414 3415 3431 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ) 3416 3432 { … … 3435 3451 for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[li]-1); rIdx ++) 3436 3452 { 3437 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true ); 3453 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( 1 ); 3454 m_apcRefPicList[li][rIdx]->print( 0 ); 3438 3455 3439 m_apcRefPicList[li][rIdx]->print( false );3440 3456 } 3441 3457 } … … 3456 3472 m_refPicSetInterLayer1 = refPicSetInterLayer1; 3457 3473 } 3474 3475 TComPic* TComSlice::getRefPicSetInterLayer( Int setIdc, Int i ) const 3476 { 3477 TComPic* pic = NULL; 3478 if (setIdc == 0 ) 3479 { 3480 pic = (*m_refPicSetInterLayer0)[ i ]; 3481 } 3482 else if (setIdc == 1 ) 3483 { 3484 pic = (*m_refPicSetInterLayer1)[ i ]; 3485 } 3486 3487 assert( pic != NULL ); 3488 3489 return pic; 3490 } 3491 3458 3492 3459 3493 TComPic* TComSlice::getPicFromRefPicSetInterLayer(Int setIdc, Int layerId ) const … … 3572 3606 #endif 3573 3607 } 3608 #endif 3574 3609 #if NH_3D_NBDV 3575 3610 Void TComSlice::setDefaultRefView() … … 3687 3722 if( iViewIdx<getViewIndex() && !bIsDepth ) 3688 3723 { 3689 setBaseViewRefPicList( ivPicLists->get PicList( iLayerId), iViewIdx );3724 setBaseViewRefPicList( ivPicLists->getSubDpb( iLayerId, false ), iViewIdx ); 3690 3725 } 3691 3726 } … … 3710 3745 if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() ) 3711 3746 { 3712 existInterViewRef = true; 3747 existInterViewRef = true; 3713 3748 } 3714 3749 } … … 3833 3868 #if NH_3D 3834 3869 Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists ) 3835 { 3870 { 3836 3871 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 3837 { 3872 { 3838 3873 for ( Int depthId = 0; depthId < 2; depthId++ ) 3839 3874 { … … 3920 3955 } 3921 3956 #endif 3922 #endif 3957 3923 3958 3924 3959 … … 3933 3968 } 3934 3969 3935 Bool TComSlice::inferPocMsb ValPresentFlag()3970 Bool TComSlice::inferPocMsbCycleValPresentFlag() 3936 3971 { 3937 3972 Bool pocMsbValPresentFlag; … … 3952 3987 } 3953 3988 3989 3990 Void TComSlice::f834decProcForRefPicListConst() 3991 { 3992 // This process is invoked at the beginning of the decoding process for each P or B slice. 3993 assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE ); 3994 3995 // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into 3996 // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B 3997 // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0. 3998 3999 // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1 4000 // are derived as follows: 4001 4002 // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr ) 4003 Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() ); 4004 4005 // and the list RefPicListTemp0 is constructed as follows: 4006 std::vector<TComPic*> refPicListTemp0; 4007 refPicListTemp0.resize((MAX_NUM_REF+1),NULL); 4008 4009 const TComDecodedRps* decRps = getPic()->getDecodedRps(); 4010 4011 const std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 4012 const std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 4013 const std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 4014 4015 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 4016 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 4017 const Int numPocLtCurr = decRps->m_numPocLtCurr; 4018 4019 const Int numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0; 4020 const Int numActiveRefLayerPics1 = decRps->m_numActiveRefLayerPics1; 4021 4022 const std::vector<TComPic*>& refPicSetInterLayer0 = decRps->m_refPicSetInterLayer0; 4023 const std::vector<TComPic*>& refPicSetInterLayer1 = decRps->m_refPicSetInterLayer1; 4024 4025 Int rIdx = 0; 4026 while( rIdx < numRpsCurrTempList0 ) 4027 { 4028 for(Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4029 { 4030 refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ]; 4031 } 4032 4033 for(Int i = 0; i < numActiveRefLayerPics0; rIdx++, i++ ) 4034 { 4035 refPicListTemp0[ rIdx ] = refPicSetInterLayer0[ i ]; 4036 } 4037 4038 for(Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList0; rIdx++, i++ ) // (F 65) 4039 { 4040 refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ]; 4041 } 4042 4043 for(Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4044 { 4045 refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ]; 4046 } 4047 4048 for(Int i = 0; i < numActiveRefLayerPics1; rIdx++, i++ ) 4049 { 4050 refPicListTemp0[ rIdx ] = refPicSetInterLayer1[ i ]; 4051 } 4052 } 4053 4054 // The list RefPicList0 is constructed as follows: 4055 TComRefPicListModification* rplm = getRefPicListModification(); 4056 for( rIdx = 0; rIdx <= getNumRefIdxL0ActiveMinus1(); rIdx++ ) // (F 66) 4057 { 4058 m_apcRefPicList[ 0 ][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ]; 4059 // The decoding process below slice level requires the status 4060 // of the reference pictures, when decoding the RPS. So store it here. 4061 m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm(); 4062 m_aiRefPOCList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC(); 4063 m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId(); 4064 } 4065 4066 std::vector<TComPic*> refPicListTemp1; 4067 refPicListTemp1.resize((MAX_NUM_REF+1),NULL); 4068 4069 if (getSliceType() == B_SLICE ) 4070 { 4071 // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to 4072 // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows: 4073 Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() ); 4074 4075 rIdx = 0; 4076 while( rIdx < numRpsCurrTempList1 ) 4077 { 4078 for( Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4079 { 4080 refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ]; 4081 } 4082 for( Int i = 0; i< numActiveRefLayerPics1; rIdx++, i++ ) 4083 { 4084 refPicListTemp1[ rIdx ] = refPicSetInterLayer1[ i ]; 4085 } 4086 for( Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList1; rIdx++, i++ ) // (F 67) 4087 { 4088 refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ]; 4089 } 4090 for( Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4091 { 4092 refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ]; 4093 } 4094 for( Int i = 0; i< numActiveRefLayerPics0; rIdx++, i++ ) 4095 { 4096 refPicListTemp1[ rIdx ] = refPicSetInterLayer0[ i ]; 4097 } 4098 } 4099 } 4100 4101 if (getSliceType() == B_SLICE ) 4102 { 4103 // When the slice is a B slice, the list RefPicList1 is constructed as follows: 4104 for( rIdx = 0; rIdx <= getNumRefIdxL1ActiveMinus1(); rIdx++ ) // (F 68) 4105 { 4106 m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ]; 4107 4108 // The decoding process below slice level requires the marking status 4109 // of the reference pictures, when decoding the RPS. So store it here. 4110 m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm(); 4111 m_aiRefPOCList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC(); 4112 m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId(); 4113 } 4114 } 4115 } 4116 4117 4118 Void TComSlice::cl834DecProcForRefPicListConst() 4119 { 4120 // This process is invoked at the beginning of the decoding process for each P or B slice. 4121 assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE ); 4122 4123 // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into 4124 // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B 4125 // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0. 4126 4127 // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1 4128 // are derived as follows: 4129 4130 // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr ) 4131 Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() ); 4132 4133 // and the list RefPicListTemp0 is constructed as follows: 4134 std::vector<TComPic*> refPicListTemp0; 4135 refPicListTemp0.resize((MAX_NUM_REF+1),NULL); 4136 4137 const TComDecodedRps* decRps = getPic()->getDecodedRps(); 4138 4139 const std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore; 4140 const std::vector<TComPic*>& refPicSetStCurrAfter = decRps->m_refPicSetStCurrAfter; 4141 const std::vector<TComPic*>& refPicSetLtCurr = decRps->m_refPicSetLtCurr; 4142 4143 const Int numPocStCurrBefore = decRps->m_numPocStCurrBefore; 4144 const Int numPocStCurrAfter = decRps->m_numPocStCurrAfter; 4145 const Int numPocLtCurr = decRps->m_numPocLtCurr; 4146 4147 Int rIdx = 0; 4148 while( rIdx < numRpsCurrTempList0 ) 4149 { 4150 for(Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4151 { 4152 refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ]; 4153 } 4154 4155 for(Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList0; rIdx++, i++ ) // (8 8) 4156 { 4157 refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ]; 4158 } 4159 4160 for(Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList0; rIdx++, i++ ) 4161 { 4162 refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ]; 4163 } 4164 } 4165 4166 // The list RefPicList0 is constructed as follows: 4167 4168 TComRefPicListModification* rplm = getRefPicListModification(); 4169 for( rIdx = 0; rIdx <= getNumRefIdxL0ActiveMinus1(); rIdx++ ) // (8-9) 4170 { 4171 m_apcRefPicList[0][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ]; 4172 4173 // The decoding process below slice level requires the marking status 4174 // of the reference pictures, when decoding the RPS. So store it here. 4175 m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm(); 4176 m_aiRefPOCList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC(); 4177 m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId(); 4178 } 4179 4180 std::vector<TComPic*> refPicListTemp1; 4181 refPicListTemp1.resize((MAX_NUM_REF+1),NULL); 4182 4183 if (getSliceType() == B_SLICE ) 4184 { 4185 // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to 4186 // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows: 4187 Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() ); 4188 4189 rIdx = 0; 4190 while( rIdx < numRpsCurrTempList1 ) 4191 { 4192 for( Int i = 0; i < numPocStCurrAfter && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4193 { 4194 refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ]; 4195 } 4196 for( Int i = 0; i < numPocStCurrBefore && rIdx < numRpsCurrTempList1; rIdx++, i++ ) // (8-10) 4197 { 4198 refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ]; 4199 } 4200 for( Int i = 0; i < numPocLtCurr && rIdx < numRpsCurrTempList1; rIdx++, i++ ) 4201 { 4202 refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ]; 4203 } 4204 } 4205 } 4206 4207 if (getSliceType() == B_SLICE ) 4208 { 4209 // When the slice is a B slice, the list RefPicList1 is constructed as follows: 4210 for( rIdx = 0; rIdx <= getNumRefIdxL1ActiveMinus1(); rIdx++ ) // (F 68) 4211 { 4212 m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ]; 4213 4214 // The decoding process below slice level requires the marking status 4215 // of the reference pictures, when decoding the RPS. So store it here. 4216 m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm(); 4217 m_aiRefPOCList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC(); 4218 m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId(); 4219 } 4220 } 4221 } 4222 4223 Int TComSlice::getNumPicTotalCurr() const 4224 { 4225 Int numPicTotalCurr = 0; 4226 #if NH_MV_FIX_NUM_POC_TOTAL_CUR 4227 if ( !isIdr() ) 4228 { 4229 const TComStRefPicSet* stRps = getStRps( getCurrRpsIdx() ); 4230 #endif 4231 for( Int i = 0; i < stRps->getNumNegativePicsVar(); i++ ) 4232 { 4233 if( stRps->getUsedByCurrPicS0Var( i ) ) 4234 { 4235 numPicTotalCurr++; 4236 } 4237 } 4238 for( Int i = 0; i < stRps->getNumPositivePicsVar(); i++) //(7 55) 4239 { 4240 if( stRps->getUsedByCurrPicS1Var(i) ) 4241 { 4242 numPicTotalCurr++; 4243 } 4244 } 4245 for( Int i = 0; i < getNumLongTermSps() + getNumLongTermPics(); i++ ) 4246 { 4247 if( getUsedByCurrPicLtVar( i ) ) 4248 { 4249 numPicTotalCurr++; 4250 } 4251 } 4252 #if NH_MV_FIX_NUM_POC_TOTAL_CUR 4253 } 4254 #endif 4255 4256 if ( decProcAnnexF() ) 4257 { 4258 numPicTotalCurr += getNumActiveRefLayerPics(); 4259 } 4260 return numPicTotalCurr; 4261 } 4262 4263 4264 4265 Int TComSlice::getPocLsbLtVar( Int i ) 4266 { 4267 Int pocLsbLtVar; 4268 if (i < getNumLongTermSps() ) 4269 { 4270 4271 pocLsbLtVar = getSPS()->getLtRefPicPocLsbSps( getLtIdxSps( i ) ); 4272 } 4273 else 4274 { 4275 pocLsbLtVar = getPocLsbLt( i ); 4276 } 4277 return pocLsbLtVar; 4278 } 4279 4280 4281 Bool TComSlice::getUsedByCurrPicLtVar( Int i ) const 4282 { 4283 Bool usedByCurrPicLtVar; 4284 if (i < getNumLongTermSps() ) 4285 { 4286 usedByCurrPicLtVar = getSPS()->getUsedByCurrPicLtSPSFlag( getLtIdxSps( i ) ); 4287 } 4288 else 4289 { 4290 usedByCurrPicLtVar = getUsedByCurrPicLtFlag( i ); 4291 } 4292 return usedByCurrPicLtVar; 4293 } 4294 4295 4296 Int TComSlice::getDeltaPocMsbCycleLtVar( Int i ) const 4297 { 4298 Int deltaPocMsbCycleVar; 4299 if (i == 0 || i == getNumLongTermSps() ) 4300 { 4301 deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i ); 4302 } 4303 else 4304 { 4305 deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i ) + getDeltaPocMsbCycleLtVar( i - 1 ); 4306 } 4307 return deltaPocMsbCycleVar; 4308 } 3954 4309 3955 4310 #endif … … 4074 4429 4075 4430 Void TComSlice::checkInCompPredRefLayers() 4076 { 4431 { 4077 4432 if ( getInCompPredFlag() ) 4078 4433 { 4079 4434 for (Int i = 0; i < getNumCurCmpLIds(); i++ ) 4080 { 4435 { 4081 4436 assert( getIvPic(!getIsDepth(), getInCmpRefViewIdcs( i ) ) != NULL ); 4082 4437 // It is a requirement of bitstream conformance that there 4083 4438 // is a picture in the DPB with PicOrderCntVal equal to the PicOrderCntVal of the current picture, 4084 4439 // and a nuh_layer_id value equal to ViewCompLayerId[ inCmpRefViewIdcs[ i ] ][ !DepthFlag ]. 4440 } 4441 } 4442 } 4443 4444 Void TComSlice::setPocsInCurrRPSs() 4445 { 4446 // Currently only needed at decoder side; 4447 m_pocsInCurrRPSs.clear(); 4448 std::vector<TComPic*>** rpsCurr = getPic()->getDecodedRps()->m_refPicSetsCurr; 4449 for (Int i = 0 ; i < 3; i++ ) 4450 { 4451 for( Int j = 0; j < rpsCurr[i]->size(); j++ ) 4452 { 4453 m_pocsInCurrRPSs.push_back( (*rpsCurr[i])[j]->getPOC() ); 4085 4454 } 4086 4455 } … … 4613 4982 4614 4983 ProfileTierLevel* curProfileTierLevel = getGeneralPTL( ); 4984 assert( curProfileTierLevel != NULL ); 4615 4985 4616 4986 if( !profilePresentFlag ) … … 4644 5014 Void TComPTL::inferSubLayerValues(Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL) 4645 5015 { 4646 assert( k == 0 || refPTL != NULL ); 4647 5016 assert( k == 0 || refPTL != NULL ); 4648 5017 for (Int i = maxNumSubLayersMinus1; i >= 0; i--) 4649 5018 { … … 4665 5034 } 4666 5035 5036 assert( refProfileTierLevel != NULL ); 4667 5037 ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i ); 5038 assert( curProfileTierLevel != NULL ); 4668 5039 if( !getSubLayerLevelPresentFlag( i ) ) 4669 5040 { … … 4883 5254 } 4884 5255 5256 5257 Int TComDpbSize::getVpsMaxLatencyPictures( Int i, Int j ) const 5258 { 5259 return getMaxVpsNumReorderPics( i, j ) + getMaxVpsLatencyIncreasePlus1(i, j) - 1; 5260 } 5261 4885 5262 Void Window::scaleOffsets( Int scal ) 4886 5263 { … … 4894 5271 } 4895 5272 } 4896 #endif 5273 5274 Void TComStRefPicSet::inferRps( Int stRpsIdx, TComSPS* sps, Bool encoder ) 5275 { 5276 if ( getInterRefPicSetPredictionFlag() ) 5277 { 5278 // When inter_ref_pic_set_prediction_flag is equal to 1, the variables DeltaPocS0[ stRpsIdx ][ i ], UsedByCurrPicS0[ stRpsIdx ][ i ], 5279 // NumNegativePics[ stRpsIdx ], DeltaPocS1[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ] and NumPositivePics[ stRpsIdx ] are 5280 // derived as follows: 5281 5282 Int i = 0; 5283 Int refRpsIdx = getRefRpsIdx( stRpsIdx ); 5284 TComStRefPicSet* refRps = sps->getStRefPicSet( refRpsIdx ); 5285 5286 for( Int j = refRps->getNumPositivePicsVar( ) - 1; j >= 0; j-- ) 5287 { 5288 Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps(); 5289 if( dPoc < 0 && getUseDeltaFlag( refRps->getNumNegativePicsVar( ) + j ) ) 5290 { 5291 setDeltaPocS0Var ( i, dPoc ); 5292 setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumNegativePicsVar( ) + j ) ); 5293 } 5294 } 5295 if( getDeltaRps() < 0 && getUseDeltaFlag( refRps->getNumDeltaPocs() ) ) // (7 59) 5296 { 5297 setDeltaPocS0Var( i, getDeltaRps() ); 5298 setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() ) ); 5299 } 5300 for( Int j = 0; j < refRps->getNumNegativePicsVar(); j++ ) 5301 { 5302 Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps(); 5303 if( dPoc < 0 && getUseDeltaFlag( j ) ) 5304 { 5305 setDeltaPocS0Var( i , dPoc); 5306 setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( j )) ; 5307 } 5308 } 5309 5310 setNumNegativePicsVar( i ); 5311 5312 i = 0; 5313 for( Int j = refRps->getNumNegativePicsVar() - 1; j >= 0; j-- ) 5314 { 5315 Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps(); 5316 if( dPoc > 0 && getUseDeltaFlag( j ) ) 5317 { 5318 setDeltaPocS1Var( i, dPoc ); 5319 setUsedByCurrPicS1Var( i++, getUsedByCurrPicFlag( j ) ) ; 5320 } 5321 } 5322 5323 if( getDeltaRps() > 0 && getUseDeltaFlag( refRps->getNumDeltaPocs() ) ) // (7 60) 5324 { 5325 setDeltaPocS1Var( i , getDeltaRps() ); 5326 setUsedByCurrPicS1Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() )); 5327 } 5328 5329 for( Int j = 0; j < refRps->getNumPositivePicsVar( ); j++) 5330 { 5331 Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps(); 5332 if( dPoc > 0 && getUseDeltaFlag( refRps->getNumNegativePicsVar() + j ) ) 5333 { 5334 setDeltaPocS1Var( i, dPoc); 5335 setUsedByCurrPicS1Var( i++, getUsedByCurrPicFlag( refRps->getNumNegativePicsVar() + j )); 5336 } 5337 } 5338 setNumPositivePicsVar( i ); 5339 } 5340 else 5341 { 5342 // When inter_ref_pic_set_prediction_flag is equal to 0, the variables NumNegativePics[ stRpsIdx ], NumPositivePics[ stRpsIdx ], 5343 // UsedByCurrPicS0[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ], DeltaPocS0[ stRpsIdx ][ i ] and DeltaPocS1[ stRpsIdx ][ i ] 5344 // are derived as follows: 5345 5346 setNumNegativePicsVar( getNumNegativePics( ) ); // (7 61) 5347 setNumPositivePicsVar( getNumPositivePics( ) ); // (7 62) 5348 5349 for (Int i = 0 ; i < getNumNegativePics(); i++ ) 5350 { 5351 setUsedByCurrPicS0Var( i, getUsedByCurrPicS0Flag( i ) ); // (7 63) 5352 if (i == 0 ) 5353 { 5354 setDeltaPocS0Var( i , -( getDeltaPocS0Minus1( i ) + 1 )); // (7 65) 5355 } 5356 else 5357 { 5358 setDeltaPocS0Var( i , getDeltaPocS0Var( i - 1 ) - ( getDeltaPocS0Minus1( i ) + 1 )); // (7 67) 5359 } 5360 } 5361 5362 for (Int i = 0 ; i < getNumPositivePics(); i++ ) 5363 { 5364 setUsedByCurrPicS1Var( i, getUsedByCurrPicS1Flag( i ) ); // (7 64) 5365 5366 if (i == 0 ) 5367 { 5368 setDeltaPocS1Var( i , getDeltaPocS1Minus1( i ) + 1 ); // (7 66) 5369 } 5370 else 5371 { 5372 setDeltaPocS1Var( i , getDeltaPocS1Var( i - 1 ) + ( getDeltaPocS1Minus1( i ) + 1 )); // (7 68) 5373 } 5374 } 5375 } 5376 } 5377 5378 #endif
Note: See TracChangeset for help on using the changeset viewer.