Changeset 815 in SHVCSoftware
- Timestamp:
- 30 Jun 2014, 06:13:06 (11 years ago)
- Location:
- trunk
- Files:
-
- 50 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-6-dev merged: 715-751,753-814
- Property svn:mergeinfo changed
-
trunk/SHM.xcodeproj/project.pbxproj
r125 r815 131 131 71AD603A11EBC28D00F5F1FE /* libTLibEncoder.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6767961911AD626F00421804 /* libTLibEncoder.a */; }; 132 132 71AD603B11EBC29600F5F1FE /* libTLibVideoIO.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6767964B11AD629200421804 /* libTLibVideoIO.a */; }; 133 C3D5A69A190AD6DA005E0EBE /* TCom3DAsymLUT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3D5A698190AD6DA005E0EBE /* TCom3DAsymLUT.cpp */; }; 134 C3D5A69B190AD6DA005E0EBE /* TCom3DAsymLUT.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D5A699190AD6DA005E0EBE /* TCom3DAsymLUT.h */; }; 135 C3D5A69E190AD6F8005E0EBE /* TEnc3DAsymLUT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C3D5A69C190AD6F8005E0EBE /* TEnc3DAsymLUT.cpp */; }; 136 C3D5A69F190AD6F8005E0EBE /* TEnc3DAsymLUT.h in Headers */ = {isa = PBXBuildFile; fileRef = C3D5A69D190AD6F8005E0EBE /* TEnc3DAsymLUT.h */; }; 133 137 DB7795C213F1226500C92469 /* TEncPic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DB7795BE13F1226500C92469 /* TEncPic.cpp */; }; 134 138 DB7795C313F1226500C92469 /* TEncPic.h in Headers */ = {isa = PBXBuildFile; fileRef = DB7795BF13F1226500C92469 /* TEncPic.h */; }; … … 340 344 7184647513FAE75800747BF9 /* program_options_lite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = program_options_lite.cpp; path = source/Lib/TAppCommon/program_options_lite.cpp; sourceTree = "<group>"; }; 341 345 7184647613FAE75800747BF9 /* program_options_lite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = program_options_lite.h; path = source/Lib/TAppCommon/program_options_lite.h; sourceTree = "<group>"; }; 346 C3D5A698190AD6DA005E0EBE /* TCom3DAsymLUT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TCom3DAsymLUT.cpp; path = source/Lib/TLibCommon/TCom3DAsymLUT.cpp; sourceTree = "<group>"; }; 347 C3D5A699190AD6DA005E0EBE /* TCom3DAsymLUT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TCom3DAsymLUT.h; path = source/Lib/TLibCommon/TCom3DAsymLUT.h; sourceTree = "<group>"; }; 348 C3D5A69C190AD6F8005E0EBE /* TEnc3DAsymLUT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TEnc3DAsymLUT.cpp; path = source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp; sourceTree = "<group>"; }; 349 C3D5A69D190AD6F8005E0EBE /* TEnc3DAsymLUT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TEnc3DAsymLUT.h; path = source/Lib/TLibEncoder/TEnc3DAsymLUT.h; sourceTree = "<group>"; }; 342 350 DB7795BE13F1226500C92469 /* TEncPic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TEncPic.cpp; path = source/Lib/TLibEncoder/TEncPic.cpp; sourceTree = "<group>"; }; 343 351 DB7795BF13F1226500C92469 /* TEncPic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TEncPic.h; path = source/Lib/TLibEncoder/TEncPic.h; sourceTree = "<group>"; }; … … 464 472 isa = PBXGroup; 465 473 children = ( 474 C3D5A698190AD6DA005E0EBE /* TCom3DAsymLUT.cpp */, 475 C3D5A699190AD6DA005E0EBE /* TCom3DAsymLUT.h */, 466 476 6B635E7516E5EAB60057B313 /* TComUpsampleFilter.h */, 467 477 6B635E7616E5EAB60057B313 /* TComUpsampleFilter.cpp */, … … 563 573 isa = PBXGroup; 564 574 children = ( 575 C3D5A69C190AD6F8005E0EBE /* TEnc3DAsymLUT.cpp */, 576 C3D5A69D190AD6F8005E0EBE /* TEnc3DAsymLUT.h */, 565 577 71206CD916066EDD00A354E7 /* SyntaxElementWriter.cpp */, 566 578 71206CDA16066EDD00A354E7 /* SyntaxElementWriter.h */, … … 670 682 676795D211AD61FC00421804 /* TComList.h in Headers */, 671 683 676795D411AD61FC00421804 /* TComLoopFilter.h in Headers */, 684 C3D5A69B190AD6DA005E0EBE /* TCom3DAsymLUT.h in Headers */, 672 685 676795D611AD61FC00421804 /* TComMotionInfo.h in Headers */, 673 686 676795D911AD61FC00421804 /* TComPattern.h in Headers */, … … 685 698 671E0D4C11B6AD8C00F3747B /* ContextModel3DBuffer.h in Headers */, 686 699 671E0D4F11B6AD8C00F3747B /* TComBitCounter.h in Headers */, 700 C3D5A69F190AD6F8005E0EBE /* TEnc3DAsymLUT.h in Headers */, 687 701 671E0D5111B6AD8C00F3747B /* TComCABACTables.h in Headers */, 688 702 671E0D5211B6AD8C00F3747B /* TComMv.h in Headers */, … … 932 946 buildActionMask = 2147483647; 933 947 files = ( 948 C3D5A69E190AD6F8005E0EBE /* TEnc3DAsymLUT.cpp in Sources */, 934 949 676795CE11AD61FC00421804 /* TComBitStream.cpp in Sources */, 935 950 676795D011AD61FC00421804 /* TComDataCU.cpp in Sources */, … … 939 954 676795DA11AD61FC00421804 /* TComPic.cpp in Sources */, 940 955 676795DC11AD61FC00421804 /* TComPicSym.cpp in Sources */, 956 C3D5A69A190AD6DA005E0EBE /* TCom3DAsymLUT.cpp in Sources */, 941 957 676795DE11AD61FC00421804 /* TComPicYuv.cpp in Sources */, 942 958 676795E211AD61FC00421804 /* TComPrediction.cpp in Sources */, … … 1098 1114 HEADER_SEARCH_PATHS = source/Lib; 1099 1115 ONLY_ACTIVE_ARCH = YES; 1100 SDKROOT = macosx ;1116 SDKROOT = macosx10.8; 1101 1117 }; 1102 1118 name = Debug; … … 1112 1128 GCC_WARN_UNUSED_VARIABLE = YES; 1113 1129 HEADER_SEARCH_PATHS = source/Lib; 1114 SDKROOT = macosx ;1130 SDKROOT = macosx10.8; 1115 1131 }; 1116 1132 name = Release; -
trunk/cfg
- Property svn:mergeinfo changed
/branches/SHM-6-dev/cfg merged: 778,803
- Property svn:mergeinfo changed
-
trunk/cfg/layers.cfg
r713 r815 41 41 InitialQP1 : 0 # Rate control: initial QP for layer 1 42 42 RCForceIntraQP1 : 0 # Rate control: force intra QP to be equal to initial QP for layer 1 43 44 45 NumLayerSets : 1 46 NumLayerInIdList0 : 2 47 LayerSetLayerIdList0 : 0 1 48 49 NumAddLayerSets : 0 -
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-6-dev/source merged: 715-726,728-744,746-751,753-802,804-814
- Property svn:mergeinfo changed
-
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r713 r815 146 146 m_tgtLayerId = nLayerNum - 1; 147 147 assert( m_tgtLayerId >= 0 ); 148 assert( m_tgtLayerId < MAX_LAYERS ); 148 149 #if O0137_MAX_LAYERID 149 150 assert( m_tgtLayerId < MAX_NUM_LAYER_IDS ); -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r713 r815 191 191 InputNALUnit nalu; 192 192 byteStreamNALUnit(bytestream, nalUnit, stats); 193 194 193 // call actual decoding function 195 194 Bool bNewPicture = false; … … 215 214 { 216 215 bNewPicture = m_acTDecTop[nalu.m_layerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_layerId], curLayerId, bNewPOC); 216 #if POC_RESET_IDC_DECODER 217 if ( (bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) ) 218 #else 217 219 if (bNewPicture) 220 #endif 218 221 { 219 222 bitstreamFile.clear(); … … 225 228 bytestream.reset(); 226 229 } 227 } 228 } 229 230 #if POC_RESET_IDC_DECODER 231 else if(m_acTDecTop[nalu.m_layerId].getParseIdc() == 1) 232 { 233 bitstreamFile.clear(); 234 // This is before third parse of the NAL unit, and 235 // location points to correct beginning of the NALU 236 bitstreamFile.seekg(location); 237 bytestream.reset(); 238 } 239 #endif 240 } 241 } 242 243 #if POC_RESET_IDC_DECODER 244 if ((bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) 245 #else 230 246 if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) 247 #endif 231 248 { 232 249 #if O0194_DIFFERENT_BITDEPTH_EL_BL … … 245 262 } 246 263 264 #if POC_RESET_IDC_DECODER 265 if( bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 0 ) 266 { 267 outputAllPictures( nalu.m_layerId, true ); 268 } 269 #endif 270 247 271 if( pcListPic ) 248 272 { … … 269 293 flushAllPictures( nalu.m_layerId, outputPicturesFlag ); 270 294 } 295 296 #if POC_RESET_IDC_DECODER 297 if( bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() != 0 ) 298 // New picture, slice header parsed but picture not decoded 299 #else 271 300 if( bNewPicture ) // New picture, slice header parsed but picture not decoded 301 #endif 272 302 { 273 303 #if NO_OUTPUT_OF_PRIOR_PICS … … 1235 1265 1236 1266 // Find the status of the DPB 1267 #if POC_RESET_IDC_DECODER 1268 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus, false); 1269 #else 1237 1270 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus); 1271 #endif 1238 1272 1239 1273 while( dpbStatus.m_numAUsNotDisplayed ) … … 1282 1316 // Find DPB-information from the VPS 1283 1317 DpbStatus maxDpbLimit; 1318 #if RESOLUTION_BASED_DPB 1284 1319 Int targetLsIdx, subDpbIdx; 1285 1320 TComVPS *vps = findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit); 1321 1286 1322 if( getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ) 1287 1323 { … … 1294 1330 subDpbIdx = vps->getSubDpbAssigned( targetLsIdx, layerIdx ); 1295 1331 } 1332 #else 1333 Int subDpbIdx = getCommonDecoderParams()->getTargetOutputLayerSetIdx() == 0 ? 0 : layerIdx; 1334 findDpbParametersFromVps(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, maxDpbLimit); 1335 #endif 1296 1336 // Assume that listOfPocs is sorted in increasing order - if not have to sort it. 1297 1337 while( ifInvokeBumpingBeforeDecoding(dpbStatus, maxDpbLimit, layerIdx, subDpbIdx) ) … … 1437 1477 for(Int i = 0; i < vps->getNumLayersInIdList( targetLsIdx ); i++) 1438 1478 { 1479 #if RESOUTION_BASED_DPB 1439 1480 maxDpbLimit.m_numPicsInLayer[i] = vps->getMaxVpsLayerDecPicBuffMinus1( targetOutputLsIdx, i, highestTId ) + 1; 1440 1481 maxDpbLimit.m_numPicsInSubDpb[vps->getSubDpbAssigned( targetLsIdx, i )] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, vps->getSubDpbAssigned( targetLsIdx, i ), highestTId) + 1; 1482 #else 1483 maxDpbLimit.m_numPicsInSubDpb[i] = vps->getMaxVpsDecPicBufferingMinus1( targetOutputLsIdx, i, highestTId) + 1; 1484 #endif 1441 1485 } 1442 1486 // ------------------------------------- … … 1472 1516 retVal |= ( dpbStatus.m_numPicsInSubDpb[subDpbIdx] >= dpbLimit.m_numPicsInSubDpb[subDpbIdx] ); 1473 1517 1518 #if RESOLUTION_BASED_DPB 1474 1519 // Number of pictures in each layer 1475 1520 retVal |= ( dpbStatus.m_numPicsInLayer[layerIdx] >= dpbLimit.m_numPicsInLayer[layerIdx]); 1521 #endif 1476 1522 1477 1523 return retVal; … … 1492 1538 , std::vector<Int> *listOfPocsPositionInEachLayer 1493 1539 , DpbStatus &dpbStatus 1540 #if POC_RESET_IDC_DECODER 1541 , Bool notOutputCurrAu 1542 #endif 1494 1543 ) 1495 1544 { … … 1516 1565 vps = pic->getSlice(0)->getVPS(); 1517 1566 } 1518 1519 std::vector<Int>::iterator it;1520 if( pic->getOutputMark() ) // && pic->getPOC() > m_aiPOCLastDisplay[i])1521 { 1522 it = find( listOfPocs.begin(), listOfPocs.end(), pic->getPOC() ); // Check if already included1523 if( it == listOfPocs.end() ) // New POC value - i.e. new AU - add to the list1567 #if POC_RESET_IDC_DECODER 1568 if( !(pic->isCurrAu() && notOutputCurrAu ) ) 1569 { 1570 #endif 1571 std::vector<Int>::iterator it; 1572 if( pic->getOutputMark() ) // && pic->getPOC() > m_aiPOCLastDisplay[i]) 1524 1573 { 1525 listOfPocs.push_back( pic->getPOC() ); 1574 it = find( listOfPocs.begin(), listOfPocs.end(), pic->getPOC() ); // Check if already included 1575 if( it == listOfPocs.end() ) // New POC value - i.e. new AU - add to the list 1576 { 1577 listOfPocs.push_back( pic->getPOC() ); 1578 } 1579 listOfPocsInEachLayer [i].push_back( pic->getPOC() ); // POC to be output in each layer 1580 listOfPocsPositionInEachLayer [i].push_back( picPositionInList ); // For ease of access 1526 1581 } 1527 listOfPocsInEachLayer [i].push_back( pic->getPOC() ); // POC to be output in each layer1528 listOfPocsPositionInEachLayer [i].push_back( picPositionInList ); // For ease of access1529 }1530 if( pic->getSlice(0)->isReferenced() || pic->getOutputMark() )1531 { 1532 dpbStatus.m_numPicsInLayer[i]++; // Count pictures that are "used for reference" or "needed for output"1533 } 1582 if( pic->getSlice(0)->isReferenced() || pic->getOutputMark() ) 1583 { 1584 dpbStatus.m_numPicsInLayer[i]++; // Count pictures that are "used for reference" or "needed for output" 1585 } 1586 #if POC_RESET_IDC_DECODER 1587 } 1588 #endif 1534 1589 } 1535 1590 iterPic++; … … 1550 1605 { 1551 1606 dpbStatus.m_numPicsNotDisplayedInLayer[i] = listOfPocsInEachLayer[i].size(); 1607 #if RESOLUTION_BASED_DPB 1552 1608 dpbStatus.m_numPicsInSubDpb[vps->getSubDpbAssigned(targetLsIdx,i)] += dpbStatus.m_numPicsInLayer[i]; 1609 #else 1610 dpbStatus.m_numPicsInSubDpb[i] += dpbStatus.m_numPicsInLayer[i]; 1611 #endif 1553 1612 } 1554 1613 assert( dpbStatus.m_numAUsNotDisplayed != -1 ); 1555 1556 1557 1614 } 1615 1616 #if POC_RESET_IDC_DECODER 1617 Void TAppDecTop::outputAllPictures(Int layerId, Bool notOutputCurrPic) 1618 { 1619 { // All pictures in the DPB in that layer are to be output; this means other pictures would also be output 1620 std::vector<Int> listOfPocs; 1621 std::vector<Int> listOfPocsInEachLayer[MAX_LAYERS]; 1622 std::vector<Int> listOfPocsPositionInEachLayer[MAX_LAYERS]; 1623 DpbStatus dpbStatus; 1624 1625 // Find the status of the DPB 1626 xFindDPBStatus(listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus, notOutputCurrPic); 1627 1628 if( listOfPocs.size() ) 1629 { 1630 while( listOfPocsInEachLayer[layerId].size() ) // As long as there picture in the layer to be output 1631 { 1632 bumpingProcess( listOfPocs, listOfPocsInEachLayer, listOfPocsPositionInEachLayer, dpbStatus ); 1633 } 1634 } 1635 } 1636 } 1637 #endif 1558 1638 #endif 1559 1639 //! \} -
trunk/source/App/TAppDecoder/TAppDecTop.h
r644 r815 107 107 108 108 Void xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerID, Int &pocLastDisplay, DpbStatus &dpbStatus); 109 #if POC_RESET_IDC_DECODER 110 Void outputAllPictures(Int layerId, Bool notOutputCurrAu); 111 #endif 109 112 Void xFindDPBStatus( std::vector<Int> &listOfPocs 110 113 , std::vector<Int> *listOfPocsInEachLayer 111 114 , std::vector<Int> *listOfPocsPositionInEachLayer 112 115 , DpbStatus &dpbStatus 116 #if POC_RESET_IDC_DECODER 117 , Bool notOutputCurrAu = true 118 #endif 113 119 ); 114 120 -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r713 r815 69 69 , m_avcBaseLayerFlag(0) 70 70 #endif 71 #if N0120_MAX_TID_REF_CFG72 71 , m_maxTidRefPresentFlag(1) 73 #endif74 72 , m_pColumnWidth() 75 73 , m_pRowHeight() … … 420 418 Int* cfg_OutputBitDepthC [MAX_LAYERS]; 421 419 #endif 422 #if N0120_MAX_TID_REF_CFG423 420 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 424 #endif425 421 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 426 422 { … … 491 487 cfg_OutputBitDepthC [layer] = &m_acLayerCfg[layer].m_outputBitDepthC; 492 488 #endif 493 #if N0120_MAX_TID_REF_CFG 494 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 495 #endif 489 cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; 496 490 #if AUXILIARY_PICTURES 497 491 cfg_auxId[layer] = &m_acLayerCfg[layer].m_auxId; 498 492 #endif 499 493 } 494 #if Q0078_ADD_LAYER_SETS 495 Int* cfg_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 496 string cfg_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1]; 497 string* cfg_layerSetLayerIdListPtr[MAX_VPS_LAYER_SETS_PLUS1]; 498 Int* cfg_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 499 string cfg_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 500 string* cfg_highestLayerIdxPtr[MAX_VPS_LAYER_SETS_PLUS1]; 501 for (UInt i = 0; i < MAX_VPS_LAYER_SETS_PLUS1; i++) 502 { 503 cfg_numLayerInIdList[i] = &m_numLayerInIdList[i]; 504 cfg_layerSetLayerIdListPtr[i] = &cfg_layerSetLayerIdList[i]; 505 cfg_highestLayerIdxPtr[i] = &cfg_highestLayerIdx[i]; 506 cfg_numHighestLayerIdx[i] = &m_numHighestLayerIdx[i]; 507 } 508 #endif 500 509 #if AVC_BASE 501 510 string cfg_BLInputFile; … … 519 528 string cfg_codedPivotValue; 520 529 string cfg_targetPivotValue; 530 #if P0050_KNEE_FUNCTION_SEI 531 string cfg_kneeSEIInputKneePointValue; 532 string cfg_kneeSEIOutputKneePointValue; 533 #endif 521 534 po::Options opts; 522 535 opts.addOptions() … … 548 561 #endif 549 562 ("NumLayers", m_numLayers, 1, "Number of layers to code") 563 #if Q0078_ADD_LAYER_SETS 564 ("NumLayerSets", m_numLayerSets, 0, "Number of layer sets") 565 ("NumLayerInIdList%d", cfg_numLayerInIdList, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of layers in the set") 566 ("LayerSetLayerIdList%d", cfg_layerSetLayerIdListPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Layer IDs for the set") 567 ("NumAddLayerSets", m_numAddLayerSets, 0, "Number of additional layer sets") 568 ("NumHighestLayerIdx%d", cfg_numHighestLayerIdx, 0, MAX_VPS_LAYER_ID_PLUS1, "Number of highest layer idx") 569 ("HighestLayerIdx%d", cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_ID_PLUS1, "Highest layer idx for an additional layer set") 570 #endif 550 571 #if AUXILIARY_PICTURES 551 572 ("InputChromaFormat%d", cfg_tmpInputChromaFormat, 420, MAX_LAYERS, "InputChromaFormatIDC for layer %d") … … 554 575 #endif 555 576 ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") 556 #if SCALABILITY_MASK_E0104557 577 ("ScalabilityMask1", m_scalabilityMask[1], 0, "scalability_mask[1] (multiview)") 558 578 ("ScalabilityMask2", m_scalabilityMask[2], 1, "scalability_mask[2] (scalable)" ) 559 579 #if AUXILIARY_PICTURES 560 580 ("ScalabilityMask3", m_scalabilityMask[3], 0, "scalability_mask[3] (auxiliary pictures)" ) 561 #endif562 #else563 ("ScalabilityMask0", m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)")564 ("ScalabilityMask1", m_scalabilityMask[1], 1, "scalability_mask[1] (scalable)" )565 581 #endif 566 582 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") … … 598 614 ("OutputBitDepthC%d", cfg_OutputBitDepthC, 0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") 599 615 #endif 600 #if N0120_MAX_TID_REF_CFG601 616 ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) 602 617 ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction") 603 #endif604 618 #if O0223_PICTURE_TYPES_ALIGN_FLAG 605 619 ("CrossLayerPictureTypeAlignFlag", m_crossLayerPictureTypeAlignFlag, true, "align picture type across layers" ) 606 620 #endif 607 #if N0147_IRAP_ALIGN_FLAG608 621 ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 609 #endif610 622 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 611 623 ("CrossLayerAlignedIdrOnlyFlag", m_crossLayerAlignedIdrOnlyFlag, true, "only idr for IRAP across layers" ) … … 953 965 ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") 954 966 ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") 967 #if P0050_KNEE_FUNCTION_SEI 968 ("SEIKneeFunctionInfo", m_kneeSEIEnabled, false, "Control generation of Knee function SEI messages") 969 ("SEIKneeFunctionId", m_kneeSEIId, 0, "Specifies Id of Knee function SEI message for a given session") 970 ("SEIKneeFunctionCancelFlag", m_kneeSEICancelFlag, false, "Indicates that Knee function SEI message cancels the persistance or follows") 971 ("SEIKneeFunctionPersistenceFlag", m_kneeSEIPersistenceFlag, true, "Specifies the persistence of the Knee function SEI message") 972 ("SEIKneeFunctionMappingFlag", m_kneeSEIMappingFlag, false, "Specifies the mapping mode of the Knee function SEI message") 973 ("SEIKneeFunctionInputDrange", m_kneeSEIInputDrange, 1000, "Specifies the peak luminance level for the input picture of Knee function SEI messages") 974 ("SEIKneeFunctionInputDispLuminance", m_kneeSEIInputDispLuminance, 100, "Specifies the expected display brightness for the input picture of Knee function SEI messages") 975 ("SEIKneeFunctionOutputDrange", m_kneeSEIOutputDrange, 4000, "Specifies the peak luminance level for the output picture of Knee function SEI messages") 976 ("SEIKneeFunctionOutputDispLuminance", m_kneeSEIOutputDispLuminance, 800, "Specifies the expected display brightness for the output picture of Knee function SEI messages") 977 ("SEIKneeFunctionNumKneePointsMinus1", m_kneeSEINumKneePointsMinus1, 2, "Specifies the number of knee points - 1") 978 ("SEIKneeFunctionInputKneePointValue", cfg_kneeSEIInputKneePointValue, string("600 800 900"), "Array of input knee point") 979 ("SEIKneeFunctionOutputKneePointValue", cfg_kneeSEIOutputKneePointValue, string("100 250 450"), "Array of output knee point") 980 #endif 981 #if Q0189_TMVP_CONSTRAINTS 982 ("SEITemporalMotionVectorPredictionConstraints", m_TMVPConstraintsSEIEnabled, 0, "Control generation of TMVP constrants SEI message") 983 #endif 955 984 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 956 985 ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)") … … 976 1005 ("CGSLUTBit", m_nCGSLUTBit , 12, "bit depth of CGS LUT") 977 1006 #endif 1007 #if Q0108_TSA_STSA 1008 ("InheritCodingStruct%d",m_inheritCodingStruct, 0, MAX_LAYERS, "Predicts the GOP structure of one layer for another layer") 1009 #endif 978 1010 ; 979 1011 … … 983 1015 opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry()); 984 1016 } 1017 1018 #if Q0108_TSA_STSA 1019 for (Int i=1; i<MAX_LAYERS; i++) 1020 { 1021 for(Int j=1; j<MAX_GOP+1; j++) 1022 { 1023 std::ostringstream cOSS; 1024 cOSS<<"Layer"<<i<<"Frame"<<j; 1025 opts.addOptions()(cOSS.str(), m_EhGOPList[i][j-1], GOPEntry()); 1026 } 1027 } 1028 #endif 1029 985 1030 po::setDefaults(opts); 986 1031 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 1032 1033 #if Q0108_TSA_STSA 1034 for (Int i=1; i<MAX_LAYERS; i++) 1035 { 1036 if(m_inheritCodingStruct[i] == 0) 1037 { 1038 for(Int j=1; j<MAX_GOP+1; j++) 1039 { 1040 m_EhGOPList[i][j-1] = m_GOPList[j-1]; 1041 } 1042 } 1043 else if( m_inheritCodingStruct[i] > 0) 1044 { 1045 for(Int j=1; j<MAX_GOP+1; j++) 1046 { 1047 m_EhGOPList[i][j-1] = m_EhGOPList[m_inheritCodingStruct[i]][j-1]; 1048 } 1049 } 1050 } 1051 #endif 987 1052 988 1053 if(m_isField) … … 1309 1374 { 1310 1375 m_acLayerCfg[layer].m_predLayerIds = NULL; 1376 } 1377 } 1378 #endif 1379 #if Q0078_ADD_LAYER_SETS 1380 for (Int layerSet = 0; layerSet < m_numLayerSets; layerSet++) 1381 { 1382 if (m_numLayerInIdList[layerSet] > 0) 1383 { 1384 Char* layerSetLayerIdListDup = cfg_layerSetLayerIdList[layerSet].empty() ? NULL : strdup(cfg_layerSetLayerIdList[layerSet].c_str()); 1385 Int i = 0; 1386 char *layerId = strtok(layerSetLayerIdListDup, " ,-"); 1387 while (layerId != NULL) 1388 { 1389 if (i >= m_numLayerInIdList[layerSet]) 1390 { 1391 printf("NumLayerInIdList%d: The number of layers in the set is larger than the allowed number of layers.\n", layerSet); 1392 exit(EXIT_FAILURE); 1393 } 1394 m_layerSetLayerIdList[layerSet][i] = atoi(layerId); 1395 layerId = strtok(NULL, " ,-"); 1396 i++; 1397 } 1398 } 1399 } 1400 for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++) 1401 { 1402 if (m_numHighestLayerIdx[addLayerSet] > 0) 1403 { 1404 Char* highestLayrIdxListDup = cfg_highestLayerIdx[addLayerSet].empty() ? NULL : strdup(cfg_highestLayerIdx[addLayerSet].c_str()); 1405 Int i = 0; 1406 char *layerIdx = strtok(highestLayrIdxListDup, " ,-"); 1407 while (layerIdx != NULL) 1408 { 1409 if (i >= m_numLayerInIdList[addLayerSet]) 1410 { 1411 printf("NumLayerInIdList%d: The number of layer idx's in the highest layer idx list is larger than the allowed number of idx's.\n", addLayerSet); 1412 exit(EXIT_FAILURE); 1413 } 1414 m_highestLayerIdx[addLayerSet][i] = atoi(layerIdx); 1415 layerIdx = strtok(NULL, " ,-"); 1416 i++; 1417 } 1311 1418 } 1312 1419 } … … 1495 1602 } 1496 1603 } 1604 #if P0050_KNEE_FUNCTION_SEI 1605 if( m_kneeSEIEnabled && !m_kneeSEICancelFlag ) 1606 { 1607 Char* pcInputKneePointValue = cfg_kneeSEIInputKneePointValue.empty() ? NULL : strdup(cfg_kneeSEIInputKneePointValue.c_str()); 1608 Char* pcOutputKneePointValue = cfg_kneeSEIOutputKneePointValue.empty() ? NULL : strdup(cfg_kneeSEIOutputKneePointValue.c_str()); 1609 assert ( m_kneeSEINumKneePointsMinus1 >= 0 && m_kneeSEINumKneePointsMinus1 < 999 ); 1610 m_kneeSEIInputKneePoint = new Int[m_kneeSEINumKneePointsMinus1+1]; 1611 m_kneeSEIOutputKneePoint = new Int[m_kneeSEINumKneePointsMinus1+1]; 1612 char *InputVal = strtok(pcInputKneePointValue, " .,"); 1613 Int i=0; 1614 while( InputVal && i<(m_kneeSEINumKneePointsMinus1+1) ) 1615 { 1616 m_kneeSEIInputKneePoint[i] = (UInt) atoi( InputVal ); 1617 InputVal = strtok(NULL, " .,"); 1618 i++; 1619 } 1620 char *OutputVal = strtok(pcOutputKneePointValue, " .,"); 1621 i=0; 1622 while( OutputVal && i<(m_kneeSEINumKneePointsMinus1+1) ) 1623 { 1624 m_kneeSEIOutputKneePoint[i] = (UInt) atoi( OutputVal ); 1625 OutputVal = strtok(NULL, " .,"); 1626 i++; 1627 } 1628 } 1629 #endif 1497 1630 1498 1631 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI … … 1742 1875 * This permits the ability to omit a GOP structure specification */ 1743 1876 #if SVC_EXTENSION 1877 #if Q0108_TSA_STSA 1878 if( m_acLayerCfg[0].m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1 ) 1879 { 1880 m_GOPList[0] = GOPEntry(); 1881 m_GOPList[0].m_QPFactor = 1; 1882 m_GOPList[0].m_betaOffsetDiv2 = 0; 1883 m_GOPList[0].m_tcOffsetDiv2 = 0; 1884 m_GOPList[0].m_POC = 1; 1885 m_GOPList[0].m_numRefPicsActive = 4; 1886 } 1887 1744 1888 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1745 1889 { 1890 if (m_acLayerCfg[layer].m_iIntraPeriod == 1 && m_EhGOPList[layer][0].m_POC == -1) { 1891 m_EhGOPList[layer][0] = GOPEntry(); 1892 m_EhGOPList[layer][0].m_QPFactor = 1; 1893 m_EhGOPList[layer][0].m_betaOffsetDiv2 = 0; 1894 m_EhGOPList[layer][0].m_tcOffsetDiv2 = 0; 1895 m_EhGOPList[layer][0].m_POC = 1; 1896 m_EhGOPList[layer][0].m_numRefPicsActive = 4; 1897 } 1898 } 1899 #else 1900 for(UInt layer = 0; layer < MAX_LAYERS; layer++) 1901 { 1746 1902 Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; 1747 #endif 1903 if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { 1904 m_GOPList[0] = GOPEntry(); 1905 m_GOPList[0].m_QPFactor = 1; 1906 m_GOPList[0].m_betaOffsetDiv2 = 0; 1907 m_GOPList[0].m_tcOffsetDiv2 = 0; 1908 m_GOPList[0].m_POC = 1; 1909 m_GOPList[0].m_numRefPicsActive = 4; 1910 } 1911 } 1912 #endif 1913 #else 1748 1914 if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { 1749 1915 m_GOPList[0] = GOPEntry(); … … 1754 1920 m_GOPList[0].m_numRefPicsActive = 4; 1755 1921 } 1756 #if SVC_EXTENSION 1757 } 1758 #endif 1759 1922 #endif 1760 1923 1761 1924 Bool verifiedGOP=false; … … 1790 1953 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 1791 1954 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 1792 1793 1955 1794 1956 // it can be updated after AVC BL support will be added to the WD … … 1827 1989 #endif 1828 1990 1829 m_extraRPSs=0; 1991 #if !Q0108_TSA_STSA 1992 m_extraRPSs = 0; 1993 #else 1994 memset( m_extraRPSs, 0, sizeof( m_extraRPSs ) ); 1995 #endif 1830 1996 //start looping through frames in coding order until we can verify that the GOP structure is correct. 1831 1997 while(!verifiedGOP&&!errorGOP) … … 1893 2059 { 1894 2060 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 2061 #if !Q0108_TSA_STSA 1895 2062 m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP]; 2063 #else 2064 m_GOPList[m_iGOPSize+m_extraRPSs[0]]=m_GOPList[curGOP]; 2065 #endif 1896 2066 Int newRefs=0; 1897 2067 for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) … … 1900 2070 if(absPOC>=0) 1901 2071 { 2072 #if !Q0108_TSA_STSA 1902 2073 m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i]; 1903 2074 m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i]; 2075 #else 2076 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i]; 2077 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i]; 2078 #endif 1904 2079 newRefs++; 1905 2080 } … … 1924 2099 for(Int i=0; i<newRefs; i++) 1925 2100 { 2101 #if !Q0108_TSA_STSA 1926 2102 if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC) 2103 #else 2104 if(m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[i]==offPOC-curPOC) 2105 #endif 1927 2106 { 1928 2107 newRef=false; … … 1939 2118 for(Int j=0; j<newRefs; j++) 1940 2119 { 2120 #if !Q0108_TSA_STSA 1941 2121 if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0) 2122 #else 2123 if(m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]>0) 2124 #endif 1942 2125 { 1943 2126 insertPoint = j; … … 1949 2132 for(Int j=insertPoint; j<newRefs+1; j++) 1950 2133 { 2134 #if !Q0108_TSA_STSA 1951 2135 Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]; 1952 2136 Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]; 1953 2137 m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev; 1954 2138 m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed; 2139 #else 2140 Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]; 2141 Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]; 2142 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]=prev; 2143 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]=prevUsed; 2144 #endif 2145 1955 2146 prevUsed=newUsed; 1956 2147 prev=newPrev; … … 1964 2155 } 1965 2156 } 2157 #if !Q0108_TSA_STSA 1966 2158 m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs; 1967 2159 m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC; 2160 #else 2161 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics=newRefs; 2162 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC = curPOC; 2163 #endif 2164 #if !Q0108_TSA_STSA 1968 2165 if (m_extraRPSs == 0) 1969 { 2166 #else 2167 if (m_extraRPSs[0] == 0) 2168 #endif 2169 { 2170 #if !Q0108_TSA_STSA 1970 2171 m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0; 1971 2172 m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0; 2173 #else 2174 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 0; 2175 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = 0; 2176 #endif 1972 2177 } 1973 2178 else 1974 2179 { 2180 #if !Q0108_TSA_STSA 1975 2181 Int rIdx = m_iGOPSize + m_extraRPSs - 1; 2182 #else 2183 Int rIdx = m_iGOPSize + m_extraRPSs[0] - 1; 2184 #endif 1976 2185 Int refPOC = m_GOPList[rIdx].m_POC; 1977 2186 Int refPics = m_GOPList[rIdx].m_numRefPics; … … 1982 2191 Int absPOCref = refPOC+deltaPOC; 1983 2192 Int refIdc = 0; 2193 #if !Q0108_TSA_STSA 1984 2194 for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++) 1985 2195 { … … 2006 2216 m_extraRPSs++; 2007 2217 } 2218 #else 2219 for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics; j++) 2220 { 2221 if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]) 2222 { 2223 if (m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]) 2224 { 2225 refIdc = 1; 2226 } 2227 else 2228 { 2229 refIdc = 2; 2230 } 2231 } 2232 } 2233 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_refIdc[newIdc]=refIdc; 2234 newIdc++; 2235 } 2236 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 1; 2237 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = newIdc; 2238 m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC; 2239 } 2240 curGOP=m_iGOPSize+m_extraRPSs[0]; 2241 m_extraRPSs[0]++; 2242 } 2243 #endif 2244 2008 2245 numRefs=0; 2009 2246 for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) … … 2022 2259 } 2023 2260 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2261 2262 #if SVC_EXTENSION && Q0108_TSA_STSA 2263 for ( Int layerId = 1; layerId < m_numLayers; layerId++ ) 2264 { 2265 verifiedGOP=false; 2266 errorGOP=false; 2267 checkGOP=1; 2268 numRefs = m_isField ? 2 : 1; 2269 refList[0]=0; 2270 2271 if(m_isField) 2272 { 2273 refList[1] = 1; 2274 } 2275 2276 memset( isOK, 0, sizeof( isOK ) ); 2277 numOK=0; 2278 2279 for(Int i=0; i<m_iGOPSize; i++) 2280 { 2281 if(m_EhGOPList[layerId][i].m_POC==m_iGOPSize) 2282 { 2283 xConfirmPara( m_EhGOPList[layerId][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); 2284 } 2285 } 2286 2287 xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); 2288 m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; 2289 2290 // verify layer configuration parameters 2291 for(UInt layer=0; layer<m_numLayers; layer++) 2292 { 2293 Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; 2294 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) 2295 { 2296 for(Int i=0; i<m_iGOPSize; i++) 2297 { 2298 xConfirmPara( (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2299 xConfirmPara( (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerId][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" ); 2300 } 2301 } 2302 } 2303 2304 //start looping through frames in coding order until we can verify that the GOP structure is correct. 2305 while(!verifiedGOP&&!errorGOP) 2306 { 2307 Int curGOP = (checkGOP-1)%m_iGOPSize; 2308 Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][curGOP].m_POC; 2309 if(m_EhGOPList[layerId][curGOP].m_POC<0) 2310 { 2311 printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); 2312 errorGOP=true; 2313 } 2314 else 2315 { 2316 //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. 2317 Bool beforeI = false; 2318 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2319 { 2320 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2321 if(absPOC < 0) 2322 { 2323 beforeI=true; 2324 } 2325 else 2326 { 2327 Bool found=false; 2328 for(Int j=0; j<numRefs; j++) 2329 { 2330 if(refList[j]==absPOC) 2331 { 2332 found=true; 2333 for(Int k=0; k<m_iGOPSize; k++) 2334 { 2335 if(absPOC%m_iGOPSize == m_EhGOPList[layerId][k].m_POC%m_iGOPSize) 2336 { 2337 if(m_EhGOPList[layerId][k].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId) 2338 { 2339 m_EhGOPList[layerId][k].m_refPic = true; 2340 } 2341 m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerId][k].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId; 2342 } 2343 } 2344 } 2345 } 2346 if(!found) 2347 { 2348 printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerId][curGOP].m_referencePics[i],curGOP+1); 2349 errorGOP=true; 2350 } 2351 } 2352 } 2353 if(!beforeI&&!errorGOP) 2354 { 2355 //all ref frames were present 2356 if(!isOK[curGOP]) 2357 { 2358 numOK++; 2359 isOK[curGOP]=true; 2360 if(numOK==m_iGOPSize) 2361 { 2362 verifiedGOP=true; 2363 } 2364 } 2365 } 2366 else 2367 { 2368 //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) 2369 2370 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]]=m_EhGOPList[layerId][curGOP]; 2371 Int newRefs=0; 2372 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2373 { 2374 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2375 if(absPOC>=0) 2376 { 2377 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[newRefs]=m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2378 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerId][curGOP].m_usedByCurrPic[i]; 2379 newRefs++; 2380 } 2381 } 2382 Int numPrefRefs = m_EhGOPList[layerId][curGOP].m_numRefPicsActive; 2383 2384 for(Int offset = -1; offset>-checkGOP; offset--) 2385 { 2386 //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. 2387 Int offGOP = (checkGOP-1+offset)%m_iGOPSize; 2388 Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerId][offGOP].m_POC; 2389 if(offPOC>=0&&m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId) 2390 { 2391 Bool newRef=false; 2392 for(Int i=0; i<numRefs; i++) 2393 { 2394 if(refList[i]==offPOC) 2395 { 2396 newRef=true; 2397 } 2398 } 2399 for(Int i=0; i<newRefs; i++) 2400 { 2401 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[i]==offPOC-curPOC) 2402 { 2403 newRef=false; 2404 } 2405 } 2406 if(newRef) 2407 { 2408 Int insertPoint=newRefs; 2409 //this picture can be added, find appropriate place in list and insert it. 2410 if(m_EhGOPList[layerId][offGOP].m_temporalId==m_EhGOPList[layerId][curGOP].m_temporalId) 2411 { 2412 m_EhGOPList[layerId][offGOP].m_refPic = true; 2413 } 2414 for(Int j=0; j<newRefs; j++) 2415 { 2416 if(m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]>0) 2417 { 2418 insertPoint = j; 2419 break; 2420 } 2421 } 2422 Int prev = offPOC-curPOC; 2423 Int prevUsed = m_EhGOPList[layerId][offGOP].m_temporalId<=m_EhGOPList[layerId][curGOP].m_temporalId; 2424 for(Int j=insertPoint; j<newRefs+1; j++) 2425 { 2426 Int newPrev = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]; 2427 Int newUsed = m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]; 2428 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]=prev; 2429 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]=prevUsed; 2430 prevUsed=newUsed; 2431 prev=newPrev; 2432 } 2433 newRefs++; 2434 } 2435 } 2436 if(newRefs>=numPrefRefs) 2437 { 2438 break; 2439 } 2440 } 2441 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics=newRefs; 2442 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC = curPOC; 2443 if (m_extraRPSs[layerId] == 0) 2444 { 2445 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 0; 2446 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = 0; 2447 } 2448 else 2449 { 2450 Int rIdx = m_iGOPSize + m_extraRPSs[layerId] - 1; 2451 Int refPOC = m_EhGOPList[layerId][rIdx].m_POC; 2452 Int refPics = m_EhGOPList[layerId][rIdx].m_numRefPics; 2453 Int newIdc=0; 2454 for(Int i = 0; i<= refPics; i++) 2455 { 2456 Int deltaPOC = ((i != refPics)? m_EhGOPList[layerId][rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 2457 Int absPOCref = refPOC+deltaPOC; 2458 Int refIdc = 0; 2459 for (Int j = 0; j < m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefPics; j++) 2460 { 2461 if ( (absPOCref - curPOC) == m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_referencePics[j]) 2462 { 2463 if (m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_usedByCurrPic[j]) 2464 { 2465 refIdc = 1; 2466 } 2467 else 2468 { 2469 refIdc = 2; 2470 } 2471 } 2472 } 2473 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_refIdc[newIdc]=refIdc; 2474 newIdc++; 2475 } 2476 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_interRPSPrediction = 1; 2477 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_numRefIdc = newIdc; 2478 m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_deltaRPS = refPOC - m_EhGOPList[layerId][m_iGOPSize+m_extraRPSs[layerId]].m_POC; 2479 } 2480 curGOP=m_iGOPSize+m_extraRPSs[layerId]; 2481 m_extraRPSs[layerId]++; 2482 } 2483 numRefs=0; 2484 for(Int i = 0; i< m_EhGOPList[layerId][curGOP].m_numRefPics; i++) 2485 { 2486 Int absPOC = curPOC+m_EhGOPList[layerId][curGOP].m_referencePics[i]; 2487 if(absPOC >= 0) 2488 { 2489 refList[numRefs]=absPOC; 2490 numRefs++; 2491 } 2492 } 2493 refList[numRefs]=curPOC; 2494 numRefs++; 2495 } 2496 checkGOP++; 2497 } 2498 xConfirmPara(errorGOP,"Invalid GOP structure given"); 2499 } 2500 #endif 2501 2024 2502 m_maxTempLayer = 1; 2025 2503 for(Int i=0; i<m_iGOPSize; i++) … … 2031 2509 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); 2032 2510 } 2511 2512 #if Q0108_TSA_STSA 2513 for ( Int layerId = 1; layerId < m_numLayers; layerId++) 2514 { 2515 m_EhMaxTempLayer[layerId] = 1; 2516 for(Int i=0; i<m_iGOPSize; i++) 2517 { 2518 if(m_EhGOPList[layerId][i].m_temporalId >= m_EhMaxTempLayer[layerId] ) 2519 { 2520 m_EhMaxTempLayer[layerId] = m_EhGOPList[layerId][i].m_temporalId; 2521 } 2522 xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I"); 2523 } 2524 } 2525 #endif 2526 2033 2527 for(Int i=0; i<MAX_TLAYER; i++) 2034 2528 { … … 2195 2689 xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); 2196 2690 } 2691 #if P0050_KNEE_FUNCTION_SEI 2692 if (m_kneeSEIEnabled && !m_kneeSEICancelFlag) 2693 { 2694 xConfirmPara( m_kneeSEINumKneePointsMinus1 < 0 || m_kneeSEINumKneePointsMinus1 > 998, "SEIKneeFunctionNumKneePointsMinus1 must be in the range of 0 to 998"); 2695 for ( UInt i=0; i<=m_kneeSEINumKneePointsMinus1; i++ ){ 2696 xConfirmPara( m_kneeSEIInputKneePoint[i] < 1 || m_kneeSEIInputKneePoint[i] > 999, "SEIKneeFunctionInputKneePointValue must be in the range of 1 to 999"); 2697 xConfirmPara( m_kneeSEIOutputKneePoint[i] < 0 || m_kneeSEIOutputKneePoint[i] > 1000, "SEIKneeFunctionInputKneePointValue must be in the range of 0 to 1000"); 2698 if ( i > 0 ) 2699 { 2700 xConfirmPara( m_kneeSEIInputKneePoint[i-1] >= m_kneeSEIInputKneePoint[i], "The i-th SEIKneeFunctionInputKneePointValue must be greather than the (i-1)-th value"); 2701 } 2702 } 2703 } 2704 #endif 2197 2705 2198 2706 #if RC_SHVC_HARMONIZATION … … 2234 2742 xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5"); 2235 2743 } 2744 2745 #if SVC_EXTENSION 2236 2746 #if VPS_EXTN_DIRECT_REF_LAYERS 2237 2747 xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); … … 2304 2814 } 2305 2815 #endif 2306 #if N0120_MAX_TID_REF_CFG2307 2816 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) 2308 2817 { 2309 2818 xConfirmPara(m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); 2310 2819 } 2311 #endif2312 2820 #if AUXILIARY_PICTURES 2313 2821 for (UInt layer=0; layer < MAX_LAYERS-1; layer++) … … 2320 2828 xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" ); 2321 2829 #endif 2830 #endif //SVC_EXTENSION 2322 2831 #undef xConfirmPara 2323 2832 if (check_failed) … … 2397 2906 #if SVC_EXTENSION 2398 2907 printf("Total number of layers : %d\n", m_numLayers ); 2399 #if SCALABILITY_MASK_E0104 2400 printf("Multiview : %d\n", m_scalabilityMask[1] ); 2401 printf("Scalable : %d\n", m_scalabilityMask[2] ); 2908 printf("Multiview : %d\n", m_scalabilityMask[VIEW_ORDER_INDEX] ); 2909 printf("Scalable : %d\n", m_scalabilityMask[SCALABILITY_ID] ); 2402 2910 #if AVC_BASE 2403 2911 printf("Base layer : %s\n", m_avcBaseLayerFlag ? "AVC" : "HEVC"); 2404 2912 #endif 2405 2913 #if AUXILIARY_PICTURES 2406 printf("Auxiliary pictures : %d\n", m_scalabilityMask[3] ); 2407 #endif 2408 #else 2409 printf("Multiview : %d\n", m_scalabilityMask[0] ); 2410 printf("Scalable : %d\n", m_scalabilityMask[1] ); 2914 printf("Auxiliary pictures : %d\n", m_scalabilityMask[AUX_ID] ); 2411 2915 #endif 2412 2916 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 2419 2923 printf("Align picture type : %d\n", m_crossLayerPictureTypeAlignFlag ); 2420 2924 #endif 2421 #if N0147_IRAP_ALIGN_FLAG2422 2925 printf("Cross layer IRAP alignment : %d\n", m_crossLayerIrapAlignFlag ); 2423 #endif2424 2926 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2425 2927 printf("IDR only for IRAP : %d\n", m_crossLayerAlignedIdrOnlyFlag ); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r713 r815 73 73 Char* m_BLSyntaxFile; ///< input syntax file 74 74 #endif 75 #if N0120_MAX_TID_REF_CFG76 75 Bool m_maxTidRefPresentFlag; 77 #endif 76 #if Q0078_ADD_LAYER_SETS 77 Int m_numLayerSets; 78 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 79 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 80 Int m_numAddLayerSets; 81 Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; 82 Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 83 #endif 78 84 #else 79 85 Char* m_pchInputFile; ///< source file name … … 119 125 Int m_iDecodingRefreshType; ///< random access type 120 126 Int m_iGOPSize; ///< GOP size of hierarchical structure 127 128 #if !Q0108_TSA_STSA 121 129 Int m_extraRPSs; ///< extra RPSs added to handle CRA 130 #else 131 Int m_extraRPSs[MAX_LAYERS]; ///< extra RPSs added to handle CRA 132 #endif 133 122 134 GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file 135 #if Q0108_TSA_STSA 136 GOPEntry m_EhGOPList[MAX_LAYERS][MAX_GOP]; ///< the enhancement layer coding structure entries from the config file 137 Int m_inheritCodingStruct[MAX_LAYERS]; 138 #endif 139 123 140 Int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures 124 141 Int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of pictures in the decoded picture buffer … … 148 165 149 166 Int m_maxTempLayer; ///< Max temporal layer 167 #if Q0108_TSA_STSA 168 Int m_EhMaxTempLayer[MAX_LAYERS]; ///< Max temporal layer 169 #endif 150 170 151 171 #if !LAYER_CTB … … 285 305 Int m_SOPDescriptionSEIEnabled; 286 306 Int m_scalableNestingSEIEnabled; 307 #if Q0189_TMVP_CONSTRAINTS 308 Int m_TMVPConstraintsSEIEnabled; 309 #endif 287 310 // weighted prediction 288 311 Bool m_useWeightedPred; ///< Use of weighted prediction in P slices … … 363 386 Void xPrintParameter (); ///< print configuration values 364 387 Void xPrintUsage (); ///< print usage 388 #if SVC_EXTENSION 365 389 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 366 390 Int m_adaptiveResolutionChange; ///< Indicate adaptive resolution change frame … … 386 410 Bool m_crossLayerPictureTypeAlignFlag; 387 411 #endif 388 #if N0147_IRAP_ALIGN_FLAG389 412 Bool m_crossLayerIrapAlignFlag; 413 #if P0050_KNEE_FUNCTION_SEI 414 Bool m_kneeSEIEnabled; 415 Int m_kneeSEIId; 416 Bool m_kneeSEICancelFlag; 417 Bool m_kneeSEIPersistenceFlag; 418 Bool m_kneeSEIMappingFlag; 419 Int m_kneeSEIInputDrange; 420 Int m_kneeSEIInputDispLuminance; 421 Int m_kneeSEIOutputDrange; 422 Int m_kneeSEIOutputDispLuminance; 423 Int m_kneeSEINumKneePointsMinus1; 424 Int* m_kneeSEIInputKneePoint; 425 Int* m_kneeSEIOutputKneePoint; 390 426 #endif 391 427 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG … … 404 440 Int m_nCGSLUTBit; 405 441 #endif 442 #endif //SVC_EXTENSION 406 443 public: 407 444 TAppEncCfg(); -
trunk/source/App/TAppEncoder/TAppEncLayerCfg.h
r713 r815 83 83 #endif 84 84 85 #if N0120_MAX_TID_REF_CFG86 85 Int m_maxTidIlRefPicsPlus1; 87 #endif88 86 Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). 89 87 … … 181 179 Void setSourceHeight(Int x) { m_iSourceHeight = x; } 182 180 #endif 183 #if N0120_MAX_TID_REF_CFG184 181 Int getMaxTidIlRefPicsPlus1() { return m_maxTidIlRefPicsPlus1; } 185 #endif186 182 #if LAYER_CTB 187 183 UInt getMaxCUWidth() {return m_uiMaxCUWidth; } -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r713 r815 82 82 vps->setTemporalNestingFlag(true); 83 83 } 84 #if !VPS_RENAME85 vps.setMaxLayers ( 1 );86 #endif87 84 for(Int i = 0; i < MAX_TLAYER; i++) 88 85 { … … 190 187 delete [] mapIdxToLayer; 191 188 #endif 189 190 assert( m_numLayers <= MAX_LAYERS ); 192 191 193 192 for(UInt layer=0; layer<m_numLayers; layer++) … … 241 240 m_acTEncTop[layer].setDecodingRefreshType ( m_iDecodingRefreshType ); 242 241 m_acTEncTop[layer].setGOPSize ( m_iGOPSize ); 242 #if Q0108_TSA_STSA 243 m_acTEncTop[layer].setGopList ( layer ? m_EhGOPList[layer] : m_GOPList ); 244 #else 243 245 m_acTEncTop[layer].setGopList ( m_GOPList ); 244 246 #endif 247 248 #if !Q0108_TSA_STSA 245 249 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs ); 250 #else 251 m_acTEncTop[layer].setExtraRPSs ( m_extraRPSs[layer] ); 252 #endif 246 253 for(Int i = 0; i < MAX_TLAYER; i++) 247 254 { … … 256 263 257 264 m_acTEncTop[layer].setPad ( m_acLayerCfg[layer].getPad() ); 258 265 #if !Q0108_TSA_STSA 259 266 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 267 #else 268 if (layer== 0) 269 { 270 m_acTEncTop[layer].setMaxTempLayer ( m_maxTempLayer ); 271 } 272 else 273 { 274 m_acTEncTop[layer].setMaxTempLayer ( m_EhMaxTempLayer[layer] ); 275 } 276 #endif 260 277 m_acTEncTop[layer].setUseAMP( m_enableAMP ); 261 #if N0120_MAX_TID_REF_CFG 262 if (layer<m_numLayers-1)278 279 if( layer < m_numLayers - 1 ) 263 280 { 264 281 m_acTEncTop[layer].setMaxTidIlRefPicsPlus1 ( m_acLayerCfg[layer].getMaxTidIlRefPicsPlus1()); 265 282 } 266 #endif 283 267 284 #if VPS_EXTN_DIRECT_REF_LAYERS 268 285 if(layer) … … 306 323 } 307 324 Int numDirectRefLayers = 0; 325 326 assert( layer < MAX_LAYERS ); 327 308 328 for (Int i = 0; i < layer; i++) 309 329 { … … 480 500 m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 481 501 m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 502 #if P0050_KNEE_FUNCTION_SEI 503 m_acTEncTop[layer].setKneeSEIEnabled ( m_kneeSEIEnabled ); 504 m_acTEncTop[layer].setKneeSEIId ( m_kneeSEIId ); 505 m_acTEncTop[layer].setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 506 m_acTEncTop[layer].setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 507 m_acTEncTop[layer].setKneeSEIMappingFlag ( m_kneeSEIMappingFlag ); 508 m_acTEncTop[layer].setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 509 m_acTEncTop[layer].setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 510 m_acTEncTop[layer].setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 511 m_acTEncTop[layer].setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 512 m_acTEncTop[layer].setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 513 m_acTEncTop[layer].setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 514 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 515 #endif 482 516 #if Q0074_SEI_COLOR_MAPPING 483 517 m_acTEncTop[layer].setColorMappingInfoSEIFile ( m_acLayerCfg[layer].m_cSeiColorMappingFile.empty() ? NULL : const_cast<Char *>(m_acLayerCfg[layer].m_cSeiColorMappingFile.c_str()) ); … … 497 531 m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled ); 498 532 m_acTEncTop[layer].setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled ); 533 #if Q0189_TMVP_CONSTRAINTS 534 m_acTEncTop[layer].setTMVPConstraintsSEIEnabled( m_TMVPConstraintsSEIEnabled); 535 #endif 499 536 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 500 537 m_acTEncTop[layer].setInterLayerConstrainedTileSetsSEIEnabled( m_interLayerConstrainedTileSetsSEIEnabled ); … … 614 651 m_acTEncTop[layer].setCGSLUTBit( m_nCGSLUTBit ); 615 652 #endif 653 #if Q0078_ADD_LAYER_SETS 654 m_acTEncTop[layer].setNumAddLayerSets( m_numAddLayerSets ); 655 #endif 616 656 } 617 657 } … … 799 839 m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue ( m_nominalWhiteLevelLumaCodeValue ); 800 840 m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue ( m_extendedWhiteLevelLumaCodeValue ); 841 #if P0050_KNEE_FUNCTION_SEI 842 m_cTEncTop.setKneeSEIEnabled ( m_kneeSEIEnabled ); 843 m_cTEncTop.setKneeSEIId ( m_kneeSEIId ); 844 m_cTEncTop.setKneeSEICancelFlag ( m_kneeSEICancelFlag ); 845 m_cTEncTop.setKneeSEIPersistenceFlag ( m_kneeSEIPersistenceFlag ); 846 m_cTEncTop.setKneeSEIMappingFlag ( m_kneeSEIMappingFlag ); 847 m_cTEncTop.setKneeSEIInputDrange ( m_kneeSEIInputDrange ); 848 m_cTEncTop.setKneeSEIInputDispLuminance ( m_kneeSEIInputDispLuminance ); 849 m_cTEncTop.setKneeSEIOutputDrange ( m_kneeSEIOutputDrange ); 850 m_cTEncTop.setKneeSEIOutputDispLuminance ( m_kneeSEIOutputDispLuminance ); 851 m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 ); 852 m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint ); 853 m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 854 #endif 801 855 #if Q0074_SEI_COLOR_MAPPING 802 856 m_cTEncTop.setColorMappingInfoSEIFile ( m_pchSEIColorMappingFile ); … … 994 1048 #endif 995 1049 } 996 #if VPS_RENAME997 1050 m_acTEncTop[0].getVPS()->setMaxLayers( m_numLayers ); 998 #endif999 1051 #if VPS_EXTN_OP_LAYER_SETS 1000 1052 TComVPS* vps = m_acTEncTop[0].getVPS(); … … 1003 1055 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); 1004 1056 1005 vps->setNumLayerSets(m_numLayers); 1006 for(Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1007 { 1008 for(Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 1009 { 1057 #if Q0078_ADD_LAYER_SETS 1058 if (m_numLayerSets > 0) 1059 { 1060 vps->setNumLayerSets(m_numLayerSets+1); 1061 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1062 { 1063 for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 1064 { 1065 vps->setLayerIdIncludedFlag(false, setId, layerId); 1066 } 1067 } 1068 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1069 { 1070 for (Int i = 0; i < m_numLayerInIdList[setId-1]; i++) 1071 { 1072 Int layerId = m_layerSetLayerIdList[setId-1][i]; 1073 1010 1074 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1011 //4 1012 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1013 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1014 1015 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1016 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1017 #endif 1018 if( layerId <= setId ) 1019 { 1075 //4 1076 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1077 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1078 1079 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1080 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1081 #endif 1082 1020 1083 vps->setLayerIdIncludedFlag(true, setId, layerId); 1021 1084 } 1022 else 1023 { 1024 vps->setLayerIdIncludedFlag(false, setId, layerId); 1025 } 1026 } 1027 } 1085 } 1086 } 1087 else 1088 { 1089 // Default layer sets 1090 #endif 1091 vps->setNumLayerSets(m_numLayers); 1092 for (Int setId = 1; setId < vps->getNumLayerSets(); setId++) 1093 { 1094 for (Int layerId = 0; layerId <= vps->getMaxLayerId(); layerId++) 1095 { 1096 #if O0194_DIFFERENT_BITDEPTH_EL_BL 1097 //4 1098 g_bitDepthY = m_acLayerCfg[layerId].m_internalBitDepthY; 1099 g_bitDepthC = m_acLayerCfg[layerId].m_internalBitDepthC; 1100 1101 g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthY : m_acLayerCfg[layerId].m_internalBitDepthY; 1102 g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_acLayerCfg[layerId].m_inputBitDepthC : m_acLayerCfg[layerId].m_internalBitDepthC; 1103 #endif 1104 if (layerId <= setId) 1105 { 1106 vps->setLayerIdIncludedFlag(true, setId, layerId); 1107 } 1108 else 1109 { 1110 vps->setLayerIdIncludedFlag(false, setId, layerId); 1111 } 1112 } 1113 } 1114 #if Q0078_ADD_LAYER_SETS 1115 } 1116 #endif 1117 #if Q0078_ADD_LAYER_SETS 1118 vps->setVpsNumLayerSetsMinus1(vps->getNumLayerSets() - 1); 1119 vps->setNumAddLayerSets(m_numAddLayerSets); 1120 vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets()); 1121 if (m_numAddLayerSets > 0) 1122 { 1123 for (Int setId = 0; setId < m_numAddLayerSets; setId++) 1124 { 1125 for (Int j = 0; j < m_numHighestLayerIdx[setId]; j++) 1126 { 1127 vps->setHighestLayerIdxPlus1(setId, j + 1, m_highestLayerIdx[setId][j] + 1); 1128 } 1129 } 1130 } 1131 #endif 1028 1132 #if VPS_EXTN_MASK_AND_DIM_INFO 1029 1133 UInt i = 0, dimIdLen = 0; … … 1097 1201 #if VPS_TSLAYERS 1098 1202 vps->setMaxTSLayersPresentFlag(true); 1203 1099 1204 for( i = 0; i < vps->getMaxLayers(); i++ ) 1100 1205 { … … 1102 1207 } 1103 1208 #endif 1104 #if N0120_MAX_TID_REF_PRESENT_FLAG1105 #if N0120_MAX_TID_REF_CFG1106 1209 vps->setMaxTidRefPresentFlag(m_maxTidRefPresentFlag); 1107 #else1108 vps->setMaxTidRefPresentFlag(true);1109 #endif1110 1210 if (vps->getMaxTidRefPresentFlag()) 1111 1211 { 1112 1212 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1113 1213 { 1114 #if N0120_MAX_TID_REF_CFG1115 1214 #if O0225_MAX_TID_FOR_REF_LAYERS 1116 1215 for( Int j = i+1; j < vps->getMaxLayers(); j++) … … 1121 1220 vps->setMaxTidIlRefPicsPlus1(i, m_acTEncTop[i].getMaxTidIlRefPicsPlus1()); 1122 1221 #endif 1123 #else 1222 } 1223 } 1224 else 1225 { 1226 for( i = 0; i < vps->getMaxLayers() - 1; i++ ) 1227 { 1124 1228 #if O0225_MAX_TID_FOR_REF_LAYERS 1125 1229 for( Int j = i+1; j < vps->getMaxLayers(); j++) 1126 1230 { 1127 vps->setMaxTidIlRefPicsPlus1(i, j, vps->getMaxTLayers()+1);1128 }1129 #else1130 vps->setMaxTidIlRefPicsPlus1(i, vps->getMaxTLayers()+1);1131 #endif1132 #endif1133 }1134 }1135 else1136 {1137 for( i = 0; i < vps->getMaxLayers() - 1; i++ )1138 {1139 #if O0225_MAX_TID_FOR_REF_LAYERS1140 for( Int j = i+1; j < vps->getMaxLayers(); j++)1141 {1142 1231 vps->setMaxTidIlRefPicsPlus1(i, j, 7); 1143 1232 } … … 1147 1236 } 1148 1237 } 1149 #endif1150 #if ILP_SSH_SIG1151 #if ILP_SSH_SIG_FIX1152 1238 vps->setIlpSshSignalingEnabledFlag(false); 1153 #else1154 vps->setIlpSshSignalingEnabledFlag(true);1155 #endif1156 #endif1157 1239 #if VPS_EXTN_PROFILE_INFO 1158 1240 vps->getPTLForExtnPtr()->resize(vps->getNumLayerSets()); … … 1162 1244 // Note - may need to be changed for other layer structures. 1163 1245 *(vps->getPTLForExtn(setId)) = *(m_acTEncTop[setId].getSPS()->getPTL()); 1164 }1165 #endif1166 // Target output layer1167 vps->setNumOutputLayerSets(vps->getNumLayerSets());1168 vps->setNumProfileTierLevel(vps->getNumLayerSets());1169 #if P0295_DEFAULT_OUT_LAYER_IDC1170 vps->setDefaultTargetOutputLayerIdc(1);1171 #else1172 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC1173 vps->setDefaultOneTargetOutputLayerIdc(1);1174 #else1175 vps->setDefaultOneTargetOutputLayerFlag(true);1176 #endif1177 #endif1178 for(i = 1; i < vps->getNumLayerSets(); i++)1179 {1180 vps->setProfileLevelTierIdx(i, i);1181 vps->setOutputLayerSetIdx(i, i);1182 }1183 #endif1184 #if VPS_DPB_SIZE_TABLE1185 // The Layer ID List variables can be derived here.1186 #if DERIVE_LAYER_ID_LIST_VARIABLES1187 vps->deriveLayerIdListVariables();1188 #endif1189 #if RESOLUTION_BASED_DPB1190 vps->assignSubDpbIndices();1191 #else1192 vps->deriveNumberOfSubDpbs();1193 #endif1194 1195 // derive OutputLayerFlag[i][j]1196 if( vps->getDefaultTargetOutputLayerIdc() == 1 )1197 {1198 // default_target_output_layer_idc equal to 1 specifies that only the layer with the highest value of nuh_layer_id such that nuh_layer_id equal to nuhLayerIdA and1199 // AuxId[ nuhLayerIdA ] equal to 0 in each of the output layer sets with index in the range of 1 to vps_num_layer_sets_minus1, inclusive, is an output layer of its output layer set.1200 1201 // Include the highest layer as output layer for each layer set1202 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++)1203 {1204 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )1205 {1206 if( vps->getLayerIdIncludedFlag(lsIdx, layer) )1207 {1208 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );1209 }1210 }1211 }1212 }1213 else1214 {1215 // cases when default_target_output_layer_idc is not equal to 11216 assert(!"default_target_output_layer_idc not equal to 1 is not yet supported");1217 }1218 1219 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension1220 for(i = 1; i < vps->getNumOutputLayerSets(); i++)1221 {1222 #if CHANGE_NUMSUBDPB_IDX1223 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i );1224 #endif1225 Int layerSetId = vps->getOutputLayerSetIdx(i);1226 1227 for(Int j = 0; j < vps->getMaxTLayers(); j++)1228 {1229 1230 Int maxNumReorderPics = -1;1231 #if CHANGE_NUMSUBDPB_IDX1232 #if RESOLUTION_BASED_DPB1233 for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++)1234 #else1235 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++)1236 #endif1237 #else1238 for(Int k = 0; k < vps->getNumSubDpbs(i); k++)1239 #endif1240 {1241 Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set1242 #if RESOLUTION_BASED_DPB1243 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );1244 // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated1245 // at the encoder, modify below1246 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );1247 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1;1248 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue );1249 #else1250 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );1251 #endif1252 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));1253 }1254 #if RESOLUTION_BASED_DPB1255 for(Int k = 0; k < vps->getNumSubDpbs(i); k++)1256 {1257 // Decrement m_maxVpsDecPicBufferingMinus11258 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j );1259 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 );1260 }1261 #endif1262 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);1263 vps->determineSubDpbInfoFlags();1264 }1265 1246 } 1266 1247 #endif … … 1271 1252 Bool isDefaultDirectDependencyTypeSet = false; 1272 1253 #endif 1273 for (UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)1274 { 1275 vps->setNumDirectRefLayers( layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers());1276 maxDirectRefLayers = max<UInt>( maxDirectRefLayers, vps->getNumDirectRefLayers( layerCtr ));1277 1278 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)1279 { 1280 vps->setRefLayerId( layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i));1254 for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1255 { 1256 vps->setNumDirectRefLayers(layerCtr, m_acTEncTop[layerCtr].getNumDirectRefLayers()); 1257 maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layerCtr)); 1258 1259 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++) 1260 { 1261 vps->setRefLayerId(layerCtr, i, m_acTEncTop[layerCtr].getRefLayerId(i)); 1281 1262 } 1282 1263 // Set direct dependency flag 1283 1264 // Initialize flag to 0 1284 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1285 { 1286 vps->setDirectDependencyFlag( layerCtr, refLayerCtr, false);1287 } 1288 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++)1289 { 1290 vps->setDirectDependencyFlag( 1265 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1266 { 1267 vps->setDirectDependencyFlag(layerCtr, refLayerCtr, false); 1268 } 1269 for (i = 0; i < vps->getNumDirectRefLayers(layerCtr); i++) 1270 { 1271 vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true); 1291 1272 } 1292 1273 // prediction indications 1293 1274 vps->setDirectDepTypeLen(2); // sample and motion types are encoded 1294 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++)1295 { 1296 if (vps->getDirectDependencyFlag( 1275 for (Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) 1276 { 1277 if (vps->getDirectDependencyFlag(layerCtr, refLayerCtr)) 1297 1278 { 1298 1279 assert(m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) || m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr)); 1299 vps->setDirectDependencyType( 1300 1280 vps->setDirectDependencyType(layerCtr, refLayerCtr, ((m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) ? 1 : 0) | 1281 (m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr) ? 2 : 0)) - 1); 1301 1282 #if O0096_DEFAULT_DEPENDENCY_TYPE 1302 1283 if (!isDefaultDirectDependencyTypeSet) … … 1314 1295 else 1315 1296 { 1316 vps->setDirectDependencyType( layerCtr, refLayerCtr, 0);1297 vps->setDirectDependencyType(layerCtr, refLayerCtr, 0); 1317 1298 } 1318 1299 } … … 1320 1301 1321 1302 #if O0092_0094_DEPENDENCY_CONSTRAINT 1322 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1323 { 1324 vps->setNumRefLayers(vps->getLayerIdInNuh(layerCtr)); // identify the number of direct and indirect reference layers of current layer and set recursiveRefLayersFlags 1325 } 1326 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1327 { 1328 for(UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1329 { 1330 assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS); 1331 } 1332 } 1333 #endif 1303 vps->setNumRefLayers(); 1304 1305 if (vps->getMaxLayers() > MAX_REF_LAYERS) 1306 { 1307 for (UInt layerCtr = 1; layerCtr <= vps->getMaxLayers() - 1; layerCtr++) 1308 { 1309 assert(vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS); 1310 } 1311 } 1312 #endif 1313 #if Q0078_ADD_LAYER_SETS 1314 vps->setPredictedLayerIds(); 1315 vps->setTreePartitionLayerIdList(); 1316 vps->setLayerIdIncludedFlagsForAddLayerSets(); 1317 #endif 1318 #endif 1319 // Target output layer 1320 vps->setNumOutputLayerSets(vps->getNumLayerSets()); 1321 vps->setNumProfileTierLevel(vps->getNumLayerSets()); 1322 #if P0295_DEFAULT_OUT_LAYER_IDC 1323 vps->setDefaultTargetOutputLayerIdc(1); 1324 #else 1325 #if O0109_DEFAULT_ONE_OUT_LAYER_IDC 1326 vps->setDefaultOneTargetOutputLayerIdc(1); 1327 #else 1328 vps->setDefaultOneTargetOutputLayerFlag(true); 1329 #endif 1330 #endif 1331 for(i = 1; i < vps->getNumLayerSets(); i++) 1332 { 1333 vps->setProfileLevelTierIdx(i, i); 1334 vps->setOutputLayerSetIdx(i, i); 1335 } 1336 #endif 1337 #if VPS_DPB_SIZE_TABLE 1338 // The Layer ID List variables can be derived here. 1339 #if DERIVE_LAYER_ID_LIST_VARIABLES 1340 vps->deriveLayerIdListVariables(); 1341 #endif 1342 #if RESOLUTION_BASED_DPB 1343 vps->assignSubDpbIndices(); 1344 #else 1345 vps->deriveNumberOfSubDpbs(); 1346 #endif 1347 1348 // derive OutputLayerFlag[i][j] 1349 if( vps->getDefaultTargetOutputLayerIdc() == 1 ) 1350 { 1351 // default_output_layer_idc equal to 1 specifies that only the layer with the highest value of nuh_layer_id such that nuh_layer_id equal to nuhLayerIdA and 1352 // AuxId[ nuhLayerIdA ] equal to 0 in each of the output layer sets with index in the range of 1 to vps_num_layer_sets_minus1, inclusive, is an output layer of its output layer set. 1353 1354 // Include the highest layer as output layer for each layer set 1355 for(Int lsIdx = 1; lsIdx < vps->getNumLayerSets(); lsIdx++) 1356 { 1357 for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ ) 1358 { 1359 #if !Q0078_ADD_LAYER_SETS // the following condition is incorrect and is not needed anyway 1360 if( vps->getLayerIdIncludedFlag(lsIdx, layer) ) 1361 #endif 1362 { 1363 vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 ); 1364 } 1365 } 1366 } 1367 } 1368 else 1369 { 1370 // cases when default_output_layer_idc is not equal to 1 1371 assert(!"default_output_layer_idc not equal to 1 is not yet supported"); 1372 } 1373 1374 // Initialize dpb_size_table() for all ouput layer sets in the VPS extension 1375 for(i = 1; i < vps->getNumOutputLayerSets(); i++) 1376 { 1377 #if CHANGE_NUMSUBDPB_IDX 1378 Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx( i ); 1379 #endif 1380 Int layerSetId = vps->getOutputLayerSetIdx(i); 1381 1382 for(Int j = 0; j < vps->getMaxTLayers(); j++) 1383 { 1384 1385 Int maxNumReorderPics = -1; 1386 #if CHANGE_NUMSUBDPB_IDX 1387 #if RESOLUTION_BASED_DPB 1388 for(Int k = 0; k < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); k++) 1389 #else 1390 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1391 #endif 1392 #else 1393 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1394 #endif 1395 { 1396 Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set 1397 #if RESOLUTION_BASED_DPB 1398 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 ); 1399 // Add sub-DPB sizes of layers belonging to a sub-DPB. If a different sub-DPB size is calculated 1400 // at the encoder, modify below 1401 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1402 oldValue += vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j ) + 1; 1403 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue ); 1404 #else 1405 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 ); 1406 #endif 1407 maxNumReorderPics = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j)); 1408 } 1409 #if RESOLUTION_BASED_DPB 1410 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) 1411 { 1412 // Decrement m_maxVpsDecPicBufferingMinus1 1413 Int oldValue = vps->getMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j ); 1414 vps->setMaxVpsDecPicBufferingMinus1( i, vps->getSubDpbAssigned( layerSetIdxForOutputLayerSet, k ), j, oldValue - 1 ); 1415 } 1416 #endif 1417 vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics); 1418 vps->determineSubDpbInfoFlags(); 1419 } 1420 } 1334 1421 #endif 1335 1422 vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true); … … 1339 1426 if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0 ) 1340 1427 { 1428 #if Q0078_ADD_LAYER_SETS 1429 vps->setPocLsbNotPresentFlag(i, true); // make independedent layers base-layer compliant 1430 #else 1341 1431 vps->setPocLsbNotPresentFlag(i, false); 1432 #endif 1342 1433 } 1343 1434 } … … 1349 1440 vps->setCrossLayerAlignedIdrOnlyFlag( m_crossLayerAlignedIdrOnlyFlag ); 1350 1441 #endif 1351 #if N0147_IRAP_ALIGN_FLAG1352 1442 vps->setCrossLayerIrapAlignFlag( m_crossLayerIrapAlignFlag ); 1353 1443 for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++) … … 1365 1455 } 1366 1456 } 1367 #endif1368 1457 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 1369 1458 vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false); … … 1418 1507 { 1419 1508 vps->setVpsVuiBspHrdPresentFlag(true); 1509 #if Q0078_ADD_LAYER_SETS 1510 vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1); 1511 #else 1420 1512 vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2); 1513 #endif 1421 1514 vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1); 1422 1515 for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ ) … … 1451 1544 vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) ); 1452 1545 } 1546 #if Q0078_ADD_LAYER_SETS 1547 for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++) 1548 #else 1453 1549 for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++) 1550 #endif 1454 1551 { 1455 1552 vps->setNumBitstreamPartitions(h, 1); … … 1532 1629 if( m_isField ) 1533 1630 { 1534 #if SVC_ UPSAMPLING1631 #if SVC_EXTENSION 1535 1632 #if LAYER_CTB 1536 1633 #if AUXILIARY_PICTURES … … 1552 1649 else 1553 1650 { 1554 #if SVC_ UPSAMPLING1651 #if SVC_EXTENSION 1555 1652 #if LAYER_CTB 1556 1653 #if AUXILIARY_PICTURES … … 1991 2088 rpcPicYuvRec = new TComPicYuv; 1992 2089 1993 #if SVC_UPSAMPLING1994 2090 #if LAYER_CTB 1995 2091 #if AUXILIARY_PICTURES … … 2005 2101 #endif 2006 2102 #endif 2007 #else2008 rpcPicYuvRec->create( m_acLayerCfg[layer].getSourceWidth(), m_acLayerCfg[layer].getSourceHeight(), m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth );2009 #endif2010 2103 2011 2104 } … … 2032 2125 Void TAppEncTop::xWriteRecon(UInt layer, Int iNumEncoded) 2033 2126 { 2127 #if REPN_FORMAT_IN_VPS 2128 ChromaFormat chromaFormatIdc = m_acLayerCfg[layer].getChromaFormatIDC(); 2129 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 2130 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 2131 #endif 2132 2034 2133 if (m_isField) 2035 2134 { … … 2054 2153 #endif 2055 2154 { 2155 #if REPN_FORMAT_IN_VPS 2156 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft() * xScal, m_acLayerCfg[layer].getConfRight() * xScal, 2157 m_acLayerCfg[layer].getConfTop() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal, m_isTopFieldFirst ); 2158 #else 2056 2159 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRecTop, pcPicYuvRecBottom, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom(), m_isTopFieldFirst ); 2160 #endif 2057 2161 } 2058 2162 } … … 2078 2182 #endif 2079 2183 { 2184 #if REPN_FORMAT_IN_VPS 2185 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft() * xScal, m_acLayerCfg[layer].getConfRight() * xScal, 2186 m_acLayerCfg[layer].getConfTop() * yScal, m_acLayerCfg[layer].getConfBottom() * yScal ); 2187 #else 2080 2188 m_acTVideoIOYuvReconFile[layer].write( pcPicYuvRec, m_acLayerCfg[layer].getConfLeft(), m_acLayerCfg[layer].getConfRight(), 2081 2189 m_acLayerCfg[layer].getConfTop(), m_acLayerCfg[layer].getConfBottom() ); 2190 #endif 2082 2191 } 2083 2192 } -
trunk/source/Lib/TLibCommon/CommonDef.h
r713 r815 58 58 #if SVC_EXTENSION 59 59 #include <vector> 60 #define NV_VERSION "6. 0(HM-14.0)" ///< Current software version60 #define NV_VERSION "6.1 (HM-14.0)" ///< Current software version 61 61 #else 62 62 #define NV_VERSION "14.0" ///< Current software version -
trunk/source/Lib/TLibCommon/SEI.h
r713 r815 37 37 #include <cstring> 38 38 39 #if Q0078_ADD_LAYER_SETS 40 #include "TLibCommon/NAL.h" 41 #endif 42 39 43 //! \ingroup TLibCommon 40 44 //! \{ … … 66 70 POST_FILTER_HINT = 22, 67 71 TONE_MAPPING_INFO = 23, 72 #if P0050_KNEE_FUNCTION_SEI 73 KNEE_FUNCTION_INFO = 24, 74 #endif 68 75 FRAME_PACKING = 45, 69 76 DISPLAY_ORIENTATION = 47, … … 91 98 #if Q0074_SEI_COLOR_MAPPING 92 99 COLOR_MAPPING_INFO = 143, 100 #endif 101 #if Q0078_ADD_LAYER_SETS 102 OUTPUT_LAYER_SET_NESTING = 144, 103 VPS_REWRITING = 145, 104 #endif 105 #if Q0189_TMVP_CONSTRAINTS 106 TMVP_CONSTRAINTS = 146, 107 #endif 108 #if Q0247_FRAME_FIELD_INFO 109 FRAME_FIELD_INFO = 147, 93 110 #endif 94 111 }; … … 407 424 Int m_extendedWhiteLevelLumaCodeValue; 408 425 }; 409 426 #if P0050_KNEE_FUNCTION_SEI 427 class SEIKneeFunctionInfo : public SEI 428 { 429 public: 430 PayloadType payloadType() const { return KNEE_FUNCTION_INFO; } 431 SEIKneeFunctionInfo() {} 432 virtual ~SEIKneeFunctionInfo() {} 433 434 Int m_kneeId; 435 Bool m_kneeCancelFlag; 436 Bool m_kneePersistenceFlag; 437 Bool m_kneeMappingFlag; 438 Int m_kneeInputDrange; 439 Int m_kneeInputDispLuminance; 440 Int m_kneeOutputDrange; 441 Int m_kneeOutputDispLuminance; 442 Int m_kneeNumKneePointsMinus1; 443 std::vector<Int> m_kneeInputKneePoint; 444 std::vector<Int> m_kneeOutputKneePoint; 445 }; 446 #endif 410 447 #if Q0074_SEI_COLOR_MAPPING 411 448 class SEIColorMappingInfo : public SEI … … 486 523 #endif 487 524 525 #if Q0189_TMVP_CONSTRAINTS 526 class SEITMVPConstrains : public SEI 527 { 528 public: 529 PayloadType payloadType() const { return TMVP_CONSTRAINTS; } 530 531 SEITMVPConstrains() 532 : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0) 533 {} 534 535 virtual ~SEITMVPConstrains() 536 { 537 } 538 539 UInt prev_pics_not_used_flag; 540 UInt no_intra_layer_col_pic_flag; 541 }; 542 #endif 543 544 #if Q0247_FRAME_FIELD_INFO 545 class SEIFrameFieldInfo: public SEI 546 { 547 public: 548 PayloadType payloadType() const { return FRAME_FIELD_INFO; } 549 550 SEIFrameFieldInfo() 551 : m_ffinfo_picStruct(0),m_ffinfo_sourceScanType(0), m_ffinfo_duplicateFlag(false) 552 {} 553 554 virtual ~SEIFrameFieldInfo() 555 { 556 } 557 558 UInt m_ffinfo_picStruct; 559 UInt m_ffinfo_sourceScanType; 560 Bool m_ffinfo_duplicateFlag; 561 }; 562 563 #endif 564 488 565 typedef std::list<SEI*> SEIMessages; 489 566 … … 583 660 }; 584 661 662 #if Q0078_ADD_LAYER_SETS 663 class SEIOutputLayerSetNesting : public SEI 664 { 665 public: 666 PayloadType payloadType() const { return OUTPUT_LAYER_SET_NESTING; } 667 668 SEIOutputLayerSetNesting() {} 669 virtual ~SEIOutputLayerSetNesting() 670 { 671 if (!m_callerOwnsSEIs) 672 { 673 deleteSEIs(m_nestedSEIs); 674 } 675 } 676 677 Bool m_olsFlag; 678 UInt m_numOlsIndicesMinus1; 679 UInt m_olsIdx[1024]; 680 Bool m_callerOwnsSEIs; 681 SEIMessages m_nestedSEIs; 682 }; 683 684 class SEIVPSRewriting : public SEI 685 { 686 public: 687 PayloadType payloadType() const { return VPS_REWRITING; } 688 689 SEIVPSRewriting() {} 690 virtual ~SEIVPSRewriting() {} 691 692 NALUnit* nalu; 693 }; 694 #endif 695 585 696 //! \} -
trunk/source/Lib/TLibCommon/TCom3DAsymLUT.cpp
r713 r815 44 44 45 45 if( m_pCuboid != NULL ) 46 { 46 47 destroy(); 48 } 47 49 xAllocate3DArray( m_pCuboid , m_nYSize , m_nUSize , m_nVSize ); 48 50 } … … 88 90 89 91 // alignment padding 90 pU += (nWidth>>1); 91 pV += (nWidth>>1); 92 for( Int y = 0 ; y < (nHeight>>1) ; y ++ ) 93 { 94 *pU = pU[-1]; 95 *pV = pV[-1]; 96 pU += nStrideC; 97 pV += nStrideC; 98 } 99 memcpy(pU-(nWidth>>1), pU-(nWidth>>1)-nStrideC, ((nWidth>>1)+1)*sizeof(Pel)); 100 memcpy(pV-(nWidth>>1), pV-(nWidth>>1)-nStrideC, ((nWidth>>1)+1)*sizeof(Pel)); 101 pU = pcPic->getCbAddr(); 102 pV = pcPic->getCrAddr(); 92 pcPic->setBorderExtension( false ); 93 pcPic->extendPicBorder(); 103 94 104 95 Pel iMaxValY = (1<<getOutputBitDepthY())-1; -
trunk/source/Lib/TLibCommon/TCom3DAsymLUT.h
r713 r815 100 100 p[0] = new T*[xSize*ySize]; 101 101 for( Int x = 1 ; x < xSize ; x++ ) 102 { 102 103 p[x] = p[x-1] + ySize; 104 } 103 105 p[0][0] = new T[xSize*ySize*zSize]; 104 106 for( Int x = 0 ; x < xSize ; x++ ) 105 107 { 106 108 for( Int y = 0 ; y < ySize ; y++ ) 109 { 107 110 p[x][y] = p[0][0] + x * ySize * zSize + y * zSize; 111 } 108 112 } 109 113 } … … 117 121 { 118 122 if( p[0][0] != NULL ) 123 { 119 124 delete [] p[0][0]; 125 } 120 126 delete [] p[0]; 121 127 } -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r713 r815 3517 3517 #endif 3518 3518 3519 #if N0139_POSITION_ROUNDING_OFFSET 3519 #if REF_IDX_MFM 3520 // offset for collocated block in the motion mapping 3520 3521 if( iMotionMapping == 1 ) 3521 3522 { 3523 Bool unequalPictureSizeFlag = g_posScalingFactor[refLayerIdc][0] != 65536 || g_posScalingFactor[refLayerIdc][1] != 65536; //the condition should be updated according to the WD. 3524 3522 3525 // actually, motion field compression is performed in the Void TComPic::compressMotion() function, but with (+4) the rounding may have effect on the picture boundary check. 3523 iBX = ( ( iBX + 4 ) >> 4 ) << 4; 3524 iBY = ( ( iBY + 4 ) >> 4 ) << 4; 3526 if( unequalPictureSizeFlag ) 3527 { 3528 iBX = ( ( iBX + 4 ) >> 4 ) << 4; 3529 iBY = ( ( iBY + 4 ) >> 4 ) << 4; 3530 } 3531 else 3532 { 3533 iBX += 4; 3534 iBY += 4; 3535 } 3525 3536 } 3526 3537 #endif … … 3637 3648 { 3638 3649 Int refIdxL0 = cMvFieldL0.getRefIdx(); 3639 if(getSlice()->getRefPic(REF_PIC_LIST_0, refIdxL0)->isILR(m_layerId)) 3650 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_0, refIdxL0); 3651 3652 if(refPic->isILR(m_layerId)) 3640 3653 { 3641 3654 checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0); 3655 3656 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3657 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3658 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_layerId, refPic->getLayerId() ); 3642 3659 } 3643 3660 } … … 3645 3662 { 3646 3663 Int refIdxL1 = cMvFieldL1.getRefIdx(); 3647 if(getSlice()->getRefPic(REF_PIC_LIST_1, refIdxL1)->isILR(m_layerId)) 3664 TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_1, refIdxL1); 3665 3666 if(refPic->isILR(m_layerId)) 3648 3667 { 3649 3668 checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0); 3669 3670 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3671 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3672 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_layerId, refPic->getLayerId() ); 3650 3673 } 3651 3674 } -
trunk/source/Lib/TLibCommon/TComPic.cpp
r595 r815 72 72 { 73 73 } 74 #if SVC_ UPSAMPLING74 #if SVC_EXTENSION 75 75 #if AUXILIARY_PICTURES 76 76 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, … … 184 184 185 185 deleteSEIs(m_SEIs); 186 #if SVC_EXTENSION && SVC_UPSAMPLING186 #if SVC_EXTENSION 187 187 for( Int i = 0; i < MAX_LAYERS; i++ ) 188 188 { -
trunk/source/Lib/TLibCommon/TComPic.h
r713 r815 92 92 Int m_nFrameBit; 93 93 #endif 94 94 #if POC_RESET_IDC_DECODER 95 Bool m_currAuFlag; 96 #endif 95 97 public: 96 98 TComPic(); 97 99 virtual ~TComPic(); 98 100 101 #if SVC_EXTENSION 99 102 #if AUXILIARY_PICTURES 100 #if SVC_UPSAMPLING101 103 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 102 104 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 103 105 #else 104 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,105 Int *numReorderPics, Bool bIsVirtual = false );106 #endif107 #else108 #if SVC_UPSAMPLING109 106 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 110 107 Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false ); 108 #endif 111 109 #else 112 110 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 113 Int *numReorderPics, Bool bIsVirtual = false ); 114 #endif 115 #endif 111 Int *numReorderPics, Bool bIsVirtual = false ); 112 #endif //SVC_EXTENSION 113 116 114 virtual Void destroy(); 117 115 … … 202 200 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 203 201 #if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM 204 Bool isILR( UInt currLayerId ) { return ( getIsLongTerm()&& m_layerId < currLayerId ); }202 Bool isILR( UInt currLayerId ) { return ( m_bIsLongTerm && m_layerId < currLayerId ); } 205 203 #endif 206 204 #if REF_IDX_MFM … … 227 225 Int getFrameBit() { return m_nFrameBit; } 228 226 #endif 227 #if POC_RESET_IDC_DECODER 228 Bool isCurrAu() { return m_currAuFlag; } 229 Void setCurrAuFlag(Bool x) {m_currAuFlag = x; } 230 #endif 229 231 };// END CLASS DEFINITION TComPic 230 232 -
trunk/source/Lib/TLibCommon/TComPicYuv.cpp
r713 r815 67 67 { 68 68 } 69 70 #if SVC_EXTENSION 69 71 #if AUXILIARY_PICTURES 70 #if SVC_UPSAMPLING71 72 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 72 73 #else 73 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth )74 #endif75 #else76 #if SVC_UPSAMPLING77 74 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps ) 75 #endif 78 76 #else 79 77 Void TComPicYuv::create( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ) 80 78 #endif 81 #endif82 79 { 83 80 m_iPicWidth = iPicWidth; 84 81 m_iPicHeight = iPicHeight; 85 82 86 #if SVC_ UPSAMPLING83 #if SVC_EXTENSION 87 84 if(pcSps != NULL) 88 85 { … … 369 366 } 370 367 368 #if SVC_EXTENSION 369 Void TComPicYuv::dump( Char* pFileName, Bool bAdd, Int bitDepth ) 370 { 371 FILE* pFile; 372 if (!bAdd) 373 { 374 pFile = fopen (pFileName, "wb"); 375 } 376 else 377 { 378 pFile = fopen (pFileName, "ab"); 379 } 380 381 if( bitDepth == 8 ) 382 { 383 dump( pFileName, bAdd ); 384 return; 385 } 386 387 Int x, y; 388 UChar uc; 389 390 Pel* piY = getLumaAddr(); 391 Pel* piCb = getCbAddr(); 392 Pel* piCr = getCrAddr(); 393 394 for ( y = 0; y < m_iPicHeight; y++ ) 395 { 396 for ( x = 0; x < m_iPicWidth; x++ ) 397 { 398 uc = piY[x] & 0xff; 399 fwrite( &uc, sizeof(UChar), 1, pFile ); 400 uc = (piY[x] >> 8) & 0xff; 401 fwrite( &uc, sizeof(UChar), 1, pFile ); 402 } 403 piY += getStride(); 404 } 405 406 for ( y = 0; y < m_iPicHeight >> 1; y++ ) 407 { 408 for ( x = 0; x < m_iPicWidth >> 1; x++ ) 409 { 410 uc = piCb[x] & 0xff; 411 fwrite( &uc, sizeof(UChar), 1, pFile ); 412 uc = (piCb[x] >> 8) & 0xff; 413 fwrite( &uc, sizeof(UChar), 1, pFile ); 414 } 415 piCb += getCStride(); 416 } 417 418 for ( y = 0; y < m_iPicHeight >> 1; y++ ) 419 { 420 for ( x = 0; x < m_iPicWidth >> 1; x++ ) 421 { 422 uc = piCr[x] & 0xff; 423 fwrite( &uc, sizeof(UChar), 1, pFile ); 424 uc = (piCr[x] >> 8) & 0xff; 425 fwrite( &uc, sizeof(UChar), 1, pFile ); 426 } 427 piCr += getCStride(); 428 } 429 430 fclose(pFile); 431 } 432 433 #endif 371 434 372 435 //! \} -
trunk/source/Lib/TLibCommon/TComPicYuv.h
r595 r815 42 42 #include "CommonDef.h" 43 43 #include "TComRom.h" 44 #if SVC_ UPSAMPLING44 #if SVC_EXTENSION 45 45 #include "TComSlice.h" 46 46 #endif … … 94 94 ChromaFormat m_chromaFormatIDC; ////< Chroma Format 95 95 #endif 96 #if SVC_UPSAMPLING97 96 Window m_conformanceWindow; 98 #endif99 97 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 100 98 Bool m_isReconstructed; … … 112 110 // Memory management 113 111 // ------------------------------------------------------------------------------------------------ 112 #if SVC_EXTENSION 114 113 #if AUXILIARY_PICTURES 115 #if SVC_UPSAMPLING116 114 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 117 115 #else 118 Void create ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth );119 #endif120 #else121 #if SVC_UPSAMPLING122 116 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, TComSPS* pcSps = NULL); 117 #endif 123 118 #else 124 119 Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth ); 125 #endif 126 #endif 120 #endif //SVC_EXTENSION 127 121 128 122 Void destroy (); … … 187 181 #if SVC_EXTENSION 188 182 Void setHeight ( Int iPicHeight ) { m_iPicHeight = iPicHeight; } 189 #if SVC_UPSAMPLING190 183 Window& getConformanceWindow() { return m_conformanceWindow; } 191 184 Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } 192 #endif193 185 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 194 186 Void setReconstructed(Bool x) { m_isReconstructed = x; } … … 199 191 Void convertToMonochrome(); 200 192 #endif 193 Void dump( Char* pFileName, Bool bAdd, Int bitDepth ); 201 194 #endif //SVC_EXTENSION 202 195 -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r713 r815 487 487 pcCU->clipMv(cMv); 488 488 489 #if SVC_EXTENSION 490 if( pcCU->getLayerId() > 0 ) 491 { 492 TComPic* refPic = pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx); 493 494 if( refPic->isILR(pcCU->getLayerId()) ) 495 { 496 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 497 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 498 assert( pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), refPic->getLayerId() ) ); 499 489 500 #if REF_IDX_ME_ZEROMV 490 assert( ( pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) && cMv.getHor() == 0 && cMv.getVer() == 0 ) || pcCU->getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(pcCU->getLayerId()) == false ); 501 // It is a requirement of bitstream conformance that the variables mvLX[ 0 ] and mvLX[ 1 ] shall be equal to 0 if the value of refIdxLX corresponds to an inter-layer reference picture. 502 assert( cMv.getHor() == 0 && cMv.getVer() == 0 ); 503 #endif 504 } 505 506 } 491 507 #endif 492 508 … … 765 781 } 766 782 767 #if SVC_ UPSAMPLING783 #if SVC_EXTENSION 768 784 #if O0215_PHASE_ALIGNMENT 769 785 #if O0194_JOINT_US_BITSHIFT … … 791 807 #endif 792 808 #endif 793 #endif 809 #endif //SVC_EXTENSION 794 810 //! \} -
trunk/source/Lib/TLibCommon/TComPrediction.h
r713 r815 48 48 #include "TComWeightPrediction.h" 49 49 50 #if SVC_ UPSAMPLING50 #if SVC_EXTENSION 51 51 #include "TComUpsampleFilter.h" 52 52 #endif … … 72 72 73 73 TComInterpolationFilter m_if; 74 75 #if SVC_UPSAMPLING76 TComUpsampleFilter m_cUsf;77 #endif78 74 79 75 Pel* m_pLumaRecBuffer; ///< array for downsampled reconstructed luma sample … … 94 90 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 95 91 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); 92 93 #if SVC_EXTENSION 94 TComUpsampleFilter m_cUsf; 95 #endif 96 96 97 97 public: … … 118 118 119 119 #if SVC_EXTENSION 120 #if SVC_UPSAMPLING121 120 #if O0215_PHASE_ALIGNMENT 122 121 #if O0194_JOINT_US_BITSHIFT … … 132 131 #endif 133 132 #endif 134 #endif135 133 #endif //SVC_EXTENSION 136 134 }; -
trunk/source/Lib/TLibCommon/TComRom.cpp
r595 r815 527 527 { 528 528 case NAL_UNIT_CODED_SLICE_TRAIL_N: 529 return "TRAIL_N"; 529 530 case NAL_UNIT_CODED_SLICE_TRAIL_R: 530 return "TRAIL ";531 return "TRAIL_R"; 531 532 532 533 case NAL_UNIT_CODED_SLICE_TSA_N: 534 return " TSA_N"; 533 535 case NAL_UNIT_CODED_SLICE_TSA_R: 534 return " TSA ";536 return " TSA_R"; 535 537 536 538 case NAL_UNIT_CODED_SLICE_STSA_N: 539 return " STSA_N"; 537 540 case NAL_UNIT_CODED_SLICE_STSA_R: 538 return " STSA ";541 return " STSA_R"; 539 542 540 543 case NAL_UNIT_CODED_SLICE_RADL_N: 544 return " RADL_N"; 541 545 case NAL_UNIT_CODED_SLICE_RADL_R: 542 return " RADL ";546 return " RADL_R"; 543 547 544 548 case NAL_UNIT_CODED_SLICE_RASL_N: 549 return " RASL_N"; 545 550 case NAL_UNIT_CODED_SLICE_RASL_R: 546 return " RASL ";551 return " RASL_R"; 547 552 548 553 case NAL_UNIT_CODED_SLICE_BLA_W_LP: 549 554 case NAL_UNIT_CODED_SLICE_BLA_W_RADL: 550 555 case NAL_UNIT_CODED_SLICE_BLA_N_LP: 551 return " BLA";556 return " BLA"; 552 557 553 558 case NAL_UNIT_CODED_SLICE_IDR_W_RADL: 554 559 case NAL_UNIT_CODED_SLICE_IDR_N_LP: 555 return " IDR";560 return " IDR"; 556 561 557 562 case NAL_UNIT_CODED_SLICE_CRA: 558 return " CRA";563 return " CRA"; 559 564 560 565 default: 561 return " ";566 return " "; 562 567 }; 563 568 } -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r713 r815 125 125 , m_pocMsbValPresentFlag ( false ) 126 126 #endif 127 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 128 , m_picOrderCntLsb (0) 129 #endif 127 130 #endif //SVC_EXTENSION 128 131 { … … 200 203 m_numEntryPointOffsets = 0; 201 204 m_enableTMVPFlag = true; 205 #if POC_RESET_IDC_SIGNALLING 206 m_pocResetIdc = 0; 207 m_pocResetPeriodId = 0; 208 m_fullPocResetFlag = false; 209 m_pocLsbVal = 0; 210 m_pocMsbVal = 0; 211 m_pocMsbValRequiredFlag = false; 212 m_pocMsbValPresentFlag = false; 213 #endif 214 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 215 m_picOrderCntLsb = 0; 216 #endif 202 217 } 203 218 … … 223 238 } 224 239 #endif 225 240 #if POC_RESET_IDC_DECODER 241 Bool TComSlice::getRaslPicFlag () 242 { 243 return getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R 244 || getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N; 245 } 246 Bool TComSlice::getRadlPicFlag () 247 { 248 return getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R 249 || getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N; 250 } 251 #endif 252 #if POC_RESET_IDC_ENCODER 253 Void TComSlice::decrementRefPocValues(Int const decrementValue) 254 { 255 for(Int listNum = 0; listNum < 2; listNum++) 256 { 257 RefPicList dpbPicSliceList = (listNum == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 258 for(Int listIdx = 0; listIdx < getNumRefIdx( dpbPicSliceList ); listIdx++) 259 { 260 setRefPOC( getRefPOC(dpbPicSliceList, listIdx) - decrementValue, 261 dpbPicSliceList, 262 listIdx 263 ); 264 } 265 } 266 } 267 Int TComSlice::getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ) 268 { 269 if( prevLsb - currLsb >= (maxLsbVal >> 1) ) 270 { 271 return prevMsb + maxLsbVal; 272 } 273 else if( currLsb - prevLsb > (maxLsbVal >> 1) ) 274 { 275 return prevMsb - maxLsbVal; 276 } 277 else 278 { 279 return prevMsb; 280 } 281 } 282 #endif 226 283 /** 227 284 - allocate table to contain substream sizes to be written to the slice header. … … 279 336 while ( iterPic != rcListPic.end() ) 280 337 { 338 #if POC_RESET_IDC_ENCODER 339 if( (pcPic->getPOC() == poc) && (pcPic->getSlice(0)->isReferenced()) ) 340 #else 281 341 if(pcPic->getPOC() == poc) 342 #endif 282 343 { 283 344 break; … … 293 354 pcPic = *(iterPic); 294 355 } 295 #if POC_RESET_FLAG 356 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER 296 357 assert( pcPic->getSlice(0)->isReferenced() ); 297 358 #endif … … 512 573 } 513 574 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 514 #if SCALABILITY_MASK_E0104 515 if( m_pcVPS->getScalabilityMask(2) ) 516 #else 517 if( m_pcVPS->getScalabilityMask(1) ) 518 #endif 575 if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) 519 576 { 520 577 Int numResampler = 0; … … 550 607 #endif 551 608 #if O0194_DIFFERENT_BITDEPTH_EL_BL 552 Int sameBitDepth = g_bitDepthYLayer[m_layerId] - g_bitDepthYLayer[refLayerId] + g_bitDepthCLayer[m_layerId] - g_bitDepthCLayer[refLayerId];553 554 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepth 609 Bool sameBitDepths = ( g_bitDepthYLayer[m_layerId] == g_bitDepthYLayer[refLayerId] ) && ( g_bitDepthCLayer[m_layerId] == g_bitDepthCLayer[refLayerId] ); 610 611 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) || !scalingOffset || !sameBitDepths 555 612 #if Q0048_CGS_3D_ASYMLUT 556 613 || getPPS()->getCGSFlag() … … 775 832 #endif 776 833 777 #if N0147_IRAP_ALIGN_FLAG778 834 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 0); 779 835 assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 0); 780 #else781 assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 1);782 assert(m_aiNumRefIdx[REF_PIC_LIST_1] > 1);783 #endif784 836 785 837 //set L0 inter-layer reference picture modification 786 838 #if RPL_INIT_N0316_N0082 787 839 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 840 841 if( m_activeNumILRRefIdx > 1 ) 842 { 843 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] >= (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true; 844 } 788 845 #else 789 846 Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true; 790 847 #endif 791 #if N0147_IRAP_ALIGN_FLAG792 848 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 ); 793 #endif794 849 refPicListModification->setRefPicListModificationFlagL0(hasModification); 795 850 if(hasModification) … … 799 854 refPicListModification->setRefPicSetIdxL0(i, i); 800 855 } 856 801 857 if(m_aiNumRefIdx[REF_PIC_LIST_0] > numberOfRpsCurrTempList) 802 858 { 803 859 // repeat last ref pic when the number of active ref idx are more than RPS entries 804 860 for (Int i = numberOfRpsCurrTempList; i < m_aiNumRefIdx[REF_PIC_LIST_0]; i ++) 805 861 { … … 809 865 else 810 866 { 811 for(Int i = m_activeNumILRRefIdx; i > 0; i-- ) 867 // number of ILRPs included into the reference picture list with the list modification 868 Int includeNumILRP = min( max(1, m_aiNumRefIdx[REF_PIC_LIST_0]-numberOfPocBeforeCurr), m_activeNumILRRefIdx); 869 870 for(Int i = includeNumILRP; i > 0; i-- ) 812 871 { 813 872 #if RPL_INIT_N0316_N0082 814 873 if((numberOfPocBeforeCurr) >= m_aiNumRefIdx[REF_PIC_LIST_0]) 815 874 { 816 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr );875 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr + includeNumILRP - i); 817 876 } 818 877 else 819 878 { 820 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr );879 refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr + includeNumILRP - i); 821 880 for (Int j = numberOfPocBeforeCurr; j < (m_aiNumRefIdx[REF_PIC_LIST_0] - i); j++) 822 881 { 823 refPicListModification->setRefPicSetIdxL0(j, j + m_activeNumILRRefIdx); 882 assert( j + includeNumILRP < numberOfRpsCurrTempList ); 883 refPicListModification->setRefPicSetIdxL0(j, j + includeNumILRP); 824 884 } 825 885 } … … 832 892 833 893 //set L1 inter-layer reference picture modification 834 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] == numberOfRpsCurrTempList) ? false : true; 835 #if N0147_IRAP_ALIGN_FLAG 894 hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] >= numberOfRpsCurrTempList) ? false : true; 836 895 hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_1] > 1 ); 837 #endif838 896 839 897 refPicListModification->setRefPicListModificationFlagL1(hasModification); … … 854 912 else 855 913 { 856 for(Int i = m_activeNumILRRefIdx; i > 0; i-- ) 914 Int includeNumILRP = min(m_aiNumRefIdx[REF_PIC_LIST_1], m_activeNumILRRefIdx); 915 916 for(Int i = includeNumILRP; i > 0; i-- ) 857 917 { 858 918 refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfRpsCurrTempList - i); … … 1088 1148 rpcPic->setCurrSliceIdx(0); 1089 1149 #if NO_CLRAS_OUTPUT_FLAG 1150 #if POC_RESET_IDC_ENCODER 1090 1151 if (noClrasOutputFlag) 1091 1152 { 1153 rpcPic->getSlice(0)->setReferenced(false); // all layers // TODO. This does not mark all layers 1154 } 1155 else 1156 { 1157 if (rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false); // only current layer 1158 } 1159 #else 1160 if (noClrasOutputFlag) 1161 { 1092 1162 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); // all layers 1093 1163 } … … 1096 1166 if (rpcPic->getPOC() != pocCurr && rpcPic->getLayerId() == m_layerId) rpcPic->getSlice(0)->setReferenced(false); // only current layer 1097 1167 } 1168 #endif 1098 1169 #else 1099 1170 if (rpcPic->getPOC() != pocCurr) rpcPic->getSlice(0)->setReferenced(false); … … 1101 1172 iterPic++; 1102 1173 } 1174 #if POC_RESET_IDC_ENCODER 1175 this->getPic()->getSlice(0)->setReferenced(true); // Mark the current picture back as refererced. 1176 #endif 1103 1177 if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1104 1178 || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 1329 1403 } 1330 1404 1331 1405 #if POC_RESET_IDC_ENCODER 1406 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset) 1407 #else 1332 1408 Void TComSlice::checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic) 1409 #endif 1333 1410 { 1334 1411 TComPic* rpcPic; … … 1419 1496 nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL) 1420 1497 { 1498 #if POC_RESET_IDC_ENCODER 1499 if( usePocBeforeReset ) 1500 { 1501 assert(rpcPic->getSlice(0)->getPocValueBeforeReset() < this->getPocValueBeforeReset()); 1502 } 1503 else 1504 { 1505 assert(rpcPic->getPOC() < this->getPOC()); 1506 } 1507 #else 1421 1508 assert(rpcPic->getPOC() < this->getPOC()); 1509 #endif 1422 1510 } 1423 1511 } … … 1437 1525 if(this->getAssociatedIRAPPOC() != rpcPic->getPOC()) 1438 1526 { 1527 #if POC_RESET_IDC_ENCODER 1528 if( usePocBeforeReset ) 1529 { 1530 assert(rpcPic->getSlice(0)->getPocValueBeforeReset() < this->getPocValueBeforeReset()); 1531 } 1532 else 1533 { 1534 assert(rpcPic->getPOC() < this->getPOC()); 1535 } 1536 #else 1439 1537 assert(rpcPic->getPOC() < this->getPOC()); 1538 #endif 1440 1539 } 1441 1540 } … … 1454 1553 // rpcPic is a picture that preceded the leading in decoding order since it exist in the DPB 1455 1554 // rpcPic would violate the constraint if it was a trailing picture 1555 #if POC_RESET_IDC_ENCODER 1556 if( usePocBeforeReset ) 1557 { 1558 assert(rpcPic->getPOC() <= this->getAssociatedIrapPocBeforeReset()); 1559 } 1560 else 1561 { 1562 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1563 } 1564 #else 1456 1565 assert(rpcPic->getPOC() <= this->getAssociatedIRAPPOC()); 1566 #endif 1457 1567 } 1458 1568 } … … 1760 1870 if(isAvailable == 0) 1761 1871 { 1872 #if !UNAVAILABLE_PIC_BUGFIX 1762 1873 if (this->getPOC() + pReferencePictureSet->getDeltaPOC(i) >= pocRandomAccess) 1874 #endif 1763 1875 { 1764 1876 if(!pReferencePictureSet->getUsed(i) ) … … 1781 1893 } 1782 1894 #if ALLOW_RECOVERY_POINT_AS_RAP 1895 #if UNAVAILABLE_PIC_BUGFIX 1896 if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1897 #else 1783 1898 else if(bUseRecoveryPoint && this->getPOC() > pocRandomAccess) 1899 #endif 1784 1900 { 1785 1901 atLeastOneUnabledByRecoveryPoint = 1; … … 2025 2141 if ( layerId == 0 ) 2026 2142 { 2027 retVal = sps->getPicWidthInLumaSamples(); 2143 if( vps->getAvcBaseLayerFlag() ) 2144 { 2145 retVal = vps->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples(); 2146 } 2147 else 2148 { 2149 retVal = sps->getPicWidthInLumaSamples(); 2150 } 2028 2151 } 2029 2152 else … … 2051 2174 if( layerId == 0 ) 2052 2175 { 2053 retVal = sps->getPicHeightInLumaSamples(); 2176 if( vps->getAvcBaseLayerFlag() ) 2177 { 2178 retVal = vps->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples(); 2179 } 2180 else 2181 { 2182 retVal = sps->getPicHeightInLumaSamples(); 2183 } 2054 2184 } 2055 2185 else … … 2207 2337 , m_bTemporalIdNestingFlag (false) 2208 2338 , m_numHrdParameters ( 0) 2209 #if !VPS_RENAME2210 , m_maxNuhReservedZeroLayerId ( 0)2211 #endif2212 2339 , m_hrdParameters (NULL) 2213 2340 , m_hrdOpSetIdx (NULL) 2214 2341 , m_cprmsPresentFlag (NULL) 2215 #if VPS_RENAME2216 2342 , m_maxLayerId (0) 2217 2343 , m_numLayerSets (0) 2218 #endif2219 2344 #if VPS_EXTN_OP_LAYER_SETS 2220 2345 , m_numOutputLayerSets (0) … … 2234 2359 #endif 2235 2360 #endif 2236 #if VPS_VUI_BITRATE_PICRATE2237 2361 , m_bitRatePresentVpsFlag (false) 2238 2362 , m_picRatePresentVpsFlag (false) 2239 #endif2240 2363 #if REPN_FORMAT_IN_VPS 2241 2364 #if Q0195_REP_FORMAT_CLEANUP … … 2311 2434 m_crossLayerPictureTypeAlignFlag = true; 2312 2435 #endif 2313 #if N0147_IRAP_ALIGN_FLAG2314 2436 m_crossLayerIrapAlignFlag = true; 2315 #endif2316 2437 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2317 2438 m_crossLayerAlignedIdrOnlyFlag = false; 2318 2439 #endif 2319 #if N0120_MAX_TID_REF_PRESENT_FLAG2320 2440 m_maxTidRefPresentFlag = true; 2321 #endif2322 2441 for( Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++) 2323 2442 { … … 2336 2455 ::memset(m_loopFilterNotAcrossTilesFlag, 0, sizeof(m_loopFilterNotAcrossTilesFlag)); 2337 2456 #endif 2338 #if TILE_BOUNDARY_ALIGNED_FLAG2339 2457 ::memset(m_tileBoundariesAlignedFlag, 0, sizeof(m_tileBoundariesAlignedFlag)); 2340 #endif2341 2458 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 2342 2459 m_wppNotInUseFlag = true; … … 2363 2480 } 2364 2481 #endif 2365 #if VPS_VUI_BITRATE_PICRATE2366 2482 ::memset(m_bitRatePresentFlag, 0, sizeof(m_bitRatePresentFlag)); 2367 2483 ::memset(m_picRatePresentFlag, 0, sizeof(m_picRatePresentFlag)); … … 2370 2486 ::memset(m_constPicRateIdc , 0, sizeof(m_constPicRateIdc) ); 2371 2487 ::memset(m_avgPicRate , 0, sizeof(m_avgPicRate) ); 2372 #endif2373 2488 #if REPN_FORMAT_IN_VPS 2374 2489 ::memset( m_vpsRepFormatIdx, 0, sizeof(m_vpsRepFormatIdx) ); … … 2485 2600 } 2486 2601 } 2487 #if TILE_BOUNDARY_ALIGNED_FLAG 2602 2488 2603 if (m_tilesNotInUseFlag) 2489 2604 { … … 2496 2611 } 2497 2612 } 2498 #endif 2499 } 2500 #endif 2613 } 2614 #endif 2615 2501 2616 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 2502 2617 Void TComVPS::setWppNotInUseFlag(Bool x) … … 2526 2641 } 2527 2642 2528 Void TComVPS::setNumRefLayers(Int currLayerId) 2529 { 2643 Void TComVPS::setNumRefLayers() 2644 { 2645 memset( m_numberRefLayers, 0, sizeof( m_numberRefLayers ) ); 2646 2530 2647 for (Int i = 0; i < m_uiMaxLayers; i++) 2531 2648 { … … 2538 2655 } 2539 2656 } 2657 #endif 2658 2659 #if Q0078_ADD_LAYER_SETS 2660 Void TComVPS::setPredictedLayerIds() 2661 { 2662 for (UInt i = 0; i < getMaxLayers() - 1; i++) 2663 { 2664 UInt iNuhLId = getLayerIdInNuh(i); 2665 UInt predIdx = 0; 2666 for (UInt j = iNuhLId + 1; j < MAX_NUM_LAYER_IDS; j++) 2667 { 2668 if (getRecursiveRefLayerFlag(j, iNuhLId)) 2669 { 2670 setPredictedLayerId(i, predIdx, j); 2671 predIdx++; 2672 } 2673 } 2674 setNumPredictedLayers(iNuhLId, predIdx); 2675 } 2676 } 2677 2678 Void TComVPS::setTreePartitionLayerIdList() 2679 { 2680 Bool countedLayerIdxFlag[MAX_NUM_LAYER_IDS]; 2681 2682 for (UInt i = 0; i <= getMaxLayers() - 1; i++) 2683 { 2684 countedLayerIdxFlag[i] = false; 2685 } 2686 2687 Int numIndependentLayers = 0; 2688 2689 for (UInt i = 0; i <= getMaxLayers() - 1; i++) 2690 { 2691 UInt iNuhLId = getLayerIdInNuh(i); 2692 if (getNumDirectRefLayers(iNuhLId) == 0) 2693 { 2694 setTreePartitionLayerId(numIndependentLayers, 0, iNuhLId); 2695 setNumLayersInTreePartition(numIndependentLayers, 1); 2696 for (UInt j = 0; j < getNumPredictedLayers(iNuhLId); j++) 2697 { 2698 if (!countedLayerIdxFlag[getLayerIdInVps(iNuhLId)]) 2699 { 2700 setTreePartitionLayerId(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers), getPredictedLayerId(iNuhLId, j)); 2701 setNumLayersInTreePartition(numIndependentLayers, getNumLayersInTreePartition(numIndependentLayers) + 1); 2702 countedLayerIdxFlag[getLayerIdInVps(getPredictedLayerId(iNuhLId, j))] = true; 2703 } 2704 } 2705 numIndependentLayers++; 2706 } 2707 } 2708 2709 setNumIndependentLayers(numIndependentLayers); 2710 } 2711 2712 void TComVPS::setLayerIdIncludedFlagsForAddLayerSets() 2713 { 2714 for (UInt i = 0; i < getNumAddLayerSets(); i++) 2715 { 2716 for (UInt j = 1; j < getNumIndependentLayers(); j++) 2717 { 2718 Int layerNum = 0; 2719 Int lsIdx = getVpsNumLayerSetsMinus1() + 1 + i; 2720 for (Int layerId = 0; layerId < MAX_VPS_LAYER_ID_PLUS1; layerId++) 2721 { 2722 setLayerIdIncludedFlag(false, lsIdx, layerId); 2723 } 2724 for (Int treeIdx = 1; treeIdx < getNumIndependentLayers(); treeIdx++) 2725 { 2726 for (Int layerCnt = 0; layerCnt < getHighestLayerIdxPlus1(i, j); layerCnt++) 2727 { 2728 setLayerSetLayerIdList(lsIdx, layerNum, getTreePartitionLayerId(treeIdx, layerCnt)); 2729 setLayerIdIncludedFlag(true, lsIdx, getTreePartitionLayerId(treeIdx, layerCnt)); 2730 layerNum++; 2731 } 2732 } 2733 setNumLayersInIdList(lsIdx, layerNum); 2734 } 2735 } 2736 } 2737 2540 2738 #endif 2541 2739 … … 2701 2899 return -1; // Layer not found 2702 2900 } 2901 #endif 2703 2902 #if O0164_MULTI_LAYER_HRD 2704 2903 Void TComVPS::setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ) … … 2780 2979 } 2781 2980 #endif 2981 #if RESOLUTION_BASED_DPB 2782 2982 // RepFormat Assignment operator 2783 2983 RepFormat& RepFormat::operator= (const RepFormat &other) … … 2851 3051 #if SVC_EXTENSION 2852 3052 , m_layerId ( 0 ) 3053 , m_extensionFlag ( false ) 2853 3054 , m_numScaledRefLayerOffsets ( 0 ) 2854 3055 #if REPN_FORMAT_IN_VPS … … 2905 3106 2906 3107 TimingInfo *timingInfo = vui->getTimingInfo(); 2907 #if TIMING_INFO_NONZERO_LAYERID_SPS2908 if( getLayerId()> 0 )3108 #if SVC_EXTENSION 3109 if( m_layerId > 0 ) 2909 3110 { 2910 3111 timingInfo->setTimingInfoPresentFlag( false ); 3112 return; 3113 } 3114 #endif 3115 3116 timingInfo->setTimingInfoPresentFlag( true ); 3117 switch( frameRate ) 3118 { 3119 case 24: 3120 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 3121 break; 3122 case 25: 3123 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 3124 break; 3125 case 30: 3126 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 3127 break; 3128 case 50: 3129 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 3130 break; 3131 case 60: 3132 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 3133 break; 3134 default: 3135 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 3136 break; 3137 } 3138 3139 Bool rateCnt = ( bitRate > 0 ); 3140 hrd->setNalHrdParametersPresentFlag( rateCnt ); 3141 hrd->setVclHrdParametersPresentFlag( rateCnt ); 3142 3143 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 3144 3145 if( hrd->getSubPicCpbParamsPresentFlag() ) 3146 { 3147 hrd->setTickDivisorMinus2( 100 - 2 ); // 3148 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 3149 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 3150 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2911 3151 } 2912 3152 else 2913 3153 { 2914 #endif 2915 timingInfo->setTimingInfoPresentFlag( true ); 2916 switch( frameRate ) 2917 { 2918 case 24: 2919 timingInfo->setNumUnitsInTick( 1125000 ); timingInfo->setTimeScale ( 27000000 ); 2920 break; 2921 case 25: 2922 timingInfo->setNumUnitsInTick( 1080000 ); timingInfo->setTimeScale ( 27000000 ); 2923 break; 2924 case 30: 2925 timingInfo->setNumUnitsInTick( 900900 ); timingInfo->setTimeScale ( 27000000 ); 2926 break; 2927 case 50: 2928 timingInfo->setNumUnitsInTick( 540000 ); timingInfo->setTimeScale ( 27000000 ); 2929 break; 2930 case 60: 2931 timingInfo->setNumUnitsInTick( 450450 ); timingInfo->setTimeScale ( 27000000 ); 2932 break; 2933 default: 2934 timingInfo->setNumUnitsInTick( 1001 ); timingInfo->setTimeScale ( 60000 ); 2935 break; 2936 } 2937 2938 Bool rateCnt = ( bitRate > 0 ); 2939 hrd->setNalHrdParametersPresentFlag( rateCnt ); 2940 hrd->setVclHrdParametersPresentFlag( rateCnt ); 2941 2942 hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) ); 2943 2944 if( hrd->getSubPicCpbParamsPresentFlag() ) 2945 { 2946 hrd->setTickDivisorMinus2( 100 - 2 ); // 2947 hrd->setDuCpbRemovalDelayLengthMinus1( 7 ); // 8-bit precision ( plus 1 for last DU in AU ) 2948 hrd->setSubPicCpbParamsInPicTimingSEIFlag( true ); 2949 hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 ); // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay 2950 } 2951 else 2952 { 2953 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 2954 } 2955 2956 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 2957 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2958 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 2959 2960 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 2961 if( randomAccess ) 2962 { 2963 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 2964 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 2965 } 2966 else 2967 { 2968 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 2969 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 2970 } 2971 2972 /* 2973 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 2974 */ 2975 Int i, j; 2976 UInt birateValue, cpbSizeValue; 2977 UInt ducpbSizeValue; 2978 UInt duBitRateValue = 0; 2979 2980 for( i = 0; i < MAX_TLAYER; i ++ ) 2981 { 2982 hrd->setFixedPicRateFlag( i, 1 ); 2983 hrd->setPicDurationInTcMinus1( i, 0 ); 2984 hrd->setLowDelayHrdFlag( i, 0 ); 2985 hrd->setCpbCntMinus1( i, 0 ); 2986 2987 birateValue = bitRate; 2988 cpbSizeValue = bitRate; // 1 second 2989 ducpbSizeValue = bitRate/numDU; 2990 duBitRateValue = bitRate; 2991 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 2992 { 2993 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 2994 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 2995 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 2996 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 2997 2998 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 2999 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 3000 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 3001 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 3002 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 3003 } 3004 } 3005 #if TIMING_INFO_NONZERO_LAYERID_SPS 3006 } 3007 #endif 3154 hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 3155 } 3156 3157 hrd->setBitRateScale( 4 ); // in units of 2~( 6 + 4 ) = 1,024 bps 3158 hrd->setCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 3159 hrd->setDuCpbSizeScale( 6 ); // in units of 2~( 4 + 4 ) = 1,024 bit 3160 3161 hrd->setInitialCpbRemovalDelayLengthMinus1(15); // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit 3162 if( randomAccess ) 3163 { 3164 hrd->setCpbRemovalDelayLengthMinus1(5); // 32 = 2^5 (plus 1) 3165 hrd->setDpbOutputDelayLengthMinus1 (5); // 32 + 3 = 2^6 3166 } 3167 else 3168 { 3169 hrd->setCpbRemovalDelayLengthMinus1(9); // max. 2^10 3170 hrd->setDpbOutputDelayLengthMinus1 (9); // max. 2^10 3171 } 3172 3173 /* 3174 Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported. 3175 */ 3176 Int i, j; 3177 UInt birateValue, cpbSizeValue; 3178 UInt ducpbSizeValue; 3179 UInt duBitRateValue = 0; 3180 3181 for( i = 0; i < MAX_TLAYER; i ++ ) 3182 { 3183 hrd->setFixedPicRateFlag( i, 1 ); 3184 hrd->setPicDurationInTcMinus1( i, 0 ); 3185 hrd->setLowDelayHrdFlag( i, 0 ); 3186 hrd->setCpbCntMinus1( i, 0 ); 3187 3188 birateValue = bitRate; 3189 cpbSizeValue = bitRate; // 1 second 3190 ducpbSizeValue = bitRate/numDU; 3191 duBitRateValue = bitRate; 3192 for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ ) 3193 { 3194 hrd->setBitRateValueMinus1( i, j, 0, ( birateValue - 1 ) ); 3195 hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) ); 3196 hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) ); 3197 hrd->setCbrFlag( i, j, 0, ( j == 0 ) ); 3198 3199 hrd->setBitRateValueMinus1( i, j, 1, ( birateValue - 1) ); 3200 hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) ); 3201 hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) ); 3202 hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) ); 3203 hrd->setCbrFlag( i, j, 1, ( j == 0 ) ); 3204 } 3205 } 3008 3206 } 3009 3207 const Int TComSPS::m_winUnitX[]={1,2,2,1}; … … 3061 3259 , m_listsModificationPresentFlag( 0) 3062 3260 , m_numExtraSliceHeaderBits(0) 3261 #if SVC_EXTENSION 3262 , m_extensionFlag(false) 3063 3263 #if SCALINGLIST_INFERRING 3264 , m_layerId(0) 3064 3265 , m_inferScalingListFlag ( false ) 3065 3266 , m_scalingListRefLayerId ( 0 ) … … 3068 3269 , m_pocResetInfoPresentFlag (false) 3069 3270 #endif 3271 #if Q0048_CGS_3D_ASYMLUT 3272 , m_nCGSFlag(0) 3273 , m_nCGSOutputBitDepthY(0) 3274 , m_nCGSOutputBitDepthC(0) 3275 #endif 3276 #endif //SVC_EXTENSION 3070 3277 { 3071 3278 m_scalingList = new TComScalingList; … … 3698 3905 return false; 3699 3906 } 3700 #if POC_RESET_FLAG 3907 #if POC_RESET_FLAG || POC_RESET_IDC_DECODER 3908 #if POC_RESET_IDC_DECODER 3909 TComPic* pic = xGetRefPic( rcListPic, getPOC() ); 3910 #else 3701 3911 TComPic* pic = xGetRefPic( rcListPic, m_bPocResetFlag ? 0 : m_iPOC ); 3912 #endif 3702 3913 3703 3914 if( pic ) … … 3712 3923 return true; 3713 3924 #else 3714 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3925 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 3926 return true; 3715 3927 #endif 3716 3928 } -
trunk/source/Lib/TLibCommon/TComSlice.h
r713 r815 140 140 141 141 Void create (Int numberOfEntries); 142 Void destroy 142 Void destroy(); 143 143 144 144 … … 469 469 470 470 UInt m_numHrdParameters; 471 #if ! VPS_RENAME471 #if !SVC_EXTENSION 472 472 UInt m_maxNuhReservedZeroLayerId; 473 473 #endif … … 484 484 #if SVC_EXTENSION 485 485 #if DERIVE_LAYER_ID_LIST_VARIABLES 486 #if Q0078_ADD_LAYER_SETS 487 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 488 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 489 #else 486 490 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 487 491 Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; 492 #endif 488 493 #endif 489 494 #if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED … … 492 497 #endif 493 498 #endif 494 #if VPS_RENAME495 499 UInt m_maxLayerId; 496 500 UInt m_numLayerSets; 501 #if Q0078_ADD_LAYER_SETS 502 UInt m_vpsNumLayerSetsMinus1; 503 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 504 #else 497 505 Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 498 506 #endif … … 514 522 UInt m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer_id_in_nuh with the layer ID in the VPS 515 523 #endif 516 #if ILP_SSH_SIG 524 #if BITRATE_PICRATE_SIGNALLING 525 #if Q0078_ADD_LAYER_SETS 526 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; 527 #else 528 UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1]; 529 #endif 530 #endif 531 517 532 Bool m_ilpSshSignalingEnabledFlag; 518 #endif519 533 #if VPS_EXTN_PROFILE_INFO 520 534 // Profile-tier-level signalling related … … 529 543 // Target output layer signalling related 530 544 UInt m_numOutputLayerSets; 545 #if Q0078_ADD_LAYER_SETS 546 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 547 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_ID_PLUS1]; 548 #else 531 549 UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1]; 532 550 Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 551 #endif 533 552 #endif 534 553 #if VPS_EXTN_DIRECT_REF_LAYERS … … 565 584 Bool m_crossLayerPictureTypeAlignFlag; 566 585 #endif 567 #if N0147_IRAP_ALIGN_FLAG568 586 Bool m_crossLayerIrapAlignFlag; 569 #endif570 587 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 571 588 Bool m_crossLayerAlignedIdrOnlyFlag; … … 576 593 UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; 577 594 #endif 578 #if N0120_MAX_TID_REF_PRESENT_FLAG579 595 Bool m_maxTidRefPresentFlag; 580 #endif581 596 #if VPS_TSLAYERS 582 597 Bool m_maxTSLayersPresentFlag; … … 594 609 Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_ID_PLUS1]; 595 610 #endif 596 #if TILE_BOUNDARY_ALIGNED_FLAG597 611 Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; 598 #endif599 612 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 600 613 Bool m_wppNotInUseFlag; … … 616 629 Int m_vpsTransChar[16]; 617 630 Int m_vpsMatCoeff[16]; 618 #endif 619 #if VPS_VUI_BITRATE_PICRATE 631 #endif 632 620 633 Bool m_bitRatePresentVpsFlag; 621 634 Bool m_picRatePresentVpsFlag; … … 626 639 Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 627 640 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 628 #endif629 641 630 642 #if P0312_VERT_PHASE_ADJ … … 633 645 634 646 #if P0300_ALT_OUTPUT_LAYER_FLAG 647 #if Q0078_ADD_LAYER_SETS 648 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 649 #else 635 650 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1]; 651 #endif 636 652 #else 637 653 #if O0153_ALT_OUTPUT_LAYER_FLAG … … 661 677 Int m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer 662 678 Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer 679 #endif 680 #if Q0078_ADD_LAYER_SETS 681 Int m_numAddLayerSets; 682 UInt m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; 683 UInt m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 684 UInt m_numPredictedLayers[MAX_NUM_LAYER_IDS]; 685 Int m_numIndependentLayers; 686 Int m_numLayersInTreePartition[MAX_NUM_LAYER_IDS]; 687 UInt m_treePartitionLayerIdList[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 663 688 #endif 664 689 #if SPS_DPB_PARAMS … … 675 700 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; 676 701 #if CHANGE_NUMSUBDPB_IDX 702 #if Q0078_ADD_LAYER_SETS 703 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; 704 #else 677 705 Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1]; 706 #endif 678 707 #else 679 708 Int m_numSubDpbs [MAX_VPS_OP_LAYER_SETS_PLUS1]; … … 735 764 } 736 765 #endif 766 #if HRD_BPB 767 Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl) 768 { 769 return m_bspHrd->getCpbCntMinus1(sl); 770 } 771 #endif 737 772 738 773 TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } … … 798 833 Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } 799 834 Int getNumRefLayers(Int currLayerId) { return m_numberRefLayers[currLayerId]; } 800 Void setNumRefLayers(Int currLayerId); 801 #endif 802 #if VPS_RENAME 803 UInt getMaxLayerId() { return m_maxLayerId; } 804 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 805 835 Void setNumRefLayers(); 836 #endif 837 #if Q0078_ADD_LAYER_SETS 838 void setLayerIdIncludedFlagsForAddLayerSets(); 839 UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } 840 Void setVpsNumLayerSetsMinus1(UInt x) { m_vpsNumLayerSetsMinus1 = x; } 841 UInt getNumAddLayerSets() { return m_numAddLayerSets; } 842 Void setNumAddLayerSets(UInt x) { m_numAddLayerSets = x; } 843 UInt getHighestLayerIdxPlus1(UInt set, UInt idx) { return m_highestLayerIdxPlus1[set][idx]; } 844 Void setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx) { m_highestLayerIdxPlus1[set][idx] = layerIdx; } 845 Void setPredictedLayerIds(); 846 UInt getPredictedLayerId(UInt layerIdx, UInt predIdx) { return m_predictedLayerId[layerIdx][predIdx]; } 847 Void setPredictedLayerId(UInt layerIdx, UInt predIdx, UInt x) { m_predictedLayerId[layerIdx][predIdx] = x; } 848 UInt getNumPredictedLayers(UInt layerId) { return m_numPredictedLayers[layerId]; } 849 Void setNumPredictedLayers(UInt layerId, UInt x) { m_numPredictedLayers[layerId] = x; } 850 Void setTreePartitionLayerIdList(); 851 Int getNumIndependentLayers() { return m_numIndependentLayers; } 852 Void setNumIndependentLayers(Int x) { m_numIndependentLayers = x; } 853 Int getNumLayersInTreePartition(Int idx) { return m_numLayersInTreePartition[idx]; } 854 Void setNumLayersInTreePartition(Int idx, Int x) { m_numLayersInTreePartition[idx] = x; } 855 UInt getTreePartitionLayerId(Int idx, Int layerIdx) { return m_treePartitionLayerIdList[idx][layerIdx]; } 856 Void setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId) { m_treePartitionLayerIdList[idx][layerIdx] = layerId; } 857 #endif 858 UInt getMaxLayerId() { return m_maxLayerId; } 859 Void setMaxLayerId(UInt v) { m_maxLayerId = v; } 806 860 UInt getNumLayerSets() { return m_numLayerSets; } 807 861 Void setNumLayerSets(UInt v) { m_numLayerSets = v; } 808 #endif809 862 #if VPS_EXTN_MASK_AND_DIM_INFO 810 863 Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } … … 835 888 Void setLayerIdInVps(Int id, UInt x) { m_layerIdInVps[id] = x; } 836 889 #endif 837 #if ILP_SSH_SIG 838 Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} 839 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} 840 #endif 890 #if BITRATE_PICRATE_SIGNALLING 891 UInt getMaxSLayersInLayerSetMinus1(Int ls) { return m_maxSLInLayerSetMinus1[ls]; } 892 Void setMaxSLayersInLayerSetMinus1(Int ls, Int x) { m_maxSLInLayerSetMinus1[ls] = x; } 893 #endif 894 Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} 895 Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} 841 896 #if VPS_EXTN_PROFILE_INFO 842 897 Bool getProfilePresentFlag(Int id) { return m_profilePresentFlag[id]; } … … 883 938 UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } 884 939 Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } 940 Bool isSamplePredictionType(Int currLayerId, Int refLayerId) { assert(currLayerId != refLayerId); return ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 1 ) ? true : false; } 941 Bool isMotionPredictionType(Int currLayerId, Int refLayerId) { assert(currLayerId != refLayerId); return ( ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 2 ) >> 1 ) ? true : false; } 885 942 #endif 886 943 UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } … … 923 980 Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x; } 924 981 #endif 925 #if N0147_IRAP_ALIGN_FLAG926 982 Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag; } 927 983 Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x; } 928 #endif929 984 #if O0225_MAX_TID_FOR_REF_LAYERS 930 985 UInt getMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId) { return m_maxTidIlRefPicsPlus1[layerId][refLayerId]; } … … 934 989 Void setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer; } 935 990 #endif 936 #if N0120_MAX_TID_REF_PRESENT_FLAG937 991 Bool getMaxTidRefPresentFlag() { return m_maxTidRefPresentFlag ;} 938 992 Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x;} 939 #endif940 993 #if VPS_TSLAYERS 941 994 Bool getMaxTSLayersPresentFlag() { return m_maxTSLayersPresentFlag ;} … … 960 1013 Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } 961 1014 #endif 962 #if TILE_BOUNDARY_ALIGNED_FLAG963 1015 Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } 964 1016 Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } 965 #endif966 1017 #if VPS_VUI_WPP_NOT_IN_USE__FLAG 967 1018 Bool getWppNotInUseFlag() { return m_wppNotInUseFlag; } … … 1001 1052 Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x; } 1002 1053 #endif 1003 #if VPS_VUI_BITRATE_PICRATE1004 1054 Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag; } 1005 1055 Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } … … 1021 1071 Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } 1022 1072 Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } 1023 #endif1024 1073 #if O0164_MULTI_LAYER_HRD 1025 1074 Bool getVpsVuiBspHrdPresentFlag() { return m_vpsVuiBspHrdPresentFlag; } … … 1463 1512 #if SVC_EXTENSION 1464 1513 UInt m_layerId; 1514 Bool m_extensionFlag; 1465 1515 UInt m_numScaledRefLayerOffsets; 1466 1516 #if P0312_VERT_PHASE_ADJ … … 1621 1671 Void setLayerId(UInt layerId) { m_layerId = layerId; } 1622 1672 UInt getLayerId() { return m_layerId; } 1673 Int getExtensionFlag() { return m_extensionFlag; } 1674 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1623 1675 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1624 1676 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } … … 1736 1788 1737 1789 #if SVC_EXTENSION 1790 Bool m_extensionFlag; 1738 1791 #if SCALINGLIST_INFERRING 1739 1792 UInt m_layerId; … … 1862 1915 1863 1916 #if SCALINGLIST_INFERRING 1864 UInt getLayerId() { return m_layerId; }1865 Void setLayerId( UInt layerId ) { m_layerId = layerId; }1866 Bool getInferScalingListFlag() { return m_inferScalingListFlag; }1867 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; }1868 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; }1869 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; }1870 #endif1871 1872 #if SCALINGLIST_INFERRING1873 1917 Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } 1874 1918 #else … … 1886 1930 Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } 1887 1931 Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } 1932 #if SVC_EXTENSION 1933 Int getExtensionFlag() { return m_extensionFlag; } 1934 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1935 #if SCALINGLIST_INFERRING 1936 UInt getLayerId() { return m_layerId; } 1937 Void setLayerId( UInt layerId ) { m_layerId = layerId; } 1938 Bool getInferScalingListFlag() { return m_inferScalingListFlag; } 1939 UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } 1940 Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } 1941 Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } 1942 #endif 1888 1943 #if POC_RESET_IDC 1889 1944 Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } … … 1898 1953 Void setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n; } 1899 1954 #endif 1955 #endif //SVC_EXTENSION 1900 1956 }; 1901 1957 … … 1935 1991 Int m_iLastIDR; 1936 1992 Int m_iAssociatedIRAP; 1993 #if POC_RESET_IDC_ENCODER 1994 Int m_associatedIrapPocBeforeReset; 1995 #endif 1996 1937 1997 NalUnitType m_iAssociatedIRAPType; 1938 1998 static Int m_prevTid0POC; … … 2061 2121 Bool m_pocMsbValPresentFlag; 2062 2122 #endif 2123 #if POC_RESET_IDC_ENCODER 2124 Int m_pocValueBeforeReset; 2125 #endif 2126 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 2127 Int m_picOrderCntLsb; 2128 #endif 2063 2129 #if Q0048_CGS_3D_ASYMLUT 2064 2130 Int m_nCGSOverWritePPS; // for optimization, not output to bitstream … … 2106 2172 Void adjustPrevTid0POC (Int adj) { m_prevTid0POC=m_prevTid0POC-adj; } 2107 2173 #endif 2174 #if POC_RESET_IDC_DECODER 2175 Void setPrevTid0POC( Int x ) { m_prevTid0POC = x; } 2176 #endif 2177 2108 2178 TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } 2109 2179 Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } … … 2111 2181 Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } 2112 2182 Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } 2183 #if POC_RESET_IDC_ENCODER 2184 Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; } 2185 Int getAssociatedIrapPocBeforeReset( ) { return m_associatedIrapPocBeforeReset; } 2186 #endif 2187 2113 2188 Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } 2114 2189 NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } … … 2220 2295 Void setTLayerInfo( UInt uiTLayer ); 2221 2296 Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 2297 #if POC_RESET_IDC_ENCODER 2298 Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false); 2299 #else 2222 2300 Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); 2301 #endif 2223 2302 Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); 2224 2303 Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); … … 2418 2497 Bool getCraPicFlag (); 2419 2498 #endif 2499 #if POC_RESET_IDC_DECODER 2500 Bool getRaslPicFlag (); 2501 Bool getRadlPicFlag (); 2502 #endif 2503 #if POC_RESET_IDC_DECODER || POC_RESET_IDC_ENCODER 2504 Int getPicOrderCntLsb() { return m_picOrderCntLsb; } 2505 Void setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; } 2506 #endif 2507 2508 #if POC_RESET_IDC_ENCODER 2509 Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } 2510 Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } 2511 Void decrementRefPocValues(Int const decrementValue); 2512 Int getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ); 2513 #endif 2514 2420 2515 2421 2516 #endif //SVC_EXTENSION … … 2472 2567 } 2473 2568 2569 #if Q0078_ADD_LAYER_SETS 2570 Void removePS(Int psId) 2571 { 2572 assert(psId < m_maxId); 2573 if (m_paramsetMap.find(psId) != m_paramsetMap.end()) 2574 { 2575 m_paramsetMap.erase(psId); 2576 } 2577 } 2578 #endif 2579 2580 2474 2581 private: 2475 2582 std::map<Int,T *> m_paramsetMap; … … 2494 2601 TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; 2495 2602 TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; 2603 #if Q0078_ADD_LAYER_SETS 2604 Void removeSPS(Int spsId) { m_spsMap.removePS(spsId); }; 2605 #endif 2496 2606 2497 2607 //! store picture parameter set and take ownership of it … … 2500 2610 TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; 2501 2611 TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; 2612 #if Q0078_ADD_LAYER_SETS 2613 Void removePPS(Int ppsId) { m_ppsMap.removePS(ppsId); }; 2614 #endif 2502 2615 2503 2616 //! activate a SPS from a active parameter sets SEI message -
trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r713 r815 1 1 #include "TypeDef.h" 2 #if SVC_EXTENSION 2 3 #include "TComUpsampleFilter.h" 3 #include "TypeDef.h"4 5 #if SVC_UPSAMPLING6 #define CNU -1 ///< Coefficients Not Used7 4 8 5 const Int TComUpsampleFilter::m_lumaFixedFilter[16][NTAPS_US_LUMA] = 9 6 { 10 { 0, 0, 0, 64, 0, 0, 0, 0}, // 11 #if ARBITRARY_SPATIAL_RATIO 12 { 0, 1, -3, 63, 4, -2, 1, 0}, 13 { -1, 2, -5, 62, 8, -3, 1, 0}, 14 { -1, 3, -8, 60, 13, -4, 1, 0}, 15 { -1, 4,-10, 58, 17, -5, 1, 0}, 16 #else 17 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 18 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 19 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 20 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 21 #endif 22 { -1, 4, -11, 52, 26, -8, 3, -1}, // <-> actual phase shift 1/3, used for spatial scalability x1.5 23 #if ARBITRARY_SPATIAL_RATIO 24 { -1, 3, -9, 47, 31, -10, 4, -1}, 25 { -1, 4, -11, 45, 34, -10, 4, -1}, 26 #else 27 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 28 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 29 #endif 30 { -1, 4, -11, 40, 40, -11, 4, -1}, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 31 #if ARBITRARY_SPATIAL_RATIO 32 { -1, 4, -10, 34, 45, -11, 4, -1}, 33 { -1, 4, -10, 31, 47, -9, 3, -1}, 34 #else 35 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 36 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 37 #endif 38 { -1, 3, -8, 26, 52, -11, 4, -1}, // <-> actual phase shift 2/3, used for spatial scalability x1.5 39 #if ARBITRARY_SPATIAL_RATIO 40 { 0, 1, -5, 17, 58, -10, 4, -1}, 41 { 0, 1, -4, 13, 60, -8, 3, -1}, 42 { 0, 1, -3, 8, 62, -5, 2, -1}, 43 { 0, 1, -2, 4, 63, -3, 1, 0} 44 #else 45 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 46 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 47 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU}, // 48 {CNU,CNU,CNU,CNU,CNU,CNU,CNU,CNU} // 49 #endif 7 { 0, 0, 0, 64, 0, 0, 0, 0 }, 8 { 0, 1, -3, 63, 4, -2, 1, 0 }, 9 { -1, 2, -5, 62, 8, -3, 1, 0 }, 10 { -1, 3, -8, 60, 13, -4, 1, 0 }, 11 { -1, 4, -10, 58, 17, -5, 1, 0 }, 12 { -1, 4, -11, 52, 26, -8, 3, -1 }, // <-> actual phase shift 1/3, used for spatial scalability x1.5 13 { -1, 3, -9, 47, 31, -10, 4, -1 }, 14 { -1, 4, -11, 45, 34, -10, 4, -1 }, 15 { -1, 4, -11, 40, 40, -11, 4, -1 }, // <-> actual phase shift 1/2, equal to HEVC MC, used for spatial scalability x2 16 { -1, 4, -10, 34, 45, -11, 4, -1 }, 17 { -1, 4, -10, 31, 47, -9, 3, -1 }, 18 { -1, 3, -8, 26, 52, -11, 4, -1 }, // <-> actual phase shift 2/3, used for spatial scalability x1.5 19 { 0, 1, -5, 17, 58, -10, 4, -1 }, 20 { 0, 1, -4, 13, 60, -8, 3, -1 }, 21 { 0, 1, -3, 8, 62, -5, 2, -1 }, 22 { 0, 1, -2, 4, 63, -3, 1, 0 } 50 23 }; 51 24 52 25 const Int TComUpsampleFilter::m_chromaFixedFilter[16][NTAPS_US_CHROMA] = 53 26 { 54 { 0, 64, 0, 0},// 55 #if ARBITRARY_SPATIAL_RATIO 56 { -2, 62, 4, 0}, 57 { -2, 58, 10, -2}, 58 { -4, 56, 14, -2}, 59 #else 60 {CNU,CNU,CNU,CNU},// 61 {CNU,CNU,CNU,CNU},// 62 {CNU,CNU,CNU,CNU},// 63 #endif 64 { -4, 54, 16, -2},// <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 65 { -6, 52, 20, -2},// <-> actual phase shift 1/3, used for spatial scalability x1.5 66 { -6, 46, 28, -4},// <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 67 #if ARBITRARY_SPATIAL_RATIO 68 { -4, 42, 30, -4}, 69 #else 70 {CNU,CNU,CNU,CNU},// 71 #endif 72 { -4, 36, 36, -4},// <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 73 { -4, 30, 42, -4},// <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 74 #if ARBITRARY_SPATIAL_RATIO 75 { -4, 28, 46, -6}, 76 #else 77 {CNU,CNU,CNU,CNU},// 78 #endif 79 { -2, 20, 52, -6},// <-> actual phase shift 2/3, used for spatial scalability x1.5 80 #if ARBITRARY_SPATIAL_RATIO 81 {-2, 16, 54, -4}, 82 {-2, 14, 56, -4}, 83 #else 84 {CNU,CNU,CNU,CNU},// 85 {CNU,CNU,CNU,CNU},// 86 #endif 87 { -2, 10, 58, -2},// <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 88 { 0, 4, 62, -2} // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 27 { 0, 64, 0, 0 }, 28 { -2, 62, 4, 0 }, 29 { -2, 58, 10, -2 }, 30 { -4, 56, 14, -2 }, 31 { -4, 54, 16, -2 }, // <-> actual phase shift 1/4,equal to HEVC MC, used for spatial scalability x1.5 (only for accurate Chroma alignement) 32 { -6, 52, 20, -2 }, // <-> actual phase shift 1/3, used for spatial scalability x1.5 33 { -6, 46, 28, -4 }, // <-> actual phase shift 3/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 34 { -4, 42, 30, -4 }, 35 { -4, 36, 36, -4 }, // <-> actual phase shift 1/2,equal to HEVC MC, used for spatial scalability x2 36 { -4, 30, 42, -4 }, // <-> actual phase shift 7/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 37 { -4, 28, 46, -6 }, 38 { -2, 20, 52, -6 }, // <-> actual phase shift 2/3, used for spatial scalability x1.5 39 { -2, 16, 54, -4 }, 40 { -2, 14, 56, -4 }, 41 { -2, 10, 58, -2 }, // <-> actual phase shift 7/8,equal to HEVC MC, used for spatial scalability x2 (only for accurate Chroma alignement) 42 { 0, 4, 62, -2 } // <-> actual phase shift 11/12, used for spatial scalability x1.5 (only for accurate Chroma alignement) 89 43 }; 90 44 … … 260 214 } 261 215 262 #if ARBITRARY_SPATIAL_RATIO263 216 assert ( widthEL >= widthBL ); 264 217 assert ( heightEL >= heightBL ); 265 #else266 assert ( widthEL == widthBL || widthEL == 2*widthBL || 2*widthEL == 3*widthBL );267 assert ( heightEL == heightBL || heightEL == 2*heightBL || 2*heightEL == 3*heightBL );268 #endif269 218 270 219 pcBasePic->setBorderExtension(false); … … 298 247 #endif 299 248 300 #if ROUNDING_OFFSET301 249 Int addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 302 250 Int addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 303 #else304 Int addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );305 Int addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );306 #endif307 251 308 252 #if Q0120_PHASE_CALCULATION … … 333 277 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 334 278 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 335 #if N0214_INTERMEDIATE_BUFFER_16BITS336 279 #if O0194_JOINT_US_BITSHIFT 337 280 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 345 288 #else 346 289 Int shift1 = g_bitDepthY - 8; 347 #endif348 290 #endif 349 291 … … 362 304 for( j = 0; j < heightBL ; j++ ) 363 305 { 364 #if N0214_INTERMEDIATE_BUFFER_16BITS365 306 *piDstY = sumLumaHor(piSrcY, coeff) >> shift1; 366 #else367 *piDstY = sumLumaHor(piSrcY, coeff);368 #endif369 307 piSrcY += strideBL; 370 308 piDstY += strideEL; … … 378 316 pcTempPic->setHeight(heightEL); 379 317 380 #if N0214_INTERMEDIATE_BUFFER_16BITS381 318 #if O0194_JOINT_US_BITSHIFT 382 319 Int nShift = 20 - g_bitDepthYLayer[currLayerId]; 383 320 #else 384 321 Int nShift = US_FILTER_PREC*2 - shift1; 385 #endif386 #else387 const Int nShift = US_FILTER_PREC*2;388 322 #endif 389 323 Int iOffset = 1 << (nShift - 1); … … 472 406 #endif 473 407 474 #if ROUNDING_OFFSET475 408 addX = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 476 409 addY = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 477 #else478 addX = ( ( ( widthBL * (phaseXC) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );479 addY = ( ( ( heightBL * (phaseYC) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );480 #endif481 410 482 411 #if Q0120_PHASE_CALCULATION … … 502 431 heightBL = min<Int>( pcBasePic->getHeight() >> 1, heightEL ); 503 432 504 #if N0214_INTERMEDIATE_BUFFER_16BITS505 433 #if O0194_JOINT_US_BITSHIFT 506 434 // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 514 442 #else 515 443 shift1 = g_bitDepthC - 8; 516 #endif517 444 #endif 518 445 … … 533 460 for( j = 0; j < heightBL ; j++ ) 534 461 { 535 #if N0214_INTERMEDIATE_BUFFER_16BITS536 462 *piDstU = sumChromaHor(piSrcU, coeff) >> shift1; 537 463 *piDstV = sumChromaHor(piSrcV, coeff) >> shift1; 538 #else539 *piDstU = sumChromaHor(piSrcU, coeff);540 *piDstV = sumChromaHor(piSrcV, coeff);541 #endif542 464 543 465 piSrcU += strideBL; … … 554 476 pcTempPic->setHeight(heightEL << 1); 555 477 556 #if N0214_INTERMEDIATE_BUFFER_16BITS557 478 #if O0194_JOINT_US_BITSHIFT 558 479 nShift = 20 - g_bitDepthCLayer[currLayerId]; … … 561 482 #endif 562 483 iOffset = 1 << (nShift - 1); 563 #endif564 484 565 485 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) -
trunk/source/Lib/TLibCommon/TypeDef.h
r713 r815 41 41 #define SVC_EXTENSION 1 42 42 43 #define SYNTAX_BYTES 10 43 #define SYNTAX_BYTES 10 ///< number of bytes taken by syntaxes per 4x4 block [RefIdxL0(1byte), RefIdxL1(1byte), MVxL0(2bytes), MVyL0(2bytes), MVxL1(2bytes), MVyL1(2bytes)] 44 44 #if SVC_EXTENSION 45 45 #define MAX_LAYERS 8 ///< max number of layers the codec is supposed to handle 46 46 47 47 #define VPS_VUI_OFFSET 1 ///< N0085: Signal VPS VUI offset in the VPS extension 48 #define RANDOM_ACCESS_SEI_FIX 149 48 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 50 49 51 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 50 #define Q0108_TSA_STSA 0 ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers 51 #define Q0177_SPS_TEMP_NESTING_FIX 1 ///< JCTVC-Q0177; Fix the inference value of sps_temporal_id_nesting_flag when it is not present 52 #define Q0177_EOS_CHECKS 1 ///< JCTVC-Q0177; Put checks on handling EOS 53 #define Q0142_POC_LSB_NOT_PRESENT 1 ///< JCTVC-Q0142; Add constraint checking on the value of poc_reset_idc and poc_lsb_val 54 #define Q0146_SSH_EXT_DATA_BIT 1 ///< JCTVC-Q0146; Bug-fix -- the SSH_EXT_DATA_BIT can have any value -- not required to be 1 55 56 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 52 57 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 53 58 #if P0312_VERT_PHASE_ADJ … … 62 67 #define VPS_EXTN_UEV_CODING 1 ///< JCTVC-P0306: Code some syntax elements as ue(v), and remove some syntax elements that duplicate behaviour 63 68 #define CHANGE_NUMSUBDPB_IDX 1 ///< Change index of NumSubDpb from output layer set to layer set, to be more aligned with the Spec 64 #define RESOLUTION_BASED_DPB 1 ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS 69 #define RESOLUTION_BASED_DPB 0 ///< JCTVC-Q0154 - remove sharing of sub-DPB across layers 70 ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS 65 71 #define ALIGNED_BUMPING 1 ///< JCTVC-P0192: Align bumping of pictures in an AU 66 #define MAX_SUBDPBS MAX_LAYERS67 #define SUB_BITSTREAM_PROPERTY_SEI 1 ///< JCTVC-P0204: Sub-bitstream property SEI message68 #if SUB_BITSTREAM_PROPERTY_SEI69 #define MAX_SUB_STREAMS 102470 #endif71 72 #define O0109_O0199_FLAGS_TO_VUI 1 ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui 72 73 #define O0109_VIEW_ID_LEN 1 ///< JCTVC-O0109: view_id_len_minus1 to view_id_len, and add constraint (1<<view_id_len) is greater than or equal to NumViews … … 77 78 #endif 78 79 79 #define P0295_DEFAULT_OUT_LAYER_IDC 1 ///< JCTVC-P0295: modifify default_one_target_output_layer_idc to default_ target_output_layer_idc80 #define P0295_DEFAULT_OUT_LAYER_IDC 1 ///< JCTVC-P0295: modifify default_one_target_output_layer_idc to default_output_layer_idc 80 81 #define O0109_DEFAULT_ONE_OUT_LAYER_IDC 1 ///< JCTVC-O0109: default_one_target_output_layer_flag to default_one_target_output_layer_idc 81 82 #define O0109_MOVE_VPS_VUI_FLAG 1 ///< JCTVC-O0109: move vps_vui_present_flag before vps_vui_offset … … 84 85 85 86 #define O0164_MULTI_LAYER_HRD 1 ///< JCTVC-O0164: Multi-layer HRD operation 86 #define Q0 074_SEI_COLOR_MAPPING 1 ///< JCTVC-Q0074, SEI Color Mapping87 #define Q0182_MULTI_LAYER_HRD_UPDATE 1 ///< JCTVC-Q0182: On bitstream partition buffering 87 88 88 89 #define O0194_DIFFERENT_BITDEPTH_EL_BL 1 ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled) … … 92 93 #define Q0048_CGS_3D_ASYMLUT 1 ///< JCTVC-Q0048: Colour gamut scalability with look-up table 93 94 #if Q0048_CGS_3D_ASYMLUT 95 #define CGS_GCC_NO_VECTORIZATION 1 94 96 #define O0194_WEIGHTED_PREDICTION_CGS 0 95 97 #else 96 98 #define O0194_WEIGHTED_PREDICTION_CGS 1 ///< JCTVC-O0194: Weighted prediciton for color gamut scalability 97 99 #endif 98 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 99 #define VPS_NUH_LAYER_ID 1 ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0 100 #define POC_RESET_FLAG 1 ///< JCTVC-N0244: POC reset flag for layer pictures. 100 #define POC_RESET_FLAG 0 ///< JCTVC-N0244: POC reset flag for layer pictures. 101 101 #define POC_RESET_IDC 1 ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG 102 102 #if POC_RESET_IDC 103 103 #define POC_RESET_IDC_SIGNALLING 1 ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements 104 #endif 104 #define POC_RESET_IDC_ENCODER 1 ///< JCTVC-P0041: Include support of enabling POC reset at the encoder 105 #define POC_RESET_IDC_DECODER 1 ///< JCTVC-P0041: Include support of enabling POC reset at the decoder 106 #define ALIGN_IRAP_BUGFIX 1 107 #define UNAVAILABLE_PIC_BUGFIX 1 108 #endif 109 #define POC_MSB_VAL_PRESENT_FLAG_SEM 1 ///< JCTVC-Q0146: Inference of poc_msb_val_present_flag 110 #define POC_RESET_INFO_INFERENCE 1 ///< JCTVC-Q0146: Infer the value of poc_reset_info_present_flag when not present 105 111 #define NO_OUTPUT_OF_PRIOR_PICS 1 ///< Use no_output_of_prior_pics_flag 106 #define ALIGN_TSA_STSA_PICS 1 ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU.107 112 #define REPN_FORMAT_IN_VPS 1 ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS 108 113 #if REPN_FORMAT_IN_VPS 109 114 #define REPN_FORMAT_CONTROL_FLAG 1 ///< JCTVC-O0179: Add control flag in representation format to control sending of chroma and bitdepth parameters 110 115 #endif 111 #define TIMING_INFO_NONZERO_LAYERID_SPS 1 ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS112 116 #define RPL_INIT_N0316_N0082 1 ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 113 117 114 118 #define SCALINGLIST_INFERRING 1 ///< JCTVC-N0371: inter-layer scaling list 115 #define SPS_EXTENSION 1 ///< Define sps_extension() syntax structure116 #if SPS_EXTENSION117 119 #define O0142_CONDITIONAL_SPS_EXTENSION 1 ///< JCTVC-O0142: Conditional SPS extension 118 #endif119 #define SCALABILITY_MASK_E0104 1 ///< JCT3V-E0104: scalability mask for depth120 #define LAYER_CTB 0 ///< enable layer-specific CTB structure121 120 #if POC_RESET_FLAG 122 121 #define PREVTID0_POC_RESET 1 ///< JCTVC-O0117 Modification of the PicOrderCntVal of prevTid0Pic … … 124 123 #endif 125 124 126 #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 header127 #if ILP_SSH_SIG128 #define ILP_SSH_SIG_FIX 1 ///< fix for SHM ticket #5129 #endif130 #define SPL_FLG_CHK 1 ///< JCTVC-N0195 proposal 5, JCTVC-N0085: constrain sum of lengths to be less than or equal to 6131 #define ILP_NUM_REF_CHK 1 ///< JCTVC-N0195 proposal 1, JCTVC-N0081, JCTVC-N0154, JCTVC-N0217: a condition on signaling inter_layer_pred_layer_idc[ i ], to avoid sending when NumDirectRefLayers equals NumActiveRefLayerPics, and instead infer values132 133 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS134 #define VPS_EXTNS 1 ///< Include function structure for VPS extensions135 #if VPS_EXTNS136 125 #define VPS_EXTN_MASK_AND_DIM_INFO 1 ///< Include avc_base_layer_flag, splitting_flag, scalability mask and dimension related info 137 126 #if VPS_EXTN_MASK_AND_DIM_INFO … … 142 131 #define VPS_EXTN_DIRECT_REF_LAYERS 1 ///< Include indication of direct dependency of layers in VPS extension 143 132 #define M0040_ADAPTIVE_RESOLUTION_CHANGE 1 144 #define VPS_VUI 1 ///< Include function structure for VPS VUI 145 146 #if VPS_VUI 133 147 134 #define VPS_VUI_TILES_NOT_IN_USE__FLAG 1 ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use 148 135 #define VPS_VUI_WPP_NOT_IN_USE__FLAG 1 ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use 149 #define TILE_BOUNDARY_ALIGNED_FLAG 1 ///< JCTVC-N0160/JCTVC-N0199 proposal 2 variant 2: VPS VUI flag to indicate tile boundary alignment150 136 #define N0160_VUI_EXT_ILP_REF 1 ///< VUI extension inter-layer dependency offset signalling 151 #define VPS_VUI_BITRATE_PICRATE 1 ///< JCTVC-N0085: Signal bit rate and picture in VPS VUI152 137 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 153 138 #define HIGHER_LAYER_IRAP_SKIP_FLAG 1 ///< JCTVC-O0199: Indication that higher layer IRAP picture uses skip blocks only … … 158 143 #endif 159 144 #define P0182_VPS_VUI_PS_FLAG 1 ///< JCTVC-P0182, add base_layer_parameter_set_compatibility_flag 160 #endif //VPS_VUI161 162 #endif163 145 164 146 #define P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED 1 ///< JCTVC-P0125 -- Keep it as a reserved FFFF value --- The following two macros (VPS_EXTN_OFFSET & VPS_EXTN_OFFSET_CALC) will have no effect when this macro is set to 1. … … 169 151 #define DERIVE_LAYER_ID_LIST_VARIABLES 1 ///< Derived variables based on the variables in VPS - for use in syntax table parsing 170 152 171 #define SVC_UPSAMPLING 1 ///< upsampling filters172 #define ROUNDING_OFFSET 1 ///< JCTVC-N0111: upsampling rounding offset using scalling factors173 #define N0214_INTERMEDIATE_BUFFER_16BITS 1 ///< JCTVC-N0214: support base layer input more than 8 bits174 #define ARBITRARY_SPATIAL_RATIO 1 ///< JCTVC-N0219, JCTVC-N0273: Support arbitrary spatial ratio175 176 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization)177 178 153 #define AVC_BASE 1 ///< YUV BL reading for AVC base SVC 179 154 #if AVC_BASE … … 181 156 #endif 182 157 183 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME)184 #define ENCODER_FAST_MODE 1 ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.185 158 #define REF_IDX_MFM 1 ///< JCTVC-L0336: motion vector mapping of inter-layer reference picture 186 159 #define MAX_ONE_RESAMPLING_DIRECT_LAYERS 1 ///< Allow maximum of one resampling process for direct reference layers 187 160 #define MOTION_RESAMPLING_CONSTRAINT 1 ///< JCTVC-N0108: Allow maximum of one motion resampling process for direct reference layers, and use motion inter-layer prediction from the same layer as texture inter-layer prediction. 188 #define EARLY_REF_PIC_MARKING 1 ///< Decoded picture marking of sub-layer non-reference pictures 189 #define N0120_MAX_TID_REF_PRESENT_FLAG 1 ///< JCTVC-N0120: max_tid_ref_pics_plus1_present_flag 190 #define N0120_MAX_TID_REF_CFG 1 ///< set max_tid_il_ref_pics_plus1 and max_tid_ref_present_flag in the config. file (configuration setting) 161 #define EARLY_REF_PIC_MARKING 0 ///< Valencia meeting - remove early marking of inter-layer reference pictures 162 ///< Decoded picture marking of sub-layer non-reference pictures 191 163 #define O0225_MAX_TID_FOR_REF_LAYERS 1 192 164 #define O0225_TID_BASED_IL_RPS_DERIV 1 … … 195 167 #define P0079_DERIVE_NUMACTIVE_REF_PICS 1 ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics 196 168 #define Q0060_MAX_TID_REF_EQUAL_TO_ZERO 1 ///< JCTVC-Q0060 handling the case max_tid_il_ref_pics_plus1 is equal to 0. 197 #if REF_IDX_MFM 198 #define N0139_POSITION_ROUNDING_OFFSET 1 ///< JCTVC-N0139: offset for collocated block in motion mapping 199 #endif 200 201 #define O0223_PICTURE_TYPES_ALIGN_FLAG 1 ///< a flag to indicatate whether picture types are aligned across layers. 169 170 #define O0223_PICTURE_TYPES_ALIGN_FLAG 1 ///< a flag to indicatate whether picture types are aligned across layers. 202 171 203 172 #define P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 1 ///< a flag to indicatate whether picture types for IRAP are IDR across layers. 204 173 205 #define N0147_IRAP_ALIGN_FLAG 1 ///< a flag to indicatate whether IRAPs are aligned across layers 206 #if N0147_IRAP_ALIGN_FLAG 207 #define O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS 1 ///< Remove IRAP align depedency constraints on poc_Reset_flag. 208 #define IRAP_ALIGN_FLAG_IN_VPS_VUI 1 ///< Move IRAP align flag to VPS VUI 209 #endif 210 #if !N0147_IRAP_ALIGN_FLAG 211 #define IDR_ALIGNMENT 1 ///< align IDR picures across layers : As per JCTVC-N0373, IDR are not required to be aligned. 212 #endif 213 #define FAST_INTRA_SHVC 1 ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only) 214 #if FAST_INTRA_SHVC 215 #define NB_REMAIN_MODES 2 ///< JCTVC-M0115: nb of remaining modes 216 #endif 217 218 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037: rate control for SHVC 174 #define IRAP_ALIGN_FLAG_IN_VPS_VUI 1 ///< Move IRAP align flag to VPS VUI 219 175 220 176 #define VIEW_ID_RELATED_SIGNALING 1 ///< Introduce syntax elements view_id and view_id_val 221 #define LAYERS_NOT_PRESENT_SEI 1 ///< JCTVC-M0043: add layers not present SEI.222 #define N0383_IL_CONSTRAINED_TILE_SETS_SEI 1223 177 #define N0065_LAYER_POC_ALIGNMENT 1 224 178 … … 246 200 247 201 #define Q0165_OUTPUT_LAYER_SET 1 ///< JCTVC-Q0165: add a constraint to disallow an empty output layer set 248 #define Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1 ///< JCTVC-Q0165: signal num_add_output_layer_set and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0 202 #define Q0165_NUM_ADD_OUTPUT_LAYER_SETS 1 ///< JCTVC-Q0165: signal num_add_olss and default_target_output_layer_idc when vps_num_layer_sets_minus1 is greater than 0 203 204 #define Q0078_ADD_LAYER_SETS 1 ///< JCTVC-Q0078: additional layer sets and layer set config 205 #if Q0078_ADD_LAYER_SETS 206 #define MAX_NUM_ADD_LAYER_SETS 1023 207 #endif 249 208 250 209 #define VPS_DPB_SIZE_TABLE 1 ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters … … 263 222 #define P0138_USE_ALT_CPB_PARAMS_FLAG 1 ///< JCTVC-P0138: use_alt_cpb_params_flag syntax in buffering period SEI message extension 264 223 #define P0166_MODIFIED_PPS_EXTENSION 1 ///< JCTVC-P0166: add pps_extension_type_flag 265 266 #if VIEW_ID_RELATED_SIGNALING 224 #define BITRATE_PICRATE_SIGNALLING 1 ///< JCTVC-Q0102 Proposal 3 signal bitrate, picrate only up to the maximum temporal sub-layers in the corresponding layer set 225 #define LAYER_DECPICBUFF_PARAM 1 ///< JCTVC-Q0102 Proposal 2 infer value from layer DPB param 226 #define HRD_BPB 1 ///< JCTVC-Q0101 Bitstream Partition Buffering Proposals 227 #define DPB_CONSTRAINTS 1 ///< JCTVC-Q0100 RPS DPB constraints 228 267 229 /// scalability types 268 230 enum ScalabilityType 269 231 { 270 232 VIEW_ORDER_INDEX = 1, 271 SCALABILITY_ID = 2, 272 }; 273 #endif 233 SCALABILITY_ID = 2, 234 AUX_ID = 3, 235 }; 236 237 /// normative encoder constraints -------- 238 #define MFM_ENCCONSTRAINT 1 ///< JCTVC-O0216: Encoder constraint for motion field mapping 239 #define REF_IDX_ME_ZEROMV 1 ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME) 240 241 /// encoder settings --------------------- 242 #define FAST_INTRA_SHVC 1 ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only) 243 #if FAST_INTRA_SHVC 244 #define NB_REMAIN_MODES 2 ///< JCTVC-M0115: nb of remaining modes 245 #endif 246 #define RC_SHVC_HARMONIZATION 1 ///< JCTVC-M0037: rate control for SHVC 247 #define JCTVC_M0259_LAMBDAREFINEMENT 1 ///< JCTVC-M0259: lambda refinement (encoder only optimization) 248 #define ENCODER_FAST_MODE 1 ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1. 249 #define LAYER_CTB 0 ///< enable layer-specific CTB structure 250 251 /// SEI messages ------------------------- 252 #define P0050_KNEE_FUNCTION_SEI 1 ///< JCTVC-P0050: Knee function SEI 253 #define SUB_BITSTREAM_PROPERTY_SEI 1 ///< JCTVC-P0204: Sub-bitstream property SEI message 254 #if SUB_BITSTREAM_PROPERTY_SEI 255 #define MAX_SUB_STREAMS 1024 256 #endif 257 #define Q0074_SEI_COLOR_MAPPING 1 ///< JCTVC-Q0074, SEI Color Mapping 258 #define LAYERS_NOT_PRESENT_SEI 1 ///< JCTVC-M0043: add layers not present SEI. 259 #define N0383_IL_CONSTRAINED_TILE_SETS_SEI 1 260 #define Q0189_TMVP_CONSTRAINTS 1 ///< JCTVC-Q0189: indicate constraints on TMVP 261 #define Q0247_FRAME_FIELD_INFO 1 ///< JCTVC-Q0247: field_frame_info SEI message 262 274 263 275 264 #else … … 304 293 #define MAX_NESTING_NUM_LAYER 64 305 294 306 #if VPS_RENAME307 #define MAX_VPS_OP_LAYER_SETS_PLUS1 3295 #if SVC_EXTENSION 296 #define MAX_VPS_OP_LAYER_SETS_PLUS1 (MAX_LAYERS+1) 308 297 #define MAX_VPS_LAYER_SETS_PLUS1 1024 309 298 #define MAX_VPS_LAYER_ID_PLUS1 MAX_LAYERS -
trunk/source/Lib/TLibDecoder/NALread.cpp
r595 r815 114 114 if ( nalu.m_temporalId ) 115 115 { 116 #if !Q0108_TSA_STSA 116 117 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 117 118 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 124 125 && nalu.m_nalUnitType != NAL_UNIT_EOS 125 126 && nalu.m_nalUnitType != NAL_UNIT_EOB ); 127 #else 128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 129 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL 130 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP 131 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL 132 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP 133 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA 134 && nalu.m_nalUnitType != NAL_UNIT_VPS 135 && nalu.m_nalUnitType != NAL_UNIT_SPS 136 && nalu.m_nalUnitType != NAL_UNIT_EOS); 137 #endif 126 138 } 127 139 else 128 140 { 141 #if !Q0108_TSA_STSA 129 142 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 130 143 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 131 144 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R 132 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N ); 145 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N 146 ); 147 #else 148 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R 149 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 150 ); 151 #endif 133 152 } 134 153 } -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r713 r815 93 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 94 94 break; 95 #if P0050_KNEE_FUNCTION_SEI 96 case SEI::KNEE_FUNCTION_INFO: 97 fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n"); 98 break; 99 #endif 95 100 #if Q0074_SEI_COLOR_MAPPING 96 101 case SEI::COLOR_MAPPING_INFO: … … 129 134 case SEI::BSP_HRD: 130 135 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 136 break; 137 #endif 138 #if Q0078_ADD_LAYER_SETS 139 case SEI::OUTPUT_LAYER_SET_NESTING: 140 fprintf(g_hTrace, "=========== Output layer set nesting SEI message ===========\n"); 141 break; 142 case SEI::VPS_REWRITING: 143 fprintf(g_hTrace, "=========== VPS rewriting SEI message ===========\n"); 131 144 break; 132 145 #endif … … 285 298 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 286 299 break; 300 #if P0050_KNEE_FUNCTION_SEI 301 case SEI::KNEE_FUNCTION_INFO: 302 sei = new SEIKneeFunctionInfo; 303 xParseSEIKneeFunctionInfo((SEIKneeFunctionInfo&) *sei, payloadSize); 304 break; 305 #endif 287 306 #if Q0074_SEI_COLOR_MAPPING 288 307 case SEI::COLOR_MAPPING_INFO: … … 345 364 sei = new SEIBspHrd; 346 365 xParseSEIBspHrd((SEIBspHrd&) *sei, sps, *nestingSei); 366 break; 367 #endif 368 #if Q0078_ADD_LAYER_SETS 369 case SEI::OUTPUT_LAYER_SET_NESTING: 370 sei = new SEIOutputLayerSetNesting; 371 #if LAYERS_NOT_PRESENT_SEI 372 xParseSEIOutputLayerSetNesting((SEIOutputLayerSetNesting&)*sei, nalUnitType, vps, sps); 373 #else 374 xParseSEIOutputLayerSetNesting((SEIOutputLayerSetNesting&)*sei, nalUnitType, sps); 375 #endif 376 break; 377 case SEI::VPS_REWRITING: 378 sei = new SEIVPSRewriting; 379 xParseSEIVPSRewriting((SEIVPSRewriting&)*sei); 380 break; 381 #endif 382 #if Q0189_TMVP_CONSTRAINTS 383 case SEI::TMVP_CONSTRAINTS: 384 sei = new SEITMVPConstrains; 385 xParseSEITMVPConstraints((SEITMVPConstrains&) *sei, payloadSize); 386 break; 387 #endif 388 #if Q0247_FRAME_FIELD_INFO 389 case SEI::FRAME_FIELD_INFO: 390 sei = new SEIFrameFieldInfo; 391 xParseSEIFrameFieldInfo ((SEIFrameFieldInfo&) *sei, payloadSize); 347 392 break; 348 393 #endif … … 849 894 } 850 895 896 #if P0050_KNEE_FUNCTION_SEI 897 Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt /*payloadSize*/){ 898 Int i; 899 UInt val; 900 READ_UVLC( val, "knee_function_id" ); sei.m_kneeId = val; 901 READ_FLAG( val, "knee_function_cancel_flag" ); sei.m_kneeCancelFlag = val; 902 if ( !sei.m_kneeCancelFlag ) 903 { 904 READ_FLAG( val, "knee_function_persistence_flag" ); sei.m_kneePersistenceFlag = val; 905 READ_FLAG( val, "mapping_flag" ); sei.m_kneeMappingFlag = val; 906 READ_CODE( 32, val, "input_d_range" ); sei.m_kneeInputDrange = val; 907 READ_CODE( 32, val, "input_disp_luminance" ); sei.m_kneeInputDispLuminance = val; 908 READ_CODE( 32, val, "output_d_range" ); sei.m_kneeOutputDrange = val; 909 READ_CODE( 32, val, "output_disp_luminance" ); sei.m_kneeOutputDispLuminance = val; 910 READ_UVLC( val, "num_knee_points_minus1" ); sei.m_kneeNumKneePointsMinus1 = val; 911 assert( sei.m_kneeNumKneePointsMinus1 > 0 ); 912 sei.m_kneeInputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1); 913 sei.m_kneeOutputKneePoint.resize(sei.m_kneeNumKneePointsMinus1+1); 914 for(i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ ) 915 { 916 READ_CODE( 10, val, "input_knee_point" ); sei.m_kneeInputKneePoint[i] = val; 917 READ_CODE( 10, val, "output_knee_point" ); sei.m_kneeOutputKneePoint[i] = val; 918 } 919 } 920 } 921 #endif 922 851 923 #if Q0074_SEI_COLOR_MAPPING 852 924 Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/) … … 960 1032 } 961 1033 1034 #if Q0189_TMVP_CONSTRAINTS 1035 Void SEIReader::xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize) 1036 { 1037 UInt uiCode; 1038 READ_UVLC( uiCode, "prev_pics_not_used_flag" ); sei.prev_pics_not_used_flag = uiCode; 1039 READ_UVLC( uiCode, "no_intra_layer_col_pic_flag" ); sei.no_intra_layer_col_pic_flag = uiCode; 1040 xParseByteAlign(); 1041 } 1042 #endif 1043 1044 #if Q0247_FRAME_FIELD_INFO 1045 Void SEIReader::xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize) 1046 { 1047 UInt code; 1048 READ_CODE( 4, code, "ffinfo_pic_struct" ); sei.m_ffinfo_picStruct = code; 1049 READ_CODE( 2, code, "ffinfo_source_scan_type" ); sei.m_ffinfo_sourceScanType = code; 1050 READ_FLAG( code, "ffinfo_duplicate_flag" ); sei.m_ffinfo_duplicateFlag = ( code == 1 ? true : false ); 1051 xParseByteAlign(); 1052 } 1053 #endif 1054 962 1055 #if LAYERS_NOT_PRESENT_SEI 963 1056 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps) … … 1209 1302 UInt lsIdx = nestingSei.m_nestingOpIdx[h]; 1210 1303 READ_UVLC( uiCode, "num_sei_bitstream_partitions_minus1[i]"); sei.m_seiNumBitstreamPartitionsMinus1[lsIdx] = uiCode; 1211 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1212 { 1213 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1304 #if HRD_BPB 1305 Int chkPart=0; 1306 #endif 1307 UInt i; 1308 for(i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 1309 { 1310 #if HRD_BPB 1311 UInt nl=0; UInt j; 1312 for(j = 0; j < sei.m_vpsMaxLayers; j++) 1214 1313 { 1215 1314 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1216 1315 { 1316 nl++; 1317 } 1318 } 1319 for (j = 0; j < nl; j++) 1320 { 1321 #else 1322 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1323 { 1324 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 1325 { 1326 #endif 1217 1327 READ_FLAG( uiCode, "sei_layer_in_bsp_flag[lsIdx][i][j]" ); sei.m_seiLayerInBspFlag[lsIdx][i][j] = uiCode; 1218 1328 } 1219 } 1220 } 1329 #if !HRD_BPB 1330 } 1331 #endif 1332 #if HRD_BPB 1333 chkPart+=sei.m_seiLayerInBspFlag[lsIdx][i][j]; 1334 #endif 1335 } 1336 #if HRD_BPB 1337 assert(chkPart<=1); 1338 #endif 1339 #if HRD_BPB 1340 if(sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]==0) 1341 { 1342 Int chkPartition1=0; Int chkPartition2=0; 1343 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 1344 { 1345 if( sei.m_layerIdIncludedFlag[lsIdx][j] ) 1346 { 1347 chkPartition1+=sei.m_seiLayerInBspFlag[lsIdx][0][j]; 1348 chkPartition2++; 1349 } 1350 } 1351 assert(chkPartition1!=chkPartition2); 1352 } 1353 #endif 1354 1221 1355 READ_UVLC( uiCode, "sei_num_bsp_sched_combinations_minus1[i]"); sei.m_seiNumBspSchedCombinationsMinus1[lsIdx] = uiCode; 1222 for ( UInti = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++)1356 for (i = 0; i <= sei.m_seiNumBspSchedCombinationsMinus1[lsIdx]; i++) 1223 1357 { 1224 1358 for (UInt j = 0; j <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; j++) 1225 1359 { 1226 1360 READ_UVLC( uiCode, "sei_bsp_comb_hrd_idx[lsIdx][i][j]"); sei.m_seiBspCombHrdIdx[lsIdx][i][j] = uiCode; 1361 #if HRD_BPB 1362 assert(uiCode <= sei.m_seiNumBspHrdParametersMinus1); 1363 #endif 1227 1364 READ_UVLC( uiCode, "sei_bsp_comb_sched_idx[lsIdx][i][j]"); sei.m_seiBspCombScheddx[lsIdx][i][j] = uiCode; 1365 #if HRD_BPB 1366 assert(uiCode <= sei.hrd->getCpbCntMinus1( sps->getMaxTLayers()-1 )); 1367 #endif 1368 1228 1369 } 1229 1370 } … … 1307 1448 #endif 1308 1449 1450 #if Q0078_ADD_LAYER_SETS 1451 1452 #if LAYERS_NOT_PRESENT_SEI 1453 Void SEIReader::xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps) 1454 #else 1455 Void SEIReader::xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComSPS *sps) 1456 #endif 1457 { 1458 UInt uiCode; 1459 SEIMessages seis; 1460 1461 READ_FLAG(uiCode, "ols_flag"); sei.m_olsFlag = uiCode; 1462 READ_UVLC(uiCode, "num_ols_indices_minus1"); sei.m_numOlsIndicesMinus1 = uiCode; 1463 1464 for (Int i = 0; i <= sei.m_numOlsIndicesMinus1; i++) 1465 { 1466 READ_UVLC(uiCode, "ols_idx[i]"); sei.m_olsIdx[i] = uiCode; 1467 } 1468 1469 // byte alignment 1470 while (m_pcBitstream->getNumBitsRead() % 8 != 0) 1471 { 1472 UInt code; 1473 READ_FLAG(code, "ols_nesting_zero_bit"); 1474 } 1475 1476 sei.m_callerOwnsSEIs = false; 1477 1478 // read nested SEI messages 1479 do { 1480 #if O0164_MULTI_LAYER_HRD 1481 #if LAYERS_NOT_PRESENT_SEI 1482 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 1483 #else 1484 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 1485 #endif 1486 #else 1487 #if LAYERS_NOT_PRESENT_SEI 1488 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, vps, sps); 1489 #else 1490 xReadSEImessage(sei.m_nestedSEIs, nalUnitType, sps); 1491 #endif 1492 #endif 1493 } while (m_pcBitstream->getNumBitsLeft() > 8); 1494 1495 } 1496 1497 Void SEIReader::xParseSEIVPSRewriting(SEIVPSRewriting &sei) 1498 { 1499 } 1500 1501 #endif 1502 1309 1503 #endif //SVC_EXTENSION 1310 1504 -
trunk/source/Lib/TLibDecoder/SEIread.h
r713 r815 90 90 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 91 91 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 92 #if P0050_KNEE_FUNCTION_SEI 93 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize); 94 #endif 92 95 #if Q0074_SEI_COLOR_MAPPING 93 96 Void xParseSEIColorMappingInfo (SEIColorMappingInfo& sei, UInt payloadSize); … … 116 119 Void xParseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1); 117 120 #endif 121 #if Q0078_ADD_LAYER_SETS 122 #if LAYERS_NOT_PRESENT_SEI 123 Void xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps); 124 #else 125 Void xParseSEIOutputLayerSetNesting(SEIOutputLayerSetNesting& sei, const NalUnitType nalUnitType, TComSPS *sps); 126 #endif 127 Void xParseSEIVPSRewriting(SEIVPSRewriting &sei); 128 #endif 129 130 #if Q0189_TMVP_CONSTRAINTS 131 Void xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize); 132 #endif 133 #if Q0247_FRAME_FIELD_INFO 134 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize); 135 #endif 118 136 Void xParseByteAlign(); 119 137 }; -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r713 r815 339 339 340 340 READ_FLAG( uiCode, "pps_extension_flag"); 341 #if POC_RESET_INFO_INFERENCE 342 pcPPS->setExtensionFlag( uiCode ? true : false ); 343 344 if( pcPPS->getExtensionFlag() ) 345 #else 341 346 if (uiCode) 347 #endif 342 348 { 343 349 #if P0166_MODIFIED_PPS_EXTENSION … … 367 373 #endif 368 374 } 375 #if POC_RESET_INFO_INFERENCE 376 else // Extension type 0 absent 377 { 378 pcPPS->setPocResetInfoPresentFlag( false ); 379 } 380 #endif 369 381 if (ppsExtensionTypeFlag[7]) 370 382 { … … 379 391 #endif 380 392 } 393 #if POC_RESET_INFO_INFERENCE 394 if( !pcPPS->getExtensionFlag() ) 395 { 396 pcPPS->setPocResetInfoPresentFlag( false ); 397 } 398 #endif 381 399 } 382 400 … … 443 461 TimingInfo *timingInfo = pcVUI->getTimingInfo(); 444 462 READ_FLAG( uiCode, "vui_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); 445 #if TIMING_INFO_NONZERO_LAYERID_SPS463 #if SVC_EXTENSION 446 464 if( pcSPS->getLayerId() > 0 ) 447 465 { … … 585 603 #endif 586 604 605 #if !Q0177_SPS_TEMP_NESTING_FIX //This part is not needed anymore as it is already covered by implementation in TDecTop::xActivateParameterSets() 587 606 if ( pcSPS->getMaxTLayers() == 1 ) 588 607 { … … 596 615 #endif 597 616 } 617 #endif 618 598 619 #ifdef SPS_PTL_FIX 599 620 if ( pcSPS->getLayerId() == 0) … … 827 848 828 849 READ_FLAG( uiCode, "sps_extension_flag"); 829 if (uiCode) 830 { 831 #if SPS_EXTENSION 832 850 851 #if SVC_EXTENSION 852 pcSPS->setExtensionFlag( uiCode ? true : false ); 853 854 if( pcSPS->getExtensionFlag() ) 855 { 833 856 #if O0142_CONDITIONAL_SPS_EXTENSION 834 857 UInt spsExtensionTypeFlag[8]; … … 849 872 { 850 873 #endif 851 852 #endif853 874 while ( xMoreRbspData() ) 854 875 { 855 876 READ_FLAG( uiCode, "sps_extension_data_flag"); 856 877 } 857 #if SPS_EXTENSION 858 } 859 #endif 860 } 861 } 862 863 #if SPS_EXTENSION 878 } 879 } 880 #else 881 if (uiCode) 882 { 883 while ( xMoreRbspData() ) 884 { 885 READ_FLAG( uiCode, "sps_extension_data_flag"); 886 } 887 } 888 #endif 889 } 890 891 #if SVC_EXTENSION 864 892 Void TDecCavlc::parseSPSExtension( TComSPS* pcSPS ) 865 893 { … … 899 927 READ_CODE( 4, uiCode, "vps_video_parameter_set_id" ); pcVPS->setVPSId( uiCode ); 900 928 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 901 #if VPS_RENAME929 #if SVC_EXTENSION 902 930 #if O0137_MAX_LAYERID 903 931 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayers( min( 62u, uiCode) + 1 ); … … 941 969 } 942 970 943 #if VPS_RENAME971 #if SVC_EXTENSION 944 972 assert( pcVPS->getNumHrdParameters() < MAX_VPS_LAYER_SETS_PLUS1 ); 945 973 assert( pcVPS->getMaxLayerId() < MAX_VPS_LAYER_ID_PLUS1 ); 946 974 READ_CODE( 6, uiCode, "vps_max_layer_id" ); pcVPS->setMaxLayerId( uiCode ); 975 #if Q0078_ADD_LAYER_SETS 976 READ_UVLC(uiCode, "vps_num_layer_sets_minus1"); pcVPS->setVpsNumLayerSetsMinus1(uiCode); 977 pcVPS->setNumLayerSets(pcVPS->getVpsNumLayerSetsMinus1() + 1); 978 for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++) 979 #else 947 980 READ_UVLC( uiCode, "vps_num_layer_sets_minus1" ); pcVPS->setNumLayerSets( uiCode + 1 ); 948 981 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ ) 982 #endif 949 983 { 950 984 // Operation point set … … 995 1029 } 996 1030 997 #if VPS_EXTNS1031 #if SVC_EXTENSION 998 1032 READ_FLAG( uiCode, "vps_extension_flag" ); pcVPS->setVpsExtensionFlag( uiCode ? true : false ); 999 1033 … … 1040 1074 1041 1075 #if SVC_EXTENSION 1042 #if VPS_EXTNS1043 1076 Void TDecCavlc::parseVPSExtension(TComVPS *vps) 1044 1077 { … … 1081 1114 } 1082 1115 1116 // The value of dimBitOffset[ NumScalabilityTypes ] is set equal to 6. 1083 1117 if(vps->getSplittingFlag()) 1084 1118 { … … 1166 1200 } 1167 1201 #endif 1202 #if Q0078_ADD_LAYER_SETS 1203 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved here 1204 vps->setNumRefLayers(); 1205 1206 if (vps->getMaxLayers() > MAX_REF_LAYERS) 1207 { 1208 for (i = 1; i < vps->getMaxLayers(); i++) 1209 { 1210 assert(vps->getNumRefLayers(vps->getLayerIdInNuh(i)) <= MAX_REF_LAYERS); 1211 } 1212 } 1213 #endif 1214 vps->setPredictedLayerIds(); 1215 vps->setTreePartitionLayerIdList(); 1216 #endif 1168 1217 #if VPS_TSLAYERS 1169 1218 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag"); vps->setMaxTSLayersPresentFlag(uiCode ? true : false); … … 1184 1233 } 1185 1234 #endif 1186 #if N0120_MAX_TID_REF_PRESENT_FLAG1187 1235 READ_FLAG( uiCode, "max_tid_ref_present_flag"); vps->setMaxTidRefPresentFlag(uiCode ? true : false); 1188 1236 if (vps->getMaxTidRefPresentFlag()) … … 1201 1249 #else 1202 1250 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1203 #if N0120_MAX_TID_REF_CFG1204 1251 assert( uiCode <= vps->getMaxTLayers()); 1205 #else1206 assert( uiCode <= vps->getMaxTLayers()+ 1 );1207 #endif1208 1252 #endif 1209 1253 } … … 1223 1267 } 1224 1268 } 1225 #else 1226 for(i = 0; i < vps->getMaxLayers() - 1; i++) 1227 { 1228 #if O0225_MAX_TID_FOR_REF_LAYERS 1229 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 1230 { 1231 if(vps->getDirectDependencyFlag(j, i)) 1232 { 1233 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i][j]" ); vps->setMaxTidIlRefPicsPlus1(i, j, uiCode); 1234 assert( uiCode <= vps->getMaxTLayers() ); 1235 } 1236 } 1237 #else 1238 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); vps->setMaxTidIlRefPicsPlus1(i, uiCode); 1239 assert( uiCode <= vps->getMaxTLayers() ); 1240 #endif 1241 } 1242 #endif 1243 #if ILP_SSH_SIG 1244 READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false); 1245 #endif 1269 READ_FLAG( uiCode, "all_ref_layers_active_flag" ); vps->setIlpSshSignalingEnabledFlag(uiCode ? true : false); 1246 1270 #if VPS_EXTN_PROFILE_INFO 1247 1271 // Profile-tier-level signalling … … 1276 1300 #endif 1277 1301 1302 #if Q0078_ADD_LAYER_SETS 1303 if (vps->getNumIndependentLayers() > 1) 1304 { 1305 READ_UVLC(uiCode, "num_add_layer_sets"); vps->setNumAddLayerSets(uiCode); 1306 for (i = 0; i < vps->getNumAddLayerSets(); i++) 1307 { 1308 for (j = 1; j < vps->getNumIndependentLayers(); j++) 1309 { 1310 int len = 1; 1311 while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1)) 1312 { 1313 len++; 1314 } 1315 READ_CODE(len, uiCode, "highest_layer_idx_plus1[i][j]"); vps->setHighestLayerIdxPlus1(i, j, uiCode); 1316 } 1317 } 1318 vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets()); 1319 vps->setLayerIdIncludedFlagsForAddLayerSets(); 1320 } 1321 #endif 1322 1278 1323 #if !VPS_EXTN_UEV_CODING 1279 1324 READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); vps->setMoreOutputLayerSetsThanDefaultFlag( uiCode ? true : false ); … … 1293 1338 if( vps->getNumLayerSets() > 1 ) 1294 1339 { 1295 READ_UVLC( uiCode, "num_add_o utput_layer_sets" ); vps->setNumAddOutputLayerSets( uiCode );1296 READ_CODE( 2, uiCode, "default_ target_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode );1340 READ_UVLC( uiCode, "num_add_olss" ); vps->setNumAddOutputLayerSets( uiCode ); 1341 READ_CODE( 2, uiCode, "default_output_layer_idc" ); vps->setDefaultTargetOutputLayerIdc( uiCode ); 1297 1342 } 1298 1343 else … … 1304 1349 #endif 1305 1350 1306 // The value of num_add_o utput_layer_sets shall be in the range of 0 to 1023, inclusive.1351 // The value of num_add_olss shall be in the range of 0 to 1023, inclusive. 1307 1352 assert( vps->getNumAddOutputLayerSets() >= 0 && vps->getNumAddOutputLayerSets() < 1024 ); 1308 1353 … … 1328 1373 numBits++; 1329 1374 } 1330 READ_CODE( numBits, uiCode, " output_layer_set_idx_minus1"); vps->setOutputLayerSetIdx( i, uiCode + 1);1375 READ_CODE( numBits, uiCode, "layer_set_idx_for_ols_minus1"); vps->setOutputLayerSetIdx( i, uiCode + 1); 1331 1376 } 1332 1377 else … … 1334 1379 vps->setOutputLayerSetIdx( i, i ); 1335 1380 } 1381 #if Q0078_ADD_LAYER_SETS 1382 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1383 #else 1336 1384 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) 1385 #endif 1337 1386 { 1338 1387 Int lsIdx = vps->getOutputLayerSetIdx(i); … … 1634 1683 #endif 1635 1684 1636 #if N0147_IRAP_ALIGN_FLAG &&!IRAP_ALIGN_FLAG_IN_VPS_VUI1685 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI 1637 1686 READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" ); 1638 1687 vps->setCrossLayerIrapAlignFlag(uiCode); … … 1678 1727 } 1679 1728 #endif 1680 #if O0092_0094_DEPENDENCY_CONSTRAINT 1681 for(i = 1; i < vps->getMaxLayers(); i++) 1682 { 1683 vps->setNumRefLayers(vps->getLayerIdInNuh(i)); // identify the number of direct and indirect reference layers of current layer and set recursiveRefLayersFlags 1684 } 1729 #if !Q0078_ADD_LAYER_SETS 1730 #if O0092_0094_DEPENDENCY_CONSTRAINT // Moved up 1731 vps->setNumRefLayers(); 1732 1685 1733 if(vps->getMaxLayers() > MAX_REF_LAYERS) 1686 1734 { … … 1690 1738 } 1691 1739 } 1740 #endif 1692 1741 #endif 1693 1742 … … 1732 1781 #endif 1733 1782 { 1734 #if VPS_VUI1735 1783 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1736 1784 { … … 1738 1786 } 1739 1787 parseVPSVUI(vps); 1740 #endif1741 1788 } 1742 1789 else … … 1778 1825 } 1779 1826 1780 // When not present, the value of num_add_o utput_layer_sets is inferred to be equal to 0.1781 // NumOutputLayerSets = num_add_o utput_layer_sets + vps_num_layer_sets_minus1 + 11827 // When not present, the value of num_add_olss is inferred to be equal to 0. 1828 // NumOutputLayerSets = num_add_olss + NumLayerSets 1782 1829 vps->setNumOutputLayerSets( vps->getNumLayerSets() ); 1783 1830 1784 1831 // For i in the range of 0 to NumOutputLayerSets-1, inclusive, the variable LayerSetIdxForOutputLayerSet[ i ] is derived as specified in the following: 1785 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : output_layer_set_idx_minus1[ i ] + 11832 // LayerSetIdxForOutputLayerSet[ i ] = ( i <= vps_number_layer_sets_minus1 ) ? i : layer_set_idx_for_ols_minus1[ i ] + 1 1786 1833 for( i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1787 1834 { … … 1834 1881 Void TDecCavlc::defaultVPSVUI( TComVPS* vps ) 1835 1882 { 1836 #if N0147_IRAP_ALIGN_FLAG1837 1883 // When not present, the value of all_layers_idr_aligned_flag is inferred to be equal to 0. 1838 1884 vps->setCrossLayerIrapAlignFlag( false ); 1839 #endif1840 1885 1841 1886 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 1849 1894 #endif 1850 1895 } 1851 #endif1852 1896 1853 1897 #if REPN_FORMAT_IN_VPS … … 1918 1962 UInt uiCode; 1919 1963 #if DPB_PARAMS_MAXTLAYERS 1964 #if BITRATE_PICRATE_SIGNALLING 1965 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumLayerSets()]; 1966 for(Int i = 0; i < vps->getNumLayerSets(); i++) 1967 #else 1920 1968 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1921 1969 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1970 #endif 1922 1971 { 1923 1972 UInt maxSLMinus1 = 0; … … 1927 1976 Int optLsIdx = i; 1928 1977 #endif 1978 #if BITRATE_PICRATE_SIGNALLING 1979 optLsIdx = i; 1980 #endif 1929 1981 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1930 1982 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); … … 1932 1984 } 1933 1985 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1986 #if BITRATE_PICRATE_SIGNALLING 1987 vps->setMaxSLayersInLayerSetMinus1(i,MaxSubLayersInLayerSetMinus1[ i ]); 1988 #endif 1934 1989 } 1935 1990 #endif … … 1945 2000 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]"); vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false ); 1946 2001 #if DPB_PARAMS_MAXTLAYERS 2002 #if BITRATE_PICRATE_SIGNALLING 2003 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ vps->getOutputLayerSetIdx( i ) ]; j++) 2004 #else 1947 2005 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 2006 #endif 1948 2007 #else 1949 2008 for(Int j = 0; j <= vps->getMaxTLayers(); j++) … … 2009 2068 if( !vps->getSubLayerDpbInfoPresentFlag(i, j) ) // If sub-layer DPB information is NOT present 2010 2069 { 2070 #if RESOLUTION_BASED_DPB 2011 2071 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 2072 #else 2073 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 2074 #endif 2012 2075 { 2013 2076 vps->setMaxVpsDecPicBufferingMinus1( i, k, j, vps->getMaxVpsDecPicBufferingMinus1( i, k, j - 1 ) ); 2014 2077 } 2015 2078 vps->setMaxVpsNumReorderPics( i, j, vps->getMaxVpsNumReorderPics( i, j - 1) ); 2079 #if RESOLUTION_BASED_DPB 2016 2080 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 2017 2081 { 2018 2082 vps->setMaxVpsLayerDecPicBuffMinus1( i, k, j, vps->getMaxVpsLayerDecPicBuffMinus1( i, k, j - 1)); 2019 2083 } 2084 #endif 2020 2085 vps->setMaxVpsLatencyIncreasePlus1( i, j, vps->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 2021 2086 } … … 2024 2089 } 2025 2090 #endif 2026 #if VPS_VUI 2091 2027 2092 Void TDecCavlc::parseVPSVUI(TComVPS *vps) 2028 2093 { … … 2039 2104 vps->setCrossLayerIrapAlignFlag(uiCode); 2040 2105 #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG 2041 if (uiCode)2042 { 2043 READ_FLAG( uiCode, "all_layers_idr_aligned_flag" );2044 vps->setCrossLayer IrapAlignFlag(uiCode);2106 if( uiCode ) 2107 { 2108 READ_FLAG( uiCode, "all_layers_idr_aligned_flag" ); 2109 vps->setCrossLayerAlignedIdrOnlyFlag(uiCode); 2045 2110 } 2046 2111 #endif … … 2053 2118 } 2054 2119 #endif 2055 #if VPS_VUI_BITRATE_PICRATE 2120 2056 2121 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); vps->setBitRatePresentVpsFlag( uiCode ? true : false ); 2057 2122 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); vps->setPicRatePresentVpsFlag( uiCode ? true : false ); 2058 2123 2059 2124 Bool parseFlag = vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag(); 2060 { 2061 for( i = 0; i < vps->getNumLayerSets(); i++ ) 2062 { 2063 for( j = 0; j < vps->getMaxTLayers(); j++ ) 2064 { 2065 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 2066 { 2067 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 2068 } 2069 else 2070 { 2071 vps->setBitRatePresentFlag( i, j, false ); 2072 } 2073 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 2074 { 2075 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 2076 } 2077 else 2078 { 2079 vps->setPicRatePresentFlag( i, j, false ); 2080 } 2081 if( parseFlag && vps->getBitRatePresentFlag(i, j) ) 2082 { 2083 READ_CODE( 16, uiCode, "avg_bit_rate[i][j]" ); vps->setAvgBitRate( i, j, uiCode ); 2084 READ_CODE( 16, uiCode, "max_bit_rate[i][j]" ); vps->setMaxBitRate( i, j, uiCode ); 2085 } 2086 else 2087 { 2088 vps->setAvgBitRate( i, j, 0 ); 2089 vps->setMaxBitRate( i, j, 0 ); 2090 } 2091 if( parseFlag && vps->getPicRatePresentFlag(i, j) ) 2092 { 2093 READ_CODE( 2 , uiCode, "constant_pic_rate_idc[i][j]" ); vps->setConstPicRateIdc( i, j, uiCode ); 2094 READ_CODE( 16, uiCode, "avg_pic_rate[i][j]" ); vps->setAvgPicRate( i, j, uiCode ); 2095 } 2096 else 2097 { 2098 vps->setConstPicRateIdc( i, j, 0 ); 2099 vps->setAvgPicRate ( i, j, 0 ); 2100 } 2101 } 2102 } 2103 } 2104 #endif 2125 2126 #if Q0078_ADD_LAYER_SETS 2127 for( i = 0; i <= vps->getVpsNumLayerSetsMinus1(); i++ ) 2128 #else 2129 for( i = 0; i < vps->getNumLayerSets(); i++ ) 2130 #endif 2131 { 2132 #if BITRATE_PICRATE_SIGNALLING 2133 for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ ) 2134 #else 2135 for( j = 0; j < vps->getMaxTLayers(); j++ ) 2136 #endif 2137 { 2138 if( parseFlag && vps->getBitRatePresentVpsFlag() ) 2139 { 2140 READ_FLAG( uiCode, "bit_rate_present_flag[i][j]" ); vps->setBitRatePresentFlag( i, j, uiCode ? true : false ); 2141 } 2142 else 2143 { 2144 vps->setBitRatePresentFlag( i, j, false ); 2145 } 2146 if( parseFlag && vps->getPicRatePresentVpsFlag() ) 2147 { 2148 READ_FLAG( uiCode, "pic_rate_present_flag[i][j]" ); vps->setPicRatePresentFlag( i, j, uiCode ? true : false ); 2149 } 2150 else 2151 { 2152 vps->setPicRatePresentFlag( i, j, false ); 2153 } 2154 if( parseFlag && vps->getBitRatePresentFlag(i, j) ) 2155 { 2156 READ_CODE( 16, uiCode, "avg_bit_rate[i][j]" ); vps->setAvgBitRate( i, j, uiCode ); 2157 READ_CODE( 16, uiCode, "max_bit_rate[i][j]" ); vps->setMaxBitRate( i, j, uiCode ); 2158 } 2159 else 2160 { 2161 vps->setAvgBitRate( i, j, 0 ); 2162 vps->setMaxBitRate( i, j, 0 ); 2163 } 2164 if( parseFlag && vps->getPicRatePresentFlag(i, j) ) 2165 { 2166 READ_CODE( 2 , uiCode, "constant_pic_rate_idc[i][j]" ); vps->setConstPicRateIdc( i, j, uiCode ); 2167 READ_CODE( 16, uiCode, "avg_pic_rate[i][j]" ); vps->setAvgPicRate( i, j, uiCode ); 2168 } 2169 else 2170 { 2171 vps->setConstPicRateIdc( i, j, 0 ); 2172 vps->setAvgPicRate ( i, j, 0 ); 2173 } 2174 } 2175 } 2105 2176 #if VPS_VUI_VIDEO_SIGNAL_MOVE 2106 2177 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); vps->setVideoSigPresentVpsFlag( uiCode == 1 ); … … 2162 2233 } 2163 2234 #endif 2164 #if TILE_BOUNDARY_ALIGNED_FLAG 2235 2165 2236 for(i = 1; i < vps->getMaxLayers(); i++) 2166 2237 { … … 2177 2248 } 2178 2249 } 2179 #endif2180 2250 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 2181 2251 } … … 2290 2360 parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 2291 2361 } 2362 #if Q0078_ADD_LAYER_SETS 2363 for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++) 2364 #else 2292 2365 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 2366 #endif 2293 2367 { 2294 2368 READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode); 2369 #if HRD_BPB 2370 Int chkPart=0; 2371 #endif 2295 2372 for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ ) 2296 2373 { … … 2302 2379 } 2303 2380 } 2304 } 2381 #if HRD_BPB 2382 chkPart+=vps->getLayerInBspFlag(h, i, j); 2383 #endif 2384 } 2385 #if HRD_BPB 2386 assert(chkPart<=1); 2387 #endif 2388 #if HRD_BPB 2389 if(vps->getNumBitstreamPartitions(h)==1) 2390 { 2391 Int chkPartition1=0; Int chkPartition2=0; 2392 for( j = 0; j <= (vps->getMaxLayers()-1); j++ ) 2393 { 2394 if( vps->getLayerIdIncludedFlag(h, j) ) 2395 { 2396 chkPartition1+=vps->getLayerInBspFlag(h, 0, j); 2397 chkPartition2++; 2398 } 2399 } 2400 assert(chkPartition1!=chkPartition2); 2401 } 2402 #endif 2305 2403 if (vps->getNumBitstreamPartitions(h)) 2306 2404 { 2405 #if Q0182_MULTI_LAYER_HRD_UPDATE 2406 READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1[h]"); vps->setNumBspSchedCombinations(h, uiCode + 1); 2407 #else 2307 2408 READ_UVLC( uiCode, "num_bsp_sched_combinations[h]"); vps->setNumBspSchedCombinations(h, uiCode); 2409 #endif 2308 2410 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 2309 2411 { … … 2311 2413 { 2312 2414 READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][j]"); vps->setBspCombHrdIdx(h, i, j, uiCode); 2415 #if HRD_BPB 2416 assert(uiCode <= vps->getVpsNumBspHrdParametersMinus1()); 2417 #endif 2418 2313 2419 READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][j]"); vps->setBspCombSchedIdx(h, i, j, uiCode); 2420 #if HRD_BPB 2421 assert(uiCode <= vps->getBspHrdParamBufferCpbCntMinus1(uiCode,vps->getMaxTLayers()-1)); 2422 #endif 2314 2423 } 2315 2424 } … … 2334 2443 #endif 2335 2444 } 2336 #endif2337 2445 #endif //SVC_EXTENSION 2338 2446 … … 2412 2520 } 2413 2521 2522 #if Q0142_POC_LSB_NOT_PRESENT 2523 #if SHM_FIX7 2524 Int iPOClsb = 0; 2525 #endif 2526 #endif 2527 2414 2528 if(!rpcSlice->getDependentSliceSegmentFlag()) 2415 2529 { … … 2484 2598 } 2485 2599 #if N0065_LAYER_POC_ALIGNMENT 2600 #if !Q0142_POC_LSB_NOT_PRESENT 2486 2601 #if SHM_FIX7 2487 2602 Int iPOClsb = 0; 2488 2603 #endif 2604 #endif 2489 2605 #if O0062_POC_LSB_NOT_PRESENT_FLAG 2490 2606 if( ( rpcSlice->getLayerId() > 0 && !rpcSlice->getVPS()->getPocLsbNotPresentFlag( rpcSlice->getVPS()->getLayerIdInVps(rpcSlice->getLayerId())) ) || !rpcSlice->getIdrPicFlag()) … … 2497 2613 { 2498 2614 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 2615 #if POC_RESET_IDC_DECODER 2616 rpcSlice->setPicOrderCntLsb( uiCode ); 2617 #endif 2499 2618 #if SHM_FIX7 2500 2619 iPOClsb = uiCode; … … 2531 2650 #if SHM_FIX7 2532 2651 } 2652 #endif 2653 #if POC_RESET_IDC_DECODER 2654 else 2655 { 2656 rpcSlice->setPicOrderCntLsb( 0 ); 2657 } 2533 2658 #endif 2534 2659 if( !rpcSlice->getIdrPicFlag() ) … … 2645 2770 rps->setNumberOfPictures(offset); 2646 2771 } 2772 #if DPB_CONSTRAINTS 2773 if(rpcSlice->getVPS()->getVpsExtensionFlag()==1) 2774 { 2775 #if Q0078_ADD_LAYER_SETS 2776 for (Int ii = 1; ii < (rpcSlice->getVPS()->getVpsNumLayerSetsMinus1() + 1); ii++) // prevent assert error when num_add_layer_sets > 0 2777 #else 2778 for (Int ii=1; ii< rpcSlice->getVPS()->getNumOutputLayerSets(); ii++ ) 2779 #endif 2780 { 2781 Int layerSetIdxForOutputLayerSet = rpcSlice->getVPS()->getOutputLayerSetIdx( ii ); 2782 Int chkAssert=0; 2783 for(Int kk = 0; kk < rpcSlice->getVPS()->getNumLayersInIdList(layerSetIdxForOutputLayerSet); kk++) 2784 { 2785 if(rpcSlice->getLayerId()==rpcSlice->getVPS()->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, kk)) 2786 { 2787 chkAssert=1; 2788 } 2789 } 2790 if(chkAssert) 2791 { 2792 // There may be something wrong here (layer id assumed to be layer idx?) 2793 assert(rps->getNumberOfNegativePictures() <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii))); 2794 assert(rps->getNumberOfPositivePictures() <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii)) - rps->getNumberOfNegativePictures()); 2795 assert((rps->getNumberOfPositivePictures() + rps->getNumberOfNegativePictures() + rps->getNumberOfLongtermPictures()) <= rpcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1(ii , rpcSlice->getLayerId() , rpcSlice->getVPS()->getMaxSLayersInLayerSetMinus1(ii))); 2796 } 2797 } 2798 2799 2800 } 2801 if(rpcSlice->getLayerId() == 0) 2802 { 2803 assert(rps->getNumberOfNegativePictures() <= rpcSlice->getSPS()->getMaxDecPicBuffering(rpcSlice->getSPS()->getMaxTLayers()-1) ); 2804 assert(rps->getNumberOfPositivePictures() <= rpcSlice->getSPS()->getMaxDecPicBuffering(rpcSlice->getSPS()->getMaxTLayers()-1) -rps->getNumberOfNegativePictures()); 2805 assert((rps->getNumberOfPositivePictures() + rps->getNumberOfNegativePictures() + rps->getNumberOfLongtermPictures()) <= rpcSlice->getSPS()->getMaxDecPicBuffering(rpcSlice->getSPS()->getMaxTLayers()-1)); 2806 } 2807 #endif 2647 2808 if ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 2648 2809 || rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 2673 2834 #if SVC_EXTENSION 2674 2835 rpcSlice->setActiveNumILRRefIdx(0); 2675 #if ILP_SSH_SIG2676 #if ILP_SSH_SIG_FIX2677 2836 if((rpcSlice->getLayerId() > 0) && !(rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (rpcSlice->getNumILRRefIdx() > 0) ) 2678 #else2679 if((rpcSlice->getLayerId() > 0) && rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (rpcSlice->getNumILRRefIdx() > 0) )2680 #endif2681 #else2682 if((rpcSlice->getLayerId() > 0) && (rpcSlice->getNumILRRefIdx() > 0) )2683 #endif2684 2837 { 2685 2838 READ_FLAG(uiCode,"inter_layer_pred_enabled_flag"); … … 2720 2873 #endif 2721 2874 } 2722 #if ILP_NUM_REF_CHK 2875 2723 2876 if( rpcSlice->getActiveNumILRRefIdx() == rpcSlice->getNumILRRefIdx() ) 2724 2877 { … … 2730 2883 else 2731 2884 { 2732 #endif 2733 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ )2734 {2735 READ_CODE( numBits,uiCode,"inter_layer_pred_layer_idc[i]");2736 rpcSlice->setInterLayerPredLayerIdc(uiCode,i);2885 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 2886 { 2887 READ_CODE( numBits,uiCode,"inter_layer_pred_layer_idc[i]" ); 2888 rpcSlice->setInterLayerPredLayerIdc(uiCode,i); 2889 } 2737 2890 } 2738 #if ILP_NUM_REF_CHK2739 }2740 #endif2741 2891 } 2742 2892 else … … 2760 2910 } 2761 2911 } 2762 #if ILP_SSH_SIG2763 #if ILP_SSH_SIG_FIX2764 2912 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true && (rpcSlice->getLayerId() > 0 )) 2765 #else2766 else if( rpcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == false )2767 #endif2768 2913 { 2769 2914 rpcSlice->setInterLayerPredEnabledFlag(true); … … 2799 2944 #endif 2800 2945 } 2801 #endif2802 #endif2803 2946 #if P0312_VERT_PHASE_ADJ 2804 2947 for(Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) … … 2811 2954 } 2812 2955 #endif 2956 #endif //SVC_EXTENSION 2813 2957 2814 2958 if(sps->getUseSAO()) … … 2992 3136 #if SVC_EXTENSION && REF_IDX_MFM 2993 3137 // set motion mapping flag 2994 rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() ) ? true : false );3138 rpcSlice->setMFMEnabledFlag( ( rpcSlice->getNumMotionPredRefLayers() > 0 && rpcSlice->getActiveNumILRRefIdx() && !rpcSlice->isIntra() ) ? true : false ); 2995 3139 #endif 2996 3140 if ( rpcSlice->getSliceType() == B_SLICE ) … … 3132 3276 3133 3277 #if POC_RESET_IDC_SIGNALLING 3134 Int sliceHe derExtensionLength = 0;3278 Int sliceHeaderExtensionLength = 0; 3135 3279 if(pps->getSliceHeaderExtensionPresentFlag()) 3136 3280 { 3137 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHe derExtensionLength = uiCode;3281 READ_UVLC( uiCode, "slice_header_extension_length"); sliceHeaderExtensionLength = uiCode; 3138 3282 } 3139 3283 else 3140 3284 { 3141 sliceHe derExtensionLength = 0;3285 sliceHeaderExtensionLength = 0; 3142 3286 } 3143 3287 UInt startBits = m_pcBitstream->getNumBitsRead(); // Start counter of # SH Extn bits 3144 if( sliceHe derExtensionLength > 0 )3288 if( sliceHeaderExtensionLength > 0 ) 3145 3289 { 3146 3290 if( rpcSlice->getPPS()->getPocResetInfoPresentFlag() ) … … 3152 3296 rpcSlice->setPocResetIdc( 0 ); 3153 3297 } 3298 #if Q0142_POC_LSB_NOT_PRESENT 3299 if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && iPOClsb > 0 ) 3300 { 3301 assert( rpcSlice->getPocResetIdc() != 2 ); 3302 } 3303 #endif 3154 3304 if( rpcSlice->getPocResetIdc() > 0 ) 3155 3305 { … … 3166 3316 READ_FLAG( uiCode, "full_poc_reset_flag"); rpcSlice->setFullPocResetFlag((uiCode == 1) ? true : false); 3167 3317 READ_CODE(rpcSlice->getSPS()->getBitsForPOC(), uiCode,"poc_lsb_val"); rpcSlice->setPocLsbVal(uiCode); 3318 #if Q0142_POC_LSB_NOT_PRESENT 3319 if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() ) 3320 { 3321 assert( rpcSlice->getPocLsbVal() == 0 ); 3322 } 3323 #endif 3168 3324 } 3169 3325 … … 3179 3335 else 3180 3336 { 3337 #if POC_MSB_VAL_PRESENT_FLAG_SEM 3338 if( sliceHeaderExtensionLength == 0 ) 3339 { 3340 rpcSlice->setPocMsbValPresentFlag( false ); 3341 } 3342 else if( rpcSlice->getPocMsbValRequiredFlag() ) 3343 #else 3181 3344 if( rpcSlice->getPocMsbValRequiredFlag() ) 3345 #endif 3182 3346 { 3183 3347 rpcSlice->setPocMsbValPresentFlag( true ); … … 3189 3353 } 3190 3354 3355 #if !POC_RESET_IDC_DECODER 3191 3356 Int maxPocLsb = 1 << rpcSlice->getSPS()->getBitsForPOC(); 3357 #endif 3192 3358 if( rpcSlice->getPocMsbValPresentFlag() ) 3193 3359 { 3194 3360 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 3361 3362 #if !POC_RESET_IDC_DECODER 3195 3363 // Update POC of the slice based on this MSB val 3196 3364 Int pocLsb = rpcSlice->getPOC() % maxPocLsb; … … 3200 3368 { 3201 3369 rpcSlice->setPocMsbVal( rpcSlice->getPOC() / maxPocLsb ); 3370 #endif 3202 3371 } 3203 3372 … … 3212 3381 while( counter ) 3213 3382 { 3383 #if Q0146_SSH_EXT_DATA_BIT 3384 READ_FLAG( uiCode, "slice_segment_header_extension_data_bit" ); 3385 #else 3214 3386 READ_FLAG( uiCode, "slice_segment_header_extension_reserved_bit" ); assert( uiCode == 1 ); 3387 #endif 3215 3388 counter--; 3216 3389 } -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r713 r815 75 75 Void parseQtRootCbf ( UInt uiAbsPartIdx, UInt& uiQtRootCbf ); 76 76 Void parseVPS ( TComVPS* pcVPS ); 77 #if SPS_EXTENSION 78 #if VPS_EXTNS 77 #if SVC_EXTENSION 79 78 Void parseVPSExtension ( TComVPS* pcVPS ); 80 79 Void defaultVPSExtension ( TComVPS* pcVPS ); 81 #endif 82 83 #if VPS_VUI 84 Void parseVPSVUI ( TComVPS* pcVPS ); 85 Void defaultVPSVUI ( TComVPS* pcVPS ); 86 #endif 80 Void parseVPSVUI ( TComVPS* pcVPS ); 81 Void defaultVPSVUI ( TComVPS* pcVPS ); 87 82 #if REPN_FORMAT_IN_VPS 88 83 Void parseRepFormat ( RepFormat *repFormat, RepFormat *repFormatPrev ); -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r713 r815 85 85 m_isNoOutputPriorPics = false; 86 86 #endif 87 #if Q0177_EOS_CHECKS 88 m_isLastNALWasEos = false; 89 #endif 87 90 #if NO_CLRAS_OUTPUT_FLAG 88 91 m_noClrasOutputFlag = false; … … 93 96 m_subDpbIdx = -1; 94 97 #endif 98 #if POC_RESET_IDC_DECODER 99 m_parseIdc = -1; 100 m_lastPocPeriodId = -1; 101 m_prevPicOrderCnt = 0; 102 #endif 95 103 #if Q0048_CGS_3D_ASYMLUT 96 104 m_pColorMappedPic = NULL; … … 104 112 TDecTop::~TDecTop() 105 113 { 114 #if Q0078_ADD_LAYER_SETS 115 for (Int psId = 0; psId < MAX_NUM_SPS; psId++) 116 { 117 TComSPS* sps = m_parameterSetManagerDecoder.getSPS(psId); 118 if (sps != NULL) 119 { 120 // Remove parameter set from other layers to prevent multiple deletes of the same object 121 for (Int lId = 0; lId < m_numLayer; lId++) 122 { 123 if (m_ppcTDecTop[lId] != this) 124 { 125 m_parameterSetManagerDecoder.removeSPS(psId); 126 } 127 } 128 } 129 } 130 for (Int psId = 0; psId < MAX_NUM_PPS; psId++) 131 { 132 TComPPS* pps = m_parameterSetManagerDecoder.getPPS(psId); 133 if (pps != NULL) 134 { 135 // Remove parameter set from other layers to prevent multiple deletes of the same object 136 for (Int lId = 0; lId < m_numLayer; lId++) 137 { 138 if (m_ppcTDecTop[lId] != this) 139 { 140 m_parameterSetManagerDecoder.removePPS(psId); 141 } 142 } 143 } 144 } 145 #endif 106 146 #if ENC_DEC_TRACE 107 147 fclose( g_hTrace ); … … 225 265 226 266 m_cIlpPic[j] = new TComPic; 267 227 268 #if AUXILIARY_PICTURES 228 269 #if REPN_FORMAT_IN_VPS 229 #if SVC_UPSAMPLING230 270 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 231 271 #else 232 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);233 #endif234 #else235 #if SVC_UPSAMPLING236 272 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 237 #else238 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), pcSPS->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);239 #endif240 273 #endif 241 274 #else 242 275 #if REPN_FORMAT_IN_VPS 243 #if SVC_UPSAMPLING244 276 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 245 277 #else 246 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);247 #endif248 #else249 #if SVC_UPSAMPLING250 278 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 251 #else252 m_cIlpPic[j]->create(pcSPS->getPicWidthInLumaSamples(), pcSPS->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);253 #endif254 279 #endif 255 280 #endif … … 393 418 394 419 //only for scalable extension 395 #if SCALABILITY_MASK_E0104 396 assert( pcSlice->getVPS()->getScalabilityMask(2) == true ); 397 #else 398 assert( pcSlice->getVPS()->getScalabilityMask(1) == true ); 399 #endif 400 } 401 } 402 } 403 #endif 404 420 assert( pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true ); 421 } 422 } 423 } 424 405 425 #if AUXILIARY_PICTURES 406 426 #if REPN_FORMAT_IN_VPS 407 #if SVC_UPSAMPLING408 427 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 409 428 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 410 429 #else 411 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,412 conformanceWindow, defaultDisplayWindow, numReorderPics, true);413 #endif414 #else415 #if SVC_UPSAMPLING416 430 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 417 431 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 418 #else419 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,420 conformanceWindow, defaultDisplayWindow, numReorderPics, true);421 #endif422 432 #endif 423 433 #else 424 434 #if REPN_FORMAT_IN_VPS 425 #if SVC_UPSAMPLING426 435 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 427 436 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 428 437 #else 429 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,430 conformanceWindow, defaultDisplayWindow, numReorderPics, true);431 #endif432 #else433 #if SVC_UPSAMPLING434 438 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 435 439 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 436 #else 440 #endif 441 #endif 442 443 #else //SVC_EXTENSION 437 444 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 438 445 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 439 #endif 440 #endif 441 #endif 446 #endif //SVC_EXTENSION 447 442 448 m_cListPic.pushBack( rpcPic ); 443 449 … … 478 484 rpcPic->destroy(); 479 485 486 #if SVC_EXTENSION 480 487 #if AUXILIARY_PICTURES 481 488 #if REPN_FORMAT_IN_VPS 482 #if SVC_UPSAMPLING483 489 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 484 490 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 485 486 #else 487 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 488 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 489 #endif 490 #else 491 #if SVC_UPSAMPLING 491 #else 492 492 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 493 493 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 494 495 #else496 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,497 conformanceWindow, defaultDisplayWindow, numReorderPics, true);498 #endif499 494 #endif 500 495 #else 501 496 #if REPN_FORMAT_IN_VPS 502 #if SVC_UPSAMPLING503 497 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 504 498 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 505 499 506 500 #else 507 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,508 conformanceWindow, defaultDisplayWindow, numReorderPics, true);509 #endif510 #else511 #if SVC_UPSAMPLING512 501 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 513 502 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 514 515 #else 503 #endif 504 #endif 505 #else //SVC_EXTENSION 516 506 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 517 507 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 518 #endif 519 #endif 520 #endif 508 #endif //SVC_EXTENSION 521 509 } 522 510 … … 793 781 794 782 #if AUXILIARY_PICTURES 795 #if SVC_UPSAMPLING796 783 #if AVC_SYNTAX 797 784 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); … … 800 787 #endif 801 788 #else 802 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, true);803 #endif804 #else805 #if SVC_UPSAMPLING806 789 #if AVC_SYNTAX 807 790 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, activeSPS, true); 808 791 #else 809 792 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), conformanceWindow, defaultDisplayWindow, numReorderPics, NULL, true); 810 #endif811 #else812 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), onformanceWindow, defaultDisplayWindow, numReorderPics, true);813 793 #endif 814 794 #endif … … 846 826 847 827 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 828 #if Q0177_SPS_TEMP_NESTING_FIX 829 sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? activeVPS->getTemporalNestingFlag() : true ); 830 #else 848 831 sps->setTemporalIdNestingFlag( activeVPS->getTemporalNestingFlag() ); 832 #endif 849 833 850 834 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, … … 854 838 // to avoid compiler warning "array subscript is above array bounds" 855 839 assert( i < MAX_TLAYER ); 856 840 #if LAYER_DECPICBUFF_PARAM && RESOLUTION_BASED_DPB 841 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsLayerDecPicBuffMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 842 #else 857 843 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), sps->getLayerId(), i) + 1, i); 844 #endif 858 845 } 859 846 } … … 1122 1109 } 1123 1110 #endif 1111 #if POC_RESET_IDC_DECODER 1112 if( m_parseIdc != -1 ) // Second pass for a POC resetting picture 1113 { 1114 m_parseIdc++; // Proceed to POC decoding and RPS derivation 1115 } 1116 1117 if( m_parseIdc == 2 ) 1118 { 1119 bNewPOC = false; 1120 } 1121 1122 if( (bNewPOC || m_layerId!=m_uiPrevLayerId) && (m_parseIdc == -1) ) // Will be true at the first pass 1123 { 1124 //if (bNewPOC || m_layerId!=m_uiPrevLayerId) 1125 // Check if new reset period has started - this is needed just so that the SHM decoder which calls slice header decoding twice 1126 // does not invoke the output twice 1127 //if( m_lastPocPeriodId[m_apcSlicePilot->getLayerId()] == m_apcSlicePilot->getPocResetPeriodId() ) 1128 // Update CurrAU marking 1129 if(( m_layerId < m_uiPrevLayerId) ||( ( m_layerId == m_uiPrevLayerId) && bNewPOC)) // Decoding a lower layer than or same layer as previous - mark all earlier pictures as not in current AU 1130 { 1131 markAllPicsAsNoCurrAu(); 1132 } 1133 1134 if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 ) 1135 { 1136 Int pocResetPeriodId = m_apcSlicePilot->getPocResetPeriodId(); 1137 if ( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 || 1138 ( m_apcSlicePilot->getPocResetIdc() == 3 && pocResetPeriodId != getLastPocPeriodId() ) ) 1139 { 1140 setLastPocPeriodId(pocResetPeriodId); 1141 m_parseIdc = 0; 1142 } 1143 } 1144 else 1145 { 1146 m_parseIdc = 3; // Proceed to decoding POC and RPS 1147 } 1148 } 1149 #endif 1124 1150 1125 1151 #if ALIGNED_BUMPING 1152 #if POC_RESET_IDC_DECODER 1153 //if( (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) ) 1154 if( m_parseIdc == 1 ) 1155 { 1156 // Invoke output of pictures if the current picture is a POC reset picture 1157 bNewPOC = true; 1158 /* Include reset of all POCs in the layer */ 1159 1160 // This operation would do the following: 1161 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 1162 // 2. Update the value of m_pocCRA. 1163 // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later 1164 // 4. update value of POCLastDisplay 1165 1166 //Do the reset stuff here 1167 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1168 Int pocLsbVal; 1169 if( m_apcSlicePilot->getPocResetIdc() == 3 ) 1170 { 1171 pocLsbVal = m_apcSlicePilot->getPocLsbVal() ; 1172 } 1173 else 1174 { 1175 pocLsbVal = (m_apcSlicePilot->getPOC() % maxPocLsb); 1176 } 1177 1178 Int pocMsbDelta = 0; 1179 if ( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1180 { 1181 pocMsbDelta = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; 1182 } 1183 else 1184 { 1185 //This MSB derivation can be made into one function. Item to do next. 1186 Int prevPoc = this->getPrevPicOrderCnt(); 1187 Int prevPocLsb = prevPoc & (maxPocLsb - 1); 1188 Int prevPocMsb = prevPoc - prevPocLsb; 1189 1190 pocMsbDelta = m_apcSlicePilot->getCurrMsb( pocLsbVal, prevPocLsb, prevPocMsb, maxPocLsb ); 1191 } 1192 1193 Int pocLsbDelta; 1194 if( m_apcSlicePilot->getPocResetIdc() == 2 || ( m_apcSlicePilot->getPocResetIdc() == 3 && m_apcSlicePilot->getFullPocResetFlag() )) 1195 { 1196 pocLsbDelta = pocLsbVal; 1197 } 1198 else 1199 { 1200 pocLsbDelta = 0; 1201 } 1202 1203 Int deltaPocVal = pocMsbDelta + pocLsbDelta; 1204 1205 //Reset all POC for DPB -> basically do it for each slice in the picutre 1206 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1207 1208 // Iterate through all picture in DPB 1209 while( iterPic != m_cListPic.end() ) 1210 { 1211 TComPic *dpbPic = *iterPic; 1212 // Check if the picture pointed to by iterPic is either used for reference or 1213 // needed for output, are in the same layer, and not the current picture. 1214 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1215 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 1216 && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() )) 1217 { 1218 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 1219 { 1220 1221 TComSlice *slice = dpbPic->getSlice(i); 1222 TComReferencePictureSet *rps = slice->getRPS(); 1223 slice->setPOC( slice->getPOC() - deltaPocVal ); 1224 1225 // Also adjust the POC value stored in the RPS of each such slice 1226 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 1227 { 1228 rps->setPOC( j, rps->getPOC(j) - deltaPocVal ); 1229 } 1230 // Also adjust the value of refPOC 1231 for(Int k = 0; k < 2; k++) // For List 0 and List 1 1232 { 1233 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1234 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 1235 { 1236 slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j); 1237 } 1238 } 1239 } 1240 } 1241 iterPic++; 1242 } 1243 // Update the value of pocCRA 1244 m_pocCRA -= deltaPocVal; 1245 1246 // Update value of POCLastDisplay 1247 iPOCLastDisplay -= deltaPocVal; 1248 } 1249 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1250 Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb(); 1251 1252 if( m_parseIdc == 1 || m_parseIdc == 2 ) // TODO This should be replaced by pocResettingFlag. 1253 { 1254 // Set poc for current slice 1255 if( m_apcSlicePilot->getPocResetIdc() == 1 ) 1256 { 1257 m_apcSlicePilot->setPOC( slicePicOrderCntLsb ); 1258 } 1259 else if( m_apcSlicePilot->getPocResetIdc() == 2 ) 1260 { 1261 m_apcSlicePilot->setPOC( 0 ); 1262 } 1263 else 1264 { 1265 Int picOrderCntMsb = m_apcSlicePilot->getCurrMsb( slicePicOrderCntLsb, m_apcSlicePilot->getFullPocResetFlag() ? 0 : m_apcSlicePilot->getPocLsbVal(), 0 , maxPocLsb ); 1266 m_apcSlicePilot->setPOC( picOrderCntMsb + slicePicOrderCntLsb ); 1267 } 1268 } 1269 else if (m_parseIdc == 3) 1270 { 1271 Int picOrderCntMsb = 0; 1272 if( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1273 { 1274 picOrderCntMsb = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; 1275 } 1276 else if( m_apcSlicePilot->getIdrPicFlag() ) 1277 { 1278 picOrderCntMsb = 0; 1279 } 1280 else 1281 { 1282 Int prevPicOrderCntLsb = this->getPrevPicOrderCnt() & ( maxPocLsb - 1); 1283 Int prevPicOrderCntMsb = this->getPrevPicOrderCnt() - prevPicOrderCntLsb; 1284 picOrderCntMsb = m_apcSlicePilot->getCurrMsb(slicePicOrderCntLsb, prevPicOrderCntLsb, prevPicOrderCntMsb, maxPocLsb ); 1285 } 1286 m_apcSlicePilot->setPOC( picOrderCntMsb + slicePicOrderCntLsb ); 1287 } 1288 1289 if( m_parseIdc == 1 || m_parseIdc == 3) 1290 { 1291 // Adjust prevPicOrderCnt 1292 if( !m_apcSlicePilot->getRaslPicFlag() 1293 && !m_apcSlicePilot->getRadlPicFlag() 1294 && (m_apcSlicePilot->getNalUnitType() % 2 == 1) 1295 && ( nalu.m_temporalId == 0 ) 1296 && !m_apcSlicePilot->getDiscardableFlag() ) 1297 { 1298 this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() ); 1299 } 1300 else if ( m_apcSlicePilot->getPocResetIdc() == 3 ) 1301 { 1302 this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1303 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1304 } 1305 #else 1126 1306 if (bNewPOC || m_layerId!=m_uiPrevLayerId) 1127 1307 { 1308 #endif 1128 1309 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1129 1310 } 1130 1311 #endif 1312 #if POC_RESET_IDC_DECODER 1313 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId || m_parseIdc == 1) && !m_bFirstSliceInSequence ) 1314 #else 1131 1315 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 1316 #endif 1132 1317 { 1133 1318 m_prevPOC = m_apcSlicePilot->getPOC(); … … 1136 1321 return true; 1137 1322 } 1138 #else 1139 //we should only get a different poc for a new picture (with CTU address==0) 1140 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1141 { 1142 printf ("Warning, the first slice of a picture might have been lost!\n"); 1143 } 1144 // exit when a new picture is found 1145 if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence ) 1146 { 1147 if (m_prevPOC >= m_pocRandomAccess) 1148 { 1149 m_prevPOC = m_apcSlicePilot->getPOC(); 1150 return true; 1151 } 1152 m_prevPOC = m_apcSlicePilot->getPOC(); 1153 } 1154 #endif 1323 1324 #if POC_RESET_IDC_DECODER 1325 m_parseIdc = -1; 1326 #endif 1327 1155 1328 // actual decoding starts here 1156 xActivateParameterSets(); 1157 #if !O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS && N0147_IRAP_ALIGN_FLAG 1158 //Note setting O0223_O0139_IRAP_ALIGN_NO_CONTRAINTS to 0 may cause decoder to crash. 1159 //When cross_layer_irap_aligned_flag is equal to 0, num_extra_slice_header_bits >=1 1160 if(!m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 1161 { 1162 assert( m_apcSlicePilot->getPPS()->getNumExtraSliceHeaderBits() > 0); 1163 } 1164 //When cross_layer_irap_aligned_flag is equal to 1, the value of poc_reset_flag shall be equal to 0 1165 if( m_apcSlicePilot->getVPS()->getCrossLayerIrapAlignFlag() ) 1166 { 1167 assert( m_apcSlicePilot->getPocResetFlag() == 0); 1168 } 1169 #endif 1329 xActivateParameterSets(); 1330 1170 1331 #if REPN_FORMAT_IN_VPS 1171 1332 // Initialize ILRP if needed, only for the current layer … … 1177 1338 { 1178 1339 m_prevPOC = m_apcSlicePilot->getPOC(); 1179 #if SVC_EXTENSION1180 1340 curLayerId = m_layerId; 1181 1341 m_uiPrevLayerId = m_layerId; 1182 #endif1183 1342 } 1184 1343 m_bFirstSliceInSequence = false; … … 1249 1408 } 1250 1409 #endif 1251 #if ALIGN_TSA_STSA_PICS 1410 // Alignment of TSA and STSA pictures across AU 1411 #if !Q0108_TSA_STSA 1252 1412 if( m_apcSlicePilot->getLayerId() > 0 ) 1253 1413 { … … 1287 1447 } 1288 1448 #endif 1449 1450 #else //SVC_EXTENSION 1451 //we should only get a different poc for a new picture (with CTU address==0) 1452 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 1453 { 1454 printf ("Warning, the first slice of a picture might have been lost!\n"); 1455 } 1456 // exit when a new picture is found 1457 if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence ) 1458 { 1459 if (m_prevPOC >= m_pocRandomAccess) 1460 { 1461 m_prevPOC = m_apcSlicePilot->getPOC(); 1462 return true; 1463 } 1464 m_prevPOC = m_apcSlicePilot->getPOC(); 1465 } 1466 1467 // actual decoding starts here 1468 xActivateParameterSets(); 1469 1470 if (m_apcSlicePilot->isNextSlice()) 1471 { 1472 m_prevPOC = m_apcSlicePilot->getPOC(); 1473 } 1474 m_bFirstSliceInSequence = false; 1475 #endif //SVC_EXTENSION 1289 1476 //detect lost reference picture and insert copy of earlier frame. 1290 1477 Int lostPoc; … … 1301 1488 pBLPic->getSlice(0)->setReferenced(true); 1302 1489 fstream* pFile = m_ppcTDecTop[0]->getBLReconFile(); 1303 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth();1304 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight();1305 1490 1306 1491 if( pFile->good() ) 1307 1492 { 1493 Bool is16bit = g_bitDepthYLayer[0] > 8 || g_bitDepthCLayer[0] > 8; 1494 UInt uiWidth = pBLPic->getPicYuvRec()->getWidth(); 1495 UInt uiHeight = pBLPic->getPicYuvRec()->getHeight(); 1496 1497 Int len = uiWidth * (is16bit ? 2 : 1); 1498 UChar *buf = new UChar[len]; 1499 1308 1500 UInt64 uiPos = (UInt64) m_apcSlicePilot->getPOC() * uiWidth * uiHeight * 3 / 2; 1501 if( is16bit ) 1502 { 1503 uiPos <<= 1; 1504 } 1309 1505 1310 1506 pFile->seekg((UInt)uiPos, ios::beg ); 1311 1507 1508 // read Y component 1312 1509 Pel* pPel = pBLPic->getPicYuvRec()->getLumaAddr(); 1313 1510 UInt uiStride = pBLPic->getPicYuvRec()->getStride(); 1314 1511 for( Int i = 0; i < uiHeight; i++ ) 1315 1512 { 1316 for( Int j = 0; j < uiWidth; j++ ) 1513 pFile->read(reinterpret_cast<Char*>(buf), len); 1514 1515 if( !is16bit ) 1317 1516 { 1318 pPel[j] = pFile->get(); 1517 for (Int x = 0; x < uiWidth; x++) 1518 { 1519 pPel[x] = buf[x]; 1520 } 1319 1521 } 1522 else 1523 { 1524 for (Int x = 0; x < uiWidth; x++) 1525 { 1526 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1527 } 1528 } 1529 1320 1530 pPel += uiStride; 1321 1531 } 1322 1532 1533 len >>= 1; 1534 uiWidth >>= 1; 1535 uiHeight >>= 1; 1536 1537 // read Cb component 1323 1538 pPel = pBLPic->getPicYuvRec()->getCbAddr(); 1324 1539 uiStride = pBLPic->getPicYuvRec()->getCStride(); 1325 for( Int i = 0; i < uiHeight/2; i++ ) 1326 { 1327 for( Int j = 0; j < uiWidth/2; j++ ) 1540 for( Int i = 0; i < uiHeight; i++ ) 1541 { 1542 pFile->read(reinterpret_cast<Char*>(buf), len); 1543 1544 if( !is16bit ) 1328 1545 { 1329 pPel[j] = pFile->get(); 1546 for( Int x = 0; x < uiWidth; x++ ) 1547 { 1548 pPel[x] = buf[x]; 1549 } 1330 1550 } 1551 else 1552 { 1553 for( Int x = 0; x < uiWidth; x++ ) 1554 { 1555 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1556 } 1557 } 1558 1331 1559 pPel += uiStride; 1332 1560 } 1333 1561 1562 // read Cr component 1334 1563 pPel = pBLPic->getPicYuvRec()->getCrAddr(); 1335 1564 uiStride = pBLPic->getPicYuvRec()->getCStride(); 1336 for( Int i = 0; i < uiHeight/2; i++ ) 1337 { 1338 for( Int j = 0; j < uiWidth/2; j++ ) 1565 for( Int i = 0; i < uiHeight; i++ ) 1566 { 1567 pFile->read(reinterpret_cast<Char*>(buf), len); 1568 1569 if( !is16bit ) 1339 1570 { 1340 pPel[j] = pFile->get(); 1571 for( Int x = 0; x < uiWidth; x++ ) 1572 { 1573 pPel[x] = buf[x]; 1574 } 1341 1575 } 1576 else 1577 { 1578 for( Int x = 0; x < uiWidth; x++ ) 1579 { 1580 pPel[x] = (buf[2*x+1] << 8) | buf[2*x]; 1581 } 1582 } 1583 1342 1584 pPel += uiStride; 1343 1585 } 1586 1587 delete[] buf; 1344 1588 } 1345 1589 } … … 1365 1609 // Get a new picture buffer 1366 1610 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 1611 1612 #if POC_RESET_IDC_DECODER 1613 pcPic->setCurrAuFlag( true ); 1614 #endif 1367 1615 1368 1616 Bool isField = false; … … 1543 1791 { 1544 1792 UInt refLayerIdc = i; 1793 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1545 1794 #if AVC_BASE 1546 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc )== 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() )1795 if( refLayerId == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() ) 1547 1796 { 1548 1797 TComPic* pic = *m_ppcTDecTop[0]->getListPic()->begin(); … … 1593 1842 1594 1843 #if O0098_SCALED_REF_LAYER_ID 1595 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));1844 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 1596 1845 #else 1597 1846 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); … … 1627 1876 } 1628 1877 #endif 1629 #if SVC_ UPSAMPLING1878 #if SVC_EXTENSION 1630 1879 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1631 { 1880 { 1881 // check for the sample prediction picture type 1882 if( m_ppcTDecTop[m_layerId]->getSamplePredEnabledFlag(refLayerId) ) 1883 { 1632 1884 #if O0215_PHASE_ALIGNMENT 1633 1885 #if O0194_JOINT_US_BITSHIFT 1634 1886 #if Q0048_CGS_3D_ASYMLUT 1635 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1636 #else 1637 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1887 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1888 #else 1889 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1638 1890 #endif 1639 1891 #else 1640 1892 #if Q0048_CGS_3D_ASYMLUT 1641 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );1642 #else 1643 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1893 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() ); 1894 #else 1895 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1644 1896 #endif 1645 1897 #endif … … 1647 1899 #if O0194_JOINT_US_BITSHIFT 1648 1900 #if Q0048_CGS_3D_ASYMLUT 1649 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );1650 #else 1651 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );1901 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1902 #else 1903 m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1652 1904 #endif 1653 1905 #else 1654 1906 #if Q0048_CGS_3D_ASYMLUT 1655 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1656 #else 1657 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1658 #endif 1659 #endif 1660 #endif 1907 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1908 #else 1909 m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1910 #endif 1911 #endif 1912 #endif 1913 } 1661 1914 } 1662 1915 else … … 1665 1918 } 1666 1919 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1667 #endif 1920 #endif //SVC_EXTENSION 1668 1921 } 1669 1922 } … … 1732 1985 if( pcSlice->getMFMEnabledFlag() ) 1733 1986 { 1734 Int refLayerId = pcSlice->getRefPic( pcSlice->getSliceType() == B_SLICE ? ( RefPicList )( 1 - pcSlice->getColFromL0Flag() ) : REF_PIC_LIST_0 , pcSlice->getColRefIdx() )->getLayerId(); 1987 TComPic* refPic = pcSlice->getRefPic( pcSlice->getSliceType() == B_SLICE ? ( RefPicList )( 1 - pcSlice->getColFromL0Flag() ) : REF_PIC_LIST_0 , pcSlice->getColRefIdx() ); 1988 1989 assert( refPic ); 1990 1991 Int refLayerId = refPic->getLayerId(); 1992 1735 1993 if( refLayerId != pcSlice->getLayerId() ) 1736 1994 { … … 1742 2000 #endif 1743 2001 1744 #if N0147_IRAP_ALIGN_FLAG1745 2002 if( m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag() ) 1746 2003 { … … 1758 2015 } 1759 2016 } 1760 #endif 2017 2018 if( m_layerId > 0 && !pcSlice->isIntra() && pcSlice->getEnableTMVPFlag() ) 2019 { 2020 TComPic* refPic = pcSlice->getRefPic(RefPicList(1 - pcSlice->getColFromL0Flag()), pcSlice->getColRefIdx()); 2021 2022 assert( refPic ); 2023 2024 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 2025 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 2026 if( refPic->isILR(pcSlice->getLayerId()) ) 2027 { 2028 assert( m_ppcTDecTop[m_layerId]->getMotionPredEnabledFlag(refPic->getLayerId()) ); 2029 } 2030 } 1761 2031 #endif //SVC_EXTENSION 1762 2032 … … 1856 2126 #endif 1857 2127 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 2128 #if Q0078_ADD_LAYER_SETS 2129 // Store SPS for all layers 2130 for (Int lId = 0; lId < m_numLayer; lId++) 2131 { 2132 if (m_ppcTDecTop[lId] != this) 2133 { 2134 m_ppcTDecTop[lId]->getParameterSetManager()->storePrefetchedSPS(sps); 2135 } 2136 } 2137 #endif 1858 2138 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1859 2139 if(m_numLayer>0) … … 1886 2166 ); 1887 2167 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 2168 #if Q0078_ADD_LAYER_SETS 2169 // Store PPS for all layers 2170 for (Int lId = 0; lId < m_numLayer; lId++) 2171 { 2172 if (m_ppcTDecTop[lId] != this) 2173 { 2174 m_ppcTDecTop[lId]->getParameterSetManager()->storePrefetchedPPS(pps); 2175 } 2176 } 2177 #endif 1888 2178 1889 2179 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 1906 2196 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 1907 2197 { 1908 #if RANDOM_ACCESS_SEI_FIX1909 2198 if (m_prevSliceSkipped) // No need to decode SEI messages of a skipped access unit 1910 2199 { 1911 2200 return; 1912 2201 } 1913 #endif1914 2202 #if LAYERS_NOT_PRESENT_SEI 1915 2203 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); … … 1991 2279 { 1992 2280 case NAL_UNIT_VPS: 1993 #if VPS_NUH_LAYER_ID2281 #if SVC_EXTENSION 1994 2282 assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1995 2283 #endif 1996 2284 xDecodeVPS(); 2285 #if Q0177_EOS_CHECKS 2286 m_isLastNALWasEos = false; 2287 #endif 1997 2288 #if AVC_BASE 1998 2289 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) … … 2033 2324 case NAL_UNIT_PREFIX_SEI: 2034 2325 case NAL_UNIT_SUFFIX_SEI: 2326 #if Q0177_EOS_CHECKS 2327 if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI ) 2328 { 2329 assert( m_isLastNALWasEos == false ); 2330 } 2331 #endif 2035 2332 xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType ); 2036 2333 return false; … … 2052 2349 case NAL_UNIT_CODED_SLICE_RASL_N: 2053 2350 case NAL_UNIT_CODED_SLICE_RASL_R: 2351 #if Q0177_EOS_CHECKS 2352 if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N || 2353 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N || 2354 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N || 2355 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 2356 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ) 2357 { 2358 assert( m_isLastNALWasEos == false ); 2359 } 2360 else 2361 { 2362 m_isLastNALWasEos = false; 2363 } 2364 #endif 2054 2365 #if SVC_EXTENSION 2055 2366 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, curLayerId, bNewPOC); … … 2060 2371 2061 2372 case NAL_UNIT_EOS: 2373 #if Q0177_EOS_CHECKS 2374 assert( m_isLastNALWasEos == false ); 2375 //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything. 2376 if (nalu.m_layerId > 0) 2377 { 2378 printf( "\nThis bitstream has EOS with non-zero layer id.\n" ); 2379 return false; 2380 } 2381 m_isLastNALWasEos = true; 2382 #endif 2062 2383 m_associatedIRAPType = NAL_UNIT_INVALID; 2063 2384 m_pocCRA = 0; … … 2085 2406 2086 2407 case NAL_UNIT_FILLER_DATA: 2408 #if Q0177_EOS_CHECKS 2409 assert( m_isLastNALWasEos == false ); 2410 #endif 2087 2411 return false; 2088 2412 … … 2256 2580 } 2257 2581 } 2258 for ( Int i = 1, mIdx = 0, sIdx = 0; i < m_numLayer; i++ ) 2259 { 2582 for( Int i = 1; i < m_numLayer; i++ ) 2583 { 2584 Int mIdx = 0, sIdx = 0; 2260 2585 Int iNuhLId = vps->getLayerIdInNuh(i); 2261 2586 TDecTop *decTop = (TDecTop *)getLayerDec(iNuhLId); … … 2392 2717 } 2393 2718 #endif 2394 2719 #if POC_RESET_IDC_DECODER 2720 Void TDecTop::markAllPicsAsNoCurrAu() 2721 { 2722 for(Int i = 0; i < MAX_LAYERS; i++) 2723 { 2724 TComList<TComPic*>* listPic = this->getLayerDec(i)->getListPic(); 2725 TComList<TComPic*>::iterator iterPic = listPic->begin(); 2726 while ( iterPic != listPic->end() ) 2727 { 2728 TComPic *pcPic = *(iterPic); 2729 pcPic->setCurrAuFlag( false ); 2730 iterPic++; 2731 } 2732 } 2733 } 2734 #endif 2395 2735 #if Q0048_CGS_3D_ASYMLUT 2396 2736 Void TDecTop::initAsymLut(TComSlice *pcSlice) -
trunk/source/Lib/TLibDecoder/TDecTop.h
r713 r815 162 162 Bool m_craNoRaslOutputFlag; //value of variable NoRaslOutputFlag of the last CRA pic 163 163 #endif 164 #if Q0177_EOS_CHECKS 165 Bool m_isLastNALWasEos; 166 #endif 164 167 165 168 #if SVC_EXTENSION … … 201 204 Bool m_firstPicInLayerDecodedFlag; 202 205 #endif 206 #if POC_RESET_IDC_DECODER 207 Int m_parseIdc; 208 Int m_lastPocPeriodId; 209 Int m_prevPicOrderCnt; 210 #endif 203 211 #if RESOLUTION_BASED_DPB 204 212 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to. … … 241 249 #if EARLY_REF_PIC_MARKING 242 250 Void earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdList); 251 #endif 252 #if POC_RESET_IDC_DECODER 253 Int getParseIdc() { return m_parseIdc;} 254 Void setParseIdc(Int x) { m_parseIdc = x;} 255 Void markAllPicsAsNoCurrAu(); 256 257 Int getLastPocPeriodId() { return m_lastPocPeriodId; } 258 Void setLastPocPeriodId(Int x) { m_lastPocPeriodId = x; } 259 260 Int getPrevPicOrderCnt() { return m_prevPicOrderCnt; } 261 Void setPrevPicOrderCnt(Int const x) { m_prevPicOrderCnt = x; } 243 262 #endif 244 263 UInt getLayerId () { return m_layerId; } -
trunk/source/Lib/TLibEncoder/SEIwrite.cpp
r713 r815 87 87 fprintf( g_hTrace, "=========== Tone Mapping Info SEI message ===========\n"); 88 88 break; 89 #if P0050_KNEE_FUNCTION_SEI 90 case SEI::KNEE_FUNCTION_INFO: 91 fprintf( g_hTrace, "=========== Knee Function Information SEI message ===========\n"); 92 break; 93 #endif 89 94 #if Q0074_SEI_COLOR_MAPPING 90 95 case SEI::COLOR_MAPPING_INFO: … … 123 128 case SEI::BSP_HRD: 124 129 fprintf( g_hTrace, "=========== Bitstream parition HRD parameters SEI message ===========\n"); 130 break; 131 #endif 132 #if Q0078_ADD_LAYER_SETS 133 case SEI::OUTPUT_LAYER_SET_NESTING: 134 fprintf(g_hTrace, "=========== Output layer set nesting SEI message ===========\n"); 135 break; 136 case SEI::VPS_REWRITING: 137 fprintf(g_hTrace, "=========== VPS rewriting SEI message ===========\n"); 125 138 break; 126 139 #endif … … 177 190 xWriteSEIToneMappingInfo(*static_cast<const SEIToneMappingInfo*>(&sei)); 178 191 break; 192 #if P0050_KNEE_FUNCTION_SEI 193 case SEI::KNEE_FUNCTION_INFO: 194 xWriteSEIKneeFunctionInfo(*static_cast<const SEIKneeFunctionInfo*>(&sei)); 195 break; 196 #endif 179 197 #if Q0074_SEI_COLOR_MAPPING 180 198 case SEI::COLOR_MAPPING_INFO: … … 217 235 case SEI::BSP_HRD: 218 236 xWriteSEIBspHrd(*static_cast<const SEIBspHrd*>(&sei), sps, nestingSei); 237 break; 238 #endif 239 #if Q0078_ADD_LAYER_SETS 240 case SEI::OUTPUT_LAYER_SET_NESTING: 241 xWriteSEIOutputLayerSetNesting(bs, *static_cast<const SEIOutputLayerSetNesting*>(&sei), vps, sps); 242 break; 243 case SEI::VPS_REWRITING: 244 xWriteSEIVPSRewriting(*static_cast<const SEIVPSRewriting*>(&sei)); 245 break; 246 #endif 247 #if Q0189_TMVP_CONSTRAINTS 248 case SEI::TMVP_CONSTRAINTS: 249 xWriteSEITMVPConstraints(*static_cast<const SEITMVPConstrains*>(&sei)); 250 break; 251 #endif 252 #if Q0247_FRAME_FIELD_INFO 253 case SEI::FRAME_FIELD_INFO: 254 xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei)); 219 255 break; 220 256 #endif … … 575 611 xWriteByteAlign(); 576 612 } 577 613 #if P0050_KNEE_FUNCTION_SEI 614 Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei) 615 { 616 WRITE_UVLC( sei.m_kneeId, "knee_function_id" ); 617 WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 618 if ( !sei.m_kneeCancelFlag ) 619 { 620 WRITE_FLAG( sei.m_kneePersistenceFlag, "knee_function_persistence_flag" ); 621 WRITE_FLAG( sei.m_kneeMappingFlag, "mapping_flag" ); 622 WRITE_CODE( (UInt)sei.m_kneeInputDrange , 32, "input_d_range" ); 623 WRITE_CODE( (UInt)sei.m_kneeInputDispLuminance, 32, "input_disp_luminance" ); 624 WRITE_CODE( (UInt)sei.m_kneeOutputDrange, 32, "output_d_range" ); 625 WRITE_CODE( (UInt)sei.m_kneeOutputDispLuminance, 32, "output_disp_luminance" ); 626 WRITE_UVLC( sei.m_kneeNumKneePointsMinus1, "num_knee_points_minus1" ); 627 for(Int i = 0; i <= sei.m_kneeNumKneePointsMinus1; i++ ) 628 { 629 WRITE_CODE( (UInt)sei.m_kneeInputKneePoint[i], 10,"input_knee_point" ); 630 WRITE_CODE( (UInt)sei.m_kneeOutputKneePoint[i], 10, "output_knee_point" ); 631 } 632 } 633 xWriteByteAlign(); 634 } 635 #endif 578 636 #if Q0074_SEI_COLOR_MAPPING 579 637 Void SEIWriter::xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei) … … 815 873 #endif 816 874 875 #if Q0189_TMVP_CONSTRAINTS 876 Void SEIWriter::xWriteSEITMVPConstraints (const SEITMVPConstrains &sei) 877 { 878 WRITE_UVLC( sei.prev_pics_not_used_flag , "prev_pics_not_used_flag" ); 879 WRITE_UVLC( sei.no_intra_layer_col_pic_flag , "no_intra_layer_col_pic_flag" ); 880 xWriteByteAlign(); 881 } 882 #endif 883 884 #if Q0247_FRAME_FIELD_INFO 885 Void SEIWriter::xWriteSEIFrameFieldInfo (const SEIFrameFieldInfo &sei) 886 { 887 WRITE_CODE( sei.m_ffinfo_picStruct , 4, "ffinfo_pic_struct" ); 888 WRITE_CODE( sei.m_ffinfo_sourceScanType, 2, "ffinfo_source_scan_type" ); 889 WRITE_FLAG( sei.m_ffinfo_duplicateFlag ? 1 : 0, "ffinfo_duplicate_flag" ); 890 xWriteByteAlign(); 891 } 892 #endif 893 817 894 #if O0164_MULTI_LAYER_HRD 818 895 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei) … … 893 970 for (UInt i = 0; i <= sei.m_seiNumBitstreamPartitionsMinus1[lsIdx]; i++) 894 971 { 972 #if HRD_BPB 973 UInt nl=0; 895 974 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 896 975 { 897 976 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 898 977 { 978 nl++; 979 } 980 } 981 for (UInt j = 0; j < nl; j++) 982 { 983 #else 984 for (UInt j = 0; j < sei.m_vpsMaxLayers; j++) 985 { 986 if (sei.m_layerIdIncludedFlag[lsIdx][j]) 987 { 988 #endif 899 989 WRITE_FLAG( sei.m_seiLayerInBspFlag[lsIdx][i][j], "sei_layer_in_bsp_flag[lsIdx][i][j]" ); 900 990 } 901 } 991 #if !HRD_BPB 992 } 993 #endif 902 994 } 903 995 WRITE_UVLC( sei.m_seiNumBspSchedCombinationsMinus1[lsIdx], "sei_num_bsp_sched_combinations_minus1[i]"); … … 988 1080 #endif 989 1081 1082 #if Q0078_ADD_LAYER_SETS 1083 1084 Void SEIWriter::xWriteSEIOutputLayerSetNesting(TComBitIf& bs, const SEIOutputLayerSetNesting &sei, TComVPS *vps, TComSPS *sps) 1085 { 1086 WRITE_FLAG(sei.m_olsFlag, "ols_flag"); 1087 WRITE_UVLC(sei.m_numOlsIndicesMinus1, "num_ols_indices_minus1"); 1088 1089 for (Int i = 0; i <= sei.m_numOlsIndicesMinus1; i++) 1090 { 1091 WRITE_UVLC(sei.m_olsIdx[i], "ols_idx[i]"); 1092 } 1093 1094 while (m_pcBitIf->getNumberOfWrittenBits() % 8 != 0) 1095 { 1096 WRITE_FLAG(0, "ols_nesting_zero_bit"); 1097 } 1098 1099 // write nested SEI messages 1100 for (SEIMessages::const_iterator it = sei.m_nestedSEIs.begin(); it != sei.m_nestedSEIs.end(); it++) 1101 { 1102 writeSEImessage(bs, *(*it), vps, sps); 1103 } 1104 } 1105 1106 Void SEIWriter::xWriteSEIVPSRewriting(const SEIVPSRewriting &sei) 1107 { 1108 //sei.nalu-> 1109 } 1110 1111 #endif 1112 990 1113 #endif //SVC_EXTENSION 991 1114 -
trunk/source/Lib/TLibEncoder/SEIwrite.h
r713 r815 72 72 Void xWriteSEIGradualDecodingRefreshInfo(const SEIGradualDecodingRefreshInfo &sei); 73 73 Void xWriteSEIToneMappingInfo(const SEIToneMappingInfo& sei); 74 #if P0050_KNEE_FUNCTION_SEI 75 Void xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei); 76 #endif 74 77 #if Q0074_SEI_COLOR_MAPPING 75 78 Void xWriteSEIColorMappingInfo(const SEIColorMappingInfo& sei); … … 92 95 Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei); 93 96 #endif 97 #if Q0189_TMVP_CONSTRAINTS 98 Void xWriteSEITMVPConstraints (const SEITMVPConstrains &sei); 99 #endif 100 #if Q0247_FRAME_FIELD_INFO 101 Void xWriteSEIFrameFieldInfo (const SEIFrameFieldInfo &sei); 102 #endif 94 103 #if O0164_MULTI_LAYER_HRD 95 104 Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei); … … 98 107 Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 ); 99 108 #endif 109 #if Q0078_ADD_LAYER_SETS 110 Void xWriteSEIOutputLayerSetNesting(TComBitIf& bs, const SEIOutputLayerSetNesting &sei, TComVPS *vps, TComSPS *sps); 111 Void xWriteSEIVPSRewriting(const SEIVPSRewriting &sei); 112 #endif 100 113 #endif //SVC_EXTENSION 101 114 }; -
trunk/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r713 r815 276 276 Int nStrideILRY = pRecPic->getStride(); 277 277 Int nStrideILRC = pRecPic->getCStride(); 278 Int nWidth = m_pDsOrigPic->getWidth(); //should exclude the padding;279 Int nHeight= m_pDsOrigPic->getHeight();280 278 xReset3DArray( m_pColorInfo , xGetYSize() , xGetUSize() , xGetVSize() ); 281 279 xReset3DArray( m_pColorInfoC , xGetYSize() , xGetUSize() , xGetVSize() ); 282 280 283 281 //alignment padding 284 Pel *pU = pRecPic->getCbAddr(); 285 Pel *pV = pRecPic->getCrAddr(); 286 pU[(nWidth>>1)] = pU[(nWidth>>1)-1]; 287 pV[(nWidth>>1)] = pV[(nWidth>>1)-1]; 288 memcpy(pU-nStrideILRC, pU, ((nWidth>>1)+1)*sizeof(Pel)); 289 memcpy(pV-nStrideILRC, pV, ((nWidth>>1)+1)*sizeof(Pel)); 290 pU += nStrideILRC+ (nWidth>>1); 291 pV += nStrideILRC+ (nWidth>>1); 292 293 for( Int y = 1 ; y < (nHeight>>1) ; y ++ ) 294 { 295 *pU = pU[-1]; 296 *pV = pV[-1]; 297 pU += nStrideILRC; 298 pV += nStrideILRC; 299 } 300 memcpy(pU-(nWidth>>1), pU-(nWidth>>1)-nStrideILRC, ((nWidth>>1)+1)*sizeof(Pel)); 301 memcpy(pV-(nWidth>>1), pV-(nWidth>>1)-nStrideILRC, ((nWidth>>1)+1)*sizeof(Pel)); 302 303 for( Int i = 0 ; i < nHeight ; i++ ) 304 { 305 Int posSrcY = i * nStrideSrcY; 306 Int posIRLY = i * nStrideILRY; 307 Int posSrcUV = ( i >> 1 ) * nStrideSrcC; 308 Int posIRLUV = ( i >> 1 ) * nStrideILRC; 309 for( Int j = 0 ; j < nWidth ; j++ , posSrcY++ , posIRLY++ , posSrcUV += !( j & 0x01 ) , posIRLUV += !( j & 0x01 ) ) 282 pRecPic->setBorderExtension( false ); 283 pRecPic->extendPicBorder(); 284 285 TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx()); 286 UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc); 287 const Window &scalEL = pSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 288 TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 289 // borders of down-sampled picture 290 Int leftDS = (scalEL.getWindowLeftOffset()*g_posScalingFactor[refLayerIdc][0]+(1<<15))>>16; 291 Int rightDS = pcRecPicBL->getWidth() - 1 + (((scalEL.getWindowRightOffset())*g_posScalingFactor[refLayerIdc][0]+(1<<15))>>16); 292 Int topDS = (((scalEL.getWindowTopOffset())*g_posScalingFactor[refLayerIdc][1]+(1<<15))>>16); 293 Int bottomDS = pcRecPicBL->getHeight() - 1 + (((scalEL.getWindowBottomOffset())*g_posScalingFactor[refLayerIdc][1]+(1<<15))>>16); 294 // overlapped region 295 Int left = max( 0 , leftDS ); 296 Int right = min( pcRecPicBL->getWidth() - 1 , rightDS ); 297 Int top = max( 0 , topDS ); 298 Int bottom = min( pcRecPicBL->getHeight() - 1 , bottomDS ); 299 // since we do data collection only for overlapped region, the border extension is good enough 300 301 for( Int i = top ; i <= bottom ; i++ ) 302 { 303 Int iDS = i-topDS; 304 Int jDS = left-leftDS; 305 Int posSrcY = iDS * nStrideSrcY + jDS; 306 Int posIRLY = i * nStrideILRY + left; 307 Int posSrcUV = ( iDS >> 1 ) * nStrideSrcC + (jDS>>1); 308 Int posIRLUV = ( i >> 1 ) * nStrideILRC + (left>>1); 309 for( Int j = left ; j <= right ; j++ , posSrcY++ , posIRLY++ , posSrcUV += !( j & 0x01 ) , posIRLUV += !( j & 0x01 ) ) 310 310 { 311 311 Int Y = pSrcY[posSrcY]; -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r713 r815 256 256 WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag"); 257 257 #if P0166_MODIFIED_PPS_EXTENSION 258 WRITE_FLAG( 1, "pps_extension_flag" ); 259 if( 1 ) //pps_extension_flag 258 WRITE_FLAG( pcPPS->getExtensionFlag() ? 1 : 0, "pps_extension_flag" ); 259 260 if( pcPPS->getExtensionFlag() ) 260 261 { 261 262 #if !POC_RESET_IDC … … 638 639 } 639 640 640 #if SPS_EXTENSION 641 WRITE_FLAG( 1, "sps_extension_flag" ); 642 if( 1 ) // if( sps_extension_flag ) 641 #if SVC_EXTENSION 642 WRITE_FLAG( pcSPS->getExtensionFlag() ? 1 : 0, "sps_extension_flag" ); 643 644 if( pcSPS->getExtensionFlag() ) 643 645 { 644 646 #if O0142_CONDITIONAL_SPS_EXTENSION … … 661 663 #endif 662 664 } 663 #if SPS_EXTENSION 665 666 #if SVC_EXTENSION 664 667 Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS ) 665 668 { … … 688 691 } 689 692 } 690 #endif 693 #endif //SVC_EXTENSION 694 691 695 Void TEncCavlc::codeVPS( TComVPS* pcVPS ) 692 696 { … … 703 707 WRITE_CODE( pcVPS->getVPSId(), 4, "vps_video_parameter_set_id" ); 704 708 WRITE_CODE( 3, 2, "vps_reserved_three_2bits" ); 705 #if VPS_RENAME709 #if SVC_EXTENSION 706 710 WRITE_CODE( pcVPS->getMaxLayers() - 1, 6, "vps_max_layers_minus1" ); 707 711 #else … … 734 738 } 735 739 736 #if VPS_RENAME740 #if SVC_EXTENSION 737 741 assert( pcVPS->getNumHrdParameters() <= MAX_VPS_LAYER_SETS_PLUS1 ); 738 742 assert( pcVPS->getMaxLayerId() < MAX_VPS_LAYER_ID_PLUS1 ); … … 741 745 #endif 742 746 WRITE_CODE( pcVPS->getMaxLayerId(), 6, "vps_max_layer_id" ); 747 #if Q0078_ADD_LAYER_SETS 748 WRITE_UVLC(pcVPS->getVpsNumLayerSetsMinus1(), "vps_num_layer_sets_minus1"); 749 for (UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx++) 750 #else 743 751 WRITE_UVLC( pcVPS->getNumLayerSets() - 1, "vps_num_layer_sets_minus1" ); 744 for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getNumLayerSets() - 1 ); opsIdx ++ ) 752 for (UInt opsIdx = 1; opsIdx <= (pcVPS->getNumLayerSets() - 1); opsIdx++) 753 #endif 745 754 { 746 755 // Operation point set … … 798 807 } 799 808 } 800 #if VPS_EXTNS809 #if SVC_EXTENSION 801 810 // When MaxLayersMinus1 is greater than 0, vps_extension_flag shall be equal to 1. 802 811 if( pcVPS->getMaxLayers() > 1 ) … … 832 841 833 842 #if SVC_EXTENSION 834 #if VPS_EXTNS835 843 Void TEncCavlc::codeVPSExtension (TComVPS *vps) 836 844 { … … 846 854 #if !P0307_REMOVE_VPS_VUI_OFFSET 847 855 #if O0109_MOVE_VPS_VUI_FLAG 848 #if !VPS_VUI849 WRITE_FLAG( 0, "vps_vui_present_flag" );850 vps->setVpsVuiPresentFlag(false);851 #else852 856 WRITE_FLAG( 1, "vps_vui_present_flag" ); 853 857 vps->setVpsVuiPresentFlag(true); 854 #endif855 858 if ( vps->getVpsVuiPresentFlag() ) 856 859 { … … 879 882 } 880 883 881 #if SPL_FLG_CHK 884 // The value of dimBitOffset[ NumScalabilityTypes ] is set equal to 6. 882 885 if(vps->getSplittingFlag()) 883 886 { … … 889 892 assert(splDimSum<=6); 890 893 } 891 #endif892 894 893 895 WRITE_FLAG( vps->getNuhLayerIdPresentFlag(), "vps_nuh_layer_id_present_flag" ); … … 957 959 } 958 960 #endif 959 #if N0120_MAX_TID_REF_PRESENT_FLAG960 961 WRITE_FLAG( vps->getMaxTidRefPresentFlag(), "max_tid_ref_present_flag"); 961 962 if (vps->getMaxTidRefPresentFlag()) … … 976 977 } 977 978 } 978 #else 979 for( i = 0; i < vps->getMaxLayers() - 1; i++) 980 { 981 #if O0225_MAX_TID_FOR_REF_LAYERS 982 for( j = i+1; j <= vps->getMaxLayers() - 1; j++) 983 { 984 if(vps->getDirectDependencyFlag(j, i)) 985 { 986 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i,j), 3, "max_tid_il_ref_pics_plus1[i][j]" ); 987 } 988 } 989 #else 990 WRITE_CODE(vps->getMaxTidIlRefPicsPlus1(i), 3, "max_tid_il_ref_pics_plus1[i]" ); 991 #endif 992 } 993 #endif 994 #if ILP_SSH_SIG 995 WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" ); 996 #endif 979 WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" ); 997 980 #if VPS_EXTN_PROFILE_INFO 998 981 // Profile-tier-level signalling … … 1016 999 #endif 1017 1000 1001 #if Q0078_ADD_LAYER_SETS 1002 if (vps->getNumIndependentLayers() > 1) 1003 { 1004 WRITE_UVLC( vps->getNumAddLayerSets(), "num_add_layer_sets" ); 1005 for (i = 0; i < vps->getNumAddLayerSets(); i++) 1006 { 1007 for (j = 1; j < vps->getNumIndependentLayers(); j++) 1008 { 1009 int len = 1; 1010 while ((1 << len) < (vps->getNumLayersInTreePartition(j) + 1)) 1011 { 1012 len++; 1013 } 1014 WRITE_CODE(vps->getHighestLayerIdxPlus1(i, j), len, "highest_layer_idx_plus1[i][j]"); 1015 } 1016 } 1017 } 1018 #endif 1019 1018 1020 #if !VPS_EXTN_UEV_CODING 1019 1021 Int numOutputLayerSets = vps->getNumOutputLayerSets() ; … … 1027 1029 Int numAddOutputLayerSets = numOutputLayerSets - (Int)vps->getNumLayerSets(); 1028 1030 1029 // The value of num_add_o utput_layer_sets shall be in the range of 0 to 1023, inclusive.1031 // The value of num_add_olss shall be in the range of 0 to 1023, inclusive. 1030 1032 assert( numAddOutputLayerSets >= 0 && numAddOutputLayerSets < 1024 ); 1031 1033 … … 1033 1035 if( vps->getNumLayerSets() > 1 ) 1034 1036 { 1035 WRITE_UVLC( numAddOutputLayerSets, "num_add_o utput_layer_sets" );1036 WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_ target_output_layer_idc" );1037 WRITE_UVLC( numAddOutputLayerSets, "num_add_olss" ); 1038 WRITE_CODE( vps->getDefaultTargetOutputLayerIdc(), 2, "default_output_layer_idc" ); 1037 1039 } 1038 1040 #else … … 1065 1067 numBits++; 1066 1068 } 1067 WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, " output_layer_set_idx_minus1");1069 WRITE_CODE( vps->getOutputLayerSetIdx(i) - 1, numBits, "layer_set_idx_for_ols_minus1"); 1068 1070 #if P0295_DEFAULT_OUT_LAYER_IDC 1069 1071 } 1072 #if Q0078_ADD_LAYER_SETS 1073 if ( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 1074 #else 1070 1075 if ( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 ) //Instead of == 2, >= 2 is used to follow the agreement that value 3 should be interpreted as 2 1076 #endif 1071 1077 { 1072 1078 #endif … … 1217 1223 WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" ); 1218 1224 #endif 1219 #if N0147_IRAP_ALIGN_FLAG &&!IRAP_ALIGN_FLAG_IN_VPS_VUI1225 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI 1220 1226 WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag"); 1221 1227 #endif … … 1286 1292 1287 1293 #if !O0109_MOVE_VPS_VUI_FLAG 1288 #if !VPS_VUI1289 WRITE_FLAG( 0, "vps_vui_present_flag" );1290 #else1291 1294 WRITE_FLAG( 1, "vps_vui_present_flag" ); 1292 1295 if(1) // Should be conditioned on the value of vps_vui_present_flag … … 1303 1306 codeVPSVUI(vps); 1304 1307 } 1305 #endif1306 1308 #else 1307 1309 #if P0307_REMOVE_VPS_VUI_OFFSET … … 1326 1328 #endif // 0109_MOVE_VPS_FLAG 1327 1329 } 1328 #endif 1330 1329 1331 #if REPN_FORMAT_IN_VPS 1330 1332 Void TEncCavlc::codeRepFormat( RepFormat *repFormat ) … … 1371 1373 { 1372 1374 #if DPB_PARAMS_MAXTLAYERS 1375 #if BITRATE_PICRATE_SIGNALLING 1376 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumLayerSets()]; 1377 for(Int i = 0; i < vps->getNumLayerSets(); i++) 1378 #else 1373 1379 Int * MaxSubLayersInLayerSetMinus1 = new Int[vps->getNumOutputLayerSets()]; 1374 1380 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) 1381 #endif 1375 1382 { 1376 1383 UInt maxSLMinus1 = 0; … … 1380 1387 Int optLsIdx = i; 1381 1388 #endif 1389 #if BITRATE_PICRATE_SIGNALLING 1390 optLsIdx = i; 1391 #endif 1382 1392 for(Int k = 0; k < vps->getNumLayersInIdList(optLsIdx); k++ ) { 1383 1393 Int lId = vps->getLayerSetLayerIdList(optLsIdx, k); … … 1385 1395 } 1386 1396 MaxSubLayersInLayerSetMinus1[ i ] = maxSLMinus1; 1387 } 1388 #endif 1397 #if BITRATE_PICRATE_SIGNALLING 1398 vps->setMaxSLayersInLayerSetMinus1(i,MaxSubLayersInLayerSetMinus1[ i ]); 1399 #endif 1400 } 1401 #endif 1402 1389 1403 1390 1404 for(Int i = 1; i < vps->getNumOutputLayerSets(); i++) … … 1395 1409 WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]"); 1396 1410 #if DPB_PARAMS_MAXTLAYERS 1411 #if BITRATE_PICRATE_SIGNALLING 1412 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ vps->getOutputLayerSetIdx( i ) ]; j++) 1413 #else 1397 1414 for(Int j = 0; j <= MaxSubLayersInLayerSetMinus1[ i ]; j++) 1415 #endif 1398 1416 #else 1399 1417 for(Int j = 0; j < vps->getMaxTLayers(); j++) … … 1407 1425 { 1408 1426 #if CHANGE_NUMSUBDPB_IDX 1427 #if RESOLUTION_BASED_DPB 1409 1428 for(Int k = 0; k < vps->getNumSubDpbs(layerSetIdxForOutputLayerSet); k++) 1429 #else 1430 for(Int k = 0; k < vps->getNumLayersInIdList( layerSetIdxForOutputLayerSet ); k++) 1431 #endif 1410 1432 #else 1411 1433 for(Int k = 0; k < vps->getNumSubDpbs(i); k++) … … 1430 1452 } 1431 1453 #endif 1432 #if VPS_VUI 1454 1433 1455 Void TEncCavlc::codeVPSVUI (TComVPS *vps) 1434 1456 { … … 1451 1473 } 1452 1474 #endif 1453 #if VPS_VUI_BITRATE_PICRATE1454 1475 WRITE_FLAG( vps->getBitRatePresentVpsFlag(), "bit_rate_present_vps_flag" ); 1455 1476 WRITE_FLAG( vps->getPicRatePresentVpsFlag(), "pic_rate_present_vps_flag" ); … … 1457 1478 if( vps->getBitRatePresentVpsFlag() || vps->getPicRatePresentVpsFlag() ) 1458 1479 { 1480 #if Q0078_ADD_LAYER_SETS 1481 for( i = 0; i <= vps->getVpsNumLayerSetsMinus1(); i++ ) 1482 #else 1459 1483 for( i = 0; i < vps->getNumLayerSets(); i++ ) 1460 { 1484 #endif 1485 { 1486 #if BITRATE_PICRATE_SIGNALLING 1487 for( j = 0; j <= vps->getMaxSLayersInLayerSetMinus1(i); j++ ) 1488 #else 1461 1489 for( j = 0; j < vps->getMaxTLayers(); j++ ) 1490 #endif 1462 1491 { 1463 1492 if( vps->getBitRatePresentVpsFlag() ) … … 1482 1511 } 1483 1512 } 1484 #endif1485 1513 #if VPS_VUI_VIDEO_SIGNAL_MOVE 1486 1514 WRITE_FLAG( vps->getVideoSigPresentVpsFlag(), "video_signal_info_idx_present_flag" ); … … 1519 1547 } 1520 1548 #endif 1521 #if TILE_BOUNDARY_ALIGNED_FLAG 1549 1522 1550 for(i = 1; i < vps->getMaxLayers(); i++) 1523 1551 { … … 1534 1562 } 1535 1563 } 1536 #endif1537 1564 #if VPS_VUI_TILES_NOT_IN_USE__FLAG 1538 1565 } … … 1627 1654 codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1); 1628 1655 } 1656 #if Q0078_ADD_LAYER_SETS 1657 for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ ) 1658 #else 1629 1659 for( UInt h = 1; h <= (vps->getNumLayerSets()-1); h++ ) 1660 #endif 1630 1661 { 1631 1662 WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]"); … … 1642 1673 if (vps->getNumBitstreamPartitions(h)) 1643 1674 { 1675 #if Q0182_MULTI_LAYER_HRD_UPDATE 1676 WRITE_UVLC(vps->getNumBspSchedCombinations(h) - 1, "num_bsp_sched_combinations_minus1[h]"); 1677 #else 1644 1678 WRITE_UVLC( vps->getNumBspSchedCombinations(h), "num_bsp_sched_combinations[h]"); 1679 #endif 1645 1680 for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ ) 1646 1681 { … … 1673 1708 #endif 1674 1709 } 1675 #endif1676 1710 #endif //SVC_EXTENSION 1677 1711 … … 1811 1845 } 1812 1846 #else 1847 #if POC_RESET_IDC_ENCODER 1848 Int picOrderCntLSB; 1849 if( pcSlice->getPocResetIdc() == 2 ) // i.e. the LSB is reset 1850 { 1851 picOrderCntLSB = pcSlice->getPicOrderCntLsb(); // This will be the LSB value w.r.t to the previous POC reset period. 1852 } 1853 else 1854 { 1855 picOrderCntLSB = (pcSlice->getPOC() + (1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1856 } 1857 #else 1813 1858 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1859 #endif 1814 1860 #endif 1815 1861 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); … … 1940 1986 1941 1987 #if SVC_EXTENSION 1942 #if ILP_SSH_SIG1943 #if ILP_SSH_SIG_FIX1944 1988 if((pcSlice->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1945 #else1946 if((pcSlice->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) )1947 #endif1948 #else1949 if((pcSlice->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) )1950 #endif1951 1989 { 1952 1990 WRITE_FLAG(pcSlice->getInterLayerPredEnabledFlag(),"inter_layer_pred_enabled_flag"); … … 1964 2002 WRITE_CODE(pcSlice->getActiveNumILRRefIdx() - 1, numBits,"num_inter_layer_ref_pics_minus1"); 1965 2003 } 1966 #if ILP_NUM_REF_CHK 2004 1967 2005 if( pcSlice->getNumILRRefIdx() != pcSlice->getActiveNumILRRefIdx() ) 1968 2006 { 1969 #endif 1970 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )1971 {1972 WRITE_CODE(pcSlice->getInterLayerPredLayerIdc(i),numBits,"inter_layer_pred_layer_idc[i]");2007 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 2008 { 2009 WRITE_CODE(pcSlice->getInterLayerPredLayerIdc(i),numBits,"inter_layer_pred_layer_idc[i]"); 2010 } 1973 2011 } 1974 #if ILP_NUM_REF_CHK1975 }1976 #endif1977 2012 } 1978 2013 } … … 2294 2329 { 2295 2330 Int tmpBitsBeforeWriting = getNumberOfWrittenBits(); 2331 Int maxPocLsb = 1 << slice->getSPS()->getBitsForPOC(); 2296 2332 if(slice->getPPS()->getSliceHeaderExtensionPresentFlag()) 2297 2333 { … … 2336 2372 { 2337 2373 UInt lengthVal = 1; 2338 UInt tempVal = slice->getPocMsbVal() + 1;2374 UInt tempVal = (slice->getPocMsbVal() / maxPocLsb) + 1; 2339 2375 assert ( tempVal ); 2340 2376 while( 1 != tempVal ) … … 2373 2409 if( slice->getPocMsbValPresentFlag() ) 2374 2410 { 2375 WRITE_UVLC( slice->getPocMsbVal(), "poc_msb_val" ); 2411 assert( slice->getPocMsbVal() % maxPocLsb == 0 ); 2412 WRITE_UVLC( slice->getPocMsbVal() / maxPocLsb, "poc_msb_val" ); 2376 2413 } 2377 2414 for (Int i = 0; i < shExtnAdditionalBits; i++) 2378 2415 { 2416 #if Q0146_SSH_EXT_DATA_BIT 2417 WRITE_FLAG( 1, "slice_segment_header_extension_data_bit"); 2418 #else 2379 2419 WRITE_FLAG( 1, "slice_segment_header_extension_reserved_bit"); 2420 #endif 2380 2421 } 2381 2422 } -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r713 r815 159 159 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); 160 160 161 #if SPS_EXTENSION 162 Void codeSPSExtension ( TComSPS* pcSPS ); 163 #if VPS_EXTNS 164 Void codeVPSExtension ( TComVPS* pcVPS ); 165 #endif 166 #if VPS_VUI 167 Void codeVPSVUI (TComVPS *vps); 168 #endif 161 #if SVC_EXTENSION 162 Void codeSPSExtension ( TComSPS* pcSPS ); 163 Void codeVPSExtension ( TComVPS* pcVPS ); 164 Void codeVPSVUI ( TComVPS *vps ); 169 165 #if REPN_FORMAT_IN_VPS 170 Void codeRepFormat 166 Void codeRepFormat ( RepFormat *repFormat ); 171 167 #endif 172 168 #if VPS_DPB_SIZE_TABLE 173 Void codeVpsDpbSizeTable 169 Void codeVpsDpbSizeTable (TComVPS *vps); 174 170 #endif 175 171 #if Q0048_CGS_3D_ASYMLUT -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r713 r815 248 248 Int* m_codedPivotValue; 249 249 Int* m_targetPivotValue; 250 #if P0050_KNEE_FUNCTION_SEI 251 Bool m_kneeSEIEnabled; 252 Int m_kneeSEIId; 253 Bool m_kneeSEICancelFlag; 254 Bool m_kneeSEIPersistenceFlag; 255 Bool m_kneeSEIMappingFlag; 256 Int m_kneeSEIInputDrange; 257 Int m_kneeSEIInputDispLuminance; 258 Int m_kneeSEIOutputDrange; 259 Int m_kneeSEIOutputDispLuminance; 260 Int m_kneeSEINumKneePointsMinus1; 261 Int* m_kneeSEIInputKneePoint; 262 Int* m_kneeSEIOutputKneePoint; 263 #endif 250 264 #if Q0074_SEI_COLOR_MAPPING 251 265 Char* m_seiColorMappingFile; … … 262 276 Int m_SOPDescriptionSEIEnabled; 263 277 Int m_scalableNestingSEIEnabled; 278 #if Q0189_TMVP_CONSTRAINTS 279 Int m_TMVPConstraintsSEIEnabled; 280 #endif 264 281 //====== Weighted Prediction ======== 265 282 Bool m_useWeightedPred; //< Use of Weighting Prediction (P_SLICE) … … 348 365 Bool m_motionPredEnabledFlag[MAX_VPS_LAYER_ID_PLUS1]; 349 366 #endif 350 #if N0120_MAX_TID_REF_CFG351 367 Int m_maxTidIlRefPicsPlus1; 352 #endif353 368 #if AUXILIARY_PICTURES 354 369 ChromaFormat m_chromaFormatIDC; … … 670 685 Void setTMISEIExtendedWhiteLevelLumaCodeValue(Int b) { m_extendedWhiteLevelLumaCodeValue =b; } 671 686 Int getTMISEIExtendedWhiteLevelLumaCodeValue() { return m_extendedWhiteLevelLumaCodeValue; } 687 #if P0050_KNEE_FUNCTION_SEI 688 Void setKneeSEIEnabled(Int b) { m_kneeSEIEnabled = b; } 689 Bool getKneeSEIEnabled() { return m_kneeSEIEnabled; } 690 Void setKneeSEIId(Int b) { m_kneeSEIId = b; } 691 Int getKneeSEIId() { return m_kneeSEIId; } 692 Void setKneeSEICancelFlag(Bool b) { m_kneeSEICancelFlag=b; } 693 Bool getKneeSEICancelFlag() { return m_kneeSEICancelFlag; } 694 Void setKneeSEIPersistenceFlag(Bool b) { m_kneeSEIPersistenceFlag = b; } 695 Bool getKneeSEIPersistenceFlag() { return m_kneeSEIPersistenceFlag; } 696 Void setKneeSEIMappingFlag(Bool b) { m_kneeSEIMappingFlag = b; } 697 Bool getKneeSEIMappingFlag() { return m_kneeSEIMappingFlag; } 698 Void setKneeSEIInputDrange(Int b) { m_kneeSEIInputDrange = b; } 699 Int getKneeSEIInputDrange() { return m_kneeSEIInputDrange; } 700 Void setKneeSEIInputDispLuminance(Int b) { m_kneeSEIInputDispLuminance = b; } 701 Int getKneeSEIInputDispLuminance() { return m_kneeSEIInputDispLuminance; } 702 Void setKneeSEIOutputDrange(Int b) { m_kneeSEIOutputDrange = b; } 703 Int getKneeSEIOutputDrange() { return m_kneeSEIOutputDrange; } 704 Void setKneeSEIOutputDispLuminance(Int b) { m_kneeSEIOutputDispLuminance = b; } 705 Int getKneeSEIOutputDispLuminance() { return m_kneeSEIOutputDispLuminance; } 706 Void setKneeSEINumKneePointsMinus1(Int b) { m_kneeSEINumKneePointsMinus1 = b; } 707 Int getKneeSEINumKneePointsMinus1() { return m_kneeSEINumKneePointsMinus1; } 708 Void setKneeSEIInputKneePoint(Int *p) { m_kneeSEIInputKneePoint = p; } 709 Int* getKneeSEIInputKneePoint() { return m_kneeSEIInputKneePoint; } 710 Void setKneeSEIOutputKneePoint(Int *p) { m_kneeSEIOutputKneePoint = p; } 711 Int* getKneeSEIOutputKneePoint() { return m_kneeSEIOutputKneePoint; } 712 #endif 672 713 #if Q0074_SEI_COLOR_MAPPING 673 714 Void setColorMappingInfoSEIFile( Char* nameFile ) { m_seiColorMappingFile = nameFile; } … … 695 736 Int getSOPDescriptionSEIEnabled() { return m_SOPDescriptionSEIEnabled; } 696 737 Void setScalableNestingSEIEnabled(Int b) { m_scalableNestingSEIEnabled = b; } 738 #if Q0189_TMVP_CONSTRAINTS 739 void setTMVPConstraintsSEIEnabled(Int b) { m_TMVPConstraintsSEIEnabled = b; } 740 #endif 697 741 Int getScalableNestingSEIEnabled() { return m_scalableNestingSEIEnabled; } 742 #if Q0189_TMVP_CONSTRAINTS 743 Int getTMVPConstraintsSEIEnabled() { return m_TMVPConstraintsSEIEnabled; } 744 #endif 698 745 Void setUseWP ( Bool b ) { m_useWeightedPred = b; } 699 746 Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } … … 877 924 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; } 878 925 #endif 879 #if N0120_MAX_TID_REF_CFG880 926 Int getMaxTidIlRefPicsPlus1 () { return m_maxTidIlRefPicsPlus1; } 881 927 Void setMaxTidIlRefPicsPlus1 (Int num) { m_maxTidIlRefPicsPlus1 = num; } 882 #endif883 928 #if LAYERS_NOT_PRESENT_SEI 884 929 Void setLayersNotPresentSEIEnabled(Int b) { m_layersNotPresentSEIEnabled = b; } -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r595 r815 696 696 #if (ENCODER_FAST_MODE) 697 697 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 698 rpcBestCU->getPredictionMode(0) == MODE_NONE || // if there is no valid inter prediction 698 699 !testInter || 699 700 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || … … 701 702 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 702 703 #else 703 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 704 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 705 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 706 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 707 #endif 704 if( rpcBestCU->getSlice()->getSliceType() == I_SLICE || 705 rpcBestCU->getCbf( 0, TEXT_LUMA ) != 0 || 706 rpcBestCU->getCbf( 0, TEXT_CHROMA_U ) != 0 || 707 rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0 ) // avoid very complex intra if it is unlikely 708 #endif 709 { 710 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 711 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 712 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 708 713 { 709 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 710 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 711 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 714 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 712 715 { 713 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 714 { 715 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 716 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 716 717 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 717 }718 718 } 719 719 } 720 } 720 721 721 722 // test PCM … … 734 735 #if (ENCODER_FAST_MODE) 735 736 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 736 if(pcPic->getLayerId() > 0 && !m_disableILP) 737 #else 738 if(pcPic->getLayerId() > 0) 739 #endif 740 { 741 for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++) 742 { 743 xCheckRDCostILRUni( rpcBestCU, rpcTempCU, pcSlice->getInterLayerPredLayerIdc(refLayer)); 744 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 737 if(pcPic->getLayerId() > 0 && !m_disableILP) 738 #else 739 if(pcPic->getLayerId() > 0) 740 #endif 741 { 742 for(Int refLayer = 0; refLayer < pcSlice->getActiveNumILRRefIdx(); refLayer++) 743 { 744 xCheckRDCostILRUni( rpcBestCU, rpcTempCU, pcSlice->getVPS()->getRefLayerId( pcSlice->getLayerId(), pcSlice->getInterLayerPredLayerIdc(refLayer) ) ); 745 rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); 746 } 745 747 } 746 }747 748 #endif 748 749 … … 821 822 822 823 if ( m_pcEncCfg->getCUTransquantBypassFlagForceValue() ) 823 824 { 824 825 iMaxQP = iMinQP; // If all blocks are forced into using transquant bypass, do not loop here. 825 826 } 826 827 827 828 for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++) … … 1476 1477 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); 1477 1478 1479 #if SVC_EXTENSION 1480 #if AMP_MRG 1481 rpcTempCU->setMergeAMP (true); 1482 Bool ret = m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG ); 1483 #else 1484 Bool ret = m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1485 #endif 1486 1487 if( !ret ) 1488 { 1489 return; 1490 } 1491 #else 1478 1492 #if AMP_MRG 1479 1493 rpcTempCU->setMergeAMP (true); … … 1481 1495 #else 1482 1496 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] ); 1497 #endif 1483 1498 #endif 1484 1499 -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r713 r815 92 92 m_bRefreshPending = 0; 93 93 m_pocCRA = 0; 94 #if POC_RESET_IDC_ENCODER 95 m_pocCraWithoutReset = 0; 96 m_associatedIrapPocBeforeReset = 0; 97 #endif 94 98 m_numLongTermRefPicSPS = 0; 95 99 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); … … 103 107 m_associatedIRAPPOC = 0; 104 108 #endif 105 #if SVC_ UPSAMPLING109 #if SVC_EXTENSION 106 110 m_pcPredSearch = NULL; 107 #endif108 111 #if Q0048_CGS_3D_ASYMLUT 109 112 m_temp = NULL; 110 113 m_pColorMappedPic = NULL; 111 114 #endif 115 #if POC_RESET_IDC_ENCODER 116 m_lastPocPeriodId = -1; 117 #endif 118 #endif //SVC_EXTENSION 112 119 return; 113 120 } … … 173 180 #if SVC_EXTENSION 174 181 m_ppcTEncTop = pcTEncTop->getLayerEnc(); 175 #endif176 #if SVC_UPSAMPLING177 182 m_pcPredSearch = pcTEncTop->getPredSearch(); ///< encoder search class 178 #endif179 183 #if Q0048_CGS_3D_ASYMLUT 180 184 if( pcTEncTop->getLayerId() ) … … 185 189 { 186 190 m_pColorMappedPic = new TComPicYuv; 187 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), CHROMA_420, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 188 } 189 } 190 #endif 191 m_pColorMappedPic->create( m_ppcTEncTop[0]->getSourceWidth(), m_ppcTEncTop[0]->getSourceHeight(), m_ppcTEncTop[0]->getChromaFormatIDC(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, NULL ); 192 } 193 } 194 #endif 195 #endif //SVC_EXTENSION 191 196 } 192 197 … … 327 332 } 328 333 334 #if P0050_KNEE_FUNCTION_SEI 335 SEIKneeFunctionInfo* TEncGOP::xCreateSEIKneeFunctionInfo() 336 { 337 SEIKneeFunctionInfo *seiKneeFunctionInfo = new SEIKneeFunctionInfo(); 338 seiKneeFunctionInfo->m_kneeId = m_pcCfg->getKneeSEIId(); 339 seiKneeFunctionInfo->m_kneeCancelFlag = m_pcCfg->getKneeSEICancelFlag(); 340 if ( !seiKneeFunctionInfo->m_kneeCancelFlag ) 341 { 342 seiKneeFunctionInfo->m_kneePersistenceFlag = m_pcCfg->getKneeSEIPersistenceFlag(); 343 seiKneeFunctionInfo->m_kneeMappingFlag = m_pcCfg->getKneeSEIMappingFlag(); 344 seiKneeFunctionInfo->m_kneeInputDrange = m_pcCfg->getKneeSEIInputDrange(); 345 seiKneeFunctionInfo->m_kneeInputDispLuminance = m_pcCfg->getKneeSEIInputDispLuminance(); 346 seiKneeFunctionInfo->m_kneeOutputDrange = m_pcCfg->getKneeSEIOutputDrange(); 347 seiKneeFunctionInfo->m_kneeOutputDispLuminance = m_pcCfg->getKneeSEIOutputDispLuminance(); 348 349 seiKneeFunctionInfo->m_kneeNumKneePointsMinus1 = m_pcCfg->getKneeSEINumKneePointsMinus1(); 350 Int* piInputKneePoint = m_pcCfg->getKneeSEIInputKneePoint(); 351 Int* piOutputKneePoint = m_pcCfg->getKneeSEIOutputKneePoint(); 352 if(piInputKneePoint&&piOutputKneePoint) 353 { 354 seiKneeFunctionInfo->m_kneeInputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1); 355 seiKneeFunctionInfo->m_kneeOutputKneePoint.resize(seiKneeFunctionInfo->m_kneeNumKneePointsMinus1+1); 356 for(Int i=0; i<=seiKneeFunctionInfo->m_kneeNumKneePointsMinus1; i++) 357 { 358 seiKneeFunctionInfo->m_kneeInputKneePoint[i] = piInputKneePoint[i]; 359 seiKneeFunctionInfo->m_kneeOutputKneePoint[i] = piOutputKneePoint[i]; 360 } 361 } 362 } 363 return seiKneeFunctionInfo; 364 } 365 #endif 366 329 367 #if Q0074_SEI_COLOR_MAPPING 330 368 SEIColorMappingInfo* TEncGOP::xCreateSEIColorMappingInfo( Char* file ) … … 477 515 delete sei; 478 516 } 517 #if P0050_KNEE_FUNCTION_SEI 518 if(m_pcCfg->getKneeSEIEnabled()) 519 { 520 SEIKneeFunctionInfo *sei = xCreateSEIKneeFunctionInfo(); 521 522 nalu = NALUnit(NAL_UNIT_PREFIX_SEI); 523 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 524 #if O0164_MULTI_LAYER_HRD 525 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 526 #else 527 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 528 #endif 529 writeRBSPTrailingBits(nalu.m_Bitstream); 530 accessUnit.push_back(new NALUnitEBSP(nalu)); 531 delete sei; 532 } 533 #endif 479 534 #if Q0074_SEI_COLOR_MAPPING 480 535 if(m_pcCfg->getColorMappingInfoSEIFile()) … … 554 609 TEncSbac* pcSbacCoders = NULL; 555 610 TComOutputBitstream* pcSubstreamsOut = NULL; 611 #if Q0108_TSA_STSA 612 Int flagTSTA = 0; 613 #endif 556 614 557 615 xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut, isField ); … … 855 913 } 856 914 #endif 915 #if POC_RESET_IDC_ENCODER 916 pcSlice->setPocValueBeforeReset( pocCurr ); 917 // Check if the current picture is to be assigned as a reset picture 918 determinePocResetIdc(pocCurr, pcSlice); 919 920 // If reset, do the following steps: 921 if( pcSlice->getPocResetIdc() ) 922 { 923 updatePocValuesOfPics(pocCurr, pcSlice); 924 } 925 else 926 { 927 // Check the base layer picture is IDR. If so, just set current POC equal to 0 (alignment of POC) 928 if( ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) ) 929 { 930 m_pcEncTop->setPocAdjustmentValue( pocCurr ); 931 } 932 // else 933 { 934 // Just subtract POC by the current cumulative POC delta 935 pcSlice->setPOC( pocCurr - m_pcEncTop->getPocAdjustmentValue() ); 936 } 937 938 Int maxPocLsb = 1 << pcSlice->getSPS()->getBitsForPOC(); 939 pcSlice->setPocMsbVal( pcSlice->getPOC() - ( pcSlice->getPOC() & (maxPocLsb-1) ) ); 940 } 941 // Update the POC of current picture, pictures in the DPB, including references inside the reference pictures 942 943 #endif 944 857 945 #if O0149_CROSS_LAYER_BLA_FLAG 858 946 if( m_layerId == 0 && (getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_N_LP) ) … … 1012 1100 if (m_layerId > 0) 1013 1101 { 1014 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1];1015 Int activeNumILRRefIdxTmp = 0;1102 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1]; 1103 Int activeNumILRRefIdxTmp = 0; 1016 1104 1017 1105 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1018 1106 { 1019 1107 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1108 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1020 1109 #if VPS_EXTN_DIRECT_REF_LAYERS 1021 1110 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(refLayerIdc)->getListPic(); … … 1041 1130 1042 1131 #if O0098_SCALED_REF_LAYER_ID 1043 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));1132 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindowForLayer(refLayerId); 1044 1133 #else 1045 1134 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc); … … 1088 1177 } 1089 1178 #endif 1090 #if SVC_UPSAMPLING 1091 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 1092 { 1179 #if SVC_EXTENSION 1180 if( pcPic->isSpatialEnhLayer(refLayerIdc) ) 1181 { 1182 // check for the sample prediction picture type 1183 if( m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag(refLayerId) ) 1184 { 1093 1185 #if P0312_VERT_PHASE_ADJ 1094 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom1095 if( scalEL.getVertPhasePositionEnableFlag() )1096 {1097 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc );1098 }1186 //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom 1187 if( scalEL.getVertPhasePositionEnableFlag() ) 1188 { 1189 pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc ); 1190 } 1099 1191 #endif 1100 1192 #if O0215_PHASE_ALIGNMENT 1101 1193 #if O0194_JOINT_US_BITSHIFT 1102 1194 #if Q0048_CGS_3D_ASYMLUT 1103 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1104 #else 1105 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );1195 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1196 #else 1197 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() ); 1106 1198 #endif 1107 1199 #else 1108 1200 #if Q0048_CGS_3D_ASYMLUT 1109 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1110 #else 1111 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );1201 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1202 #else 1203 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() ); 1112 1204 #endif 1113 1205 #endif … … 1115 1207 #if O0194_JOINT_US_BITSHIFT 1116 1208 #if Q0048_CGS_3D_ASYMLUT 1117 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );1118 #else 1119 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );1209 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1210 #else 1211 m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1120 1212 #endif 1121 1213 #else 1122 1214 #if Q0048_CGS_3D_ASYMLUT 1123 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1124 #else 1125 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1126 #endif 1127 #endif 1128 #endif 1215 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL ); 1216 #else 1217 m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL ); 1218 #endif 1219 #endif 1220 #endif 1221 } 1129 1222 } 1130 1223 else … … 1137 1230 } 1138 1231 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 1139 #endif 1232 #endif //SVC_EXTENSION 1140 1233 } 1141 1234 … … 1154 1247 pcSlice->setInterLayerPredEnabledFlag(false); 1155 1248 } 1156 1249 1157 1250 if( pocCurr % m_pcCfg->getIntraPeriod() == 0 ) 1158 1251 { 1159 #if N0147_IRAP_ALIGN_FLAG1160 1252 if(pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 1161 1253 { … … 1172 1264 } 1173 1265 else 1174 #endif 1175 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 1176 1177 #if IDR_ALIGNMENT 1178 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic(); 1179 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 1180 if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1181 { 1182 pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType()); 1183 } 1184 else 1185 { 1266 { 1267 #if !ALIGN_IRAP_BUGFIX 1186 1268 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 1187 } 1188 #endif 1189 } 1190 1269 #endif 1270 } 1271 } 1272 1191 1273 if( pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1192 1274 { … … 1196 1278 { 1197 1279 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 1198 1199 1280 (pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && 1281 pcSlice->getSliceType() == B_SLICE ) 1200 1282 { 1201 1283 pcSlice->setSliceType(P_SLICE); 1202 1284 } 1203 } 1285 } 1204 1286 } 1205 1287 #endif //#if SVC_EXTENSION … … 1207 1289 { 1208 1290 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R && 1291 #if SVC_EXTENSION 1292 ( m_iGopSize != 1 || m_ppcTEncTop[m_layerId]->getIntraPeriod() > 1 ) ) 1293 #else 1209 1294 !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE)) 1295 #endif 1210 1296 // Add this condition to avoid POC issues with encoder_intra_main.cfg configuration (see #1127 in bug tracker) 1211 1297 { … … 1232 1318 { 1233 1319 m_associatedIRAPType = pcSlice->getNalUnitType(); 1320 #if POC_RESET_IDC_ENCODER 1321 m_associatedIRAPPOC = pcSlice->getPOC(); 1322 m_associatedIrapPocBeforeReset = pocCurr; 1323 #else 1234 1324 m_associatedIRAPPOC = pocCurr; 1325 #endif 1235 1326 } 1236 1327 pcSlice->setAssociatedIRAPType(m_associatedIRAPType); 1237 1328 pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC); 1329 #if POC_RESET_IDC_ENCODER 1330 pcSlice->setAssociatedIrapPocBeforeReset(m_associatedIrapPocBeforeReset); 1331 #endif 1238 1332 #endif 1239 1333 #endif … … 1243 1337 #else 1244 1338 pcSlice->decodingRefreshMarking(m_pocCRA, m_bRefreshPending, rcListPic); 1339 #endif 1340 #if POC_RESET_IDC_ENCODER 1341 // m_pocCRA may have been update here; update m_pocCraWithoutReset 1342 m_pocCraWithoutReset = m_pocCRA + m_pcEncTop->getPocAdjustmentValue(); 1245 1343 #endif 1246 1344 m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid); … … 1280 1378 #endif 1281 1379 #if ALIGNED_BUMPING 1380 #if POC_RESET_IDC_ENCODER 1381 pcSlice->checkLeadingPictureRestrictions(rcListPic, true); 1382 #else 1282 1383 pcSlice->checkLeadingPictureRestrictions(rcListPic); 1384 #endif 1283 1385 #endif 1284 1386 pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS()); … … 1293 1395 if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag()) 1294 1396 { 1295 #if ALIGN_TSA_STSA_PICS1397 #if !Q0108_TSA_STSA 1296 1398 if( pcSlice->getLayerId() > 0 ) 1297 1399 { … … 1392 1494 if(isSTSA==true) 1393 1495 { 1394 #if ALIGN_TSA_STSA_PICS1496 #if !Q0108_TSA_STSA 1395 1497 if( pcSlice->getLayerId() > 0 ) 1396 1498 { … … 1461 1563 } 1462 1564 } 1565 #if Q0108_TSA_STSA 1566 else if( ( pcSlice->getTLayer() == 0 && pcSlice->getLayerId() > 0) // only for enhancement layer and with temporal layer 0 1567 && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N 1568 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R 1569 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N 1570 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R 1571 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL 1572 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP 1573 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA 1574 ) 1575 ) 1576 { 1577 Bool isSTSA=true; 1578 for(Int ii=iGOPid+1; ii < m_pcCfg->getGOPSize() && isSTSA; ii++) 1579 { 1580 Int lTid= m_pcCfg->getGOPEntry(ii).m_temporalId; 1581 if(lTid==pcSlice->getTLayer()) 1582 { 1583 TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii); 1584 for(Int jj=0; jj<nRPS->getNumberOfPictures(); jj++) 1585 { 1586 if(nRPS->getUsed(jj)) 1587 { 1588 Int tPoc=m_pcCfg->getGOPEntry(ii).m_POC+nRPS->getDeltaPOC(jj); 1589 Int kk=0; 1590 for(kk=0; kk<m_pcCfg->getGOPSize(); kk++) 1591 { 1592 if(m_pcCfg->getGOPEntry(kk).m_POC==tPoc) 1593 { 1594 break; 1595 } 1596 } 1597 Int tTid=m_pcCfg->getGOPEntry(kk).m_temporalId; 1598 if(tTid >= pcSlice->getTLayer()) 1599 { 1600 isSTSA = false; 1601 break; 1602 } 1603 } 1604 } 1605 } 1606 } 1607 if(isSTSA==true) 1608 { 1609 #if !Q0108_TSA_STSA 1610 if( pcSlice->getLayerId() > 0 ) 1611 { 1612 Bool oneRefLayerSTSA = false, oneRefLayerNotSTSA = false; 1613 for( Int i = 0; i < pcSlice->getLayerId(); i++) 1614 { 1615 TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic(); 1616 TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC()); 1617 if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) ) 1618 { 1619 if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ) || 1620 ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R ) 1621 ) 1622 { 1623 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1624 { 1625 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1626 } 1627 else 1628 { 1629 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1630 } 1631 oneRefLayerSTSA = true; 1632 } 1633 else 1634 { 1635 oneRefLayerNotSTSA = true; 1636 } 1637 } 1638 } 1639 assert( !( oneRefLayerNotSTSA && oneRefLayerSTSA ) ); // Only one variable should be true - failure of this assert means 1640 // that two independent reference layers that are not dependent on 1641 // each other, but are reference for current layer have inconsistency 1642 if( oneRefLayerNotSTSA /*&& !oneRefLayerSTSA*/ ) // No reference layer is STSA - set current as TRAIL 1643 { 1644 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1645 { 1646 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N ); 1647 } 1648 else 1649 { 1650 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R ); 1651 } 1652 } 1653 else // This means there is no reference layer picture for current picture in this AU 1654 { 1655 if(pcSlice->getTemporalLayerNonReferenceFlag() ) 1656 { 1657 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1658 } 1659 else 1660 { 1661 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R ); 1662 } 1663 } 1664 } 1665 #else 1666 if(pcSlice->getTemporalLayerNonReferenceFlag()) 1667 { 1668 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N); 1669 flagTSTA = 1; 1670 } 1671 else 1672 { 1673 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R); 1674 flagTSTA = 1; 1675 } 1676 #endif 1677 } 1678 } 1679 #endif 1680 1463 1681 arrangeLongtermPicturesInRPS(pcSlice, rcListPic); 1464 1682 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); … … 1471 1689 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 1472 1690 { 1473 #if POC_RESET_FLAG 1474 if ( pocCurr > 0 1691 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 1692 if ( pocCurr > 0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) 1475 1693 #else 1476 1694 if (pcSlice->getPOC()>0 && pcSlice->isRADL() && pcPic->getSlice(0)->getBaseColPic(pcPic->getSlice(0)->getInterLayerPredLayerIdc(0))->getSlice(0)->isRASL()) … … 1480 1698 pcSlice->setInterLayerPredEnabledFlag(0); 1481 1699 } 1482 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1700 #if Q0108_TSA_STSA 1701 if( ( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) || flagTSTA == 1 ) 1702 #else 1703 if( pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 1704 #endif 1483 1705 { 1484 1706 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getActiveNumILRRefIdx()); … … 1489 1711 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getNumRefIdx(REF_PIC_LIST_0)+pcSlice->getActiveNumILRRefIdx()); 1490 1712 pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getActiveNumILRRefIdx()); 1713 } 1714 1715 // check for the reference pictures whether there is at least one either temporal picture or ILRP with sample prediction type 1716 if( pcSlice->getNumRefIdx( REF_PIC_LIST_0 ) - pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNumRefIdx( REF_PIC_LIST_1 ) - pcSlice->getActiveNumILRRefIdx() == 0 ) 1717 { 1718 Bool foundSamplePredPicture = false; 1719 1720 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1721 { 1722 if( m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, pcSlice->getInterLayerPredLayerIdc(i) ) ) ) 1723 { 1724 foundSamplePredPicture = true; 1725 break; 1726 } 1727 } 1728 1729 if( !foundSamplePredPicture ) 1730 { 1731 pcSlice->setSliceType(I_SLICE); 1732 pcSlice->setInterLayerPredEnabledFlag(0); 1733 pcSlice->setActiveNumILRRefIdx(0); 1734 } 1491 1735 } 1492 1736 } … … 1520 1764 // Set reference list 1521 1765 pcSlice->setRefPicList ( rcListPic ); 1522 #endif //SVC_EXTENSION1766 #endif 1523 1767 pcSlice->setRefPicListModificationSvc(); 1524 1768 pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList()); … … 1532 1776 1533 1777 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 1534 { 1535 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) 1778 { 1779 RefPicList refList = RefPicList(1 - ColFromL0Flag); 1780 TComPic* refPic = pcSlice->getRefPic(refList, colIdx); 1781 1782 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1783 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1784 if( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerId() ) 1536 1785 #if MFM_ENCCONSTRAINT 1537 && pcSlice->getBaseColPic( *m_ppcTEncTop[ pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getLayerId()]->getListPic() )->checkSameRefInfo() == true1786 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId()]->getListPic() )->checkSameRefInfo() == true 1538 1787 #endif 1539 1788 ) … … 1549 1798 ColFromL0Flag = 1 - ColFromL0Flag; 1550 1799 for(Int colIdx = 0; colIdx < pcSlice->getNumRefIdx( RefPicList(1 - ColFromL0Flag) ); colIdx++) 1551 { 1552 if( pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->isILR(m_layerId) 1800 { 1801 RefPicList refList = RefPicList(1 - ColFromL0Flag); 1802 TComPic* refPic = pcSlice->getRefPic(refList, colIdx); 1803 1804 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1805 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1806 if( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerId() ) 1553 1807 #if MFM_ENCCONSTRAINT 1554 && pcSlice->getBaseColPic( *m_ppcTEncTop[ pcSlice->getRefPic( RefPicList(1 - ColFromL0Flag), colIdx)->getLayerId()]->getListPic() )->checkSameRefInfo() == true1808 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId()]->getListPic() )->checkSameRefInfo() == true 1555 1809 #endif 1556 1810 ) … … 1650 1904 pcSlice->setEnableTMVPFlag(0); 1651 1905 } 1906 1907 #if SVC_EXTENSION 1908 if( m_layerId > 0 && !pcSlice->isIntra() ) 1909 { 1910 Int colFromL0Flag = 1; 1911 Int colRefIdx = 0; 1912 1913 // check whether collocated picture is valid 1914 if( pcSlice->getEnableTMVPFlag() ) 1915 { 1916 colFromL0Flag = pcSlice->getColFromL0Flag(); 1917 colRefIdx = pcSlice->getColRefIdx(); 1918 1919 TComPic* refPic = pcSlice->getRefPic(RefPicList(1-colFromL0Flag), colRefIdx); 1920 1921 assert( refPic ); 1922 1923 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1924 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1925 if( refPic->isILR(m_layerId) && !m_ppcTEncTop[m_layerId]->getMotionPredEnabledFlag(refPic->getLayerId()) ) 1926 { 1927 pcSlice->setEnableTMVPFlag(false); 1928 pcSlice->setMFMEnabledFlag(false); 1929 colRefIdx = 0; 1930 } 1931 } 1932 1933 // remove motion only ILRP from the end of the colFromL0Flag reference picture list 1934 RefPicList refList = RefPicList(colFromL0Flag); 1935 Int numRefIdx = pcSlice->getNumRefIdx(refList); 1936 1937 if( numRefIdx > 0 ) 1938 { 1939 for( Int refIdx = pcSlice->getNumRefIdx(refList) - 1; refIdx > 0; refIdx-- ) 1940 { 1941 TComPic* refPic = pcSlice->getRefPic(refList, refIdx); 1942 1943 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) ) 1944 { 1945 break; 1946 } 1947 else 1948 { 1949 assert( numRefIdx > 1 ); 1950 numRefIdx--; 1951 } 1952 } 1953 1954 pcSlice->setNumRefIdx( refList, numRefIdx ); 1955 } 1956 1957 // remove motion only ILRP from the end of the (1-colFromL0Flag) reference picture list up to colRefIdx 1958 refList = RefPicList(1 - colFromL0Flag); 1959 numRefIdx = pcSlice->getNumRefIdx(refList); 1960 1961 if( numRefIdx > 0 ) 1962 { 1963 for( Int refIdx = pcSlice->getNumRefIdx(refList) - 1; refIdx > colRefIdx; refIdx-- ) 1964 { 1965 TComPic* refPic = pcSlice->getRefPic(refList, refIdx); 1966 1967 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[m_layerId]->getSamplePredEnabledFlag( refPic->getLayerId() ) ) ) 1968 { 1969 break; 1970 } 1971 else 1972 { 1973 assert( numRefIdx > 1 ); 1974 numRefIdx--; 1975 } 1976 } 1977 1978 pcSlice->setNumRefIdx( refList, numRefIdx ); 1979 } 1980 1981 assert( pcSlice->getNumRefIdx(REF_PIC_LIST_0) > 0 && ( pcSlice->isInterP() || (pcSlice->isInterB() && pcSlice->getNumRefIdx(REF_PIC_LIST_1) > 0) ) ); 1982 } 1983 #endif 1984 1652 1985 /////////////////////////////////////////////////////////////////////////////////////////////////// Compress a slice 1653 1986 // Slice compression … … 1700 2033 1701 2034 Int sliceQP = m_pcCfg->getInitialQP(); 1702 #if POC_RESET_FLAG 2035 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 1703 2036 if ( ( pocCurr == 0 && m_pcCfg->getInitialQP() > 0 ) || ( frameLevel == 0 && m_pcCfg->getForceIntraQP() ) ) // QP is specified 1704 2037 #else … … 1983 2316 { 1984 2317 #if SVC_EXTENSION 1985 #if VPS_NUH_LAYER_ID 1986 OutputNALUnit nalu(NAL_UNIT_VPS, 0, 0 ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1987 #else 1988 OutputNALUnit nalu(NAL_UNIT_VPS, 0, m_layerId); 1989 #endif 2318 OutputNALUnit nalu( NAL_UNIT_VPS, 0, 0 ); // The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1990 2319 #if AVC_BASE 1991 2320 if( ( m_layerId == 1 && m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) || ( m_layerId == 0 && !m_pcEncTop->getVPS()->getAvcBaseLayerFlag() ) ) … … 2021 2350 nalu = NALUnit(NAL_UNIT_SPS); 2022 2351 #endif 2352 #if Q0078_ADD_LAYER_SETS 2353 if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0) 2354 { 2355 nalu.m_layerId = 0; // For independent base layer rewriting 2356 } 2357 #endif 2023 2358 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2024 2359 if (m_bSeqFirst) … … 2058 2393 #else 2059 2394 nalu = NALUnit(NAL_UNIT_PPS); 2395 #endif 2396 #if Q0078_ADD_LAYER_SETS 2397 if (m_pcEncTop->getVPS()->getNumDirectRefLayers(m_layerId) == 0 && m_pcEncTop->getVPS()->getNumAddLayerSets() > 0) 2398 { 2399 nalu.m_layerId = 0; // For independent base layer rewriting 2400 } 2060 2401 #endif 2061 2402 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); … … 2155 2496 writeSOP = false; 2156 2497 } 2498 #if Q0189_TMVP_CONSTRAINTS 2499 if( m_pcEncTop->getTMVPConstraintsSEIEnabled() == 1 && 2500 (m_pcEncTop->getTMVPModeId() == 1 || m_pcEncTop->getTMVPModeId() == 2) && 2501 pcSlice->getLayerId() >0 && 2502 (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP)) 2503 { 2504 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 2505 SEITMVPConstrains seiTMVPConstrains; 2506 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2507 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2508 seiTMVPConstrains.no_intra_layer_col_pic_flag = 1; 2509 seiTMVPConstrains.prev_pics_not_used_flag = 1; 2510 #if O0164_MULTI_LAYER_HRD 2511 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiTMVPConstrains, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 2512 #else 2513 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiTMVPConstrains, pcSlice->getSPS() ); 2514 #endif 2515 writeRBSPTrailingBits(nalu.m_Bitstream); 2516 accessUnit.push_back(new NALUnitEBSP(nalu)); 2517 } 2518 #endif 2519 #if Q0247_FRAME_FIELD_INFO 2520 if( pcSlice->getLayerId()> 0 && 2521 ( (m_pcCfg->getProgressiveSourceFlag() && m_pcCfg->getInterlacedSourceFlag()) || m_pcCfg->getFrameFieldInfoPresentFlag())) 2522 { 2523 OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI); 2524 SEIFrameFieldInfo seiFFInfo; 2525 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 2526 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 2527 seiFFInfo.m_ffinfo_picStruct = (isField && pcSlice->getPic()->isTopField())? 1 : isField? 2 : 0; 2528 #if O0164_MULTI_LAYER_HRD 2529 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiFFInfo, m_pcEncTop->getVPS(), pcSlice->getSPS() ); 2530 #else 2531 m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiFFInfo, pcSlice->getSPS() ); 2532 #endif 2533 writeRBSPTrailingBits(nalu.m_Bitstream); 2534 accessUnit.push_back(new NALUnitEBSP(nalu)); 2535 } 2536 #endif 2157 2537 2158 2538 if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) && … … 2185 2565 } 2186 2566 pictureTimingSEI.m_auCpbRemovalDelay = std::min<Int>(std::max<Int>(1, m_totalCoded - m_lastBPSEI), static_cast<Int>(pow(2, static_cast<double>(pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getCpbRemovalDelayLengthMinus1()+1)))); // Syntax element signalled as minus, hence the . 2187 #if POC_RESET_FLAG 2567 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 2188 2568 pictureTimingSEI.m_picDpbOutputDelay = pcSlice->getSPS()->getNumReorderPics(pcSlice->getSPS()->getMaxTLayers()-1) + pocCurr - m_totalCoded; 2189 2569 #else … … 2313 2693 SEIRecoveryPoint sei_recovery_point; 2314 2694 sei_recovery_point.m_recoveryPocCnt = 0; 2315 #if POC_RESET_FLAG 2695 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 2316 2696 sei_recovery_point.m_exactMatchingFlag = ( pocCurr == 0 ) ? (true) : (false); 2317 2697 #else … … 3068 3448 #endif 3069 3449 } 3450 3451 #if POC_RESET_IDC_ENCODER 3452 Void TEncGOP::determinePocResetIdc(Int const pocCurr, TComSlice *const slice) 3453 { 3454 // If one picture in the AU is IDR, and another picture is not IDR, set the poc_reset_idc to 1 or 2 3455 // If BL picture in the AU is IDR, and another picture is not IDR, set the poc_reset_idc to 2 3456 // If BL picture is IRAP, and another picture is non-IRAP, then the poc_reset_idc is equal to 1 or 2. 3457 if( slice->getSliceIdx() == 0 ) // First slice - compute, copy for other slices 3458 { 3459 Int needReset = false; 3460 Int resetDueToBL = false; 3461 if( slice->getVPS()->getMaxLayers() > 1 ) 3462 { 3463 // If IRAP is refreshed in this access unit for base layer 3464 if( (m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 1 || m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) 3465 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3466 ) 3467 { 3468 // Check if the IRAP refresh interval of any layer does not match that of the base layer 3469 for(Int i = 1; i < slice->getVPS()->getMaxLayers(); i++) 3470 { 3471 Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 3472 Bool refreshTypeFlag = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() ); 3473 if( !(refreshIntervalFlag && refreshTypeFlag) ) 3474 { 3475 needReset = true; 3476 resetDueToBL = true; 3477 break; 3478 } 3479 } 3480 } 3481 } 3482 3483 if( !needReset )// No need reset due to base layer IRAP 3484 { 3485 // Check if EL IDRs results in POC Reset 3486 for(Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++) 3487 { 3488 Bool idrFlag = ( (m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2) 3489 && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3490 ); 3491 for(Int j = 0; j < slice->getVPS()->getMaxLayers(); j++) 3492 { 3493 if( j == i ) 3494 { 3495 continue; 3496 } 3497 Bool idrOtherPicFlag = ( (m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2) 3498 && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 3499 ); 3500 3501 if( idrFlag != idrOtherPicFlag ) 3502 { 3503 needReset = true; 3504 break; 3505 } 3506 } 3507 } 3508 } 3509 if( needReset ) 3510 { 3511 if( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2 ) // BL IDR refresh, assuming BL picture present 3512 { 3513 if( resetDueToBL ) 3514 { 3515 slice->setPocResetIdc( 2 ); // Full reset needed 3516 } 3517 else 3518 { 3519 slice->setPocResetIdc( 1 ); // Due to IDR in EL 3520 } 3521 } 3522 else 3523 { 3524 slice->setPocResetIdc( 1 ); // Only MSB reset 3525 } 3526 3527 // Start a new POC reset period 3528 if (m_layerId == 0) // Assuming BL picture is always present at encoder; for other AU structures, need to change this 3529 { 3530 Int periodId = rand() % 64; 3531 m_lastPocPeriodId = (periodId == m_lastPocPeriodId) ? (periodId + 1) % 64 : periodId ; 3532 } 3533 else 3534 { 3535 m_lastPocPeriodId = m_ppcTEncTop[0]->getGOPEncoder()->getLastPocPeriodId(); 3536 } 3537 slice->setPocResetPeriodId(m_lastPocPeriodId); 3538 } 3539 else 3540 { 3541 slice->setPocResetIdc( 0 ); 3542 } 3543 } 3544 } 3545 3546 Void TEncGOP::updatePocValuesOfPics(Int const pocCurr, TComSlice *const slice) 3547 { 3548 3549 Int pocAdjustValue = pocCurr - m_pcEncTop->getPocAdjustmentValue(); 3550 3551 // New POC reset period 3552 Int maxPocLsb, pocLsbVal, pocMsbDelta, pocLsbDelta, deltaPocVal; 3553 3554 maxPocLsb = 1 << slice->getSPS()->getBitsForPOC(); 3555 pocLsbVal = (slice->getPocResetIdc() == 3) 3556 ? slice->getPocLsbVal() 3557 : pocAdjustValue % maxPocLsb; 3558 pocMsbDelta = pocAdjustValue - pocLsbVal; 3559 pocLsbDelta = (slice->getPocResetIdc() == 2 || ( slice->getPocResetIdc() == 3 && slice->getFullPocResetFlag() )) 3560 ? pocLsbVal 3561 : 0; 3562 deltaPocVal = pocMsbDelta + pocLsbDelta; 3563 3564 // Decrement value of associatedIrapPoc of the TEncGop object 3565 this->m_associatedIRAPPOC -= deltaPocVal; 3566 3567 // Decrememnt the value of m_pocCRA 3568 this->m_pocCRA -= deltaPocVal; 3569 3570 // Iterate through all pictures in the DPB 3571 TComList<TComPic*>::iterator iterPic = getListPic()->begin(); 3572 while( iterPic != getListPic()->end() ) 3573 { 3574 TComPic *dpbPic = *iterPic; 3575 3576 if( dpbPic->getReconMark() ) 3577 { 3578 for(Int i = dpbPic->getNumAllocatedSlice() - 1; i >= 0; i--) 3579 { 3580 TComSlice *dpbPicSlice = dpbPic->getSlice( i ); 3581 TComReferencePictureSet *dpbPicRps = dpbPicSlice->getRPS(); 3582 3583 // Decrement POC of slice 3584 dpbPicSlice->setPOC( dpbPicSlice->getPOC() - deltaPocVal ); 3585 3586 // Decrement POC value stored in the RPS of each such slice 3587 for( Int j = dpbPicRps->getNumberOfPictures() - 1; j >= 0; j-- ) 3588 { 3589 dpbPicRps->setPOC( j, dpbPicRps->getPOC(j) - deltaPocVal ); 3590 } 3591 3592 // Decrement value of refPOC 3593 dpbPicSlice->decrementRefPocValues( deltaPocVal ); 3594 3595 // Update value of associatedIrapPoc of each slice 3596 dpbPicSlice->setAssociatedIRAPPOC( dpbPicSlice->getAssociatedIRAPPOC() - deltaPocVal ); 3597 } 3598 } 3599 iterPic++; 3600 } 3601 3602 // Actual POC value before reset 3603 Int adjustedPocValue = pocCurr - m_pcEncTop->getPocAdjustmentValue(); 3604 3605 // Set MSB value before reset 3606 Int tempLsbVal = adjustedPocValue & (maxPocLsb - 1); 3607 slice->setPocMsbVal( adjustedPocValue - tempLsbVal); 3608 3609 // Set LSB value before reset - this is needed in the case of resetIdc = 2 3610 slice->setPicOrderCntLsb( tempLsbVal ); 3611 3612 // Cumulative delta 3613 m_pcEncTop->setPocAdjustmentValue( m_pcEncTop->getPocAdjustmentValue() + deltaPocVal ); 3614 3615 // New LSB value, after reset 3616 adjustedPocValue = pocCurr - m_pcEncTop->getPocAdjustmentValue(); 3617 Int newLsbVal = adjustedPocValue & (maxPocLsb - 1); 3618 3619 // Set value of POC current picture after RESET 3620 if( slice->getPocResetIdc() == 1 ) 3621 { 3622 slice->setPOC( newLsbVal ); 3623 } 3624 else if( slice->getPocResetIdc() == 2 ) 3625 { 3626 slice->setPOC( 0 ); 3627 } 3628 else if( slice->getPocResetIdc() == 3 ) 3629 { 3630 Int picOrderCntMsb = slice->getCurrMsb( newLsbVal, 3631 slice->getFullPocResetFlag() ? 0 : slice->getPocLsbVal(), 3632 0, 3633 maxPocLsb ); 3634 slice->setPOC( picOrderCntMsb + newLsbVal ); 3635 } 3636 else 3637 { 3638 assert(0); 3639 } 3640 } 3641 #endif 3642 3070 3643 3071 3644 #if !SVC_EXTENSION … … 3516 4089 if( pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->isILR(m_layerId) ) 3517 4090 { 4091 #if POC_RESET_IDC_ENCODER 4092 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 4093 #else 3518 4094 printf( "%d(%d)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR(), pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId() ); 4095 #endif 3519 4096 } 3520 4097 else 3521 4098 { 4099 #if POC_RESET_IDC_ENCODER 4100 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)); 4101 #else 3522 4102 printf ("%d", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex)-pcSlice->getLastIDR()); 4103 #endif 3523 4104 } 3524 4105 #endif … … 3747 4328 } 3748 4329 } 4330 4331 #if POC_RESET_IDC_ENCODER 4332 if(m_pocCraWithoutReset > 0 && this->m_associatedIRAPType == NAL_UNIT_CODED_SLICE_CRA) 4333 { 4334 if(pocCurr < m_pocCraWithoutReset) 4335 #else 3749 4336 if(m_pocCRA>0) 3750 4337 { 3751 4338 if(pocCurr<m_pocCRA) 4339 #endif 3752 4340 { 3753 4341 // All leading pictures are being marked as TFD pictures here since current encoder uses all … … 4287 4875 4288 4876 if(!m_temp) 4877 { 4289 4878 initDs(iWidth, iHeight, m_pcCfg->getIntraPeriod()>1); 4879 } 4290 4880 4291 4881 filterImg(pcYuvSrc->getLumaAddr(), pcYuvSrc->getStride(), pcYuvDest->getLumaAddr(), pcYuvDest->getStride(), iHeight, iWidth, inputBitDepth-outputBitDepth, 0); … … 4294 4884 } 4295 4885 } 4296 const int TEncGOP::m_phase_filter_0_t0[4][13]={4886 const Int TEncGOP::m_phase_filter_0_t0[4][13]={ 4297 4887 {0, 2, -3, -9, 6, 39, 58, 39, 6, -9, -3, 2, 0}, 4298 4888 {0, 0, 0, -2, 8,-20, 116, 34, -10, 2, 0, 0, 0}, //{0, 1, -1, -8, -1, 31, 57, 47, 13, -7, -5, 1, 0}, // … … 4301 4891 }; 4302 4892 4303 const int TEncGOP::m_phase_filter_0_t1[4][13]={4893 const Int TEncGOP::m_phase_filter_0_t1[4][13]={ 4304 4894 {0, 4, 0, -12, 0, 40, 64, 40, 0, -12, 0, 4, 0}, 4305 4895 {0, 0, 0, -2, 8,-20, 116,34,-10, 2, 0, 0, 0}, //{0, 1, -1, -8, -1, 31, 57, 47, 13, -7, -5, 1, 0}, // … … 4307 4897 {0, 0, 1, -5, -7, 13, 47, 57, 31, -1, -8,-1, 1} 4308 4898 }; 4309 const int TEncGOP::m_phase_filter_0_t1_chroma[4][13]={4899 const Int TEncGOP::m_phase_filter_0_t1_chroma[4][13]={ 4310 4900 {0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0}, 4311 4901 {0, 0, 0, -2, 8,-20, 116,34,-10, 2, 0, 0, 0}, //{0, 1, -1, -8, -1, 31, 57, 47, 13, -7, -5, 1, 0}, // … … 4314 4904 }; 4315 4905 4316 const int TEncGOP::m_phase_filter_1[8][13]={4906 const Int TEncGOP::m_phase_filter_1[8][13]={ 4317 4907 {0, 0, 5, -6, -10,37, 76, 37,-10, -6, 5, 0, 0}, 4318 4908 {0, -1, 5, -3, -12,29, 75, 45, -7, -8, 5, 0, 0}, … … 4325 4915 }; 4326 4916 4917 #if CGS_GCC_NO_VECTORIZATION 4918 #ifdef __GNUC__ 4919 #define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) 4920 #if GCC_VERSION > 40600 4921 __attribute__((optimize("no-tree-vectorize"))) 4922 #endif 4923 #endif 4924 #endif 4327 4925 Void TEncGOP::filterImg( 4328 4926 Pel *src, … … 4377 4975 // pad temp (vertical) 4378 4976 for (k=-(length>>1); k<0; k++) 4379 memcpy(m_temp[k], m_temp[0], width2*sizeof(int)); 4977 { 4978 memcpy(m_temp[k], m_temp[0], width2*sizeof(Int)); 4979 } 4380 4980 for (k=height1; k<(height1+(length>>1)); k++) 4381 memcpy(m_temp[k], m_temp[k-1], (width2)* sizeof(int)); 4981 { 4982 memcpy(m_temp[k], m_temp[k-1], (width2)* sizeof(Int)); 4983 } 4382 4984 4383 4985 // vertical filtering … … 4400 5002 } 4401 5003 iSum=((iSum + shift_round) >> shift2); 4402 *p_dst++ = ( short)(iSum > iMax ? iMax : (iSum < 0 ? 0 : iSum));5004 *p_dst++ = (Short)(iSum > iMax ? iMax : (iSum < 0 ? 0 : iSum)); 4403 5005 } 4404 5006 p_dst_line += iDstStride; … … 4455 5057 { 4456 5058 if (*array2D) 5059 { 4457 5060 xFree(array2D[-iPadY]-iPadX); 5061 } 4458 5062 else 5063 { 4459 5064 printf("free_mem2DintWithPad: trying to free unused memory\r\nPress Any Key\r\n"); 5065 } 4460 5066 4461 5067 free (&array2D[-iPadY]); -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r713 r815 113 113 Bool m_bRefreshPending; 114 114 Int m_pocCRA; 115 #if POC_RESET_IDC_ENCODER 116 Int m_pocCraWithoutReset; 117 Int m_associatedIrapPocBeforeReset; 118 #endif 115 119 std::vector<Int> m_storedStartCUAddrForEncodingSlice; 116 120 std::vector<Int> m_storedStartCUAddrForEncodingSliceSegment; … … 135 139 UInt m_layerId; 136 140 TEncTop** m_ppcTEncTop; 137 #if SVC_UPSAMPLING138 141 TEncSearch* m_pcPredSearch; ///< encoder search class 139 #endif140 142 #if Q0048_CGS_3D_ASYMLUT 141 143 TEnc3DAsymLUT m_Enc3DAsymLUTPicUpdate; … … 154 156 Int **m_temp; 155 157 #endif 158 #if POC_RESET_IDC_ENCODER 159 Int m_lastPocPeriodId; 160 #endif 156 161 #endif 157 162 … … 172 177 #else 173 178 Void compressGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP, Bool isField, Bool isTff ); 179 #endif 180 #if POC_RESET_IDC_ENCODER 181 Void determinePocResetIdc( Int const pocCurr, TComSlice *const slice); 182 Int getIntraRefreshInterval() { return m_pcCfg->getIntraPeriod(); } 183 Int getIntraRefreshType() { return m_pcCfg->getDecodingRefreshType(); } 184 // Int getIntraRefreshInterval () { return (m_pcCfg) ? m_pcCfg->getIntraPeriod() : 0; } 185 Int getLastPocPeriodId() { return m_lastPocPeriodId; } 186 Void setLastPocPeriodId(Int x) { m_lastPocPeriodId = x; } 187 Void updatePocValuesOfPics( Int const pocCurr, TComSlice *const slice); 174 188 #endif 175 189 Void xAttachSliceDataToNalUnit (OutputNALUnit& rNalu, TComOutputBitstream*& rpcBitstreamRedirect); … … 209 223 210 224 SEIToneMappingInfo* xCreateSEIToneMappingInfo(); 225 #if P0050_KNEE_FUNCTION_SEI 226 SEIKneeFunctionInfo* xCreateSEIKneeFunctionInfo(); 227 #endif 211 228 #if Q0074_SEI_COLOR_MAPPING 212 229 SEIColorMappingInfo* xCreateSEIColorMappingInfo( Char* file ); -
trunk/source/Lib/TLibEncoder/TEncPic.cpp
r595 r815 126 126 * \return Void 127 127 */ 128 #if SVC_EXTENSION 128 129 #if AUXILIARY_PICTURES 129 #if SVC_UPSAMPLING130 130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 131 131 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 132 133 #else134 135 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,136 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual )137 #endif138 132 { 139 #if SVC_UPSAMPLING140 133 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 141 134 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 142 135 #else 143 TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 136 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 137 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 138 { 139 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 140 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual ); 144 141 #endif 145 142 m_uiMaxAQDepth = uiMaxAQDepth; … … 153 150 } 154 151 } 155 #else 156 #if SVC_UPSAMPLING 157 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 158 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual ) 159 160 #else 152 #else //SVC_EXTENSION 161 153 Void TEncPic::create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 162 154 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual ) 163 #endif164 155 { 165 #if SVC_UPSAMPLING166 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth,167 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual );168 #else169 156 TComPic::create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, 170 157 conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual ); 171 #endif172 158 m_uiMaxAQDepth = uiMaxAQDepth; 173 159 if ( uiMaxAQDepth > 0 ) … … 180 166 } 181 167 } 182 #endif 168 #endif //SVC_EXTENSION 183 169 184 170 /** Clean up -
trunk/source/Lib/TLibEncoder/TEncPic.h
r595 r815 41 41 #include "TLibCommon/CommonDef.h" 42 42 #include "TLibCommon/TComPic.h" 43 #if SVC_ UPSAMPLING43 #if SVC_EXTENSION 44 44 #include "TLibCommon/TComSlice.h" 45 45 #endif … … 105 105 virtual ~TEncPic(); 106 106 107 #if SVC_EXTENSION 107 108 #if AUXILIARY_PICTURES 108 #if SVC_UPSAMPLING109 109 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 110 110 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false ); 111 111 #else 112 Void create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,113 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false );114 115 #endif116 #else117 #if SVC_UPSAMPLING118 112 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 119 113 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual = false ); 120 #else 114 #endif 115 #else //SVC_EXTENSION 121 116 Void create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 122 117 Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false ); 123 #endif 124 #endif 118 #endif //SVC_EXTENSION 119 125 120 virtual Void destroy(); 126 121 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r713 r815 3102 3102 * \returns Void 3103 3103 */ 3104 #if SVC_EXTENSION 3105 #if AMP_MRG 3106 Bool TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 3107 #else 3108 Bool TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) 3109 #endif 3110 #else 3104 3111 #if AMP_MRG 3105 3112 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 3106 3113 #else 3107 3114 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) 3115 #endif 3108 3116 #endif 3109 3117 { … … 3215 3223 #endif 3216 3224 3225 #if SVC_EXTENSION 3226 Bool doneUniPred = false; 3227 #endif 3228 3217 3229 // Uni-directional prediction 3218 3230 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) … … 3222 3234 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 3223 3235 { 3236 #if SVC_EXTENSION 3237 TComPic* pcPic = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp ); 3238 3239 // motion search only for the ILRP with sample prediction type 3240 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), pcPic->getLayerId() ) ) 3241 { 3242 continue; 3243 } 3244 3224 3245 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 3225 if (pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp )->isILR(pcCU->getLayerId()) && m_disableILP)3246 if( pcPic->isILR(pcCU->getLayerId()) && m_disableILP ) 3226 3247 { 3227 3248 continue; 3228 3249 } 3229 3250 #endif 3230 #if (ENCODER_FAST_MODE) 3231 TComPic* pcPic = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxTemp ); 3251 #if (ENCODER_FAST_MODE) 3232 3252 if( pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N) ) 3233 3253 { 3234 3254 continue; 3235 3255 } 3256 #endif 3257 doneUniPred = true; 3236 3258 #endif 3237 3259 … … 3342 3364 } 3343 3365 } 3366 3367 #if SVC_EXTENSION 3368 if( pcCU->getLayerId() && !doneUniPred ) 3369 { 3370 // there is no valid reference pictures for inter prediction 3371 return false; 3372 } 3373 #endif 3374 3344 3375 // Bi-directional prediction 3345 3376 #if REF_IDX_ME_ZEROMV … … 3462 3493 #if (ENCODER_FAST_MODE) 3463 3494 Bool testRefIdx = true; 3464 pcPic = pcCU->getSlice()->getRefPic( RefPicList(iRefList) , iRefIdxTemp ); 3495 pcPic = pcCU->getSlice()->getRefPic( RefPicList(iRefList) , iRefIdxTemp ); 3496 3497 // motion search only for the ILRP with sample prediction type 3498 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), pcPic->getLayerId() ) ) 3499 { 3500 continue; 3501 } 3502 3465 3503 if(pcPic->isILR(pcCU->getLayerId()) && (ePartSize == SIZE_2Nx2N)) 3466 3504 { … … 3781 3819 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 3782 3820 3821 #if SVC_EXTENSION 3822 return true; 3823 #else 3783 3824 return; 3825 #endif 3784 3826 } 3785 3827 … … 5967 6009 Bool TEncSearch::predInterSearchILRUni( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, UInt refLayerId ) 5968 6010 { 5969 rpcPredYuv->clear(); 5970 rpcRecoYuv->clear(); 5971 5972 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 5973 5974 TComMv cMv[2]; 5975 TComMv cMvPred[2][33]; 5976 TComMv cMvTemp[2][33]; 5977 TComMv TempMv; 5978 5979 Int iRefIdx[2]={0,0}; 5980 5981 Int aaiMvpIdx[2][33]; 5982 Int aaiMvpNum[2][33]; 5983 5984 UInt uiMbBits[3] = {1, 1, 0}; 5985 UInt uiLastMode = 0; 5986 5987 UInt uiCost[2] = { MAX_UINT, MAX_UINT }; //uni, rdCost 5988 UInt uiCostTemp; 5989 UInt biPDistTemp = MAX_INT; 5990 UInt uiBitsTemp; 5991 5992 PartSize ePartSize = pcCU->getPartitionSize( 0 ); //2Nx2N 5993 Int iPartIdx = 0; //one PU in CU 5994 UInt uiPartAddr; 5995 Int iRoiWidth, iRoiHeight; 5996 Bool bILRSearched = false; 5997 5998 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 5999 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 6000 6001 for( Int iRefList = 0; iRefList < iNumPredDir; iRefList++) //list 6002 { 6003 if(bILRSearched) 6004 continue; 6005 6006 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 6007 6008 Int iRefIdxTemp = -1; 6009 Bool foundILR = false; 6010 6011 for( Int refIdx = 0; refIdx < pcCU->getSlice()->getNumRefIdx(eRefPicList); refIdx++ ) 6012 { 6013 if( pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->isILR(pcCU->getLayerId()) && pcCU->getSlice()->getRefPic(eRefPicList, refIdx)->getLayerId() == refLayerId ) 6014 { 6015 iRefIdxTemp = refIdx; 6016 foundILR = true; 6017 bILRSearched = true; 6018 break; 6019 } 6020 } 6021 6022 if(!foundILR) //no ILR in eRefPiclist 6023 { 6024 continue; 6025 } 6026 6027 uiBitsTemp = uiMbBits[iRefList]; 6028 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) 6029 { 6030 uiBitsTemp += iRefIdxTemp+1; 6031 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 6032 } 6033 6034 xEstimateMvPredAMVP( pcCU, pcOrgYuv, iPartIdx, eRefPicList, iRefIdxTemp, cMvPred[iRefList][iRefIdxTemp], false, &biPDistTemp); 6035 aaiMvpIdx[iRefList][iRefIdxTemp] = pcCU->getMVPIdx(eRefPicList, uiPartAddr); 6036 aaiMvpNum[iRefList][iRefIdxTemp] = pcCU->getMVPNum(eRefPicList, uiPartAddr); 6037 6038 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 6039 6040 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 6041 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 6042 6043 if( uiCostTemp < uiCost[iRefList] ) 6044 { 6045 uiCost[iRefList] = uiCostTemp; 6046 6047 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp]; 6048 iRefIdx[iRefList] = iRefIdxTemp; 6049 6050 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6051 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6052 } 6053 } 6054 6055 if( uiCost[0] == MAX_UINT && uiCost[1] == MAX_UINT ) //no ILR in both list0 and list1 6056 { 6057 return false; 6058 } 6059 6060 // Clear Motion Field 6061 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6062 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6063 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6064 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6065 6066 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6067 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6068 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6069 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6070 6071 if( uiCost[0] <= uiCost[1] ) //list0 ILR 6072 { 6073 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMv ( cMv[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6074 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx( iRefIdx[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6075 6076 TempMv = cMv[0] - cMvPred[0][iRefIdx[0]]; 6077 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6078 6079 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6080 6081 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6082 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6083 } 6084 else if( uiCost[1] < uiCost[0] ) //list1 ILR 6085 { 6086 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv ( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6087 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6088 6089 TempMv = cMv[1] - cMvPred[1][iRefIdx[1]]; 6090 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6091 6092 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6093 6094 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6095 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6096 } 6097 else 6098 { 6099 assert(0); 6100 } 6101 6102 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 6103 6104 motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx ); 6105 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 6106 6107 return true; 6011 rpcPredYuv->clear(); 6012 rpcRecoYuv->clear(); 6013 6014 Int iNumPredDir = pcCU->getSlice()->isInterP() ? 1 : 2; 6015 6016 TComMv cMv[2]; 6017 TComMv cMvPred[2][33]; 6018 TComMv cMvTemp[2][33]; 6019 TComMv TempMv; 6020 6021 Int iRefIdx[2]={0,0}; 6022 6023 Int aaiMvpIdx[2][33]; 6024 Int aaiMvpNum[2][33]; 6025 6026 UInt uiMbBits[3] = {1, 1, 0}; 6027 UInt uiLastMode = 0; 6028 6029 UInt uiCost[2] = { MAX_UINT, MAX_UINT }; //uni, rdCost 6030 UInt uiCostTemp; 6031 UInt biPDistTemp = MAX_INT; 6032 UInt uiBitsTemp; 6033 6034 PartSize ePartSize = pcCU->getPartitionSize( 0 ); //2Nx2N 6035 Int iPartIdx = 0; //one PU in CU 6036 UInt uiPartAddr; 6037 Int iRoiWidth, iRoiHeight; 6038 Bool bILRSearched = false; 6039 6040 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 6041 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 6042 6043 for( Int iRefList = 0; iRefList < iNumPredDir; iRefList++) //list 6044 { 6045 if(bILRSearched) 6046 { 6047 continue; 6048 } 6049 6050 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 6051 6052 Int iRefIdxTemp = -1; 6053 Bool foundILR = false; 6054 6055 for( Int refIdx = 0; refIdx < pcCU->getSlice()->getNumRefIdx(eRefPicList); refIdx++ ) 6056 { 6057 TComPic* refPic = pcCU->getSlice()->getRefPic(eRefPicList, refIdx); 6058 6059 // ILRP has to be for the sample prediction type 6060 if( refPic->isILR(pcCU->getLayerId()) && refPic->getLayerId() == refLayerId && pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId(), refLayerId ) ) 6061 { 6062 iRefIdxTemp = refIdx; 6063 foundILR = true; 6064 bILRSearched = true; 6065 break; 6066 } 6067 } 6068 6069 if(!foundILR) //no ILR in eRefPiclist 6070 { 6071 continue; 6072 } 6073 6074 uiBitsTemp = uiMbBits[iRefList]; 6075 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) 6076 { 6077 uiBitsTemp += iRefIdxTemp+1; 6078 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 6079 } 6080 6081 xEstimateMvPredAMVP( pcCU, pcOrgYuv, iPartIdx, eRefPicList, iRefIdxTemp, cMvPred[iRefList][iRefIdxTemp], false, &biPDistTemp); 6082 aaiMvpIdx[iRefList][iRefIdxTemp] = pcCU->getMVPIdx(eRefPicList, uiPartAddr); 6083 aaiMvpNum[iRefList][iRefIdxTemp] = pcCU->getMVPNum(eRefPicList, uiPartAddr); 6084 6085 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 6086 6087 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 6088 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 6089 6090 if( uiCostTemp < uiCost[iRefList] ) 6091 { 6092 uiCost[iRefList] = uiCostTemp; 6093 6094 cMv[iRefList] = cMvTemp[iRefList][iRefIdxTemp]; 6095 iRefIdx[iRefList] = iRefIdxTemp; 6096 6097 pcCU->getCUMvField(eRefPicList)->setAllMv( cMv[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6098 pcCU->getCUMvField(eRefPicList)->setAllRefIdx( iRefIdx[iRefList], ePartSize, uiPartAddr, 0, iPartIdx ); 6099 } 6100 } 6101 6102 if( uiCost[0] == MAX_UINT && uiCost[1] == MAX_UINT ) //no ILR in both list0 and list1 6103 { 6104 return false; 6105 } 6106 6107 // Clear Motion Field 6108 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6109 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, uiPartAddr, 0, iPartIdx ); 6110 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6111 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( TComMv(), ePartSize, uiPartAddr, 0, iPartIdx ); 6112 6113 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6114 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6115 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6116 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6117 6118 if( uiCost[0] <= uiCost[1] ) //list0 ILR 6119 { 6120 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMv ( cMv[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6121 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx( iRefIdx[0], ePartSize, uiPartAddr, 0, iPartIdx ); 6122 6123 TempMv = cMv[0] - cMvPred[0][iRefIdx[0]]; 6124 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6125 6126 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6127 6128 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6129 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6130 } 6131 else if( uiCost[1] < uiCost[0] ) //list1 ILR 6132 { 6133 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv ( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6134 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx ); 6135 6136 TempMv = cMv[1] - cMvPred[1][iRefIdx[1]]; 6137 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd( TempMv, ePartSize, uiPartAddr, 0, iPartIdx ); 6138 6139 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 6140 6141 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6142 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 6143 } 6144 else 6145 { 6146 assert(0); 6147 } 6148 6149 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 6150 6151 motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx ); 6152 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 6153 6154 return true; 6108 6155 } 6109 6156 #endif -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r595 r815 126 126 127 127 #if SVC_EXTENSION 128 TEncTop** m_ppcTEncTop;129 128 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 130 129 Bool m_disableILP; 131 130 #endif 132 #endif //SVC_EXTEN AION131 #endif //SVC_EXTENSION 133 132 134 133 public: … … 194 193 195 194 /// encoder estimation - inter prediction (non-skip) 195 #if SVC_EXTENSION 196 Bool predInterSearch ( TComDataCU* pcCU, 197 #else 196 198 Void predInterSearch ( TComDataCU* pcCU, 199 #endif 197 200 TComYuv* pcOrgYuv, 198 201 TComYuv*& rpcPredYuv, -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r713 r815 89 89 #endif 90 90 m_numScaledRefLayerOffsets = 0; 91 #if POC_RESET_FLAG 91 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 92 92 m_pocAdjustmentValue = 0; 93 93 #endif … … 810 810 811 811 //only for scalable extension 812 #if SCALABILITY_MASK_E0104 813 assert( m_cVPS.getScalabilityMask(2) == true ); 814 #else 815 assert( m_cVPS.getScalabilityMask(1) == true ); 816 #endif 812 assert( m_cVPS.getScalabilityMask( SCALABILITY_ID ) == true ); 817 813 } 818 814 } … … 820 816 #endif 821 817 818 #if SVC_EXTENSION 822 819 #if AUXILIARY_PICTURES 823 #if SVC_UPSAMPLING824 820 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 825 821 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 826 822 #else 827 pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,828 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);829 #endif830 #else831 #if SVC_UPSAMPLING832 823 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 833 824 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 834 #else 825 #endif 826 #else //SVC_EXTENSION 835 827 pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 , 836 828 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 837 #endif 838 #endif 829 #endif //SVC_EXTENSION 839 830 rpcPic = pcEPic; 840 831 } … … 879 870 880 871 //only for scalable extension 881 #if SCALABILITY_MASK_E0104 882 assert( m_cVPS.getScalabilityMask(2) == true ); 883 #else 884 assert( m_cVPS.getScalabilityMask(1) == true ); 885 #endif 872 assert( m_cVPS.getScalabilityMask( SCALABILITY_ID ) == true ); 886 873 } 887 874 } … … 889 876 #endif 890 877 878 #if SVC_EXTENSION 891 879 #if AUXILIARY_PICTURES 892 #if SVC_UPSAMPLING893 880 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 894 881 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 895 882 #else 896 rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,897 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);898 #endif899 #else900 #if SVC_UPSAMPLING901 883 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 902 884 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS); 903 #else 885 #endif 886 #else //SVC_EXTENSION 904 887 rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 905 888 m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics); 906 #endif 907 #endif 889 #endif //SVC_EXTENSION 908 890 } 909 891 m_cListPic.pushBack( rpcPic ); … … 922 904 { 923 905 #if SVC_EXTENSION 906 m_cSPS.setExtensionFlag( m_layerId > 0 ? true : false ); 907 908 #if Q0078_ADD_LAYER_SETS 909 if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0) 910 { 911 m_cSPS.setLayerId(0); // layer ID 0 for independent layers 912 } 913 else 914 { 915 m_cSPS.setLayerId(m_layerId); 916 } 917 #else 924 918 m_cSPS.setLayerId(m_layerId); 919 #endif 925 920 m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets); 926 921 for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++) … … 1082 1077 Void TEncTop::xInitPPS() 1083 1078 { 1084 #if SCALINGLIST_INFERRING1085 m_cPPS.setLayerId( m_layerId );1086 #endif1087 1088 1079 m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); 1089 1080 Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; … … 1181 1172 } 1182 1173 #if SVC_EXTENSION 1183 if (!m_layerId) 1174 #if SCALINGLIST_INFERRING 1175 m_cPPS.setLayerId( m_layerId ); 1176 #endif 1177 1178 #if Q0078_ADD_LAYER_SETS 1179 if (getNumDirectRefLayers() == 0 && getNumAddLayerSets() > 0) 1180 { 1181 m_cPPS.setLayerId(0); // layer ID 0 for independent layers 1182 } 1183 #endif 1184 1185 if( m_layerId > 0 ) 1186 { 1187 m_cPPS.setListsModificationPresentFlag(true); 1188 m_cPPS.setExtensionFlag(true); 1189 } 1190 else 1184 1191 { 1185 1192 m_cPPS.setListsModificationPresentFlag(false); 1186 } 1187 else 1188 { 1189 m_cPPS.setListsModificationPresentFlag(true); 1190 } 1191 1192 m_cPPS.setPPSId ( m_iPPSIdCnt ); 1193 m_cPPS.setSPSId ( m_iSPSIdCnt ); 1194 #endif 1193 m_cPPS.setExtensionFlag(false); 1194 } 1195 1196 m_cPPS.setPPSId( m_iPPSIdCnt ); 1197 m_cPPS.setSPSId( m_iSPSIdCnt ); 1195 1198 #if POC_RESET_FLAG 1196 1199 m_cPPS.setNumExtraSliceHeaderBits( 2 ); … … 1205 1208 m_cPPS.setCGSFlag( m_nCGSFlag ); 1206 1209 #endif 1210 #if POC_RESET_IDC_ENCODER 1211 m_cPPS.setPocResetInfoPresentFlag( true ); 1212 m_cPPS.setExtensionFlag( true ); 1213 m_cPPS.setSliceHeaderExtensionPresentFlag( true ); 1214 #endif 1215 #endif //SVC_EXTENSION 1207 1216 } 1208 1217 … … 1582 1591 { 1583 1592 m_cIlpPic[j] = new TComPic; 1584 #if SVC_UPSAMPLING1585 1593 #if AUXILIARY_PICTURES 1586 1594 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1587 1595 #else 1588 1596 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1589 #endif1590 #else1591 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);1592 1597 #endif 1593 1598 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) … … 1649 1654 { 1650 1655 m_cIlpPic[j] = new TComPic; 1651 #if SVC_UPSAMPLING1652 1656 #if AUXILIARY_PICTURES 1653 1657 m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1654 1658 #else 1655 1659 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true); 1656 #endif1657 #else1658 m_cIlpPic[j]->create(m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, true);1659 1660 #endif 1660 1661 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCUsInFrame(); i++) -
trunk/source/Lib/TLibEncoder/TEncTop.h
r713 r815 142 142 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 143 143 #endif 144 #if POC_RESET_FLAG 144 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 145 145 Int m_pocAdjustmentValue; 146 146 #endif … … 153 153 #if O0194_WEIGHTED_PREDICTION_CGS 154 154 Bool m_interLayerWeightedPredFlag; 155 #endif 156 #if Q0078_ADD_LAYER_SETS 157 int m_numAddLayerSets; 155 158 #endif 156 159 #endif //SVC_EXTENSION … … 254 257 TEncTop* getRefLayerEnc(UInt refLayerIdc); 255 258 #endif 256 #if POC_RESET_FLAG 259 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER 257 260 Int getPocAdjustmentValue() { return m_pocAdjustmentValue;} 258 261 Void setPocAdjustmentValue(Int x) { m_pocAdjustmentValue = x; } … … 268 271 Void setNoOutputOfPriorPicsFlags(Bool x) { m_noOutputOfPriorPicsFlags = x; } 269 272 #endif 273 #if Q0078_ADD_LAYER_SETS 274 Void setNumAddLayerSets(Int x) { m_numAddLayerSets = x; } 275 Int getNumAddLayerSets() { return m_numAddLayerSets; } 276 #endif 270 277 #else //SVC_EXTENSION 271 278 Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut,
Note: See TracChangeset for help on using the changeset viewer.