Changeset 442 in SHVCSoftware for trunk/source/App/TAppEncoder/TAppEncCfg.cpp
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev merged: 350-351,357-360 /branches/SHM-3.1-dev (added) merged: 354-356,361-403,405-441 /trunk merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source merged: 357-360 /branches/SHM-3.1-dev/source (added) merged: 355-356,361-364,366-403,405,407-441 /trunk/source merged: 352 reverse-merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r345 r442 69 69 , m_avcBaseLayerFlag(0) 70 70 #endif 71 #if N0120_MAX_TID_REF_CFG 72 , m_maxTidRefPresentFlag(1) 73 #endif 71 74 , m_pColumnWidth() 72 75 , m_pRowHeight() 73 76 , m_scalingListFile() 74 #if REF_IDX_FRAMEWORK75 77 , m_elRapSliceBEnabled(0) 76 #endif77 78 { 78 79 for(UInt layer=0; layer<MAX_LAYERS; layer++) … … 217 218 { 218 219 in>>entry.m_refIdc[i]; 220 } 221 } 222 #endif 223 #if EXTERNAL_USEDBYCURR_N0082 224 if(entry.m_numRefPics>0){ 225 in>>entry.m_UseExtusedByCurrPic; 226 if(entry.m_UseExtusedByCurrPic) 227 { 228 for ( Int i = 0; i < entry.m_numRefPics; i++ ) 229 { 230 in>>entry.m_ExtusedByCurrPic[i]; 231 } 219 232 } 220 233 } … … 335 348 336 349 #if SVC_EXTENSION 337 string cfg_LayerCfgFile [MAX_LAYERS];350 string cfg_LayerCfgFile [MAX_LAYERS]; 338 351 string cfg_BitstreamFile; 339 string* cfg_InputFile [MAX_LAYERS]; 340 string* cfg_ReconFile [MAX_LAYERS]; 341 Double* cfg_fQP [MAX_LAYERS]; 342 352 string* cfg_InputFile [MAX_LAYERS]; 353 string* cfg_ReconFile [MAX_LAYERS]; 354 Double* cfg_fQP [MAX_LAYERS]; 355 356 #if REPN_FORMAT_IN_VPS 357 Int* cfg_repFormatIdx [MAX_LAYERS]; 358 #endif 343 359 Int* cfg_SourceWidth [MAX_LAYERS]; 344 360 Int* cfg_SourceHeight [MAX_LAYERS]; … … 384 400 Bool* cfg_RCForceIntraQP [MAX_LAYERS]; 385 401 #endif 402 #if N0120_MAX_TID_REF_CFG 403 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 404 #endif 386 405 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 387 406 { … … 389 408 cfg_ReconFile[layer] = &m_acLayerCfg[layer].m_cReconFile; 390 409 cfg_fQP[layer] = &m_acLayerCfg[layer].m_fQP; 410 #if REPN_FORMAT_IN_VPS 411 cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx; 412 #endif 391 413 cfg_SourceWidth[layer] = &m_acLayerCfg[layer].m_iSourceWidth; 392 414 cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight; … … 426 448 cfg_RCForceIntraQP[layer] = &m_acLayerCfg[layer].m_RCForceIntraQP; 427 449 #endif 450 #if N0120_MAX_TID_REF_CFG 451 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 452 #endif 428 453 } 429 454 #if AVC_BASE … … 432 457 #if AVC_SYNTAX 433 458 string cfg_BLSyntaxFile; 459 #endif 460 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 461 string cfg_tileSets; 434 462 #endif 435 463 #else … … 459 487 ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d") 460 488 ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") 489 #if REPN_FORMAT_IN_VPS 490 ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS") 491 #endif 461 492 #if VPS_EXTN_DIRECT_REF_LAYERS 462 493 #if M0457_PREDICTION_INDICATIONS … … 474 505 ("NumLayers", m_numLayers, 1, "Number of layers to code") 475 506 ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 507 #if SCALABILITY_MASK_E0104 508 ("ScalabilityMask1", m_scalabilityMask[1], 0, "scalability_mask[1] (multiview)") 509 ("ScalabilityMask2", m_scalabilityMask[2], 1, "scalability_mask[2] (scalable)" ) 510 #else 476 511 ("ScalabilityMask0", m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)") 477 512 ("ScalabilityMask1", m_scalabilityMask[1], 1, "scalability_mask[1] (scalable)" ) 513 #endif 478 514 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 479 515 ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") … … 495 531 " bottom-right luma sample of the EL picture, in units of two luma samples") 496 532 #endif 533 #if N0120_MAX_TID_REF_CFG 534 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) 535 ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction") 536 #endif 497 537 #if AVC_BASE 498 538 ("AvcBase,-avc", m_avcBaseLayerFlag, 0, "avc_base_layer_flag") … … 502 542 #endif 503 543 #endif 504 #if REF_IDX_FRAMEWORK505 544 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") 506 #endif507 545 #if M0457_IL_SAMPLE_PRED_ONLY_FLAG 508 546 ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices") 509 547 #endif 510 #else 548 #else 511 549 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 512 550 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 530 568 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 531 569 #endif 570 571 //Field coding parameters 572 ("FieldCoding", m_isField, false, "Signals if it's a field based coding") 573 ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") 532 574 ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") 533 575 ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") … … 810 852 ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)") 811 853 #endif 854 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 855 ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message") 856 ("IlNumSetsInMessage", m_ilNumSetsInMessage, 0u, "Number of inter layer constrained tile sets") 857 ("TileSetsArray", cfg_tileSets, string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ") 858 #endif 812 859 ; 813 860 … … 827 874 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 828 875 876 if(m_isField) 877 { 878 #if SVC_EXTENSION 879 for(Int layer = 0; layer < MAX_LAYERS; layer++) 880 { 881 //Frame height 882 m_acLayerCfg[layer].m_iSourceHeightOrg = m_acLayerCfg[layer].m_iSourceHeight; 883 //Field height 884 m_acLayerCfg[layer].m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight >> 1; 885 } 886 #else 887 //Frame height 888 m_iSourceHeightOrg = m_iSourceHeight; 889 //Field height 890 m_iSourceHeight = m_iSourceHeight >> 1; 891 #endif 892 //number of fields to encode 893 m_framesToBeEncoded *= 2; 894 } 895 829 896 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 830 897 { … … 1119 1186 #endif 1120 1187 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 1121 1188 1189 #if REPN_FORMAT_IN_VPS_123 1190 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1191 { 1192 m_acLayerCfg[layer].setSourceHeight( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picHeightInLumaSamples); 1193 m_acLayerCfg[layer].setSourceWidth ( m_repFormatCfg[ m_acLayerCfg[layer].getRepFormatIdx() ].m_picWidthInLumaSamples ); 1194 } 1195 #endif 1122 1196 /* rules for input, output and internal bitdepths as per help text */ 1123 1197 if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } … … 1151 1225 m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; 1152 1226 m_iSourceHeight += m_confBottom; 1227 if ( m_isField ) 1228 { 1229 m_iSourceHeightOrg += m_confBottom << 1; 1230 m_aiPad[1] = m_confBottom << 1; 1231 } 1153 1232 } 1154 1233 if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) … … 1284 1363 } 1285 1364 } 1365 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 1366 if (m_interLayerConstrainedTileSetsSEIEnabled) 1367 { 1368 if (m_iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0) 1369 { 1370 printf( "Tiles are not defined (needed for inter-layer comnstrained tile sets SEI).\n" ); 1371 exit( EXIT_FAILURE ); 1372 } 1373 Char* pTileSets = cfg_tileSets.empty() ? NULL : strdup(cfg_tileSets.c_str()); 1374 int i = 0; 1375 char *topLeftTileIndex = strtok(pTileSets, " ,"); 1376 while(topLeftTileIndex != NULL) 1377 { 1378 if( i >= m_ilNumSetsInMessage ) 1379 { 1380 printf( "The number of tile sets is larger than defined by IlNumSetsInMessage.\n" ); 1381 exit( EXIT_FAILURE ); 1382 } 1383 *( m_topLeftTileIndex + i ) = atoi( topLeftTileIndex ); 1384 char *bottonRightTileIndex = strtok(NULL, " ,"); 1385 if( bottonRightTileIndex == NULL ) 1386 { 1387 printf( "BottonRightTileIndex is missing in the tile sets.\n" ); 1388 exit( EXIT_FAILURE ); 1389 } 1390 *( m_bottomRightTileIndex + i ) = atoi( bottonRightTileIndex ); 1391 char *ilcIdc = strtok(NULL, " ,"); 1392 if( ilcIdc == NULL ) 1393 { 1394 printf( "IlcIdc is missing in the tile sets.\n" ); 1395 exit( EXIT_FAILURE ); 1396 } 1397 *( m_ilcIdc + i ) = atoi( ilcIdc ); 1398 topLeftTileIndex = strtok(NULL, " ,"); 1399 i++; 1400 } 1401 if( i < m_ilNumSetsInMessage ) 1402 { 1403 printf( "The number of tile sets is smaller than defined by IlNumSetsInMessage.\n" ); 1404 exit( EXIT_FAILURE ); 1405 } 1406 m_skippedTileSetPresentFlag = false; 1407 } 1408 #endif 1286 1409 // check validity of input parameters 1287 1410 xCheckParameter(); … … 1467 1590 #endif 1468 1591 1469 #if !FINAL_RPL_CHANGE_N00821592 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1470 1593 Bool verifiedGOP=false; 1471 1594 #endif 1472 1595 Bool errorGOP=false; 1473 #if !FINAL_RPL_CHANGE_N00821596 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1474 1597 Int checkGOP=1; 1475 Int numRefs = 1;1598 Int numRefs = m_isField ? 2 : 1; 1476 1599 #endif 1477 1600 Int refList[MAX_NUM_REF_PICS+1]; 1478 1601 refList[0]=0; 1602 if(m_isField) 1603 { 1604 refList[1] = 1; 1605 } 1479 1606 Bool isOK[MAX_GOP]; 1480 1607 for(Int i=0; i<MAX_GOP; i++) … … 1482 1609 isOK[i]=false; 1483 1610 } 1484 #if !FINAL_RPL_CHANGE_N00821611 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1485 1612 Int numOK=0; 1486 1613 #endif … … 1504 1631 for(UInt layer=0; layer<m_numLayers; layer++) 1505 1632 { 1506 if(m_acLayerCfg[layer].xCheckParameter( ))1633 if(m_acLayerCfg[layer].xCheckParameter(m_isField)) 1507 1634 { 1508 1635 printf("\nError: invalid configuration parameter found in layer %d \n", layer); … … 1530 1657 for(UInt layer=0; layer<m_numLayers; layer++) 1531 1658 { 1532 if (m_acLayerCfg[layer].m_GOPListLayer[0].m_POC<0){ 1659 if (m_acLayerCfg[layer].m_GOPListLayer[0].m_POC<0) 1660 { 1533 1661 memcpy( m_acLayerCfg[layer].m_GOPListLayer, m_GOPList, sizeof(GOPEntry)*MAX_GOP ); 1534 1662 } … … 1536 1664 xConfirmPara(errorGOP,"Invalid GOP structure given"); 1537 1665 } 1666 #if TEMP_SCALABILITY_FIX 1667 if( m_acLayerCfg[1].m_GOPListLayer[5].m_POC == 6 && m_acLayerCfg[1].m_GOPListLayer[7].m_POC == 7 && 1668 m_acLayerCfg[1].m_GOPListLayer[5].m_temporalId == 0 && m_acLayerCfg[1].m_GOPListLayer[7].m_temporalId == 0) 1669 #else 1538 1670 //tentative for encoder 1539 if( m_acLayerCfg[1].m_GOPListLayer[5].m_POC == 6 && m_acLayerCfg[1].m_GOPListLayer[7].m_POC == 7 ){ 1671 if( m_acLayerCfg[1].m_GOPListLayer[5].m_POC == 6 && m_acLayerCfg[1].m_GOPListLayer[7].m_POC == 7 ) 1672 #endif 1673 { 1540 1674 //RA, POC5 1541 1675 m_acLayerCfg[1].m_GOPListLayer[5].m_usedByCurrPic[2] = 0; … … 1545 1679 m_acLayerCfg[1].m_GOPListLayer[7].m_refIdc[2] = 0; 1546 1680 } 1547 #else 1681 #endif 1682 #if EXTERNAL_USEDBYCURR_N0082|| !FINAL_RPL_CHANGE_N0082 1548 1683 m_extraRPSs=0; 1549 1684 //start looping through frames in coding order until we can verify that the GOP structure is correct. … … 1742 1877 xConfirmPara(errorGOP,"Invalid GOP structure given"); 1743 1878 #endif 1879 #if EXTERNAL_USEDBYCURR_N0082 1880 for(UInt layer=0; layer<m_numLayers; layer++) 1881 { 1882 for (Int i=0; i< m_iGOPSize; i++){ 1883 if (m_acLayerCfg[layer].m_GOPListLayer[i].m_UseExtusedByCurrPic == 1 ) 1884 { 1885 for(Int j=0; j<m_acLayerCfg[layer].m_GOPListLayer[i].m_numRefPics; j++ ) 1886 { 1887 m_acLayerCfg[layer].m_GOPListLayer[i].m_usedByCurrPic[j] = m_acLayerCfg[layer].m_GOPListLayer[i].m_ExtusedByCurrPic[j]; 1888 m_acLayerCfg[layer].m_GOPListLayer[i].m_refIdc[j] = m_acLayerCfg[layer].m_GOPListLayer[i].m_ExtusedByCurrPic[j]; 1889 } 1890 } 1891 } 1892 } 1893 #endif 1744 1894 m_maxTempLayer = 1; 1745 1895 for(Int i=0; i<m_iGOPSize; i++) … … 2045 2195 } 2046 2196 #endif 2197 #if N0120_MAX_TID_REF_CFG 2198 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) 2199 { 2200 xConfirmPara(m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); 2201 } 2202 #endif 2047 2203 #undef xConfirmPara 2048 2204 if (check_failed) … … 2081 2237 #if SVC_EXTENSION 2082 2238 printf("Total number of layers : %d\n", m_numLayers ); 2239 #if SCALABILITY_MASK_E0104 2240 printf("Multiview : %d\n", m_scalabilityMask[1] ); 2241 printf("Scalable : %d\n", m_scalabilityMask[2] ); 2242 #else 2083 2243 printf("Multiview : %d\n", m_scalabilityMask[0] ); 2084 2244 printf("Scalable : %d\n", m_scalabilityMask[1] ); 2245 #endif 2085 2246 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 2086 2247 printf("Adaptive Resolution Change : %d\n", m_adaptiveResolutionChange ); … … 2105 2266 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 2106 2267 #endif 2107 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2268 if (m_isField) 2269 { 2270 printf("Frame/Field : Field based coding\n"); 2271 printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2272 if (m_isTopFieldFirst) 2273 { 2274 printf("Field Order : Top field first\n"); 2275 } 2276 else 2277 { 2278 printf("Field Order : Bottom field first\n"); 2279 } 2280 } 2281 else 2282 { 2283 printf("Frame/Field : Frame based coding\n"); 2284 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2285 } 2108 2286 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2109 2287 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); … … 2209 2387 printf("AvcBase:%d ", 0); 2210 2388 #endif 2211 #if REF_IDX_FRAMEWORK2212 printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK);2213 2389 printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled); 2214 2390 printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV); 2215 2391 printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE); 2216 2392 printf("REF_IDX_MFM: %d ", REF_IDX_MFM); 2217 #endif2218 2393 #else 2219 2394 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
Note: See TracChangeset for help on using the changeset viewer.