Changeset 652 in SHVCSoftware for branches/SHM-6-dev/source/App/TAppDecoder


Ignore:
Timestamp:
7 Apr 2014, 23:08:52 (11 years ago)
Author:
seregin
Message:

update to HM-14.0

File:
1 edited

Legend:

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

    r644 r652  
    257257      Bool outputPicturesFlag = true; 
    258258#if NO_OUTPUT_OF_PRIOR_PICS
    259       if( m_acTDecTop[nalu.m_layerId].getNoOutputOfPriorPicsFlags() )
     259      if( m_acTDecTop[nalu.m_layerId].getNoOutputPriorPicsFlag() )
    260260      {
    261261        outputPicturesFlag = false;
     
    449449      loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS);
    450450    }
     451#if !FIX_WRITING_OUTPUT
     452#if SETTING_NO_OUT_PIC_PRIOR
     453    if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag())
     454    {
     455      m_cTDecTop.checkNoOutputPriorPics( pcListPic );
     456    }
     457#endif
     458#endif
    451459
    452460    if( pcListPic )
     
    460468        openedReconFile = true;
    461469      }
     470#if FIX_WRITING_OUTPUT
     471      // write reconstruction to file
     472      if( bNewPicture )
     473      {
     474        xWriteOutput( pcListPic, nalu.m_temporalId );
     475      }
     476#if SETTING_NO_OUT_PIC_PRIOR
     477      if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() )
     478      {
     479        m_cTDecTop.checkNoOutputPriorPics( pcListPic );
     480        m_cTDecTop.setNoOutputPriorPicsFlag (false);
     481      }
     482#endif
     483#endif
    462484      if ( bNewPicture &&
    463485           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     
    471493      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
    472494      {
     495#if FIX_OUTPUT_EOS
     496        xWriteOutput( pcListPic, nalu.m_temporalId );
     497#else
    473498        xFlushOutput( pcListPic );       
    474       }
    475       // write reconstruction to file
     499#endif
     500      }
     501      // write reconstruction to file -- for additional bumping as defined in C.5.2.3
     502#if FIX_WRITING_OUTPUT
     503      if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
     504#else
    476505      if(bNewPicture)
     506#endif
    477507      {
    478508        xWriteOutput( pcListPic, nalu.m_temporalId );
     
    586616  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    587617  Int numPicsNotYetDisplayed = 0;
     618  Int dpbFullness = 0;
     619#if SVC_EXTENSION
     620TComSPS* activeSPS = m_acTDecTop[layerId].getActiveSPS();
     621#else
     622  TComSPS* activeSPS = m_cTDecTop.getActiveSPS();
     623#endif
     624  UInt numReorderPicsHighestTid;
     625  UInt maxDecPicBufferingHighestTid;
     626  UInt maxNrSublayers = activeSPS->getMaxTLayers();
     627
     628  if(m_iMaxTemporalLayer == -1 || m_iMaxTemporalLayer >= maxNrSublayers)
     629  {
     630    numReorderPicsHighestTid = activeSPS->getNumReorderPics(maxNrSublayers-1);
     631    maxDecPicBufferingHighestTid =  activeSPS->getMaxDecPicBuffering(maxNrSublayers-1);
     632  }
     633  else
     634  {
     635    numReorderPicsHighestTid = activeSPS->getNumReorderPics(m_iMaxTemporalLayer);
     636    maxDecPicBufferingHighestTid = activeSPS->getMaxDecPicBuffering(m_iMaxTemporalLayer);
     637  }
    588638
    589639  while (iterPic != pcListPic->end())
     
    597647    {
    598648      numPicsNotYetDisplayed++;
     649      dpbFullness++;
     650    }
     651    else if(pcPic->getSlice( 0 )->isReferenced())
     652    {
     653      dpbFullness++;
    599654    }
    600655    iterPic++;
     
    619674
    620675#if SVC_EXTENSION
    621       if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed >  pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1)
    622         && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed >  pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0)))
    623 #else
    624       if ( pcPicTop->getOutputMark() && (numPicsNotYetDisplayed >  pcPicTop->getNumReorderPics(tId) && !(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1)
    625         && pcPicBottom->getOutputMark() && (numPicsNotYetDisplayed >  pcPicBottom->getNumReorderPics(tId) && (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay<0)))
     676      if( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() &&
     677        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) &&
     678        (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) &&       
     679        (pcPicTop->getPOC() == m_aiPOCLastDisplay[layerId]+1 || m_aiPOCLastDisplay[layerId]<0) )
     680#else
     681      if ( pcPicTop->getOutputMark() && pcPicBottom->getOutputMark() &&
     682          (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) &&
     683          (!(pcPicTop->getPOC()%2) && pcPicBottom->getPOC() == pcPicTop->getPOC()+1) &&
     684          (pcPicTop->getPOC() == m_iPOCLastDisplay+1 || m_iPOCLastDisplay < 0))
    626685#endif
    627686      {
     
    720779
    721780#if SVC_EXTENSION
    722       if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_aiPOCLastDisplay[layerId]))
    723 #else
    724       if ( pcPic->getOutputMark() && (numPicsNotYetDisplayed >  pcPic->getNumReorderPics(tId) && pcPic->getPOC() > m_iPOCLastDisplay))
     781      if( pcPic->getOutputMark() && pcPic->getPOC() > m_aiPOCLastDisplay[layerId] &&
     782        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid) )
     783#else
     784      if(pcPic->getOutputMark() && pcPic->getPOC() > m_iPOCLastDisplay &&
     785        (numPicsNotYetDisplayed >  numReorderPicsHighestTid || dpbFullness > maxDecPicBufferingHighestTid))
    725786#endif
    726787      {
    727788        // write to file
    728789        numPicsNotYetDisplayed--;
    729 #if SVC_EXTENSION
    730         if ( m_pchReconFile[layerId] )
     790        if(pcPic->getSlice(0)->isReferenced() == false)
     791        {
     792          dpbFullness--;
     793        }
     794#if SVC_EXTENSION
     795        if( m_pchReconFile[layerId] )
    731796        {
    732797          const Window &conf = pcPic->getConformanceWindow();
Note: See TracChangeset for help on using the changeset viewer.