Ticket #1101: hevc_software_10.1_dev_multiple_cvs.patch

File hevc_software_10.1_dev_multiple_cvs.patch, 6.1 KB (added by jackh, 7 years ago)
  • source/Lib/TLibDecoder/TDecTop.cpp

    diff -rupNw tmp1/source/Lib/TLibDecoder/TDecTop.cpp tmp2/source/Lib/TLibDecoder/TDecTop.cpp
    old new TDecTop::TDecTop() 
    6262  m_prevPOC                = MAX_INT;
    6363  m_bFirstSliceInPicture    = true;
    6464  m_bFirstSliceInSequence   = true;
    65   m_digestCanBeChecked      = false;
     65  m_lastNALSkipped      = false;
    6666}
    6767
    6868TDecTop::~TDecTop()
    Void TDecTop::executeLoopFilters(Int& po 
    192192  // Execute Deblock + Cleanup
    193193
    194194  m_cGopDecoder.filterPicture(pcPic);
    195   m_digestCanBeChecked = true;
    196195  TComSlice::sortPicList( m_cListPic ); // sorting for application output
    197196  poc                 = pcPic->getSlice(m_uiSliceIdx-1)->getPOC();
    198197  rpcListPic          = &m_cListPic; 
    Void TDecTop::xActivateParameterSets() 
    276275  TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId());
    277276  assert (sps != 0);
    278277
     278  Bool spsChanged=sps!=m_parameterSetManagerDecoder.getActiveSPS();
    279279  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    280280  {
    281281    printf ("Parameter set activation failed!");
    Void TDecTop::xActivateParameterSets() 
    312312  g_uiMaxCUDepth  = sps->getMaxCUDepth();
    313313  g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() );
    314314
     315  if (spsChanged)
     316  {
     317          for (TComList<TComPic *>::iterator It=m_cListPic.begin(); It!=m_cListPic.end(); ) {
     318                  TComList<TComPic *>::iterator CIt=It++;
     319                        (*CIt)->destroy();
     320                        delete *CIt;
     321                        m_cListPic.erase(CIt);
     322          }
     323  }
    315324  for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++)
    316325  {
    317326    sps->setAMPAcc( i, sps->getUseAMP() );
    Bool TDecTop::xDecodeSlice(InputNALUnit  
    331340{
    332341  TComPic*&   pcPic         = m_pcPic;
    333342
    334   if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
    335   {
    336     m_digestCanBeChecked = false;
    337     return false;
    338   }
    339   // Skip TFD pictures associated with BLA/BLANT pictures
    340   if (isSkipPictureForBLA(iPOCLastDisplay))
    341   {
    342     m_digestCanBeChecked = false;
    343     return false;
    344   }
    345343  m_apcSlicePilot->initSlice();
    346344
    347345  if (m_bFirstSliceInPicture)
    Bool TDecTop::xDecodeSlice(InputNALUnit  
    349347    m_uiSliceIdx     = 0;
    350348  }
    351349  m_apcSlicePilot->setSliceIdx(m_uiSliceIdx);
    352   if (!m_bFirstSliceInPicture)
     350  if (!m_bFirstSliceInPicture && !m_lastNALSkipped)
    353351  {
    354352    m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) );
    355353  }
    Bool TDecTop::xDecodeSlice(InputNALUnit  
    367365
    368366  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    369367
    370   // Skip pictures due to random access
    371   if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
    372   {
    373     return false;
     368  if (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && 
     369        m_apcSlicePilot->getSliceSegmentCurStartCUAddr() == 0 &&
     370        (nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_W_LP ||
     371        nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_W_RADL ||
     372        nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_N_LP ||
     373        nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_IDR_W_RADL ||
     374        nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_IDR_N_LP)) {
     375                m_pocRandomAccess=MAX_INT;
    374376  }
     377  // Skip pictures due to random access
    375378  // Skip TFD pictures associated with BLA/BLANT pictures
    376   if (isSkipPictureForBLA(iPOCLastDisplay))
     379  if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay) || isSkipPictureForBLA(iPOCLastDisplay))
    377380  {
     381        m_lastNALSkipped=true;
    378382    return false;
    379383  }
    380 
     384  else m_lastNALSkipped=false;
    381385  //we should only get a different poc for a new picture (with CTU address==0)
    382386  if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0))
    383387  {
    Bool TDecTop::xDecodeSlice(InputNALUnit  
    386390  // exit when a new picture is found
    387391  if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence )
    388392  {
    389     if (m_prevPOC >= m_pocRandomAccess)
     393        if (m_prevPOC >= m_pocRandomAccess || m_apcSlicePilot->getPOC()==m_pocRandomAccess)
    390394    {
    391395      m_prevPOC = m_apcSlicePilot->getPOC();
    392396      return true;
    Bool TDecTop::xDecodeSlice(InputNALUnit  
    622626  m_cGopDecoder.decompressSlice(nalu.m_Bitstream, pcPic, bPicComplete);
    623627 
    624628  m_bFirstSliceInPicture = false;
    625   m_digestCanBeChecked = false;
    626629  m_uiSliceIdx++;
    627630
    628631  return false;
    Void TDecTop::xDecodeSEI( TComInputBitst 
    655658  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    656659  {
    657660    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    658     if (m_decodedPictureHashSEIEnabled && m_digestCanBeChecked)
     661    if (m_decodedPictureHashSEIEnabled && !m_lastNALSkipped)
    659662    {
    660663      SEIMessages pictureHashes = getSeisByType(m_pcPic->getSEIs(), SEI::DECODED_PICTURE_HASH );
    661664      const SEIDecodedPictureHash *hash = ( pictureHashes.size() > 0 ) ? (SEIDecodedPictureHash*) *(pictureHashes.begin()) : NULL;
    Bool TDecTop::decode(InputNALUnit& nalu, 
    708711      xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType );
    709712      return false;
    710713
     714        case NAL_UNIT_EOS:
     715                m_pocRandomAccess=MAX_INT;
     716                break;
    711717    case NAL_UNIT_CODED_SLICE_TRAIL_R:
    712718    case NAL_UNIT_CODED_SLICE_TRAIL_N:
    713719    case NAL_UNIT_CODED_SLICE_TLA_R:
  • source/Lib/TLibDecoder/TDecTop.h

    diff -rupNw tmp1/source/Lib/TLibDecoder/TDecTop.h tmp2/source/Lib/TLibDecoder/TDecTop.h
    old new private: 
    9898  Bool                    m_bFirstSliceInPicture;
    9999  Bool                    m_bFirstSliceInSequence;
    100100  Int                     m_decodedPictureHashSEIEnabled;  ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
    101   Bool                    m_digestCanBeChecked;
     101  Bool                    m_lastNALSkipped;
    102102
    103103public:
    104104  TDecTop();