Changeset 978 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 13 Jan 2015, 14:56:46 (11 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r912 r978 321 321 #if M0040_ADAPTIVE_RESOLUTION_CHANGE 322 322 Int m_adaptiveResolutionChange; 323 #endif 324 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 325 int m_layerSwitchOffBegin; 326 int m_layerSwitchOffEnd; 323 327 #endif 324 328 #if O0153_ALT_OUTPUT_LAYER_FLAG … … 928 932 Int getAdaptiveResolutionChange() { return m_adaptiveResolutionChange; } 929 933 #endif 934 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 935 Void setLayerSwitchOffBegin(Int x) { m_layerSwitchOffBegin = x; } 936 Int getLayerSwitchOffBegin() { return m_layerSwitchOffBegin; } 937 Void setLayerSwitchOffEnd(Int x) { m_layerSwitchOffEnd = x; } 938 Int getLayerSwitchOffEnd() { return m_layerSwitchOffEnd; } 939 #endif 930 940 #if HIGHER_LAYER_IRAP_SKIP_FLAG 931 941 Void setSkipPictureAtArcSwitch(Int x) { m_skipPictureAtArcSwitch = x; } -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r944 r978 119 119 m_lastPocPeriodId = -1; 120 120 #endif 121 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 122 m_noRaslOutputFlag = false; 123 m_prevPicHasEos = false; 124 #endif 121 125 #endif //SVC_EXTENSION 122 126 return; … … 913 917 } 914 918 #endif 919 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 920 if (pocCurr > m_pcEncTop->getLayerSwitchOffBegin() && pocCurr < m_pcEncTop->getLayerSwitchOffEnd()) 921 { 922 continue; 923 } 924 #endif 915 925 916 926 if( getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_N_LP ) … … 1067 1077 } 1068 1078 #endif 1079 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 1080 // Set the nal unit type 1081 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField)); 1082 #endif 1069 1083 #if NO_CLRAS_OUTPUT_FLAG 1070 1084 if (m_layerId == 0 && … … 1080 1094 m_pcEncTop->setNoClrasOutputFlag(true); 1081 1095 } 1096 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 1097 else if (m_prevPicHasEos) 1098 { 1099 m_pcEncTop->setNoClrasOutputFlag(true); 1100 } 1101 #endif 1082 1102 else if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP 1083 1103 || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL … … 1106 1126 } 1107 1127 } 1128 #endif 1129 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 1130 xCheckLayerReset(pcSlice); 1131 xSetNoRaslOutputFlag(pcSlice); 1132 xSetLayerInitializedFlag(pcSlice); 1108 1133 #endif 1109 1134 #if M0040_ADAPTIVE_RESOLUTION_CHANGE … … 1217 1242 } 1218 1243 1244 #if !R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 1219 1245 // Set the nal unit type 1220 1246 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField)); 1247 #endif 1221 1248 #if SVC_EXTENSION 1222 1249 if (m_layerId > 0) … … 2940 2967 2941 2968 #if SETTING_NO_OUT_PIC_PRIOR 2969 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 2970 if (pcSlice->isIRAP()) 2971 { 2972 //the inference for NoOutputPriorPicsFlag 2973 // KJS: This cannot happen at the encoder 2974 if (!m_bFirst && pcSlice->isIRAP() && m_noRaslOutputFlag) 2975 { 2976 if (pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 2977 { 2978 pcSlice->setNoOutputPriorPicsFlag(true); 2979 } 2980 } 2981 } 2982 #else 2942 2983 pcSlice->setNoRaslOutputFlag(false); 2943 2984 if (pcSlice->isIRAP()) … … 2957 2998 } 2958 2999 } 3000 #endif 2959 3001 #endif 2960 3002 … … 3524 3566 } 3525 3567 } 3568 3569 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 3570 m_prevPicHasEos = false; 3571 if (m_pcCfg->getLayerSwitchOffBegin() < m_pcCfg->getLayerSwitchOffEnd()) 3572 { 3573 Int pocNext; 3574 if (iGOPid == m_iGopSize - 1) 3575 { 3576 pocNext = iPOCLast - iNumPicRcvd + m_iGopSize + m_pcCfg->getGOPEntry(0).m_POC; 3577 } 3578 else 3579 { 3580 pocNext = iPOCLast - iNumPicRcvd + m_pcCfg->getGOPEntry(iGOPid + 1).m_POC; 3581 } 3582 3583 if (pocNext > m_pcCfg->getLayerSwitchOffBegin() && pocCurr < m_pcCfg->getLayerSwitchOffEnd()) 3584 { 3585 OutputNALUnit nalu(NAL_UNIT_EOS, pcSlice->getTLayer(), pcSlice->getLayerId()); 3586 m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice); 3587 accessUnit.push_back(new NALUnitEBSP(nalu)); 3588 m_prevPicHasEos = true; 3589 } 3590 } 3591 #endif 3592 3526 3593 xResetNonNestedSEIPresentFlags(); 3527 3594 xResetNestedSEIPresentFlags(); … … 5378 5445 } 5379 5446 #endif 5447 5448 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 5449 Void TEncGOP::xCheckLayerReset(TComSlice *slice) 5450 { 5451 Bool layerResetFlag; 5452 Int dolLayerId; 5453 5454 if (slice->isIRAP() && slice->getLayerId() > 0) 5455 { 5456 if (m_prevPicHasEos) 5457 { 5458 layerResetFlag = true; 5459 dolLayerId = slice->getLayerId(); 5460 } 5461 else if ((slice->isCRA() && slice->getHandleCraAsBlaFlag()) || (slice->isIDR() && slice->getCrossLayerBLAFlag()) || slice->isBLA()) 5462 { 5463 layerResetFlag = true; 5464 dolLayerId = slice->getLayerId(); 5465 } 5466 else 5467 { 5468 layerResetFlag = false; 5469 } 5470 5471 if (layerResetFlag) 5472 { 5473 for (Int i = 0; i < slice->getVPS()->getNumPredictedLayers(dolLayerId); i++) 5474 { 5475 Int iLayerId = slice->getVPS()->getPredictedLayerId(dolLayerId, i); 5476 m_ppcTEncTop[iLayerId]->setLayerInitializedFlag(false); 5477 m_ppcTEncTop[iLayerId]->setFirstPicInLayerDecodedFlag(false); 5478 } 5479 5480 // Each picture that is in the DPB and has nuh_layer_id equal to dolLayerId is marked as "unused for reference". 5481 for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[dolLayerId]->getListPic()->begin(); pic != m_ppcTEncTop[dolLayerId]->getListPic()->end(); pic++) 5482 { 5483 if ((*pic)->getSlice(0)->getPOC() != slice->getPOC()) 5484 { 5485 (*pic)->getSlice(0)->setReferenced(false); 5486 } 5487 } 5488 5489 // Each picture that is in DPB and has nuh_layer_id equal to any value of IdPredictedLayer[dolLayerId][i] 5490 // for the values of i in range of 0 to NumPredictedLayers[dolLayerId] - 1, inclusive, is marked as "unused for reference" 5491 for (UInt i = 0; i < slice->getVPS()->getNumPredictedLayers(dolLayerId); i++) 5492 { 5493 UInt predLId = slice->getVPS()->getPredictedLayerId(dolLayerId, i); 5494 for (TComList<TComPic*>::iterator pic = m_ppcTEncTop[predLId]->getListPic()->begin(); pic != m_ppcTEncTop[predLId]->getListPic()->end(); pic++) 5495 { 5496 if ((*pic)->getSlice(0)->getPOC() != slice->getPOC()) 5497 { 5498 (*pic)->getSlice(0)->setReferenced(false); 5499 } 5500 } 5501 } 5502 } 5503 } 5504 } 5505 5506 Void TEncGOP::xSetNoRaslOutputFlag(TComSlice *slice) 5507 { 5508 if (slice->isIRAP()) 5509 { 5510 m_noRaslOutputFlag = slice->getHandleCraAsBlaFlag(); // default value 5511 if (slice->isIDR() || slice->isBLA() || m_bFirst || m_prevPicHasEos) 5512 { 5513 m_noRaslOutputFlag = true; 5514 } 5515 else if (!m_ppcTEncTop[m_layerId]->getLayerInitializedFlag()) 5516 { 5517 Bool refLayersInitialized = true; 5518 for (UInt j = 0; j < slice->getVPS()->getNumDirectRefLayers(m_layerId); j++) 5519 { 5520 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, j); 5521 if (!m_ppcTEncTop[refLayerId]->getLayerInitializedFlag()) 5522 { 5523 refLayersInitialized = false; 5524 } 5525 } 5526 if (refLayersInitialized) 5527 { 5528 m_noRaslOutputFlag = true; 5529 } 5530 } 5531 } 5532 } 5533 5534 Void TEncGOP::xSetLayerInitializedFlag(TComSlice *slice) 5535 { 5536 if (slice->isIRAP() && m_noRaslOutputFlag) 5537 { 5538 if (m_layerId == 0) 5539 { 5540 m_ppcTEncTop[m_layerId]->setLayerInitializedFlag(true); 5541 } 5542 else if (!m_ppcTEncTop[m_layerId]->getLayerInitializedFlag() && slice->getVPS()->getNumDirectRefLayers(m_layerId) == 0) 5543 { 5544 m_ppcTEncTop[m_layerId]->setLayerInitializedFlag(true); 5545 } 5546 else if (!m_ppcTEncTop[m_layerId]->getLayerInitializedFlag()) 5547 { 5548 Bool refLayersInitialized = true; 5549 for (UInt j = 0; j < slice->getVPS()->getNumDirectRefLayers(m_layerId); j++) 5550 { 5551 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, j); 5552 if (!m_ppcTEncTop[refLayerId]->getLayerInitializedFlag()) 5553 { 5554 refLayersInitialized = false; 5555 } 5556 } 5557 if (refLayersInitialized) 5558 { 5559 m_ppcTEncTop[m_layerId]->setLayerInitializedFlag(true); 5560 } 5561 } 5562 } 5563 } 5564 #endif // R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 5565 5380 5566 #endif //SVC_EXTENSION 5381 5567 -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r912 r978 159 159 Int m_lastPocPeriodId; 160 160 #endif 161 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 162 Bool m_noRaslOutputFlag; 163 Bool m_prevPicHasEos; 164 #endif 161 165 #endif 162 166 … … 281 285 Void free_mem2DintWithPad(Int **array2D, Int iPadY, Int iPadX); 282 286 #endif 287 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 288 Void xCheckLayerReset(TComSlice *slice); 289 Void xSetNoRaslOutputFlag(TComSlice *slice); 290 Void xSetLayerInitializedFlag(TComSlice *slice); 291 #endif 283 292 #endif //SVC_EXTENSION 284 293 };// END CLASS DEFINITION TEncGOP -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
r903 r978 172 172 Int m_currPocMsb; 173 173 #endif 174 #if R0071_IRAP_EOS_CROSS_LAYER_IMPACTS 175 Bool m_prevPicHasEos; 176 #endif 174 177 #endif //SVC_EXTENSION 175 178 protected:
Note: See TracChangeset for help on using the changeset viewer.