Changeset 467 in SHVCSoftware for branches/SHM-4.0-dev/source/App
- Timestamp:
- 14 Nov 2013, 00:54:41 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source/App
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.0-dev/source/App/TAppDecoder/TAppDecTop.cpp
r466 r467 242 242 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 243 243 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 244 244 245 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 245 246 -
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 //! \} -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h
r466 r467 150 150 Int m_maxTempLayer; ///< Max temporal layer 151 151 152 #if !LAYER_CTB 152 153 // coding unit (CU) definition 153 154 UInt m_uiMaxCUWidth; ///< max. CU width in pixel … … 161 162 UInt m_uiQuadtreeTUMaxDepthInter; 162 163 UInt m_uiQuadtreeTUMaxDepthIntra; 164 #endif 163 165 164 166 // coding tools (bit-depth) … … 355 357 #endif 356 358 // internal member functions 359 #if LAYER_CTB 360 Void xSetGlobal (UInt layerId); ///< set global variables 361 #else 357 362 Void xSetGlobal (); ///< set global variables 363 #endif 358 364 Void xCheckParameter (); ///< check validity of configuration values 359 365 Void xPrintParameter (); ///< print configuration values … … 399 405 UInt getInternalBitDepthC() {return m_internalBitDepthC; } 400 406 #endif 407 #if !LAYER_CTB 401 408 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 402 409 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 403 410 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 411 #endif 404 412 Int getDecodingRefreshType() {return m_iDecodingRefreshType; } 405 413 Int getWaveFrontSynchro() { return m_iWaveFrontSynchro; } … … 408 416 Char* getBLSyntaxFile() { return m_BLSyntaxFile; } 409 417 #endif 410 #if SCALED_REF_LAYER_OFFSETS411 418 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 412 #endif413 419 #if REPN_FORMAT_IN_VPS 414 420 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } 415 421 #endif 422 #if LAYER_CTB 423 Bool getUsePCM() { return m_usePCM; } 424 UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } 425 #endif 416 426 #endif 417 427 };// END CLASS DEFINITION TAppEncCfg -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r466 r467 38 38 m_confLeft = m_confRight = m_confTop = m_confBottom = 0; 39 39 m_aiPad[1] = m_aiPad[0] = 0; 40 #if SCALED_REF_LAYER_OFFSETS41 40 m_numScaledRefLayerOffsets = 0; 42 41 ::memset(m_scaledRefLayerLeftOffset, 0, sizeof(m_scaledRefLayerLeftOffset)); … … 44 43 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 45 44 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 46 #endif47 45 } 48 46 … … 142 140 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 143 141 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 142 #if LAYER_CTB 143 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 144 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 145 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); 146 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); 147 #endif 144 148 printf("QP : %5.2f\n", m_fQP ); 145 149 printf("Intra period : %d\n", m_iIntraPeriod ); … … 157 161 #endif 158 162 printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams); 163 #if LAYER_CTB 164 printf("PCM:%d ", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0); 165 #endif 159 166 } 160 167 … … 175 182 { 176 183 // automatic padding to minimum CU size 184 #if LAYER_CTB 185 Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1); 186 #else 177 187 Int minCuSize = m_cAppEncCfg->getMaxCUHeight() >> (m_cAppEncCfg->getMaxCUDepth() - 1); 188 #endif 178 189 if (m_iSourceWidth % minCuSize) 179 190 { … … 240 251 } 241 252 253 #if LAYER_CTB 254 UInt maxCUWidth = m_uiMaxCUWidth; 255 UInt maxCUHeight = m_uiMaxCUHeight; 256 UInt maxCUDepth = m_uiMaxCUDepth; 257 #else 242 258 UInt maxCUWidth = m_cAppEncCfg->getMaxCUWidth(); 243 259 UInt maxCUHeight = m_cAppEncCfg->getMaxCUHeight(); 244 260 UInt maxCUDepth = m_cAppEncCfg->getMaxCUDepth(); 261 #endif 245 262 bool check_failed = false; /* abort if there is a fatal configuration problem */ 246 263 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) … … 264 281 265 282 266 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + m _cAppEncCfg->getMaxCUHeight() - 1) / m_cAppEncCfg->getMaxCUHeight(): 1;283 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1; 267 284 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); 268 285 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); … … 279 296 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 280 297 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 298 299 #if LAYER_CTB 300 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 301 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 302 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 303 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 304 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 305 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); 306 xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller."); 307 xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize."); 308 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS 309 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS 310 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." ); 311 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." ); 312 xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" ); 313 xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthInter - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" ); 314 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); 315 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" ); 316 317 // max CU width and height should be power of 2 318 UInt ui = m_uiMaxCUWidth; 319 while(ui) 320 { 321 ui >>= 1; 322 if( (ui & 1) == 1) 323 xConfirmPara( ui != 1 , "Width should be 2^n"); 324 } 325 ui = m_uiMaxCUHeight; 326 while(ui) 327 { 328 ui >>= 1; 329 if( (ui & 1) == 1) 330 xConfirmPara( ui != 1 , "Height should be 2^n"); 331 } 332 #endif 333 281 334 #undef xConfirmPara 282 335 return check_failed; 283 336 } 284 337 285 #endif 338 #endif //SVC_EXTENSION 286 339 287 340 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r466 r467 43 43 Int m_iIntraPeriod; ///< period of I-slice (random access period) 44 44 Double m_fQP; ///< QP value of key-picture (floating point) 45 #if SVC_EXTENSION 45 46 #if VPS_EXTN_DIRECT_REF_LAYERS 46 47 #if M0457_PREDICTION_INDICATIONS … … 55 56 Int *m_predLayerIds; 56 57 Int m_numActiveRefLayers; 58 #endif 59 60 #if LAYER_CTB 61 // coding unit (CU) definition 62 UInt m_uiMaxCUWidth; ///< max. CU width in pixel 63 UInt m_uiMaxCUHeight; ///< max. CU height in pixel 64 UInt m_uiMaxCUDepth; ///< max. CU depth 65 66 // transfom unit (TU) definition 67 UInt m_uiQuadtreeTULog2MaxSize; 68 UInt m_uiQuadtreeTULog2MinSize; 69 70 UInt m_uiQuadtreeTUMaxDepthInter; 71 UInt m_uiQuadtreeTUMaxDepthIntra; 57 72 #endif 58 73 … … 70 85 Int m_maxTidIlRefPicsPlus1; 71 86 #endif 72 #if SVC_EXTENSION73 87 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 74 #endif 88 #endif //SVC_EXTENSION 75 89 76 90 Int m_iQP; ///< QP value of key-picture (integer) … … 78 92 Int* m_aidQP; ///< array of slice QP values 79 93 TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config 80 #if S CALED_REF_LAYER_OFFSETS94 #if SVC_EXTENSION 81 95 Int m_numScaledRefLayerOffsets ; 82 96 Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; … … 84 98 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 85 99 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 86 #endif87 100 #if FINAL_RPL_CHANGE_N0082 88 101 GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer … … 99 112 Int m_repFormatIdx; 100 113 #endif 114 #endif //SVC_EXTENSION 101 115 public: 102 116 TAppEncLayerCfg(); … … 133 147 Int getIntQP() {return m_iQP; } 134 148 Int* getdQPs() {return m_aidQP; } 149 #if SVC_EXTENSION 135 150 #if VPS_EXTN_DIRECT_REF_LAYERS 136 151 #if M0457_PREDICTION_INDICATIONS … … 172 187 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 173 188 #endif 189 #if LAYER_CTB 190 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 191 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 192 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 193 #endif 194 #endif //SVC_EXTENSION 174 195 }; // END CLASS DEFINITION TAppEncLayerCfg 175 196 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
r466 r467 375 375 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 376 376 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 377 #if LAYER_CTB 378 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); 379 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize ); 380 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter ); 381 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra ); 382 #else 377 383 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 378 384 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 379 385 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 380 386 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 387 #endif 381 388 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 382 389 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); … … 417 424 m_acTEncTop[layer].setSliceSegmentMode ( m_sliceSegmentMode ); 418 425 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 426 #if LAYER_CTB 427 Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1); 428 #else 419 429 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 430 #endif 420 431 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 421 432 { … … 574 585 m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 575 586 m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled); 576 #if SCALED_REF_LAYER_OFFSETS577 587 if( layer > 0 ) 578 588 { … … 584 594 } 585 595 } 586 #endif587 596 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 588 597 m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange ); … … 590 599 } 591 600 } 592 #else 601 #else //SVC_EXTENSION 593 602 Void TAppEncTop::xInitLibCfg() 594 603 { … … 864 873 m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 865 874 } 866 #endif 875 #endif //SVC_EXTENSION 867 876 868 877 Void TAppEncTop::xCreateLib() … … 875 884 for(UInt layer=0; layer<m_numLayers; layer++) 876 885 { 886 #if LAYER_CTB 887 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 888 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 889 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 890 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 891 #endif 877 892 #if O0194_DIFFERENT_BITDEPTH_EL_BL 878 893 //2 … … 901 916 m_acTEncTop[layer].create(); 902 917 } 903 #else 918 #else //SVC_EXTENSION 904 919 m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 905 920 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); … … 910 925 // Neo Decoder 911 926 m_cTEncTop.create(); 912 #endif 927 #endif //SVC_EXTENSION 913 928 } 914 929 … … 922 937 for(UInt layer=0; layer<m_numLayers; layer++) 923 938 { 939 #if LAYER_CTB 940 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 941 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 942 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 943 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 944 #endif 945 924 946 m_acTVideoIOYuvInputFile[layer].close(); 925 947 m_acTVideoIOYuvReconFile[layer].close(); … … 927 949 m_acTEncTop[layer].destroy(); 928 950 } 929 #else 951 #else //SVC_EXTENSION 930 952 m_cTVideoIOYuvInputFile.close(); 931 953 m_cTVideoIOYuvReconFile.close(); … … 933 955 // Neo Decoder 934 956 m_cTEncTop.destroy(); 935 #endif 957 #endif //SVC_EXTENSION 936 958 } 937 959 … … 941 963 for(UInt layer=0; layer<m_numLayers; layer++) 942 964 { 965 #if LAYER_CTB 966 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 967 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 968 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 969 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 970 971 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 972 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 973 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 974 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 975 #endif 943 976 #if O0194_DIFFERENT_BITDEPTH_EL_BL 944 977 //3 … … 1058 1091 #endif 1059 1092 // Target output layer 1060 #if VPS_PROFILE_OUTPUT_LAYERS1061 1093 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1062 1094 vps->setNumProfileTierLevel(vps->getNumLayerSets()); … … 1067 1099 vps->setOutputLayerSetIdx(i, i); 1068 1100 } 1069 #else 1070 vps->setNumOutputLayerSets(1); 1071 Int lsIdx = 1; 1072 vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set 1073 #endif 1101 1074 1102 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++) 1075 1103 { … … 1228 1256 { 1229 1257 #if SVC_UPSAMPLING 1258 #if LAYER_CTB 1259 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1260 #else 1230 1261 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1262 #endif 1231 1263 #else 1232 1264 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1236 1268 { 1237 1269 #if SVC_UPSAMPLING 1270 #if LAYER_CTB 1271 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1272 #else 1238 1273 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1274 #endif 1239 1275 #else 1240 1276 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1271 1307 for(UInt layer=0; layer<m_numLayers; layer++) 1272 1308 { 1309 #if LAYER_CTB 1310 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1311 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1312 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1313 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1314 #endif 1273 1315 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1274 1316 //6 … … 1346 1388 for(UInt layer=0; layer<m_numLayers; layer++) 1347 1389 { 1390 #if LAYER_CTB 1391 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1392 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1393 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1394 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1395 1396 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 1397 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 1398 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 1399 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 1400 #endif 1348 1401 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1349 1402 //7 … … 1627 1680 1628 1681 #if SVC_UPSAMPLING 1682 #if LAYER_CTB 1683 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_acLayerCfg[layer].m_uiMaxCUWidth, m_acLayerCfg[layer].m_uiMaxCUHeight, m_acLayerCfg[layer].m_uiMaxCUDepth, NULL ); 1684 #else 1629 1685 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1686 #endif 1630 1687 #else 1631 1688 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );
Note: See TracChangeset for help on using the changeset viewer.