Changeset 644 in SHVCSoftware for trunk/source/App/TAppEncoder
- Timestamp:
- 25 Mar 2014, 21:51:30 (11 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-5.1-dev (added) merged: 599-600,602-643
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-5.0-dev/source merged: 601 /branches/SHM-5.1-dev/source (added) merged: 600,602-643
- Property svn:mergeinfo changed
-
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r595 r644 385 385 string cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; 386 386 Int* cfg_numScaledRefLayerOffsets[MAX_LAYERS]; 387 #if P0312_VERT_PHASE_ADJ 388 string cfg_vertPhasePositionEnableFlag[MAX_LAYERS]; 389 #endif 387 390 388 391 #if O0098_SCALED_REF_LAYER_ID … … 393 396 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 394 397 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 398 #if P0312_VERT_PHASE_ADJ 399 string* cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS]; 400 #endif 401 395 402 #if RC_SHVC_HARMONIZATION 396 403 Bool* cfg_RCEnableRateControl [MAX_LAYERS]; … … 451 458 { 452 459 #if O0098_SCALED_REF_LAYER_ID 453 cfg_scaledRefLayerIdPtr [layer] = &cfg_scaledRefLayerId[layer] 454 #endif 455 cfg_scaledRefLayerLeftOffsetPtr [layer] = &cfg_scaledRefLayerLeftOffset[layer] 456 cfg_scaledRefLayerTopOffsetPtr [layer] = &cfg_scaledRefLayerTopOffset[layer] 457 cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer] 460 cfg_scaledRefLayerIdPtr [layer] = &cfg_scaledRefLayerId[layer]; 461 #endif 462 cfg_scaledRefLayerLeftOffsetPtr [layer] = &cfg_scaledRefLayerLeftOffset[layer]; 463 cfg_scaledRefLayerTopOffsetPtr [layer] = &cfg_scaledRefLayerTopOffset[layer]; 464 cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer]; 458 465 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 466 #if P0312_VERT_PHASE_ADJ 467 cfg_vertPhasePositionEnableFlagPtr[layer] = &cfg_vertPhasePositionEnableFlag[layer]; 468 #endif 459 469 } 460 470 #if RC_SHVC_HARMONIZATION … … 569 579 " bottom-right luma sample of the EL picture, in units of two luma samples") 570 580 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 571 " bottom-right luma sample of the EL picture, in units of two luma samples") 581 " bottom-right luma sample of the EL picture, in units of two luma samples") 582 #if P0312_VERT_PHASE_ADJ 583 ("VertPhasePositionEnableFlag%d", cfg_vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d") 584 #endif 572 585 #if O0194_DIFFERENT_BITDEPTH_EL_BL 573 586 ("InputBitDepth%d", cfg_InputBitDepthY, 8, MAX_LAYERS, "Bit-depth of input file for layer %d") … … 588 601 #if N0147_IRAP_ALIGN_FLAG 589 602 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 603 #endif 604 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 605 ("CrossLayerAlignedIdrOnlyFlag", m_crossLayerAlignedIdrOnlyFlag, true, "only idr for IRAP across layers" ) 590 606 #endif 591 607 #if O0194_WEIGHTED_PREDICTION_CGS … … 714 730 ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5") 715 731 ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6") 716 ("LambdaModifier7,-LM7", m_adLambdaModifier[ 7 ], ( Double )1.0, "Lambda modifier for temporal layer 7")717 732 #endif 718 733 … … 1070 1085 assert( strcmp(cfg_scaledRefLayerId[layer].c_str(), "")); 1071 1086 #endif 1087 #if P0312_VERT_PHASE_ADJ 1072 1088 assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || 1073 1089 strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") || 1074 1090 strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "") || 1075 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") 1076 ); 1091 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") || 1092 strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),"") ); 1093 #else 1094 assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || 1095 strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") || 1096 strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "") || 1097 strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ); 1098 #endif 1077 1099 } 1078 1100 … … 1150 1172 } 1151 1173 } 1174 #if P0312_VERT_PHASE_ADJ 1175 // VertPhasePositionEnableFlag // 1176 if(strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(), "")) 1177 { 1178 cfgStringToArray( &tempArray, cfg_vertPhasePositionEnableFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "VertPhasePositionEnableFlag"); 1179 if(tempArray) 1180 { 1181 for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) 1182 { 1183 m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] = tempArray[i]; 1184 } 1185 delete [] tempArray; tempArray = NULL; 1186 } 1187 } 1188 #endif 1152 1189 } 1153 1190 #if VPS_EXTN_DIRECT_REF_LAYERS … … 2342 2379 printf("Cross layer IRAP alignment : %d\n", m_crossLayerIrapAlignFlag ); 2343 2380 #endif 2381 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2382 printf("IDR only for IRAP : %d\n", m_crossLayerAlignedIdrOnlyFlag ); 2383 #endif 2344 2384 #if O0194_WEIGHTED_PREDICTION_CGS 2345 2385 printf("InterLayerWeightedPred : %d\n", m_useInterLayerWeightedPred ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r595 r644 384 384 Bool m_crossLayerIrapAlignFlag; 385 385 #endif 386 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 387 Bool m_crossLayerAlignedIdrOnlyFlag; 388 #endif 386 389 #if O0149_CROSS_LAYER_BLA_FLAG 387 390 Bool m_crossLayerBLAFlag; -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r540 r644 60 60 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 61 61 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 62 #if P0312_VERT_PHASE_ADJ 63 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag)); 64 #endif 62 65 } 63 66 -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r588 r644 97 97 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 98 98 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 99 #if P0312_VERT_PHASE_ADJ 100 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 101 #endif 102 99 103 #if O0194_DIFFERENT_BITDEPTH_EL_BL 100 104 Int m_inputBitDepthY; ///< bit-depth of input file (luma component) -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r597 r644 570 570 m_acTEncTop[layer].setScaledRefLayerId(i, m_acLayerCfg[layer].m_scaledRefLayerId[i]); 571 571 #endif 572 #if P0312_VERT_PHASE_ADJ 573 m_acTEncTop[layer].setVertPhasePositionEnableFlag( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); 574 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 575 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] ); 576 #else 572 577 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 573 578 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 579 #endif 574 580 } 575 581 } … … 956 962 #endif 957 963 m_acTEncTop[layer].init(isFieldCoding); 964 #if P0182_VPS_VUI_PS_FLAG 965 m_acTEncTop[layer].getVPS()->setSPSId(layer, m_acTEncTop[layer].getSPS()->getSPSId()); 966 m_acTEncTop[layer].getVPS()->setPPSId(layer, m_acTEncTop[layer].getPPS()->getPPSId()); 967 #endif 958 968 } 959 969 #if VPS_RENAME … … 1193 1203 // at the encoder, modify below 1194 1204 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1195 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) ;1205 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1; 1196 1206 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue ); 1197 1207 #else … … 1200 1210 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j)); 1201 1211 } 1212 #if RESOLUTION_BASED_DPB 1213 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1214 { 1215 // Decrement m_maxVpsDecPicBufferingMinus1 1216 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1217 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 ); 1218 } 1219 #endif 1202 1220 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics); 1203 1221 vps->determineSubDpbInfoFlags(); … … 1286 1304 vps->setCrossLayerPictureTypeAlignFlag( m_crossLayerPictureTypeAlignFlag ); 1287 1305 #endif 1306 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1307 vps->setCrossLayerAlignedIdrOnlyFlag( m_crossLayerAlignedIdrOnlyFlag ); 1308 #endif 1288 1309 #if N0147_IRAP_ALIGN_FLAG 1289 1310 vps->setCrossLayerIrapAlignFlag( m_crossLayerIrapAlignFlag ); … … 1327 1348 #endif 1328 1349 1350 #if P0300_ALT_OUTPUT_LAYER_FLAG 1351 for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++) 1352 { 1353 vps->setAltOuputLayerFlag( k, m_altOutputLayerFlag ); 1354 } 1355 #else 1329 1356 #if O0153_ALT_OUTPUT_LAYER_FLAG 1330 1357 vps->setAltOuputLayerFlag( m_altOutputLayerFlag ); 1358 #endif 1359 #endif 1360 1361 #if P0312_VERT_PHASE_ADJ 1362 Bool vpsVuiVertPhaseInUseFlag = false; 1363 for( UInt layerId = 1; layerId < m_numLayers; layerId++ ) 1364 { 1365 for( i = 0; i < m_acLayerCfg[layerId].m_numScaledRefLayerOffsets; i++ ) 1366 { 1367 if( m_acTEncTop[layerId].getVertPhasePositionEnableFlag(i) ) 1368 { 1369 vpsVuiVertPhaseInUseFlag = true; 1370 break; 1371 } 1372 } 1373 } 1374 vps->setVpsVuiVertPhaseInUseFlag( vpsVuiVertPhaseInUseFlag ); 1375 #endif 1376 1377 #if O0164_MULTI_LAYER_HRD 1378 vps->setVpsVuiBspHrdPresentFlag(false); 1379 TEncTop *pcCfg = &m_acTEncTop[0]; 1380 if( pcCfg->getBufferingPeriodSEIEnabled() ) 1381 { 1382 vps->setVpsVuiBspHrdPresentFlag(true); 1383 vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2); 1384 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 1385 for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) 1386 { 1387 vps->setBspCprmsPresentFlag(i, true); 1388 1389 UInt layerId = i + 1; 1390 TEncTop *pcCfgLayer = &m_acTEncTop[layerId]; 1391 1392 Int iPicWidth = pcCfgLayer->getSourceWidth(); 1393 Int iPicHeight = pcCfgLayer->getSourceHeight(); 1394 UInt uiWidthInCU = ( iPicWidth %m_uiMaxCUWidth ) ? iPicWidth /m_uiMaxCUWidth + 1 : iPicWidth /m_uiMaxCUWidth; 1395 UInt uiHeightInCU = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight; 1396 UInt uiNumCUsInFrame = uiWidthInCU * uiHeightInCU; 1397 1398 UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1); 1399 UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 ); 1400 if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 ) 1401 { 1402 numDU ++; 1403 } 1404 vps->getBspHrd(i)->setNumDU( numDU ); 1405 vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) ); 1406 } 1407 for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++) 1408 { 1409 vps->setNumBitstreamPartitions(h, 1); 1410 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 1411 { 1412 for( UInt j = 0; j <= (vps->getMaxLayers()-1); j++ ) 1413 { 1414 if (vps->getLayerIdIncludedFlag(h, j) && h == j) 1415 { 1416 vps->setLayerInBspFlag(h, i, j, true); 1417 } 1418 } 1419 } 1420 vps->setNumBspSchedCombinations(h, 1); 1421 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 1422 { 1423 for( UInt j = 0; j < vps->getNumBitstreamPartitions(h); j++ ) 1424 { 1425 vps->setBspCombHrdIdx(h, i, j, 0); 1426 vps->setBspCombSchedIdx(h, i, j, 0); 1427 } 1428 } 1429 } 1430 } 1331 1431 #endif 1332 1432
Note: See TracChangeset for help on using the changeset viewer.