Changeset 730 in 3DVCSoftware for branches/HTM-9.0-dev0/source
- Timestamp:
- 9 Dec 2013, 17:16:03 (11 years ago)
- Location:
- branches/HTM-9.0-dev0/source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.0-dev0/source/App/TAppDecoder/TAppDecCfg.cpp
r608 r730 85 85 ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)") 86 86 #if H_MV 87 ("MaxLayerId,-ls", m_maxLayerId, MAX_NUM_LAYER_IDS-1, "Maximum LayerId to be decoded.") 87 #if H_MV_6_HRD_O0217_13 88 ("TargetOptLayerSetIdx,x", m_targetOptLayerSetIdx, -1, "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded. 89 #else 90 ("MaxLayerId,-ls", m_maxLayerId, MAX_NUM_LAYER_IDS-1, "Maximum LayerId to be decoded.") 91 #endif 88 92 #endif 89 93 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") … … 124 128 if ( !cfg_TargetDecLayerIdSetFile.empty() ) 125 129 { 130 #if H_MV_6_HRD_O0217_13 131 m_targetDecLayerIdSetFileEmpty = false; 132 #endif 126 133 FILE* targetDecLayerIdSetFile = fopen ( cfg_TargetDecLayerIdSetFile.c_str(), "r" ); 127 134 if ( targetDecLayerIdSetFile ) … … 167 174 } 168 175 #if H_MV 176 #if H_MV_6_HRD_O0217_13 177 m_targetDecLayerIdSet.push_back( 0 ); // Only base layer at startup 178 #else 169 179 else 170 180 { … … 174 184 } 175 185 } 186 #endif 176 187 #endif 177 188 -
branches/HTM-9.0-dev0/source/App/TAppDecoder/TAppDecCfg.h
r608 r730 59 59 Char* m_pchBitstreamFile; ///< input bitstream file name 60 60 #if H_MV 61 #if H_MV_6_HRD_O0217_13 62 Int m_targetOptLayerSetIdx; ///< target output layer set index 63 #endif 61 64 Int m_maxLayerId; ///< maximum nuh_layer_id decoded 62 65 std::vector<Char*> m_pchReconFiles; ///< array of output reconstruction file name create from output reconstruction file name … … 74 77 75 78 std::vector<Int> m_targetDecLayerIdSet; ///< set of LayerIds to be included in the sub-bitstream extraction process. 79 #if H_MV_6_HRD_O0217_13 80 Bool m_targetDecLayerIdSetFileEmpty; ///< indication if target layers are given by file 81 #endif 76 82 Int m_respectDefDispWindow; ///< Only output content inside the default display window 77 83 … … 83 89 : m_pchBitstreamFile(NULL) 84 90 #if H_MV 91 #if !H_MV_6_HRD_O0217_13 85 92 , m_maxLayerId(0) 93 #endif 86 94 #endif 87 95 , m_pchReconFile(NULL) … … 91 99 , m_iMaxTemporalLayer(-1) 92 100 , m_decodedPictureHashSEIEnabled(0) 101 #if H_MV_6_HRD_O0217_13 102 , m_targetDecLayerIdSetFileEmpty(true) 103 #endif 93 104 , m_respectDefDispWindow(0) 94 105 {} -
branches/HTM-9.0-dev0/source/App/TAppDecoder/TAppDecTop.cpp
r655 r730 61 61 { 62 62 #if H_MV 63 #if H_MV_LAYER_WISE_STARTUP 64 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 65 { 66 m_layerIdToDecIdx[i] = -1; 67 m_layerInitilizedFlags[i] = false; 68 } 69 #else 63 70 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1; 71 #endif 64 72 #endif 65 73 #if H_3D … … 184 192 Bool newSliceDiffPoc = false; 185 193 Bool newSliceDiffLayer = false; 194 #if H_MV_FIX_SKIP_PICTURES 195 Bool sliceSkippedFlag = false; 196 #endif 186 197 #if H_3D 187 198 Bool allLayersDecoded = false; … … 201 212 read(nalu, nalUnit); 202 213 #if H_MV 203 Int decIdx = xGetDecoderIdx( nalu.m_layerId , true ); 204 214 #if !H_MV_6_HRD_O0217_13 215 Int decIdx = xGetDecoderIdx( nalu.m_layerId , true ); 216 #endif 217 #if H_MV_6_LAYER_ID_32 218 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || nalu.m_layerId > MAX_NUM_LAYER_IDS-1 ) 219 #else 205 220 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) ) 221 #endif 206 222 { 207 223 bNewPicture = false; 224 #if H_MV_6_LAYER_ID_32 225 if ( !bitstreamFile ) 226 { 227 decIdxLastPic = decIdxCurrPic; 228 } 229 #endif 208 230 } 209 231 else 210 { 232 { 233 #if H_MV_6_HRD_O0217_13 234 Int decIdx = xGetDecoderIdx( nalu.m_layerId , true ); 235 #endif 211 236 newSliceDiffLayer = nalu.isSlice() && ( nalu.m_layerId != layerIdCurrPic ) && !firstSlice; 237 #if H_MV_FIX_SKIP_PICTURES 238 newSliceDiffPoc = m_tDecTop[decIdx]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[decIdx], newSliceDiffLayer, sliceSkippedFlag ); 239 #else 212 240 newSliceDiffPoc = m_tDecTop[decIdx]->decode(nalu, m_iSkipFrame, m_pocLastDisplay[decIdx], newSliceDiffLayer ); 241 #endif 213 242 // decode function only returns true when all of the following conditions are true 214 243 // - poc in particular layer changes 215 244 // - nalu does not belong to first slice in layer 216 // - nalu.isSlice() == true 217 245 // - nalu.isSlice() == true 246 247 #if H_MV_6_HRD_O0217_13 248 // Update TargetDecLayerIdList only when not specified by layer id file, specification by file might actually out of conformance. 249 if (nalu.m_nalUnitType == NAL_UNIT_VPS && m_targetDecLayerIdSetFileEmpty ) 250 { 251 TComVPS* vps = m_tDecTop[decIdx]->getPrefetchedVPS(); 252 if ( m_targetOptLayerSetIdx == -1 ) 253 { 254 // Not normative! Corresponds to specification by "External Means". (Should be set equal to 0, when no external means available. ) 255 m_targetOptLayerSetIdx = vps->getVpsNumLayerSetsMinus1(); 256 } 257 258 m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx ); 259 } 260 #endif 261 #if H_MV_FIX_SKIP_PICTURES 262 bNewPicture = ( newSliceDiffLayer || newSliceDiffPoc ) && !sliceSkippedFlag; 263 if ( nalu.isSlice() && firstSlice && !sliceSkippedFlag ) 264 #else 218 265 bNewPicture = newSliceDiffLayer || newSliceDiffPoc; 219 220 266 if ( nalu.isSlice() && firstSlice ) 267 #endif 221 268 { 222 269 layerIdCurrPic = nalu.m_layerId; … … 832 879 { 833 880 Int decIdx = -1; 881 882 #if H_MV_6_LAYER_ID_32 883 if ( layerId > MAX_NUM_LAYER_IDS-1 ) 884 { 885 return decIdx; 886 } 887 #endif 888 834 889 if ( m_layerIdToDecIdx[ layerId ] != -1 ) 835 890 { … … 850 905 m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 851 906 m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 907 #if H_MV_LAYER_WISE_STARTUP 908 m_tDecTop[ decIdx ]->setLayerInitilizedFlags( m_layerInitilizedFlags ); 909 #endif 910 852 911 #if H_3D 853 912 m_tDecTop[ decIdx ]->setCamParsCollector( &m_cCamParsCollector ); -
branches/HTM-9.0-dev0/source/App/TAppDecoder/TAppDecTop.h
r655 r730 67 67 Int m_numDecoders; ///< number of decoder instances 68 68 TComPicLists m_ivPicLists; ///< picture buffers of decoder instances 69 #if H_MV_LAYER_WISE_STARTUP 70 Bool m_layerInitilizedFlags[ MAX_NUM_LAYER_IDS ]; ///< for layerwise startup 71 #endif 72 69 73 #else 70 74 TDecTop m_cTDecTop; ///< decoder class -
branches/HTM-9.0-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
r724 r730 391 391 ("VpsNumLayerSets", m_vpsNumLayerSets , 1 , "Number of layer sets") 392 392 ("LayerIdsInSet_%d", m_layerIdsInSets , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set") 393 #if H_MV_6_PS_0109_25 394 ("DefaultOneTargetOutputLayerFlag" , m_defaultOneTargetOutputLayerIdc , 0, "Output highest layer of layer sets by default") 395 #else 393 396 ("DefaultOneTargetOutputLayerFlag", m_defaultOneTargetOutputLayerFlag, false , "Output highest layer of layer sets by default") 397 #endif 394 398 ("OutputLayerSetIdx", m_outputLayerSetIdx , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets") 395 399 ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers") … … 448 452 ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") 449 453 450 // Coding structure paramters 454 // Coding structure parameters 455 #if H_MV_LAYER_WISE_STARTUP 456 ("IntraPeriod,-ip", m_iIntraPeriod,std::vector<Int>(1,-1), "Intra period in frames, (-1: only first frame), per layer") 457 #else 451 458 ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") 459 #endif 452 460 ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") 453 461 ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") … … 624 632 625 633 #if H_MV 634 635 #if H_MV_6_HRD_O0217_13 636 // DBP Size 637 ("SubLayerFlagInfoPresentFlag", m_subLayerFlagInfoPresentFlag , false , "SubLayerFlagInfoPresentFlag") 638 #endif 626 639 // VPS VUI 627 640 ("VpsVuiPresentFlag" , m_vpsVuiPresentFlag , false , "VpsVuiPresentFlag ") 641 #if H_MV_6_PS_O0223_29 642 ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false , "CrossLayerPicTypeAlignedFlag") // Could actually be derived by the encoder 643 ("CrossLayerIrapAlignedFlag" , m_crossLayerIrapAlignedFlag , false , "CrossLayerIrapAlignedFlag ") // Could actually be derived by the encoder 644 #endif 628 645 ("BitRatePresentVpsFlag" , m_bitRatePresentVpsFlag , false , "BitRatePresentVpsFlag ") 629 646 ("PicRatePresentVpsFlag" , m_picRatePresentVpsFlag , false , "PicRatePresentVpsFlag ") … … 634 651 ("ConstantPicRateIdc" , m_constantPicRateIdc , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set") 635 652 ("AvgPicRate" , m_avgPicRate , std::vector< Int >(1,0) ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate per sub layer for the N-th layer set") 653 #if H_MV_6_O0226_37 654 ("TilesNotInUseFlag" , m_tilesNotInUseFlag , true , "TilesNotInUseFlag ") 655 ("TilesInUseFlag" , m_tilesInUseFlag , std::vector< Bool >(1,false) , "TilesInUseFlag ") 656 ("LoopFilterNotAcrossTilesFlag" , m_loopFilterNotAcrossTilesFlag , std::vector< Bool >(1,false) , "LoopFilterNotAcrossTilesFlag ") 657 ("WppNotInUseFlag" , m_wppNotInUseFlag , true , "WppNotInUseFlag ") 658 ("WppInUseFlag" , m_wppInUseFlag , std::vector< Bool >(1,0) , "WppInUseFlag ") 659 #endif 636 660 ("TileBoundariesAlignedFlag" , m_tileBoundariesAlignedFlag , std::vector< Bool >(1,0) ,MAX_NUM_LAYERS , "TileBoundariesAlignedFlag per direct reference for the N-th layer") 637 661 ("IlpRestrictedRefLayersFlag" , m_ilpRestrictedRefLayersFlag , false , "IlpRestrictedRefLayersFlag") … … 1050 1074 xResizeVector( m_bLoopFilterDisable ); 1051 1075 xResizeVector( m_bUseSAO ); 1052 1076 #if H_MV_LAYER_WISE_STARTUP 1077 xResizeVector( m_iIntraPeriod ); 1078 #endif 1079 #if H_MV_6_O0226_37 1080 xResizeVector( m_tilesInUseFlag ); 1081 xResizeVector( m_loopFilterNotAcrossTilesFlag ); 1082 xResizeVector( m_wppInUseFlag ); 1083 #endif 1053 1084 #else 1054 1085 m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ]; … … 1395 1426 for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++ ) 1396 1427 { 1428 #if H_MV_6_LAYER_ID_32 1429 xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than MAX_NUM_LAYER_IDS" ); 1430 #else 1397 1431 xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx].size() >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than and less than 64" ); 1432 #endif 1398 1433 } 1399 1434 } … … 1420 1455 } 1421 1456 } 1457 1458 #if H_MV_6_PS_0109_25 1459 xConfirmPara( m_defaultOneTargetOutputLayerIdc < 0 || m_defaultOneTargetOutputLayerIdc > 1, "Default one target output layer idc must be equal to 0 or equal to 1" ); 1460 #endif 1422 1461 xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" ); 1423 1462 … … 1436 1475 xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); 1437 1476 xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); 1477 #if H_MV_LAYER_WISE_STARTUP 1478 for( Int layer = 0; layer < m_numberOfLayers; layer++ ) 1479 { 1480 xConfirmPara( (m_iIntraPeriod[layer] > 0 && m_iIntraPeriod[layer] < m_iGOPSize) || m_iIntraPeriod[layer] == 0, "Intra period must be more than GOP size, or -1 , not 0" ); 1481 } 1482 #else 1438 1483 xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); 1484 #endif 1439 1485 xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2, "Decoding Refresh Type must be equal to 0, 1 or 2" ); 1440 1486 #if H_MV … … 1462 1508 if (m_iDecodingRefreshType == 2) 1463 1509 { 1510 #if H_MV_LAYER_WISE_STARTUP 1511 for (Int i = 0; i < m_numberOfLayers; i++ ) 1512 { 1513 xConfirmPara( m_iIntraPeriod[i] > 0 && m_iIntraPeriod[i] <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 1514 } 1515 #else 1464 1516 xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); 1517 #endif 1465 1518 } 1466 1519 xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); … … 1721 1774 /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure 1722 1775 * This permits the ability to omit a GOP structure specification */ 1776 #if H_MV_LAYER_WISE_STARTUP 1777 if (m_iIntraPeriod[layer] == 1 && m_GOPList[0].m_POC == -1) { 1778 #else 1723 1779 if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { 1780 #endif 1724 1781 m_GOPList[0] = GOPEntry(); 1725 1782 m_GOPList[0].m_QPFactor = 1; … … 1746 1803 } 1747 1804 Int numOK=0; 1805 #if H_MV_LAYER_WISE_STARTUP 1806 xConfirmPara( m_iIntraPeriod[layer] >=0&&(m_iIntraPeriod[layer]%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); 1807 #else 1748 1808 xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); 1809 #endif 1749 1810 1750 1811 for(Int i=0; i<m_iGOPSize; i++) … … 1757 1818 1758 1819 #if H_MV 1820 #if H_MV_LAYER_WISE_STARTUP 1821 if ( (m_iIntraPeriod[layer] != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) ) 1822 #else 1759 1823 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable[layer]) ) 1824 #endif 1760 1825 #else 1761 1826 if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) … … 2282 2347 printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); 2283 2348 printf("Motion search range : %d\n", m_iSearchRange ); 2349 #if H_MV_LAYER_WISE_STARTUP 2350 xPrintParaVector( "Intra period", m_iIntraPeriod ); 2351 #else 2284 2352 printf("Intra period : %d\n", m_iIntraPeriod ); 2353 #endif 2285 2354 printf("Decoding refresh type : %d\n", m_iDecodingRefreshType ); 2286 2355 #if !H_MV -
branches/HTM-9.0-dev0/source/App/TAppEncoder/TAppEncCfg.h
r724 r730 89 89 Int m_vpsNumLayerSets; ///< Number of layer sets 90 90 std::vector< std::vector<Int> > m_layerIdsInSets; ///< LayerIds in vps of layer set 91 #if H_MV_6_PS_0109_25 92 Int m_defaultOneTargetOutputLayerIdc; ///< Output highest layer of layer sets by default when equal to 1 93 #else 91 94 Bool m_defaultOneTargetOutputLayerFlag; ///< Output highest layer of layer sets by default 95 #endif 92 96 std::vector<Int> m_outputLayerSetIdx; ///< Indices of layer sets used as additional output layer sets 93 97 std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers … … 98 102 std::vector< std::vector<Int> > m_dependencyTypes; ///< Dependency types of direct reference layers 99 103 104 #if H_MV_6_HRD_O0217_13 105 // DBP Size 106 Bool m_subLayerFlagInfoPresentFlag; 107 #endif 108 100 109 // VPS VUI 101 110 Bool m_vpsVuiPresentFlag; 111 #if H_MV_6_PS_O0223_29 112 Bool m_crossLayerPicTypeAlignedFlag; 113 Bool m_crossLayerIrapAlignedFlag; 114 #endif 102 115 Bool m_bitRatePresentVpsFlag; 103 116 Bool m_picRatePresentVpsFlag; … … 108 121 std::vector< std::vector<Int > > m_constantPicRateIdc; 109 122 std::vector< std::vector<Int > > m_avgPicRate; 123 #if H_MV_6_O0226_37 124 Bool m_tilesNotInUseFlag; 125 std::vector< Bool > m_tilesInUseFlag; 126 std::vector< Bool > m_loopFilterNotAcrossTilesFlag; 127 Bool m_wppNotInUseFlag; 128 std::vector< Bool > m_wppInUseFlag; 129 130 #endif 110 131 std::vector< std::vector<Bool > > m_tileBoundariesAlignedFlag; 111 132 Bool m_ilpRestrictedRefLayersFlag; … … 175 196 176 197 // coding structure 198 #if H_MV_LAYER_WISE_STARTUP 199 std::vector<Int> m_iIntraPeriod; ///< period of I-slice (random access period) 200 #else 177 201 Int m_iIntraPeriod; ///< period of I-slice (random access period) 202 #endif 178 203 Int m_iDecodingRefreshType; ///< random access type 179 204 Int m_iGOPSize; ///< GOP size of hierarchical structure 180 205 #if H_MV 181 206 Int m_extraRPSsMvc[MAX_NUM_LAYERS]; ///< extra RPSs added to handle CRA for each layer 182 std::vector< GOPEntry* > m_GOPListMvc; 207 std::vector< GOPEntry* > m_GOPListMvc; ///< the coding structure entries from the config file for each layer 183 208 Int m_numReorderPicsMvc[MAX_NUM_LAYERS][MAX_TLAYER]; ///< total number of reorder pictures for each layer 184 209 Int m_maxDecPicBufferingMvc[MAX_NUM_LAYERS][MAX_TLAYER]; ///< total number of reference pictures needed for decoding for each layer -
branches/HTM-9.0-dev0/source/App/TAppEncoder/TAppEncTop.cpp
r724 r730 36 36 */ 37 37 38 38 39 #include <list> 39 40 #include <fstream> … … 118 119 xSetLayerIds ( vps ); 119 120 xSetDimensionIdAndLength ( vps ); 120 xSetDependencies ( vps );121 xSetDependencies ( vps ); 121 122 xSetProfileTierLevel ( vps ); 122 123 xSetRepFormat ( vps ); … … 127 128 m_ivPicLists.setVPS ( &vps ); 128 129 #endif 129 130 130 131 131 for(Int layerIdInVps = 0; layerIdInVps < m_numberOfLayers; layerIdInVps++) … … 216 216 217 217 m_cTEncTop.setIvPicLists ( &m_ivPicLists ); 218 #endif// H_MV218 // H_MV 219 219 m_cTEncTop.setVPS(&vps); 220 220 … … 234 234 235 235 //====== Coding Structure ======== 236 #if H_MV_LAYER_WISE_STARTUP 237 m_cTEncTop.setIntraPeriod ( m_iIntraPeriod[ layerIdInVps ] ); 238 #else 236 239 m_cTEncTop.setIntraPeriod ( m_iIntraPeriod ); 240 #endif 237 241 m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType ); 238 242 m_cTEncTop.setGOPSize ( m_iGOPSize ); … … 1324 1328 vps.setDimensionIdLen( dim, m_dimensionIdLen[ dim ] ); 1325 1329 for( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ ) 1326 1327 1330 { 1328 1331 vps.setDimensionId( layer, dim, m_dimIds[ dim ][ layer ] ); … … 1332 1335 Int maxViewId = xGetMax( m_viewId ); 1333 1336 1337 #if H_MV_6_PS_O0109_22 1338 Int viewIdLen = gCeilLog2( maxViewId + 1 ); 1339 const Int maxViewIdLen = ( 1 << 4 ) - 1; 1340 assert( viewIdLen <= maxViewIdLen ); 1341 vps.setViewIdLen( viewIdLen ); 1342 #else 1334 1343 Int viewIdLenMinus1 = std::max( gCeilLog2( maxViewId + 1 ) - 1, 0 ) ; 1335 1344 const Int maxViewIdLenMinus1 = ( 1 << 4 ) - 1; 1336 1345 assert( viewIdLenMinus1 <= maxViewIdLenMinus1 ); 1337 1346 vps.setViewIdLenMinus1( viewIdLenMinus1 ); 1347 #endif 1338 1348 for (Int i = 0; i < m_iNumberOfViews; i++) 1339 1349 { … … 1354 1364 vps.setDirectDependencyType( depLayer, refLayer, -1 ); 1355 1365 } 1356 } 1366 } 1367 1368 #if H_MV_6_PS_O0096_21 1369 Int defaultDirectDependencyType = -1; 1370 Bool defaultDirectDependencyFlag = true; 1371 #endif 1357 1372 for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ ) 1358 1373 { … … 1363 1378 Int refLayer = m_directRefLayers[depLayer][i]; 1364 1379 vps.setDirectDependencyFlag( depLayer, refLayer, true); 1380 #if H_MV_6_PS_O0096_21 1381 Int curDirectDependencyType = m_dependencyTypes[depLayer][i]; 1382 1383 if ( defaultDirectDependencyType != -1 ) 1384 { 1385 defaultDirectDependencyFlag = defaultDirectDependencyFlag && (curDirectDependencyType == defaultDirectDependencyType ); 1386 } 1387 else 1388 { 1389 defaultDirectDependencyType = curDirectDependencyType; 1390 } 1391 1392 vps.setDirectDependencyType( depLayer, refLayer, curDirectDependencyType); 1393 #else 1365 1394 vps.setDirectDependencyType( depLayer, refLayer,m_dependencyTypes[depLayer][i]); 1366 } 1367 } 1395 #endif 1396 } 1397 } 1398 1399 #if H_MV_6_PS_O0096_21 1400 vps.setDefaultDirectDependencyFlag( defaultDirectDependencyFlag ); 1401 vps.setDefaultDirectDependencyType( defaultDirectDependencyFlag ? defaultDirectDependencyType : -1 ); 1402 #endif 1403 1404 #if H_MV_6_ILDSD_O0120_26 1405 // Max sub layers, + presence flag 1406 Bool subLayersMaxMinus1PresentFlag = false; 1407 Int subLayersMaxMinus1 = -1; 1408 for (Int curLayerIdInVps = 0; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++ ) 1409 { 1410 Int curSubLayersMaxMinus1 = -1; 1411 for( Int i = 0; i < getGOPSize(); i++ ) 1412 { 1413 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i]; 1414 curSubLayersMaxMinus1 = std::max( curSubLayersMaxMinus1, geCur.m_temporalId ); 1415 } 1416 1417 vps.setSubLayersVpsMaxMinus1( curLayerIdInVps, curSubLayersMaxMinus1 ); 1418 if ( subLayersMaxMinus1 == -1 ) 1419 { 1420 subLayersMaxMinus1 = curSubLayersMaxMinus1; 1421 } 1422 else 1423 { 1424 subLayersMaxMinus1PresentFlag = subLayersMaxMinus1PresentFlag || ( curSubLayersMaxMinus1 != subLayersMaxMinus1 ); 1425 } 1426 } 1427 1428 vps.setVpsSubLayersMaxMinus1PresentFlag( subLayersMaxMinus1PresentFlag ); 1429 #endif 1430 1368 1431 1369 1432 // Max temporal id for inter layer reference pictures + presence flag 1370 1433 Bool maxTidRefPresentFlag = false; 1371 1434 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1372 { 1435 { 1436 #if !H_MV_6_ILDDS_O0225_30 1373 1437 Int maxTid = -1; 1438 #endif 1374 1439 for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++) 1375 { 1440 { 1441 #if H_MV_6_ILDDS_O0225_30 1442 Int maxTid = -1; 1443 #endif 1376 1444 for( Int i = 0; i < getGOPSize(); i++ ) 1377 1445 { … … 1387 1455 } 1388 1456 } 1457 #if H_MV_6_ILDDS_O0225_30 1458 vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 ); 1459 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1460 } 1461 #else 1389 1462 } 1390 1463 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1391 1464 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1465 #endif 1392 1466 } 1393 1467 1394 1468 vps.setMaxTidRefPresentFlag( maxTidRefPresentFlag ); 1469 1395 1470 // Max one active ref layer flag 1396 1471 Bool maxOneActiveRefLayerFlag = true; … … 1402 1477 maxOneActiveRefLayerFlag = maxOneActiveRefLayerFlag && (ge.m_numActiveRefLayerPics <= 1); 1403 1478 } 1404 }1479 } 1405 1480 1406 1481 vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); 1407 1408 1482 1483 // Poc Lsb Not Present Flag 1484 #if H_MV_6_MISC_O0062_31 1485 for ( Int layerIdInVps = 1; layerIdInVps < m_numberOfLayers; layerIdInVps++) 1486 { 1487 if ( m_directRefLayers[ layerIdInVps ].size() == 0 ) 1488 { 1489 vps.setPocLsbNotPresentFlag( layerIdInVps, true ); 1490 } 1491 } 1492 #endif 1493 1409 1494 // All Ref layers active flag 1410 1495 Bool allRefLayersActiveFlag = true; … … 1414 1499 { 1415 1500 GOPEntry ge = m_GOPListMvc[layerIdInVps][ ( i < getGOPSize() ? i : MAX_GOP ) ]; 1501 #if H_MV_6_ILDDS_ILREFPICS_27_34 1502 Int tId = ge.m_temporalId; // Should be equal for all layers. 1503 1504 // check if all reference layers when allRefLayerActiveFlag is equal to 1 are reference layer pictures specified in the gop entry 1505 for (Int k = 0; k < m_directRefLayers[ layerIdInVps].size() && allRefLayersActiveFlag; k++ ) 1506 { 1507 Int refLayerIdInVps = vps.getLayerIdInVps( m_directRefLayers[ layerIdInVps ][ k ] ); 1508 if ( vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId && vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId ) 1509 { 1510 Bool gopEntryFoundFlag = false; 1511 for( Int l = 0; l < ge.m_numActiveRefLayerPics && !gopEntryFoundFlag; l++ ) 1512 { 1513 gopEntryFoundFlag = gopEntryFoundFlag || ( ge.m_interLayerPredLayerIdc[l] == k ); 1514 } 1515 allRefLayersActiveFlag = allRefLayersActiveFlag && gopEntryFoundFlag; 1516 } 1517 } 1518 1519 // check if all inter layer reference pictures specified in the gop entry are valid reference layer pictures when allRefLayerActiveFlag is equal to 1 1520 // (Should actually always be true) 1521 Bool maxTidIlRefAndSubLayerMaxVaildFlag = true; 1522 for( Int l = 0; l < ge.m_numActiveRefLayerPics; l++ ) 1523 { 1524 Bool referenceLayerFoundFlag = false; 1525 for (Int k = 0; k < m_directRefLayers[ layerIdInVps].size(); k++ ) 1526 { 1527 Int refLayerIdInVps = vps.getLayerIdInVps( m_directRefLayers[ layerIdInVps ][ k ] ); 1528 1529 if ( vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId && vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId ) 1530 { 1531 referenceLayerFoundFlag = referenceLayerFoundFlag || ( ge.m_interLayerPredLayerIdc[l] == k ); 1532 } 1533 } 1534 maxTidIlRefAndSubLayerMaxVaildFlag = maxTidIlRefAndSubLayerMaxVaildFlag && referenceLayerFoundFlag; 1535 } 1536 assert ( maxTidIlRefAndSubLayerMaxVaildFlag ); // Something wrong with MaxTidIlRefPicsPlus1 or SubLayersVpsMaxMinus1 1537 #else 1416 1538 allRefLayersActiveFlag = allRefLayersActiveFlag && (ge.m_numActiveRefLayerPics == m_directRefLayers[ layerIdInVps ].size() ); 1539 #endif 1417 1540 } 1418 1541 } … … 1420 1543 vps.setAllRefLayersActiveFlag( allRefLayersActiveFlag ); 1421 1544 1545 #if !H_MV_6_PS_O0223_29 1422 1546 // Currently cross layer irap aligned is always true. 1423 1547 vps.setCrossLayerIrapAlignedFlag( true ); 1548 #endif 1424 1549 vps.setRefLayers(); 1425 1550 }; … … 1491 1616 repFormat->setPicHeightVpsInLumaSamples ( m_iSourceHeight ); 1492 1617 repFormat->setPicWidthVpsInLumaSamples ( m_iSourceWidth ); 1618 #if H_MV_6_PS_REP_FORM_18_19_20 1619 repFormat->setChromaAndBitDepthVpsPresentFlag( true ); 1620 #endif 1493 1621 // ToDo not supported yet. 1494 1622 //repFormat->setSeparateColourPlaneVpsFlag( ); … … 1496 1624 assert( vps.getRepFormat( 0 ) == NULL ); 1497 1625 vps.setRepFormat( 0 , repFormat ); 1498 1626 1499 1627 for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) 1500 1628 { … … 1502 1630 } 1503 1631 } 1632 1633 #if H_MV_6_HRD_O0217_13 1634 Void TAppEncTop::xSetDpbSize ( TComVPS& vps ) 1635 { 1636 // These settings need to be verified 1637 1638 TComDpbSize* dpbSize = vps.getDpbSize(); 1639 1640 assert ( dpbSize != 0 ); 1641 1642 for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ ) 1643 { 1644 std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); 1645 dpbSize->setSubLayerFlagInfoPresentFlag( i, m_subLayerFlagInfoPresentFlag ); 1646 1647 if ( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ) 1648 { 1649 for( Int j = 0; j <= vps.getMaxTLayers() - 1 ; j++ ) 1650 { 1651 Int maxNumReorderPics = MIN_INT; 1652 Int maxDecPicBuffering = MIN_INT; 1653 Int maxLatencyIncrease = MIN_INT; 1654 1655 Int prevMaxNumReorderPics = MIN_INT; 1656 Int prevMaxDecPicBuffering = MIN_INT; 1657 Int prevMaxLatencyIncrease = MIN_INT; 1658 1659 assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() ); 1660 for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1661 { 1662 Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] ); 1663 dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 ); 1664 } 1665 1666 for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ ) 1667 { 1668 Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[ idx ] ); 1669 maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] ); 1670 } 1671 assert( maxNumReorderPics != MIN_INT ); 1672 dpbSize->setMaxVpsNumReorderPics( i, j, maxNumReorderPics ); 1673 1674 // To Be Done ! 1675 // dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode ); 1676 1677 if( j > 0 ) 1678 { 1679 dpbSize->setSubLayerDpbInfoPresentFlag( i, j, prevMaxDecPicBuffering == maxDecPicBuffering && prevMaxLatencyIncrease == maxLatencyIncrease && prevMaxNumReorderPics == maxNumReorderPics ); 1680 } 1681 1682 prevMaxNumReorderPics = maxNumReorderPics; 1683 prevMaxDecPicBuffering = maxDecPicBuffering; 1684 prevMaxLatencyIncrease = maxLatencyIncrease; 1685 } 1686 } 1687 } 1688 } 1689 #endif 1690 1504 1691 1505 1692 Void TAppEncTop::xSetLayerSets( TComVPS& vps ) … … 1520 1707 } 1521 1708 } 1709 #if H_MV_6_HRD_O0217_13 1710 vps.deriveLayerSetLayerIdList(); 1711 #endif 1522 1712 1523 1713 Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size(); 1524 1714 // Additional output layer sets + profileLevelTierIdx 1715 #if H_MV_6_PS_0109_25 1716 vps.setDefaultOneTargetOutputLayerIdc ( m_defaultOneTargetOutputLayerIdc ); 1717 #else 1525 1718 vps.setDefaultOneTargetOutputLayerFlag ( m_defaultOneTargetOutputLayerFlag ); 1719 #endif 1526 1720 vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets != 0 ); 1527 1721 vps.setNumAddOutputLayerSetsMinus1 ( numAddOuputLayerSets - 1 ); 1528 1722 1723 1724 1725 #if H_MV_6_HRD_O0217_13 1726 for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++) 1727 { 1728 if ( lsIdx > 0 ) 1729 { 1730 vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] ); 1731 } 1732 1733 vps.setOutputLayerSetIdxMinus1( lsIdx, lsIdx - 1 ); 1734 1735 for (Int i = 0; i < m_layerIdsInSets[ lsIdx ].size(); i++ ) 1736 { 1737 vps.setOutputLayerFlag( lsIdx, i, vps.inferOutputLayerFlag( lsIdx, i )); 1738 } 1739 } 1740 #else 1529 1741 for (Int lsIdx = 1; lsIdx < m_vpsNumLayerSets; lsIdx++) 1530 1742 { 1531 1743 vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] ); 1532 1744 } 1745 #endif 1533 1746 1534 1747 for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ ) … … 1553 1766 } 1554 1767 } 1768 #if H_MV_6_HRD_O0217_13 1769 vps.deriveTargetLayerIdLists(); 1770 #endif 1555 1771 } 1556 1772 … … 1564 1780 1565 1781 assert( pcVPSVUI ); 1782 1783 1784 // All this stuff could actually be derived by the encoder, 1785 // however preliminary setting it from input parameters 1786 1787 #if H_MV_6_PS_O0223_29 1788 pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag ); 1789 pcVPSVUI->setCrossLayerIrapAlignedFlag ( m_crossLayerIrapAlignedFlag ); 1790 #endif 1566 1791 1567 1792 pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag ); … … 1602 1827 } 1603 1828 1829 #if H_MV_6_O0226_37 1830 pcVPSVUI->setTilesNotInUseFlag( m_tilesNotInUseFlag ); 1831 1832 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1833 { 1834 for( Int i = 0; i <= vps.getMaxLayersMinus1(); i++ ) 1835 { 1836 pcVPSVUI->setTilesInUseFlag( i, m_tilesInUseFlag[ i ] ); 1837 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1838 { 1839 pcVPSVUI->setLoopFilterNotAcrossTilesFlag( i, m_loopFilterNotAcrossTilesFlag[ i ] ); 1840 } 1841 } 1842 1843 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1844 { 1845 for( Int j = 0; j < vps.getNumDirectRefLayers( vps.getLayerIdInNuh( i ) ) ; j++ ) 1846 { 1847 Int layerIdx = vps.getLayerIdInVps( vps.getRefLayerId(vps.getLayerIdInNuh( i ) , j )); 1848 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1849 { 1850 pcVPSVUI->setTileBoundariesAlignedFlag( i, j, m_tileBoundariesAlignedFlag[i][j] ); 1851 } 1852 } 1853 } 1854 } 1855 1856 pcVPSVUI->setWppNotInUseFlag( m_wppNotInUseFlag ); 1857 1858 if( !pcVPSVUI->getWppNotInUseFlag( ) ) 1859 { 1860 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1861 { 1862 pcVPSVUI->setWppInUseFlag( i, m_wppInUseFlag[ i ]); 1863 } 1864 } 1865 #else 1604 1866 for( Int i = 1; i <= vps.getMaxLayersMinus1(); i++ ) 1605 1867 { … … 1612 1874 } 1613 1875 } 1876 #endif 1614 1877 1615 1878 pcVPSVUI->setIlpRestrictedRefLayersFlag( m_ilpRestrictedRefLayersFlag ); … … 1642 1905 } 1643 1906 } 1907 #if H_MV_6_PS_O0118_33 1908 pcVPSVUI->setVideoSignalInfoIdxPresentFlag( true ); 1909 pcVPSVUI->setVpsNumVideoSignalInfoMinus1 ( 0 ); 1910 1911 assert ( pcVPSVUI->getVideoSignalInfo( 0 ) == NULL ); 1912 1913 TComVideoSignalInfo* videoSignalInfo = new TComVideoSignalInfo; 1914 1915 videoSignalInfo->setColourPrimariesVps ( m_colourPrimaries ); 1916 videoSignalInfo->setMatrixCoeffsVps ( m_matrixCoefficients ); 1917 videoSignalInfo->setTransferCharacteristicsVps( m_transferCharacteristics ); 1918 videoSignalInfo->setVideoVpsFormat ( m_videoFormat ); 1919 videoSignalInfo->setVideoFullRangeVpsFlag ( m_videoFullRangeFlag ); 1920 1921 pcVPSVUI->setVideoSignalInfo( 0, videoSignalInfo ); 1922 1923 for (Int i = 0; i < m_numberOfLayers; i++) 1924 { 1925 pcVPSVUI->setVpsVideoSignalInfoIdx( i, 0 ); 1926 } 1927 #endif 1928 #if H_MV_6_HRD_O0164_15 1929 pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD 1930 #endif 1644 1931 } 1645 1932 } … … 1679 1966 if( vps.getUseDLTFlag( layer ) ) 1680 1967 { 1968 #if H_MV_LAYER_WISE_STARTUP 1969 xAnalyzeInputBaseDepth(layer, max( m_iIntraPeriod[layer], 24), &vps); 1970 #else 1681 1971 xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps); 1972 #endif 1682 1973 } 1683 1974 #endif … … 1716 2007 } 1717 2008 #endif 2009 #endif 1718 2010 //! \} -
branches/HTM-9.0-dev0/source/App/TAppEncoder/TAppEncTop.h
r655 r730 125 125 Void xSetProfileTierLevel ( TComVPS& vps ); 126 126 Void xSetRepFormat ( TComVPS& vps ); 127 #if H_MV_6_HRD_O0217_13 128 Void xSetDpbSize ( TComVPS& vps ); 129 #endif 127 130 Void xSetVPSVUI ( TComVPS& vps ); 128 131 GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc ); -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/CommonDef.h
r725 r730 121 121 #define MAX_UINT 0xFFFFFFFFU ///< max. value of unsigned 32-bit integer 122 122 #define MAX_INT 2147483647 ///< max. value of signed 32-bit integer 123 #if H_3D124 123 #define MIN_INT (-2147483647-1) // < min. value of signed 32-bit integer 125 #endif 124 126 125 #define MAX_INT64 0x7FFFFFFFFFFFFFFFLL ///< max. value of signed 64-bit integer 127 126 #define MAX_DOUBLE 1.7e+308 ///< max. value of double-type value -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComPic.cpp
r655 r730 503 503 { 504 504 if ( legend ) 505 std::cout << "LId" << "\t" << "POC" << "\t" << "Rec" << "\t" << "Ref" << "\t" << "LT"<< std::endl;505 std::cout << std::endl << "LId" << "\t" << "POC" << "\t" << "Rec" << "\t" << "Ref" << "\t" << "LT" << "\t" << "OutMark" << "\t" << "OutFlag" << std::endl; 506 506 else 507 std::cout << getLayerId() << "\t" << getPOC()<< "\t" << getReconMark() << "\t" << getSlice(0)->isReferenced() << "\t" << getIsLongTerm() << std::endl;507 std::cout << getLayerId() << "\t" << getPOC()<< "\t" << getReconMark() << "\t" << getSlice(0)->isReferenced() << "\t" << getIsLongTerm() << "\t" << getOutputMark() << "\t" << getSlice(0)->getPicOutputFlag() <<std::endl; 508 508 } 509 509 … … 524 524 return pcPic; 525 525 } 526 527 526 #if H_3D 528 527 TComPic* TComPicLists::getPic( Int viewIndex, Bool depthFlag, Int poc ) … … 530 529 return getPic ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc ); 531 530 } 532 531 #endif 533 532 Void TComPicLists::print() 534 533 { … … 571 570 } 572 571 572 #if H_3D 573 573 TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon ) 574 574 { … … 576 576 return getPicYuv( layerIdInNuh, poc, recon ); 577 577 } 578 578 579 #if H_3D_ARP 579 580 TComList<TComPic*>* TComPicLists::getPicList( Int layerIdInNuh ) … … 593 594 } 594 595 #endif 595 #endif // H_3D596 #endif 596 597 #endif // H_MV 597 598 -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComRom.cpp
r724 r730 573 573 #if H_MV_ENC_DEC_TRAC 574 574 #if ENC_DEC_TRACE 575 #if H_MV_FIX_TRACE_FILE 576 Void writeToTraceFile( const Char* symbolName, Int val, Bool doIt ) 577 #else 575 578 Void writeToTraceFile( Char* symbolName, Int val, Bool doIt ) 579 #endif 576 580 { 577 581 if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt ) … … 588 592 } 589 593 594 #if H_MV_FIX_TRACE_FILE 595 Void writeToTraceFile( const Char* symbolName, Bool doIt ) 596 #else 590 597 Void writeToTraceFile( Char* symbolName, Bool doIt ) 598 #endif 591 599 { 592 600 if ( ( ( g_nSymbolCounter >= COUNTER_START && g_nSymbolCounter <= COUNTER_END )|| g_bJustDoIt ) && doIt ) -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComRom.h
r724 r730 236 236 237 237 238 #if H_MV_FIX_TRACE_FILE 239 Void writeToTraceFile( const Char* symbolName, Int val, Bool doIt ); 240 Void writeToTraceFile( const Char* symbolName, Bool doIt ); 241 #else 238 242 Void writeToTraceFile( Char* symbolName, Int val, Bool doIt ); 239 243 Void writeToTraceFile( Char* symbolName, Bool doIt ); 244 #endif 240 245 #endif 241 246 #else -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r724 r730 110 110 #endif 111 111 , m_pocResetFlag (false) 112 #if H_MV_6_RALS_O0149_11 113 , m_crossLayerBlaFlag (false) 114 #endif 112 115 , m_discardableFlag (false) 113 116 , m_interLayerPredEnabledFlag (false) … … 148 151 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 149 152 { 150 m_interLayerPredLayerIdc[ i ] = i;153 m_interLayerPredLayerIdc[ i ] = -1; 151 154 } 152 155 #endif … … 1709 1712 , m_hrdOpSetIdx (NULL) 1710 1713 , m_cprmsPresentFlag (NULL) 1714 #if H_MV_6_HRD_O0217_13 1715 , m_dpbSize (NULL) 1716 #endif 1711 1717 #if H_MV 1712 , m_vpsVUI ( NULL)1718 , m_vpsVUI (NULL) 1713 1719 #endif 1714 1720 { … … 1724 1730 for( Int layerId = 0; layerId < MAX_VPS_NUH_LAYER_ID_PLUS1; layerId++ ) 1725 1731 { 1732 #if H_MV_6_HRD_O0217_13 1733 m_layerIdIncludedFlag[lsIdx][layerId] = (( lsIdx == 0 ) && ( layerId == 0 )) ; 1734 #else 1726 1735 m_layerIdIncludedFlag[lsIdx][layerId] = false; 1736 #endif 1727 1737 } 1728 1738 } … … 1738 1748 m_moreOutputLayerSetsThanDefaultFlag = false; 1739 1749 m_numAddOutputLayerSetsMinus1 = -1; 1750 #if H_MV_6_PS_0109_25 1751 m_defaultOneTargetOutputLayerIdc = 0; 1752 #else 1740 1753 m_defaultOneTargetOutputLayerFlag = false; 1754 #endif 1741 1755 1742 1756 for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++) … … 1748 1762 m_outputLayerFlag[i][j] = false; 1749 1763 } 1750 } 1751 1764 } 1765 #if H_MV_6_GEN_0153_28 1766 m_altOutputLayerFlag = false; 1767 #endif 1752 1768 m_maxOneActiveRefLayerFlag = false; 1753 1769 m_directDepTypeLenMinus2 = 0; … … 1786 1802 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1787 1803 m_numDirectRefLayers[i] = 0; 1804 #if !H_MV_6_ILDDS_O0225_30 1788 1805 m_maxTidIlRefPicPlus1[i] = 7; 1806 #endif 1789 1807 m_vpsRepFormatIdx [i] = 0; 1808 #if H_MV_6_MISC_O0062_31 1809 m_pocLsbNotPresentFlag[i] = 0; 1810 #endif 1790 1811 m_repFormat [i] = NULL; 1791 1812 m_viewIdVal [i] = 0; … … 1821 1842 m_directDependencyType[i][j] = -1; 1822 1843 m_refLayerId[i][j] = -1; 1844 #if H_MV_6_ILDDS_O0225_30 1845 m_maxTidIlRefPicsPlus1[i][j] = 7; 1846 #endif 1823 1847 } 1824 1848 … … 1833 1857 } 1834 1858 m_vpsVUI = new TComVPSVUI; 1859 #if H_MV_6_HRD_O0217_13 1860 m_dpbSize = new TComDpbSize; 1861 #endif 1862 # 1835 1863 #if H_3D 1836 1864 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1866 1894 #if H_MV 1867 1895 if ( m_vpsVUI != NULL ) delete m_vpsVUI; 1896 #if H_MV_6_HRD_O0217_13 1897 if ( m_dpbSize != NULL ) delete m_dpbSize; 1898 #endif 1899 1868 1900 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 1869 1901 { … … 2068 2100 assert( lsIdx >= 0 ); 2069 2101 assert( lsIdx <= getVpsNumLayerSetsMinus1() ); 2102 #if H_MV_6_HRD_O0217_13 2103 return (Int) m_layerSetLayerIdList[ lsIdx ].size(); 2104 #else 2070 2105 Int numLayersInIdList = 0; 2071 2106 for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ ) … … 2073 2108 numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) ); 2074 2109 } 2110 2075 2111 return numLayersInIdList; 2076 } 2112 #endif 2113 } 2114 2115 #if H_MV_6_HRD_O0217_13 2116 Int TComVPS::getNumOutputLayerSets() 2117 { 2118 Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1; 2119 if ( getMoreOutputLayerSetsThanDefaultFlag( ) ) 2120 { 2121 numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1); 2122 } 2123 return numOutputLayerSets; 2124 } 2125 #endif 2126 2077 2127 Int TComVPS::getNumViews() 2078 2128 { … … 2104 2154 return dependentFlag; 2105 2155 } 2156 2157 #if H_MV_6_HRD_O0217_13 2158 Void TComVPS::deriveLayerSetLayerIdList() 2159 { 2160 m_layerSetLayerIdList.resize( getVpsNumLayerSetsMinus1() + 1 ); 2161 for (Int i = 0; i <= getVpsNumLayerSetsMinus1(); i++ ) 2162 { 2163 for( Int m = 0; m <= getVpsMaxLayerId(); m++ ) 2164 { 2165 if( getLayerIdIncludedFlag( i, m) ) 2166 { 2167 m_layerSetLayerIdList[ i ].push_back( m ); 2168 } 2169 } 2170 } 2171 } 2172 2173 Void TComVPS::deriveTargetLayerIdLists() 2174 { 2175 m_targetDecLayerIdLists.resize( getNumOutputLayerSets() ); 2176 m_targetOptLayerIdLists.resize( getNumOutputLayerSets() ); 2177 2178 for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ ) 2179 { 2180 Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1; 2181 Int lsIdx = targetDecLayerSetIdx; 2182 2183 for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ ) 2184 { 2185 m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2186 if( getOutputLayerFlag( targetOptLayerSetIdx, j )) // This seems to be wrong in draft text 2187 { 2188 m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2189 } 2190 } 2191 } 2192 } 2193 #endif 2106 2194 #endif // H_MV 2107 2195 … … 2157 2245 , m_spsInferScalingListFlag ( false ) 2158 2246 , m_spsScalingListRefLayerId ( 0 ) 2247 2248 #if !H_MV_6_PS_REP_FORM_18_19_20 2159 2249 , m_updateRepFormatFlag ( true ) 2250 #else 2251 , m_updateRepFormatFlag ( false ) 2252 , m_spsRepFormatIdx ( 0 ) 2253 #endif 2160 2254 , m_interViewMvVertConstraintFlag (false) 2161 2255 #endif … … 2173 2267 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2174 2268 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2269 #if H_MV_6_PSEM_O0142_3 2270 m_spsExtensionFlag = false; 2271 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 2272 { 2273 m_spsExtensionTypeFlag[ i ] = false; 2274 } 2275 #endif 2276 #if H_MV_6_SHVC_O0098_36 2277 m_numScaledRefLayerOffsets = 0; 2278 2279 for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ ) 2280 { 2281 m_scaledRefLayerId [i] = -1; 2282 } 2283 2284 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2285 { 2286 m_scaledRefLayerLeftOffset [i] = 0; 2287 m_scaledRefLayerTopOffset [i] = 0; 2288 m_scaledRefLayerRightOffset [i] = 0; 2289 m_scaledRefLayerBottomOffset [i] = 0; 2290 } 2291 #endif 2175 2292 } 2176 2293 … … 2353 2470 if ( layerIdCurr > 0 ) 2354 2471 { 2472 #if H_MV_6_PS_REP_FORM_18_19_20 2473 Int repFormatIdx = getUpdateRepFormatFlag() ? getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ; 2474 TComRepFormat* repFormat = vps->getRepFormat( repFormatIdx ); 2475 #else 2355 2476 TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 2477 2356 2478 if ( !getUpdateRepFormatFlag() ) 2357 2479 { 2480 #endif 2358 2481 setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() ); 2359 2482 //// ToDo: add when supported: … … 2368 2491 setBitDepthC ( repFormat->getBitDepthVpsChromaMinus8() + 8 ); 2369 2492 setQpBDOffsetC ( (Int) (6* ( getBitDepthC() -8 ) ) ); 2493 #if !H_MV_6_PS_REP_FORM_18_19_20 2370 2494 } 2371 2495 else 2496 #else 2497 if ( getLayerId() > 0 && getUpdateRepFormatFlag() ) 2498 #endif 2372 2499 { 2373 2500 assert( getChromaFormatIdc() <= repFormat->getChromaFormatVpsIdc() ); … … 2398 2525 } 2399 2526 } 2527 2400 2528 #endif 2401 2529 #if H_3D … … 2668 2796 #if H_MV 2669 2797 Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ) 2670 { 2798 { 2671 2799 refPicSetInterLayer0.clear(); 2672 2800 refPicSetInterLayer1.clear(); … … 2713 2841 2714 2842 } 2843 2844 2715 2845 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 2716 2846 { 2717 // Fill targetDecLayerIdSet with all layers if empty .2847 // Fill targetDecLayerIdSet with all layers if empty (at encoder side) 2718 2848 if (targetDecLayerIdSet.size() == 0 ) 2719 2849 { … … 2722 2852 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); 2723 2853 } 2724 } 2854 } 2725 2855 2726 2856 Int numTargetDecLayers = (Int) targetDecLayerIdSet.size(); … … 2731 2861 { 2732 2862 break; 2863 } 2733 2864 } 2734 }2735 2865 2736 2866 for( Int i = 0; i <= latestDecIdx; i++ ) … … 2739 2869 { 2740 2870 TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc ); 2741 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 2742 { 2743 Bool remainingInterLayerReferencesFlag = false; 2744 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 2871 #if H_MV_LAYER_WISE_STARTUP 2872 if ( pcPic ) 2873 { 2874 #endif 2875 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 2745 2876 { 2746 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 2747 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 2877 Bool remainingInterLayerReferencesFlag = false; 2878 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 2879 { 2880 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 2881 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 2882 { 2883 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 2884 { 2885 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 2886 { 2887 remainingInterLayerReferencesFlag = true; 2888 } 2889 } 2890 } 2891 } 2892 if( !remainingInterLayerReferencesFlag ) 2748 2893 { 2749 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 2750 { 2751 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 2752 { 2753 remainingInterLayerReferencesFlag = true; 2894 pcPic->getSlice(0)->setReferenced( false ); 2754 2895 } 2755 2896 } 2756 } 2757 } 2758 if( !remainingInterLayerReferencesFlag ) 2759 { 2760 pcPic->getSlice(0)->setReferenced( false ); 2761 } 2762 } 2763 } 2764 } 2897 #if H_MV_LAYER_WISE_STARTUP 2898 } 2899 #endif 2900 } 2901 } 2765 2902 } 2766 2903 … … 2773 2910 { 2774 2911 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true ); 2775 2912 2776 2913 m_apcRefPicList[li][rIdx]->print( false ); 2777 2914 } … … 2816 2953 return pcPic; 2817 2954 } 2955 2956 2957 #if H_MV_6_ILDDS_ILREFPICS_27_34 2958 Int TComSlice::getRefLayerPicFlag( Int i ) 2959 { 2960 TComVPS* vps = getVPS(); 2961 Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 2962 2963 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) && 2964 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 2965 2966 return refLayerPicFlag; 2967 } 2968 2969 Int TComSlice::getRefLayerPicIdc( Int j ) 2970 { 2971 Int refLayerPicIdc = -1; 2972 Int curj = 0; 2973 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2974 { 2975 if( getRefLayerPicFlag( i ) ) 2976 { 2977 if ( curj == j ) 2978 { 2979 refLayerPicIdc = i; 2980 break; 2981 } 2982 curj++; 2983 } 2984 } 2985 2986 assert( curj == j ); 2987 assert( refLayerPicIdc != -1 ); 2988 return refLayerPicIdc; 2989 } 2990 2991 Int TComSlice::getNumRefLayerPics( ) 2992 { 2993 Int numRefLayerPics = 0; 2994 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2995 { 2996 numRefLayerPics += getRefLayerPicFlag( i ); 2997 } 2998 return numRefLayerPics; 2999 } 3000 #endif 3001 3002 3003 2818 3004 Int TComSlice::getNumActiveRefLayerPics() 2819 3005 { … … 2826 3012 else if (getVPS()->getAllRefLayersActiveFlag() ) 2827 3013 { 3014 #if H_MV_6_ILDDS_ILREFPICS_27_34 3015 numActiveRefLayerPics = getNumRefLayerPics(); 3016 #else 2828 3017 numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() ); 3018 #endif 2829 3019 } 2830 3020 else if ( !getInterLayerPredEnabledFlag() ) … … 2834 3024 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 2835 3025 { 3026 #if H_MV_6_ILDDS_ILREFPICS_27_34 3027 numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0; 3028 #else 2836 3029 numActiveRefLayerPics = 1; 3030 #endif 2837 3031 } 2838 3032 else … … 3434 3628 TComVPSVUI::TComVPSVUI() 3435 3629 { 3630 #if H_MV_6_PS_O0223_29 3631 m_crossLayerIrapAlignedFlag = true; 3632 #endif 3436 3633 m_bitRatePresentVpsFlag = false; 3437 3634 m_picRatePresentVpsFlag = false; … … 3461 3658 } 3462 3659 } 3463 } 3464 #endif 3660 #if H_MV_6_PS_O0118_33 3661 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3662 { 3663 m_videoSignalInfo [i] = NULL; 3664 } 3665 #endif 3666 3667 #if H_MV_6_HRD_O0164_15 3668 m_vpsVuiBspHrdPresentFlag = false; 3669 m_vpsVuiBspHrdParameters = new TComVpsVuiBspHrdParameters(); 3670 #endif 3671 } 3672 3673 #if H_MV_6_PS_O0118_33 3674 TComVPSVUI::~TComVPSVUI() 3675 { 3676 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3677 { 3678 if (m_videoSignalInfo[ i ] != NULL ) delete m_videoSignalInfo[ i ]; 3679 m_videoSignalInfo [ i ] = NULL; 3680 } 3681 3682 #if H_MV_6_HRD_O0164_15 3683 if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters; 3684 m_vpsVuiBspHrdParameters = NULL; 3685 #endif 3686 } 3687 #endif 3688 3689 #if H_MV_6_PS_REP_FORM_18_19_20 3690 Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ) 3691 { 3692 if ( !encoderFlag ) 3693 { 3694 setChromaAndBitDepthVpsPresentFlag( prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3695 setSeparateColourPlaneVpsFlag ( prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3696 setBitDepthVpsLumaMinus8 ( prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3697 setBitDepthVpsChromaMinus8 ( prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3698 } 3699 else 3700 { 3701 assert( getChromaAndBitDepthVpsPresentFlag() == prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3702 assert( getSeparateColourPlaneVpsFlag () == prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3703 assert( getBitDepthVpsLumaMinus8 () == prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3704 assert( getBitDepthVpsChromaMinus8 () == prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3705 } 3706 } 3707 #endif 3708 3709 #if H_MV_6_HRD_O0164_15 3710 Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h ) 3711 { 3712 // It is a requirement of bitstream conformance that bitstream partition with index j shall not include 3713 // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j 3714 // in the range of 0 to num_bitstream_partitions[ h ] 1, inclusive, such that i is less than j. 3715 3716 for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ ) 3717 { 3718 for ( Int partI = 0; partI < partJ; partI++ ) 3719 { 3720 for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ ) 3721 { 3722 if ( m_layerInBspFlag[ h ][partJ][layerJ ] ) 3723 { 3724 for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ ) 3725 { 3726 if ( m_layerInBspFlag[ h ][partI][layerI] ) 3727 { 3728 assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) ); 3729 } 3730 } 3731 } 3732 } 3733 } 3734 } 3735 } 3736 #endif 3737 #endif -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComSlice.h
r724 r730 36 36 */ 37 37 38 38 39 #ifndef __TCOMSLICE__ 39 40 #define __TCOMSLICE__ … … 62 63 // ==================================================================================================================== 63 64 65 #if H_MV_6_HRD_O0164_15 66 class TComVPS; 67 #endif 64 68 /// Reference Picture Set class 65 69 class TComReferencePictureSet … … 403 407 404 408 #if H_MV 409 410 #if H_MV_6_PS_O0118_33 411 class TComVideoSignalInfo 412 { 413 private: 414 Int m_videoVpsFormat; 415 Bool m_videoFullRangeVpsFlag; 416 Int m_colourPrimariesVps; 417 Int m_transferCharacteristicsVps; 418 Int m_matrixCoeffsVps; 419 public: 420 Void setVideoVpsFormat( Int val ) { m_videoVpsFormat = val; } 421 Int getVideoVpsFormat( ) { return m_videoVpsFormat; } 422 423 Void setVideoFullRangeVpsFlag( Bool flag ) { m_videoFullRangeVpsFlag = flag; } 424 Bool getVideoFullRangeVpsFlag( ) { return m_videoFullRangeVpsFlag; } 425 426 Void setColourPrimariesVps( Int val ) { m_colourPrimariesVps = val; } 427 Int getColourPrimariesVps( ) { return m_colourPrimariesVps; } 428 429 Void setTransferCharacteristicsVps( Int val ) { m_transferCharacteristicsVps = val; } 430 Int getTransferCharacteristicsVps( ) { return m_transferCharacteristicsVps; } 431 432 Void setMatrixCoeffsVps( Int val ) { m_matrixCoeffsVps = val; } 433 Int getMatrixCoeffsVps( ) { return m_matrixCoeffsVps; } 434 }; 435 #endif 436 #if H_MV_6_HRD_O0164_15 437 class TComVpsVuiBspHrdParameters 438 { 439 private: 440 Int m_vpsNumBspHrdParametersMinus1; 441 Bool m_bspCprmsPresentFlag[MAX_NUM_BSP_HRD_PARAMETERS]; 442 Int m_numBitstreamPartitions[MAX_VPS_OP_SETS_PLUS1]; 443 Bool m_layerInBspFlag[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_LAYERS]; 444 Int m_numBspSchedCombinations[MAX_VPS_OP_SETS_PLUS1]; 445 Int m_bspCombHrdIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; 446 Int m_bspCombSchedIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; 447 TComHRD* m_hrdParameters[MAX_NUM_BSP_HRD_PARAMETERS]; 448 public: 449 450 Void setVpsNumBspHrdParametersMinus1( Int val ) { m_vpsNumBspHrdParametersMinus1 = val; } 451 Int getVpsNumBspHrdParametersMinus1( ) { return m_vpsNumBspHrdParametersMinus1; } 452 453 Void setBspCprmsPresentFlag( Int i, Bool flag ) { m_bspCprmsPresentFlag[i] = flag; } 454 Bool getBspCprmsPresentFlag( Int i ) { return m_bspCprmsPresentFlag[i]; } 455 456 Void setNumBitstreamPartitions( Int h, Int val ) { m_numBitstreamPartitions[h] = val; } 457 Int getNumBitstreamPartitions( Int h ) { return m_numBitstreamPartitions[h]; } 458 459 Void setLayerInBspFlag( Int h, Int i, Int j, Bool flag ) { m_layerInBspFlag[h][i][j] = flag; } 460 Bool getLayerInBspFlag( Int h, Int i, Int j ) { return m_layerInBspFlag[h][i][j]; } 461 Void checkLayerInBspFlag ( TComVPS* vps, Int h ); 462 463 Void setNumBspSchedCombinations( Int h, Int val ) { m_numBspSchedCombinations[h] = val; } 464 Int getNumBspSchedCombinations( Int h ) { return m_numBspSchedCombinations[h]; } 465 466 Void setBspCombHrdIdx( Int h, Int i, Int j, Int val ) { m_bspCombHrdIdx[h][i][j] = val; } 467 Int getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; } 468 469 Void setBspCombSchedIdx( Int h, Int i, Int j, Int val ) { m_bspCombSchedIdx[h][i][j] = val; } 470 Int getBspCombSchedIdx( Int h, Int i, Int j ) { return m_bspCombSchedIdx[h][i][j]; } 471 472 Void setHrdParametermeters( Int k, TComHRD* val ) { m_hrdParameters[k] = val; }; 473 TComHRD* getHrdParametermeters( Int k ) { return m_hrdParameters[k]; }; 474 }; 475 476 #endif 405 477 class TComVPSVUI 406 { 478 { 407 479 private: 480 #if H_MV_6_PS_O0223_29 481 Bool m_crossLayerPicTypeAlignedFlag; 482 Bool m_crossLayerIrapAlignedFlag; 483 #endif 408 484 Bool m_bitRatePresentVpsFlag; 409 485 Bool m_picRatePresentVpsFlag; … … 413 489 Int m_maxBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 414 490 Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 415 Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 491 Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 492 #if H_MV_6_O0226_37 493 Bool m_tilesNotInUseFlag; 494 Bool m_tilesInUseFlag [MAX_NUM_LAYERS]; 495 Bool m_loopFilterNotAcrossTilesFlag[MAX_NUM_LAYERS]; 496 #endif 416 497 Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 498 #if H_MV_6_O0226_37 499 Bool m_wppNotInUseFlag; 500 Bool m_wppInUseFlag [MAX_NUM_LAYERS]; 501 #endif 417 502 Bool m_ilpRestrictedRefLayersFlag; 418 503 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 419 504 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 420 505 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 506 #if H_MV_6_PS_O0118_33 507 Bool m_videoSignalInfoIdxPresentFlag; 508 Int m_vpsNumVideoSignalInfoMinus1; 509 TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO]; 510 Int m_vpsVideoSignalInfoIdx [MAX_NUM_VIDEO_SIGNAL_INFO]; 511 #endif 512 #if H_MV_6_HRD_O0164_15 513 Bool m_vpsVuiBspHrdPresentFlag; 514 TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters; 515 #endif 421 516 422 517 public: 423 TComVPSVUI();; 518 TComVPSVUI(); 519 ~TComVPSVUI(); 520 #if H_MV_6_PS_O0223_29 521 Void setCrossLayerPicTypeAlignedFlag( Bool flag ) { m_crossLayerPicTypeAlignedFlag = flag; } 522 Bool getCrossLayerPicTypeAlignedFlag( ) { return m_crossLayerPicTypeAlignedFlag; } 523 524 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 525 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 526 #endif 424 527 425 528 Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } … … 447 550 Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } 448 551 552 #if H_MV_6_O0226_37 553 Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; } 554 Bool getTilesNotInUseFlag( ) { return m_tilesNotInUseFlag; } 555 556 Void setTilesInUseFlag( Int i, Bool flag ) { m_tilesInUseFlag[i] = flag; } 557 Bool getTilesInUseFlag( Int i ) { return m_tilesInUseFlag[i]; } 558 559 Void setLoopFilterNotAcrossTilesFlag( Int i, Int val ) { m_loopFilterNotAcrossTilesFlag[i] = val; } 560 Bool getLoopFilterNotAcrossTilesFlag( Int i ) { return m_loopFilterNotAcrossTilesFlag[i]; } 561 #endif 562 449 563 Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } 450 564 Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } 451 565 566 #if H_MV_6_O0226_37 567 Void setWppNotInUseFlag( Bool flag ) { m_wppNotInUseFlag = flag; } 568 Bool getWppNotInUseFlag( ) { return m_wppNotInUseFlag; } 569 570 Void setWppInUseFlag( Int i, Bool flag ) { m_wppInUseFlag[i] = flag; } 571 Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; } 572 #endif 573 452 574 Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } 453 575 Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } … … 462 584 Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } 463 585 586 #if H_MV_6_PS_O0118_33 587 Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } 588 Bool getVideoSignalInfoIdxPresentFlag( ) { return m_videoSignalInfoIdxPresentFlag; } 589 590 Void setVideoSignalInfo( Int i, TComVideoSignalInfo* val ) { m_videoSignalInfo[i] = val; } 591 TComVideoSignalInfo* getVideoSignalInfo( Int i ) { return m_videoSignalInfo[i]; } 592 593 Void setVpsNumVideoSignalInfoMinus1( Int val ) { m_vpsNumVideoSignalInfoMinus1 = val; } 594 Int getVpsNumVideoSignalInfoMinus1( ) { return m_vpsNumVideoSignalInfoMinus1; } 595 596 Void setVpsVideoSignalInfoIdx( Int i, Int val ) { m_vpsVideoSignalInfoIdx[i] = val; } 597 Int getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } 598 #endif 599 600 #if H_MV_6_HRD_O0164_15 601 Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; } 602 Bool getVpsVuiBspHrdPresentFlag( ) { return m_vpsVuiBspHrdPresentFlag; } 603 604 Void setVpsVuiBspHrdParameters( TComVpsVuiBspHrdParameters* val) { m_vpsVuiBspHrdParameters = val; } 605 TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters( ) { return m_vpsVuiBspHrdParameters; } 606 #endif 464 607 }; 608 465 609 466 610 class TComRepFormat 467 611 { 468 612 private: 613 #if H_MV_6_PS_REP_FORM_18_19_20 614 Bool m_chromaAndBitDepthVpsPresentFlag; 615 #endif 469 616 Int m_chromaFormatVpsIdc; 470 617 Bool m_separateColourPlaneVpsFlag; … … 477 624 TComRepFormat() { }; 478 625 626 #if H_MV_6_PS_REP_FORM_18_19_20 627 Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; } 628 Bool getChromaAndBitDepthVpsPresentFlag( ) { return m_chromaAndBitDepthVpsPresentFlag; } 629 Void checkChromaAndBitDepthVpsPresentFlag( Int i ) { assert( i != 0 || m_chromaAndBitDepthVpsPresentFlag ); } // The value of chroma_and_bit_depth_vps_present_flag of the first rep_format( ) syntax structure in the VPS shall be equal to 1. 630 Void inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ); 631 #endif 632 479 633 Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } 480 634 Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } … … 494 648 Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } 495 649 Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } 650 }; 651 #endif 652 653 #if H_MV_6_HRD_O0217_13 654 class TComDpbSize 655 { 656 private: 657 Bool m_subLayerFlagInfoPresentFlag[MAX_VPS_OUTPUTLAYER_SETS]; 658 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; 659 Int m_maxVpsDecPicBufferingMinus1[MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYER_IDS][MAX_TLAYER];; 660 Int m_maxVpsNumReorderPics [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; 661 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; 662 663 public: 664 TComDpbSize( ) 665 { 666 for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ ) 667 { 668 m_subLayerFlagInfoPresentFlag[i] = false; 669 670 for (Int j = 0; j < MAX_TLAYER; j++ ) 671 { 672 m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ; 673 m_maxVpsNumReorderPics [i][j] = 0; 674 m_maxVpsLatencyIncreasePlus1 [i][j] = 0; 675 676 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ ) 677 { 678 m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 679 } 680 } 681 } 682 } 683 684 Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; } 685 Bool getSubLayerFlagInfoPresentFlag( Int i ) { return m_subLayerFlagInfoPresentFlag[i]; } 686 687 Void setSubLayerDpbInfoPresentFlag( Int i, Int j, Bool flag ) { m_subLayerDpbInfoPresentFlag[i][j] = flag; } 688 Bool getSubLayerDpbInfoPresentFlag( Int i, Int j ) { return m_subLayerDpbInfoPresentFlag[i][j]; } 689 690 Void setMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j, Int val ) { m_maxVpsDecPicBufferingMinus1[i][k][j] = val; } 691 Int getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { return m_maxVpsDecPicBufferingMinus1[i][k][j]; } 692 693 Void setMaxVpsNumReorderPics( Int i, Int j, Int val ) { m_maxVpsNumReorderPics[i][j] = val; } 694 Int getMaxVpsNumReorderPics( Int i, Int j ) { return m_maxVpsNumReorderPics[i][j]; } 695 696 Void setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int val ) { m_maxVpsLatencyIncreasePlus1[i][j] = val; } 697 Int getMaxVpsLatencyIncreasePlus1( Int i, Int j ) { return m_maxVpsLatencyIncreasePlus1[i][j]; } 496 698 }; 497 699 #endif … … 547 749 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 548 750 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 751 752 #if H_MV_6_PS_O0109_22 753 Int m_viewIdLen; 754 #else 549 755 Int m_viewIdLenMinus1; 756 #endif 550 757 Int m_viewIdVal [MAX_NUM_LAYERS]; 551 758 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 759 #if H_MV_6_ILDSD_O0120_26 760 Bool m_vpsSubLayersMaxMinus1PresentFlag; 761 Int m_subLayersVpsMaxMinus1 [MAX_NUM_LAYERS]; 762 #endif 552 763 Bool m_maxTidRefPresentFlag; 764 #if H_MV_6_ILDDS_O0225_30 765 Int m_maxTidIlRefPicsPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 766 #else 553 767 Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; 768 #endif 554 769 Bool m_allRefLayersActiveFlag; 555 770 Int m_vpsNumberLayerSetsMinus1; … … 559 774 Bool m_moreOutputLayerSetsThanDefaultFlag; 560 775 Int m_numAddOutputLayerSetsMinus1; 776 #if H_MV_6_PS_0109_25 777 Int m_defaultOneTargetOutputLayerIdc; 778 #else 561 779 Bool m_defaultOneTargetOutputLayerFlag; 780 #endif 562 781 Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; 563 782 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 564 783 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 784 #if H_MV_6_GEN_0153_28 785 Bool m_altOutputLayerFlag; 786 #endif 565 787 Bool m_repFormatIdxPresentFlag; 566 788 Int m_vpsNumRepFormatsMinus1; 567 789 Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; 568 790 TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; 569 Bool m_maxOneActiveRefLayerFlag; 791 Bool m_maxOneActiveRefLayerFlag; 792 #if H_MV_6_MISC_O0062_31 793 Bool m_pocLsbNotPresentFlag [MAX_NUM_LAYERS]; 794 #endif 795 796 #if H_MV_6_HRD_O0217_13 797 TComDpbSize* m_dpbSize; 798 #endif 799 #if !H_MV_6_PS_O0223_29 570 800 Bool m_crossLayerIrapAlignedFlag; 801 #endif 571 802 Int m_directDepTypeLenMinus2; 803 #if H_MV_6_PS_O0096_21 804 Bool m_defaultDirectDependencyFlag; 805 Int m_defaultDirectDependencyType; 806 #endif 572 807 Bool m_vpsVuiPresentFlag; 573 808 TComVPSVUI* m_vpsVUI; … … 588 823 Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 589 824 Int m_viewIndex [MAX_NUM_LAYERS ]; 825 826 #if H_MV_6_HRD_O0217_13 827 std::vector< std::vector< Int> > m_targetDecLayerIdLists; //[TargetOptLayerSetIdx][i] 828 std::vector< std::vector< Int> > m_targetOptLayerIdLists; 829 std::vector< std::vector< Int> > m_layerSetLayerIdList; 830 #endif 831 832 590 833 Int xGetDimBitOffset( Int j ); 591 834 592 835 // VPS EXTENSION 2 SYNTAX ELEMENTS 593 836 #if H_3D_ARP … … 649 892 UInt getMaxTLayers () { return m_uiMaxTLayers; } 650 893 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 651 894 #if H_MV_6_HRD_O0164_15 895 UInt getMaxSubLayersMinus1() { return m_uiMaxTLayers - 1; } // For consistency with draft spec 896 #endif 652 897 #if H_MV 653 898 UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; … … 724 969 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } 725 970 971 #if H_MV_6_PS_O0109_22 972 Void setViewIdLen( Int val ) { m_viewIdLen = val; } 973 Int getViewIdLen( ) { return m_viewIdLen; } 974 #else 726 975 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 727 976 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } 977 #endif 728 978 729 979 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } … … 731 981 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 732 982 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 733 983 #if H_MV_6_ILDSD_O0120_26 984 Void setVpsSubLayersMaxMinus1PresentFlag( Bool flag ) { m_vpsSubLayersMaxMinus1PresentFlag = flag; } 985 Bool getVpsSubLayersMaxMinus1PresentFlag( ) { return m_vpsSubLayersMaxMinus1PresentFlag; } 986 Void setSubLayersVpsMaxMinus1( Int i, Int val ) { m_subLayersVpsMaxMinus1[i] = val; } 987 Int getSubLayersVpsMaxMinus1( Int i ) { return m_subLayersVpsMaxMinus1[i]; } 988 Void checkSubLayersVpsMaxMinus1( Int i ) { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); } 989 #endif 734 990 Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } 735 991 Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } 992 #if H_MV_6_ILDDS_O0225_30 993 Void setMaxTidIlRefPicsPlus1( Int i, Int j, Int val ) { m_maxTidIlRefPicsPlus1[i][j] = val; } 994 Int getMaxTidIlRefPicsPlus1( Int i, Int j ) { return m_maxTidIlRefPicsPlus1[i][j]; } 995 #else 736 996 Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } 737 997 Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 998 #endif 738 999 Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } 739 1000 Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } … … 749 1010 Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } 750 1011 Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } 751 1012 #if H_MV_6_PS_O0109_23 1013 Void checkProfileRefMinus1( Int i ) { assert( getProfileRefMinus1( i ) + 1 <= i ); }; // The value of profile_ref_minus1[ i ] + 1 shall be less than or equal to i. 1014 #endif 752 1015 Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } 753 1016 Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } … … 755 1018 Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } 756 1019 Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } 757 1020 1021 #if H_MV_6_PS_0109_25 1022 Void setDefaultOneTargetOutputLayerIdc( Int val ) { m_defaultOneTargetOutputLayerIdc = val; } 1023 Int getDefaultOneTargetOutputLayerIdc( ) { return m_defaultOneTargetOutputLayerIdc; } 1024 Void checkDefaultOneTargetOutputLayerIdc( ) { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); } 1025 #else 758 1026 Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } 759 1027 Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } 1028 #endif 760 1029 761 1030 Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } … … 764 1033 Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } 765 1034 Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } 1035 #if H_MV_6_HRD_O0217_13 1036 Bool inferOutputLayerFlag( Int layerSetIdx, Int i ) { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1 ) )); } 1037 #endif 766 1038 767 1039 Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } 768 1040 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 769 1041 #if H_MV_6_GEN_0153_28 1042 Void setAltOutputLayerFlag( Bool flag ) { m_altOutputLayerFlag = flag; } 1043 Bool getAltOutputLayerFlag( ) { return m_altOutputLayerFlag; } 1044 #endif 770 1045 Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } 771 1046 Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } … … 781 1056 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 782 1057 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } 1058 1059 #if H_MV_6_HRD_O0217_13 1060 Void setDpbSize( TComDpbSize* val ) { assert( m_dpbSize != 0 ); m_dpbSize = val; } 1061 TComDpbSize* getDpbSize( ) { return m_dpbSize;} 1062 #endif 1063 1064 #if H_MV_6_MISC_O0062_31 1065 Void setPocLsbNotPresentFlag( Int i, Bool flag ) { m_pocLsbNotPresentFlag[i] = flag; } 1066 Bool getPocLsbNotPresentFlag( Int i ) { return m_pocLsbNotPresentFlag[i]; } 1067 #endif 1068 #if !H_MV_6_PS_O0223_29 783 1069 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 784 1070 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 1071 #endif 785 1072 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 786 1073 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } 787 1074 1075 #if H_MV_6_PS_O0096_21 1076 Void setDefaultDirectDependencyFlag( Bool flag ) { m_defaultDirectDependencyFlag = flag; } 1077 Bool getDefaultDirectDependencyFlag( ) { return m_defaultDirectDependencyFlag; } 1078 1079 Void setDefaultDirectDependencyType( Int val ) { m_defaultDirectDependencyType = val; } 1080 Int getDefaultDirectDependencyType( ) { return m_defaultDirectDependencyType; } 1081 #endif 788 1082 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 789 1083 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } … … 793 1087 TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } 794 1088 // VPS EXTENSION SEMANTICS VARIABLES 1089 795 1090 Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } 796 1091 Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } 797 1092 798 1093 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); 1094 #if H_MV_6_FIX_GET_VIEW_ID 1095 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( layerIdInNuh )]; } 1096 #else 799 1097 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } 1098 #endif 800 1099 Void setRefLayers(); 801 1100 … … 808 1107 Int scalTypeToScalIdx ( ScalabilityType scalType ); 809 1108 810 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 811 812 Int getNumLayersInIdList ( Int lsIdx );; 1109 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 1110 1111 Int getNumLayersInIdList ( Int lsIdx ); 1112 1113 #if H_MV_6_HRD_O0217_13 1114 Int getNumOutputLayerSets() ; 1115 Int getNumSubDpbs( Int i ) { return getNumLayersInIdList( i ); }; 1116 Bool isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh ); 1117 #if H_MV_6_HRD_O0217_13 1118 Void deriveLayerSetLayerIdList(); 1119 Void deriveTargetLayerIdLists(); 1120 std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 1121 std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 1122 #endif 1123 #endif 1124 813 1125 814 1126 // inference … … 1096 1408 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1097 1409 1410 #if H_MV_6_PS_O0118_33 1411 Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr ) 1412 { 1413 if ( layerIdCurr == 0 || !vps->getVpsVuiPresentFlag() ) 1414 { 1415 return; 1416 } 1417 1418 TComVPSVUI* vpsVUI = vps->getVPSVUI(); 1419 assert( vpsVUI != NULL ); 1420 1421 TComVideoSignalInfo* videoSignalInfo = vpsVUI->getVideoSignalInfo( vpsVUI->getVpsVideoSignalInfoIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 1422 assert( videoSignalInfo != NULL ); 1423 1424 setVideoFormat ( videoSignalInfo->getVideoVpsFormat () ); 1425 setVideoFullRangeFlag ( videoSignalInfo->getVideoFullRangeVpsFlag () ); 1426 setColourPrimaries ( videoSignalInfo->getColourPrimariesVps () ); 1427 setTransferCharacteristics( videoSignalInfo->getTransferCharacteristicsVps() ); 1428 setMatrixCoefficients ( videoSignalInfo->getMatrixCoeffsVps () ); 1429 } 1430 #endif 1098 1431 }; 1099 1432 … … 1181 1514 TComVPS* m_pcVPS; 1182 1515 // SPS 1516 #if H_MV_6_PSEM_O0142_3 1517 Bool m_spsExtensionFlag; 1518 Bool m_spsExtensionTypeFlag[PS_EX_T_MAX_NUM]; 1519 #endif 1183 1520 Bool m_spsInferScalingListFlag; 1184 1521 Int m_spsScalingListRefLayerId; 1185 1522 Bool m_updateRepFormatFlag; 1523 #if H_MV_6_PS_REP_FORM_18_19_20 1524 Int m_spsRepFormatIdx; 1525 #endif 1186 1526 // SPS Extension 1187 1527 Bool m_interViewMvVertConstraintFlag; 1528 #if H_MV_6_SHVC_O0098_36 1529 Int m_numScaledRefLayerOffsets; 1530 Int m_scaledRefLayerId [MAX_NUM_SCALED_REF_LAYERS]; 1531 Int m_scaledRefLayerLeftOffset [MAX_NUM_LAYERS]; 1532 Int m_scaledRefLayerTopOffset [MAX_NUM_LAYERS]; 1533 Int m_scaledRefLayerRightOffset [MAX_NUM_LAYERS]; 1534 Int m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS]; 1535 #endif 1188 1536 #endif 1189 1537 #if H_3D … … 1322 1670 TComPTL* getPTL() { return &m_pcPTL; } 1323 1671 #if H_MV 1672 #if H_MV_6_PSEM_O0142_3 1673 Void setSpsExtensionFlag( Bool flag ) { m_spsExtensionFlag = flag; } 1674 Bool getSpsExtensionFlag( ) { return m_spsExtensionFlag; } 1675 1676 Void setSpsExtensionTypeFlag( Int i, Bool flag ) { m_spsExtensionTypeFlag[i] = flag; } 1677 Bool getSpsExtensionTypeFlag( Int i ) { return m_spsExtensionTypeFlag[i]; } 1678 #endif 1324 1679 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 1325 1680 TComVPS* getVPS () { return m_pcVPS; } … … 1333 1688 Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } 1334 1689 Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } 1690 #if H_MV_6_PS_REP_FORM_18_19_20 1691 Void setSpsRepFormatIdx( Int val ) { m_spsRepFormatIdx = val; } 1692 Int getSpsRepFormatIdx( ) { return m_spsRepFormatIdx; } 1693 #endif 1335 1694 // SPS Extension 1336 1695 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1337 1696 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1697 1698 #if H_MV_6_SHVC_O0098_36 1699 Void setNumScaledRefLayerOffsets( Int val ) { m_numScaledRefLayerOffsets = val; } 1700 Int getNumScaledRefLayerOffsets( ) { return m_numScaledRefLayerOffsets; } 1701 1702 Void setScaledRefLayerId( Int i, Int val ) { m_scaledRefLayerId[i] = val; } 1703 Int getScaledRefLayerId( Int i ) { return m_scaledRefLayerId[i]; } 1704 1705 Void setScaledRefLayerLeftOffset( Int j, Int val ) { m_scaledRefLayerLeftOffset[j] = val; } 1706 Int getScaledRefLayerLeftOffset( Int j ) { return m_scaledRefLayerLeftOffset[j]; } 1707 1708 Void setScaledRefLayerTopOffset( Int j, Int val ) { m_scaledRefLayerTopOffset[j] = val; } 1709 Int getScaledRefLayerTopOffset( Int j ) { return m_scaledRefLayerTopOffset[j]; } 1710 1711 Void setScaledRefLayerRightOffset( Int j, Int val ) { m_scaledRefLayerRightOffset[j] = val; } 1712 Int getScaledRefLayerRightOffset( Int j ) { return m_scaledRefLayerRightOffset[j]; } 1713 1714 Void setScaledRefLayerBottomOffset( Int j, Int val ) { m_scaledRefLayerBottomOffset[j] = val; } 1715 Int getScaledRefLayerBottomOffset( Int j ) { return m_scaledRefLayerBottomOffset[j]; } 1716 #endif 1338 1717 // Inference 1339 1718 Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); 1340 1341 1719 Void inferScalingList( TComSPS* spsSrc ); 1342 1720 #endif … … 1736 2114 // Additional slice header syntax elements 1737 2115 Bool m_pocResetFlag; 2116 #if H_MV_6_RALS_O0149_11 2117 Bool m_crossLayerBlaFlag; 2118 #endif 1738 2119 Bool m_discardableFlag; 1739 2120 Bool m_interLayerPredEnabledFlag; … … 2073 2454 // Additional slice header syntax elements 2074 2455 2456 #if H_MV_6_RALS_O0149_11 2457 Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; } 2458 Bool getCrossLayerBlaFlag( ) { return m_crossLayerBlaFlag; } 2459 Void checkCrossLayerBlaFlag ( ) 2460 { 2461 // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0. 2462 if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 2463 { 2464 assert( m_crossLayerBlaFlag == 0 ); 2465 } 2466 } 2467 #endif 2468 2075 2469 Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 2076 2470 Bool getPocResetFlag( ) { return m_pocResetFlag; } 2077 2471 2078 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; }2079 Bool getDiscardableFlag( ) { return m_discardableFlag; }2080 2081 Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; }2082 Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; }2083 2084 Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; }2085 Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; }2086 2087 Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; }2088 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; }2472 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } 2473 Bool getDiscardableFlag( ) { return m_discardableFlag; } 2474 2475 Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } 2476 Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } 2477 2478 Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } 2479 Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } 2480 2481 Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } 2482 Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 2089 2483 2090 2484 // Additional variables derived in slice header semantics 2091 2485 Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } 2092 2486 Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } 2487 2488 #if H_MV_6_ILDDS_ILREFPICS_27_34 2489 Int getRefLayerPicFlag( Int i ); 2490 Int getRefLayerPicIdc ( Int j ); 2491 Int getNumRefLayerPics( ); 2492 #endif 2093 2493 2094 2494 Int getNumActiveRefLayerPics( ); -
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TypeDef.h
r724 r730 243 243 #endif 244 244 245 245 ///////////////////////////////////////////////////////////////////////////////////////// 246 /////////////////////////////////// HTM-9.2 Integrations ////////////////////////////// 247 ///////////////////////////////////////////////////////////////////////////////////////// 248 249 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!! 250 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!! 251 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!! 252 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!! 253 // !!! PLEASE PUT MACROS RELATED TO HTM-9.2 INTEGRATIONS HERE !!! 254 255 ///////////////////////////////////////////////////////////////////////////////////////// 256 /////////////////////////////////// HTM-9.1 Integrations ////////////////////////////// 257 ///////////////////////////////////////////////////////////////////////////////////////// 258 259 #define H_MV_FIX_TRACE_FILE 1 // Fix linux compilation error related const char conversion 260 261 #define H_MV_LAYER_WISE_STARTUP 1 // Basic version of layer wise startup. 262 #define H_MV_FIX_SKIP_PICTURES 1 // Fix related to skipping pictures. 263 #define H_MV_6_HRD_O0164_15 1 // (HRD/O0164/Multilayer HRD) #15 Decision: Adopt, modified as follows: It was suggested to constrain the stalling based on the relative cpb removal times, which must be in decoding order. The "du_based_bpb_sync_flag" is not needed, in view of this. SEI in the highest layer of the layer set or (inclusive "or") VPS VUI is used to carry the parameters (at encoder discretion). SEI in higher layer and SEI in VUI do not need to repeat information available in some lower layer. Shall be after APS SEI and buffering period SEI and before all other SEI of all layers except other HRD related SEI. 264 #define H_MV_6_HRD_O0217_13 1 // (HRD/O0217/Sub-DPB based DPB operations) #13 Decision: Adopt Specify a separate DPB capacity for each layer no sharing of capacity across layers each layer has its own parameters (max pictures, max latency, max reordering). This proposal would specify distinct parameters for each "output layer set" and to change the definition of an operation point to be specific to an output layer set instead of a 'layer set". Decision: Adopted this aspect as well. 265 #define H_MV_6_SHVC_O0098_36 1 // (SHVC/O0098/Scaled ref layer offset) #36 Modify signalling of scaled reference layer offsets to allow signalling of any lower layer, rather than just a direct reference layer, in order to enable alignment of auxiliary pictures. In further JCT-VC and JCT-3V discussion, it was also agreed to use the same offset signalling for MV-HEVC as well as SHVC 266 #define H_MV_6_GEN_0153_28 1 //(Gen/O0153/output highest layer) #28 Add a flag in the VPS to indicate if startup process should output the highest available layer if the target output layer is not available. 267 #define H_MV_6_PS_0109_25 1 //XXX(PS/O0109/default_one_target_output_layer_idc) #25 To change default_one_target_output_layer_flag to a two-bit default_one_target_output_layer_idc, and reserve the values 2 and 3 268 #define H_MV_6_O0226_37 1 //(VUI/O0226/Mod tile WPP) #37 Modifications to the VUI indicators of tile and WPP alignment related syntax elements, from the r1. 269 #define H_MV_6_RALS_O0149_11 1 //XXX (RALS/O0149/Prop2): #11 Proposal: A new slice_reserved_flag is taken into use to indicate if a base-layer IDR picture initiates the layer-wise start-up process. Decision: Adopt (the bit should not be required to be present; if present should be the bit after the discardable_flag, and discardable_flag should be the first one of the three, and the poc reset flag is not required to be present). 270 #define H_MV_6_PSEM_O0142_3 1 // (PSEM/O0142/Conditional extension syntax) #3 Adopt JCTVC-O0142 (as a structure to be used to switch whatever extensions we define in SPS, not necessarily committing to having these extensions be separate for each extension, but the current plan unless decided otherwise is to use one flag for range extensions syntax presence and one flag for SHVC+MV-HEVC extension syntax presence) 271 #define H_MV_6_FIX_GET_VIEW_ID 1 // Fix get view id 272 #define H_MV_6_LAYER_ID_32 1 // (Gen/O0137,O0200,O0223,Layer id) #32 Add (editorial equivalent of) "The value of nuh_layer_id shall be in the range of 0 to 62. The value of 63 for nuh_layer_id is reserved for future use by ITU-T | ISO/IEC. Decoders shall ignore all data that follow the value 63 for nuh_layer_id in a NAL unit." and specify that vps_max_layers_minus1 shall not be equal to 63, but decoders shall allow that value to appear in the bitstream. Specify that the value 63 is interpreted the same as the value 62 (e.g., MaxLayersMinus1 = Min( 62, vps_max_layers_minus1) and subsequently refer to MaxLayersMinus1 instead of vps_max_layers_minus1) 273 #define H_MV_6_PS_O0118_33 1 // (PS/O0118/visual signal info in vui per layer) #33 Add visual signal information (video_format, video_full_range_flag, colour_primaries, transfer_characteristics, matrix_coeffs) per layer to the VPS VUI, from v2 version of JCTVC-O0118. 274 #define H_MV_6_POC_31_35_38 1 //XXX Various related to POC 275 // (Misc/O0062/POC LSB present) (SH changes) 276 // (POC/O0117/Modify PicOrderCntVal of prevTid0Pic) #35 Modification of the PicOrderCntVal of prevTid0Pic and modification to the decoding process for reference picture set, to address problems found for cross-layer POC alignment. 277 // (POC/O0211/Fix ambiguity) #38 Modify POC derivation to correct an ambiguity in the spec. 278 #define H_MV_6_MISC_O0062_31 1 // (Misc/O0062/POC LSB present) (without SH changes ) #31 The proposal's "option 3" is to add a flag in the VPS for each EL to control whether these LSBs are present or not (for IDR pictures), and when not present, the LSBs are inferred to be equal to 0. Decision: Adopted (as described herein). 279 #define H_MV_6_ILDDS_ILREFPICS_27_34 1 // Various inter layer reference picture derivation 280 // (ILDSD/O0225/max_tid_il_ref_pics RPL const.) #27 Change derivation of NumActiveRefLayerPics to consider max_tid_il_ref_pics. 281 // (ILDSD/O0120/sub_layers_vps_max_minus1 RPL const) #34 Modify inter-layer reference picture list default construction to incorporate max temporal sub-layers per layer syntax elements in VPS extension, from r2 version of JCTVC-O0120 282 #define H_MV_6_ILDDS_O0225_30 1 // (ILDSD/O0225/signal max_tid_il_ref_pics per layer ) #30 2nd proposal of JCTVC-O0225 regarding signalling of max_tid_il_ref_pics per layer, based upon relation to SCE2 on single loop decoding. Decision: Adopted. 283 #define H_MV_6_ILDSD_O0120_26 1 // (ILDSD/O0120/sub_layers_vps_max_minus1) #26 Add syntax elements to signal max temporal sub-layers for each layer in the VPS, with a gating flag, from JCTVC- option 2. 284 #define H_MV_6_PS_O0223_29 1 // (PS/O0223/Cross layer alignment type) #29 Add a flag in VPS VUI to indicate cross layer pic type alignment. Move cross_layer_irap_aligned_flag to VPS VUI and make presence condition on added flag 285 #define H_MV_6_PS_0092_17 1 // (PS/O0092/Sharing SPS PPS) #17 Restrict sharing of SPS and PPS across layers to avoid creating problems during sub-bitstream extraction, based on modification of proposals in JCTVC-O0059 and JCTVC-O0092, reflected in the v2 version of O0092. 286 #define H_MV_6_PS_REP_FORM_18_19_20 1 // Various Rep format 287 // (PS/O0096/rep format syntax element length ) #20 Modification of length to 8 bit as decided later in trac. 288 // (PS/O0179/Rep. Format) #18 Add flag in rep_format( ) syntax structure to control sending of chroma and bit depth related parameters, as proposed in the v2 version of JCTVC-O0179. 289 // (PS/O0096/rep format) #20 Modify the SPS syntax for layers with nuh_layer_id > 0 to signal a reference to a rep_format index in the VPS, rather than signalling explicit representation format data in the SPS, from the v2 version of JCTVC-O0096. 290 // (PS/FIX/N0092/Rep. Format) #19 Inferences. 291 #define H_MV_6_PS_O0096_21 1 // (PS/O0096/direct_dependency_type gating flag) #21 Add a gating flag in VPS extension to condition the presence of direct dependency type, with a default type signalled, from JCTVC-O0096 292 #define H_MV_6_PS_O0109_22 1 // (PS/O0109/view_id_len) #22 Modify the VPS extension syntax and semantics to replace view_id_len_minus1 with view_id_len, always signal that syntax element, add a constraint that (1<<view_id_len) >= NumViews, and modify view_id_val semantics to infer value of 0 when not present, from discussion of JCTVC-O0109 293 #define H_MV_6_PS_O0109_23 1 // (PS/O0109/profile_ref_minus1 constraint) #23 Modify the semantics of profile_ref_minus1[ i ] to replace shall be less than i with shall be less than or equal to i, from discussion of JCTVC-O0109 294 #define H_MV_6_PS_O0109_24 1 // (PS/O0109/vps_vui_present_flag move) #24 Move the vps_vui_present_flag to precede vps_vui_offset, and make vps_vui_offset conditional on that flag, from JCTVC-O0109 246 295 ///////////////////////////////////////////////////////////////////////////////////////// 247 296 /////////////////////////////////// HTM-9.0 Integrations ////////////////////////////// … … 305 354 #define MAX_VPS_OP_SETS_PLUS1 1024 306 355 #if H_MV 356 #if H_MV_6_LAYER_ID_32 357 #define MAX_VPS_NUH_LAYER_ID_PLUS1 63 358 #else 307 359 #define MAX_VPS_NUH_LAYER_ID_PLUS1 64 360 #endif 308 361 #define MAX_NUM_SCALABILITY_TYPES 16 309 362 #define ENC_CFG_CONSOUT_SPACE 29 … … 328 381 329 382 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) 383 #if H_MV 384 #if H_MV_6_LAYER_ID_32 385 #define MAX_NUM_LAYER_IDS 63 386 #define MAX_NUM_LAYERS 63 387 #else 330 388 #define MAX_NUM_LAYER_IDS 64 331 #if H_MV332 389 #define MAX_NUM_LAYERS 64 390 #endif 333 391 #define MAX_VPS_PROFILE_TIER_LEVEL 64 334 392 #define MAX_VPS_ADD_OUTPUT_LAYER_SETS 1024 335 393 #define MAX_VPS_OUTPUTLAYER_SETS ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 ) 394 #if H_MV_6_PS_O0118_33 395 #define MAX_NUM_VIDEO_SIGNAL_INFO 16 396 #endif 397 #if H_MV_6_SHVC_O0098_36 398 #define MAX_NUM_SCALED_REF_LAYERS MAX_NUM_LAYERS-1 399 #endif 400 #if H_MV_6_HRD_O0164_15 401 #define MAX_NUM_BSP_HRD_PARAMETERS 100 ///< Maximum value is actually not specified 402 #define MAX_NUM_BITSTREAM_PARTITIONS 100 ///< Maximum value is actually not specified 403 #define MAX_NUM_BSP_SCHED_COMBINATION 100 ///< Maximum value is actually not specified 404 #endif 336 405 #endif 337 406 … … 810 879 811 880 #if H_MV 881 882 #if H_MV_6_PSEM_O0142_3 883 enum PsExtensionTypes 884 { 885 PS_EX_T_MV = 1, 886 #if H_3D 887 PS_EX_T_3D = 3, 888 #endif 889 PS_EX_T_ESC = 7, 890 PS_EX_T_MAX_NUM = 8 891 }; 892 #endif 893 812 894 /// scalability types 813 895 enum ScalabilityType -
branches/HTM-9.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
r724 r730 396 396 397 397 READ_FLAG( uiCode, "video_signal_type_present_flag"); pcVUI->setVideoSignalTypePresentFlag(uiCode); 398 #if H_MV_6_PS_O0118_33 399 assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() ); 400 #endif 401 398 402 if (pcVUI->getVideoSignalTypePresentFlag()) 399 403 { … … 582 586 { 583 587 READ_FLAG( uiCode, "update_rep_format_flag" ); pcSPS->setUpdateRepFormatFlag( uiCode == 1 ); 588 #if H_MV_6_PS_REP_FORM_18_19_20 589 if ( pcSPS->getUpdateRepFormatFlag() ) 590 { 591 READ_CODE( 8, uiCode, "sps_rep_format_idx" ); pcSPS->setSpsRepFormatIdx( uiCode ); 592 } 593 } 594 else 595 { 596 #else 584 597 } 585 598 586 599 if ( pcSPS->getUpdateRepFormatFlag() ) 587 600 { 601 #endif 588 602 #endif 589 603 READ_UVLC( uiCode, "chroma_format_idc" ); pcSPS->setChromaFormatIdc( uiCode ); … … 621 635 622 636 #if H_MV 623 if ( pcSPS->getUpdateRepFormatFlag() ) 624 { 637 #if H_MV_6_PS_REP_FORM_18_19_20 638 if ( pcSPS->getLayerId() == 0 ) 639 #else 640 if ( pcSPS->getUpdateRepFormatFlag() ) 641 #endif 642 { 625 643 #endif 626 644 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); … … 770 788 771 789 READ_FLAG( uiCode, "sps_extension_flag"); 772 if (uiCode) 773 { 790 #if H_MV_6_PSEM_O0142_3 791 pcSPS->setSpsExtensionFlag( uiCode ); 792 #endif 793 if (pcSPS->getSpsExtensionFlag( ) ) 794 { 795 #if !H_MV_6_PSEM_O0142_3 774 796 #if H_MV 775 797 parseSPSExtension( pcSPS ); … … 784 806 #endif 785 807 #endif 786 while ( xMoreRbspData() ) 787 { 788 READ_FLAG( uiCode, "sps_extension_data_flag"); 789 } 808 #else 809 for (Int i = 0; i < PS_EX_T_MAX_NUM; i++) 810 { 811 READ_FLAG( uiCode, "sps_extension_type_flag" ); pcSPS->setSpsExtensionTypeFlag( i, uiCode ); 812 #if H_3D 813 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D || i == PS_EX_T_ESC ); 814 #else 815 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_ESC ); 816 #endif 817 } 818 819 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV )) 820 { 821 parseSPSExtension( pcSPS ); 822 } 823 824 #if H_3D 825 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D )) 826 { 827 parseSPSExtension2( pcSPS, viewIndex, depthFlag ); 828 } 829 #endif 830 831 if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC )) 832 { 833 #endif 834 while ( xMoreRbspData() ) 835 { 836 READ_FLAG( uiCode, "sps_extension_data_flag"); 837 } 838 #if H_MV_6_PSEM_O0142_3 839 } 840 #else 790 841 #if H_MV 791 842 #if H_3D … … 794 845 } 795 846 #endif 847 #endif 796 848 } 797 849 } … … 802 854 UInt uiCode; 803 855 READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" ); pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false); 856 #if !H_MV_6_SHVC_O0098_36 804 857 READ_UVLC( uiCode, "sps_shvc_reserved_zero_idc" ); 858 #else 859 860 READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets( uiCode ); 861 862 for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++) 863 { 864 READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 865 866 Int j = pcSPS->getScaledRefLayerId( i ); 867 Int iCode; 868 READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); pcSPS->setScaledRefLayerLeftOffset( j, iCode ); 869 READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); pcSPS->setScaledRefLayerTopOffset( j, iCode ); 870 READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode ); 871 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode ); 872 } 873 #endif 805 874 } 806 875 … … 850 919 READ_CODE( 2, uiCode, "vps_reserved_three_2bits" ); assert(uiCode == 3); 851 920 #if H_MV 921 #if H_MV_6_LAYER_ID_32 922 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayersMinus1( std::min( uiCode, (UInt) ( MAX_NUM_LAYER_IDS-1) ) ); 923 #else 852 924 READ_CODE( 6, uiCode, "vps_max_layers_minus1" ); pcVPS->setMaxLayersMinus1( uiCode ); 925 #endif 853 926 #else 854 927 READ_CODE( 6, uiCode, "vps_reserved_zero_6bits" ); assert(uiCode == 0); … … 867 940 for(UInt i = 0; i <= pcVPS->getMaxTLayers()-1; i++) 868 941 { 869 READ_UVLC( uiCode, "vps_max_dec_pic_buffering_minus1[i]" ); 870 READ_UVLC( uiCode, "vps_num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i );942 READ_UVLC( uiCode, "vps_max_dec_pic_buffering_minus1[i]" ); pcVPS->setMaxDecPicBuffering( uiCode + 1, i ); 943 READ_UVLC( uiCode, "vps_num_reorder_pics[i]" ); pcVPS->setNumReorderPics( uiCode, i ); 871 944 READ_UVLC( uiCode, "vps_max_latency_increase_plus1[i]" ); pcVPS->setMaxLatencyIncrease( uiCode, i ); 872 945 … … 876 949 { 877 950 pcVPS->setMaxDecPicBuffering(pcVPS->getMaxDecPicBuffering(0), i); 878 pcVPS->setNumReorderPics (pcVPS->getNumReorderPics(0), i);951 pcVPS->setNumReorderPics (pcVPS->getNumReorderPics(0), i); 879 952 pcVPS->setMaxLatencyIncrease(pcVPS->getMaxLatencyIncrease(0), i); 880 953 } … … 905 978 } 906 979 } 980 #if H_MV_6_HRD_O0217_13 981 pcVPS->deriveLayerSetLayerIdList(); 982 #endif 907 983 TimingInfo *timingInfo = pcVPS->getTimingInfo(); 908 984 READ_FLAG( uiCode, "vps_timing_info_present_flag"); timingInfo->setTimingInfoPresentFlag (uiCode ? true : false); … … 968 1044 UInt uiCode; 969 1045 READ_FLAG( uiCode, "avc_base_layer_flag" ); pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false ); 1046 #if H_MV_6_PS_O0109_24 1047 READ_FLAG( uiCode, "vps_vui_present_flag" ); pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); if ( pcVPS->getVpsVuiPresentFlag() ) 1048 { 1049 #endif 970 1050 READ_CODE( 16, uiCode, "vps_vui_offset" ); pcVPS->setVpsVuiOffset( uiCode ); 1051 #if H_MV_6_PS_O0109_24 1052 } 1053 #endif 1054 971 1055 READ_FLAG( uiCode, "splitting_flag" ); pcVPS->setSplittingFlag( uiCode == 1 ? true : false ); 972 1056 … … 1014 1098 } 1015 1099 1100 #if H_MV_6_PS_O0109_22 1101 READ_CODE( 4, uiCode, "view_id_len" ); pcVPS->setViewIdLen( uiCode ); 1102 1103 if ( pcVPS->getViewIdLen( ) > 0 ) 1104 { 1105 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 1106 { 1107 READ_CODE( pcVPS->getViewIdLen( ), uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode ); 1108 } 1109 } 1110 else 1111 { 1112 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 1113 { 1114 pcVPS->setViewIdVal( i, 0 ); 1115 } 1116 } 1117 #else 1016 1118 // GT spec says: trac #39 1017 1119 // if ( pcVPS->getNumViews() > 1 ) … … 1025 1127 READ_CODE( pcVPS->getViewIdLenMinus1( ) + 1, uiCode, "view_id_val[i]" ); pcVPS->setViewIdVal( i, uiCode ); 1026 1128 } 1129 #endif 1130 1027 1131 1028 1132 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 1033 1137 } 1034 1138 } 1035 1139 #if H_MV_6_MISC_O0062_31 1140 pcVPS->setRefLayers(); 1141 #endif 1142 #if H_MV_6_ILDSD_O0120_26 1143 READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 ); 1144 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 1145 { 1146 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1147 { 1148 READ_CODE( 3, uiCode, "sub_layers_vps_max_minus1" ); pcVPS->setSubLayersVpsMaxMinus1( i, uiCode ); 1149 pcVPS->checkSubLayersVpsMaxMinus1( i ); 1150 1151 } 1152 } 1153 else 1154 { 1155 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1156 { 1157 pcVPS->setSubLayersVpsMaxMinus1( i, pcVPS->getMaxTLayers( ) - 1); 1158 } 1159 } 1160 #endif 1036 1161 READ_FLAG( uiCode, "max_tid_ref_present_flag" ); pcVPS->setMaxTidRefPresentFlag( uiCode == 1 ); 1037 1162 … … 1040 1165 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 1041 1166 { 1167 #if H_MV_6_ILDDS_O0225_30 1168 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1169 { 1170 if ( pcVPS->getDirectDependencyFlag(j,i) ) 1171 { 1172 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1" ); pcVPS->setMaxTidIlRefPicsPlus1( i, j, uiCode ); 1173 } 1174 } 1175 #else 1042 1176 READ_CODE( 3, uiCode, "max_tid_il_ref_pics_plus1[i]" ); pcVPS->setMaxTidIlRefPicPlus1( i , uiCode ); 1177 #endif 1043 1178 } 1044 1179 } … … 1054 1189 { 1055 1190 READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode ); 1191 #if H_MV_6_PS_O0109_23 1192 pcVPS->checkProfileRefMinus1( i ); 1193 #endif 1056 1194 } 1057 1195 parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1); … … 1076 1214 if( numOutputLayerSets > 1) 1077 1215 { 1216 #if H_MV_6_PS_0109_25 1217 READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" ); pcVPS->setDefaultOneTargetOutputLayerIdc( uiCode ); 1218 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 1219 #else 1078 1220 READ_FLAG( uiCode, "default_one_target_output_layer_flag" ); pcVPS->setDefaultOneTargetOutputLayerFlag( uiCode == 1); 1221 #endif 1079 1222 } 1080 1223 1224 #if H_MV_6_HRD_O0217_13 1225 pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 )); 1226 pcVPS->setOutputLayerSetIdxMinus1(0, -1); 1227 #endif 1081 1228 for( Int i = 1; i < numOutputLayerSets; i++ ) 1082 1229 { … … 1089 1236 } 1090 1237 } 1238 #if H_MV_6_HRD_O0217_13 1239 else 1240 { // These inference rules would also be helpful in spec text 1241 pcVPS->setOutputLayerSetIdxMinus1(i, i - 1 ); 1242 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 1243 { 1244 pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j )); 1245 } 1246 } 1247 #endif 1248 1091 1249 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 1092 1250 { … … 1094 1252 } 1095 1253 } 1096 1254 #if H_MV_6_GEN_0153_28 1255 if( pcVPS->getMaxLayersMinus1() > 0 ) 1256 { 1257 READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 ); 1258 } 1259 #endif 1260 #if H_MV_6_HRD_O0217_13 1261 pcVPS->deriveTargetLayerIdLists(); 1262 #endif 1097 1263 READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 ); 1098 1264 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 1103 1269 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 1104 1270 { 1271 #if H_MV_6_PS_REP_FORM_18_19_20 1272 assert( pcVPS->getRepFormat(i) == NULL ); 1273 TComRepFormat* curRepFormat = new TComRepFormat(); 1274 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1275 parseRepFormat( i, curRepFormat , prevRepFormat); 1276 pcVPS->setRepFormat(i, curRepFormat ); 1277 #else 1105 1278 assert( pcVPS->getRepFormat(i) == NULL ); 1106 1279 TComRepFormat* repFormat = new TComRepFormat(); 1107 1280 parseRepFormat( repFormat ); 1108 1281 pcVPS->setRepFormat(i, repFormat ); 1282 #endif 1109 1283 } 1110 1284 … … 1115 1289 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 1116 1290 { 1291 #if H_MV_6_PS_REP_FORM_18_19_20 1292 READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode ); 1293 #else 1117 1294 READ_CODE( 4, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode ); 1295 #endif 1118 1296 } 1119 1297 } … … 1121 1299 1122 1300 READ_FLAG( uiCode, "max_one_active_ref_layer_flag" ); pcVPS->setMaxOneActiveRefLayerFlag ( uiCode == 1 ); 1301 #if H_MV_6_MISC_O0062_31 1302 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1303 { 1304 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) == 0 ) 1305 { 1306 READ_FLAG( uiCode, "poc_lsb_not_present_flag" ); pcVPS->setPocLsbNotPresentFlag( i, uiCode == 1 ); 1307 } 1308 } 1309 #endif 1310 1311 #if H_MV_6_HRD_O0217_13 1312 parseDpbSize( pcVPS ); 1313 #endif 1314 1315 #if !H_MV_6_PS_O0223_29 1123 1316 READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPS->setCrossLayerIrapAlignedFlag( uiCode == 1 ); 1317 #endif 1124 1318 READ_UVLC( uiCode, "direct_dep_type_len_minus2") ; pcVPS->setDirectDepTypeLenMinus2 ( uiCode ); 1125 1319 1320 #if H_MV_6_PS_O0096_21 1321 READ_FLAG( uiCode, "default_direct_dependency_flag" ); pcVPS->setDefaultDirectDependencyFlag( uiCode == 1 ); 1322 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1323 { 1324 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "default_direct_dependency_type" ); pcVPS->setDefaultDirectDependencyType( uiCode ); 1325 } 1326 1327 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1328 { 1329 for( Int j = 0; j < i; j++ ) 1330 { 1331 if (pcVPS->getDirectDependencyFlag( i, j) ) 1332 { 1333 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1334 { 1335 pcVPS->setDirectDependencyType( i, j , pcVPS->getDefaultDirectDependencyType( ) ); 1336 } 1337 else 1338 { 1339 READ_CODE( pcVPS->getDirectDepTypeLenMinus2( ) + 2, uiCode, "direct_dependency_type[i][j]" ); pcVPS->setDirectDependencyType( i, j , uiCode); 1340 } 1341 } 1342 } 1343 } 1344 #else 1126 1345 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1127 1346 { … … 1134 1353 } 1135 1354 } 1355 #endif 1136 1356 1137 1357 READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" ); 1358 #if !H_MV_6_PS_O0109_24 1138 1359 READ_FLAG( uiCode, "vps_vui_present_flag" ) ; pcVPS->setVpsVuiPresentFlag( uiCode == 1 ); 1360 #endif 1139 1361 1140 1362 if( pcVPS->getVpsVuiPresentFlag() ) … … 1145 1367 1146 1368 pcVPS->checkVPSExtensionSyntax(); 1369 #if !H_MV_6_MISC_O0062_31 1147 1370 pcVPS->setRefLayers(); 1148 } 1149 1371 #endif 1372 } 1373 1374 #if H_MV_6_PS_REP_FORM_18_19_20 1375 Void TDecCavlc::parseRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1376 #else 1150 1377 Void TDecCavlc::parseRepFormat( TComRepFormat* pcRepFormat ) 1378 #endif 1151 1379 { 1152 1380 assert( pcRepFormat ); 1153 1381 1154 1382 UInt uiCode; 1383 1384 #if H_MV_6_PS_REP_FORM_18_19_20 1385 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1386 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode ); 1387 READ_FLAG( uiCode, "chroma_and_bit_depth_vps_present_flag" ); pcRepFormat->setChromaAndBitDepthVpsPresentFlag( uiCode == 1 ); 1388 1389 pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i ); 1390 1391 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1392 { 1393 #endif 1155 1394 READ_CODE( 2, uiCode, "chroma_format_vps_idc" ); pcRepFormat->setChromaFormatVpsIdc ( uiCode ); 1156 1395 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) … … 1158 1397 READ_FLAG( uiCode, "separate_colour_plane_vps_flag" ); pcRepFormat->setSeparateColourPlaneVpsFlag( uiCode == 1 ); 1159 1398 } 1399 #if !H_MV_6_PS_REP_FORM_18_19_20 1160 1400 READ_CODE( 16, uiCode, "pic_width_vps_in_luma_samples" ); pcRepFormat->setPicWidthVpsInLumaSamples ( uiCode ); 1161 1401 READ_CODE( 16, uiCode, "pic_height_vps_in_luma_samples" ); pcRepFormat->setPicHeightVpsInLumaSamples( uiCode ); 1402 #endif 1162 1403 READ_CODE( 4, uiCode, "bit_depth_vps_luma_minus8" ); pcRepFormat->setBitDepthVpsLumaMinus8 ( uiCode ); 1163 1404 READ_CODE( 4, uiCode, "bit_depth_vps_chroma_minus8" ); pcRepFormat->setBitDepthVpsChromaMinus8 ( uiCode ); 1405 #if H_MV_6_PS_REP_FORM_18_19_20 1406 } 1407 else 1408 { 1409 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, false ); 1410 } 1411 #endif 1164 1412 } 1165 1413 … … 1174 1422 1175 1423 UInt uiCode; 1424 #if H_MV_6_PS_O0223_29 1425 READ_FLAG( uiCode, "cross_layer_pic_type_aligned_flag" ); pcVPSVUI->setCrossLayerPicTypeAlignedFlag( uiCode == 1 ); 1426 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) 1427 { 1428 READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 ); 1429 } 1430 #endif 1176 1431 READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 ); 1177 1432 READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 ); … … 1201 1456 } 1202 1457 } 1203 } 1204 } 1205 1458 } 1459 } 1460 1461 #if H_MV_6_O0226_37 1462 READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 ); 1463 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1464 { 1465 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1466 { 1467 READ_FLAG( uiCode, "tiles_in_use_flag[i]" ); pcVPSVUI->setTilesInUseFlag( i, uiCode == 1 ); 1468 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1469 { 1470 READ_FLAG( uiCode, "loop_filter_not_across_tiles_flag[i]" ); pcVPSVUI->setLoopFilterNotAcrossTilesFlag( i, uiCode == 1 ); 1471 } 1472 } 1473 1474 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1475 { 1476 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) 1477 { 1478 Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j )); 1479 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1480 { 1481 READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); pcVPSVUI->setTileBoundariesAlignedFlag( i, j, uiCode == 1 ); 1482 } 1483 } 1484 } 1485 } 1486 1487 READ_FLAG( uiCode, "wpp_not_in_use_flag" ); pcVPSVUI->setWppNotInUseFlag( uiCode == 1 ); 1488 1489 if( !pcVPSVUI->getWppNotInUseFlag( )) 1490 { 1491 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1492 { 1493 READ_FLAG( uiCode, "wpp_in_use_flag[i]" ); pcVPSVUI->setWppInUseFlag( i, uiCode == 1 ); 1494 } 1495 } 1496 #else 1206 1497 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1207 1498 { … … 1211 1502 } 1212 1503 } 1504 #endif 1213 1505 1214 1506 READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 ); … … 1232 1524 } 1233 1525 } 1234 } 1526 1527 #if H_MV_6_PS_O0118_33 1528 READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 ); 1529 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1530 { 1531 READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode ); 1532 } 1533 else 1534 { 1535 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1536 } 1537 1538 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1539 { 1540 assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL ); 1541 TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo(); 1542 parseVideoSignalInfo( curVideoSignalInfo ); 1543 pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo ); 1544 } 1545 1546 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1547 { 1548 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1549 { 1550 READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode ); 1551 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1552 } 1553 } 1554 else 1555 { 1556 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1557 { 1558 pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ); 1559 } 1560 } 1561 #endif 1562 #if H_MV_6_HRD_O0164_15 1563 READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 ); 1564 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) 1565 { 1566 parseVpsVuiBspHrdParameters( pcVPS ); 1567 } 1568 #endif 1569 } 1570 1571 #if H_MV_6_HRD_O0164_15 1572 Void TDecCavlc::parseVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1573 { 1574 assert( pcVPS ); 1575 1576 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1577 1578 assert( pcVPSVUI ); 1579 1580 TComVpsVuiBspHrdParameters* vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 1581 1582 assert ( vpsVuiBspHrdP ); 1583 1584 UInt uiCode; 1585 READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vpsVuiBspHrdP->setVpsNumBspHrdParametersMinus1( uiCode ); 1586 for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ ) 1587 { 1588 if( i > 0 ) 1589 { 1590 READ_FLAG( uiCode, "bsp_cprms_present_flag" ); vpsVuiBspHrdP->setBspCprmsPresentFlag( i, uiCode == 1 ); 1591 } 1592 TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 1593 parseHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() ); 1594 } 1595 for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ ) 1596 { 1597 READ_UVLC( uiCode, "num_bitstream_partitions" ); vpsVuiBspHrdP->setNumBitstreamPartitions( h, uiCode ); 1598 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1599 { 1600 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1601 { 1602 if( pcVPS->getLayerIdIncludedFlag( h ,j ) ) 1603 { 1604 READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 ); 1605 } 1606 else 1607 { 1608 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1609 } 1610 } 1611 } 1612 vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 1613 1614 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1615 { 1616 READ_UVLC( uiCode, "num_bsp_sched_combinations" ); vpsVuiBspHrdP->setNumBspSchedCombinations( h, uiCode ); 1617 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1618 { 1619 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1620 { 1621 READ_UVLC( uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode ); 1622 READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode ); 1623 } 1624 } 1625 } 1626 } 1627 } 1628 #endif 1629 1630 #if H_MV_6_PS_O0118_33 1631 Void TDecCavlc::parseVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1632 { 1633 UInt uiCode; 1634 READ_CODE( 3, uiCode, "video_vps_format" ); pcVideoSignalInfo->setVideoVpsFormat( uiCode ); 1635 READ_FLAG( uiCode, "video_full_range_vps_flag" ); pcVideoSignalInfo->setVideoFullRangeVpsFlag( uiCode == 1 ); 1636 READ_CODE( 8, uiCode, "colour_primaries_vps" ); pcVideoSignalInfo->setColourPrimariesVps( uiCode ); 1637 READ_CODE( 8, uiCode, "transfer_characteristics_vps" ); pcVideoSignalInfo->setTransferCharacteristicsVps( uiCode ); 1638 READ_CODE( 8, uiCode, "matrix_coeffs_vps" ); pcVideoSignalInfo->setMatrixCoeffsVps( uiCode ); 1639 } 1640 #endif 1641 1642 #if H_MV_6_HRD_O0217_13 1643 Void TDecCavlc::parseDpbSize( TComVPS* vps ) 1644 { 1645 UInt uiCode; 1646 TComDpbSize* dpbSize = vps->getDpbSize(); 1647 assert ( dpbSize != 0 ); 1648 1649 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1650 { 1651 READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 ); 1652 1653 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1654 { 1655 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1656 { 1657 READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag" ); dpbSize->setSubLayerDpbInfoPresentFlag( i, j, uiCode == 1 ); 1658 } 1659 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1660 { 1661 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1662 { 1663 READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode ); 1664 } 1665 READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode ); 1666 READ_UVLC( uiCode, "max_vps_latency_increase_plus1" ); dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode ); 1667 } 1668 else 1669 { 1670 if ( j > 0 ) 1671 { 1672 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1673 { 1674 dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); 1675 } 1676 dpbSize->setMaxVpsNumReorderPics ( i, j, dpbSize->getMaxVpsNumReorderPics ( i, j - 1 ) ); 1677 dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1678 } 1679 } 1680 } 1681 } 1682 } 1683 #endif 1235 1684 #endif 1236 1685 … … 1280 1729 if (i!=1) 1281 1730 { 1282 READ_UVLC (uiCode, "log2_sub_PU_size_minus2 "); pcVPS->setSubPULog2Size(i, uiCode+2);1731 READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]"); pcVPS->setSubPULog2Size(i, uiCode+2); 1283 1732 } 1284 1733 #endif … … 1357 1806 sps->inferRepFormat ( vps , rpcSlice->getLayerId() ); 1358 1807 sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); 1359 1808 #if H_MV_6_PS_O0118_33 1809 if ( sps->getVuiParametersPresentFlag() ) 1810 { 1811 sps->getVuiParameters()->inferVideoSignalInfo( vps, rpcSlice->getLayerId() ); 1812 } 1813 #endif 1360 1814 rpcSlice->setVPS(vps); 1361 1815 rpcSlice->setViewId ( vps->getViewId ( rpcSlice->getLayerId() ) ); … … 1411 1865 #if H_MV 1412 1866 Int esb = 0; //Don't use i, otherwise will shadow something below 1867 #if !H_MV_6_RALS_O0149_11 1413 1868 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1414 1869 { … … 1416 1871 READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 ); 1417 1872 } 1873 #endif 1418 1874 1419 1875 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1422 1878 READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 ); 1423 1879 } 1880 1881 #if H_MV_6_RALS_O0149_11 1882 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1883 { 1884 esb++; 1885 READ_FLAG( uiCode, "cross_layer_bla_flag" ); rpcSlice->setCrossLayerBlaFlag( uiCode == 1 ); 1886 } 1887 rpcSlice->checkCrossLayerBlaFlag( ); 1888 1889 if ( rpcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1890 { 1891 esb++; 1892 READ_FLAG( uiCode, "poc_reset_flag" ); rpcSlice->setPocResetFlag( uiCode == 1 ); 1893 } 1894 #endif 1424 1895 1425 1896 for (; esb < rpcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 1445 1916 // colour_plane_id u(2) 1446 1917 1918 1919 #if H_MV_6_POC_31_35_38 1920 UInt slicePicOrderCntLsb = 0; 1921 Int iPOClsb = slicePicOrderCntLsb; // Needed later 1922 if ( (rpcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( rpcSlice->getLayerIdInVps())) || !rpcSlice->getIdrPicFlag() ) 1923 { 1924 READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb"); 1925 } 1926 1927 Bool picOrderCntMSBZeroFlag = false; 1928 1929 // as in HM code. However are all cases for IRAP picture with NoRaslOutputFlag equal to 1 covered?? 1930 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP ); 1931 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 1932 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ); 1933 picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || rpcSlice->getIdrPicFlag(); 1934 1935 // TBD picOrderCntMSBZeroFlag = picOrderCntMSBZeroFlag || ( rpcSlice->getLayerId() > 0 && !rpcSlice->getFirstPicInLayerDecodedFlag() ); 1936 1937 Int picOrderCntMSB = 0; 1938 1939 if ( !picOrderCntMSBZeroFlag ) 1940 { 1941 Int prevPicOrderCnt = rpcSlice->getPrevTid0POC(); 1942 Int maxPicOrderCntLsb = 1 << sps->getBitsForPOC(); 1943 Int prevPicOrderCntLsb = prevPicOrderCnt & (maxPicOrderCntLsb - 1); 1944 Int prevPicOrderCntMsb = prevPicOrderCnt - prevPicOrderCntLsb; 1945 1946 if( ( slicePicOrderCntLsb < prevPicOrderCntLsb ) && ( ( prevPicOrderCntLsb - slicePicOrderCntLsb ) >= ( maxPicOrderCntLsb / 2 ) ) ) 1947 { 1948 picOrderCntMSB = prevPicOrderCntMsb + maxPicOrderCntLsb; 1949 } 1950 else if( (slicePicOrderCntLsb > prevPicOrderCntLsb ) && ( (slicePicOrderCntLsb - prevPicOrderCntLsb ) > ( maxPicOrderCntLsb / 2 ) ) ) 1951 { 1952 picOrderCntMSB = prevPicOrderCntMsb - maxPicOrderCntLsb; 1953 } 1954 else 1955 { 1956 picOrderCntMSB = prevPicOrderCntMsb; 1957 } 1958 } 1959 1960 rpcSlice->setPOC( picOrderCntMSB + slicePicOrderCntLsb ); 1961 if ( rpcSlice->getPocResetFlag() ) 1962 { 1963 rpcSlice->setPocBeforeReset ( rpcSlice->getPOC() ); 1964 rpcSlice->setPOC ( 0 ); 1965 } 1966 #endif 1967 1447 1968 if( rpcSlice->getIdrPicFlag() ) 1448 1969 { 1970 #if !H_MV_6_POC_31_35_38 1449 1971 rpcSlice->setPOC(0); 1972 #endif 1450 1973 TComReferencePictureSet* rps = rpcSlice->getLocalRPS(); 1451 1974 rps->setNumberOfNegativePictures(0); … … 1460 1983 else 1461 1984 { 1985 #if !H_MV_6_POC_31_35_38 1462 1986 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 1463 1987 Int iPOClsb = uiCode; … … 1494 2018 1495 2019 } 2020 #endif 1496 2021 #endif 1497 2022 TComReferencePictureSet* rps; … … 1628 2153 } 1629 2154 #if H_MV 2155 #if H_MV_6_ILDDS_ILREFPICS_27_34 2156 Bool interLayerPredLayerIdcPresentFlag = false; 2157 #endif 1630 2158 Int layerId = rpcSlice->getLayerId(); 1631 if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) { 2159 if( rpcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) 2160 { 1632 2161 READ_FLAG( uiCode, "inter_layer_pred_enabled_flag" ); rpcSlice->setInterLayerPredEnabledFlag( uiCode == 1 ); 1633 2162 if( rpcSlice->getInterLayerPredEnabledFlag() && vps->getNumDirectRefLayers( layerId ) > 1 ) … … 1639 2168 if ( rpcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1640 2169 { 2170 #if H_MV_6_ILDDS_ILREFPICS_27_34 2171 interLayerPredLayerIdcPresentFlag = true; 2172 #endif 1641 2173 for( Int idx = 0; idx < rpcSlice->getNumActiveRefLayerPics(); idx++ ) 1642 2174 { … … 1646 2178 } 1647 2179 } 2180 #if H_MV_6_ILDDS_ILREFPICS_27_34 2181 if ( !interLayerPredLayerIdcPresentFlag ) 2182 { 2183 for( Int i = 0; i < rpcSlice->getNumActiveRefLayerPics(); i++ ) 2184 { 2185 rpcSlice->setInterLayerPredLayerIdc( i, rpcSlice->getRefLayerPicIdc( i ) ); 2186 } 2187 } 2188 #endif 1648 2189 #endif 1649 2190 if(sps->getUseSAO()) -
branches/HTM-9.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.h
r655 r730 78 78 #if H_MV 79 79 Void parseVPSExtension ( TComVPS* pcVPS ); 80 #if H_MV_6_PS_REP_FORM_18_19_20 81 Void parseRepFormat ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat ); 82 #else 80 83 Void parseRepFormat ( TComRepFormat* pcRepFormat ); 84 #endif 81 85 Void parseVPSVUI ( TComVPS* pcVPS ); 86 #if H_MV_6_PS_O0118_33 87 Void parseVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo ); 88 #endif 89 #if H_MV_6_HRD_O0217_13 90 Void parseDpbSize ( TComVPS* pcVPS ); 91 #endif 92 #if H_MV_6_HRD_O0164_15 93 Void parseVpsVuiBspHrdParameters( TComVPS* pcVPS ); 94 #endif 82 95 #endif 83 96 -
branches/HTM-9.0-dev0/source/Lib/TLibDecoder/TDecTop.cpp
r724 r730 635 635 #if H_MV 636 636 m_apcSlicePilot->setVPS(vps); 637 #if H_MV_6_PS_0092_17 638 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 639 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) ); 640 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 641 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) ); 642 #endif 637 643 sps->inferRepFormat ( vps , m_layerId ); 638 644 sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); … … 665 671 666 672 #if H_MV 673 #if H_MV_FIX_SKIP_PICTURES 674 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 675 #else 667 676 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ) 677 #endif 668 678 { 669 679 assert( nalu.m_layerId == m_layerId ); 670 671 680 #else 672 681 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 722 731 #endif 723 732 #endif 733 734 #if H_MV_LAYER_WISE_STARTUP 735 xCeckNoClrasOutput(); 736 #endif 724 737 // Skip pictures due to random access 725 738 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 726 739 { 727 m_prevSliceSkipped = true; 728 m_skippedPOC = m_apcSlicePilot->getPOC(); 740 m_prevSliceSkipped = true; 741 m_skippedPOC = m_apcSlicePilot->getPOC(); 742 #if H_MV_FIX_SKIP_PICTURES 743 sliceSkippedFlag = true; 744 #endif 729 745 return false; 730 746 } … … 732 748 if (isSkipPictureForBLA(iPOCLastDisplay)) 733 749 { 734 m_prevSliceSkipped = true; 735 m_skippedPOC = m_apcSlicePilot->getPOC(); 750 m_prevSliceSkipped = true; 751 m_skippedPOC = m_apcSlicePilot->getPOC(); 752 #if H_MV_FIX_SKIP_PICTURES 753 sliceSkippedFlag = true; 754 #endif 736 755 return false; 737 756 } … … 788 807 xCreateLostPicture(lostPoc-1); 789 808 } 809 790 810 if (m_bFirstSliceInPicture) 791 811 { … … 1171 1191 1172 1192 #if H_MV 1193 #if H_MV_FIX_SKIP_PICTURES 1194 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 1195 #else 1173 1196 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag) 1197 #endif 1174 1198 #else 1175 1199 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) … … 1216 1240 case NAL_UNIT_CODED_SLICE_RASL_R: 1217 1241 #if H_MV 1242 #if H_MV_FIX_SKIP_PICTURES 1243 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag ); 1244 #else 1218 1245 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag); 1246 #endif 1219 1247 #else 1220 1248 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); … … 1242 1270 return true; 1243 1271 } 1272 1244 1273 return false; 1245 1274 } … … 1265 1294 return true; 1266 1295 } 1296 #if H_MV_LAYER_WISE_STARTUP 1297 else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet. 1298 #else 1267 1299 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1300 #endif 1268 1301 { 1269 1302 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA … … 1272 1305 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ) 1273 1306 { 1307 1308 #if H_MV_LAYER_WISE_STARTUP 1309 if ( xAllRefLayersInitilized() ) 1310 { 1311 m_layerInitilizedFlag[ m_layerId ] = true; 1312 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1313 } 1314 else 1315 { 1316 return true; 1317 } 1318 #else 1274 1319 // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT. 1275 1320 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1321 #endif 1276 1322 } 1277 1323 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1278 1324 { 1325 #if H_MV_LAYER_WISE_STARTUP 1326 if ( xAllRefLayersInitilized() ) 1327 { 1328 m_layerInitilizedFlag[ m_layerId ] = true; 1329 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1330 } 1331 else 1332 { 1333 return true; 1334 } 1335 #else 1279 1336 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1337 #endif 1280 1338 } 1281 1339 else 1282 1340 { 1341 #if H_MV_FIX_SKIP_PICTURES 1342 static Bool warningMessage[MAX_NUM_LAYERS]; 1343 static Bool warningInitFlag = false; 1344 1345 if (!warningInitFlag) 1346 { 1347 for ( Int i = 0; i < MAX_NUM_LAYERS; i++) 1348 { 1349 warningMessage[i] = true; 1350 } 1351 warningInitFlag = true; 1352 } 1353 1354 if ( warningMessage[getLayerId()] ) 1355 { 1356 printf("\nLayer%3d No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() ); 1357 warningMessage[m_layerId] = false; 1358 } 1359 #else 1283 1360 static Bool warningMessage = false; 1284 1361 if(!warningMessage) … … 1287 1364 warningMessage = true; 1288 1365 } 1366 #endif 1289 1367 return true; 1290 1368 } … … 1296 1374 return true; 1297 1375 } 1376 #if H_MV_LAYER_WISE_STARTUP 1377 return !m_layerInitilizedFlag[ getLayerId() ]; 1378 #else 1298 1379 // if we reach here, then the picture is not skipped. 1299 1380 return false; 1381 #endif 1300 1382 } 1301 1383 … … 1338 1420 } 1339 1421 } 1422 1423 #if H_MV_LAYER_WISE_STARTUP 1424 Void TDecTop::xCeckNoClrasOutput() 1425 { 1426 // This part needs further testing! 1427 if ( getLayerId() == 0 ) 1428 { 1429 NalUnitType nut = m_apcSlicePilot->getNalUnitType(); 1430 1431 Bool isBLA = ( nut == NAL_UNIT_CODED_SLICE_BLA_W_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 1432 Bool isIDR = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP ); 1433 Bool noClrasOutputFlag = isBLA || ( isIDR && m_apcSlicePilot->getCrossLayerBlaFlag() ); 1434 1435 if ( noClrasOutputFlag ) 1436 { 1437 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 1438 { 1439 m_layerInitilizedFlag[i] = false; 1440 } 1441 } 1442 } 1443 } 1444 1445 Bool TDecTop::xAllRefLayersInitilized() 1446 { 1447 Bool allRefLayersInitilizedFlag = true; 1448 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1449 for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId() ); i++ ) 1450 { 1451 Int refLayerId = vps->getRefLayerId( m_layerId, i ); 1452 allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 1453 } 1454 1455 return allRefLayersInitilizedFlag; 1456 } 1457 #endif 1340 1458 #endif 1341 1459 //! \} -
branches/HTM-9.0-dev0/source/Lib/TLibDecoder/TDecTop.h
r724 r730 186 186 TComList<TComPic*> m_cListPic; // Dynamic buffer 187 187 #if H_MV 188 #if H_MV_LAYER_WISE_STARTUP 189 Bool* m_layerInitilizedFlag; // initialization Layers 190 #endif 188 191 static ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 189 192 #else … … 243 246 Void init(); 244 247 #if H_MV 248 #if H_MV_FIX_SKIP_PICTURES 249 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer, Bool& sliceSkippedFlag ); 250 #else 251 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer ); 252 #endif 245 253 Bool decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayer ); 246 254 #else … … 260 268 TComList<TComPic*>* getListPic () { return &m_cListPic; } 261 269 Void setIvPicLists ( TComPicLists* picLists) { m_ivPicLists = picLists; } 262 270 #if H_MV_LAYER_WISE_STARTUP 271 Void setLayerInitilizedFlags( Bool* val ) { m_layerInitilizedFlag = val; } 272 #endif 273 #if H_MV_6_HRD_O0217_13 274 TComVPS* getPrefetchedVPS () { return m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); }; //Assuming that currently only one VPS is present. 275 #endif 263 276 Int getCurrPoc () { return m_apcSlicePilot->getPOC(); } 264 277 Void setLayerId ( Int layer) { m_layerId = layer; } … … 281 294 #if H_MV 282 295 TComPic* xGetPic( Int layerId, Int poc ); 296 #if H_MV_FIX_SKIP_PICTURES 297 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ); 298 #else 283 299 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ); 300 #endif 284 301 Void xResetPocInPicBuffer(); 302 #if H_MV_LAYER_WISE_STARTUP 303 Void xCeckNoClrasOutput(); 304 305 Bool xAllRefLayersInitilized(); 306 #endif 285 307 #else 286 308 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); … … 291 313 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); 292 314 315 293 316 };// END CLASS DEFINITION TDecTop 294 317 -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
r724 r730 280 280 } 281 281 WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(), "video_signal_type_present_flag"); 282 #if H_MV_6_PS_O0118_33 283 assert( pcSPS->getLayerId() == 0 || !pcVUI->getVideoSignalTypePresentFlag() ); 284 #endif 282 285 if (pcVUI->getVideoSignalTypePresentFlag()) 283 286 { … … 443 446 { 444 447 WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" ); 448 #if H_MV_6_PS_REP_FORM_18_19_20 449 if ( pcSPS->getUpdateRepFormatFlag() ) 450 { 451 WRITE_CODE( pcSPS->getSpsRepFormatIdx( ), 8, "sps_rep_format_idx" ); 452 } 453 } 454 else 455 { 456 #else 445 457 } 446 458 447 459 if ( pcSPS->getUpdateRepFormatFlag() ) 448 460 { 461 #endif 449 462 #endif 450 463 WRITE_UVLC( pcSPS->getChromaFormatIdc (), "chroma_format_idc" ); … … 472 485 } 473 486 #if H_MV 487 #if H_MV_6_PS_REP_FORM_18_19_20 488 if ( pcSPS->getLayerId() == 0 ) 489 #else 474 490 if ( pcSPS->getUpdateRepFormatFlag() ) 491 #endif 475 492 { 476 493 #endif … … 577 594 WRITE_FLAG( 0, "sps_extension_flag" ); 578 595 #else 596 #if H_MV_6_PSEM_O0142_3 597 WRITE_FLAG( pcSPS->getSpsExtensionFlag(), "sps_extension_flag" ); 598 599 if ( pcSPS->getSpsExtensionFlag() ) 600 { 601 for (Int i = 0; i < PS_EX_T_MAX_NUM; i++) 602 { 603 WRITE_FLAG( pcSPS->getSpsExtensionTypeFlag( i ) ? 1 : 0 , "sps_extension_type_flag" ); 604 #if H_3D 605 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D ); 606 #else 607 assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV ); 608 #endif 609 } 610 611 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV )) 612 { 613 codeSPSExtension( pcSPS ); 614 } 615 616 #if H_3D 617 if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D )) 618 { 619 codeSPSExtension2( pcSPS, viewIndex, depthFlag ); 620 } 621 #endif 622 } 623 #else 579 624 WRITE_FLAG( 1, "sps_extension_flag" ); 580 625 codeSPSExtension( pcSPS ); … … 587 632 #endif 588 633 #endif 634 #endif 589 635 } 590 636 … … 593 639 { 594 640 WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" ); 641 642 #if !H_MV_6_SHVC_O0098_36 595 643 WRITE_UVLC( 0, "sps_shvc_reserved_zero_idc" ); 644 #else 645 WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" ); 646 647 for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++) 648 { 649 WRITE_CODE( pcSPS->getScaledRefLayerId( i ), 6, "scaled_ref_layer_id" ); 650 651 Int j = pcSPS->getScaledRefLayerId( i ); 652 653 WRITE_SVLC( pcSPS->getScaledRefLayerLeftOffset( j ), "scaled_ref_layer_left_offset" ); 654 WRITE_SVLC( pcSPS->getScaledRefLayerTopOffset( j ), "scaled_ref_layer_top_offset" ); 655 WRITE_SVLC( pcSPS->getScaledRefLayerRightOffset( j ), "scaled_ref_layer_right_offset" ); 656 WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" ); 657 } 658 #endif 596 659 } 597 660 #endif … … 740 803 { 741 804 WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0, "avc_base_layer_flag" ); 805 #if H_MV_6_PS_O0109_24 806 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" ); 807 if ( pcVPS->getVpsVuiPresentFlag() ) 808 { 809 #endif 742 810 WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16, "vps_vui_offset" ); // TBD 811 #if H_MV_6_PS_O0109_24 812 } 813 #endif 743 814 WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0, "splitting_flag" ); 744 815 … … 786 857 } 787 858 859 860 #if H_MV_6_PS_O0109_22 861 WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" ); 862 863 if ( pcVPS->getViewIdLen( ) > 0 ) 864 { 865 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 866 { 867 WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" ); 868 } 869 } 870 else 871 { 872 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 873 { 874 assert( pcVPS->getViewIdVal( i ) == 0 ); 875 } 876 } 877 #else 788 878 // GT spec says: trac #39 789 879 // if ( pcVPS->getNumViews() > 1 ) … … 792 882 WRITE_CODE( pcVPS->getViewIdLenMinus1( ), 4, "view_id_len_minus1" ); 793 883 } 794 795 884 for( Int i = 0; i < pcVPS->getNumViews(); i++ ) 796 885 { 797 886 WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" ); 798 887 } 888 #endif 889 799 890 800 891 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 805 896 } 806 897 } 807 898 #if H_MV_6_ILDSD_O0120_26 899 WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" ); 900 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 901 { 902 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 903 { 904 WRITE_CODE( pcVPS->getSubLayersVpsMaxMinus1( i ), 3, "sub_layers_vps_max_minus1" ); 905 pcVPS->checkSubLayersVpsMaxMinus1( i ); 906 } 907 } 908 else 909 { 910 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 911 { 912 assert( pcVPS->getSubLayersVpsMaxMinus1( i ) + 1 == pcVPS->getMaxTLayers( ) ); 913 } 914 } 915 #endif 808 916 WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" ); 809 917 … … 812 920 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 813 921 { 922 #if H_MV_6_ILDDS_O0225_30 923 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 924 { 925 if ( pcVPS->getDirectDependencyFlag(j,i) ) 926 { 927 WRITE_CODE( pcVPS->getMaxTidIlRefPicsPlus1( i, j ), 3, "max_tid_il_ref_pics_plus1" ); 928 } 929 } 930 #else 814 931 WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3, "max_tid_il_ref_pics_plus1[i]" ); 932 #endif 815 933 } 816 934 } … … 826 944 { 827 945 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" ); 946 #if H_MV_6_PS_O0109_23 947 pcVPS->checkProfileRefMinus1( i ); 948 #endif 828 949 } 829 950 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 ); … … 842 963 if( numOutputLayerSets > 1) 843 964 { 965 #if H_MV_6_PS_0109_25 966 WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" ); 967 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 968 #else 844 969 WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" ); 970 #endif 845 971 } 846 972 973 #if H_MV_6_HRD_O0217_13 974 assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 975 assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 976 #endif 847 977 for( Int i = 1; i < numOutputLayerSets; i++ ) 848 978 { … … 855 985 } 856 986 } 987 #if H_MV_6_HRD_O0217_13 988 else 989 { // These inference rules would also be helpful in spec text 990 assert( pcVPS->getOutputLayerSetIdxMinus1(i ) == i - 1 ); 991 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 992 { 993 assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 994 } 995 } 996 #endif 997 857 998 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 858 999 { … … 861 1002 } 862 1003 1004 #if H_MV_6_GEN_0153_28 1005 if( pcVPS->getMaxLayersMinus1() > 0 ) 1006 { 1007 WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" ); 1008 } 1009 #endif 1010 863 1011 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); 864 1012 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 869 1017 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 870 1018 { 1019 #if H_MV_6_PS_REP_FORM_18_19_20 1020 TComRepFormat* curRepFormat = pcVPS->getRepFormat(i); 1021 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1022 codeRepFormat( i, curRepFormat , prevRepFormat); 1023 #else 871 1024 TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i); 872 1025 codeRepFormat( pcRepFormat ); 1026 #endif 873 1027 } 874 1028 … … 879 1033 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 880 1034 { 1035 #if H_MV_6_PS_REP_FORM_18_19_20 1036 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" ); 1037 #else 881 1038 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" ); 1039 #endif 882 1040 } 883 1041 } … … 885 1043 886 1044 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" ); 1045 #if H_MV_6_MISC_O0062_31 1046 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1047 { 1048 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) == 0 ) 1049 { 1050 WRITE_FLAG( pcVPS->getPocLsbNotPresentFlag( i ) ? 1 : 0 , "poc_lsb_not_present_flag" ); 1051 } 1052 } 1053 #endif 1054 #if H_MV_6_HRD_O0217_13 1055 codeDpbSize( pcVPS ); 1056 #endif 1057 1058 #if !H_MV_6_PS_O0223_29 887 1059 WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1060 #endif 888 1061 WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ), "direct_dep_type_len_minus2"); 889 1062 1063 #if H_MV_6_PS_O0096_21 1064 WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" ); 1065 1066 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1067 { 1068 WRITE_CODE( pcVPS->getDefaultDirectDependencyType( ), pcVPS->getDirectDepTypeLenMinus2( ) + 2 , "default_direct_dependency_type" ); 1069 } 1070 1071 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1072 { 1073 for( Int j = 0; j < i; j++ ) 1074 { 1075 if (pcVPS->getDirectDependencyFlag( i, j) ) 1076 { 1077 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1078 { 1079 assert( pcVPS->getDirectDependencyType( i, j ) == pcVPS->getDefaultDirectDependencyType( ) ); 1080 } 1081 else 1082 { 1083 assert ( pcVPS->getDirectDependencyType( i, j ) != -1 ); 1084 WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2, "direct_dependency_type[i][j]" ); 1085 } 1086 } 1087 } 1088 } 1089 #else 890 1090 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 891 1091 { … … 899 1099 } 900 1100 } 901 1101 #endif 902 1102 WRITE_FLAG ( 0, "vps_shvc_reserved_zero_flag" ); 1103 #if !H_MV_6_PS_O0109_24 903 1104 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" ); 1105 #endif 904 1106 905 1107 if( pcVPS->getVpsVuiPresentFlag() ) … … 909 1111 } 910 1112 } 911 1113 #if H_MV_6_PS_O0118_33 1114 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1115 { 1116 assert( pcVideoSignalInfo ); 1117 WRITE_CODE( pcVideoSignalInfo->getVideoVpsFormat( ), 3, "video_vps_format" ); 1118 WRITE_FLAG( pcVideoSignalInfo->getVideoFullRangeVpsFlag( ) ? 1 : 0 , "video_full_range_vps_flag" ); 1119 WRITE_CODE( pcVideoSignalInfo->getColourPrimariesVps( ), 8, "colour_primaries_vps" ); 1120 WRITE_CODE( pcVideoSignalInfo->getTransferCharacteristicsVps( ), 8, "transfer_characteristics_vps" ); 1121 WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" ); 1122 } 1123 #endif 1124 1125 #if H_MV_6_HRD_O0217_13 1126 Void TEncCavlc::codeDpbSize( TComVPS* vps ) 1127 { 1128 TComDpbSize* dpbSize = vps->getDpbSize(); 1129 assert ( dpbSize != 0 ); 1130 1131 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1132 { 1133 WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" ); 1134 1135 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1136 { 1137 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1138 { 1139 WRITE_FLAG( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ? 1 : 0 , "sub_layer_dpb_info_present_flag" ); 1140 } 1141 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1142 { 1143 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) // Preliminary fix does not match with spec 1144 { 1145 WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" ); 1146 } 1147 WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" ); 1148 WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" ); 1149 } 1150 else 1151 { 1152 if ( j > 0 ) 1153 { 1154 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1155 { 1156 assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); 1157 } 1158 assert( dpbSize->getMaxVpsNumReorderPics ( i, j ) == dpbSize->getMaxVpsNumReorderPics ( i, j - 1 ) ); 1159 assert( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) == dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1160 } 1161 } 1162 } 1163 } 1164 } 1165 #endif 1166 1167 #if H_MV_6_PS_REP_FORM_18_19_20 1168 Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1169 #else 912 1170 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat ) 1171 #endif 913 1172 { 914 1173 assert( pcRepFormat ); 915 1174 916 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 917 918 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 919 { 920 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 921 } 1175 #if H_MV_6_PS_REP_FORM_18_19_20 922 1176 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 923 1177 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1178 WRITE_FLAG( pcRepFormat->getChromaAndBitDepthVpsPresentFlag( ) ? 1 : 0 , "chroma_and_bit_depth_vps_present_flag" ); 1179 1180 pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i ); 1181 1182 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1183 { 1184 #endif 1185 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 1186 1187 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 1188 { 1189 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 1190 } 1191 #if !H_MV_6_PS_REP_FORM_18_19_20 1192 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 1193 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1194 #endif 924 1195 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" ); 925 1196 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" ); 1197 #if H_MV_6_PS_REP_FORM_18_19_20 1198 } 1199 else 1200 { 1201 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true ); 1202 } 1203 #endif 926 1204 } 927 1205 … … 933 1211 934 1212 assert( pcVPSVUI ); 1213 1214 #if H_MV_6_PS_O0223_29 1215 WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" ); 1216 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) 1217 { 1218 WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1219 } 1220 #endif 935 1221 936 1222 WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" ); … … 964 1250 } 965 1251 1252 #if H_MV_6_O0226_37 1253 WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" ); 1254 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1255 { 1256 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1257 { 1258 WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" ); 1259 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1260 { 1261 WRITE_FLAG( pcVPSVUI->getLoopFilterNotAcrossTilesFlag( i ) ? 1 : 0, "loop_filter_not_across_tiles_flag[i]" ); 1262 } 1263 } 1264 1265 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1266 { 1267 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) 1268 { 1269 Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j )); 1270 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1271 { 1272 WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" ); 1273 } 1274 } 1275 } 1276 } 1277 1278 WRITE_FLAG( pcVPSVUI->getWppNotInUseFlag( ) ? 1 : 0 , "wpp_not_in_use_flag" ); 1279 1280 if( !pcVPSVUI->getWppNotInUseFlag( ) ) 1281 { 1282 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1283 { 1284 WRITE_FLAG( pcVPSVUI->getWppInUseFlag( i ) ? 1 : 0 , "wpp_in_use_flag[i]" ); 1285 } 1286 } 1287 #else 966 1288 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 967 1289 { … … 971 1293 } 972 1294 } 973 1295 #endif 974 1296 WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" ); 975 1297 … … 992 1314 } 993 1315 } 994 } 1316 #if H_MV_6_PS_O0118_33 1317 WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" ); 1318 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1319 { 1320 WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" ); 1321 } 1322 else 1323 { 1324 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1325 } 1326 1327 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1328 { 1329 assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL ); 1330 TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i ); 1331 codeVideoSignalInfo( curVideoSignalInfo ); 1332 } 1333 1334 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1335 { 1336 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1337 { 1338 WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" ); 1339 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1340 } 1341 } 1342 else 1343 { 1344 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1345 { 1346 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 1347 } 1348 } 1349 #endif 1350 #if H_MV_6_HRD_O0164_15 1351 WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" ); 1352 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) 1353 { 1354 codeVpsVuiBspHrdParameters( pcVPS ); 1355 } 1356 #endif 1357 } 1358 #if H_MV_6_HRD_O0164_15 1359 Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1360 { 1361 assert( pcVPS ); 1362 1363 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1364 1365 assert( pcVPSVUI ); 1366 1367 TComVpsVuiBspHrdParameters* vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 1368 1369 assert ( vpsVuiBspHrdP ); 1370 1371 1372 WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" ); 1373 for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ ) 1374 { 1375 if( i > 0 ) 1376 { 1377 WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" ); 1378 } 1379 TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 1380 codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() ); 1381 } 1382 for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ ) 1383 { 1384 WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" ); 1385 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1386 { 1387 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1388 { 1389 if( pcVPS->getLayerIdIncludedFlag( h ,j ) ) 1390 { 1391 WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" ); 1392 } 1393 else 1394 { 1395 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1396 } 1397 } 1398 } 1399 vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 1400 1401 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1402 { 1403 WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" ); 1404 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1405 { 1406 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1407 { 1408 WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" ); 1409 WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" ); 1410 } 1411 } 1412 } 1413 } 1414 } 1415 #endif 1416 995 1417 #endif 996 1418 … … 1115 1537 #if H_MV 1116 1538 Int esb = 0; //Don't use i, otherwise will shadow something below 1539 #if !H_MV_6_RALS_O0149_11 1117 1540 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1118 1541 { … … 1120 1543 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1121 1544 } 1545 #endif 1122 1546 1123 1547 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1126 1550 WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" ); 1127 1551 } 1552 1553 #if H_MV_6_RALS_O0149_11 1554 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1555 { 1556 esb++; 1557 WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" ); 1558 } 1559 pcSlice->checkCrossLayerBlaFlag( ); 1560 1561 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1562 { 1563 esb++; 1564 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1565 } 1566 #endif 1567 1568 1128 1569 1129 1570 for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 1148 1589 // colour_plane_id u(2) 1149 1590 1591 #if H_MV_6_POC_31_35_38 1592 if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() ) 1593 { 1594 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1595 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb"); 1596 } 1597 #endif 1150 1598 if( !pcSlice->getIdrPicFlag() ) 1151 1599 { 1600 #if !H_MV_6_POC_31_35_38 1152 1601 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1153 1602 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1603 #endif 1154 1604 TComReferencePictureSet* rps = pcSlice->getRPS(); 1155 1605 … … 1265 1715 } 1266 1716 #if H_MV 1717 #if H_MV_6_ILDDS_ILREFPICS_27_34 1718 Bool interLayerPredLayerIdcPresentFlag = false; 1719 #endif 1267 1720 Int layerId = pcSlice->getLayerId(); 1268 1721 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) … … 1276 1729 } 1277 1730 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1278 { 1731 { 1732 #if H_MV_6_ILDDS_ILREFPICS_27_34 1733 interLayerPredLayerIdcPresentFlag = true; 1734 #endif 1279 1735 for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ ) 1280 1736 { … … 1284 1740 } 1285 1741 } 1742 #if H_MV_6_ILDDS_ILREFPICS_27_34 1743 if ( !interLayerPredLayerIdcPresentFlag ) 1744 { 1745 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1746 { 1747 assert( pcSlice->getInterLayerPredLayerIdc( i ) == pcSlice->getRefLayerPicIdc( i ) ); 1748 } 1749 } 1750 #endif 1286 1751 #endif 1287 1752 if(pcSlice->getSPS()->getUseSAO()) -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncCavlc.h
r655 r730 85 85 Void codeVPS ( TComVPS* pcVPS ); 86 86 #if H_MV 87 Void codeVPSExtension ( TComVPS *pcVPS ); 88 Void codeRepFormat ( TComRepFormat* pcRepFormat ); 89 Void codeVPSVUI ( TComVPS* pcVPS ); 87 Void codeVPSExtension ( TComVPS *pcVPS ); 88 #if H_MV_6_PS_O0118_33 89 Void codeVideoSignalInfo ( TComVideoSignalInfo* pcVideoSignalInfo ); 90 #endif 91 92 #if H_MV_6_HRD_O0217_13 93 Void codeDpbSize ( TComVPS* vps ); 94 #endif 95 96 #if H_MV_6_PS_REP_FORM_18_19_20 97 Void codeRepFormat ( Int i, TComRepFormat* curRepFormat, TComRepFormat* prevRepFormat ); 98 #else 99 Void codeRepFormat ( TComRepFormat* pcRepFormat ); 100 #endif 101 Void codeVPSVUI ( TComVPS* pcVPS ); 102 #if H_MV_6_HRD_O0164_15 103 Void codeVpsVuiBspHrdParameters( TComVPS* pcVPS ); 104 #endif 90 105 #endif 91 106 Void codeVUI ( TComVUI *pcVUI, TComSPS* pcSPS ); -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp
r724 r730 664 664 refPicListModification->setRefPicListModificationFlagL1(0); 665 665 #if H_MV 666 #if H_MV_6_RALS_O0149_11 667 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 ) 668 #else 666 669 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 1 ) 670 #endif 667 671 { 668 672 // Some more sophisticated algorithm to determine discardable_flag might be added here. … … 673 677 Int numDirectRefLayers = vps ->getNumDirectRefLayers( getLayerId() ); 674 678 GOPEntry gopEntry = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid ); 675 679 680 #if H_MV_6_ILDDS_ILREFPICS_27_34 681 Bool interLayerPredLayerIdcPresentFlag = false; 682 #endif 676 683 if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 ) 677 684 { … … 685 692 if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) ) 686 693 { 694 #if H_MV_6_ILDDS_ILREFPICS_27_34 695 interLayerPredLayerIdcPresentFlag = true; 696 #endif 687 697 for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ ) 688 698 { … … 692 702 } 693 703 } 704 #if H_MV_6_ILDDS_ILREFPICS_27_34 705 if ( !interLayerPredLayerIdcPresentFlag ) 706 { 707 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 708 { 709 pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) ); 710 } 711 } 712 #endif 713 714 694 715 assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 695 716 -
branches/HTM-9.0-dev0/source/Lib/TLibEncoder/TEncTop.cpp
r724 r730 719 719 720 720 #if H_MV 721 #if H_MV_6_PS_REP_FORM_18_19_20 722 m_cSPS.setUpdateRepFormatFlag ( false ); 723 #else 721 724 m_cSPS.setUpdateRepFormatFlag ( m_layerId == 0 ); 725 #endif 722 726 m_cSPS.setSpsInferScalingListFlag ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 723 727 m_cSPS.setSpsScalingListRefLayerId ( 0 ); 728 #if H_MV_6_PSEM_O0142_3 729 m_cSPS.setSpsExtensionFlag ( true ); 730 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_MV ,true ); 731 #if H_3D 732 m_cSPS.setSpsExtensionTypeFlag ( PS_EX_T_3D ,true ); 733 #endif 734 #endif 724 735 #endif 725 736 m_cSPS.setPicWidthInLumaSamples ( m_iSourceWidth ); … … 808 819 pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag()); 809 820 pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag()); 821 #if H_MV_6_PS_O0118_33 822 pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag() && getLayerId() == 0 ); 823 #else 810 824 pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag()); 825 #endif 811 826 pcVUI->setVideoFormat(getVideoFormat()); 812 827 pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag()); … … 922 937 m_cPPS.setOutputFlagPresentFlag( false ); 923 938 #if H_MV 939 #if H_MV_6_RALS_O0149_11 940 m_cPPS.setNumExtraSliceHeaderBits( 3 ); 941 #else 924 942 m_cPPS.setNumExtraSliceHeaderBits( 2 ); 943 #endif 925 944 #endif 926 945 m_cPPS.setSignHideFlag(getSignHideFlag());
Note: See TracChangeset for help on using the changeset viewer.