Changeset 374 in SHVCSoftware for branches


Ignore:
Timestamp:
28 Aug 2013, 15:33:12 (11 years ago)
Author:
nokia
Message:

Integration of "early picture marking" of JCTVC-L0188 and fix to ILR_RESTR.

Location:
branches/SHM-3.1-dev/source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-3.1-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r372 r374  
    228228    {
    229229      m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic);
     230#if EARLY_REF_PIC_MARKING
     231      m_acTDecTop[curLayerId].earlyPicMarking(m_iMaxTemporalLayer, m_targetDecLayerIdSet);
     232#endif
    230233    }
    231234
  • branches/SHM-3.1-dev/source/Lib/TLibCommon/TypeDef.h

    r373 r374  
    112112#if JCTVC_M0203_INTERLAYER_PRED_IDC
    113113#define ILR_RESTR                        1      ///< JCTVC-M0209 Inter-layer RPS and RPL
     114#define ILR_RESTR_FIX                    1      ///< Fix encoder crash when temporal layers are used with scalable coding
     115#define EARLY_REF_PIC_MARKING            1      ///< Decoded picture marking of sub-layer non-reference pictures
    114116#define N0120_MAX_TID_REF_PRESENT_FLAG   1      ///< JCTVC-N0120 max_tid_ref_pics_plus1_present_flag
    115117#endif
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r372 r374  
    370370}
    371371
     372#if EARLY_REF_PIC_MARKING
     373Void TDecTop::earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdSet)
     374{
     375  UInt currTid = m_pcPic->getTLayer();
     376  UInt highestTid = (maxTemporalLayer >= 0) ? maxTemporalLayer : (m_pcPic->getSlice(0)->getSPS()->getMaxTLayers() - 1);
     377  UInt latestDecLayerId = m_layerId;
     378  UInt numTargetDecLayers = 0;
     379  Int targetDecLayerIdList[MAX_LAYERS];
     380  UInt latestDecIdx = 0;
     381  TComSlice* pcSlice = m_pcPic->getSlice(0);
     382
     383  if ( currTid != highestTid )  // Marking  process is only applicaple for highest decoded TLayer
     384  {
     385    return;
     386  }
     387
     388  // currPic must be marked as "used for reference" and must be a sub-layer non-reference picture
     389  if ( !((pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N  ||
     390          pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N    ||
     391          pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N   ||
     392          pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N   ||
     393          pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N   ||
     394          pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N10     ||
     395          pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N12     ||
     396          pcSlice->getNalUnitType() == NAL_UNIT_RESERVED_VCL_N14) && pcSlice->isReferenced()))
     397  {
     398    return;
     399  }
     400
     401  if ( targetDecLayerIdSet.size() == 0 ) // Cannot mark if we don't know the number of scalable layers
     402  {
     403    return;
     404  }
     405
     406  for (std::vector<Int>::iterator it = targetDecLayerIdSet.begin(); it != targetDecLayerIdSet.end(); it++)
     407  {
     408    if ( latestDecLayerId == (*it) )
     409    {
     410      latestDecIdx = numTargetDecLayers;
     411    }
     412    targetDecLayerIdList[numTargetDecLayers++] = (*it);
     413  }
     414
     415  Int remainingInterLayerReferencesFlag = 0;
     416  if ( currTid <= pcSlice->getVPS()->getMaxSublayerForIlpPlus1(latestDecLayerId) - 1 )
     417  {
     418    for ( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
     419    {
     420      for ( Int k = 0; k < m_ppcTDecTop[targetDecLayerIdList[j]]->getNumDirectRefLayers(); k++ )
     421      {
     422        if ( latestDecIdx == m_ppcTDecTop[targetDecLayerIdList[j]]->getRefLayerId(k) )
     423        {
     424          remainingInterLayerReferencesFlag = 1;
     425        }
     426      }
     427    }
     428  }
     429
     430  if ( remainingInterLayerReferencesFlag == 0 )
     431  {
     432    pcSlice->setReferenced(false);
     433  }
     434}
     435#endif
     436
    372437Void TDecTop::xCreateLostPicture(Int iLostPoc)
    373438{
  • branches/SHM-3.1-dev/source/Lib/TLibDecoder/TDecTop.h

    r345 r374  
    157157
    158158  Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
     159#if EARLY_REF_PIC_MARKING
     160  Void earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdList);
     161#endif
    159162
    160163#if SVC_EXTENSION
  • branches/SHM-3.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r370 r374  
    576576    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
    577577#if SVC_EXTENSION
     578#if ILR_RESTR && ILR_RESTR_FIX
     579    Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_ID_PLUS1];
     580    Int activeNumILRRefIdxTmp = 0;
     581#endif
    578582    if (m_layerId > 0)
    579583    {
     
    587591#endif
    588592        pcSlice->setBaseColPic( *cListPic, refLayerIdc );
     593
     594#if ILR_RESTR && ILR_RESTR_FIX
     595        // Apply temporal layer restriction to inter-layer prediction
     596        Int maxSubLayerForILPPlus1 = m_pcEncTop->getVPS()->getMaxSublayerForIlpPlus1(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getLayerId());
     597        if( ((Int)(pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getRapPicFlag()) )
     598        {
     599          interLayerPredLayerIdcTmp[activeNumILRRefIdxTmp++] = refLayerIdc; // add picture to the list of valid inter-layer pictures
     600        }
     601        else
     602        {
     603          continue; // ILP is not valid due to temporal layer restriction
     604        }
     605#endif
    589606
    590607#if SCALED_REF_LAYER_OFFSETS
     
    628645#endif
    629646      }
     647
     648#if ILR_RESTR && ILR_RESTR_FIX
     649      // Update the list of active inter-layer pictures
     650      for ( Int i = 0; i < activeNumILRRefIdxTmp; i++)
     651      {
     652        pcSlice->setInterLayerPredLayerIdc( interLayerPredLayerIdcTmp[i], i );
     653      }
     654      pcSlice->setActiveNumILRRefIdx( activeNumILRRefIdxTmp );
     655      if ( pcSlice->getActiveNumILRRefIdx() == 0 )
     656      {
     657        // No valid inter-layer pictures -> disable inter-layer prediction
     658        pcSlice->setInterLayerPredEnabledFlag(false);
     659      }
     660#endif
     661
    630662    }
    631663#endif
Note: See TracChangeset for help on using the changeset viewer.