Changeset 1045 in SHVCSoftware for branches/SHM-dev/source
- Timestamp:
- 3 Mar 2015, 02:46:34 (10 years ago)
- Location:
- branches/SHM-dev/source/App/TAppEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1037 r1045 897 897 Bool tmpLowerBitRateConstraintFlag; 898 898 UInt tmpBitDepthConstraint; 899 Int* cfg_layerPTLIdx[MAX_VPS_LAYER_ID _PLUS1];899 Int* cfg_layerPTLIdx[MAX_VPS_LAYER_IDX_PLUS1]; 900 900 #endif 901 901 … … 1137 1137 ("NumLayerSets", m_numLayerSets, 0, "Number of layer sets") 1138 1138 #endif 1139 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_ID _PLUS1, "Number of layers in the set")1140 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID _PLUS1, "Layer IDs for the set")1139 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set") 1140 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set") 1141 1141 ("NumAddLayerSets", m_numAddLayerSets, 0, "Number of additional layer sets") 1142 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_ID _PLUS1, "Number of highest layer idx")1143 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID _PLUS1, "Highest layer idx for an additional layer set")1142 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_IDX_PLUS1, "Number of highest layer idx") 1143 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set") 1144 1144 #endif 1145 1145 #if OUTPUT_LAYER_SETS_CONFIG … … 1147 1147 ("NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets excluding the 0-th output layer set") 1148 1148 ("NumOutputLayersInOutputLayerSet", cfg_numOutputLayersInOutputLayerSet, string(""), 1, "List containing number of output layers in the output layer sets") 1149 ("ListOfOutputLayers%d", cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_ID _PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]")1149 ("ListOfOutputLayers%d", cfg_listOfOutputLayers, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Layer IDs for the set, in terms of layer ID in the output layer set Range: [0..NumLayersInOutputLayerSet-1]") 1150 1150 ("OutputLayerSetIdx", cfg_outputLayerSetIdx, string(""), 1, "Corresponding layer set index, only for non-default output layer sets") 1151 1151 #endif … … 1315 1315 ("FrameOnly%d", m_frameOnlyConstraintFlagList, false, (MAX_NUM_LAYER_IDS + 1), "Indicate that the bitstream contains only frames") 1316 1316 1317 ("LayerPTLIndex%d", cfg_layerPTLIdx, 0, MAX_VPS_LAYER_ID _PLUS1, "Index of PTL for each layer")1317 ("LayerPTLIndex%d", cfg_layerPTLIdx, 0, MAX_VPS_LAYER_IDX_PLUS1, "Index of PTL for each layer") 1318 1318 ("ListOfProfileTierLevelOls%d", cfg_listOfLayerPTLOfOlss, string(""), MAX_VPS_OUTPUT_LAYER_SETS_PLUS1, "PTL Index for each layer in each OLS except the first OLS. The PTL index for layer in the first OLS is set to 1") 1319 1319 #else … … 3225 3225 // check validity of input parameters 3226 3226 #if SVC_EXTENSION 3227 for( UInt layerId = 0; layerId < m_numLayers; layerId++ )3228 { 3229 xCheckParameter(layerId );3227 for( UInt layerIdx = 0; layerIdx < m_numLayers; layerIdx++ ) 3228 { 3229 xCheckParameter(layerIdx); 3230 3230 } 3231 3231 #else … … 3255 3255 3256 3256 #if SVC_EXTENSION 3257 Void TAppEncCfg::xCheckParameter(UInt layerId )3257 Void TAppEncCfg::xCheckParameter(UInt layerIdx) 3258 3258 { 3259 Bool m_useExtendedPrecision = m_acLayerCfg[layerId ].m_useExtendedPrecision;3260 Bool m_useHighPrecisionPredictionWeighting = m_acLayerCfg[layerId ].m_useHighPrecisionPredictionWeighting;3261 ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerId ].m_chromaFormatIDC;3262 ChromaFormat m_chromaFormatConstraint = m_acLayerCfg[layerId ].m_chromaFormatConstraint;3263 ChromaFormat m_InputChromaFormatIDC = m_acLayerCfg[layerId ].m_InputChromaFormatIDC;3264 3265 Int m_inputBitDepth[] = {m_acLayerCfg[layerId ].m_inputBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA]};3266 Int m_internalBitDepth[] = {m_acLayerCfg[layerId ].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};3267 Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerId ].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]};3268 3269 m_saoOffsetBitShift[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerId ].m_saoOffsetBitShift[CHANNEL_TYPE_LUMA];3270 m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId ].m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA];3259 Bool m_useExtendedPrecision = m_acLayerCfg[layerIdx].m_useExtendedPrecision; 3260 Bool m_useHighPrecisionPredictionWeighting = m_acLayerCfg[layerIdx].m_useHighPrecisionPredictionWeighting; 3261 ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerIdx].m_chromaFormatIDC; 3262 ChromaFormat m_chromaFormatConstraint = m_acLayerCfg[layerIdx].m_chromaFormatConstraint; 3263 ChromaFormat m_InputChromaFormatIDC = m_acLayerCfg[layerIdx].m_InputChromaFormatIDC; 3264 3265 Int m_inputBitDepth[] = {m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA]}; 3266 Int m_internalBitDepth[] = {m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]}; 3267 Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]}; 3268 3269 m_saoOffsetBitShift[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerIdx].m_saoOffsetBitShift[CHANNEL_TYPE_LUMA]; 3270 m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA]; 3271 3271 3272 3272 #if MULTIPLE_PTL_SUPPORT 3273 Int layerPTLIdx = m_acLayerCfg[layerId ].m_layerPTLIdx;3273 Int layerPTLIdx = m_acLayerCfg[layerIdx].m_layerPTLIdx; 3274 3274 Profile::Name m_profile = m_profileList[layerPTLIdx]; 3275 UInt m_bitDepthConstraint = m_acLayerCfg[layerId ].m_bitDepthConstraint;3276 Bool m_intraConstraintFlag = m_acLayerCfg[layerId ].m_intraConstraintFlag;3277 Bool m_lowerBitRateConstraintFlag = m_acLayerCfg[layerId ].m_lowerBitRateConstraintFlag;3275 UInt m_bitDepthConstraint = m_acLayerCfg[layerIdx].m_bitDepthConstraint; 3276 Bool m_intraConstraintFlag = m_acLayerCfg[layerIdx].m_intraConstraintFlag; 3277 Bool m_lowerBitRateConstraintFlag = m_acLayerCfg[layerIdx].m_lowerBitRateConstraintFlag; 3278 3278 #endif 3279 3279 #else … … 3662 3662 } 3663 3663 3664 if (m_acLayerCfg[layerId ].m_iIntraPeriod == 1 && m_EhGOPList[layerId][0].m_POC == -1) {3665 m_EhGOPList[layerId ][0] = GOPEntry();3666 m_EhGOPList[layerId ][0].m_QPFactor = 1;3667 m_EhGOPList[layerId ][0].m_betaOffsetDiv2 = 0;3668 m_EhGOPList[layerId ][0].m_tcOffsetDiv2 = 0;3669 m_EhGOPList[layerId ][0].m_POC = 1;3670 m_EhGOPList[layerId ][0].m_numRefPicsActive = 4;3664 if (m_acLayerCfg[layerIdx].m_iIntraPeriod == 1 && m_EhGOPList[layerIdx][0].m_POC == -1) { 3665 m_EhGOPList[layerIdx][0] = GOPEntry(); 3666 m_EhGOPList[layerIdx][0].m_QPFactor = 1; 3667 m_EhGOPList[layerIdx][0].m_betaOffsetDiv2 = 0; 3668 m_EhGOPList[layerIdx][0].m_tcOffsetDiv2 = 0; 3669 m_EhGOPList[layerIdx][0].m_POC = 1; 3670 m_EhGOPList[layerIdx][0].m_numRefPicsActive = 4; 3671 3671 } 3672 3672 else … … 3753 3753 3754 3754 // verify layer configuration parameters 3755 if(m_acLayerCfg[layerId ].xCheckParameter(m_isField))3756 { 3757 printf("\nError: invalid configuration parameter found in layer %d \n", layerId );3755 if(m_acLayerCfg[layerIdx].xCheckParameter(m_isField)) 3756 { 3757 printf("\nError: invalid configuration parameter found in layer %d \n", layerIdx); 3758 3758 check_failed = true; 3759 3759 } 3760 3760 3761 3761 // verify layer configuration parameters 3762 Int m_iIntraPeriod = m_acLayerCfg[layerId ].m_iIntraPeriod;3762 Int m_iIntraPeriod = m_acLayerCfg[layerIdx].m_iIntraPeriod; 3763 3763 #endif 3764 3764 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) … … 4043 4043 4044 4044 #if SVC_EXTENSION && Q0108_TSA_STSA 4045 if( layerId > 0 )4045 if( layerIdx > 0 ) 4046 4046 { 4047 4047 verifiedGOP=false; … … 4061 4061 for(Int i=0; i<m_iGOPSize; i++) 4062 4062 { 4063 if(m_EhGOPList[layerId ][i].m_POC==m_iGOPSize)4064 { 4065 xConfirmPara( m_EhGOPList[layerId ][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " );4063 if(m_EhGOPList[layerIdx][i].m_POC==m_iGOPSize) 4064 { 4065 xConfirmPara( m_EhGOPList[layerIdx][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); 4066 4066 } 4067 4067 } … … 4077 4077 for(Int i=0; i<m_iGOPSize; i++) 4078 4078 { 4079 xConfirmPara( (m_EhGOPList[layerId ][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );4080 xConfirmPara( (m_EhGOPList[layerId ][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );4079 xConfirmPara( (m_EhGOPList[layerIdx][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerIdx][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 4080 xConfirmPara( (m_EhGOPList[layerIdx][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerIdx][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 4081 4081 } 4082 4082 } … … 4087 4087 { 4088 4088 Int curGOP = (checkGOP-1)%m_iGOPSize; 4089 Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId ][curGOP].m_POC;4090 if(m_EhGOPList[layerId ][curGOP].m_POC<0)4089 Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerIdx][curGOP].m_POC; 4090 if(m_EhGOPList[layerIdx][curGOP].m_POC<0) 4091 4091 { 4092 4092 printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); … … 4097 4097 //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. 4098 4098 Bool beforeI = false; 4099 for(Int i = 0; i< m_EhGOPList[layerId ][curGOP].m_numRefPics; i++)4099 for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++) 4100 4100 { 4101 Int absPOC = curPOC+m_EhGOPList[layerId ][curGOP].m_referencePics[i];4101 Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i]; 4102 4102 if(absPOC < 0) 4103 4103 { … … 4114 4114 for(Int k=0; k<m_iGOPSize; k++) 4115 4115 { 4116 if(absPOC%m_iGOPSize == m_EhGOPList[layerId ][k].m_POC%m_iGOPSize)4116 if(absPOC%m_iGOPSize == m_EhGOPList[layerIdx][k].m_POC%m_iGOPSize) 4117 4117 { 4118 if(m_EhGOPList[layerId ][k].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId)4118 if(m_EhGOPList[layerIdx][k].m_temporalId==m_EhGOPList[layerIdx][curGOP].m_temporalId) 4119 4119 { 4120 m_EhGOPList[layerId ][k].m_refPic = true;4120 m_EhGOPList[layerIdx][k].m_refPic = true; 4121 4121 } 4122 m_EhGOPList[layerId ][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerId][k].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId;4122 m_EhGOPList[layerIdx][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerIdx][k].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId; 4123 4123 } 4124 4124 } … … 4127 4127 if(!found) 4128 4128 { 4129 printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerId ][curGOP].m_referencePics[i],curGOP+1);4129 printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerIdx][curGOP].m_referencePics[i],curGOP+1); 4130 4130 errorGOP=true; 4131 4131 } … … 4149 4149 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 4150 4150 4151 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]]=m_EhGOPList[layerId][curGOP];4151 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]]=m_EhGOPList[layerIdx][curGOP]; 4152 4152 Int newRefs=0; 4153 for(Int i = 0; i< m_EhGOPList[layerId ][curGOP].m_numRefPics; i++)4153 for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++) 4154 4154 { 4155 Int absPOC = curPOC+m_EhGOPList[layerId ][curGOP].m_referencePics[i];4155 Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i]; 4156 4156 if(absPOC>=0) 4157 4157 { 4158 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[newRefs]=m_EhGOPList[layerId][curGOP].m_referencePics[i];4159 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i];4158 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[newRefs]=m_EhGOPList[layerIdx][curGOP].m_referencePics[i]; 4159 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerIdx][curGOP].m_usedByCurrPic[i]; 4160 4160 newRefs++; 4161 4161 } 4162 4162 } 4163 Int numPrefRefs = m_EhGOPList[layerId ][curGOP].m_numRefPicsActive;4163 Int numPrefRefs = m_EhGOPList[layerIdx][curGOP].m_numRefPicsActive; 4164 4164 4165 4165 for(Int offset = -1; offset>-checkGOP; offset--) … … 4167 4167 //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. 4168 4168 Int offGOP = (checkGOP-1+offset)%m_iGOPSize; 4169 Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId ][offGOP].m_POC;4170 if(offPOC>=0&&m_EhGOPList[layerId ][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId)4169 Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerIdx][offGOP].m_POC; 4170 if(offPOC>=0&&m_EhGOPList[layerIdx][offGOP].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId) 4171 4171 { 4172 4172 Bool newRef=false; … … 4180 4180 for(Int i=0; i<newRefs; i++) 4181 4181 { 4182 if(m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[i]==offPOC-curPOC)4182 if(m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[i]==offPOC-curPOC) 4183 4183 { 4184 4184 newRef=false; … … 4189 4189 Int insertPoint=newRefs; 4190 4190 //this picture can be added, find appropriate place in list and insert it. 4191 if(m_EhGOPList[layerId ][offGOP].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId)4191 if(m_EhGOPList[layerIdx][offGOP].m_temporalId==m_EhGOPList[layerIdx][curGOP].m_temporalId) 4192 4192 { 4193 m_EhGOPList[layerId ][offGOP].m_refPic = true;4193 m_EhGOPList[layerIdx][offGOP].m_refPic = true; 4194 4194 } 4195 4195 for(Int j=0; j<newRefs; j++) 4196 4196 { 4197 if(m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]>0)4197 if(m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]>0) 4198 4198 { 4199 4199 insertPoint = j; … … 4202 4202 } 4203 4203 Int prev = offPOC-curPOC; 4204 Int prevUsed = m_EhGOPList[layerId ][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId;4204 Int prevUsed = m_EhGOPList[layerIdx][offGOP].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId; 4205 4205 for(Int j=insertPoint; j<newRefs+1; j++) 4206 4206 { 4207 Int newPrev = m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j];4208 Int newUsed = m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j];4209 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]=prev;4210 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]=prevUsed;4207 Int newPrev = m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]; 4208 Int newUsed = m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j]; 4209 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]=prev; 4210 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j]=prevUsed; 4211 4211 prevUsed=newUsed; 4212 4212 prev=newPrev; … … 4220 4220 } 4221 4221 } 4222 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics=newRefs;4223 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_POC = curPOC;4224 if (m_extraRPSs[layerId ] == 0)4222 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefPics=newRefs; 4223 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_POC = curPOC; 4224 if (m_extraRPSs[layerIdx] == 0) 4225 4225 { 4226 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 0;4227 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = 0;4226 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_interRPSPrediction = 0; 4227 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefIdc = 0; 4228 4228 } 4229 4229 else 4230 4230 { 4231 Int rIdx = m_iGOPSize + m_extraRPSs[layerId ] - 1;4232 Int refPOC = m_EhGOPList[layerId ][rIdx].m_POC;4233 Int refPics = m_EhGOPList[layerId ][rIdx].m_numRefPics;4231 Int rIdx = m_iGOPSize + m_extraRPSs[layerIdx] - 1; 4232 Int refPOC = m_EhGOPList[layerIdx][rIdx].m_POC; 4233 Int refPics = m_EhGOPList[layerIdx][rIdx].m_numRefPics; 4234 4234 Int newIdc=0; 4235 4235 for(Int i = 0; i<= refPics; i++) 4236 4236 { 4237 Int deltaPOC = ((i != refPics)? m_EhGOPList[layerId ][rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 04237 Int deltaPOC = ((i != refPics)? m_EhGOPList[layerIdx][rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 4238 4238 Int absPOCref = refPOC+deltaPOC; 4239 4239 Int refIdc = 0; 4240 for (Int j = 0; j < m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics; j++)4240 for (Int j = 0; j < m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefPics; j++) 4241 4241 { 4242 if ( (absPOCref - curPOC) == m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j])4242 if ( (absPOCref - curPOC) == m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]) 4243 4243 { 4244 if (m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j])4244 if (m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j]) 4245 4245 { 4246 4246 refIdc = 1; … … 4252 4252 } 4253 4253 } 4254 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_refIdc[newIdc]=refIdc;4254 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_refIdc[newIdc]=refIdc; 4255 4255 newIdc++; 4256 4256 } 4257 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 1;4258 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = newIdc;4259 m_EhGOPList[layerId ][m_iGOPSize+m_extraRPSs[layerId]].m_deltaRPS = refPOC - m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC;4257 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_interRPSPrediction = 1; 4258 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefIdc = newIdc; 4259 m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_deltaRPS = refPOC - m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_POC; 4260 4260 } 4261 curGOP=m_iGOPSize+m_extraRPSs[layerId ];4262 m_extraRPSs[layerId ]++;4261 curGOP=m_iGOPSize+m_extraRPSs[layerIdx]; 4262 m_extraRPSs[layerIdx]++; 4263 4263 } 4264 4264 numRefs=0; 4265 for(Int i = 0; i< m_EhGOPList[layerId ][curGOP].m_numRefPics; i++)4265 for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++) 4266 4266 { 4267 Int absPOC = curPOC+m_EhGOPList[layerId ][curGOP].m_referencePics[i];4267 Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i]; 4268 4268 if(absPOC >= 0) 4269 4269 { … … 4292 4292 4293 4293 #if Q0108_TSA_STSA 4294 if( layerId > 0 )4295 { 4296 m_EhMaxTempLayer[layerId ] = 1;4294 if( layerIdx > 0 ) 4295 { 4296 m_EhMaxTempLayer[layerIdx] = 1; 4297 4297 for(Int i=0; i<m_iGOPSize; i++) 4298 4298 { 4299 if(m_EhGOPList[layerId ][i].m_temporalId >= m_EhMaxTempLayer[layerId] )4300 { 4301 m_EhMaxTempLayer[layerId ] = m_EhGOPList[layerId][i].m_temporalId;4299 if(m_EhGOPList[layerIdx][i].m_temporalId >= m_EhMaxTempLayer[layerIdx] ) 4300 { 4301 m_EhMaxTempLayer[layerIdx] = m_EhGOPList[layerIdx][i].m_temporalId; 4302 4302 } 4303 4303 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); … … 4365 4365 4366 4366 #if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers 4367 Int m_iSourceWidth = m_acLayerCfg[layerId ].m_iSourceWidth;4368 Int m_iSourceHeight = m_acLayerCfg[layerId ].m_iSourceHeight;4367 Int m_iSourceWidth = m_acLayerCfg[layerIdx].m_iSourceWidth; 4368 Int m_iSourceHeight = m_acLayerCfg[layerIdx].m_iSourceHeight; 4369 4369 #if LAYER_CTB 4370 Int m_uiMaxCUWidth = m_acLayerCfg[layerId ].m_uiMaxCUWidth;4371 Int m_uiMaxCUHeight = m_acLayerCfg[layerId ].m_uiMaxCUHeight;4370 Int m_uiMaxCUWidth = m_acLayerCfg[layerIdx].m_uiMaxCUWidth; 4371 Int m_uiMaxCUHeight = m_acLayerCfg[layerIdx].m_uiMaxCUHeight; 4372 4372 #endif 4373 4373 4374 4374 Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 ); 4375 Int m_iWaveFrontSynchro = m_acLayerCfg[layerId ].m_waveFrontSynchro;4375 Int m_iWaveFrontSynchro = m_acLayerCfg[layerIdx].m_waveFrontSynchro; 4376 4376 xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); 4377 4377 #endif … … 4540 4540 4541 4541 #if RC_SHVC_HARMONIZATION 4542 if ( m_acLayerCfg[layerId ].m_RCEnableRateControl )4543 { 4544 if ( m_acLayerCfg[layerId ].m_RCForceIntraQP )4545 { 4546 if ( m_acLayerCfg[layerId ].m_RCInitialQP == 0 )4542 if ( m_acLayerCfg[layerIdx].m_RCEnableRateControl ) 4543 { 4544 if ( m_acLayerCfg[layerIdx].m_RCForceIntraQP ) 4545 { 4546 if ( m_acLayerCfg[layerIdx].m_RCInitialQP == 0 ) 4547 4547 { 4548 4548 printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" ); 4549 m_acLayerCfg[layerId ].m_RCForceIntraQP = false;4549 m_acLayerCfg[layerIdx].m_RCForceIntraQP = false; 4550 4550 } 4551 4551 } … … 4596 4596 xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 4597 4597 // NOTE: m_numSamplePredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 4598 if( layerId > 0 )4599 { 4600 xConfirmPara(m_acLayerCfg[layerId ].m_numSamplePredRefLayers > layerId, "Cannot reference more layers than before current layer");4601 for(Int i = 0; i < m_acLayerCfg[layerId ].m_numSamplePredRefLayers; i++)4602 { 4603 xConfirmPara(m_acLayerCfg[layerId ].m_samplePredRefLayerIds[i] > layerId, "Cannot reference higher layers");4604 xConfirmPara(m_acLayerCfg[layerId ].m_samplePredRefLayerIds[i] == layerId, "Cannot reference the current layer itself");4598 if( layerIdx > 0 ) 4599 { 4600 xConfirmPara(m_acLayerCfg[layerIdx].m_numSamplePredRefLayers > layerIdx, "Cannot reference more layers than before current layer"); 4601 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numSamplePredRefLayers; i++) 4602 { 4603 xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] > layerIdx, "Cannot reference higher layers"); 4604 xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] == layerIdx, "Cannot reference the current layer itself"); 4605 4605 } 4606 4606 } 4607 4607 xConfirmPara( (m_acLayerCfg[0].m_numMotionPredRefLayers != 0) && (m_acLayerCfg[0].m_numMotionPredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 4608 4608 // NOTE: m_numMotionPredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 4609 if( layerId > 0 )4610 { 4611 xConfirmPara(m_acLayerCfg[layerId ].m_numMotionPredRefLayers > layerId, "Cannot reference more layers than before current layer");4612 for(Int i = 0; i < m_acLayerCfg[layerId ].m_numMotionPredRefLayers; i++)4613 { 4614 xConfirmPara(m_acLayerCfg[layerId ].m_motionPredRefLayerIds[i] > layerId, "Cannot reference higher layers");4615 xConfirmPara(m_acLayerCfg[layerId ].m_motionPredRefLayerIds[i] == layerId, "Cannot reference the current layer itself");4609 if( layerIdx > 0 ) 4610 { 4611 xConfirmPara(m_acLayerCfg[layerIdx].m_numMotionPredRefLayers > layerIdx, "Cannot reference more layers than before current layer"); 4612 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numMotionPredRefLayers; i++) 4613 { 4614 xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] > layerIdx, "Cannot reference higher layers"); 4615 xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] == layerIdx, "Cannot reference the current layer itself"); 4616 4616 } 4617 4617 } … … 4619 4619 xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); 4620 4620 // NOTE: m_numActiveRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 4621 if( layerId > 0 )4621 if( layerIdx > 0 ) 4622 4622 { 4623 4623 Bool predEnabledFlag[MAX_LAYERS]; 4624 for (Int refLayer = 0; refLayer < layerId ; refLayer++)4624 for (Int refLayer = 0; refLayer < layerIdx; refLayer++) 4625 4625 { 4626 4626 predEnabledFlag[refLayer] = false; 4627 4627 } 4628 for(Int i = 0; i < m_acLayerCfg[layerId ].m_numSamplePredRefLayers; i++)4629 { 4630 predEnabledFlag[m_acLayerCfg[layerId ].m_samplePredRefLayerIds[i]] = true;4631 } 4632 for(Int i = 0; i < m_acLayerCfg[layerId ].m_numMotionPredRefLayers; i++)4633 { 4634 predEnabledFlag[m_acLayerCfg[layerId ].m_motionPredRefLayerIds[i]] = true;4628 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numSamplePredRefLayers; i++) 4629 { 4630 predEnabledFlag[m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i]] = true; 4631 } 4632 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numMotionPredRefLayers; i++) 4633 { 4634 predEnabledFlag[m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i]] = true; 4635 4635 } 4636 4636 Int numDirectRefLayers = 0; 4637 for (Int refLayer = 0; refLayer < layerId ; refLayer++)4637 for (Int refLayer = 0; refLayer < layerIdx; refLayer++) 4638 4638 { 4639 4639 if (predEnabledFlag[refLayer] == true) numDirectRefLayers++; 4640 4640 } 4641 xConfirmPara(m_acLayerCfg[layerId ].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers");4642 for(Int i = 0; i < m_acLayerCfg[layerId ].m_numActiveRefLayers; i++)4643 { 4644 xConfirmPara(m_acLayerCfg[layerId ].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers");4641 xConfirmPara(m_acLayerCfg[layerIdx].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 4642 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numActiveRefLayers; i++) 4643 { 4644 xConfirmPara(m_acLayerCfg[layerIdx].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers"); 4645 4645 } 4646 4646 } … … 4663 4663 } 4664 4664 #endif 4665 if( layerId < MAX_LAYERS-1 )4666 { 4667 xConfirmPara(m_acLayerCfg[layerId ].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layerId].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7");4665 if( layerIdx < MAX_LAYERS-1 ) 4666 { 4667 xConfirmPara(m_acLayerCfg[layerIdx].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layerIdx].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); 4668 4668 } 4669 4669 #if AUXILIARY_PICTURES 4670 if( layerId < MAX_LAYERS-1 )4670 if( layerIdx < MAX_LAYERS-1 ) 4671 4671 { 4672 4672 #if R0062_AUX_PSEUDO_MONOCHROME 4673 xConfirmPara(m_acLayerCfg[layerId ].m_auxId < 0 || m_acLayerCfg[layerId].m_auxId > 2, "AuxId must be in range 0 to 2");4674 #else 4675 xConfirmPara(m_acLayerCfg[layerId ].m_auxId < 0 || m_acLayerCfg[layerId].m_auxId > 4, "AuxId must be in range 0 to 4");4676 xConfirmPara(m_acLayerCfg[layerId ].m_auxId > 0 && m_acLayerCfg[layerId].m_chromaFormatIDC != CHROMA_400, "Auxiliary picture must be monochrome picture");4673 xConfirmPara(m_acLayerCfg[layerIdx].m_auxId < 0 || m_acLayerCfg[layerIdx].m_auxId > 2, "AuxId must be in range 0 to 2"); 4674 #else 4675 xConfirmPara(m_acLayerCfg[layerIdx].m_auxId < 0 || m_acLayerCfg[layerIdx].m_auxId > 4, "AuxId must be in range 0 to 4"); 4676 xConfirmPara(m_acLayerCfg[layerIdx].m_auxId > 0 && m_acLayerCfg[layerIdx].m_chromaFormatIDC != CHROMA_400, "Auxiliary picture must be monochrome picture"); 4677 4677 #endif 4678 4678 } … … 4726 4726 { 4727 4727 #if SVC_EXTENSION 4728 // Check for layerId equal to 0, it has to pe extended to other layers.4729 UInt layerId = 0;4730 Bool m_useExtendedPrecision = m_acLayerCfg[layerId ].m_useExtendedPrecision;4731 Int m_internalBitDepth[] = {m_acLayerCfg[layerId ].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]};4732 Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerId ].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerId].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]};4733 ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerId ].m_chromaFormatIDC;4728 // Check for layerIdx equal to 0, it has to pe extended to other layers. 4729 UInt layerIdx = 0; 4730 Bool m_useExtendedPrecision = m_acLayerCfg[layerIdx].m_useExtendedPrecision; 4731 Int m_internalBitDepth[] = {m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]}; 4732 Int m_MSBExtendedBitDepth[] = {m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_acLayerCfg[layerIdx].m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA]}; 4733 ChromaFormat m_chromaFormatIDC = m_acLayerCfg[layerIdx].m_chromaFormatIDC; 4734 4734 #endif 4735 4735 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1037 r1045 79 79 Int m_numLayerSets; 80 80 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 81 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID _PLUS1];81 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 82 82 Int m_numAddLayerSets; 83 83 Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 84 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID _PLUS1];84 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; 85 85 #endif 86 86 #if OUTPUT_LAYER_SETS_CONFIG … … 490 490 #endif 491 491 #if SVC_EXTENSION 492 Void xCheckParameter (UInt layerId ); ///< check validity of configuration values per layer492 Void xCheckParameter (UInt layerIdx); ///< check validity of configuration values per layer 493 493 #else 494 494 Void xCheckParameter (); ///< check validity of configuration values … … 591 591 #endif 592 592 Int getDecodingRefreshType() {return m_iDecodingRefreshType; } 593 Int getWaveFrontSynchro(Int layerId ) { return m_acLayerCfg[layerId].m_waveFrontSynchro; }593 Int getWaveFrontSynchro(Int layerIdx) { return m_acLayerCfg[layerIdx].m_waveFrontSynchro; } 594 594 Void getDirFilename(string& filename, string& dir, const string path); 595 595 #if OUTPUT_LAYER_SETS_CONFIG -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1043 r1045 354 354 if(layer) 355 355 { 356 for(Int i = 0; i < MAX_VPS_LAYER_ID _PLUS1; i++)356 for(Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++) 357 357 { 358 358 m_acTEncTop[layer].setSamplePredEnabledFlag (i, false); … … 1323 1323 { 1324 1324 Int layerId = m_layerSetLayerIdList[setId][i]; 1325 Int layerIdx = vps->getLayerIdxInVps(m_layerSetLayerIdList[setId][i]); 1325 1326 #else 1326 1327 for( i = 0; i < m_numLayerInIdList[setId-1]; i++ ) … … 1330 1331 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1331 1332 //4 1332 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerId ].m_internalBitDepth[CHANNEL_TYPE_LUMA];1333 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId ].m_internalBitDepth[CHANNEL_TYPE_CHROMA];1334 1335 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId ].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA];1336 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId ].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA];1333 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1334 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1335 1336 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1337 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1337 1338 #endif 1338 1339 … … 1348 1349 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1349 1350 { 1350 for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++)1351 for (Int layerIdx = 0; layerIdx <= vps->getMaxLayers(); layerIdx++) 1351 1352 { 1352 1353 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1353 1354 //4 1354 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1355 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1356 1357 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1358 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerId].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1355 UInt layerId = vps->getLayerIdInNuh(layerIdx); 1356 g_bitDepth[CHANNEL_TYPE_LUMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1357 g_bitDepth[CHANNEL_TYPE_CHROMA] = m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1358 1359 g_PCMBitDepth[CHANNEL_TYPE_LUMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_LUMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_LUMA]; 1360 g_PCMBitDepth[CHANNEL_TYPE_CHROMA] = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerIdx].m_inputBitDepth[CHANNEL_TYPE_CHROMA] : m_acLayerCfg[layerIdx].m_internalBitDepth[CHANNEL_TYPE_CHROMA]; 1359 1361 #endif 1360 1362 if (layerId <= setId) … … 1787 1789 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue ); 1788 1790 #else 1789 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[ layerId].getMaxDecPicBuffering(j) - 1 );1790 #endif 1791 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[ layerId].getNumReorderPics(j));1791 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[vps->getLayerIdxInVps(layerId)].getMaxDecPicBuffering(j) - 1 ); 1792 #endif 1793 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[vps->getLayerIdxInVps(layerId)].getNumReorderPics(j)); 1792 1794 } 1793 1795 #if RESOLUTION_BASED_DPB … … 1899 1901 vps->setNumSubLayerHrdMinus1( j, vps->getMaxTLayers() - 1 ); 1900 1902 1901 UInt layerId = j;1902 TEncTop *pcCfgLayer = &m_acTEncTop[layerId ];1903 UInt layerIdx = j; 1904 TEncTop *pcCfgLayer = &m_acTEncTop[layerIdx]; 1903 1905 1904 1906 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1905 1907 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1906 1908 #if LAYER_CTB 1907 UInt uiWidthInCU = ( iPicWidth % m_acLayerCfg[layerId ].m_uiMaxCUWidth ) ? iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth + 1 : iPicWidth / m_acLayerCfg[layerId].m_uiMaxCUWidth;1908 UInt uiHeightInCU = ( iPicHeight % m_acLayerCfg[layerId ].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight;1909 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId ].m_uiMaxCUDepth << 1);1909 UInt uiWidthInCU = ( iPicWidth % m_acLayerCfg[layerIdx].m_uiMaxCUWidth ) ? iPicWidth / m_acLayerCfg[layerIdx].m_uiMaxCUWidth + 1 : iPicWidth / m_acLayerCfg[layerIdx].m_uiMaxCUWidth; 1910 UInt uiHeightInCU = ( iPicHeight % m_acLayerCfg[layerIdx].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerIdx].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerIdx].m_uiMaxCUHeight; 1911 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerIdx].m_uiMaxCUDepth << 1); 1910 1912 #else 1911 1913 UInt uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth;
Note: See TracChangeset for help on using the changeset viewer.