Changeset 466 in SHVCSoftware for branches/SHM-4.0-dev/source/App
- Timestamp:
- 13 Nov 2013, 23:25:47 (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
r442 r466 225 225 if (bNewPicture || !bitstreamFile) 226 226 { 227 #if O0194_DIFFERENT_BITDEPTH_EL_BL 228 //Bug fix: The bit depth was not set correctly for each layer when doing DBF 229 g_bitDepthY = g_bitDepthYLayer[curLayerId]; 230 g_bitDepthC = g_bitDepthCLayer[curLayerId]; 231 #endif 227 232 m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic); 228 233 #if EARLY_REF_PIC_MARKING … … 237 242 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 238 243 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 239 240 244 m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode 241 245 … … 566 570 567 571 #else 572 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 573 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 574 #else 568 575 m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 576 #endif 569 577 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 570 578 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), … … 759 767 760 768 #else 769 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 770 m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 771 #else 761 772 m_cTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), 773 #endif 762 774 conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(), 763 775 conf.getWindowRightOffset() + defDisp.getWindowRightOffset(), -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r464 r466 362 362 Int* cfg_IntraPeriod [MAX_LAYERS]; 363 363 Int* cfg_conformanceMode [MAX_LAYERS]; 364 #if LAYER_CTB365 // coding unit (CU) definition366 UInt* cfg_uiMaxCUWidth[MAX_LAYERS]; ///< max. CU width in pixel367 UInt* cfg_uiMaxCUHeight[MAX_LAYERS]; ///< max. CU height in pixel368 UInt* cfg_uiMaxCUDepth[MAX_LAYERS]; ///< max. CU depth369 370 // transfom unit (TU) definition371 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 #endif377 364 #if VPS_EXTN_DIRECT_REF_LAYERS 378 365 #if M0457_PREDICTION_INDICATIONS … … 392 379 string* cfg_predLayerIdsPtr [MAX_LAYERS]; 393 380 #endif 381 #if SCALED_REF_LAYER_OFFSETS 394 382 string cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; 395 383 string cfg_scaledRefLayerTopOffset [MAX_LAYERS]; … … 402 390 string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; 403 391 string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; 392 #endif 404 393 #if RC_SHVC_HARMONIZATION 405 394 Bool* cfg_RCEnableRateControl [MAX_LAYERS]; … … 411 400 Bool* cfg_RCForceIntraQP [MAX_LAYERS]; 412 401 #endif 402 #if O0194_DIFFERENT_BITDEPTH_EL_BL 403 Int* cfg_InputBitDepthY [MAX_LAYERS]; 404 Int* cfg_InternalBitDepthY [MAX_LAYERS]; 405 Int* cfg_InputBitDepthC [MAX_LAYERS]; 406 Int* cfg_InternalBitDepthC [MAX_LAYERS]; 407 Int* cfg_OutputBitDepthY [MAX_LAYERS]; 408 Int* cfg_OutputBitDepthC [MAX_LAYERS]; 409 #endif 413 410 #if N0120_MAX_TID_REF_CFG 414 411 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; … … 427 424 cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; 428 425 cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; 429 #if LAYER_CTB430 // coding unit (CU) definition431 cfg_uiMaxCUWidth[layer] = &m_acLayerCfg[layer].m_uiMaxCUWidth;432 cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight;433 cfg_uiMaxCUDepth[layer] = &m_acLayerCfg[layer].m_uiMaxCUDepth;434 435 // transfom unit (TU) definition.436 cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize;437 cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize;438 439 cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter;440 cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra;441 #endif442 426 #if VPS_EXTN_DIRECT_REF_LAYERS 443 427 #if M0457_PREDICTION_INDICATIONS … … 453 437 cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; 454 438 #endif 439 #if SCALED_REF_LAYER_OFFSETS 455 440 cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets; 456 441 for(Int i = 0; i < MAX_LAYERS; i++) … … 461 446 cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; 462 447 } 448 #endif 463 449 #if RC_SHVC_HARMONIZATION 464 450 cfg_RCEnableRateControl[layer] = &m_acLayerCfg[layer].m_RCEnableRateControl; … … 470 456 cfg_RCForceIntraQP[layer] = &m_acLayerCfg[layer].m_RCForceIntraQP; 471 457 #endif 458 #if O0194_DIFFERENT_BITDEPTH_EL_BL 459 cfg_InputBitDepthY [layer] = &m_acLayerCfg[layer].m_inputBitDepthY; 460 cfg_InternalBitDepthY[layer] = &m_acLayerCfg[layer].m_internalBitDepthY; 461 cfg_InputBitDepthC [layer] = &m_acLayerCfg[layer].m_inputBitDepthC; 462 cfg_InternalBitDepthC[layer] = &m_acLayerCfg[layer].m_internalBitDepthC; 463 cfg_OutputBitDepthY [layer] = &m_acLayerCfg[layer].m_outputBitDepthY; 464 cfg_OutputBitDepthC [layer] = &m_acLayerCfg[layer].m_outputBitDepthC; 465 #endif 472 466 #if N0120_MAX_TID_REF_CFG 473 467 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; … … 483 477 string cfg_tileSets; 484 478 #endif 485 #else //SVC_EXTENSION479 #else 486 480 string cfg_InputFile; 487 481 string cfg_BitstreamFile; 488 482 string cfg_ReconFile; 489 483 string cfg_dQPFile; 490 #endif //SVC_EXTENSION484 #endif 491 485 string cfg_ColumnWidth; 492 486 string cfg_RowHeight; … … 538 532 #endif 539 533 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") 534 #if !O0194_DIFFERENT_BITDEPTH_EL_BL 540 535 ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") 541 536 ("OutputBitDepth", m_outputBitDepthY, 0, "Bit-depth of output file (default:InternalBitDepth)") … … 545 540 ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 546 541 ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") 542 #endif 543 #if SCALED_REF_LAYER_OFFSETS 547 544 ("NumScaledRefLayerOffsets%d", cfg_numScaledRefLayerOffsets, 0, MAX_LAYERS, "Number of scaled offset layer sets ") 548 545 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" … … 554 551 ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" 555 552 " bottom-right luma sample of the EL picture, in units of two luma samples") 553 #endif 554 #if O0194_DIFFERENT_BITDEPTH_EL_BL 555 ("InputBitDepth%d", cfg_InputBitDepthY, 8, MAX_LAYERS, "Bit-depth of input file for layer %d") 556 ("InternalBitDepth%d", cfg_InternalBitDepthY, 0, MAX_LAYERS, "Bit-depth the codec operates at. (default:InputBitDepth) for layer %d ") 557 // "If different to InputBitDepth, source data will be converted") 558 ("InputBitDepthC%d", cfg_InputBitDepthC, 0, MAX_LAYERS, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d") 559 ("InternalBitDepthC%d", cfg_InternalBitDepthC, 0, MAX_LAYERS, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d") 560 ("OutputBitDepth%d", cfg_OutputBitDepthY, 0, MAX_LAYERS, "Bit-depth of output file (default:InternalBitDepth)") 561 ("OutputBitDepthC%d", cfg_OutputBitDepthC, 0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 562 #endif 556 563 #if N0120_MAX_TID_REF_CFG 557 564 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) … … 569 576 ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices") 570 577 #endif 571 #else //SVC_EXTENSION578 #else 572 579 ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") 573 580 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 590 597 ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") 591 598 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 592 #endif //SVC_EXTENSION599 #endif 593 600 594 601 //Field coding parameters … … 607 614 ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") 608 615 609 #if LAYER_CTB610 // Unit definition parameters611 ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width")612 ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height")613 // todo: remove defaults from MaxCUSize614 ("MaxCUSize%d,s%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size")615 ("MaxCUSize%d,s%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size")616 ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth")617 618 ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")619 ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")620 621 ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")622 ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")623 624 625 // set the same CU realted settings across all the layers if config file parameters are not layer specific626 ("MaxCUWidth", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width")627 ("MaxCUHeight", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height")628 // todo: remove defaults from MaxCUSize629 ("MaxCUSize,s", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size")630 ("MaxCUSize,s", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size")631 ("MaxPartitionDepth,h", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth")632 633 ("QuadtreeTULog2MaxSize", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2")634 ("QuadtreeTULog2MinSize", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2")635 636 ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs")637 ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs")638 #else639 616 // Unit definition parameters 640 617 ("MaxCUWidth", m_uiMaxCUWidth, 64u) … … 650 627 ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") 651 628 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 652 #endif653 629 654 630 // Coding structure paramters … … 974 950 m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); 975 951 #endif 976 #else //SVC_EXTENSION952 #else 977 953 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); 978 954 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 979 955 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 980 956 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); 981 #endif //SVC_EXTENSION957 #endif 982 958 983 959 Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); … … 1038 1014 m_pRowHeight = NULL; 1039 1015 } 1040 #if S VC_EXTENSION1016 #if SCALED_REF_LAYER_OFFSETS 1041 1017 for(Int layer = 0; layer < MAX_LAYERS; layer++) 1042 1018 { … … 1108 1084 } 1109 1085 } 1086 #endif 1110 1087 #if VPS_EXTN_DIRECT_REF_LAYERS 1111 1088 #if M0457_PREDICTION_INDICATIONS … … 1237 1214 } 1238 1215 #endif 1239 #endif //SVC_EXTENSION1240 1216 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); 1241 1217 1242 1218 /* rules for input, output and internal bitdepths as per help text */ 1219 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1220 for(Int layer = 0; layer < MAX_LAYERS; layer++){ 1221 if (!m_acLayerCfg[layer].m_internalBitDepthY) { m_acLayerCfg[layer].m_internalBitDepthY = m_acLayerCfg[layer].m_inputBitDepthY; } 1222 if (!m_acLayerCfg[layer].m_internalBitDepthC) { m_acLayerCfg[layer].m_internalBitDepthC = m_acLayerCfg[layer].m_internalBitDepthY; } 1223 if (!m_acLayerCfg[layer].m_inputBitDepthC) { m_acLayerCfg[layer].m_inputBitDepthC = m_acLayerCfg[layer].m_inputBitDepthY; } 1224 if (!m_acLayerCfg[layer].m_outputBitDepthY) { m_acLayerCfg[layer].m_outputBitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; } 1225 if (!m_acLayerCfg[layer].m_outputBitDepthC) { m_acLayerCfg[layer].m_outputBitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; } 1226 } 1227 #else 1243 1228 if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } 1244 1229 if (!m_internalBitDepthC) { m_internalBitDepthC = m_internalBitDepthY; } … … 1246 1231 if (!m_outputBitDepthY) { m_outputBitDepthY = m_internalBitDepthY; } 1247 1232 if (!m_outputBitDepthC) { m_outputBitDepthC = m_internalBitDepthC; } 1233 #endif 1248 1234 1249 1235 #if !SVC_EXTENSION … … 1457 1443 1458 1444 // set global varibles 1459 #if LAYER_CTB1460 for(Int layer = 0; layer < MAX_LAYERS; layer++)1461 {1462 xSetGlobal(layer);1463 }1464 #else1465 1445 xSetGlobal(); 1466 #endif1467 1446 1468 1447 // print-out parameters … … 1503 1482 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) 1504 1483 // check range of parameters 1484 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1485 for(UInt layer=0; layer<m_numLayers; layer++){ 1486 xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); 1487 xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); 1488 } 1489 #else 1505 1490 xConfirmPara( m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); 1506 1491 xConfirmPara( m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); 1492 #endif 1507 1493 #if !SVC_EXTENSION 1508 1494 xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); … … 1524 1510 xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); 1525 1511 xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); 1526 #if LAYER_CTB1527 for(UInt layer = 0; layer < MAX_LAYERS; layer++)1528 {1529 xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );1530 }1531 #else1532 1512 xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); 1533 #endif1534 1513 1535 1514 xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" ); … … 1545 1524 } 1546 1525 #endif 1547 #if !LAYER_CTB1548 1526 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); 1549 1527 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); 1550 1528 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); 1551 1529 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); 1552 #endif1553 1530 #if !SVC_EXTENSION 1554 1531 xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); … … 1556 1533 #endif 1557 1534 1558 #if !LAYER_CTB1559 1535 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); 1560 1536 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); … … 1570 1546 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); 1571 1547 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" ); 1572 #endif1573 1548 1574 1549 xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); … … 1618 1593 #endif 1619 1594 1620 #if !LAYER_CTB1621 1595 // max CU width and height should be power of 2 1622 1596 UInt ui = m_uiMaxCUWidth; … … 1634 1608 xConfirmPara( ui != 1 , "Height should be 2^n"); 1635 1609 } 1636 #endif 1610 1637 1611 1638 1612 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure … … 2031 2005 Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth; 2032 2006 Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight; 2033 #if LAYER_CTB2034 Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth;2035 Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight;2036 #endif2037 2007 #endif 2038 2008 if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) … … 2279 2249 /** \todo use of global variables should be removed later 2280 2250 */ 2281 #if LAYER_CTB2282 Void TAppEncCfg::xSetGlobal(UInt layerId)2283 {2284 // set max CU width & height2285 g_auiLayerMaxCUWidth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUWidth;2286 g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight;2287 2288 // compute actual CU depth with respect to config depth and max transform size2289 g_auiLayerAddCUDepth[layerId] = 0;2290 while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] ) ) ) g_auiLayerAddCUDepth[layerId]++;2291 2292 m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId];2293 g_auiLayerAddCUDepth[layerId]++;2294 g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth;2295 2296 // set internal bit-depth and constants2297 g_bitDepthY = m_internalBitDepthY;2298 g_bitDepthC = m_internalBitDepthC;2299 2300 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY;2301 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC;2302 }2303 #else2304 2251 Void TAppEncCfg::xSetGlobal() 2305 2252 { … … 2316 2263 g_uiMaxCUDepth = m_uiMaxCUDepth; 2317 2264 2318 // set internal bit-depth and constants 2265 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2266 // set internal bit-depth to constant value to make sure to be updated later 2267 g_bitDepthY = -1; 2268 g_bitDepthC = -1; 2269 2270 g_uiPCMBitDepthLuma = -1; 2271 g_uiPCMBitDepthChroma = -1; 2272 #else 2319 2273 g_bitDepthY = m_internalBitDepthY; 2320 2274 g_bitDepthC = m_internalBitDepthC; … … 2322 2276 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; 2323 2277 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; 2278 #endif 2324 2279 } 2325 #endif2326 2280 2327 2281 Void TAppEncCfg::xPrintParameter() … … 2377 2331 printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); 2378 2332 } 2379 #if !LAYER_CTB2380 2333 printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); 2381 2334 printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); 2382 2335 printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); 2383 2336 printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); 2384 #endif2385 2337 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 2386 2338 printf("Motion search range : %d\n", m_iSearchRange ); … … 2399 2351 printf("QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) ); 2400 2352 printf("GOP size : %d\n", m_iGOPSize ); 2353 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2354 printf("Internal bit depth Layer0 : (Y:%d, C:%d)\n", m_acLayerCfg[0].m_internalBitDepthY, m_acLayerCfg[0].m_internalBitDepthC ); 2355 printf("Internal bit depth Layer1 : (Y:%d, C:%d)\n", m_acLayerCfg[1].m_internalBitDepthY, m_acLayerCfg[1].m_internalBitDepthC ); 2356 #else 2401 2357 printf("Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepthY, m_internalBitDepthC ); 2358 #endif 2402 2359 printf("PCM sample bit depth : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma ); 2403 2360 #if O0215_PHASE_ALIGNMENT … … 2429 2386 2430 2387 printf("TOOL CFG: "); 2388 #if O0194_DIFFERENT_BITDEPTH_EL_BL 2389 printf("IBD0:%d ", g_bitDepthY > m_acLayerCfg[0].m_inputBitDepthY || g_bitDepthC > m_acLayerCfg[0].m_inputBitDepthC); 2390 printf("IBD1:%d ", g_bitDepthY > m_acLayerCfg[1].m_inputBitDepthY || g_bitDepthC > m_acLayerCfg[1].m_inputBitDepthC); 2391 #else 2431 2392 printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); 2393 #endif 2432 2394 printf("HAD:%d ", m_bUseHADME ); 2433 2395 printf("SRD:%d ", m_bUseSBACRD ); … … 2460 2422 printf("CIP:%d ", m_bUseConstrainedIntraPred); 2461 2423 printf("SAO:%d ", (m_bUseSAO)?(1):(0)); 2462 #if !LAYER_CTB2463 2424 printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); 2464 #endif2465 2425 printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); 2466 2426 … … 2494 2454 printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); 2495 2455 #endif 2456 printf("O0194_DIFFERENT_BITDEPTH_EL_BL: %d ", O0194_DIFFERENT_BITDEPTH_EL_BL); 2457 printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT); 2458 printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS); 2459 printf("O0194_REPN_FORMAT_IN_VPS_BUGFIX: %d ",O0194_REPN_FORMAT_IN_VPS_BUGFIX); 2496 2460 printf("\n\n"); 2497 2461 … … 2508 2472 } 2509 2473 2510 #if S VC_EXTENSION2474 #if SCALED_REF_LAYER_OFFSETS 2511 2475 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) 2512 2476 { … … 2541 2505 } 2542 2506 } 2507 #endif 2543 2508 2544 2509 #if FINAL_RPL_CHANGE_N0082 … … 2756 2721 } 2757 2722 #endif 2758 #endif //SVC_EXTENSION2759 2723 //! \} -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h
r464 r466 150 150 Int m_maxTempLayer; ///< Max temporal layer 151 151 152 #if !LAYER_CTB153 152 // coding unit (CU) definition 154 153 UInt m_uiMaxCUWidth; ///< max. CU width in pixel … … 162 161 UInt m_uiQuadtreeTUMaxDepthInter; 163 162 UInt m_uiQuadtreeTUMaxDepthIntra; 164 #endif165 163 166 164 // coding tools (bit-depth) 165 #if !O0194_DIFFERENT_BITDEPTH_EL_BL 167 166 Int m_inputBitDepthY; ///< bit-depth of input file (luma component) 168 167 Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) … … 171 170 Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) 172 171 Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) 173 172 #endif 174 173 // coding tools (PCM bit-depth) 175 174 Bool m_bPCMInputBitDepthFlag; ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth. … … 356 355 #endif 357 356 // internal member functions 358 #if LAYER_CTB359 Void xSetGlobal (UInt layerId); ///< set global variables360 #else361 357 Void xSetGlobal (); ///< set global variables 362 #endif363 358 Void xCheckParameter (); ///< check validity of configuration values 364 359 Void xPrintParameter (); ///< print configuration values … … 397 392 Int getNumLayer() {return m_numLayers; } 398 393 Int getGOPSize() {return m_iGOPSize; } 394 #if O0194_DIFFERENT_BITDEPTH_EL_BL 395 UInt getInternalBitDepthY(Int iLayer) {return m_acLayerCfg[iLayer].m_internalBitDepthY; } 396 UInt getInternalBitDepthC(Int iLayer) {return m_acLayerCfg[iLayer].m_internalBitDepthC; } 397 #else 399 398 UInt getInternalBitDepthY() {return m_internalBitDepthY; } 400 399 UInt getInternalBitDepthC() {return m_internalBitDepthC; } 401 # if !LAYER_CTB400 #endif 402 401 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 403 402 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 404 403 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 405 #endif406 404 Int getDecodingRefreshType() {return m_iDecodingRefreshType; } 407 405 Int getWaveFrontSynchro() { return m_iWaveFrontSynchro; } … … 410 408 Char* getBLSyntaxFile() { return m_BLSyntaxFile; } 411 409 #endif 410 #if SCALED_REF_LAYER_OFFSETS 412 411 Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); 412 #endif 413 413 #if REPN_FORMAT_IN_VPS 414 414 RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } 415 415 #endif 416 #if LAYER_CTB417 Bool getUsePCM() { return m_usePCM; }418 UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; }419 #endif420 416 #endif 421 417 };// END CLASS DEFINITION TAppEncCfg -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r448 r466 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_OFFSETS 40 41 m_numScaledRefLayerOffsets = 0; 41 42 ::memset(m_scaledRefLayerLeftOffset, 0, sizeof(m_scaledRefLayerLeftOffset)); … … 43 44 ::memset(m_scaledRefLayerRightOffset, 0, sizeof(m_scaledRefLayerRightOffset)); 44 45 ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset)); 46 #endif 45 47 } 46 48 … … 140 142 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); 141 143 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); 142 #if LAYER_CTB143 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 #endif148 144 printf("QP : %5.2f\n", m_fQP ); 149 145 printf("Intra period : %d\n", m_iIntraPeriod ); … … 161 157 #endif 162 158 printf("WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_cAppEncCfg->getWaveFrontSynchro(), m_iWaveFrontSubstreams); 163 #if LAYER_CTB164 printf("PCM:%d ", (m_cAppEncCfg->getUsePCM() && (1<<m_cAppEncCfg->getPCMLog2MinSize()) <= m_uiMaxCUWidth)? 1 : 0);165 #endif166 159 } 167 160 … … 182 175 { 183 176 // automatic padding to minimum CU size 184 #if LAYER_CTB185 Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);186 #else187 177 Int minCuSize = m_cAppEncCfg->getMaxCUHeight() >> (m_cAppEncCfg->getMaxCUDepth() - 1); 188 #endif189 178 if (m_iSourceWidth % minCuSize) 190 179 { … … 251 240 } 252 241 253 #if LAYER_CTB254 UInt maxCUWidth = m_uiMaxCUWidth;255 UInt maxCUHeight = m_uiMaxCUHeight;256 UInt maxCUDepth = m_uiMaxCUDepth;257 #else258 242 UInt maxCUWidth = m_cAppEncCfg->getMaxCUWidth(); 259 243 UInt maxCUHeight = m_cAppEncCfg->getMaxCUHeight(); 260 244 UInt maxCUDepth = m_cAppEncCfg->getMaxCUDepth(); 261 #endif262 245 bool check_failed = false; /* abort if there is a fatal configuration problem */ 263 246 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) … … 272 255 } 273 256 257 #if O0194_DIFFERENT_BITDEPTH_EL_BL 258 for(UInt layer = 0; layer < MAX_LAYERS; layer++){ 259 xConfirmPara( m_iQP < -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY(layer) - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 260 } 261 #else 274 262 xConfirmPara( m_iQP < -6 * ((Int)m_cAppEncCfg->getInternalBitDepthY() - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 275 276 277 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + maxCUHeight - 1) / maxCUHeight : 1; 263 #endif 264 265 266 m_iWaveFrontSubstreams = m_cAppEncCfg->getWaveFrontSynchro() ? (m_iSourceHeight + m_cAppEncCfg->getMaxCUHeight() - 1) / m_cAppEncCfg->getMaxCUHeight() : 1; 278 267 xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); 279 268 xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_cAppEncCfg->getWaveFrontSynchro(), "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); … … 290 279 xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); 291 280 xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); 292 293 #if LAYER_CTB294 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8");295 xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8");296 xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16");297 xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16");298 xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater.");299 xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller.");300 xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");301 xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");302 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS303 xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS304 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." );305 xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." );306 xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );307 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" );308 xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );309 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" );310 311 // max CU width and height should be power of 2312 UInt ui = m_uiMaxCUWidth;313 while(ui)314 {315 ui >>= 1;316 if( (ui & 1) == 1)317 xConfirmPara( ui != 1 , "Width should be 2^n");318 }319 ui = m_uiMaxCUHeight;320 while(ui)321 {322 ui >>= 1;323 if( (ui & 1) == 1)324 xConfirmPara( ui != 1 , "Height should be 2^n");325 }326 #endif327 328 281 #undef xConfirmPara 329 282 return check_failed; 330 283 } 331 284 332 #endif //SVC_EXTENSION285 #endif 333 286 334 287 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r448 r466 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_EXTENSION46 45 #if VPS_EXTN_DIRECT_REF_LAYERS 47 46 #if M0457_PREDICTION_INDICATIONS … … 56 55 Int *m_predLayerIds; 57 56 Int m_numActiveRefLayers; 58 #endif59 60 #if LAYER_CTB61 // coding unit (CU) definition62 UInt m_uiMaxCUWidth; ///< max. CU width in pixel63 UInt m_uiMaxCUHeight; ///< max. CU height in pixel64 UInt m_uiMaxCUDepth; ///< max. CU depth65 66 // transfom unit (TU) definition67 UInt m_uiQuadtreeTULog2MaxSize;68 UInt m_uiQuadtreeTULog2MinSize;69 70 UInt m_uiQuadtreeTUMaxDepthInter;71 UInt m_uiQuadtreeTUMaxDepthIntra;72 57 #endif 73 58 … … 85 70 Int m_maxTidIlRefPicsPlus1; 86 71 #endif 72 #if SVC_EXTENSION 87 73 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 88 #endif //SVC_EXTENSION74 #endif 89 75 90 76 Int m_iQP; ///< QP value of key-picture (integer) … … 92 78 Int* m_aidQP; ///< array of slice QP values 93 79 TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config 94 #if S VC_EXTENSION80 #if SCALED_REF_LAYER_OFFSETS 95 81 Int m_numScaledRefLayerOffsets ; 96 82 Int m_scaledRefLayerLeftOffset [MAX_LAYERS]; … … 98 84 Int m_scaledRefLayerRightOffset [MAX_LAYERS]; 99 85 Int m_scaledRefLayerBottomOffset[MAX_LAYERS]; 86 #endif 100 87 #if FINAL_RPL_CHANGE_N0082 101 88 GOPEntry m_GOPListLayer[MAX_GOP]; ///< for layer 89 #endif 90 #if O0194_DIFFERENT_BITDEPTH_EL_BL 91 Int m_inputBitDepthY; ///< bit-depth of input file (luma component) 92 Int m_inputBitDepthC; ///< bit-depth of input file (chroma component) 93 Int m_internalBitDepthY; ///< bit-depth codec operates at in luma (input/output files will be converted) 94 Int m_internalBitDepthC; ///< bit-depth codec operates at in chroma (input/output files will be converted) 95 Int m_outputBitDepthY; ///< bit-depth of output file (luma component) 96 Int m_outputBitDepthC; ///< bit-depth of output file (chroma component) 102 97 #endif 103 98 #if REPN_FORMAT_IN_VPS 104 99 Int m_repFormatIdx; 105 100 #endif 106 #endif //SVC_EXTENSION107 101 public: 108 102 TAppEncLayerCfg(); … … 139 133 Int getIntQP() {return m_iQP; } 140 134 Int* getdQPs() {return m_aidQP; } 141 #if SVC_EXTENSION142 135 #if VPS_EXTN_DIRECT_REF_LAYERS 143 136 #if M0457_PREDICTION_INDICATIONS … … 178 171 #if N0120_MAX_TID_REF_CFG 179 172 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 180 #endif 181 #if LAYER_CTB 182 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } 183 UInt getMaxCUHeight() {return m_uiMaxCUHeight; } 184 UInt getMaxCUDepth() {return m_uiMaxCUDepth; } 185 #endif 186 #endif //SVC_EXTENSION 173 #endif 187 174 }; // END CLASS DEFINITION TAppEncLayerCfg 188 175 -
branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
r464 r466 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2013, ITU/ISO/IEC … … 117 117 } 118 118 119 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 119 assert( m_acLayerCfg[layer].getRepFormatIdx() != -1 && "RepFormatIdx not assigned for a layer" ); 120 120 vps->setVpsRepFormatIdx( layer, m_acLayerCfg[layer].getRepFormatIdx() ); 121 121 maxRepFormatIdx = std::max( m_acLayerCfg[layer].getRepFormatIdx(), maxRepFormatIdx ); … … 141 141 for(UInt idx=0; idx < vps->getVpsNumRepFormats(); idx++) 142 142 { 143 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 143 RepFormat *repFormat = vps->getVpsRepFormat( idx ); 144 144 repFormat->setPicWidthVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth() ); 145 145 repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight() ); 146 146 repFormat->setChromaFormatVpsIdc ( 1 ); // Need modification to change for each layer - corresponds to 420 147 147 repFormat->setSeparateColourPlaneVpsFlag( 0 ); // Need modification to change for each layer 148 #if O0194_REPN_FORMAT_IN_VPS_BUGFIX 149 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY(mapIdxToLayer[idx]) ); // Need modification to change for each layer 150 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC(mapIdxToLayer[idx]) ); // Need modification to change for each layer 151 #else 148 152 repFormat->setBitDepthVpsLuma ( getInternalBitDepthY() ); // Need modification to change for each layer 149 153 repFormat->setBitDepthVpsChroma ( getInternalBitDepthC() ); // Need modification to change for each layer 154 #endif 150 155 } 151 156 delete [] mapIdxToLayer; … … 153 158 for(UInt layer=0; layer<m_numLayers; layer++) 154 159 { 160 #if O0194_DIFFERENT_BITDEPTH_EL_BL 161 //1 162 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 163 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 164 165 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 166 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 167 168 // Set this to be used in Upsampling filter in function "TComUpsampleFilter::upsampleBasePic" 169 g_bitDepthYLayer[layer] = g_bitDepthY; 170 g_bitDepthCLayer[layer] = g_bitDepthC; 171 #endif 155 172 //m_acTEncTop[layer].setVPS(&vps); 156 173 m_acTEncTop[layer].setFrameRate ( m_acLayerCfg[layer].getFrameRate() ); … … 187 204 #endif 188 205 #endif 189 // set layer ID 190 m_acTEncTop[layer].setLayerId ( layer ); 206 // set layer ID 207 m_acTEncTop[layer].setLayerId ( layer ); 191 208 m_acTEncTop[layer].setNumLayer ( m_numLayers ); 192 209 m_acTEncTop[layer].setLayerEnc(m_apcTEncTop); … … 220 237 if (layer<m_numLayers-1) 221 238 { 222 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 223 } 224 #endif 239 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 240 } 241 #endif 225 242 #if VPS_EXTN_DIRECT_REF_LAYERS 226 243 if(layer) … … 241 258 else 242 259 { 243 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 260 m_acTEncTop[layer].setNumSamplePredRefLayers ( m_acLayerCfg[layer].getNumSamplePredRefLayers() ); 244 261 for(Int i = 0; i < m_acTEncTop[layer].getNumSamplePredRefLayers(); i++) 245 262 { 246 263 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i)); 247 264 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true); 248 } 265 } 249 266 } 250 267 if(m_acLayerCfg[layer].getNumMotionPredRefLayers() == -1) … … 257 274 else 258 275 { 259 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 276 m_acTEncTop[layer].setNumMotionPredRefLayers ( m_acLayerCfg[layer].getNumMotionPredRefLayers() ); 260 277 for(Int i = 0; i < m_acTEncTop[layer].getNumMotionPredRefLayers(); i++) 261 278 { 262 279 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 263 280 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true); 264 } 281 } 265 282 } 266 283 Int numDirectRefLayers = 0; … … 283 300 else 284 301 { 285 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 302 m_acTEncTop[layer].setNumDirectRefLayers ( m_acLayerCfg[layer].getNumDirectRefLayers() ); 286 303 for(Int i = 0; i < m_acTEncTop[layer].getNumDirectRefLayers(); i++) 287 304 { … … 304 321 else 305 322 { 306 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 323 m_acTEncTop[layer].setNumActiveRefLayers ( m_acLayerCfg[layer].getNumActiveRefLayers() ); 307 324 for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++) 308 325 { … … 358 375 m_acTEncTop[layer].setUseRDOQTS ( m_useRDOQTS ); 359 376 m_acTEncTop[layer].setRDpenalty ( m_rdPenalty ); 360 #if LAYER_CTB361 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 #else366 377 m_acTEncTop[layer].setQuadtreeTULog2MaxSize ( m_uiQuadtreeTULog2MaxSize ); 367 378 m_acTEncTop[layer].setQuadtreeTULog2MinSize ( m_uiQuadtreeTULog2MinSize ); 368 379 m_acTEncTop[layer].setQuadtreeTUMaxDepthInter ( m_uiQuadtreeTUMaxDepthInter ); 369 380 m_acTEncTop[layer].setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 370 #endif371 381 m_acTEncTop[layer].setUseFastEnc ( m_bUseFastEnc ); 372 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 382 m_acTEncTop[layer].setUseEarlyCU ( m_bUseEarlyCU ); 373 383 m_acTEncTop[layer].setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 374 384 m_acTEncTop[layer].setUseCbfFastMode ( m_bUseCbfFastMode ); … … 390 400 m_acTEncTop[layer].setUseWP ( m_useWeightedPred ); 391 401 m_acTEncTop[layer].setWPBiPred ( m_useWeightedBiPred ); 402 #if O0194_WEIGHTED_PREDICTION_CGS 403 if (layer!=0){ 404 // Enable weighted prediction for enhancement layer 405 m_acTEncTop[layer].setUseWP ( true ); 406 m_acTEncTop[layer].setWPBiPred ( true ); 407 } 408 #endif 392 409 //====== Parallel Merge Estimation ======== 393 410 m_acTEncTop[layer].setLog2ParallelMergeLevelMinus2 ( m_log2ParallelMergeLevel - 2 ); … … 400 417 m_acTEncTop[layer].setSliceSegmentMode ( m_sliceSegmentMode ); 401 418 m_acTEncTop[layer].setSliceSegmentArgument ( m_sliceSegmentArgument ); 402 #if LAYER_CTB403 Int iNumPartInCU = 1<<(m_acLayerCfg[layer].m_uiMaxCUDepth<<1);404 #else405 419 Int iNumPartInCU = 1<<(m_uiMaxCUDepth<<1); 406 #endif407 420 if(m_sliceSegmentMode==FIXED_NUMBER_OF_LCU) 408 421 { … … 428 441 m_acTEncTop[layer].setSaoLcuBoundary (m_saoLcuBoundary); 429 442 m_acTEncTop[layer].setSaoLcuBasedOptimization (m_saoLcuBasedOptimization); 430 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 431 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 443 m_acTEncTop[layer].setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 444 m_acTEncTop[layer].setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 432 445 433 446 m_acTEncTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); … … 494 507 if(uiTilesCount == 1) 495 508 { 496 m_bLFCrossTileBoundaryFlag = true; 509 m_bLFCrossTileBoundaryFlag = true; 497 510 } 498 511 m_acTEncTop[layer].setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); … … 530 543 m_acTEncTop[layer].setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 531 544 m_acTEncTop[layer].setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 532 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 545 m_acTEncTop[layer].setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 533 546 m_acTEncTop[layer].setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 534 547 m_acTEncTop[layer].setAspectRatioIdc( m_aspectRatioIdc ); … … 561 574 m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 562 575 m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled); 576 #if SCALED_REF_LAYER_OFFSETS 563 577 if( layer > 0 ) 564 578 { … … 567 581 { 568 582 m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i], 569 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 570 } 571 } 583 2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]); 584 } 585 } 586 #endif 572 587 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 573 588 m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange ); … … 575 590 } 576 591 } 577 #else //SVC_EXTENSION592 #else 578 593 Void TAppEncTop::xInitLibCfg() 579 594 { … … 680 695 m_cTEncTop.setQuadtreeTUMaxDepthIntra ( m_uiQuadtreeTUMaxDepthIntra ); 681 696 m_cTEncTop.setUseFastEnc ( m_bUseFastEnc ); 682 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 697 m_cTEncTop.setUseEarlyCU ( m_bUseEarlyCU ); 683 698 m_cTEncTop.setUseFastDecisionForMerge ( m_useFastDecisionForMerge ); 684 699 m_cTEncTop.setUseCbfFastMode ( m_bUseCbfFastMode ); … … 734 749 m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary); 735 750 m_cTEncTop.setSaoLcuBasedOptimization (m_saoLcuBasedOptimization); 736 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 737 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 751 m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag); 752 m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag); 738 753 739 754 m_cTEncTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); … … 792 807 if(uiTilesCount == 1) 793 808 { 794 m_bLFCrossTileBoundaryFlag = true; 809 m_bLFCrossTileBoundaryFlag = true; 795 810 } 796 811 m_cTEncTop.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); … … 818 833 m_cTEncTop.setUseRecalculateQPAccordingToLambda( m_recalculateQPAccordingToLambda ); 819 834 m_cTEncTop.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing ); 820 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 835 m_cTEncTop.setActiveParameterSetsSEIEnabled ( m_activeParameterSetsSEIEnabled ); 821 836 m_cTEncTop.setVuiParametersPresentFlag( m_vuiParametersPresentFlag ); 822 837 m_cTEncTop.setAspectRatioIdc( m_aspectRatioIdc ); … … 849 864 m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical ); 850 865 } 851 #endif //SVC_EXTENSION866 #endif 852 867 853 868 Void TAppEncTop::xCreateLib() … … 860 875 for(UInt layer=0; layer<m_numLayers; layer++) 861 876 { 862 #if LAYER_CTB 863 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 864 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 865 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 866 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 867 #endif 877 #if O0194_DIFFERENT_BITDEPTH_EL_BL 878 //2 879 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 880 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 881 882 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 883 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 884 #endif 885 #if O0194_DIFFERENT_BITDEPTH_EL_BL 886 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_acLayerCfg[layer].m_inputBitDepthY, m_acLayerCfg[layer].m_inputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // read mode 887 #else 868 888 m_acTVideoIOYuvInputFile[layer].open( (Char *)m_acLayerCfg[layer].getInputFile().c_str(), false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 889 #endif 869 890 m_acTVideoIOYuvInputFile[layer].skipFrames(m_FrameSkip, m_acLayerCfg[layer].getSourceWidth() - m_acLayerCfg[layer].getPad()[0], m_acLayerCfg[layer].getSourceHeight() - m_acLayerCfg[layer].getPad()[1]); 870 891 871 892 if (!m_acLayerCfg[layer].getReconFile().empty()) 872 893 { 894 #if O0194_DIFFERENT_BITDEPTH_EL_BL 895 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_acLayerCfg[layer].m_outputBitDepthY, m_acLayerCfg[layer].m_outputBitDepthC, m_acLayerCfg[layer].m_internalBitDepthY, m_acLayerCfg[layer].m_internalBitDepthC ); // write mode 896 #else 873 897 m_acTVideoIOYuvReconFile[layer].open((Char *)m_acLayerCfg[layer].getReconFile().c_str(), true, m_outputBitDepthY, m_outputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // write mode 898 #endif 874 899 } 875 900 876 901 m_acTEncTop[layer].create(); 877 902 } 878 #else //SVC_EXTENSION903 #else 879 904 m_cTVideoIOYuvInputFile.open( m_pchInputFile, false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC ); // read mode 880 905 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]); … … 885 910 // Neo Decoder 886 911 m_cTEncTop.create(); 887 #endif //SVC_EXTENSION912 #endif 888 913 } 889 914 … … 897 922 for(UInt layer=0; layer<m_numLayers; layer++) 898 923 { 899 #if LAYER_CTB900 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer];901 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer];902 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer];903 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer];904 #endif905 906 924 m_acTVideoIOYuvInputFile[layer].close(); 907 925 m_acTVideoIOYuvReconFile[layer].close(); … … 909 927 m_acTEncTop[layer].destroy(); 910 928 } 911 #else //SVC_EXTENSION929 #else 912 930 m_cTVideoIOYuvInputFile.close(); 913 931 m_cTVideoIOYuvReconFile.close(); … … 915 933 // Neo Decoder 916 934 m_cTEncTop.destroy(); 917 #endif //SVC_EXTENSION935 #endif 918 936 } 919 937 … … 923 941 for(UInt layer=0; layer<m_numLayers; layer++) 924 942 { 925 #if LAYER_CTB 926 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 927 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 928 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 929 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 930 931 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 932 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 933 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 934 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 943 #if O0194_DIFFERENT_BITDEPTH_EL_BL 944 //3 945 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 946 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 947 948 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 949 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 935 950 #endif 936 951 m_acTEncTop[layer].init(isFieldCoding); … … 948 963 for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 949 964 { 965 #if O0194_DIFFERENT_BITDEPTH_EL_BL 966 //4 967 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 968 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 969 970 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 971 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 972 #endif 950 973 vps->setLayerIdIncludedFlag(true, setId, layerId); 951 974 } … … 963 986 vps->setScalabilityMask(i, false); 964 987 } 965 if(m_numLayers > 1) 988 if(m_numLayers > 1) 966 989 { 967 990 Int scalabilityTypes = 0; … … 996 1019 #if N0120_MAX_TID_REF_CFG 997 1020 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); 998 #else 1021 #else 999 1022 vps->setMaxTidRefPresentFlag(true); 1000 #endif 1023 #endif 1001 1024 if (vps->getMaxTidRefPresentFlag()) 1002 1025 { … … 1004 1027 { 1005 1028 #if N0120_MAX_TID_REF_CFG 1006 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1007 #else 1029 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1030 #else 1008 1031 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1); 1009 #endif 1032 #endif 1010 1033 } 1011 1034 } … … 1017 1040 } 1018 1041 } 1019 #endif 1042 #endif 1020 1043 #if ILP_SSH_SIG 1021 1044 #if ILP_SSH_SIG_FIX … … 1035 1058 #endif 1036 1059 // Target output layer 1037 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1038 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1060 #if VPS_PROFILE_OUTPUT_LAYERS 1061 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1062 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1039 1063 vps->setDefaultOneTargetOutputLayerFlag(true); 1040 1064 for(i = 1; i < vps->getNumLayerSets(); i++) 1041 1065 { 1042 1066 vps->setProfileLevelTierIdx(i, i); 1043 vps->setOutputLayerSetIdx(i, i); 1044 } 1045 1067 vps->setOutputLayerSetIdx(i, i); 1068 } 1069 #else 1070 vps->setNumOutputLayerSets(1); 1071 Int lsIdx = 1; 1072 vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set 1073 #endif 1046 1074 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++) 1047 1075 { 1048 // Include the highest layer as output layer 1076 // Include the highest layer as output layer 1049 1077 for(UInt layer=0; layer <= vps->getMaxLayerId() ; layer++) 1050 1078 { … … 1105 1133 #endif 1106 1134 #endif 1107 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1108 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1109 #endif 1110 #if N0147_IRAP_ALIGN_FLAG 1111 vps->setCrossLayerIrapAlignFlag(true); 1135 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1136 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); 1137 #endif 1138 #if N0147_IRAP_ALIGN_FLAG 1139 vps->setCrossLayerIrapAlignFlag(true); 1112 1140 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1113 1141 { … … 1115 1143 { 1116 1144 if (vps->getDirectDependencyFlag( layerCtr, refLayerCtr)) 1117 { 1145 { 1118 1146 if(m_acTEncTop[layerCtr].getIntraPeriod() != m_acTEncTop[refLayerCtr].getIntraPeriod()) 1119 1147 { … … 1129 1157 vps->setCrossLayerIrapAlignFlag(false); 1130 1158 } 1131 #endif 1159 #endif 1132 1160 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1133 1161 vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false); … … 1187 1215 for(UInt layer=0; layer<m_numLayers; layer++) 1188 1216 { 1217 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1218 //5 1219 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1220 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1221 1222 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1223 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1224 #endif 1189 1225 // allocate original YUV buffer 1190 1226 pcPicYuvOrg[layer] = new TComPicYuv; … … 1192 1228 { 1193 1229 #if SVC_UPSAMPLING 1194 #if LAYER_CTB1195 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 );1196 #else1197 1230 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1198 #endif1199 1231 #else 1200 1232 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeightOrg(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1204 1236 { 1205 1237 #if SVC_UPSAMPLING 1206 #if LAYER_CTB1207 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 );1208 #else1209 1238 pcPicYuvOrg[layer]->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1210 #endif1211 1239 #else 1212 1240 pcPicYuvOrg->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1237 1265 while ( !bEos ) 1238 1266 { 1239 // Read enough frames 1267 // Read enough frames 1240 1268 Bool bFramesReadyToCode = false; 1241 1269 while(!bFramesReadyToCode) … … 1243 1271 for(UInt layer=0; layer<m_numLayers; layer++) 1244 1272 { 1245 #if LAYER_CTB 1246 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1247 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1248 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1249 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1250 #endif 1251 1273 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1274 //6 1275 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1276 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1277 1278 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1279 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1280 #endif 1252 1281 // get buffers 1253 1282 xGetBuffer(pcPicYuvRec, layer); … … 1311 1340 #endif 1312 1341 1313 // loop through frames in one GOP 1342 // loop through frames in one GOP 1314 1343 for ( UInt iPicIdInGOP=0; iPicIdInGOP < (bFirstFrame? 1:m_iGOPSize); iPicIdInGOP++ ) 1315 1344 { … … 1317 1346 for(UInt layer=0; layer<m_numLayers; layer++) 1318 1347 { 1319 #if LAYER_CTB 1320 g_uiMaxCUWidth = g_auiLayerMaxCUWidth[layer]; 1321 g_uiMaxCUHeight = g_auiLayerMaxCUHeight[layer]; 1322 g_uiMaxCUDepth = g_auiLayerMaxCUDepth[layer]; 1323 g_uiAddCUDepth = g_auiLayerAddCUDepth[layer]; 1324 1325 memcpy( g_auiZscanToRaster, g_auiLayerZscanToRaster[layer], sizeof( g_auiZscanToRaster ) ); 1326 memcpy( g_auiRasterToZscan, g_auiLayerRasterToZscan[layer], sizeof( g_auiRasterToZscan ) ); 1327 memcpy( g_auiRasterToPelX, g_auiLayerRasterToPelX[layer], sizeof( g_auiRasterToPelX ) ); 1328 memcpy( g_auiRasterToPelY, g_auiLayerRasterToPelY[layer], sizeof( g_auiRasterToPelY ) ); 1348 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1349 //7 1350 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1351 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1352 1353 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1354 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1329 1355 #endif 1330 1356 // call encoding function for one frame … … 1353 1379 for(UInt layer=0; layer<m_numLayers; layer++) 1354 1380 { 1381 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1382 //8 1383 g_bitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; 1384 g_bitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; 1385 1386 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthY : m_acLayerCfg[layer].m_internalBitDepthY; 1387 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layer].m_inputBitDepthC : m_acLayerCfg[layer].m_internalBitDepthC; 1388 #endif 1355 1389 // write bistream to file if necessary 1356 1390 iNumEncoded = m_acTEncTop[layer].getNumPicRcvd(); … … 1593 1627 1594 1628 #if SVC_UPSAMPLING 1595 #if LAYER_CTB1596 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 );1597 #else1598 1629 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth, NULL ); 1599 #endif1600 1630 #else 1601 1631 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); … … 1620 1650 delete pcPicYuvRec; pcPicYuvRec = NULL; 1621 1651 } 1622 } 1652 } 1623 1653 } 1624 1654 … … 1671 1701 #endif 1672 1702 { 1673 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1703 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 1674 1704 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 1675 1705 } … … 1691 1721 for ( i = 0; i < iNumEncoded/2; i++ ) 1692 1722 #endif 1693 { 1723 { 1694 1724 const AccessUnit& auTop = *(iterBitstream++); 1695 1725 const vector<UInt>& statsTop = writeAnnexB(bitstreamFile, auTop);
Note: See TracChangeset for help on using the changeset viewer.