Changeset 964 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecTop.cpp


Ignore:
Timestamp:
5 Jul 2014, 05:16:45 (10 years ago)
Author:
tech
Message:
  • Merged 11.0-dev0@963. (Update to HM 14.0 + MV-HEVC Draft 8 HLS)
  • Added coding results.
  • Changed version number.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r884 r964  
    365365  m_prevSliceSkipped = false;
    366366  m_skippedPOC = 0;
     367#if SETTING_NO_OUT_PIC_PRIOR
     368  m_bFirstSliceInBitstream  = true;
     369  m_lastPOCNoOutputPriorPics = -1;
     370  m_craNoRaslOutputFlag = false;
     371  m_isNoOutputPriorPics = false;
     372#endif
     373#if H0056_EOS_CHECKS
     374  m_isLastNALWasEos = false;
     375#endif
    367376#if H_MV
    368377  m_layerId = 0;
     
    372381  m_isDepth = false;
    373382  m_pcCamParsCollector = 0;
     383#endif
     384#if H_MV_HLS_8_HRD_Q0102_08
     385  m_targetOptLayerSetIdx = -1;
    374386#endif
    375387#endif
     
    471483    TComVPS* vps         = pcSlice->getVPS();
    472484    TComDpbSize* dpbSize = vps->getDpbSize();
    473     Int lsIdx            = vps->getLayerSetIdxForOutputLayerSet( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
     485    Int lsIdx            = vps->olsIdxToLsIdx( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?
    474486    Int layerIdx         = vps->getIdxInLayerSet     ( lsIdx, getLayerId() );
    475487    Int subDpbIdx        = dpbSize->getSubDpbAssigned( lsIdx, layerIdx );
     
    499511    {
    500512      rpcPic->setOutputMark(false);
     513#if H_MV_HLS_7_VPS_P0300_27
     514      rpcPic->setPicOutputFlag(false);
     515#endif
    501516      bBufferIsAvailable = true;
    502517      break;
     
    506521    {
    507522      rpcPic->setOutputMark(false);
     523#if H_MV_HLS_7_VPS_P0300_27
     524      rpcPic->setPicOutputFlag(false);
     525#endif
    508526      rpcPic->setReconMark( false );
    509527      rpcPic->getPicYuvRec()->setBorderExtension( false );
     
    550568  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    551569  TComSlice::markCurrPic( pcPic );
     570#if !H_MV_HLS_8_DBP_NODOC_42
    552571  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
    553572#endif
     573#endif
    554574  m_bFirstSliceInPicture  = true;
    555575
    556576  return;
    557577}
     578
     579#if SETTING_NO_OUT_PIC_PRIOR
     580Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic)
     581{
     582  if (!rpcListPic || !m_isNoOutputPriorPics) return;
     583
     584  TComList<TComPic*>::iterator  iterPic   = rpcListPic->begin();
     585
     586  while (iterPic != rpcListPic->end())
     587  {
     588    TComPic*& pcPicTmp = *(iterPic++);
     589    if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC())
     590    {
     591      pcPicTmp->setOutputMark(false);
     592#if H_MV_HLS_7_VPS_P0300_27
     593      pcPicTmp->setPicOutputFlag(false);
     594#endif
     595    }
     596  }
     597}
     598#endif
    558599
    559600Void TDecTop::xCreateLostPicture(Int iLostPoc)
     
    620661  TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
    621662  assert (vps != 0);
    622   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )
     663  if (!m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )
    623664#else
    624665  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
     
    628669    assert (0);
    629670  }
     671
     672#if H_MV_HLS_8_HRD_Q0102_08
     673  sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false );
     674#endif
     675
     676#if H_MV_HLS_8_RPS_Q0100_36
     677  vps->inferDbpSizeLayerSetZero( sps, false );
     678#endif
     679
     680#if H_MV_HLS_8_PMS_Q0195_21
     681  // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
     682  if ( vps->getVpsNumRepFormatsMinus1() == 0 )
     683  {
     684    //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0.
     685    assert( sps->getUpdateRepFormatFlag() == false );
     686  }
     687#endif
     688
     689#if H_MV_HLS_8_RPS_Q0100_36
     690  sps->checkRpsMaxNumPics( vps, getLayerId() );
     691#endif
     692
     693#if H_MV_HLS_8_MIS_Q0177_22
     694  if( m_layerId > 0 )
     695  {
     696    sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
     697  }
     698#endif
    630699
    631700  if( pps->getDependentSliceSegmentsEnabledFlag() )
     
    719788  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    720789#endif
     790
     791#if H_MV_HLS_8_HRD_Q0102_08
     792  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx );
     793#else
    721794  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    722 
     795#endif
    723796  // set POC for dependent slices in skipped pictures
    724797  if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped)
     
    741814#endif
    742815
     816#if SETTING_NO_OUT_PIC_PRIOR
     817  //For inference of NoOutputOfPriorPicsFlag
     818  if (m_apcSlicePilot->getRapPicFlag())
     819  {
     820    if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) ||
     821        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) ||
     822        (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag()))
     823    {
     824      m_apcSlicePilot->setNoRaslOutputFlag(true);
     825    }
     826    //the inference for NoOutputPriorPicsFlag
     827    if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag())
     828    {
     829      if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     830      {
     831        m_apcSlicePilot->setNoOutputPriorPicsFlag(true);
     832      }
     833    }
     834    else
     835    {
     836      m_apcSlicePilot->setNoOutputPriorPicsFlag(false);
     837    }
     838
     839    if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA)
     840    {
     841      m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag();
     842    }
     843  }
     844  if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag())
     845  {
     846    m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC();
     847    m_isNoOutputPriorPics = true;
     848  }
     849  else
     850  {
     851    m_isNoOutputPriorPics = false;
     852  }
     853
     854  //For inference of PicOutputFlag
     855  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R)
     856  {
     857    if ( m_craNoRaslOutputFlag )
     858    {
     859      m_apcSlicePilot->setPicOutputFlag(false);
     860    }
     861  }
     862#endif
     863
     864#if FIX_POC_CRA_NORASL_OUTPUT
     865  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
     866  {
     867    Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
     868    m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
     869  }
     870#endif
    743871#if H_MV
    744872    xCeckNoClrasOutput();
     
    769897
    770898  //we should only get a different poc for a new picture (with CTU address==0)
    771   if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0))
     899  if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0))
    772900  {
    773901    printf ("Warning, the first slice of a picture might have been lost!\n");
     
    810938  }
    811939  m_bFirstSliceInSequence = false;
     940#if SETTING_NO_OUT_PIC_PRIOR 
     941  m_bFirstSliceInBitstream  = false;
     942#endif
    812943  //detect lost reference picture and insert copy of earlier frame.
    813944  Int lostPoc;
     
    11271258#endif
    11281259#if H_3D
    1129   // Preliminary fix. assuming that all sps refer to the same SPS.
     1260  // Preliminary fix. assuming that all sps refer to the same VPS.
    11301261  // Parsing dependency should be resolved!
    11311262  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    1132   assert( vps != 0 ); 
     1263  assert( vps != 0 );
    11331264  m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) );
    11341265#else
     
    11821313      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    11831314      m_parameterSetManagerDecoder.applyPrefetchedPS();
    1184       assert(seiAps->activeSeqParamSetId.size()>0);
    1185 #if H_MV
    1186       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId ))
    1187 #else
    1188       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     1315      assert(seiAps->activeSeqParameterSetId.size()>0);
     1316#if H_MV
     1317      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0], m_layerId ))
     1318#else
     1319      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))
    11891320#endif
    11901321      {
     
    12091340    case NAL_UNIT_VPS:
    12101341      xDecodeVPS();
     1342#if H0056_EOS_CHECKS
     1343      m_isLastNALWasEos = false;
     1344#endif
    12111345      return false;
    12121346     
     
    12211355    case NAL_UNIT_PREFIX_SEI:
    12221356    case NAL_UNIT_SUFFIX_SEI:
     1357#if H0056_EOS_CHECKS
     1358      if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI )
     1359      {
     1360        assert( m_isLastNALWasEos == false );
     1361      }
     1362#endif
    12231363      xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType );
    12241364      return false;
     
    12401380    case NAL_UNIT_CODED_SLICE_RASL_N:
    12411381    case NAL_UNIT_CODED_SLICE_RASL_R:
     1382#if H0056_EOS_CHECKS
     1383      if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N ||
     1384          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N ||
     1385          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N ||
     1386          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N ||
     1387          nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N )
     1388      {
     1389        assert( m_isLastNALWasEos == false );
     1390      }
     1391      else
     1392      {
     1393        m_isLastNALWasEos = false;
     1394      }
     1395#endif
    12421396#if H_MV
    12431397      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
     
    12471401      break;
    12481402    case NAL_UNIT_EOS:
     1403#if H0056_EOS_CHECKS
     1404      assert( m_isLastNALWasEos == false );
     1405      //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything.
     1406      if (nalu.m_layerId > 0)
     1407      {
     1408        printf( "\nThis bitstream has EOS with non-zero layer id.\n" );
     1409        return false;
     1410      }
     1411      m_isLastNALWasEos = true;
     1412#endif
    12491413      m_associatedIRAPType = NAL_UNIT_INVALID;
    12501414      m_pocCRA = 0;
     
    12641428      return false;
    12651429     
     1430    case NAL_UNIT_FILLER_DATA:
     1431#if H_MV
     1432      assert( m_isLastNALWasEos == false );
     1433#endif
     1434      return false;
    12661435     
    12671436    case NAL_UNIT_RESERVED_VCL_N10:
     
    12841453    case NAL_UNIT_RESERVED_VCL31:
    12851454     
    1286     case NAL_UNIT_FILLER_DATA:
    12871455    case NAL_UNIT_RESERVED_NVCL41:
    12881456    case NAL_UNIT_RESERVED_NVCL42:
Note: See TracChangeset for help on using the changeset viewer.