Changeset 588 in SHVCSoftware for trunk/source/App/TAppEncoder
- Timestamp:
- 1 Feb 2014, 23:50:54 (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-5.0-dev (added) merged: 548-585,587
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-5.0-dev/source (added) merged: 549-585 /trunk/source removed
- Property svn:mergeinfo changed
-
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r547 r588 80 80 { 81 81 m_acLayerCfg[layer].setAppEncCfg(this); 82 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG83 m_ilSampleOnlyPred[layer] = 0;84 #endif85 82 } 86 83 memset( m_scalabilityMask, 0, sizeof(m_scalabilityMask) ); … … 146 143 { 147 144 #if VPS_EXTN_DIRECT_REF_LAYERS 148 #if M0457_PREDICTION_INDICATIONS149 145 for(Int layer = 0; layer < MAX_LAYERS; layer++) 150 146 { … … 152 148 { 153 149 delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds; 154 } 155 } 156 for(Int layer = 0; layer < MAX_LAYERS; layer++) 157 { 150 m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL; 151 } 158 152 if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) 159 153 { 160 154 delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds; 161 } 162 } 163 #else 164 for(Int layer = 0; layer < MAX_LAYERS; layer++) 165 { 166 if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) 167 { 168 delete [] m_acLayerCfg[layer].m_refLayerIds; 169 } 170 } 171 #endif 172 for(Int layer = 0; layer < MAX_LAYERS; layer++) 173 { 155 m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL; 156 } 174 157 if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) 175 158 { 176 159 delete [] m_acLayerCfg[layer].m_predLayerIds; 160 m_acLayerCfg[layer].m_predLayerIds = NULL; 177 161 } 178 162 } … … 383 367 #endif 384 368 #if VPS_EXTN_DIRECT_REF_LAYERS 385 #if M0457_PREDICTION_INDICATIONS386 369 Int* cfg_numSamplePredRefLayers [MAX_LAYERS]; 387 370 string cfg_samplePredRefLayerIds [MAX_LAYERS]; … … 390 373 string cfg_motionPredRefLayerIds [MAX_LAYERS]; 391 374 string* cfg_motionPredRefLayerIdsPtr[MAX_LAYERS]; 392 #else393 Int* cfg_numDirectRefLayers [MAX_LAYERS];394 string cfg_refLayerIds [MAX_LAYERS];395 string* cfg_refLayerIdsPtr [MAX_LAYERS];396 #endif397 375 Int* cfg_numActiveRefLayers [MAX_LAYERS]; 398 376 string cfg_predLayerIds [MAX_LAYERS]; … … 462 440 #endif 463 441 #if VPS_EXTN_DIRECT_REF_LAYERS 464 #if M0457_PREDICTION_INDICATIONS465 442 cfg_numSamplePredRefLayers [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers; 466 443 cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer]; 467 444 cfg_numMotionPredRefLayers [layer] = &m_acLayerCfg[layer].m_numMotionPredRefLayers; 468 445 cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer]; 469 #else470 cfg_numDirectRefLayers [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers;471 cfg_refLayerIdsPtr [layer] = &cfg_refLayerIds[layer];472 #endif473 446 cfg_numActiveRefLayers [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers; 474 447 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; … … 551 524 #endif 552 525 #if VPS_EXTN_DIRECT_REF_LAYERS 553 #if M0457_PREDICTION_INDICATIONS554 526 ("NumSamplePredRefLayers%d",cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers") 555 527 ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs") 556 528 ("NumMotionPredRefLayers%d",cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers") 557 529 ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs") 558 #else559 ("NumDirectRefLayers%d", cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers")560 ("RefLayerIds%d", cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs")561 #endif562 530 ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers") 563 531 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs") … … 619 587 #endif 620 588 #if N0147_IRAP_ALIGN_FLAG 621 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 589 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 590 #endif 591 #if O0194_WEIGHTED_PREDICTION_CGS 592 ("InterLayerWeightedPred", m_useInterLayerWeightedPred, false, "enable IL WP parameters estimation at encoder" ) 622 593 #endif 623 594 #if AVC_BASE … … 629 600 #endif 630 601 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") 631 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG632 ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices")633 #endif634 602 #else //SVC_EXTENSION 635 603 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") … … 956 924 ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") 957 925 ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") 958 #if M0043_LAYERS_PRESENT_SEI959 ("SEILayers Present", m_layersPresentSEIEnabled, 0, "Control generation of layerspresent SEI message")926 #if LAYERS_NOT_PRESENT_SEI 927 ("SEILayersNotPresent", m_layersNotPresentSEIEnabled, 0, "Control generation of layers not present SEI message") 960 928 #endif 961 929 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") … … 1190 1158 } 1191 1159 #if VPS_EXTN_DIRECT_REF_LAYERS 1192 #if M0457_PREDICTION_INDICATIONS1193 1160 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1194 1161 { … … 1253 1220 } 1254 1221 } 1255 #else 1256 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1257 { 1258 Char* pRefLayerIds = cfg_refLayerIds[layer].empty() ? NULL: strdup(cfg_refLayerIds[layer].c_str()); 1259 if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) 1260 { 1261 char *refLayerId; 1262 int i=0; 1263 m_acLayerCfg[layer].m_refLayerIds = new Int[m_acLayerCfg[layer].m_numDirectRefLayers]; 1264 refLayerId = strtok(pRefLayerIds, " ,-"); 1265 while(refLayerId != NULL) 1266 { 1267 if( i >= m_acLayerCfg[layer].m_numDirectRefLayers ) 1268 { 1269 printf( "NumDirectRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); 1270 exit( EXIT_FAILURE ); 1271 } 1272 *( m_acLayerCfg[layer].m_refLayerIds + i ) = atoi( refLayerId ); 1273 refLayerId = strtok(NULL, " ,-"); 1274 i++; 1275 } 1276 if( i < m_acLayerCfg[layer].m_numDirectRefLayers ) 1277 { 1278 printf( "NumDirectRefLayers: The width of some columns is not defined.\n" ); 1279 exit( EXIT_FAILURE ); 1280 } 1281 } 1282 else 1283 { 1284 m_acLayerCfg[layer].m_refLayerIds = NULL; 1285 } 1286 } 1287 #endif 1222 1288 1223 #if AUXILIARY_PICTURES 1289 1224 for(UInt layer = 0; layer < MAX_LAYERS; layer++) … … 2231 2166 } 2232 2167 #if VPS_EXTN_DIRECT_REF_LAYERS 2233 #if M0457_PREDICTION_INDICATIONS2234 2168 xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); 2235 2169 // 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 … … 2254 2188 } 2255 2189 } 2256 #else 2257 xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" ); 2258 // NOTE: m_numDirectRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference 2259 for(Int layer = 1; layer < MAX_LAYERS; layer++) 2260 { 2261 xConfirmPara(m_acLayerCfg[layer].m_numDirectRefLayers > layer, "Cannot reference more layers than before current layer"); 2262 for(Int i = 0; i < m_acLayerCfg[layer].m_numDirectRefLayers; i++) 2263 { 2264 xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] > layer, "Cannot reference higher layers"); 2265 xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] == layer, "Cannot reference the current layer itself"); 2266 } 2267 } 2268 #endif 2190 2269 2191 xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); 2270 2192 // 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 2271 2193 for(Int layer = 1; layer < MAX_LAYERS; layer++) 2272 2194 { 2273 #if M0457_PREDICTION_INDICATIONS2274 2195 Bool predEnabledFlag[MAX_LAYERS]; 2275 2196 for (Int refLayer = 0; refLayer < layer; refLayer++) … … 2295 2216 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers"); 2296 2217 } 2297 #else 2298 xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); 2299 for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) 2300 { 2301 xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers"); 2302 } 2303 #endif 2304 } 2305 #endif 2218 } 2219 #endif //VPS_EXTN_DIRECT_REF_LAYERS 2306 2220 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 2307 2221 if (m_adaptiveResolutionChange > 0) … … 2435 2349 #if N0147_IRAP_ALIGN_FLAG 2436 2350 printf("Cross layer IRAP alignment : %d\n", m_crossLayerIrapAlignFlag ); 2351 #endif 2352 #if O0194_WEIGHTED_PREDICTION_CGS 2353 printf("InterLayerWeightedPred : %d\n", m_useInterLayerWeightedPred ); 2437 2354 #endif 2438 2355 for(UInt layer=0; layer<m_numLayers; layer++) … … 2581 2498 printf("O0194_DIFFERENT_BITDEPTH_EL_BL: %d ", O0194_DIFFERENT_BITDEPTH_EL_BL); 2582 2499 printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT); 2583 printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS);2584 2500 #else 2585 2501 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r540 r588 72 72 #if AVC_SYNTAX 73 73 Char* m_BLSyntaxFile; ///< input syntax file 74 #endif75 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG76 Int m_ilSampleOnlyPred[ MAX_LAYERS ];77 74 #endif 78 75 #if N0120_MAX_TID_REF_CFG … … 283 280 Int m_gradualDecodingRefreshInfoEnabled; 284 281 Int m_decodingUnitInfoSEIEnabled; 285 #if M0043_LAYERS_PRESENT_SEI286 Int m_layers PresentSEIEnabled;282 #if LAYERS_NOT_PRESENT_SEI 283 Int m_layersNotPresentSEIEnabled; 287 284 #endif 288 285 Int m_SOPDescriptionSEIEnabled; … … 384 381 #endif 385 382 #if O0215_PHASE_ALIGNMENT 386 Bool m_phaseAlignFlag;383 Bool m_phaseAlignFlag; 387 384 #endif 388 385 #if O0223_PICTURE_TYPES_ALIGN_FLAG 389 Bool m_crossLayerPictureTypeAlignFlag;386 Bool m_crossLayerPictureTypeAlignFlag; 390 387 #endif 391 388 #if N0147_IRAP_ALIGN_FLAG 392 Bool m_crossLayerIrapAlignFlag;389 Bool m_crossLayerIrapAlignFlag; 393 390 #endif 394 391 #if O0149_CROSS_LAYER_BLA_FLAG 395 bool m_crossLayerBLAFlag; 392 Bool m_crossLayerBLAFlag; 393 #endif 394 #if O0194_WEIGHTED_PREDICTION_CGS 395 Bool m_useInterLayerWeightedPred; 396 396 #endif 397 397 public: -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r540 r588 48 48 #endif 49 49 #if VPS_EXTN_DIRECT_REF_LAYERS 50 #if M0457_PREDICTION_INDICATIONS51 50 Int *m_samplePredRefLayerIds; 52 51 Int m_numSamplePredRefLayers; 53 52 Int *m_motionPredRefLayerIds; 54 53 Int m_numMotionPredRefLayers; 55 #else56 Int *m_refLayerIds;57 Int m_numDirectRefLayers;58 #endif59 54 Int *m_predLayerIds; 60 55 Int m_numActiveRefLayers; … … 153 148 Int* getdQPs() {return m_aidQP; } 154 149 #if VPS_EXTN_DIRECT_REF_LAYERS 155 #if M0457_PREDICTION_INDICATIONS156 150 Int getNumSamplePredRefLayers() {return m_numSamplePredRefLayers; } 157 151 Int* getSamplePredRefLayerIds() {return m_samplePredRefLayerIds; } … … 160 154 Int* getMotionPredRefLayerIds() {return m_motionPredRefLayerIds; } 161 155 Int getMotionPredRefLayerId(Int i) {return m_motionPredRefLayerIds[i]; } 162 #else163 Int getNumDirectRefLayers() {return m_numDirectRefLayers;}164 Int* getRefLayerIds() {return m_refLayerIds; }165 Int getRefLayerId(Int i) {return m_refLayerIds[i]; }166 #endif167 156 168 157 Int getNumActiveRefLayers() {return m_numActiveRefLayers;} -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r547 r588 177 177 delete [] mapIdxToLayer; 178 178 #endif 179 179 180 for(UInt layer=0; layer<m_numLayers; layer++) 180 181 { … … 190 191 g_bitDepthYLayer[layer] = g_bitDepthY; 191 192 g_bitDepthCLayer[layer] = g_bitDepthC; 193 194 #if O0194_WEIGHTED_PREDICTION_CGS 195 m_acTEncTop[layer].setInterLayerWeightedPredFlag( m_useInterLayerWeightedPred ); 196 #endif 192 197 #endif 193 198 //m_acTEncTop[layer].setVPS(&vps); … … 209 214 #if REF_IDX_MFM 210 215 #if AVC_BASE 211 #if M0457_PREDICTION_INDICATIONS212 216 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ) && m_acLayerCfg[layer].getNumMotionPredRefLayers()); 213 217 #else 214 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ));215 #endif216 #else217 #if M0457_PREDICTION_INDICATIONS218 218 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_acLayerCfg[layer].getNumMotionPredRefLayers() > 0 ) ); 219 #else220 m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : true);221 #endif222 #endif223 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG224 m_acTEncTop[layer].setIlSampleOnlyPred( layer == 0 ? 0 : m_ilSampleOnlyPred[layer] );225 219 #endif 226 220 #endif … … 261 255 if(layer) 262 256 { 263 #if M0457_PREDICTION_INDICATIONS264 257 for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++) 265 258 { … … 309 302 } 310 303 m_acTEncTop[layer].setNumDirectRefLayers(numDirectRefLayers); 311 #else 312 if(m_acLayerCfg[layer].getNumDirectRefLayers() == -1) 313 { 314 // Not included in the configuration file; assume that each layer depends on previous layer 315 m_acTEncTop[layer].setNumDirectRefLayers (1); // One ref. layer 316 m_acTEncTop[layer].setRefLayerId (0, layer - 1); // Previous layer 317 } 318 else 319 { 320 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 321 for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++) 322 { 323 m_acTEncTop[layer].setRefLayerId ( i, m_acLayerCfg[layer].getRefLayerId(i)); 324 } 325 } 326 #endif 304 327 305 if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1) 328 306 { 329 #if M0457_PREDICTION_INDICATIONS330 307 m_acTEncTop[layer].setNumActiveRefLayers( m_acTEncTop[layer].getNumDirectRefLayers() ); 331 #else332 m_acTEncTop[layer].setNumActiveRefLayers( m_acLayerCfg[layer].getNumDirectRefLayers() );333 #endif334 308 for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ ) 335 309 { … … 346 320 } 347 321 } 348 #endif 322 #endif //VPS_EXTN_DIRECT_REF_LAYERS 349 323 //===== Slice ======== 350 324 … … 426 400 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 427 401 #if O0194_WEIGHTED_PREDICTION_CGS 428 if (layer!=0)402 if( layer != 0 && m_useInterLayerWeightedPred ) 429 403 { 430 404 // Enable weighted prediction for enhancement layer … … 514 488 m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); 515 489 m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); 516 #if M0043_LAYERS_PRESENT_SEI517 m_acTEncTop[layer].setLayers PresentSEIEnabled( m_layersPresentSEIEnabled );490 #if LAYERS_NOT_PRESENT_SEI 491 m_acTEncTop[layer].setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled ); 518 492 #endif 519 493 m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); … … 828 802 m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled ); 829 803 m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled ); 830 #if M0043_LAYERS_PRESENT_SEI831 m_cTEncTop.setLayers PresentSEIEnabled( m_layersPresentSEIEnabled );804 #if LAYERS_NOT_PRESENT_SEI 805 m_cTEncTop.setLayersNotPresentSEIEnabled( m_layersNotPresentSEIEnabled ); 832 806 #endif 833 807 m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); … … 1171 1145 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1172 1146 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1147 #if P0295_DEFAULT_OUT_LAYER_IDC 1148 vps->setDefaultTargetOutputLayerIdc(1); 1149 #else 1173 1150 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC 1174 1151 vps->setDefaultOneTargetOutputLayerIdc(1); 1175 1152 #else 1176 1153 vps->setDefaultOneTargetOutputLayerFlag(true); 1154 #endif 1177 1155 #endif 1178 1156 for(i = 1; i < vps->getNumLayerSets(); i++) … … 1199 1177 vps->deriveLayerIdListVariables(); 1200 1178 #endif 1179 #if RESOLUTION_BASED_DPB 1180 vps->assignSubDpbIndices(); 1181 #else 1201 1182 vps->deriveNumberOfSubDpbs(); 1183 #endif 1202 1184 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension 1203 1185 for(i = 1; i < vps->getNumOutputLayerSets(); i++) 1204 1186 { 1187 #if CHANGE_NUMSUBDPB_IDX 1188 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1189 #endif 1205 1190 Int layerSetId = vps->getOutputLayerSetIdx(i); 1206 1191 1207 // For each output layer set, set the DPB size for each layer and the reorder/latency value the maximum for all layers1208 Bool checkFlagOuter = false; // Used to calculate sub_layer_flag_info_present_flag1209 Bool checkFlagInner[MAX_TLAYER]; // Used to calculate sub_layer_dpb_info_present_flag1210 1211 1192 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1212 1193 { 1213 1194 1214 1195 Int maxNumReorderPics = -1; 1196 #if CHANGE_NUMSUBDPB_IDX 1197 #if RESOLUTION_BASED_DPB 1198 for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++) 1199 #else 1200 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1201 #endif 1202 #else 1215 1203 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1204 #endif 1216 1205 { 1217 1206 Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set 1207 #if RESOLUTION_BASED_DPB 1208 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 ); 1209 // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated 1210 // at the encoder, modify below 1211 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1212 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ); 1213 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue ); 1214 #else 1218 1215 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 ); 1216 #endif 1219 1217 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j)); 1220 1218 } 1221 1219 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics); 1222 1223 if( j == 0 ) // checkFlagInner[0] is always 1 1224 { 1225 checkFlagInner[j] = true; // Always signal sub-layer DPB information for the first sub-layer 1226 } 1227 else 1228 { 1229 checkFlagInner[j] = false; // Initialize to be false. If the values of the current sub-layers matches with the earlier sub-layer, 1230 // then will be continue to be false - i.e. the j-th sub-layer DPB info is not signaled 1231 checkFlagInner[j] |= ( maxNumReorderPics != vps->getMaxVpsNumReorderPics(i, j - 1) ); 1232 for(Int k = 0; k < vps->getNumSubDpbs(i) && !checkFlagInner[j]; k++) // If checkFlagInner[j] is true, break and signal the values 1233 { 1234 checkFlagInner[j] |= ( vps->getMaxVpsDecPicBufferingMinus1(i, k, j - 1) != vps->getMaxVpsDecPicBufferingMinus1(i, k, j) ); 1235 } 1236 } 1237 // If checkFlagInner[j] = true, then some value needs to be signalled for the j-th sub-layer 1238 vps->setSubLayerDpbInfoPresentFlag( i, j, checkFlagInner[j] ); 1239 } 1240 for(Int j = 1; j < vps->getMaxTLayers(); j++) // Check if DPB info of any of non-zero sub-layers is signaled. If so set flag to one 1241 { 1242 if( vps->getSubLayerDpbInfoPresentFlag(i, j) ) 1243 { 1244 checkFlagOuter = true; 1245 break; 1246 } 1247 } 1248 vps->setSubLayerFlagInfoPresentFlag( i, checkFlagOuter ); 1220 vps->determineSubDpbInfoFlags(); 1221 } 1249 1222 } 1250 1223 #endif … … 1274 1247 vps->setDirectDependencyFlag( layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true); 1275 1248 } 1276 #if M0457_PREDICTION_INDICATIONS 1249 // prediction indications 1277 1250 vps->setDirectDepTypeLen(2); // sample and motion types are encoded 1278 1251 for(Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) … … 1301 1274 } 1302 1275 } 1303 #endif1304 1276 } 1305 1277 … … 1318 1290 #endif 1319 1291 #endif 1320 #if JCTVC_M0458_INTERLAYER_RPS_SIG1321 1292 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1322 #endif1323 1293 #if O0062_POC_LSB_NOT_PRESENT_FLAG 1324 1294 for(i = 1; i< vps->getMaxLayers(); i++) … … 1361 1331 vps->setHigherLayerIrapSkipFlag(m_skipPictureAtArcSwitch); 1362 1332 #endif 1333 #if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED 1363 1334 #if !VPS_EXTN_OFFSET_CALC 1364 1335 #if VPS_EXTN_OFFSET 1365 1336 // to be updated according to the current semantics 1366 1337 vps->setExtensionOffset( 0xffff ); 1338 #endif 1367 1339 #endif 1368 1340 #endif … … 1653 1625 if(iTotalNumEncoded) 1654 1626 { 1627 #if P0130_EOB 1628 if( bEos ) 1629 { 1630 OutputNALUnit nalu(NAL_UNIT_EOB); 1631 nalu.m_layerId = 0; 1632 1633 AccessUnit& accessUnit = outputAccessUnits.back(); 1634 nalu.m_temporalId = accessUnit.front()->m_temporalId; 1635 accessUnit.push_back(new NALUnitEBSP(nalu)); 1636 } 1637 #endif 1655 1638 xWriteStream(bitstreamFile, iTotalNumEncoded, outputAccessUnits); 1656 1639 outputAccessUnits.clear();
Note: See TracChangeset for help on using the changeset viewer.