- Timestamp:
- 10 Dec 2013, 13:50:12 (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cfg/3D-HEVC/NonCTC/allintra/baseCfg_2view+depth_AllIntra.cfg
r735 r738 167 167 DepthRefinement : 1 # Dispary refined by depth DoNBDV 168 168 IvMvScaling : 1 # Interview motion vector scaling 169 SubPULog2Size : 3 169 SubPULog2Size : 3 # Log2 of sub-PU size for IvMvPred (2...6) 170 170 171 171 -
trunk/cfg/3D-HEVC/NonCTC/allintra/baseCfg_3view+depth_AllIntra.cfg
r735 r738 182 182 DepthRefinement : 1 # Dispary refined by depth DoNBDV 183 183 IvMvScaling : 1 # Interview motion vector scaling 184 SubPULog2Size : 3 184 SubPULog2Size : 3 # Log2 of sub-PU size for IvMvPred (2...6) 185 185 186 186 -
trunk/source/App/TAppDecoder/TAppDecCfg.cpp
r608 r738 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 #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 87 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 -
trunk/source/App/TAppDecoder/TAppDecCfg.h
r608 r738 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 {} -
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r655 r738 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 214 #if !H_MV_6_HRD_O0217_13 203 215 Int decIdx = xGetDecoderIdx( nalu.m_layerId , true ); 204 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 … … 216 245 // - nalu.isSlice() == true 217 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 266 220 267 if ( nalu.isSlice() && firstSlice ) 268 #endif 221 269 { 222 270 layerIdCurrPic = nalu.m_layerId; … … 832 880 { 833 881 Int decIdx = -1; 882 883 #if H_MV_6_LAYER_ID_32 884 if ( layerId > MAX_NUM_LAYER_IDS-1 ) 885 { 886 return decIdx; 887 } 888 #endif 889 834 890 if ( m_layerIdToDecIdx[ layerId ] != -1 ) 835 891 { … … 850 906 m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 851 907 m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 908 #if H_MV_LAYER_WISE_STARTUP 909 m_tDecTop[ decIdx ]->setLayerInitilizedFlags( m_layerInitilizedFlags ); 910 #endif 911 852 912 #if H_3D 853 913 m_tDecTop[ decIdx ]->setCamParsCollector( &m_cCamParsCollector ); -
trunk/source/App/TAppDecoder/TAppDecTop.h
r655 r738 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 -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r724 r738 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 -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r724 r738 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 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r735 r738 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 ); … … 1332 1336 Int maxViewId = xGetMax( m_viewId ); 1333 1337 1338 #if H_MV_6_PS_O0109_22 1339 Int viewIdLen = gCeilLog2( maxViewId + 1 ); 1340 const Int maxViewIdLen = ( 1 << 4 ) - 1; 1341 assert( viewIdLen <= maxViewIdLen ); 1342 vps.setViewIdLen( viewIdLen ); 1343 #else 1334 1344 Int viewIdLenMinus1 = std::max( gCeilLog2( maxViewId + 1 ) - 1, 0 ) ; 1335 1345 const Int maxViewIdLenMinus1 = ( 1 << 4 ) - 1; 1336 1346 assert( viewIdLenMinus1 <= maxViewIdLenMinus1 ); 1337 1347 vps.setViewIdLenMinus1( viewIdLenMinus1 ); 1348 #endif 1338 1349 for (Int i = 0; i < m_iNumberOfViews; i++) 1339 1350 { … … 1355 1366 } 1356 1367 } 1368 1369 #if H_MV_6_PS_O0096_21 1370 Int defaultDirectDependencyType = -1; 1371 Bool defaultDirectDependencyFlag = true; 1372 #endif 1357 1373 for( Int depLayer = 1; depLayer < m_numberOfLayers; depLayer++ ) 1358 1374 { … … 1363 1379 Int refLayer = m_directRefLayers[depLayer][i]; 1364 1380 vps.setDirectDependencyFlag( depLayer, refLayer, true); 1381 #if H_MV_6_PS_O0096_21 1382 Int curDirectDependencyType = m_dependencyTypes[depLayer][i]; 1383 1384 if ( defaultDirectDependencyType != -1 ) 1385 { 1386 defaultDirectDependencyFlag = defaultDirectDependencyFlag && (curDirectDependencyType == defaultDirectDependencyType ); 1387 } 1388 else 1389 { 1390 defaultDirectDependencyType = curDirectDependencyType; 1391 } 1392 1393 vps.setDirectDependencyType( depLayer, refLayer, curDirectDependencyType); 1394 #else 1365 1395 vps.setDirectDependencyType( depLayer, refLayer,m_dependencyTypes[depLayer][i]); 1366 } 1367 } 1396 #endif 1397 } 1398 } 1399 1400 #if H_MV_6_PS_O0096_21 1401 vps.setDefaultDirectDependencyFlag( defaultDirectDependencyFlag ); 1402 vps.setDefaultDirectDependencyType( defaultDirectDependencyFlag ? defaultDirectDependencyType : -1 ); 1403 #endif 1404 1405 #if H_MV_6_ILDSD_O0120_26 1406 // Max sub layers, + presence flag 1407 Bool subLayersMaxMinus1PresentFlag = false; 1408 Int subLayersMaxMinus1 = -1; 1409 for (Int curLayerIdInVps = 0; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++ ) 1410 { 1411 Int curSubLayersMaxMinus1 = -1; 1412 for( Int i = 0; i < getGOPSize(); i++ ) 1413 { 1414 GOPEntry geCur = m_GOPListMvc[curLayerIdInVps][i]; 1415 curSubLayersMaxMinus1 = std::max( curSubLayersMaxMinus1, geCur.m_temporalId ); 1416 } 1417 1418 vps.setSubLayersVpsMaxMinus1( curLayerIdInVps, curSubLayersMaxMinus1 ); 1419 if ( subLayersMaxMinus1 == -1 ) 1420 { 1421 subLayersMaxMinus1 = curSubLayersMaxMinus1; 1422 } 1423 else 1424 { 1425 subLayersMaxMinus1PresentFlag = subLayersMaxMinus1PresentFlag || ( curSubLayersMaxMinus1 != subLayersMaxMinus1 ); 1426 } 1427 } 1428 1429 vps.setVpsSubLayersMaxMinus1PresentFlag( subLayersMaxMinus1PresentFlag ); 1430 #endif 1431 1368 1432 1369 1433 // Max temporal id for inter layer reference pictures + presence flag … … 1371 1435 for ( Int refLayerIdInVps = 0; refLayerIdInVps < m_numberOfLayers; refLayerIdInVps++) 1372 1436 { 1437 #if !H_MV_6_ILDDS_O0225_30 1373 1438 Int maxTid = -1; 1439 #endif 1374 1440 for ( Int curLayerIdInVps = 1; curLayerIdInVps < m_numberOfLayers; curLayerIdInVps++) 1375 1441 { 1442 #if H_MV_6_ILDDS_O0225_30 1443 Int maxTid = -1; 1444 #endif 1376 1445 for( Int i = 0; i < getGOPSize(); i++ ) 1377 1446 { … … 1387 1456 } 1388 1457 } 1458 #if H_MV_6_ILDDS_O0225_30 1459 vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 ); 1460 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1461 } 1462 #else 1389 1463 } 1390 1464 vps.setMaxTidIlRefPicPlus1( refLayerIdInVps, maxTid + 1 ); 1391 1465 maxTidRefPresentFlag = maxTidRefPresentFlag || ( maxTid != 6 ); 1466 #endif 1392 1467 } 1393 1468 … … 1406 1481 vps.setMaxOneActiveRefLayerFlag( maxOneActiveRefLayerFlag ); 1407 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 1408 1493 1409 1494 // All Ref layers active flag … … 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( ); … … 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 } … … 1683 1970 if( vps.getUseDLTFlag( layer ) ) 1684 1971 { 1972 #if H_MV_LAYER_WISE_STARTUP 1973 xAnalyzeInputBaseDepth(layer, max( m_iIntraPeriod[layer], 24), &vps); 1974 #else 1685 1975 xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod, 24), &vps); 1976 #endif 1686 1977 } 1687 1978 #endif … … 1720 2011 } 1721 2012 #endif 2013 #endif 1722 2014 //! \} -
trunk/source/App/TAppEncoder/TAppEncTop.h
r655 r738 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 ); -
trunk/source/Lib/TLibCommon/CommonDef.h
r736 r738 60 60 61 61 #if H_MV 62 #define NV_VERSION "9. 0r1"///< Current software version62 #define NV_VERSION "9.1" ///< Current software version 63 63 #define HM_VERSION "12.0" ///< 64 64 #else … … 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 -
trunk/source/Lib/TLibCommon/TComPic.cpp
r655 r738 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 … … 530 530 return getPic ( m_vps->getLayerIdInNuh( viewIndex, depthFlag ), poc ); 531 531 } 532 532 #endif 533 533 Void TComPicLists::print() 534 534 { … … 571 571 } 572 572 573 #if H_3D 573 574 TComPicYuv* TComPicLists::getPicYuv( Int viewIndex, Bool depthFlag, Int poc, Bool recon ) 574 575 { … … 593 594 } 594 595 #endif 595 #endif // H_3D596 #endif 596 597 #endif // H_MV 597 598 -
trunk/source/Lib/TLibCommon/TComRom.cpp
r724 r738 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 ) -
trunk/source/Lib/TLibCommon/TComRom.h
r724 r738 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 -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r724 r738 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 1718 , m_vpsVUI ( NULL ) … … 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++) … … 1749 1763 } 1750 1764 } 1751 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++ ) … … 2074 2109 } 2075 2110 return numLayersInIdList; 2076 } 2111 #endif 2112 } 2113 2114 #if H_MV_6_HRD_O0217_13 2115 Int TComVPS::getNumOutputLayerSets() 2116 { 2117 Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1; 2118 if ( getMoreOutputLayerSetsThanDefaultFlag( ) ) 2119 { 2120 numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1); 2121 } 2122 return numOutputLayerSets; 2123 } 2124 #endif 2125 2077 2126 Int TComVPS::getNumViews() 2078 2127 { … … 2104 2153 return dependentFlag; 2105 2154 } 2155 2156 #if H_MV_6_HRD_O0217_13 2157 Void TComVPS::deriveLayerSetLayerIdList() 2158 { 2159 m_layerSetLayerIdList.resize( getVpsNumLayerSetsMinus1() + 1 ); 2160 for (Int i = 0; i <= getVpsNumLayerSetsMinus1(); i++ ) 2161 { 2162 for( Int m = 0; m <= getVpsMaxLayerId(); m++ ) 2163 { 2164 if( getLayerIdIncludedFlag( i, m) ) 2165 { 2166 m_layerSetLayerIdList[ i ].push_back( m ); 2167 } 2168 } 2169 } 2170 } 2171 2172 Void TComVPS::deriveTargetLayerIdLists() 2173 { 2174 m_targetDecLayerIdLists.resize( getNumOutputLayerSets() ); 2175 m_targetOptLayerIdLists.resize( getNumOutputLayerSets() ); 2176 2177 for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ ) 2178 { 2179 Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1; 2180 Int lsIdx = targetDecLayerSetIdx; 2181 2182 for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ ) 2183 { 2184 m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2185 if( getOutputLayerFlag( targetOptLayerSetIdx, j )) // This seems to be wrong in draft text 2186 { 2187 m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2188 } 2189 } 2190 } 2191 } 2192 #endif 2106 2193 #endif // H_MV 2107 2194 … … 2157 2244 , m_spsInferScalingListFlag ( false ) 2158 2245 , m_spsScalingListRefLayerId ( 0 ) 2246 2247 #if !H_MV_6_PS_REP_FORM_18_19_20 2159 2248 , m_updateRepFormatFlag ( true ) 2249 #else 2250 , m_updateRepFormatFlag ( false ) 2251 , m_spsRepFormatIdx ( 0 ) 2252 #endif 2160 2253 , m_interViewMvVertConstraintFlag (false) 2161 2254 #endif … … 2173 2266 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2174 2267 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2268 #if H_MV_6_PSEM_O0142_3 2269 m_spsExtensionFlag = false; 2270 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 2271 { 2272 m_spsExtensionTypeFlag[ i ] = false; 2273 } 2274 #endif 2275 #if H_MV_6_SHVC_O0098_36 2276 m_numScaledRefLayerOffsets = 0; 2277 2278 for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ ) 2279 { 2280 m_scaledRefLayerId [i] = -1; 2281 } 2282 2283 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2284 { 2285 m_scaledRefLayerLeftOffset [i] = 0; 2286 m_scaledRefLayerTopOffset [i] = 0; 2287 m_scaledRefLayerRightOffset [i] = 0; 2288 m_scaledRefLayerBottomOffset [i] = 0; 2289 } 2290 #endif 2175 2291 } 2176 2292 … … 2353 2469 if ( layerIdCurr > 0 ) 2354 2470 { 2471 #if H_MV_6_PS_REP_FORM_18_19_20 2472 Int repFormatIdx = getUpdateRepFormatFlag() ? getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ; 2473 TComRepFormat* repFormat = vps->getRepFormat( repFormatIdx ); 2474 #else 2355 2475 TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 2356 2476 if ( !getUpdateRepFormatFlag() ) 2357 2477 { 2478 #endif 2358 2479 setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() ); 2359 2480 //// ToDo: add when supported: … … 2368 2489 setBitDepthC ( repFormat->getBitDepthVpsChromaMinus8() + 8 ); 2369 2490 setQpBDOffsetC ( (Int) (6* ( getBitDepthC() -8 ) ) ); 2491 #if !H_MV_6_PS_REP_FORM_18_19_20 2370 2492 } 2371 2493 else 2494 #else 2495 if ( getLayerId() > 0 && getUpdateRepFormatFlag() ) 2496 #endif 2372 2497 { 2373 2498 assert( getChromaFormatIdc() <= repFormat->getChromaFormatVpsIdc() ); … … 2715 2840 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 2716 2841 { 2717 // Fill targetDecLayerIdSet with all layers if empty .2842 // Fill targetDecLayerIdSet with all layers if empty (at encoder side) 2718 2843 if (targetDecLayerIdSet.size() == 0 ) 2719 2844 { … … 2739 2864 { 2740 2865 TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc ); 2866 #if H_MV_LAYER_WISE_STARTUP 2867 if ( pcPic ) 2868 { 2869 #endif 2741 2870 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 2742 2871 { … … 2761 2890 } 2762 2891 } 2892 #if H_MV_LAYER_WISE_STARTUP 2893 } 2894 #endif 2763 2895 } 2764 2896 } … … 2816 2948 return pcPic; 2817 2949 } 2950 2951 2952 #if H_MV_6_ILDDS_ILREFPICS_27_34 2953 Int TComSlice::getRefLayerPicFlag( Int i ) 2954 { 2955 TComVPS* vps = getVPS(); 2956 Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 2957 2958 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) && 2959 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 2960 2961 return refLayerPicFlag; 2962 } 2963 2964 Int TComSlice::getRefLayerPicIdc( Int j ) 2965 { 2966 Int refLayerPicIdc = -1; 2967 Int curj = 0; 2968 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2969 { 2970 if( getRefLayerPicFlag( i ) ) 2971 { 2972 if ( curj == j ) 2973 { 2974 refLayerPicIdc = i; 2975 break; 2976 } 2977 curj++; 2978 } 2979 } 2980 2981 assert( curj == j ); 2982 assert( refLayerPicIdc != -1 ); 2983 return refLayerPicIdc; 2984 } 2985 2986 Int TComSlice::getNumRefLayerPics( ) 2987 { 2988 Int numRefLayerPics = 0; 2989 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2990 { 2991 numRefLayerPics += getRefLayerPicFlag( i ); 2992 } 2993 return numRefLayerPics; 2994 } 2995 #endif 2996 2997 2998 2818 2999 Int TComSlice::getNumActiveRefLayerPics() 2819 3000 { … … 2826 3007 else if (getVPS()->getAllRefLayersActiveFlag() ) 2827 3008 { 3009 #if H_MV_6_ILDDS_ILREFPICS_27_34 3010 numActiveRefLayerPics = getNumRefLayerPics(); 3011 #else 2828 3012 numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() ); 3013 #endif 2829 3014 } 2830 3015 else if ( !getInterLayerPredEnabledFlag() ) … … 2834 3019 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 2835 3020 { 3021 #if H_MV_6_ILDDS_ILREFPICS_27_34 3022 numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0; 3023 #else 2836 3024 numActiveRefLayerPics = 1; 3025 #endif 2837 3026 } 2838 3027 else … … 3434 3623 TComVPSVUI::TComVPSVUI() 3435 3624 { 3625 #if H_MV_6_PS_O0223_29 3626 m_crossLayerIrapAlignedFlag = true; 3627 #endif 3436 3628 m_bitRatePresentVpsFlag = false; 3437 3629 m_picRatePresentVpsFlag = false; … … 3461 3653 } 3462 3654 } 3463 } 3464 #endif 3655 #if H_MV_6_PS_O0118_33 3656 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3657 { 3658 m_videoSignalInfo [i] = NULL; 3659 } 3660 #endif 3661 3662 #if H_MV_6_HRD_O0164_15 3663 m_vpsVuiBspHrdPresentFlag = false; 3664 m_vpsVuiBspHrdParameters = new TComVpsVuiBspHrdParameters(); 3665 #endif 3666 } 3667 3668 #if H_MV_6_PS_O0118_33 3669 TComVPSVUI::~TComVPSVUI() 3670 { 3671 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3672 { 3673 if (m_videoSignalInfo[ i ] != NULL ) delete m_videoSignalInfo[ i ]; 3674 m_videoSignalInfo [ i ] = NULL; 3675 } 3676 3677 #if H_MV_6_HRD_O0164_15 3678 if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters; 3679 m_vpsVuiBspHrdParameters = NULL; 3680 #endif 3681 } 3682 #endif 3683 3684 #if H_MV_6_PS_REP_FORM_18_19_20 3685 Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ) 3686 { 3687 if ( !encoderFlag ) 3688 { 3689 setChromaAndBitDepthVpsPresentFlag( prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3690 setSeparateColourPlaneVpsFlag ( prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3691 setBitDepthVpsLumaMinus8 ( prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3692 setBitDepthVpsChromaMinus8 ( prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3693 } 3694 else 3695 { 3696 assert( getChromaAndBitDepthVpsPresentFlag() == prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3697 assert( getSeparateColourPlaneVpsFlag () == prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3698 assert( getBitDepthVpsLumaMinus8 () == prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3699 assert( getBitDepthVpsChromaMinus8 () == prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3700 } 3701 } 3702 #endif 3703 3704 #if H_MV_6_HRD_O0164_15 3705 Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h ) 3706 { 3707 // It is a requirement of bitstream conformance that bitstream partition with index j shall not include 3708 // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j 3709 // in the range of 0 to num_bitstream_partitions[ h ] 1, inclusive, such that i is less than j. 3710 3711 for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ ) 3712 { 3713 for ( Int partI = 0; partI < partJ; partI++ ) 3714 { 3715 for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ ) 3716 { 3717 if ( m_layerInBspFlag[ h ][partJ][layerJ ] ) 3718 { 3719 for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ ) 3720 { 3721 if ( m_layerInBspFlag[ h ][partI][layerI] ) 3722 { 3723 assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) ); 3724 } 3725 } 3726 } 3727 } 3728 } 3729 } 3730 } 3731 #endif 3732 #endif -
trunk/source/Lib/TLibCommon/TComSlice.h
r724 r738 62 62 // ==================================================================================================================== 63 63 64 #if H_MV_6_HRD_O0164_15 65 class TComVPS; 66 #endif 64 67 /// Reference Picture Set class 65 68 class TComReferencePictureSet … … 403 406 404 407 #if H_MV 408 409 #if H_MV_6_PS_O0118_33 410 class TComVideoSignalInfo 411 { 412 private: 413 Int m_videoVpsFormat; 414 Bool m_videoFullRangeVpsFlag; 415 Int m_colourPrimariesVps; 416 Int m_transferCharacteristicsVps; 417 Int m_matrixCoeffsVps; 418 public: 419 Void setVideoVpsFormat( Int val ) { m_videoVpsFormat = val; } 420 Int getVideoVpsFormat( ) { return m_videoVpsFormat; } 421 422 Void setVideoFullRangeVpsFlag( Bool flag ) { m_videoFullRangeVpsFlag = flag; } 423 Bool getVideoFullRangeVpsFlag( ) { return m_videoFullRangeVpsFlag; } 424 425 Void setColourPrimariesVps( Int val ) { m_colourPrimariesVps = val; } 426 Int getColourPrimariesVps( ) { return m_colourPrimariesVps; } 427 428 Void setTransferCharacteristicsVps( Int val ) { m_transferCharacteristicsVps = val; } 429 Int getTransferCharacteristicsVps( ) { return m_transferCharacteristicsVps; } 430 431 Void setMatrixCoeffsVps( Int val ) { m_matrixCoeffsVps = val; } 432 Int getMatrixCoeffsVps( ) { return m_matrixCoeffsVps; } 433 }; 434 #endif 435 #if H_MV_6_HRD_O0164_15 436 class TComVpsVuiBspHrdParameters 437 { 438 private: 439 Int m_vpsNumBspHrdParametersMinus1; 440 Bool m_bspCprmsPresentFlag[MAX_NUM_BSP_HRD_PARAMETERS]; 441 Int m_numBitstreamPartitions[MAX_VPS_OP_SETS_PLUS1]; 442 Bool m_layerInBspFlag[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_LAYERS]; 443 Int m_numBspSchedCombinations[MAX_VPS_OP_SETS_PLUS1]; 444 Int m_bspCombHrdIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; 445 Int m_bspCombSchedIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; 446 TComHRD* m_hrdParameters[MAX_NUM_BSP_HRD_PARAMETERS]; 447 public: 448 449 Void setVpsNumBspHrdParametersMinus1( Int val ) { m_vpsNumBspHrdParametersMinus1 = val; } 450 Int getVpsNumBspHrdParametersMinus1( ) { return m_vpsNumBspHrdParametersMinus1; } 451 452 Void setBspCprmsPresentFlag( Int i, Bool flag ) { m_bspCprmsPresentFlag[i] = flag; } 453 Bool getBspCprmsPresentFlag( Int i ) { return m_bspCprmsPresentFlag[i]; } 454 455 Void setNumBitstreamPartitions( Int h, Int val ) { m_numBitstreamPartitions[h] = val; } 456 Int getNumBitstreamPartitions( Int h ) { return m_numBitstreamPartitions[h]; } 457 458 Void setLayerInBspFlag( Int h, Int i, Int j, Bool flag ) { m_layerInBspFlag[h][i][j] = flag; } 459 Bool getLayerInBspFlag( Int h, Int i, Int j ) { return m_layerInBspFlag[h][i][j]; } 460 Void checkLayerInBspFlag ( TComVPS* vps, Int h ); 461 462 Void setNumBspSchedCombinations( Int h, Int val ) { m_numBspSchedCombinations[h] = val; } 463 Int getNumBspSchedCombinations( Int h ) { return m_numBspSchedCombinations[h]; } 464 465 Void setBspCombHrdIdx( Int h, Int i, Int j, Int val ) { m_bspCombHrdIdx[h][i][j] = val; } 466 Int getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; } 467 468 Void setBspCombSchedIdx( Int h, Int i, Int j, Int val ) { m_bspCombSchedIdx[h][i][j] = val; } 469 Int getBspCombSchedIdx( Int h, Int i, Int j ) { return m_bspCombSchedIdx[h][i][j]; } 470 471 Void setHrdParametermeters( Int k, TComHRD* val ) { m_hrdParameters[k] = val; }; 472 TComHRD* getHrdParametermeters( Int k ) { return m_hrdParameters[k]; }; 473 }; 474 475 #endif 405 476 class TComVPSVUI 406 477 { 407 478 private: 479 #if H_MV_6_PS_O0223_29 480 Bool m_crossLayerPicTypeAlignedFlag; 481 Bool m_crossLayerIrapAlignedFlag; 482 #endif 408 483 Bool m_bitRatePresentVpsFlag; 409 484 Bool m_picRatePresentVpsFlag; … … 414 489 Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 415 490 Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; 491 #if H_MV_6_O0226_37 492 Bool m_tilesNotInUseFlag; 493 Bool m_tilesInUseFlag [MAX_NUM_LAYERS]; 494 Bool m_loopFilterNotAcrossTilesFlag[MAX_NUM_LAYERS]; 495 #endif 416 496 Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 497 #if H_MV_6_O0226_37 498 Bool m_wppNotInUseFlag; 499 Bool m_wppInUseFlag [MAX_NUM_LAYERS]; 500 #endif 417 501 Bool m_ilpRestrictedRefLayersFlag; 418 502 Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 419 503 Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 420 504 Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 505 #if H_MV_6_PS_O0118_33 506 Bool m_videoSignalInfoIdxPresentFlag; 507 Int m_vpsNumVideoSignalInfoMinus1; 508 TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO]; 509 Int m_vpsVideoSignalInfoIdx [MAX_NUM_VIDEO_SIGNAL_INFO]; 510 #endif 511 #if H_MV_6_HRD_O0164_15 512 Bool m_vpsVuiBspHrdPresentFlag; 513 TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters; 514 #endif 421 515 422 516 public: 423 TComVPSVUI();; 517 TComVPSVUI(); 518 ~TComVPSVUI(); 519 #if H_MV_6_PS_O0223_29 520 Void setCrossLayerPicTypeAlignedFlag( Bool flag ) { m_crossLayerPicTypeAlignedFlag = flag; } 521 Bool getCrossLayerPicTypeAlignedFlag( ) { return m_crossLayerPicTypeAlignedFlag; } 522 523 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 524 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 525 #endif 424 526 425 527 Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } … … 447 549 Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } 448 550 551 #if H_MV_6_O0226_37 552 Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; } 553 Bool getTilesNotInUseFlag( ) { return m_tilesNotInUseFlag; } 554 555 Void setTilesInUseFlag( Int i, Bool flag ) { m_tilesInUseFlag[i] = flag; } 556 Bool getTilesInUseFlag( Int i ) { return m_tilesInUseFlag[i]; } 557 558 Void setLoopFilterNotAcrossTilesFlag( Int i, Int val ) { m_loopFilterNotAcrossTilesFlag[i] = val; } 559 Bool getLoopFilterNotAcrossTilesFlag( Int i ) { return m_loopFilterNotAcrossTilesFlag[i]; } 560 #endif 561 449 562 Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } 450 563 Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } 451 564 565 #if H_MV_6_O0226_37 566 Void setWppNotInUseFlag( Bool flag ) { m_wppNotInUseFlag = flag; } 567 Bool getWppNotInUseFlag( ) { return m_wppNotInUseFlag; } 568 569 Void setWppInUseFlag( Int i, Bool flag ) { m_wppInUseFlag[i] = flag; } 570 Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; } 571 #endif 572 452 573 Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } 453 574 Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } … … 462 583 Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } 463 584 585 #if H_MV_6_PS_O0118_33 586 Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } 587 Bool getVideoSignalInfoIdxPresentFlag( ) { return m_videoSignalInfoIdxPresentFlag; } 588 589 Void setVideoSignalInfo( Int i, TComVideoSignalInfo* val ) { m_videoSignalInfo[i] = val; } 590 TComVideoSignalInfo* getVideoSignalInfo( Int i ) { return m_videoSignalInfo[i]; } 591 592 Void setVpsNumVideoSignalInfoMinus1( Int val ) { m_vpsNumVideoSignalInfoMinus1 = val; } 593 Int getVpsNumVideoSignalInfoMinus1( ) { return m_vpsNumVideoSignalInfoMinus1; } 594 595 Void setVpsVideoSignalInfoIdx( Int i, Int val ) { m_vpsVideoSignalInfoIdx[i] = val; } 596 Int getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } 597 #endif 598 599 #if H_MV_6_HRD_O0164_15 600 Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; } 601 Bool getVpsVuiBspHrdPresentFlag( ) { return m_vpsVuiBspHrdPresentFlag; } 602 603 Void setVpsVuiBspHrdParameters( TComVpsVuiBspHrdParameters* val) { m_vpsVuiBspHrdParameters = val; } 604 TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters( ) { return m_vpsVuiBspHrdParameters; } 605 #endif 464 606 }; 465 607 … … 467 609 { 468 610 private: 611 #if H_MV_6_PS_REP_FORM_18_19_20 612 Bool m_chromaAndBitDepthVpsPresentFlag; 613 #endif 469 614 Int m_chromaFormatVpsIdc; 470 615 Bool m_separateColourPlaneVpsFlag; … … 477 622 TComRepFormat() { }; 478 623 624 #if H_MV_6_PS_REP_FORM_18_19_20 625 Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; } 626 Bool getChromaAndBitDepthVpsPresentFlag( ) { return m_chromaAndBitDepthVpsPresentFlag; } 627 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. 628 Void inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ); 629 #endif 630 479 631 Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } 480 632 Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } … … 494 646 Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } 495 647 Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } 648 }; 649 #endif 650 651 #if H_MV_6_HRD_O0217_13 652 class TComDpbSize 653 { 654 private: 655 Bool m_subLayerFlagInfoPresentFlag[MAX_VPS_OUTPUTLAYER_SETS]; 656 Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; 657 Int m_maxVpsDecPicBufferingMinus1[MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYER_IDS][MAX_TLAYER];; 658 Int m_maxVpsNumReorderPics [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; 659 Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; 660 661 public: 662 TComDpbSize( ) 663 { 664 for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ ) 665 { 666 m_subLayerFlagInfoPresentFlag[i] = false; 667 668 for (Int j = 0; j < MAX_TLAYER; j++ ) 669 { 670 m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ; 671 m_maxVpsNumReorderPics [i][j] = 0; 672 m_maxVpsLatencyIncreasePlus1 [i][j] = 0; 673 674 for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ ) 675 { 676 m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 677 } 678 } 679 } 680 } 681 682 Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; } 683 Bool getSubLayerFlagInfoPresentFlag( Int i ) { return m_subLayerFlagInfoPresentFlag[i]; } 684 685 Void setSubLayerDpbInfoPresentFlag( Int i, Int j, Bool flag ) { m_subLayerDpbInfoPresentFlag[i][j] = flag; } 686 Bool getSubLayerDpbInfoPresentFlag( Int i, Int j ) { return m_subLayerDpbInfoPresentFlag[i][j]; } 687 688 Void setMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j, Int val ) { m_maxVpsDecPicBufferingMinus1[i][k][j] = val; } 689 Int getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { return m_maxVpsDecPicBufferingMinus1[i][k][j]; } 690 691 Void setMaxVpsNumReorderPics( Int i, Int j, Int val ) { m_maxVpsNumReorderPics[i][j] = val; } 692 Int getMaxVpsNumReorderPics( Int i, Int j ) { return m_maxVpsNumReorderPics[i][j]; } 693 694 Void setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int val ) { m_maxVpsLatencyIncreasePlus1[i][j] = val; } 695 Int getMaxVpsLatencyIncreasePlus1( Int i, Int j ) { return m_maxVpsLatencyIncreasePlus1[i][j]; } 496 696 }; 497 697 #endif … … 547 747 Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; 548 748 Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; 749 750 #if H_MV_6_PS_O0109_22 751 Int m_viewIdLen; 752 #else 549 753 Int m_viewIdLenMinus1; 754 #endif 550 755 Int m_viewIdVal [MAX_NUM_LAYERS]; 551 756 Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 757 #if H_MV_6_ILDSD_O0120_26 758 Bool m_vpsSubLayersMaxMinus1PresentFlag; 759 Int m_subLayersVpsMaxMinus1 [MAX_NUM_LAYERS]; 760 #endif 552 761 Bool m_maxTidRefPresentFlag; 762 #if H_MV_6_ILDDS_O0225_30 763 Int m_maxTidIlRefPicsPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 764 #else 553 765 Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; 766 #endif 554 767 Bool m_allRefLayersActiveFlag; 555 768 Int m_vpsNumberLayerSetsMinus1; … … 559 772 Bool m_moreOutputLayerSetsThanDefaultFlag; 560 773 Int m_numAddOutputLayerSetsMinus1; 774 #if H_MV_6_PS_0109_25 775 Int m_defaultOneTargetOutputLayerIdc; 776 #else 561 777 Bool m_defaultOneTargetOutputLayerFlag; 778 #endif 562 779 Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; 563 780 Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; 564 781 Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; 782 #if H_MV_6_GEN_0153_28 783 Bool m_altOutputLayerFlag; 784 #endif 565 785 Bool m_repFormatIdxPresentFlag; 566 786 Int m_vpsNumRepFormatsMinus1; … … 568 788 TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; 569 789 Bool m_maxOneActiveRefLayerFlag; 790 #if H_MV_6_MISC_O0062_31 791 Bool m_pocLsbNotPresentFlag [MAX_NUM_LAYERS]; 792 #endif 793 794 #if H_MV_6_HRD_O0217_13 795 TComDpbSize* m_dpbSize; 796 #endif 797 #if !H_MV_6_PS_O0223_29 570 798 Bool m_crossLayerIrapAlignedFlag; 799 #endif 571 800 Int m_directDepTypeLenMinus2; 801 #if H_MV_6_PS_O0096_21 802 Bool m_defaultDirectDependencyFlag; 803 Int m_defaultDirectDependencyType; 804 #endif 572 805 Bool m_vpsVuiPresentFlag; 573 806 TComVPSVUI* m_vpsVUI; … … 588 821 Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 589 822 Int m_viewIndex [MAX_NUM_LAYERS ]; 823 824 #if H_MV_6_HRD_O0217_13 825 std::vector< std::vector< Int> > m_targetDecLayerIdLists; //[TargetOptLayerSetIdx][i] 826 std::vector< std::vector< Int> > m_targetOptLayerIdLists; 827 std::vector< std::vector< Int> > m_layerSetLayerIdList; 828 #endif 829 830 590 831 Int xGetDimBitOffset( Int j ); 591 832 … … 649 890 UInt getMaxTLayers () { return m_uiMaxTLayers; } 650 891 Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } 651 892 #if H_MV_6_HRD_O0164_15 893 UInt getMaxSubLayersMinus1() { return m_uiMaxTLayers - 1; } // For consistency with draft spec 894 #endif 652 895 #if H_MV 653 896 UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; … … 724 967 Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } 725 968 969 #if H_MV_6_PS_O0109_22 970 Void setViewIdLen( Int val ) { m_viewIdLen = val; } 971 Int getViewIdLen( ) { return m_viewIdLen; } 972 #else 726 973 Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } 727 974 Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } 975 #endif 728 976 729 977 Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } … … 731 979 Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } 732 980 Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } 733 981 #if H_MV_6_ILDSD_O0120_26 982 Void setVpsSubLayersMaxMinus1PresentFlag( Bool flag ) { m_vpsSubLayersMaxMinus1PresentFlag = flag; } 983 Bool getVpsSubLayersMaxMinus1PresentFlag( ) { return m_vpsSubLayersMaxMinus1PresentFlag; } 984 Void setSubLayersVpsMaxMinus1( Int i, Int val ) { m_subLayersVpsMaxMinus1[i] = val; } 985 Int getSubLayersVpsMaxMinus1( Int i ) { return m_subLayersVpsMaxMinus1[i]; } 986 Void checkSubLayersVpsMaxMinus1( Int i ) { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); } 987 #endif 734 988 Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } 735 989 Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } 990 #if H_MV_6_ILDDS_O0225_30 991 Void setMaxTidIlRefPicsPlus1( Int i, Int j, Int val ) { m_maxTidIlRefPicsPlus1[i][j] = val; } 992 Int getMaxTidIlRefPicsPlus1( Int i, Int j ) { return m_maxTidIlRefPicsPlus1[i][j]; } 993 #else 736 994 Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } 737 995 Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 996 #endif 738 997 Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } 739 998 Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } … … 749 1008 Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } 750 1009 Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } 751 1010 #if H_MV_6_PS_O0109_23 1011 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. 1012 #endif 752 1013 Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } 753 1014 Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } … … 756 1017 Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } 757 1018 1019 #if H_MV_6_PS_0109_25 1020 Void setDefaultOneTargetOutputLayerIdc( Int val ) { m_defaultOneTargetOutputLayerIdc = val; } 1021 Int getDefaultOneTargetOutputLayerIdc( ) { return m_defaultOneTargetOutputLayerIdc; } 1022 Void checkDefaultOneTargetOutputLayerIdc( ) { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); } 1023 #else 758 1024 Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } 759 1025 Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } 1026 #endif 760 1027 761 1028 Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } … … 764 1031 Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } 765 1032 Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } 1033 #if H_MV_6_HRD_O0217_13 1034 Bool inferOutputLayerFlag( Int layerSetIdx, Int i ) { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1 ) )); } 1035 #endif 766 1036 767 1037 Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } 768 1038 Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 1039 #if H_MV_6_GEN_0153_28 1040 Void setAltOutputLayerFlag( Bool flag ) { m_altOutputLayerFlag = flag; } 1041 Bool getAltOutputLayerFlag( ) { return m_altOutputLayerFlag; } 1042 #endif 769 1043 770 1044 Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } … … 781 1055 Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } 782 1056 Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } 1057 1058 #if H_MV_6_HRD_O0217_13 1059 Void setDpbSize( TComDpbSize* val ) { assert( m_dpbSize != 0 ); m_dpbSize = val; } 1060 TComDpbSize* getDpbSize( ) { return m_dpbSize;} 1061 #endif 1062 1063 #if H_MV_6_MISC_O0062_31 1064 Void setPocLsbNotPresentFlag( Int i, Bool flag ) { m_pocLsbNotPresentFlag[i] = flag; } 1065 Bool getPocLsbNotPresentFlag( Int i ) { return m_pocLsbNotPresentFlag[i]; } 1066 #endif 1067 #if !H_MV_6_PS_O0223_29 783 1068 Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } 784 1069 Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } 1070 #endif 785 1071 Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } 786 1072 Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } 787 1073 1074 #if H_MV_6_PS_O0096_21 1075 Void setDefaultDirectDependencyFlag( Bool flag ) { m_defaultDirectDependencyFlag = flag; } 1076 Bool getDefaultDirectDependencyFlag( ) { return m_defaultDirectDependencyFlag; } 1077 1078 Void setDefaultDirectDependencyType( Int val ) { m_defaultDirectDependencyType = val; } 1079 Int getDefaultDirectDependencyType( ) { return m_defaultDirectDependencyType; } 1080 #endif 788 1081 Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 789 1082 Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } … … 797 1090 798 1091 Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); 1092 #if H_MV_6_FIX_GET_VIEW_ID 1093 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( layerIdInNuh )]; } 1094 #else 799 1095 Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } 1096 #endif 800 1097 Void setRefLayers(); 801 1098 … … 810 1107 Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; 811 1108 812 Int getNumLayersInIdList ( Int lsIdx );; 1109 Int getNumLayersInIdList ( Int lsIdx ); 1110 1111 #if H_MV_6_HRD_O0217_13 1112 Int getNumOutputLayerSets() ; 1113 Int getNumSubDpbs( Int i ) { return getNumLayersInIdList( i ); }; 1114 Bool isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh ); 1115 #if H_MV_6_HRD_O0217_13 1116 Void deriveLayerSetLayerIdList(); 1117 Void deriveTargetLayerIdLists(); 1118 std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 1119 std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 1120 #endif 1121 #endif 1122 813 1123 814 1124 // inference … … 1096 1406 TimingInfo* getTimingInfo() { return &m_timingInfo; } 1097 1407 1408 #if H_MV_6_PS_O0118_33 1409 Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr ) 1410 { 1411 if ( layerIdCurr == 0 || !vps->getVpsVuiPresentFlag() ) 1412 { 1413 return; 1414 } 1415 1416 TComVPSVUI* vpsVUI = vps->getVPSVUI(); 1417 assert( vpsVUI != NULL ); 1418 1419 TComVideoSignalInfo* videoSignalInfo = vpsVUI->getVideoSignalInfo( vpsVUI->getVpsVideoSignalInfoIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 1420 assert( videoSignalInfo != NULL ); 1421 1422 setVideoFormat ( videoSignalInfo->getVideoVpsFormat () ); 1423 setVideoFullRangeFlag ( videoSignalInfo->getVideoFullRangeVpsFlag () ); 1424 setColourPrimaries ( videoSignalInfo->getColourPrimariesVps () ); 1425 setTransferCharacteristics( videoSignalInfo->getTransferCharacteristicsVps() ); 1426 setMatrixCoefficients ( videoSignalInfo->getMatrixCoeffsVps () ); 1427 } 1428 #endif 1098 1429 }; 1099 1430 … … 1181 1512 TComVPS* m_pcVPS; 1182 1513 // SPS 1514 #if H_MV_6_PSEM_O0142_3 1515 Bool m_spsExtensionFlag; 1516 Bool m_spsExtensionTypeFlag[PS_EX_T_MAX_NUM]; 1517 #endif 1183 1518 Bool m_spsInferScalingListFlag; 1184 1519 Int m_spsScalingListRefLayerId; 1185 1520 Bool m_updateRepFormatFlag; 1521 #if H_MV_6_PS_REP_FORM_18_19_20 1522 Int m_spsRepFormatIdx; 1523 #endif 1186 1524 // SPS Extension 1187 1525 Bool m_interViewMvVertConstraintFlag; 1526 #if H_MV_6_SHVC_O0098_36 1527 Int m_numScaledRefLayerOffsets; 1528 Int m_scaledRefLayerId [MAX_NUM_SCALED_REF_LAYERS]; 1529 Int m_scaledRefLayerLeftOffset [MAX_NUM_LAYERS]; 1530 Int m_scaledRefLayerTopOffset [MAX_NUM_LAYERS]; 1531 Int m_scaledRefLayerRightOffset [MAX_NUM_LAYERS]; 1532 Int m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS]; 1533 #endif 1188 1534 #endif 1189 1535 #if H_3D … … 1322 1668 TComPTL* getPTL() { return &m_pcPTL; } 1323 1669 #if H_MV 1670 #if H_MV_6_PSEM_O0142_3 1671 Void setSpsExtensionFlag( Bool flag ) { m_spsExtensionFlag = flag; } 1672 Bool getSpsExtensionFlag( ) { return m_spsExtensionFlag; } 1673 1674 Void setSpsExtensionTypeFlag( Int i, Bool flag ) { m_spsExtensionTypeFlag[i] = flag; } 1675 Bool getSpsExtensionTypeFlag( Int i ) { return m_spsExtensionTypeFlag[i]; } 1676 #endif 1324 1677 Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } 1325 1678 TComVPS* getVPS () { return m_pcVPS; } … … 1333 1686 Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } 1334 1687 Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } 1688 #if H_MV_6_PS_REP_FORM_18_19_20 1689 Void setSpsRepFormatIdx( Int val ) { m_spsRepFormatIdx = val; } 1690 Int getSpsRepFormatIdx( ) { return m_spsRepFormatIdx; } 1691 #endif 1335 1692 // SPS Extension 1336 1693 Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } 1337 1694 Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} 1695 1696 #if H_MV_6_SHVC_O0098_36 1697 Void setNumScaledRefLayerOffsets( Int val ) { m_numScaledRefLayerOffsets = val; } 1698 Int getNumScaledRefLayerOffsets( ) { return m_numScaledRefLayerOffsets; } 1699 1700 Void setScaledRefLayerId( Int i, Int val ) { m_scaledRefLayerId[i] = val; } 1701 Int getScaledRefLayerId( Int i ) { return m_scaledRefLayerId[i]; } 1702 1703 Void setScaledRefLayerLeftOffset( Int j, Int val ) { m_scaledRefLayerLeftOffset[j] = val; } 1704 Int getScaledRefLayerLeftOffset( Int j ) { return m_scaledRefLayerLeftOffset[j]; } 1705 1706 Void setScaledRefLayerTopOffset( Int j, Int val ) { m_scaledRefLayerTopOffset[j] = val; } 1707 Int getScaledRefLayerTopOffset( Int j ) { return m_scaledRefLayerTopOffset[j]; } 1708 1709 Void setScaledRefLayerRightOffset( Int j, Int val ) { m_scaledRefLayerRightOffset[j] = val; } 1710 Int getScaledRefLayerRightOffset( Int j ) { return m_scaledRefLayerRightOffset[j]; } 1711 1712 Void setScaledRefLayerBottomOffset( Int j, Int val ) { m_scaledRefLayerBottomOffset[j] = val; } 1713 Int getScaledRefLayerBottomOffset( Int j ) { return m_scaledRefLayerBottomOffset[j]; } 1714 #endif 1338 1715 // Inference 1339 1716 Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); … … 1736 2113 // Additional slice header syntax elements 1737 2114 Bool m_pocResetFlag; 2115 #if H_MV_6_RALS_O0149_11 2116 Bool m_crossLayerBlaFlag; 2117 #endif 1738 2118 Bool m_discardableFlag; 1739 2119 Bool m_interLayerPredEnabledFlag; … … 2073 2453 // Additional slice header syntax elements 2074 2454 2455 #if H_MV_6_RALS_O0149_11 2456 Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; } 2457 Bool getCrossLayerBlaFlag( ) { return m_crossLayerBlaFlag; } 2458 Void checkCrossLayerBlaFlag ( ) 2459 { 2460 // 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. 2461 if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 2462 { 2463 assert( m_crossLayerBlaFlag == 0 ); 2464 } 2465 } 2466 #endif 2467 2075 2468 Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 2076 2469 Bool getPocResetFlag( ) { return m_pocResetFlag; } … … 2091 2484 Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } 2092 2485 Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } 2486 2487 #if H_MV_6_ILDDS_ILREFPICS_27_34 2488 Int getRefLayerPicFlag( Int i ); 2489 Int getRefLayerPicIdc ( Int j ); 2490 Int getNumRefLayerPics( ); 2491 #endif 2093 2492 2094 2493 Int getNumActiveRefLayerPics( ); -
trunk/source/Lib/TLibCommon/TypeDef.h
r735 r738 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 ////////////////////////////// … … 306 355 #define MAX_VPS_OP_SETS_PLUS1 1024 307 356 #if H_MV 357 #if H_MV_6_LAYER_ID_32 358 #define MAX_VPS_NUH_LAYER_ID_PLUS1 63 359 #else 308 360 #define MAX_VPS_NUH_LAYER_ID_PLUS1 64 361 #endif 309 362 #define MAX_NUM_SCALABILITY_TYPES 16 310 363 #define ENC_CFG_CONSOUT_SPACE 29 … … 329 382 330 383 #define MAX_CPB_CNT 32 ///< Upper bound of (cpb_cnt_minus1 + 1) 384 #if H_MV 385 #if H_MV_6_LAYER_ID_32 386 #define MAX_NUM_LAYER_IDS 63 387 #define MAX_NUM_LAYERS 63 388 #else 331 389 #define MAX_NUM_LAYER_IDS 64 332 #if H_MV333 390 #define MAX_NUM_LAYERS 64 391 #endif 334 392 #define MAX_VPS_PROFILE_TIER_LEVEL 64 335 393 #define MAX_VPS_ADD_OUTPUT_LAYER_SETS 1024 336 394 #define MAX_VPS_OUTPUTLAYER_SETS ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 ) 395 #if H_MV_6_PS_O0118_33 396 #define MAX_NUM_VIDEO_SIGNAL_INFO 16 397 #endif 398 #if H_MV_6_SHVC_O0098_36 399 #define MAX_NUM_SCALED_REF_LAYERS MAX_NUM_LAYERS-1 400 #endif 401 #if H_MV_6_HRD_O0164_15 402 #define MAX_NUM_BSP_HRD_PARAMETERS 100 ///< Maximum value is actually not specified 403 #define MAX_NUM_BITSTREAM_PARTITIONS 100 ///< Maximum value is actually not specified 404 #define MAX_NUM_BSP_SCHED_COMBINATION 100 ///< Maximum value is actually not specified 405 #endif 337 406 #endif 338 407 … … 811 880 812 881 #if H_MV 882 883 #if H_MV_6_PSEM_O0142_3 884 enum PsExtensionTypes 885 { 886 PS_EX_T_MV = 1, 887 #if H_3D 888 PS_EX_T_3D = 3, 889 #endif 890 PS_EX_T_ESC = 7, 891 PS_EX_T_MAX_NUM = 8 892 }; 893 #endif 894 813 895 /// scalability types 814 896 enum ScalabilityType -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r724 r738 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 637 #if H_MV_6_PS_REP_FORM_18_19_20 638 if ( pcSPS->getLayerId() == 0 ) 639 #else 623 640 if ( pcSPS->getUpdateRepFormatFlag() ) 641 #endif 624 642 { 625 643 #endif … … 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 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 786 834 while ( xMoreRbspData() ) 787 835 { 788 836 READ_FLAG( uiCode, "sps_extension_data_flag"); 789 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); … … 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 ); … … 1204 1459 } 1205 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()) -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r655 r738 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 -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r724 r738 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 ); … … 722 732 #endif 723 733 #endif 734 735 #if H_MV_LAYER_WISE_STARTUP 736 xCeckNoClrasOutput(); 737 #endif 724 738 // Skip pictures due to random access 725 739 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 727 741 m_prevSliceSkipped = true; 728 742 m_skippedPOC = m_apcSlicePilot->getPOC(); 743 #if H_MV_FIX_SKIP_PICTURES 744 sliceSkippedFlag = true; 745 #endif 729 746 return false; 730 747 } … … 734 751 m_prevSliceSkipped = true; 735 752 m_skippedPOC = m_apcSlicePilot->getPOC(); 753 #if H_MV_FIX_SKIP_PICTURES 754 sliceSkippedFlag = true; 755 #endif 736 756 return false; 737 757 } … … 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); … … 1265 1293 return true; 1266 1294 } 1295 #if H_MV_LAYER_WISE_STARTUP 1296 else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet. 1297 #else 1267 1298 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1299 #endif 1268 1300 { 1269 1301 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA … … 1272 1304 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ) 1273 1305 { 1306 1307 #if H_MV_LAYER_WISE_STARTUP 1308 if ( xAllRefLayersInitilized() ) 1309 { 1310 m_layerInitilizedFlag[ m_layerId ] = true; 1311 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1312 } 1313 else 1314 { 1315 return true; 1316 } 1317 #else 1274 1318 // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT. 1275 1319 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1320 #endif 1276 1321 } 1277 1322 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1278 1323 { 1324 #if H_MV_LAYER_WISE_STARTUP 1325 if ( xAllRefLayersInitilized() ) 1326 { 1327 m_layerInitilizedFlag[ m_layerId ] = true; 1279 1328 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1280 1329 } 1281 1330 else 1282 1331 { 1332 return true; 1333 } 1334 #else 1335 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1336 #endif 1337 } 1338 else 1339 { 1340 #if H_MV_FIX_SKIP_PICTURES 1341 static Bool warningMessage[MAX_NUM_LAYERS]; 1342 static Bool warningInitFlag = false; 1343 1344 if (!warningInitFlag) 1345 { 1346 for ( Int i = 0; i < MAX_NUM_LAYERS; i++) 1347 { 1348 warningMessage[i] = true; 1349 } 1350 warningInitFlag = true; 1351 } 1352 1353 if ( warningMessage[getLayerId()] ) 1354 { 1355 printf("\nLayer%3d No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() ); 1356 warningMessage[m_layerId] = false; 1357 } 1358 #else 1283 1359 static Bool warningMessage = false; 1284 1360 if(!warningMessage) … … 1287 1363 warningMessage = true; 1288 1364 } 1365 #endif 1289 1366 return true; 1290 1367 } … … 1296 1373 return true; 1297 1374 } 1375 #if H_MV_LAYER_WISE_STARTUP 1376 return !m_layerInitilizedFlag[ getLayerId() ]; 1377 #else 1298 1378 // if we reach here, then the picture is not skipped. 1299 1379 return false; 1380 #endif 1300 1381 } 1301 1382 … … 1338 1419 } 1339 1420 } 1421 1422 #if H_MV_LAYER_WISE_STARTUP 1423 Void TDecTop::xCeckNoClrasOutput() 1424 { 1425 // This part needs further testing! 1426 if ( getLayerId() == 0 ) 1427 { 1428 NalUnitType nut = m_apcSlicePilot->getNalUnitType(); 1429 1430 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 ); 1431 Bool isIDR = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP ); 1432 Bool noClrasOutputFlag = isBLA || ( isIDR && m_apcSlicePilot->getCrossLayerBlaFlag() ); 1433 1434 if ( noClrasOutputFlag ) 1435 { 1436 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 1437 { 1438 m_layerInitilizedFlag[i] = false; 1439 } 1440 } 1441 } 1442 } 1443 1444 Bool TDecTop::xAllRefLayersInitilized() 1445 { 1446 Bool allRefLayersInitilizedFlag = true; 1447 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1448 for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId() ); i++ ) 1449 { 1450 Int refLayerId = vps->getRefLayerId( m_layerId, i ); 1451 allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 1452 } 1453 1454 return allRefLayersInitilizedFlag; 1455 } 1456 #endif 1340 1457 #endif 1341 1458 //! \} -
trunk/source/Lib/TLibDecoder/TDecTop.h
r724 r738 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); -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r724 r738 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 ) … … 797 887 WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLenMinus1( ) + 1, "view_id_val[i]" ); 798 888 } 889 #endif 890 799 891 800 892 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) … … 805 897 } 806 898 } 807 899 #if H_MV_6_ILDSD_O0120_26 900 WRITE_FLAG( pcVPS->getVpsSubLayersMaxMinus1PresentFlag( ) ? 1 : 0 , "vps_sub_layers_max_minus1_present_flag" ); 901 if ( pcVPS->getVpsSubLayersMaxMinus1PresentFlag() ) 902 { 903 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 904 { 905 WRITE_CODE( pcVPS->getSubLayersVpsMaxMinus1( i ), 3, "sub_layers_vps_max_minus1" ); 906 pcVPS->checkSubLayersVpsMaxMinus1( i ); 907 } 908 } 909 else 910 { 911 for (Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 912 { 913 assert( pcVPS->getSubLayersVpsMaxMinus1( i ) + 1 == pcVPS->getMaxTLayers( ) ); 914 } 915 } 916 #endif 808 917 WRITE_FLAG( pcVPS->getMaxTidRefPresentFlag( ) ? 1 : 0 , "max_tid_ref_present_flag" ); 809 918 … … 812 921 for( Int i = 0; i < pcVPS->getMaxLayersMinus1(); i++ ) 813 922 { 923 #if H_MV_6_ILDDS_O0225_30 924 for( Int j = i + 1; j <= pcVPS->getMaxLayersMinus1(); j++ ) 925 { 926 if ( pcVPS->getDirectDependencyFlag(j,i) ) 927 { 928 WRITE_CODE( pcVPS->getMaxTidIlRefPicsPlus1( i, j ), 3, "max_tid_il_ref_pics_plus1" ); 929 } 930 } 931 #else 814 932 WRITE_CODE( pcVPS->getMaxTidIlRefPicPlus1( i ), 3, "max_tid_il_ref_pics_plus1[i]" ); 933 #endif 815 934 } 816 935 } … … 826 945 { 827 946 WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" ); 947 #if H_MV_6_PS_O0109_23 948 pcVPS->checkProfileRefMinus1( i ); 949 #endif 828 950 } 829 951 codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 ); … … 842 964 if( numOutputLayerSets > 1) 843 965 { 966 #if H_MV_6_PS_0109_25 967 WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" ); 968 pcVPS->checkDefaultOneTargetOutputLayerIdc(); 969 #else 844 970 WRITE_FLAG( pcVPS->getDefaultOneTargetOutputLayerFlag( ) ? 1 : 0, "default_one_target_output_layer_flag" ); 971 #endif 845 972 } 846 973 974 #if H_MV_6_HRD_O0217_13 975 assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 976 assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 977 #endif 847 978 for( Int i = 1; i < numOutputLayerSets; i++ ) 848 979 { … … 855 986 } 856 987 } 988 #if H_MV_6_HRD_O0217_13 989 else 990 { // These inference rules would also be helpful in spec text 991 assert( pcVPS->getOutputLayerSetIdxMinus1(i ) == i - 1 ); 992 for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ ) 993 { 994 assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 995 } 996 } 997 #endif 998 857 999 if ( pcVPS->getProfileLevelTierIdxLen() > 0 ) 858 1000 { … … 861 1003 } 862 1004 1005 #if H_MV_6_GEN_0153_28 1006 if( pcVPS->getMaxLayersMinus1() > 0 ) 1007 { 1008 WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" ); 1009 } 1010 #endif 1011 863 1012 WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" ); 864 1013 if ( pcVPS->getRepFormatIdxPresentFlag() ) … … 869 1018 for (Int i = 0; i <= pcVPS->getVpsNumRepFormatsMinus1(); i++ ) 870 1019 { 1020 #if H_MV_6_PS_REP_FORM_18_19_20 1021 TComRepFormat* curRepFormat = pcVPS->getRepFormat(i); 1022 TComRepFormat* prevRepFormat = i > 0 ? pcVPS->getRepFormat( i - 1) : NULL; 1023 codeRepFormat( i, curRepFormat , prevRepFormat); 1024 #else 871 1025 TComRepFormat* pcRepFormat = pcVPS->getRepFormat(i); 872 1026 codeRepFormat( pcRepFormat ); 1027 #endif 873 1028 } 874 1029 … … 879 1034 if( pcVPS->getVpsNumRepFormatsMinus1() > 0 ) 880 1035 { 1036 #if H_MV_6_PS_REP_FORM_18_19_20 1037 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" ); 1038 #else 881 1039 WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 4, "vps_rep_format_idx" ); 1040 #endif 882 1041 } 883 1042 } … … 885 1044 886 1045 WRITE_FLAG( pcVPS->getMaxOneActiveRefLayerFlag( ) ? 1 : 0, "max_one_active_ref_layer_flag" ); 1046 #if H_MV_6_MISC_O0062_31 1047 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1048 { 1049 if( pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) == 0 ) 1050 { 1051 WRITE_FLAG( pcVPS->getPocLsbNotPresentFlag( i ) ? 1 : 0 , "poc_lsb_not_present_flag" ); 1052 } 1053 } 1054 #endif 1055 #if H_MV_6_HRD_O0217_13 1056 codeDpbSize( pcVPS ); 1057 #endif 1058 1059 #if !H_MV_6_PS_O0223_29 887 1060 WRITE_FLAG( pcVPS->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1061 #endif 888 1062 WRITE_UVLC( pcVPS->getDirectDepTypeLenMinus2 ( ), "direct_dep_type_len_minus2"); 889 1063 1064 #if H_MV_6_PS_O0096_21 1065 WRITE_FLAG( pcVPS->getDefaultDirectDependencyFlag( ) ? 1 : 0 , "default_direct_dependency_flag" ); 1066 1067 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1068 { 1069 WRITE_CODE( pcVPS->getDefaultDirectDependencyType( ), pcVPS->getDirectDepTypeLenMinus2( ) + 2 , "default_direct_dependency_type" ); 1070 } 1071 1072 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1073 { 1074 for( Int j = 0; j < i; j++ ) 1075 { 1076 if (pcVPS->getDirectDependencyFlag( i, j) ) 1077 { 1078 if ( pcVPS->getDefaultDirectDependencyFlag( ) ) 1079 { 1080 assert( pcVPS->getDirectDependencyType( i, j ) == pcVPS->getDefaultDirectDependencyType( ) ); 1081 } 1082 else 1083 { 1084 assert ( pcVPS->getDirectDependencyType( i, j ) != -1 ); 1085 WRITE_CODE( pcVPS->getDirectDependencyType( i, j ),pcVPS->getDirectDepTypeLenMinus2( ) + 2, "direct_dependency_type[i][j]" ); 1086 } 1087 } 1088 } 1089 } 1090 #else 890 1091 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 891 1092 { … … 899 1100 } 900 1101 } 901 1102 #endif 902 1103 WRITE_FLAG ( 0, "vps_shvc_reserved_zero_flag" ); 1104 #if !H_MV_6_PS_O0109_24 903 1105 WRITE_FLAG( pcVPS->getVpsVuiPresentFlag( ) ? 1 : 0 , "vps_vui_present_flag" ); 1106 #endif 904 1107 905 1108 if( pcVPS->getVpsVuiPresentFlag() ) … … 909 1112 } 910 1113 } 911 1114 #if H_MV_6_PS_O0118_33 1115 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo ) 1116 { 1117 assert( pcVideoSignalInfo ); 1118 WRITE_CODE( pcVideoSignalInfo->getVideoVpsFormat( ), 3, "video_vps_format" ); 1119 WRITE_FLAG( pcVideoSignalInfo->getVideoFullRangeVpsFlag( ) ? 1 : 0 , "video_full_range_vps_flag" ); 1120 WRITE_CODE( pcVideoSignalInfo->getColourPrimariesVps( ), 8, "colour_primaries_vps" ); 1121 WRITE_CODE( pcVideoSignalInfo->getTransferCharacteristicsVps( ), 8, "transfer_characteristics_vps" ); 1122 WRITE_CODE( pcVideoSignalInfo->getMatrixCoeffsVps( ), 8, "matrix_coeffs_vps" ); 1123 } 1124 #endif 1125 1126 #if H_MV_6_HRD_O0217_13 1127 Void TEncCavlc::codeDpbSize( TComVPS* vps ) 1128 { 1129 TComDpbSize* dpbSize = vps->getDpbSize(); 1130 assert ( dpbSize != 0 ); 1131 1132 for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ ) 1133 { 1134 WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" ); 1135 1136 for( Int j = 0; j <= vps->getMaxTLayers() - 1 ; j++ ) 1137 { 1138 if( j > 0 && dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1139 { 1140 WRITE_FLAG( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ? 1 : 0 , "sub_layer_dpb_info_present_flag" ); 1141 } 1142 if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) ) 1143 { 1144 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) // Preliminary fix does not match with spec 1145 { 1146 WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" ); 1147 } 1148 WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" ); 1149 WRITE_UVLC( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ), "max_vps_latency_increase_plus1" ); 1150 } 1151 else 1152 { 1153 if ( j > 0 ) 1154 { 1155 for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ ) 1156 { 1157 assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) ); 1158 } 1159 assert( dpbSize->getMaxVpsNumReorderPics ( i, j ) == dpbSize->getMaxVpsNumReorderPics ( i, j - 1 ) ); 1160 assert( dpbSize->getMaxVpsLatencyIncreasePlus1( i, j ) == dpbSize->getMaxVpsLatencyIncreasePlus1( i, j - 1 ) ); 1161 } 1162 } 1163 } 1164 } 1165 } 1166 #endif 1167 1168 #if H_MV_6_PS_REP_FORM_18_19_20 1169 Void TEncCavlc::codeRepFormat( Int i, TComRepFormat* pcRepFormat, TComRepFormat* pcPrevRepFormat ) 1170 #else 912 1171 Void TEncCavlc::codeRepFormat( TComRepFormat* pcRepFormat ) 1172 #endif 913 1173 { 914 1174 assert( pcRepFormat ); 915 1175 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 } 1176 #if H_MV_6_PS_REP_FORM_18_19_20 922 1177 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 923 1178 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1179 WRITE_FLAG( pcRepFormat->getChromaAndBitDepthVpsPresentFlag( ) ? 1 : 0 , "chroma_and_bit_depth_vps_present_flag" ); 1180 1181 pcRepFormat->checkChromaAndBitDepthVpsPresentFlag( i ); 1182 1183 if ( pcRepFormat->getChromaAndBitDepthVpsPresentFlag() ) 1184 { 1185 #endif 1186 WRITE_CODE( pcRepFormat->getChromaFormatVpsIdc( ), 2, "chroma_format_vps_idc" ); 1187 1188 if ( pcRepFormat->getChromaFormatVpsIdc() == 3 ) 1189 { 1190 WRITE_FLAG( pcRepFormat->getSeparateColourPlaneVpsFlag( ) ? 1 : 0 , "separate_colour_plane_vps_flag" ); 1191 } 1192 #if !H_MV_6_PS_REP_FORM_18_19_20 1193 WRITE_CODE( pcRepFormat->getPicWidthVpsInLumaSamples( ), 16, "pic_width_vps_in_luma_samples" ); 1194 WRITE_CODE( pcRepFormat->getPicHeightVpsInLumaSamples( ), 16, "pic_height_vps_in_luma_samples" ); 1195 #endif 924 1196 WRITE_CODE( pcRepFormat->getBitDepthVpsLumaMinus8( ), 4, "bit_depth_vps_luma_minus8" ); 925 1197 WRITE_CODE( pcRepFormat->getBitDepthVpsChromaMinus8( ), 4, "bit_depth_vps_chroma_minus8" ); 1198 #if H_MV_6_PS_REP_FORM_18_19_20 1199 } 1200 else 1201 { 1202 pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true ); 1203 } 1204 #endif 926 1205 } 927 1206 … … 933 1212 934 1213 assert( pcVPSVUI ); 1214 1215 #if H_MV_6_PS_O0223_29 1216 WRITE_FLAG( pcVPSVUI->getCrossLayerPicTypeAlignedFlag( ) ? 1 : 0 , "cross_layer_pic_type_aligned_flag" ); 1217 if ( !pcVPSVUI->getCrossLayerPicTypeAlignedFlag() ) 1218 { 1219 WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" ); 1220 } 1221 #endif 935 1222 936 1223 WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" ); … … 964 1251 } 965 1252 1253 #if H_MV_6_O0226_37 1254 WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" ); 1255 if( !pcVPSVUI->getTilesNotInUseFlag() ) 1256 { 1257 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1258 { 1259 WRITE_FLAG( pcVPSVUI->getTilesInUseFlag( i ) ? 1 : 0 , "tiles_in_use_flag[i]" ); 1260 if( pcVPSVUI->getTilesInUseFlag( i ) ) 1261 { 1262 WRITE_FLAG( pcVPSVUI->getLoopFilterNotAcrossTilesFlag( i ) ? 1 : 0, "loop_filter_not_across_tiles_flag[i]" ); 1263 } 1264 } 1265 1266 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1267 { 1268 for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ ) 1269 { 1270 Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j )); 1271 if( pcVPSVUI->getTilesInUseFlag( i ) && pcVPSVUI->getTilesInUseFlag( layerIdx ) ) 1272 { 1273 WRITE_FLAG( pcVPSVUI->getTileBoundariesAlignedFlag( i, j ) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" ); 1274 } 1275 } 1276 } 1277 } 1278 1279 WRITE_FLAG( pcVPSVUI->getWppNotInUseFlag( ) ? 1 : 0 , "wpp_not_in_use_flag" ); 1280 1281 if( !pcVPSVUI->getWppNotInUseFlag( ) ) 1282 { 1283 for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1284 { 1285 WRITE_FLAG( pcVPSVUI->getWppInUseFlag( i ) ? 1 : 0 , "wpp_in_use_flag[i]" ); 1286 } 1287 } 1288 #else 966 1289 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 967 1290 { … … 971 1294 } 972 1295 } 973 1296 #endif 974 1297 WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" ); 975 1298 … … 992 1315 } 993 1316 } 994 } 1317 #if H_MV_6_PS_O0118_33 1318 WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" ); 1319 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ) 1320 { 1321 WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" ); 1322 } 1323 else 1324 { 1325 pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 1326 } 1327 1328 for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ ) 1329 { 1330 assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL ); 1331 TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i ); 1332 codeVideoSignalInfo( curVideoSignalInfo ); 1333 } 1334 1335 if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 ) 1336 { 1337 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1338 { 1339 WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" ); 1340 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() ); 1341 } 1342 } 1343 else 1344 { 1345 for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ ) 1346 { 1347 assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 1348 } 1349 } 1350 #endif 1351 #if H_MV_6_HRD_O0164_15 1352 WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" ); 1353 if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ) 1354 { 1355 codeVpsVuiBspHrdParameters( pcVPS ); 1356 } 1357 #endif 1358 } 1359 #if H_MV_6_HRD_O0164_15 1360 Void TEncCavlc::codeVpsVuiBspHrdParameters( TComVPS* pcVPS ) 1361 { 1362 assert( pcVPS ); 1363 1364 TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 1365 1366 assert( pcVPSVUI ); 1367 1368 TComVpsVuiBspHrdParameters* vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 1369 1370 assert ( vpsVuiBspHrdP ); 1371 1372 1373 WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" ); 1374 for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ ) 1375 { 1376 if( i > 0 ) 1377 { 1378 WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" ); 1379 } 1380 TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 1381 codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() ); 1382 } 1383 for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ ) 1384 { 1385 WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" ); 1386 for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ ) 1387 { 1388 for( Int j = 0; j <= pcVPS->getMaxLayersMinus1(); j++ ) 1389 { 1390 if( pcVPS->getLayerIdIncludedFlag( h ,j ) ) 1391 { 1392 WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" ); 1393 } 1394 else 1395 { 1396 vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, false ); // This inference seems to be missing in spec 1397 } 1398 } 1399 } 1400 vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 1401 1402 if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) ) 1403 { 1404 WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinations( h ), "num_bsp_sched_combinations" ); 1405 for( Int i = 0; i < vpsVuiBspHrdP->getNumBspSchedCombinations( h ); i++ ) 1406 { 1407 for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ ) 1408 { 1409 WRITE_UVLC( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ), "bsp_comb_hrd_idx" ); 1410 WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" ); 1411 } 1412 } 1413 } 1414 } 1415 } 1416 #endif 1417 995 1418 #endif 996 1419 … … 1115 1538 #if H_MV 1116 1539 Int esb = 0; //Don't use i, otherwise will shadow something below 1540 #if !H_MV_6_RALS_O0149_11 1117 1541 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1118 1542 { … … 1120 1544 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1121 1545 } 1546 #endif 1122 1547 1123 1548 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) … … 1126 1551 WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" ); 1127 1552 } 1553 1554 #if H_MV_6_RALS_O0149_11 1555 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1556 { 1557 esb++; 1558 WRITE_FLAG( pcSlice->getCrossLayerBlaFlag( ) ? 1 : 0 , "cross_layer_bla_flag" ); 1559 } 1560 pcSlice->checkCrossLayerBlaFlag( ); 1561 1562 if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > esb ) 1563 { 1564 esb++; 1565 WRITE_FLAG( pcSlice->getPocResetFlag( ) ? 1 : 0 , "poc_reset_flag" ); 1566 } 1567 #endif 1568 1569 1128 1570 1129 1571 for (; esb < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); esb++) … … 1148 1590 // colour_plane_id u(2) 1149 1591 1592 #if H_MV_6_POC_31_35_38 1593 if ( (pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( pcSlice->getLayerIdInVps())) || !pcSlice->getIdrPicFlag() ) 1594 { 1595 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1596 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "slice_pic_order_cnt_lsb"); 1597 } 1598 #endif 1150 1599 if( !pcSlice->getIdrPicFlag() ) 1151 1600 { 1601 #if !H_MV_6_POC_31_35_38 1152 1602 Int picOrderCntLSB = (pcSlice->getPOC()-pcSlice->getLastIDR()+(1<<pcSlice->getSPS()->getBitsForPOC())) & ((1<<pcSlice->getSPS()->getBitsForPOC())-1); 1153 1603 WRITE_CODE( picOrderCntLSB, pcSlice->getSPS()->getBitsForPOC(), "pic_order_cnt_lsb"); 1604 #endif 1154 1605 TComReferencePictureSet* rps = pcSlice->getRPS(); 1155 1606 … … 1265 1716 } 1266 1717 #if H_MV 1718 #if H_MV_6_ILDDS_ILREFPICS_27_34 1719 Bool interLayerPredLayerIdcPresentFlag = false; 1720 #endif 1267 1721 Int layerId = pcSlice->getLayerId(); 1268 1722 if( pcSlice->getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && vps->getNumDirectRefLayers( layerId ) > 0 ) … … 1277 1731 if ( pcSlice->getNumActiveRefLayerPics() != vps->getNumDirectRefLayers( layerId ) ) 1278 1732 { 1733 #if H_MV_6_ILDDS_ILREFPICS_27_34 1734 interLayerPredLayerIdcPresentFlag = true; 1735 #endif 1279 1736 for( Int idx = 0; idx < pcSlice->getNumActiveRefLayerPics(); idx++ ) 1280 1737 { … … 1284 1741 } 1285 1742 } 1743 #if H_MV_6_ILDDS_ILREFPICS_27_34 1744 if ( !interLayerPredLayerIdcPresentFlag ) 1745 { 1746 for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ ) 1747 { 1748 assert( pcSlice->getInterLayerPredLayerIdc( i ) == pcSlice->getRefLayerPicIdc( i ) ); 1749 } 1750 } 1751 #endif 1286 1752 #endif 1287 1753 if(pcSlice->getSPS()->getUseSAO()) -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r655 r738 86 86 #if H_MV 87 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 88 99 Void codeRepFormat ( TComRepFormat* pcRepFormat ); 100 #endif 89 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 ); -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r724 r738 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. … … 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 -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r724 r738 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.