Changeset 1057 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 4 Mar 2015, 09:55:40 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
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.