Changeset 445 in SHVCSoftware for branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
- Timestamp:
- 7 Nov 2013, 08:07:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r442 r445 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 … … 416 429 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 417 430 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 431 #if LAYER_CTB 432 // coding unit (CU) definition 433 cfg_uiMaxCUWidth[layer] = &m_acLayerCfg[layer].m_uiMaxCUWidth; 434 cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight; 435 cfg_uiMaxCUDepth[layer] = &m_acLayerCfg[layer].m_uiMaxCUDepth; 436 437 // transfom unit (TU) definition. 438 cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize; 439 cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize; 440 441 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter; 442 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra; 443 #endif 418 444 #if VPS_EXTN_DIRECT_REF_LAYERS 419 445 #if M0457_PREDICTION_INDICATIONS … … 585 611 ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") 586 612 613 #if LAYER_CTB 614 // Unit definition parameters 615 ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width") 616 ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height") 617 // todo: remove defaults from MaxCUSize 618 ("MaxCUSize%d,s%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size") 619 ("MaxCUSize%d,s%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size") 620 ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth") 621 622 ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2") 623 ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2") 624 625 ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs") 626 ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs") 627 628 629 // set the same CU realted settings across all the layers if config file parameters are not layer specific 630 ("MaxCUWidth", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width") 631 ("MaxCUHeight", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height") 632 // todo: remove defaults from MaxCUSize 633 ("MaxCUSize,s", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size") 634 ("MaxCUSize,s", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size") 635 ("MaxPartitionDepth,h", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth") 636 637 ("QuadtreeTULog2MaxSize", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2") 638 ("QuadtreeTULog2MinSize", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2") 639 640 ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs") 641 ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs") 642 #else 587 643 // Unit definition parameters 588 644 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 598 654 ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") 599 655 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 656 #endif 600 657 601 658 // Coding structure paramters … … 1411 1468 1412 1469 // set global varibles 1470 #if LAYER_CTB 1471 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1472 { 1473 xSetGlobal(layer); 1474 } 1475 #else 1413 1476 xSetGlobal(); 1477 #endif 1414 1478 1415 1479 // print-out parameters … … 1471 1535 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 1472 1536 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); 1537 #if LAYER_CTB 1538 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1539 { 1540 xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 1541 } 1542 #else 1473 1543 xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 1544 #endif 1474 1545 1475 1546 xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" ); … … 1485 1556 } 1486 1557 #endif 1558 #if !LAYER_CTB 1487 1559 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 1488 1560 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 1489 1561 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 1490 1562 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 1563 #endif 1491 1564 #if !SVC_EXTENSION 1492 1565 xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); … … 1494 1567 #endif 1495 1568 1569 #if !LAYER_CTB 1496 1570 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 1497 1571 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); … … 1507 1581 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); 1508 1582 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" ); 1583 #endif 1509 1584 1510 1585 xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); … … 1554 1629 #endif 1555 1630 1631 #if !LAYER_CTB 1556 1632 // max CU width and height should be power of 2 1557 1633 UInt ui = m_uiMaxCUWidth; … … 1569 1645 xConfirmPara( ui != 1 , "Height should be 2^n"); 1570 1646 } 1571 1647 #endif 1572 1648 1573 1649 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure … … 1966 2042 Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth; 1967 2043 Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight; 2044 #if LAYER_CTB 2045 Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth; 2046 Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight; 2047 #endif 1968 2048 #endif 1969 2049 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 2210 2290 /** \todo use of global variables should be removed later 2211 2291 */ 2292 #if LAYER_CTB 2293 Void TAppEncCfg::xSetGlobal(UInt layerId) 2294 { 2295 // set max CU width & height 2296 g_auiLayerMaxCUWidth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUWidth; 2297 g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight; 2298 2299 // compute actual CU depth with respect to config depth and max transform size 2300 g_auiLayerAddCUDepth[layerId] = 0; 2301 while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] ) ) ) g_auiLayerAddCUDepth[layerId]++; 2302 2303 m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId]; 2304 g_auiLayerAddCUDepth[layerId]++; 2305 g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth; 2306 2307 // set internal bit-depth and constants 2308 g_bitDepthY = m_internalBitDepthY; 2309 g_bitDepthC = m_internalBitDepthC; 2310 2311 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; 2312 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; 2313 } 2314 #else 2212 2315 Void TAppEncCfg::xSetGlobal() 2213 2316 { … … 2231 2334 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; 2232 2335 } 2336 #endif 2233 2337 2234 2338 Void TAppEncCfg::xPrintParameter() … … 2284 2388 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2285 2389 } 2390 #if !LAYER_CTB 2286 2391 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2287 2392 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 2288 2393 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); 2289 2394 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); 2395 #endif 2290 2396 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 2291 2397 printf("Motion search range : %d\n", m_iSearchRange ); … … 2362 2468 printf("CIP:%d ", m_bUseConstrainedIntraPred); 2363 2469 printf("SAO:%d ", (m_bUseSAO)?(1):(0)); 2470 #if !LAYER_CTB 2364 2471 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 2472 #endif 2365 2473 printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); 2366 2474
Note: See TracChangeset for help on using the changeset viewer.