Changeset 1057 in SHVCSoftware for branches/SHM-dev/source
- Timestamp:
- 4 Mar 2015, 09:55:40 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r1044 r1057 69 69 #if SVC_EXTENSION 70 70 string cfg_ReconFile [MAX_LAYERS]; 71 Int nLayerNum;71 Int layerNum, targetLayerId; 72 72 #if OUTPUT_LAYER_SET_INDEX 73 73 Int olsIdx; … … 103 103 #endif 104 104 #if FIX_CONF_MODE 105 ("LayerNum,-ls", nLayerNum, MAX_NUM_LAYER_IDS, "Number of layers to be decoded.") 105 ("TargetLayerId,-lid", targetLayerId, -1, "Target layer id") 106 ("LayerNum,-ls", layerNum, MAX_NUM_LAYER_IDS, "Target layer id") // Legacy option 106 107 #else 107 108 ("LayerNum,-ls", nLayerNum, 1, "Number of layers to be decoded.") … … 165 166 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 166 167 #if SVC_EXTENSION 167 m_tgtLayerId = nLayerNum - 1; 168 assert( m_tgtLayerId >= 0 ); 168 if( targetLayerId < 0 ) 169 { 170 targetLayerId = layerNum - 1; 171 } 172 173 assert( targetLayerId >= 0 ); 169 174 #if !FIX_CONF_MODE 170 175 assert( m_tgtLayerId < MAX_LAYERS ); // If this is wrong, it should be caught by asserts in other locations. 171 176 #endif 172 177 #if O0137_MAX_LAYERID 173 assert( m_tgtLayerId < MAX_NUM_LAYER_IDS );178 assert( targetLayerId < MAX_NUM_LAYER_IDS ); 174 179 #endif 175 180 #if OUTPUT_LAYER_SET_INDEX … … 207 212 #endif 208 213 m_commonDecoderParams.setTargetOutputLayerSetIdx( olsIdx ); 209 m_commonDecoderParams.setTargetLayerId( m_tgtLayerId );214 m_commonDecoderParams.setTargetLayerId( targetLayerId ); 210 215 #endif 211 216 #if FIX_CONF_MODE -
branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h
r1029 r1057 75 75 76 76 #if SVC_EXTENSION 77 Int m_tgtLayerId; ///< target layer ID78 77 #if AVC_BASE 79 78 Char* m_pchBLReconFile; ///< input BL reconstruction file name … … 118 117 #endif 119 118 #if SVC_EXTENSION 120 , m_tgtLayerId(0)121 119 #if AVC_BASE && !REPN_FORMAT_IN_VPS 122 120 , m_iBLSourceWidth(0) -
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r1052 r1057 223 223 if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || 224 224 #if FIX_CONF_MODE 225 (nalu.m_layerId > this->getCommonDecoderParams()->getTargetLayerId()) )225 (nalu.m_layerId > m_commonDecoderParams.getTargetLayerId()) ) 226 226 #else 227 227 (nalu.m_layerId > m_tgtLayerId) ) -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1045 r1057 772 772 string* cfg_ReconFile [MAX_LAYERS]; 773 773 Double* cfg_fQP [MAX_LAYERS]; 774 Int* cfg_layerId [MAX_LAYERS]; 774 775 #if REPN_FORMAT_IN_VPS 775 776 Int* cfg_repFormatIdx [MAX_LAYERS]; … … 911 912 cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx; 912 913 #endif 914 cfg_layerId[layer] = &m_acLayerCfg[layer].m_layerId; 913 915 cfg_SourceWidth[layer] = &m_acLayerCfg[layer].m_iSourceWidth; 914 916 cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight; … … 1122 1124 ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS") 1123 1125 #endif 1126 ("LayerId%d", cfg_layerId, -1, MAX_LAYERS, "Layer id") 1124 1127 #if VPS_EXTN_DIRECT_REF_LAYERS 1125 1128 ("NumSamplePredRefLayers%d", cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers") … … 1130 1133 ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs") 1131 1134 #endif 1132 ("NumLayers", m_numLayers, 1, "Number of layers to code") 1135 ("NumLayers", m_numLayers, 1, "Number of layers to code") 1133 1136 #if Q0078_ADD_LAYER_SETS 1134 1137 #if OUTPUT_LAYER_SETS_CONFIG … … 4601 4604 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numSamplePredRefLayers; i++) 4602 4605 { 4603 xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] > layerIdx, "Cannot reference higher layers");4604 xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] == layerIdx, "Cannot reference the current layer itself");4606 xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] > m_acLayerCfg[layerIdx].m_layerId, "Cannot reference higher layers"); 4607 xConfirmPara(m_acLayerCfg[layerIdx].m_samplePredRefLayerIds[i] == m_acLayerCfg[layerIdx].m_layerId, "Cannot reference the current layer itself"); 4605 4608 } 4606 4609 } … … 4612 4615 for(Int i = 0; i < m_acLayerCfg[layerIdx].m_numMotionPredRefLayers; i++) 4613 4616 { 4614 xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] > layerIdx, "Cannot reference higher layers");4615 xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] == layerIdx, "Cannot reference the current layer itself");4617 xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] > m_acLayerCfg[layerIdx].m_layerId, "Cannot reference higher layers"); 4618 xConfirmPara(m_acLayerCfg[layerIdx].m_motionPredRefLayerIds[i] == m_acLayerCfg[layerIdx].m_layerId, "Cannot reference the current layer itself"); 4616 4619 } 4617 4620 } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1045 r1057 61 61 #if SVC_EXTENSION 62 62 TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS]; 63 Int m_layerId; 63 64 Int m_numLayers; ///< number of layers 64 65 Int m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask … … 577 578 #if SVC_EXTENSION 578 579 Int getNumFrameToBeEncoded() {return m_framesToBeEncoded; } 579 Int getNumLayer() {return m_numLayers; }580 Int getNumLayer() {return m_numLayers; } 580 581 Int getGOPSize() {return m_iGOPSize; } 581 582 #if O0194_DIFFERENT_BITDEPTH_EL_BL -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r1030 r1057 30 30 string m_cInputFile; ///< source file name 31 31 string m_cReconFile; ///< output reconstruction file 32 32 Int m_layerId; ///< layer Id 33 33 Int m_iFrameRate; ///< source frame-rates (Hz) 34 34 Int m_iSourceWidth; ///< source width in pixel … … 209 209 Int getNumActiveRefLayers() {return m_numActiveRefLayers;} 210 210 Int* getPredLayerIds() {return m_predLayerIds; } 211 Int getPredLayerId (Int i){return m_predLayerIds[i]; }211 Int getPredLayerIdx(Int i) {return m_predLayerIds[i]; } 212 212 #endif 213 213 #if RC_SHVC_HARMONIZATION -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1045 r1057 301 301 #endif 302 302 // set layer ID 303 m_acTEncTop[layer].setLayerId ( layer);304 m_acTEncTop[layer].setNumLayer ( m_numLayers );305 m_acTEncTop[layer].setLayerEnc (m_apcTEncTop);303 m_acTEncTop[layer].setLayerId ( m_acLayerCfg[layer].m_layerId == -1 ? layer : m_acLayerCfg[layer].m_layerId ); 304 m_acTEncTop[layer].setNumLayer ( m_numLayers ); 305 m_acTEncTop[layer].setLayerEnc ( m_apcTEncTop ); 306 306 307 307 //====== Coding Structure ======== … … 354 354 if(layer) 355 355 { 356 UInt prevLayerIdx = m_acLayerCfg[layer].getPredLayerIdx(m_acLayerCfg[layer].getNumActiveRefLayers() - 1); 357 UInt prevLayerId = m_acTEncTop[layer].getRefLayerId(prevLayerIdx); 358 356 359 for(Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++) 357 360 { … … 363 366 // Not included in the configuration file; assume that each layer depends on previous layer 364 367 m_acTEncTop[layer].setNumSamplePredRefLayers (1); // One sample pred ref. layer 365 m_acTEncTop[layer].setSamplePredRefLayerId ( 0, layer - 1); // Previous layer366 m_acTEncTop[layer].setSamplePredEnabledFlag ( layer - 1, true);368 m_acTEncTop[layer].setSamplePredRefLayerId (prevLayerIdx, prevLayerId); // Previous layer 369 m_acTEncTop[layer].setSamplePredEnabledFlag (prevLayerIdx, true); 367 370 } 368 371 else … … 372 375 { 373 376 m_acTEncTop[layer].setSamplePredRefLayerId ( i, m_acLayerCfg[layer].getSamplePredRefLayerId(i)); 374 m_acTEncTop[layer].setSamplePredEnabledFlag (m_acLayerCfg[layer].getSamplePredRefLayerId(i), true);375 377 } 376 378 } … … 379 381 // Not included in the configuration file; assume that each layer depends on previous layer 380 382 m_acTEncTop[layer].setNumMotionPredRefLayers (1); // One motion pred ref. layer 381 m_acTEncTop[layer].setMotionPredRefLayerId ( 0, layer - 1); // Previous layer382 m_acTEncTop[layer].setMotionPredEnabledFlag ( layer - 1, true);383 m_acTEncTop[layer].setMotionPredRefLayerId (prevLayerIdx, prevLayerId); // Previous layer 384 m_acTEncTop[layer].setMotionPredEnabledFlag (prevLayerIdx, true); 383 385 } 384 386 else … … 388 390 { 389 391 m_acTEncTop[layer].setMotionPredRefLayerId ( i, m_acLayerCfg[layer].getMotionPredRefLayerId(i)); 390 m_acTEncTop[layer].setMotionPredEnabledFlag (m_acLayerCfg[layer].getMotionPredRefLayerId(i), true);391 392 } 392 393 } … … 395 396 assert( layer < MAX_LAYERS ); 396 397 397 for (Int i = 0; i < layer; i++) 398 { 399 if (m_acTEncTop[layer].getSamplePredEnabledFlag(i) || m_acTEncTop[layer].getMotionPredEnabledFlag(i)) 398 for (Int i = 0; i < m_acLayerCfg[layer].m_layerId; i++) 399 { 400 Int refLayerId = -1; 401 402 for( Int layerIdc = 0; layerIdc < m_acTEncTop[layer].getNumSamplePredRefLayers(); layerIdc++ ) 400 403 { 401 m_acTEncTop[layer].setRefLayerId (numDirectRefLayers, i); 404 if( m_acLayerCfg[layer].getSamplePredRefLayerId(layerIdc) == i ) 405 { 406 refLayerId = i; 407 m_acTEncTop[layer].setSamplePredEnabledFlag( numDirectRefLayers, true ); 408 break; 409 } 410 } 411 412 for( Int layerIdc = 0; layerIdc < m_acTEncTop[layer].getNumMotionPredRefLayers(); layerIdc++ ) 413 { 414 if( m_acLayerCfg[layer].getMotionPredRefLayerId(layerIdc) == i ) 415 { 416 refLayerId = i; 417 m_acTEncTop[layer].setMotionPredEnabledFlag( numDirectRefLayers, true ); 418 break; 419 } 420 } 421 422 if( refLayerId >= 0 ) 423 { 424 m_acTEncTop[layer].setRefLayerId ( numDirectRefLayers, refLayerId ); 402 425 numDirectRefLayers++; 403 426 } 404 427 } 405 m_acTEncTop[layer].setNumDirectRefLayers (numDirectRefLayers); 428 429 m_acTEncTop[layer].setNumDirectRefLayers ( numDirectRefLayers ); 406 430 407 431 if(m_acLayerCfg[layer].getNumActiveRefLayers() == -1) … … 410 434 for( Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++ ) 411 435 { 412 m_acTEncTop[layer].setPredLayerId (i, i);436 m_acTEncTop[layer].setPredLayerIdx(i, i); 413 437 } 414 438 } … … 418 442 for(Int i = 0; i < m_acTEncTop[layer].getNumActiveRefLayers(); i++) 419 443 { 420 m_acTEncTop[layer].setPredLayerId ( i, m_acLayerCfg[layer].getPredLayerId(i));444 m_acTEncTop[layer].setPredLayerIdx ( i, m_acLayerCfg[layer].getPredLayerIdx(i)); 421 445 } 422 446 } … … 1266 1290 for(i = 1; i < vps->getMaxLayers(); i++) 1267 1291 { 1268 vps->setLayerIdInNuh(i, i);1292 vps->setLayerIdInNuh(i, m_acLayerCfg[i].m_layerId); 1269 1293 vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i); 1270 1294 vps->setDimensionId(i, 0, i); 1295 1296 if( m_acLayerCfg[i].m_layerId != i ) 1297 { 1298 vps->setNuhLayerIdPresentFlag(true); 1299 } 1271 1300 } 1272 1301 … … 1296 1325 1297 1326 #if VPS_EXTN_OP_LAYER_SETS 1298 vps->setMaxLayerId( m_numLayers - 1); // Set max-layer ID1327 vps->setMaxLayerId( m_acLayerCfg[m_numLayers - 1].m_layerId ); // Set max-layer ID 1299 1328 1300 1329 vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false ); … … 1529 1558 Bool isDefaultDirectDependencyTypeSet = false; 1530 1559 #endif 1531 for (UInt layerCtr = 1; layerCtr < = vps->getMaxLayers() - 1; layerCtr++)1560 for (UInt layerCtr = 1; layerCtr < vps->getMaxLayers(); layerCtr++) 1532 1561 { 1533 1562 UInt layerId = vps->getLayerIdInNuh(layerCtr); 1534 1563 vps->setNumDirectRefLayers(layerId, m_acTEncTop[layerCtr].getNumDirectRefLayers()); 1535 maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layer Ctr));1536 1537 for (i = 0; i < vps->getNumDirectRefLayers(layer Ctr); i++)1564 maxDirectRefLayers = max<UInt>(maxDirectRefLayers, vps->getNumDirectRefLayers(layerId)); 1565 1566 for (i = 0; i < vps->getNumDirectRefLayers(layerId); i++) 1538 1567 { 1539 1568 vps->setRefLayerId(layerId, i, m_acTEncTop[layerCtr].getRefLayerId(i)); … … 1545 1574 vps->setDirectDependencyFlag(layerCtr, refLayerCtr, false); 1546 1575 } 1547 for (i = 0; i < vps->getNumDirectRefLayers(layer Ctr); i++)1576 for (i = 0; i < vps->getNumDirectRefLayers(layerId); i++) 1548 1577 { 1549 1578 vps->setDirectDependencyFlag(layerCtr, vps->getLayerIdxInVps(m_acTEncTop[layerCtr].getRefLayerId(i)), true); -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1038 r1057 3599 3599 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3600 3600 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3601 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_layerId, refPic->getLayerId() );3601 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( getLayerIdx(), refPic->getLayerIdx() ); 3602 3602 } 3603 3603 } … … 3613 3613 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 3614 3614 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 3615 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_layerId, refPic->getLayerId() );3615 checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( getLayerIdx(), refPic->getLayerIdx() ); 3616 3616 } 3617 3617 } -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1029 r1057 487 487 Void setLayerId (UInt layerId) { m_layerId = layerId; } 488 488 UInt getLayerId () { return m_layerId; } 489 UInt getLayerIdx () { return m_pcSlice->getVPS()->getLayerIdxInVps(m_layerId); } 489 490 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 490 491 Bool isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1049 r1057 200 200 Void setLayerId (UInt layerId) { m_layerId = layerId; } 201 201 UInt getLayerId () { return m_layerId; } 202 UInt getLayerIdx() { return getSlice(0)->getVPS()->getLayerIdxInVps(m_layerId); } 202 203 Bool isSpatialEnhLayer(UInt refLayerIdc) { return m_bSpatialEnhLayer[refLayerIdc]; } 203 204 Void setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; } -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
r1029 r1057 599 599 // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture, 600 600 // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture 601 assert( pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId (), refPic->getLayerId() ) );601 assert( pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerIdx(), refPic->getLayerIdx() ) ); 602 602 603 603 #if REF_IDX_ME_ZEROMV -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1046 r1057 3363 3363 #if CHANGE_NUMSUBDPB_IDX 3364 3364 // For layer set 0 3365 setNumSubDpbs(0, 1);3365 m_numSubDpbs[0] = 1; 3366 3366 // For other layer sets 3367 for( Int i = 1; i < getNumLayerSets(); i++)3368 { 3369 setNumSubDpbs( i, getNumLayersInIdList( i ) );3367 for( Int i = 1; i < m_numLayerSets; i++) 3368 { 3369 m_numSubDpbs[i] = m_numLayerInIdList[i]; 3370 3370 } 3371 3371 #else … … 3796 3796 m_numNecessaryLayers.empty(); 3797 3797 // Assumed that output layer sets and variables RecursiveRefLayer are already derived 3798 for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++)3798 for( Int olsIdx = 0; olsIdx < m_numOutputLayerSets; olsIdx++) 3799 3799 { 3800 3800 deriveNecessaryLayerFlag(olsIdx); … … 3803 3803 Void TComVPS::deriveNecessaryLayerFlag(Int const olsIdx) 3804 3804 { 3805 Int lsIdx = this->getOutputLayerSetIdx( olsIdx );3806 Int numLayersInLs = this->getNumLayersInIdList( lsIdx );3805 Int lsIdx = m_outputLayerSetIdx[olsIdx]; 3806 Int numLayersInLs = m_numLayerInIdList[lsIdx]; 3807 3807 assert( m_necessaryLayerFlag.size() == olsIdx ); // Function should be called in the correct order. 3808 3808 m_necessaryLayerFlag.push_back( std::vector<Bool>( numLayersInLs, false ) ); // Initialize to false 3809 3809 for( Int lsLayerIdx = 0; lsLayerIdx < numLayersInLs; lsLayerIdx++ ) 3810 3810 { 3811 if( this->m_outputLayerFlag[olsIdx][lsLayerIdx] )3811 if( m_outputLayerFlag[olsIdx][lsLayerIdx] ) 3812 3812 { 3813 3813 m_necessaryLayerFlag[olsIdx][lsLayerIdx] = true; 3814 Int currNuhLayerId = this->m_layerSetLayerIdList[lsIdx][lsLayerIdx];3814 Int currNuhLayerId = m_layerSetLayerIdList[lsIdx][lsLayerIdx]; 3815 3815 for( Int rLsLayerIdx = 0; rLsLayerIdx < lsLayerIdx; rLsLayerIdx++ ) 3816 3816 { 3817 Int refNuhLayerId = this->m_layerSetLayerIdList[lsIdx][rLsLayerIdx];3818 if( this->m_recursiveRefLayerFlag[currNuhLayerId][refNuhLayerId] )3817 Int refNuhLayerId = m_layerSetLayerIdList[lsIdx][rLsLayerIdx]; 3818 if( m_recursiveRefLayerFlag[currNuhLayerId][refNuhLayerId] ) 3819 3819 { 3820 3820 m_necessaryLayerFlag[olsIdx][rLsLayerIdx] = true; … … 3831 3831 NecessaryLayerFlag[ olsIdx ][ lsLayerIdx ] is equal to 1 for the value of lsLayerIdx 3832 3832 for which LayerSetLayerIdList[ OlsIdxToLsIdx[ olsIdx ] ][ lsLayerIdx ] is equal to layer_id_in_nuh[ layerIdx ]. */ 3833 for(Int layerIdx = this->getBaseLayerInternalFlag() ? 0 : 1; layerIdx < this->getMaxLayers(); layerIdx++)3833 for(Int layerIdx = m_baseLayerInternalFlag ? 0 : 1; layerIdx < m_uiMaxLayers; layerIdx++) 3834 3834 { 3835 3835 Bool layerFoundNecessaryLayerFlag = false; 3836 for(Int olsIdx = 0; olsIdx < this->getNumOutputLayerSets(); olsIdx++)3837 { 3838 Int lsIdx = this->getOutputLayerSetIdx( olsIdx );3839 Int currNuhLayerId = this->getLayerIdInNuh( layerIdx );3836 for(Int olsIdx = 0; olsIdx < m_numOutputLayerSets; olsIdx++) 3837 { 3838 Int lsIdx = m_outputLayerSetIdx[olsIdx]; 3839 Int currNuhLayerId = m_layerIdInNuh[layerIdx]; 3840 3840 std::vector<Int>::iterator iter = std::find( m_layerSetLayerIdList[lsIdx].begin(), m_layerSetLayerIdList[lsIdx].end(), currNuhLayerId ); 3841 3841 if( iter != m_layerSetLayerIdList[lsIdx].end() ) // Layer present in layer set … … 4299 4299 pcIlpPic[refLayerIdc]->setIsLongTerm(1); 4300 4300 4301 // assign PPS to I RLP to be used for reference location offsets4301 // assign PPS to ILRP to be used for reference location offsets 4302 4302 pcIlpPic[refLayerIdc]->getSlice(0)->setPPS( m_pcPic->getSlice(0)->getPPS() ); 4303 4304 // assing VPS to ILRP to be used for deriving layerIdx 4305 pcIlpPic[refLayerIdc]->getSlice(0)->setVPS( m_pcPic->getSlice(0)->getVPS() ); 4303 4306 4304 4307 #if REF_IDX_MFM -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1053 r1057 634 634 #if NECESSARY_LAYER_FLAG 635 635 std::vector< std::vector<Int> > m_layerSetLayerIdList; 636 std::vector<Int> m_numLayerInIdList;;636 std::vector<Int> m_numLayerInIdList; 637 637 #else 638 638 Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1]; … … 1052 1052 Void setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx) { m_highestLayerIdxPlus1[set][idx] = layerIdx; } 1053 1053 Void setPredictedLayerIds(); 1054 UInt getPredictedLayerId(UInt layerId x, UInt predIdx) { return m_predictedLayerId[layerIdx][predIdx]; }1055 Void setPredictedLayerId(UInt layerId x, UInt predIdx, UInt x) { m_predictedLayerId[layerIdx][predIdx] = x; }1054 UInt getPredictedLayerId(UInt layerId, UInt predIdx) { return m_predictedLayerId[layerId][predIdx]; } 1055 Void setPredictedLayerId(UInt layerId, UInt predIdx, UInt x) { m_predictedLayerId[layerId][predIdx] = x; } 1056 1056 UInt getNumPredictedLayers(UInt layerId) { return m_numPredictedLayers[layerId]; } 1057 1057 Void setNumPredictedLayers(UInt layerId, UInt x) { m_numPredictedLayers[layerId] = x; } … … 1089 1089 Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } 1090 1090 1091 UInt getLayerIdInNuh(Int layerIdx) { return m_layerIdInNuh[layerIdx]; }1092 Void setLayerIdInNuh(Int layerIdx, UInt x) { m_layerIdInNuh[layerIdx] = x;}1093 1094 UInt getDimensionId(Int layerIdx, Int id) 1095 Void setDimensionId(Int layerIdx, Int id, UInt x) 1091 UInt getLayerIdInNuh(Int layerIdx) { return m_layerIdInNuh[layerIdx]; } 1092 Void setLayerIdInNuh(Int layerIdx, UInt layerId) { m_layerIdInNuh[layerIdx] = layerId; } 1093 1094 UInt getDimensionId(Int layerIdx, Int id) { return m_dimensionId[layerIdx][id]; } 1095 Void setDimensionId(Int layerIdx, Int id, UInt x) { m_dimensionId[layerIdx][id] = x; } 1096 1096 1097 1097 UInt getNumScalabilityTypes() { return m_numScalabilityTypes; } 1098 1098 Void setNumScalabilityTypes(UInt x) { m_numScalabilityTypes = x; } 1099 1099 1100 UInt getLayerIdxInVps(Int layerId) { return m_layerIdxInVps[layerId]; }1101 Void setLayerIdxInVps(Int layerId, UInt x) { m_layerIdxInVps[layerId] = x;}1100 UInt getLayerIdxInVps(Int layerId) { return m_layerIdxInVps[layerId]; } 1101 Void setLayerIdxInVps(Int layerId, UInt layerIdx) { m_layerIdxInVps[layerId] = layerIdx; } 1102 1102 #endif 1103 1103 #if BITRATE_PICRATE_SIGNALLING … … 1134 1134 #if VPS_EXTN_DIRECT_REF_LAYERS 1135 1135 // Direct dependency of layers 1136 Bool getDirectDependencyFlag(Int currLayerId c, Int refLayerIdc) { return m_directDependencyFlag[currLayerIdc][refLayerIdc]; }1137 Void setDirectDependencyFlag(Int currLayerId c, Int refLayerIdc, Bool x) { m_directDependencyFlag[currLayerIdc][refLayerIdc] = x; }1136 Bool getDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx) { return m_directDependencyFlag[currLayerIdx][refLayerIdx]; } 1137 Void setDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx, Bool x) { m_directDependencyFlag[currLayerIdx][refLayerIdx] = x; } 1138 1138 1139 1139 UInt getNumDirectRefLayers(Int layerId) { return m_numDirectRefLayers[layerId]; } … … 1151 1151 Void setDefaultDirectDependecyType(UInt x) { m_defaultDirectDependencyType = x; } 1152 1152 #endif 1153 UInt getDirectDependencyType(Int currLayerId , Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; }1154 Void setDirectDependencyType(Int currLayerId , Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; }1155 Bool isSamplePredictionType(Int currLayerId , Int refLayerId) { assert(currLayerId != refLayerId); return ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 1 ) ? true : false; }1156 Bool isMotionPredictionType(Int currLayerId , Int refLayerId) { assert(currLayerId != refLayerId); return ( ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 2 ) >> 1 ) ? true : false; }1153 UInt getDirectDependencyType(Int currLayerIdx, Int refLayerIdx) { return m_directDependencyType[currLayerIdx][refLayerIdx]; } 1154 Void setDirectDependencyType(Int currLayerIdx, Int refLayerIdx, UInt x) { m_directDependencyType[currLayerIdx][refLayerIdx] = x; } 1155 Bool isSamplePredictionType(Int currLayerIdx, Int refLayerIdx) { assert(currLayerIdx != refLayerIdx); return ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 1 ) ? true : false; } 1156 Bool isMotionPredictionType(Int currLayerIdx, Int refLayerIdx) { assert(currLayerIdx != refLayerIdx); return ( ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 2 ) >> 1 ) ? true : false; } 1157 1157 #endif 1158 1158 UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1049 r1057 3034 3034 #endif 3035 3035 #if LIST_OF_PTL 3036 for(Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < = vps->getNumProfileTierLevel() - 1; idx++)3036 for(Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < vps->getNumProfileTierLevel(); idx++) 3037 3037 #else 3038 3038 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1056 r1057 2229 2229 if( refPic->isILR(pcSlice->getLayerId()) ) 2230 2230 { 2231 assert( m_ppcTDecTop[m_layerId]->getMotionPredEnabledFlag( pcSlice->getVPS()->getLayerIdxInVps(refPic->getLayerId())) );2231 assert( m_ppcTDecTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerIdx() ) ); 2232 2232 } 2233 2233 } … … 3008 3008 for(Int i = 0; i < vps->getNumOutputLayerSets(); i++) 3009 3009 { 3010 Bool layerSetMatchFlag = true;3010 Bool layerSetMatchFlag = false; 3011 3011 Int layerSetIdx = vps->getOutputLayerSetIdx( i ); 3012 if( vps->getNumLayersInIdList( layerSetIdx ) == params->getTargetLayerId() + 1 ) 3013 { 3014 for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++) 3015 { 3016 if( vps->getLayerSetLayerIdList( layerSetIdx, j ) != j ) 3017 { 3018 layerSetMatchFlag = false; 3019 break; 3020 } 3021 } 3022 } 3023 else 3024 { 3025 layerSetMatchFlag = false; 3012 3013 for(Int j = 0; j < vps->getNumLayersInIdList( layerSetIdx ); j++) 3014 { 3015 if( vps->getLayerSetLayerIdList( layerSetIdx, j ) == params->getTargetLayerId() ) 3016 { 3017 layerSetMatchFlag = true; 3018 break; 3019 } 3026 3020 } 3027 3021 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r1049 r1057 273 273 Void setNumSamplePredRefLayers (Int num) { m_numSamplePredRefLayers = num; } 274 274 275 Int getSamplePredRefLayerId (Int i) { return m_samplePredRefLayerId[i]; }276 Void setSamplePredRefLayerId (Int i, Int refLayerId) { m_samplePredRefLayerId[i] = refLayerId; }275 Int getSamplePredRefLayerId (Int layerIdc) { return m_samplePredRefLayerId[layerIdc]; } 276 Void setSamplePredRefLayerId (Int layerIdc, Int refLayerId) { m_samplePredRefLayerId[layerIdc] = refLayerId; } 277 277 278 278 Int getNumMotionPredRefLayers () { return m_numMotionPredRefLayers; } 279 279 Void setNumMotionPredRefLayers (Int num) { m_numMotionPredRefLayers = num; } 280 280 281 Int getMotionPredRefLayerId (Int i) { return m_motionPredRefLayerId[i]; } 282 Void setMotionPredRefLayerId (Int i, Int refLayerId) { m_motionPredRefLayerId[i] = refLayerId; } 283 284 Bool getSamplePredEnabledFlag (Int i) { return m_samplePredEnabledFlag[i]; } 285 Void setSamplePredEnabledFlag (Int i,Bool flag) { m_samplePredEnabledFlag[i] = flag; } 286 287 Bool getMotionPredEnabledFlag (Int i) { return m_motionPredEnabledFlag[i]; } 288 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; } 289 290 TDecTop* getSamplePredRefLayerDec ( UInt layerId ); 291 TDecTop* getMotionPredRefLayerDec ( UInt layerId ); 281 Int getMotionPredRefLayerId (Int layerIdc) { return m_motionPredRefLayerId[layerIdc]; } 282 Void setMotionPredRefLayerId (Int layerIdc, Int refLayerId) { m_motionPredRefLayerId[layerIdc] = refLayerId; } 283 284 Bool getSamplePredEnabledFlag (Int layerIdx) { return m_samplePredEnabledFlag[layerIdx]; } 285 Void setSamplePredEnabledFlag (Int layerIdx, Bool flag) { m_samplePredEnabledFlag[layerIdx] = flag; } 286 287 Bool getMotionPredEnabledFlag (Int layerIdx) { return m_motionPredEnabledFlag[layerIdx]; } 288 Void setMotionPredEnabledFlag (Int layerIdx, Bool flag) { m_motionPredEnabledFlag[layerIdx] = flag; } 292 289 293 290 Void setRefLayerParams( TComVPS* vps ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1048 r1057 2170 2170 if( !vps->getSplittingFlag() ) 2171 2171 { 2172 for(j = 0; j < vps->getNumScalabilityTypes(); j++)2173 {2174 UInt bits = vps->getDimensionIdLen(j);2175 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" );2176 }2177 }2172 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 2173 { 2174 UInt bits = vps->getDimensionIdLen(j); 2175 WRITE_CODE( vps->getDimensionId(i, j), bits, "dimension_id[i][j]" ); 2176 } 2177 } 2178 2178 } 2179 2179 #endif … … 2208 2208 2209 2209 #if VPS_EXTN_DIRECT_REF_LAYERS 2210 for( Int layerCtr = 1; layerCtr < = vps->getMaxLayers() - 1; layerCtr++)2210 for( Int layerCtr = 1; layerCtr < vps->getMaxLayers(); layerCtr++) 2211 2211 { 2212 2212 for( Int refLayerCtr = 0; refLayerCtr < layerCtr; refLayerCtr++) … … 2282 2282 assert( vps->getNumProfileTierLevel() == vps->getPTLForExtnPtr()->size()); 2283 2283 #endif 2284 for(Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < = vps->getNumProfileTierLevel() - 1; idx++)2284 for(Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < vps->getNumProfileTierLevel(); idx++) 2285 2285 #else 2286 2286 for(Int idx = 1; idx <= vps->getNumProfileTierLevel() - 1; idx++) -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1048 r1057 391 391 392 392 Int m_numActiveRefLayers; 393 Int m_predLayerId [MAX_VPS_LAYER_IDX_PLUS1];393 Int m_predLayerIdx[MAX_VPS_LAYER_IDX_PLUS1]; 394 394 Int m_numSamplePredRefLayers; 395 395 Int m_samplePredRefLayerId[MAX_VPS_LAYER_IDX_PLUS1]; … … 1119 1119 Void setNumActiveRefLayers (Int num) { m_numActiveRefLayers = num; } 1120 1120 1121 Int getPredLayerId (Int i) { return m_predLayerId[i]; }1122 Void setPredLayerId (Int i, Int refLayerId) { m_predLayerId[i] = refLayerId;}1121 Int getPredLayerIdx (Int lyaerIdc) { return m_predLayerIdx[lyaerIdc]; } 1122 Void setPredLayerIdx (Int lyaerIdc, Int refLayerIdx) { m_predLayerIdx[lyaerIdc] = refLayerIdx; } 1123 1123 1124 1124 Int getNumSamplePredRefLayers () { return m_numSamplePredRefLayers; } 1125 1125 Void setNumSamplePredRefLayers (Int num) { m_numSamplePredRefLayers = num; } 1126 1126 1127 Int getSamplePredRefLayerId (Int i) { return m_samplePredRefLayerId[i]; }1128 Void setSamplePredRefLayerId (Int i, Int refLayerId) { m_samplePredRefLayerId[i] = refLayerId; }1127 Int getSamplePredRefLayerId (Int layerIdc) { return m_samplePredRefLayerId[layerIdc]; } 1128 Void setSamplePredRefLayerId (Int layerIdc, Int refLayerId) { m_samplePredRefLayerId[layerIdc] = refLayerId; } 1129 1129 1130 1130 Int getNumMotionPredRefLayers () { return m_numMotionPredRefLayers; } 1131 1131 Void setNumMotionPredRefLayers (Int num) { m_numMotionPredRefLayers = num; } 1132 1132 1133 Int getMotionPredRefLayerId (Int i) { return m_motionPredRefLayerId[i]; }1134 Void setMotionPredRefLayerId (Int i, Int refLayerId) { m_motionPredRefLayerId[i] = refLayerId; }1135 1136 Bool getSamplePredEnabledFlag (Int i) { return m_samplePredEnabledFlag[i]; }1137 Void setSamplePredEnabledFlag (Int i,Bool flag) { m_samplePredEnabledFlag[i] = flag; }1138 1139 Bool getMotionPredEnabledFlag (Int i) { return m_motionPredEnabledFlag[i]; }1140 Void setMotionPredEnabledFlag (Int i,Bool flag) { m_motionPredEnabledFlag[i] = flag; }1133 Int getMotionPredRefLayerId (Int layerIdc) { return m_motionPredRefLayerId[layerIdc]; } 1134 Void setMotionPredRefLayerId (Int layerIdc, Int refLayerId) { m_motionPredRefLayerId[layerIdc] = refLayerId; } 1135 1136 Bool getSamplePredEnabledFlag (Int layerIdx) { return m_samplePredEnabledFlag[layerIdx]; } 1137 Void setSamplePredEnabledFlag (Int layerIdx, Bool flag) { m_samplePredEnabledFlag[layerIdx] = flag; } 1138 1139 Bool getMotionPredEnabledFlag (Int layerIdx) { return m_motionPredEnabledFlag[layerIdx]; } 1140 Void setMotionPredEnabledFlag (Int layerIdx,Bool flag) { m_motionPredEnabledFlag[layerIdx] = flag; } 1141 1141 #endif 1142 1142 Int getMaxTidIlRefPicsPlus1 () { return m_maxTidIlRefPicsPlus1; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.h
r1054 r1057 182 182 183 183 #if SVC_EXTENSION 184 TEncTop* getLayerEnc(UInt LayerId) {return m_ppcTEncTop[LayerId]; }184 TEncTop* getLayerEnc(UInt layerIdx) {return m_ppcTEncTop[layerIdx]; } 185 185 #if ENCODER_FAST_MODE 186 186 Void xCheckRDCostILRUni ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt refLayerId); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1055 r1057 192 192 if( pcTEncTop->getLayerId() ) 193 193 { 194 UInt prevLayerId = pcTEncTop->getLayerId()-1; // it should be changed 194 UInt prevLayerIdx = pcTEncTop->getPredLayerIdx( pcTEncTop->getNumActiveRefLayers() - 1); 195 UInt prevLayerId = pcTEncTop->getRefLayerId(prevLayerIdx); 195 196 196 197 m_Enc3DAsymLUTPicUpdate.create( m_pcCfg->getCGSMaxOctantDepth() , g_bitDepthLayer[CHANNEL_TYPE_LUMA][prevLayerId] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][prevLayerId] , g_bitDepthLayer[CHANNEL_TYPE_LUMA][pcTEncTop->getLayerId()] , g_bitDepthLayer[CHANNEL_TYPE_CHROMA][pcTEncTop->getLayerId()] , m_pcCfg->getCGSMaxYPartNumLog2() /*, m_pcCfg->getCGSPhaseAlignment()*/ ); … … 1172 1173 for (UInt i = 0; i < m_pcCfg->getNumLayer(); i++) 1173 1174 { 1174 Int layerId = pcSlice->getVPS()->getLayerIdInNuh(i); 1175 m_ppcTEncTop[layerId]->setLayerInitializedFlag(false); 1176 m_ppcTEncTop[layerId]->setFirstPicInLayerDecodedFlag(false); 1175 m_ppcTEncTop[i]->setLayerInitializedFlag(false); 1176 m_ppcTEncTop[i]->setFirstPicInLayerDecodedFlag(false); 1177 1177 } 1178 1178 } … … 1224 1224 1225 1225 // infer the scaling list from the reference layer 1226 pcSlice->setScalingList ( m_ppcTEncTop[ refLayerId]->getScalingList() );1226 pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() ); 1227 1227 } 1228 1228 else … … 1258 1258 1259 1259 // infer the scaling list from the reference layer 1260 pcSlice->setScalingList ( m_ppcTEncTop[ refLayerId]->getScalingList() );1260 pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() ); 1261 1261 } 1262 1262 else … … 1311 1311 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1312 1312 #if VPS_EXTN_DIRECT_REF_LAYERS 1313 TComList<TComPic*> *cListPic = m_ppcTEncTop[ m_layerId]->getRefLayerEnc(refLayerIdc)->getListPic();1313 TComList<TComPic*> *cListPic = m_ppcTEncTop[refLayerIdc]->getRefLayerEnc(refLayerIdc)->getListPic(); 1314 1314 #else 1315 1315 TComList<TComPic*> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)-1]->getListPic(); … … 1415 1415 { 1416 1416 // check for the sample prediction picture type 1417 if( m_ppcTEncTop[ m_layerId]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId)))1417 if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId))) 1418 1418 { 1419 1419 #if P0312_VERT_PHASE_ADJ … … 1494 1494 if(pcSlice->getVPS()->getCrossLayerIrapAlignFlag()) 1495 1495 { 1496 TComList<TComPic*> *cListPic = m_ppcTEncTop[ m_layerId]->getRefLayerEnc(0)->getListPic();1496 TComList<TComPic*> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getRefLayerEnc(0)->getListPic(); 1497 1497 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 1498 1498 if(picLayer0) … … 1536 1536 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_R && 1537 1537 #if SVC_EXTENSION 1538 ( m_iGopSize != 1 || m_ppcTEncTop[ m_layerId]->getIntraPeriod() > 1 ) )1538 ( m_iGopSize != 1 || m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getIntraPeriod() > 1 ) ) 1539 1539 #else 1540 1540 !(m_iGopSize == 1 && pcSlice->getSliceType() == I_SLICE)) … … 1841 1841 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1842 1842 { 1843 if( m_ppcTEncTop[ m_layerId]->getSamplePredEnabledFlag( pcSlice->getVPS()->getRefLayerId( m_layerId, pcSlice->getInterLayerPredLayerIdc(i)) ) )1843 if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( pcSlice->getInterLayerPredLayerIdc(i) ) ) 1844 1844 { 1845 1845 foundSamplePredPicture = true; … … 1875 1875 for( Int i = 0; i < pcSlice->getLayerId(); i++) 1876 1876 { 1877 TComList<TComPic *> *cListPic = m_ppcTEncTop[ i]->getListPic();1877 TComList<TComPic *> *cListPic = m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(i)]->getListPic(); 1878 1878 TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC()); 1879 1879 if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerIdx(), i) ) … … 1969 1969 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1970 1970 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1971 if( refPic->isILR(m_layerId) && m_ppcTEncTop[ m_layerId]->getMotionPredEnabledFlag( pcSlice->getVPS()->getLayerIdxInVps(refPic->getLayerId()) )1971 if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerIdx() ) 1972 1972 #if MFM_ENCCONSTRAINT 1973 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId ()]->getListPic() )->checkSameRefInfo() == true1973 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerIdx()]->getListPic() )->checkSameRefInfo() == true 1974 1974 #endif 1975 1975 ) … … 1991 1991 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 1992 1992 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 1993 if( refPic->isILR(m_layerId) && m_ppcTEncTop[ m_layerId]->getMotionPredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps( refPic->getLayerId()))1993 if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerIdx() ) 1994 1994 #if MFM_ENCCONSTRAINT 1995 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerId ()]->getListPic() )->checkSameRefInfo() == true1995 && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerIdx()]->getListPic() )->checkSameRefInfo() == true 1996 1996 #endif 1997 1997 ) … … 2110 2110 // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 2111 2111 // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture. 2112 if( refPic->isILR(m_layerId) && !m_ppcTEncTop[ m_layerId]->getMotionPredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refPic->getLayerId())))2112 if( refPic->isILR(m_layerId) && !m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag(refPic->getLayerIdx()) ) 2113 2113 { 2114 2114 pcSlice->setEnableTMVPFlag(false); … … 2128 2128 TComPic* refPic = pcSlice->getRefPic(refList, refIdx); 2129 2129 2130 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[ m_layerId]->getSamplePredEnabledFlag( pcSlice->getVPS()->getLayerIdxInVps(refPic->getLayerId())) ) )2130 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerIdx() ) ) ) 2131 2131 { 2132 2132 break; … … 2152 2152 TComPic* refPic = pcSlice->getRefPic(refList, refIdx); 2153 2153 2154 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[ m_layerId]->getSamplePredEnabledFlag( pcSlice->getVPS()->getLayerIdxInVps((refPic->getLayerId())))) )2154 if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerIdx() ) ) ) 2155 2155 { 2156 2156 break; … … 4664 4664 for(Int i = 1; i < slice->getVPS()->getMaxLayers(); i++) 4665 4665 { 4666 UInt layerId = slice->getVPS()->getLayerIdInNuh(i); 4667 Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 4668 Bool refreshTypeFlag = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshType() ); 4666 Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ); 4667 Bool refreshTypeFlag = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() ); 4669 4668 if( !(refreshIntervalFlag && refreshTypeFlag) ) 4670 4669 { … … 4682 4681 for(Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++) 4683 4682 { 4684 UInt layerId = slice->getVPS()->getLayerIdInNuh(i); 4685 Bool idrFlag = ( (m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshType() == 2) 4686 && ( pocCurr % m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 4683 Bool idrFlag = ( (m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2) 4684 && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 4687 4685 ); 4688 4686 for(Int j = 0; j < slice->getVPS()->getMaxLayers(); j++) … … 4693 4691 } 4694 4692 4695 layerId = slice->getVPS()->getLayerIdInNuh(j); 4696 Bool idrOtherPicFlag = ( (m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshType() == 2) 4697 && ( pocCurr % m_ppcTEncTop[layerId]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 4693 Bool idrOtherPicFlag = ( (m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2) 4694 && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) 4698 4695 ); 4699 4696 … … 4739 4736 for (UInt i = 0; i < MAX_LAYERS; i++) 4740 4737 { 4741 UInt layerId = slice->getVPS()->getLayerIdInNuh(i); 4742 m_ppcTEncTop[layerId]->setPocDecrementedInDPBFlag(false); 4738 m_ppcTEncTop[i]->setPocDecrementedInDPBFlag(false); 4743 4739 } 4744 4740 #endif … … 4828 4824 for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++) 4829 4825 { 4830 if (!m_ppcTEncTop[affectedLayerList[layerIdx]]->getPocDecrementedInDPBFlag()) 4831 { 4832 m_ppcTEncTop[affectedLayerList[layerIdx]]->setPocDecrementedInDPBFlag(true); 4826 UInt lIdx = slice->getVPS()->getLayerIdxInVps(affectedLayerList[layerIdx]); 4827 4828 if (!m_ppcTEncTop[lIdx]->getPocDecrementedInDPBFlag()) 4829 { 4830 m_ppcTEncTop[lIdx]->setPocDecrementedInDPBFlag(true); 4833 4831 4834 4832 // Decrement value of associatedIrapPoc of the TEncGop object 4835 m_ppcTEncTop[ affectedLayerList[layerIdx]]->getGOPEncoder()->m_associatedIRAPPOC -= deltaPocVal;4833 m_ppcTEncTop[lIdx]->getGOPEncoder()->m_associatedIRAPPOC -= deltaPocVal; 4836 4834 4837 4835 // Decrememnt the value of m_pocCRA 4838 m_ppcTEncTop[ affectedLayerList[layerIdx]]->getGOPEncoder()->m_pocCRA -= deltaPocVal;4839 4840 TComList<TComPic*>::iterator iterPic = m_ppcTEncTop[ affectedLayerList[layerIdx]]->getListPic()->begin();4841 while (iterPic != m_ppcTEncTop[ affectedLayerList[layerIdx]]->getListPic()->end())4836 m_ppcTEncTop[lIdx]->getGOPEncoder()->m_pocCRA -= deltaPocVal; 4837 4838 TComList<TComPic*>::iterator iterPic = m_ppcTEncTop[lIdx]->getListPic()->begin(); 4839 while (iterPic != m_ppcTEncTop[lIdx]->getListPic()->end()) 4842 4840 #else 4843 4841 // Decrement value of associatedIrapPoc of the TEncGop object … … 5342 5340 { 5343 5341 Int iLayerId = slice->getVPS()->getPredictedLayerId(dolLayerId, i); 5344 m_ppcTEncTop[ iLayerId]->setLayerInitializedFlag(false);5345 m_ppcTEncTop[ iLayerId]->setFirstPicInLayerDecodedFlag(false);5342 m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(iLayerId)]->setLayerInitializedFlag(false); 5343 m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(iLayerId)]->setFirstPicInLayerDecodedFlag(false); 5346 5344 } 5347 5345 5348 5346 // Each picture that is in the DPB and has nuh_layer_id equal to dolLayerId is marked as "unused for reference". 5349 for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[ dolLayerId]->getListPic()->begin(); pic != m_ppcTEncTop[dolLayerId]->getListPic()->end(); pic++)5347 for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(dolLayerId)]->getListPic()->begin(); pic != m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(dolLayerId)]->getListPic()->end(); pic++) 5350 5348 { 5351 5349 if ((*pic)->getSlice(0)->getPOC() != slice->getPOC()) … … 5360 5358 { 5361 5359 UInt predLId = slice->getVPS()->getPredictedLayerId(dolLayerId, i); 5362 for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[ predLId]->getListPic()->begin(); pic != m_ppcTEncTop[predLId]->getListPic()->end(); pic++)5360 for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(predLId)]->getListPic()->begin(); pic != m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(predLId)]->getListPic()->end(); pic++) 5363 5361 { 5364 5362 if ((*pic)->getSlice(0)->getPOC() != slice->getPOC()) … … 5381 5379 m_noRaslOutputFlag = true; 5382 5380 } 5383 else if (!m_ppcTEncTop[ m_layerId]->getLayerInitializedFlag())5381 else if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->getLayerInitializedFlag()) 5384 5382 { 5385 5383 Bool refLayersInitialized = true; … … 5387 5385 { 5388 5386 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, j); 5389 if (!m_ppcTEncTop[ refLayerId]->getLayerInitializedFlag())5387 if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(refLayerId)]->getLayerInitializedFlag()) 5390 5388 { 5391 5389 refLayersInitialized = false; … … 5406 5404 if (m_layerId == 0) 5407 5405 { 5408 m_ppcTEncTop[ m_layerId]->setLayerInitializedFlag(true);5409 } 5410 else if (!m_ppcTEncTop[ m_layerId]->getLayerInitializedFlag() && slice->getVPS()->getNumDirectRefLayers(m_layerId) == 0)5411 { 5412 m_ppcTEncTop[ m_layerId]->setLayerInitializedFlag(true);5413 } 5414 else if (!m_ppcTEncTop[ m_layerId]->getLayerInitializedFlag())5406 m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->setLayerInitializedFlag(true); 5407 } 5408 else if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->getLayerInitializedFlag() && slice->getVPS()->getNumDirectRefLayers(m_layerId) == 0) 5409 { 5410 m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->setLayerInitializedFlag(true); 5411 } 5412 else if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->getLayerInitializedFlag()) 5415 5413 { 5416 5414 Bool refLayersInitialized = true; … … 5418 5416 { 5419 5417 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, j); 5420 if (!m_ppcTEncTop[ refLayerId]->getLayerInitializedFlag())5418 if (!m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(refLayerId)]->getLayerInitializedFlag()) 5421 5419 { 5422 5420 refLayersInitialized = false; … … 5425 5423 if (refLayersInitialized) 5426 5424 { 5427 m_ppcTEncTop[ m_layerId]->setLayerInitializedFlag(true);5425 m_ppcTEncTop[slice->getVPS()->getLayerIdxInVps(m_layerId)]->setLayerInitializedFlag(true); 5428 5426 } 5429 5427 } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp
r1029 r1057 3243 3243 3244 3244 // motion search only for the ILRP with sample prediction type 3245 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId (), pcPic->getLayerId() ) )3245 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerIdx(), pcPic->getLayerIdx() ) ) 3246 3246 { 3247 3247 continue; … … 3481 3481 3482 3482 // motion search only for the ILRP with sample prediction type 3483 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId (), pcPic->getLayerId() ) )3483 if( pcPic->isILR( pcCU->getLayerId() ) && !pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerIdx(), pcPic->getLayerIdx() ) ) 3484 3484 { 3485 3485 continue; … … 6074 6074 6075 6075 // ILRP has to be for the sample prediction type 6076 if( refPic->isILR(pcCU->getLayerId()) && refPic->getLayerId() == refLayerId && pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerId (), refLayerId) )6076 if( refPic->isILR(pcCU->getLayerId()) && refPic->getLayerId() == refLayerId && pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getLayerIdx(), pcCU->getSlice()->getVPS()->getLayerIdxInVps(refLayerId) ) ) 6077 6077 { 6078 6078 iRefIdxTemp = refIdx; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1051 r1057 139 139 { 140 140 #if JCTVC_M0259_LAMBDAREFINEMENT 141 if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getLayerId ()]->getNumActiveRefLayers() && depth >= 3 && m_pcCfg->getGOPSize() == ( 1 << depth ) )142 { 143 Int nCurLayerId= slice->getLayerId();144 UInt prevLayerId = slice->getVPS()->getLayerIdInNuh(slice->getVPS()->getLayerIdxInVps(nCurLayerId)-1);145 146 Double gamma = xCalEnhLambdaFactor( m_ppcTEncTop[prevLayerId ]->getQP() - m_ppcTEncTop[nCurLayerId]->getQP() ,147 1.0 * m_ppcTEncTop[ nCurLayerId]->getSourceWidth() * m_ppcTEncTop[nCurLayerId]->getSourceHeight()148 / m_ppcTEncTop[prevLayerId ]->getSourceWidth() / m_ppcTEncTop[prevLayerId]->getSourceHeight() );141 if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getLayerIdx()]->getNumActiveRefLayers() && depth >= 3 && m_pcCfg->getGOPSize() == ( 1 << depth ) ) 142 { 143 Int layerIdx = slice->getLayerId(); 144 UInt prevLayerIdx = m_ppcTEncTop[layerIdx]->getPredLayerIdx( m_ppcTEncTop[layerIdx]->getNumActiveRefLayers() - 1); 145 146 Double gamma = xCalEnhLambdaFactor( m_ppcTEncTop[prevLayerIdx]->getQP() - m_ppcTEncTop[layerIdx]->getQP() , 147 1.0 * m_ppcTEncTop[layerIdx]->getSourceWidth() * m_ppcTEncTop[layerIdx]->getSourceHeight() 148 / m_ppcTEncTop[prevLayerIdx]->getSourceWidth() / m_ppcTEncTop[prevLayerIdx]->getSourceHeight() ); 149 149 dLambda *= gamma; 150 150 } … … 165 165 166 166 #if JCTVC_M0259_LAMBDAREFINEMENT 167 if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getLayerId ()]->getNumActiveRefLayers() && m_pcCfg->getGOPSize() >= 8 && slice->isIntra() == false && depth == 0 )167 if( slice->getLayerId() > 0 && m_ppcTEncTop[slice->getLayerIdx()]->getNumActiveRefLayers() && m_pcCfg->getGOPSize() >= 8 && slice->isIntra() == false && depth == 0 ) 168 168 { 169 169 dLambdas[0] = dLambda * 1.1; … … 557 557 if( rpcSlice->getNumILRRefIdx() > 0 ) 558 558 { 559 rpcSlice->setActiveNumILRRefIdx( m_ppcTEncTop[ layerId]->getNumActiveRefLayers() );559 rpcSlice->setActiveNumILRRefIdx( m_ppcTEncTop[rpcSlice->getVPS()->getLayerIdxInVps(layerId)]->getNumActiveRefLayers() ); 560 560 for( Int i = 0; i < rpcSlice->getActiveNumILRRefIdx(); i++ ) 561 561 { 562 rpcSlice->setInterLayerPredLayerIdc( m_ppcTEncTop[ layerId]->getPredLayerId(i), i );562 rpcSlice->setInterLayerPredLayerIdc( m_ppcTEncTop[rpcSlice->getVPS()->getLayerIdxInVps(layerId)]->getPredLayerIdx(i), i ); 563 563 } 564 564 rpcSlice->setInterLayerPredEnabledFlag(1); 565 565 } 566 rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[ layerId]->getMFMEnabledFlag());566 rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[rpcSlice->getVPS()->getLayerIdxInVps(layerId)]->getMFMEnabledFlag()); 567 567 } 568 568 … … 764 764 } 765 765 #if O0194_WEIGHTED_PREDICTION_CGS 766 else if( m_ppcTEncTop[pcSlice->getLayerId ()]->getInterLayerWeightedPredFlag() )766 else if( m_ppcTEncTop[pcSlice->getLayerIdx()]->getInterLayerWeightedPredFlag() ) 767 767 { 768 768 // Calculate for the base layer to be used in EL as Inter layer reference … … 1137 1137 1138 1138 #if SVC_EXTENSION 1139 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerId ()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail);1139 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, m_ppcTEncTop[pcSlice->getLayerIdx()]->getSAO()->getSaoMaxOffsetQVal(), sliceEnabled, leftMergeAvail, aboveMergeAvail); 1140 1140 #else 1141 1141 m_pcEntropyCoder->encodeSAOBlkParam(saoblkParam, sliceEnabled, leftMergeAvail, aboveMergeAvail); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1051 r1057 1533 1533 TEncTop* TEncTop::getRefLayerEnc( UInt refLayerIdx ) 1534 1534 { 1535 if( m_ppcTEncTop[m_ layerId]->getNumDirectRefLayers() <= 0 )1535 if( m_ppcTEncTop[m_cVPS.getLayerIdxInVps(m_layerId)]->getNumDirectRefLayers() <= 0 ) 1536 1536 { 1537 1537 return (TEncTop *)getLayerEnc( 0 ); 1538 1538 } 1539 1539 1540 return (TEncTop *)getLayerEnc( m_cVPS.get RefLayerId( m_layerId, refLayerIdx) );1540 return (TEncTop *)getLayerEnc( m_cVPS.getLayerIdxInVps(m_cVPS.getRefLayerId( m_layerId, refLayerIdx )) ); 1541 1541 } 1542 1542 #endif -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r1051 r1057 117 117 static Int m_iPPSIdCnt; ///< next Id number for PPS 118 118 TEncTop** m_ppcTEncTop; 119 TEncTop* getLayerEnc(UInt layerId ) { return m_ppcTEncTop[layerId]; }119 TEncTop* getLayerEnc(UInt layerIdx) { return m_ppcTEncTop[layerIdx]; } 120 120 TComPic* m_cIlpPic[MAX_NUM_REF]; ///< Inter layer Prediction picture = upsampled picture 121 121 #if REF_IDX_MFM … … 235 235 Void setNumRefLayerOffsets(Int x) { m_numRefLayerOffsets = x; } 236 236 UInt getNumRefLayerOffsets() { return m_numRefLayerOffsets; } 237 Void setRefLayerId(Int x, UInt id) { m_refLayerId[x] = id;}238 UInt getRefLayerId(Int x) { return m_refLayerId[x];}237 Void setRefLayerId(Int layerIdx, UInt layerId) { m_refLayerId[layerIdx] = layerId; } 238 UInt getRefLayerId(Int layerIdx) { return m_refLayerId[layerIdx]; } 239 239 Window& getRefLayerWindowForLayer(Int layerId); 240 240 Window& getRefLayerWindow(Int x) { return m_refLayerWindow[x]; }
Note: See TracChangeset for help on using the changeset viewer.