Changeset 445 in SHVCSoftware
- Timestamp:
- 7 Nov 2013, 08:07:50 (11 years ago)
- Location:
- branches/SHM-4.0-dev/source
- Files:
-
- 12 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 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h
r442 r445 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) … … 354 356 #endif 355 357 // internal member functions 358 #if LAYER_CTB 359 Void xSetGlobal (UInt layerId); ///< set global variables 360 #else 356 361 Void xSetGlobal (); ///< set global variables 362 #endif 357 363 Void xCheckParameter (); ///< check validity of configuration values 358 364 Void xPrintParameter (); ///< print configuration values … … 390 396 UInt getInternalBitDepthY() {return m_internalBitDepthY; } 391 397 UInt getInternalBitDepthC() {return m_internalBitDepthC; } 398 #if !LAYER_CTB 392 399 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 393 400 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 394 401 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 402 #endif 395 403 Int getDecodingRefreshType() {return m_iDecodingRefreshType; } 396 404 Int getWaveFrontSynchro() { return m_iWaveFrontSynchro; } … … 405 413 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } 406 414 #endif 415 #if LAYER_CTB 416 Bool getUsePCM() { return m_usePCM; } 417 UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } 418 #endif 407 419 #endif 408 420 };// END CLASS DEFINITION TAppEncCfg -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r442 r445 142 142 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 143 143 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 144 #if LAYER_CTB 145 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 146 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 147 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); 148 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); 149 #endif 144 150 printf("QP : %5.2f\n", m_fQP ); 145 151 printf("Intra period : %d\n", m_iIntraPeriod ); … … 157 163 #endif 158 164 printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams); 165 #if LAYER_CTB 166 printf("PCM:%d ", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0); 167 #endif 159 168 } 160 169 … … 175 184 { 176 185 // automatic padding to minimum CU size 186 #if LAYER_CTB 187 Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1); 188 #else 177 189 Int minCuSize = m_cAppEncCfg->getMaxCUHeight() >> (m_cAppEncCfg->getMaxCUDepth() - 1); 190 #endif 178 191 if (m_iSourceWidth % minCuSize) 179 192 { … … 240 253 } 241 254 255 #if LAYER_CTB 256 UInt maxCUWidth = m_uiMaxCUWidth; 257 UInt maxCUHeight = m_uiMaxCUHeight; 258 UInt maxCUDepth = m_uiMaxCUDepth; 259 #else 242 260 UInt maxCUWidth = m_cAppEncCfg->getMaxCUWidth(); 243 261 UInt maxCUHeight = m_cAppEncCfg->getMaxCUHeight(); 244 262 UInt maxCUDepth = m_cAppEncCfg->getMaxCUDepth(); 263 #endif 245 264 bool check_failed = false; /* abort if there is a fatal configuration problem */ 246 265 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) … … 258 277 259 278 260 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + m _cAppEncCfg->getMaxCUHeight() - 1) / m_cAppEncCfg->getMaxCUHeight(): 1;279 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1; 261 280 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); 262 281 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); … … 273 292 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 274 293 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 294 295 #if LAYER_CTB 296 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 297 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 298 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 299 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 300 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 301 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); 302 xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller."); 303 xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize."); 304 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS 305 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS 306 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." ); 307 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." ); 308 xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" ); 309 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" ); 310 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); 311 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" ); 312 313 // max CU width and height should be power of 2 314 UInt ui = m_uiMaxCUWidth; 315 while(ui) 316 { 317 ui >>= 1; 318 if( (ui & 1) == 1) 319 xConfirmPara( ui != 1 , "Width should be 2^n"); 320 } 321 ui = m_uiMaxCUHeight; 322 while(ui) 323 { 324 ui >>= 1; 325 if( (ui & 1) == 1) 326 xConfirmPara( ui != 1 , "Height should be 2^n"); 327 } 328 #endif 329 275 330 #undef xConfirmPara 276 331 return check_failed; -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r442 r445 55 55 Int *m_predLayerIds; 56 56 Int m_numActiveRefLayers; 57 #endif 58 59 #if LAYER_CTB 60 // coding unit (CU) definition 61 UInt m_uiMaxCUWidth; ///< max. CU width in pixel 62 UInt m_uiMaxCUHeight; ///< max. CU height in pixel 63 UInt m_uiMaxCUDepth; ///< max. CU depth 64 65 // transfom unit (TU) definition 66 UInt m_uiQuadtreeTULog2MaxSize; 67 UInt m_uiQuadtreeTULog2MinSize; 68 69 UInt m_uiQuadtreeTUMaxDepthInter; 70 UInt m_uiQuadtreeTUMaxDepthIntra; 57 71 #endif 58 72 … … 163 177 #if N0120_MAX_TID_REF_CFG 164 178 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 165 #endif 179 #endif 180 #if LAYER_CTB 181 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 182 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 183 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 184 #endif 166 185 }; // END CLASS DEFINITION TAppEncLayerCfg 167 186 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
r442 r445 358 358 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 359 359 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 360 #if LAYER_CTB 361 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize ); 362 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize ); 363 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter ); 364 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra ); 365 #else 360 366 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 361 367 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 362 368 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 363 369 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 370 #endif 364 371 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 365 372 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); … … 393 400 m_acTEncTop[layer].setSliceSegmentMode ( m_sliceSegmentMode ); 394 401 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 402 #if LAYER_CTB 403 Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1); 404 #else 395 405 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 406 #endif 396 407 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 397 408 { … … 851 862 for(UInt layer=0; layer<m_numLayers; layer++) 852 863 { 864 #if LAYER_CTB 865 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 866 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 867 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 868 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 869 #endif 853 870 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 854 871 m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1]); … … 882 899 for(UInt layer=0; layer<m_numLayers; layer++) 883 900 { 901 #if LAYER_CTB 902 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 903 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 904 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 905 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 906 #endif 907 884 908 m_acTVideoIOYuvInputFile[layer].close(); 885 909 m_acTVideoIOYuvReconFile[layer].close(); … … 901 925 for(UInt layer=0; layer<m_numLayers; layer++) 902 926 { 927 #if LAYER_CTB 928 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 929 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 930 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 931 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 932 933 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 934 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 935 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 936 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 937 #endif 903 938 m_acTEncTop[layer].init(isFieldCoding); 904 939 } … … 1153 1188 { 1154 1189 #if SVC_UPSAMPLING 1190 #if LAYER_CTB 1191 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 ); 1192 #else 1155 1193 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1194 #endif 1156 1195 #else 1157 1196 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1161 1200 { 1162 1201 #if SVC_UPSAMPLING 1202 #if LAYER_CTB 1203 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 ); 1204 #else 1163 1205 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1206 #endif 1164 1207 #else 1165 1208 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1196 1239 for(UInt layer=0; layer<m_numLayers; layer++) 1197 1240 { 1241 #if LAYER_CTB 1242 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1243 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1244 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1245 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1246 #endif 1247 1198 1248 // get buffers 1199 1249 xGetBuffer(pcPicYuvRec, layer); … … 1263 1313 for(UInt layer=0; layer<m_numLayers; layer++) 1264 1314 { 1315 #if LAYER_CTB 1316 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1317 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1318 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1319 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1320 1321 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 1322 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 1323 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 1324 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 1325 #endif 1265 1326 // call encoding function for one frame 1266 1327 if ( m_isField ) … … 1528 1589 1529 1590 #if SVC_UPSAMPLING 1591 #if LAYER_CTB 1592 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 ); 1593 #else 1530 1594 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1595 #endif 1531 1596 #else 1532 1597 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
r442 r445 4004 4004 uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY); 4005 4005 4006 #if !LAYER_CTB 4006 4007 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4008 #endif 4007 4009 4008 4010 #if SCALED_REF_LAYER_OFFSETS … … 4034 4036 } 4035 4037 4038 #if LAYER_CTB 4039 UInt baseMaxCUHeight = cBaseColPic->getPicSym()->getMaxCUHeight(); 4040 UInt baseMaxCUWidth = cBaseColPic->getPicSym()->getMaxCUWidth(); 4041 UInt baseMinUnitSize = cBaseColPic->getMinCUWidth(); 4042 4043 uiCUAddrBase = ( iBY / cBaseColPic->getPicSym()->getMaxCUHeight() ) * cBaseColPic->getFrameWidthInCU() + ( iBX / cBaseColPic->getPicSym()->getMaxCUWidth() ); 4044 #else 4036 4045 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4046 #endif 4037 4047 4038 4048 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 4039 4049 4050 #if LAYER_CTB 4051 UInt uiRasterAddrBase = ( iBY - (iBY/baseMaxCUHeight)*baseMaxCUHeight ) / baseMinUnitSize * cBaseColPic->getNumPartInWidth() + ( iBX - (iBX/baseMaxCUWidth)*baseMaxCUWidth ) / baseMinUnitSize; 4052 4053 uiAbsPartIdxBase = g_auiLayerRasterToZscan[cBaseColPic->getLayerId()][uiRasterAddrBase]; 4054 #else 4040 4055 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 4041 4056 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 4042 4057 4043 4058 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 4059 #endif 4044 4060 4045 4061 return cBaseColPic->getCU(uiCUAddrBase); -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicSym.h
r442 r445 126 126 TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcTComDataCU[uiCUAddr]; } 127 127 128 #if LAYER_CTB 129 UInt getMaxCUWidth() { return m_uiMaxCUWidth; } 130 UInt getMaxCUHeight() { return m_uiMaxCUHeight; } 131 #endif 132 128 133 #if AVC_SYNTAX 129 134 UInt getMaxCUWidth() { return m_uiMaxCUWidth; } -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r313 r445 90 90 Int numCuInHeight = m_iPicHeight / m_iCuHeight + (m_iPicHeight % m_iCuHeight != 0); 91 91 92 #if LAYER_CTB 93 m_iLumaMarginX = uiMaxCUWidth + 16; // for 16-byte alignment 94 m_iLumaMarginY = uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 95 #else 92 96 m_iLumaMarginX = g_uiMaxCUWidth + 16; // for 16-byte alignment 93 97 m_iLumaMarginY = g_uiMaxCUHeight + 16; // margin for 8-tap filter and infinite padding 98 #endif 94 99 95 100 m_iChromaMarginX = m_iLumaMarginX>>1; -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRom.cpp
r442 r445 86 86 // Data structure related table & variable 87 87 // ==================================================================================================================== 88 88 #if LAYER_CTB 89 UInt g_auiLayerMaxCUWidth[MAX_LAYERS]; 90 UInt g_auiLayerMaxCUHeight[MAX_LAYERS]; 91 UInt g_auiLayerMaxCUDepth[MAX_LAYERS]; 92 UInt g_auiLayerAddCUDepth[MAX_LAYERS]; 93 UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 94 UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 95 UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 96 UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 97 #endif 89 98 UInt g_uiMaxCUWidth = MAX_CU_SIZE; 90 99 UInt g_uiMaxCUHeight = MAX_CU_SIZE; -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TComRom.h
r442 r445 81 81 82 82 // global variable (LCU width/height, max. CU depth) 83 #if LAYER_CTB 84 extern UInt g_auiLayerMaxCUWidth[MAX_LAYERS]; 85 extern UInt g_auiLayerMaxCUHeight[MAX_LAYERS]; 86 extern UInt g_auiLayerMaxCUDepth[MAX_LAYERS]; 87 extern UInt g_auiLayerAddCUDepth[MAX_LAYERS]; 88 extern UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 89 extern UInt g_auiLayerRasterToZscan[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 90 extern UInt g_auiLayerRasterToPelX[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 91 extern UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 92 #endif 83 93 extern UInt g_uiMaxCUWidth; 84 94 extern UInt g_uiMaxCUHeight; -
branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
r442 r445 64 64 #define VERT_MV_CONSTRAINT 1 ///< Vertical MV component constraint flag 65 65 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth 66 #define LAYER_CTB 0 ///< enable layer-specific CTB structure 66 67 67 68 #define ILP_SSH_SIG 1 ///< JCTVC-N0195 proposal 2, JCTVC-N0118: add presence flag in VPS ext to condition inter-layer prediction signaling in slice segment header -
branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
r442 r445 175 175 } 176 176 } 177 178 #if LAYER_CTB 179 memcpy(g_auiLayerZscanToRaster[m_layerId], g_auiZscanToRaster, sizeof( g_auiZscanToRaster ) ); 180 memcpy(g_auiLayerRasterToZscan[m_layerId], g_auiRasterToZscan, sizeof( g_auiRasterToZscan ) ); 181 memcpy(g_auiLayerRasterToPelX[m_layerId], g_auiRasterToPelX, sizeof( g_auiRasterToPelX ) ); 182 memcpy(g_auiLayerRasterToPelY[m_layerId], g_auiRasterToPelY, sizeof( g_auiRasterToPelY ) ); 183 #endif 177 184 } 178 185
Note: See TracChangeset for help on using the changeset viewer.