Changeset 467 in SHVCSoftware for branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 14 Nov 2013, 00:54:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r466 r467 362 362 Int* cfg_IntraPeriod [MAX_LAYERS]; 363 363 Int* cfg_conformanceMode [MAX_LAYERS]; 364 #if LAYER_CTB 365 // coding unit (CU) definition 366 UInt* cfg_uiMaxCUWidth[MAX_LAYERS]; ///< max. CU width in pixel 367 UInt* cfg_uiMaxCUHeight[MAX_LAYERS]; ///< max. CU height in pixel 368 UInt* cfg_uiMaxCUDepth[MAX_LAYERS]; ///< max. CU depth 369 370 // transfom unit (TU) definition 371 UInt* cfg_uiQuadtreeTULog2MaxSize[MAX_LAYERS]; 372 UInt* cfg_uiQuadtreeTULog2MinSize[MAX_LAYERS]; 373 374 UInt* cfg_uiQuadtreeTUMaxDepthInter[MAX_LAYERS]; 375 UInt* cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS]; 376 #endif 364 377 #if VPS_EXTN_DIRECT_REF_LAYERS 365 378 #if M0457_PREDICTION_INDICATIONS … … 379 392 string* cfg_predLayerIdsPtr [MAX_LAYERS]; 380 393 #endif 381 #if SCALED_REF_LAYER_OFFSETS382 394 string cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; 383 395 string cfg_scaledRefLayerTopOffset [MAX_LAYERS]; … … 390 402 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 391 403 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 392 #endif393 404 #if RC_SHVC_HARMONIZATION 394 405 Bool* cfg_RCEnableRateControl [MAX_LAYERS]; … … 424 435 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 425 436 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 437 #if LAYER_CTB 438 // coding unit (CU) definition 439 cfg_uiMaxCUWidth[layer] = &m_acLayerCfg[layer].m_uiMaxCUWidth; 440 cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight; 441 cfg_uiMaxCUDepth[layer] = &m_acLayerCfg[layer].m_uiMaxCUDepth; 442 443 // transfom unit (TU) definition. 444 cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize; 445 cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize; 446 447 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter; 448 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra; 449 #endif 426 450 #if VPS_EXTN_DIRECT_REF_LAYERS 427 451 #if M0457_PREDICTION_INDICATIONS … … 437 461 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; 438 462 #endif 439 #if SCALED_REF_LAYER_OFFSETS440 463 cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets; 441 464 for(Int i = 0; i < MAX_LAYERS; i++) … … 446 469 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 447 470 } 448 #endif449 471 #if RC_SHVC_HARMONIZATION 450 472 cfg_RCEnableRateControl[layer] = &m_acLayerCfg[layer].m_RCEnableRateControl; … … 477 499 string cfg_tileSets; 478 500 #endif 479 #else 501 #else //SVC_EXTENSION 480 502 string cfg_InputFile; 481 503 string cfg_BitstreamFile; 482 504 string cfg_ReconFile; 483 505 string cfg_dQPFile; 484 #endif 506 #endif //SVC_EXTENSION 485 507 string cfg_ColumnWidth; 486 508 string cfg_RowHeight; … … 541 563 ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") 542 564 #endif 543 #if SCALED_REF_LAYER_OFFSETS544 565 ("NumScaledRefLayerOffsets%d", cfg_numScaledRefLayerOffsets, 0, MAX_LAYERS, "Number of scaled offset layer sets ") 545 566 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" … … 551 572 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 552 573 " bottom-right luma sample of the EL picture, in units of two luma samples") 553 #endif554 574 #if O0194_DIFFERENT_BITDEPTH_EL_BL 555 575 ("InputBitDepth%d", cfg_InputBitDepthY, 8, MAX_LAYERS, "Bit-depth of input file for layer %d") … … 576 596 ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices") 577 597 #endif 578 #else 598 #else //SVC_EXTENSION 579 599 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 580 600 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 597 617 ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") 598 618 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 599 #endif 619 #endif //SVC_EXTENSION 600 620 601 621 //Field coding parameters … … 614 634 ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") 615 635 636 #if LAYER_CTB 637 // Unit definition parameters 638 ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width") 639 ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height") 640 // todo: remove defaults from MaxCUSize 641 ("MaxCUSize%d,s%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size") 642 ("MaxCUSize%d,s%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size") 643 ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth") 644 645 ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2") 646 ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2") 647 648 ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs") 649 ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs") 650 651 652 // set the same CU realted settings across all the layers if config file parameters are not layer specific 653 ("MaxCUWidth", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width") 654 ("MaxCUHeight", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height") 655 // todo: remove defaults from MaxCUSize 656 ("MaxCUSize,s", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size") 657 ("MaxCUSize,s", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size") 658 ("MaxPartitionDepth,h", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth") 659 660 ("QuadtreeTULog2MaxSize", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2") 661 ("QuadtreeTULog2MinSize", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2") 662 663 ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs") 664 ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs") 665 #else 616 666 // Unit definition parameters 617 667 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 627 677 ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") 628 678 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 679 #endif 629 680 630 681 // Coding structure paramters … … 950 1001 m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); 951 1002 #endif 952 #else 1003 #else //SVC_EXTENSION 953 1004 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); 954 1005 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 955 1006 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 956 1007 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 957 #endif 1008 #endif //SVC_EXTENSION 958 1009 959 1010 Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); … … 1014 1065 m_pRowHeight = NULL; 1015 1066 } 1016 #if S CALED_REF_LAYER_OFFSETS1067 #if SVC_EXTENSION 1017 1068 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1018 1069 { … … 1084 1135 } 1085 1136 } 1086 #endif1087 1137 #if VPS_EXTN_DIRECT_REF_LAYERS 1088 1138 #if M0457_PREDICTION_INDICATIONS … … 1214 1264 } 1215 1265 #endif 1266 #endif //SVC_EXTENSION 1216 1267 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 1217 1268 … … 1443 1494 1444 1495 // set global varibles 1496 #if LAYER_CTB 1497 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1498 { 1499 xSetGlobal(layer); 1500 } 1501 #else 1445 1502 xSetGlobal(); 1503 #endif 1446 1504 1447 1505 // print-out parameters … … 1510 1568 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 1511 1569 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); 1570 #if LAYER_CTB 1571 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1572 { 1573 xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 1574 } 1575 #else 1512 1576 xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 1577 #endif 1513 1578 1514 1579 xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" ); … … 1524 1589 } 1525 1590 #endif 1591 #if !LAYER_CTB 1526 1592 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 1527 1593 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 1528 1594 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 1529 1595 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 1596 #endif 1530 1597 #if !SVC_EXTENSION 1531 1598 xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); … … 1533 1600 #endif 1534 1601 1602 #if !LAYER_CTB 1535 1603 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 1536 1604 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); … … 1546 1614 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); 1547 1615 xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" ); 1616 #endif 1548 1617 1549 1618 xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); … … 1593 1662 #endif 1594 1663 1664 #if !LAYER_CTB 1595 1665 // max CU width and height should be power of 2 1596 1666 UInt ui = m_uiMaxCUWidth; … … 1608 1678 xConfirmPara( ui != 1 , "Height should be 2^n"); 1609 1679 } 1610 1680 #endif 1611 1681 1612 1682 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure … … 2005 2075 Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth; 2006 2076 Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight; 2077 #if LAYER_CTB 2078 Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth; 2079 Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight; 2080 #endif 2007 2081 #endif 2008 2082 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 2249 2323 /** \todo use of global variables should be removed later 2250 2324 */ 2325 #if LAYER_CTB 2326 Void TAppEncCfg::xSetGlobal(UInt layerId) 2327 { 2328 // set max CU width & height 2329 g_auiLayerMaxCUWidth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUWidth; 2330 g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight; 2331 2332 // compute actual CU depth with respect to config depth and max transform size 2333 g_auiLayerAddCUDepth[layerId] = 0; 2334 while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] ) ) ) g_auiLayerAddCUDepth[layerId]++; 2335 2336 m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId]; 2337 g_auiLayerAddCUDepth[layerId]++; 2338 g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth; 2339 2340 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2341 // set internal bit-depth to constant value to make sure to be updated later 2342 g_bitDepthY = -1; 2343 g_bitDepthC = -1; 2344 2345 g_uiPCMBitDepthLuma = -1; 2346 g_uiPCMBitDepthChroma = -1; 2347 #else 2348 // set internal bit-depth and constants 2349 g_bitDepthY = m_internalBitDepthY; 2350 g_bitDepthC = m_internalBitDepthC; 2351 2352 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; 2353 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; 2354 #endif 2355 } 2356 #else 2251 2357 Void TAppEncCfg::xSetGlobal() 2252 2358 { … … 2278 2384 #endif 2279 2385 } 2386 #endif 2280 2387 2281 2388 Void TAppEncCfg::xPrintParameter() … … 2331 2438 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2332 2439 } 2440 #if !LAYER_CTB 2333 2441 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2334 2442 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 2335 2443 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); 2336 2444 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); 2445 #endif 2337 2446 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 2338 2447 printf("Motion search range : %d\n", m_iSearchRange ); … … 2422 2531 printf("CIP:%d ", m_bUseConstrainedIntraPred); 2423 2532 printf("SAO:%d ", (m_bUseSAO)?(1):(0)); 2533 #if !LAYER_CTB 2424 2534 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 2535 #endif 2425 2536 printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); 2426 2537 … … 2472 2583 } 2473 2584 2474 #if S CALED_REF_LAYER_OFFSETS2585 #if SVC_EXTENSION 2475 2586 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) 2476 2587 { … … 2505 2616 } 2506 2617 } 2507 #endif2508 2618 2509 2619 #if FINAL_RPL_CHANGE_N0082 … … 2721 2831 } 2722 2832 #endif 2833 #endif //SVC_EXTENSION 2723 2834 //! \}
Note: See TracChangeset for help on using the changeset viewer.