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


Ignore:
Timestamp:
23 Oct 2013, 23:01:30 (12 years ago)
Author:
tech
Message:

Merged 8.1-Cleanup@654

File:
1 edited

Legend:

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

    r622 r655  
    347347#endif
    348348#endif
     349  m_associatedIRAPType = NAL_UNIT_INVALID;
    349350  m_pocCRA = 0;
    350   m_prevRAPisBLA = false;
    351351  m_pocRandomAccess = MAX_INT; 
    352352  m_prevPOC                = MAX_INT;
    353353  m_bFirstSliceInPicture    = true;
    354354  m_bFirstSliceInSequence   = true;
     355  m_prevSliceSkipped = false;
     356  m_skippedPOC = 0;
    355357#if H_MV
    356358  m_layerId = 0;
     
    436438  Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window();
    437439
    438 #if H_MV5
    439440#if H_MV
    440441    assert( conformanceWindow   .getScaledFlag() );
    441442    assert( defaultDisplayWindow.getScaledFlag() );
    442 #endif
    443443#endif
    444444  for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++)
     
    518518  m_cCuDecoder.destroy();       
    519519#if H_MV
    520 #if H_MV5
    521520  TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
    522 #else
    523   TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer ); 
    524 #endif
    525521  TComSlice::markCurrPic( pcPic );
    526522  TComSlice::markIvRefPicsAsUnused   ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc );
     
    591587  assert (sps != 0);
    592588
    593 #if H_MV5
    594589#if H_MV
    595590  TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId());
     
    599594  if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    600595#endif
    601 #else
    602   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    603 #endif
    604596  {
    605597    printf ("Parameter set activation failed!");
     
    627619  m_apcSlicePilot->setSPS(sps);
    628620#if H_MV
    629 #if H_MV5
    630621  m_apcSlicePilot->setVPS(vps); 
    631622  sps->inferRepFormat  ( vps , m_layerId );
    632623  sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) );
    633 #else
    634   m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getActiveVPS() );
    635 #endif
    636624#endif
    637625  pps->setSPS(sps);
     
    695683
    696684#if H_MV
    697 #if H_MV5
    698685  m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
    699 #else
    700   m_apcSlicePilot->setRefPicSetInterLayer( & m_refPicSetInterLayer );
    701 #endif
    702686  m_apcSlicePilot->setLayerId( nalu.m_layerId );
    703687#endif
    704688  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
     689
     690  // set POC for dependent slices in skipped pictures
     691  if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped)
     692  {
     693    m_apcSlicePilot->setPOC(m_skippedPOC);
     694  }
     695
     696  m_apcSlicePilot->setAssociatedIRAPPOC(m_pocCRA);
     697  m_apcSlicePilot->setAssociatedIRAPType(m_associatedIRAPType);
    705698
    706699#if H_MV 
    707700  TComVPS* vps     = m_apcSlicePilot->getVPS();
    708 #if H_MV5
    709701  Int layerId  = nalu.m_layerId;   
    710702  setViewId   ( vps->getViewId   ( layerId )      ); 
     
    714706  m_ivPicLists->setVPS( vps );
    715707#endif
    716 #else
    717   Int layerIdInVps = vps->getLayerIdInVps( nalu.m_layerId ); 
    718   setViewId   ( vps->getViewId   ( layerIdInVps )      ); 
    719 #if H_3D
    720   setViewIndex( vps->getViewIndex( layerIdInVps )      ); 
    721   setIsDepth  ( vps->getDepthId  ( layerIdInVps ) == 1 ); 
    722   m_ivPicLists->setVPS( vps );
    723 #endif
    724 #endif
    725708#endif
    726709    // Skip pictures due to random access
    727710    if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
    728711    {
     712    m_prevSliceSkipped = true;
     713    m_skippedPOC = m_apcSlicePilot->getPOC();
    729714      return false;
    730715    }
     
    732717    if (isSkipPictureForBLA(iPOCLastDisplay))
    733718    {
     719    m_prevSliceSkipped = true;
     720    m_skippedPOC = m_apcSlicePilot->getPOC();
    734721      return false;
    735722    }
     723
     724  // clear previous slice skipped flag
     725  m_prevSliceSkipped = false;
    736726
    737727  //we should only get a different poc for a new picture (with CTU address==0)
     
    763753#endif
    764754  // actual decoding starts here
    765 #if H_MV5
    766755#if H_MV
    767756   // This part needs further testing !
     
    771760   }
    772761#endif
    773 #endif
    774762  xActivateParameterSets();
    775763
     
    791779    m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
    792780#if H_MV
    793 #if H_MV5
    794781    m_apcSlicePilot->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
    795 #else
    796     m_apcSlicePilot->createAndApplyIvReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer );
    797 #endif
    798782#endif
    799783    //  Get a new picture buffer
    800784    xGetNewPicBuffer (m_apcSlicePilot, pcPic);
    801785
     786    Bool isField = false;
     787    Bool isTff = false;
     788   
     789    if(!m_SEIs.empty())
     790    {
     791      // Check if any new Picture Timing SEI has arrived
     792      SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING);
     793      if (pictureTimingSEIs.size()>0)
     794      {
     795        SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin());
     796        isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2);
     797        isTff =  (pictureTiming->m_picStruct == 1);
     798      }
     799    }
     800   
     801    //Set Field/Frame coding mode
     802    m_pcPic->setField(isField);
     803    m_pcPic->setTopField(isTff);
     804   
    802805    // transfer any SEI messages that have been received to the picture
    803806    pcPic->setSEIs(m_SEIs);
     
    938941  if (bNextSlice)
    939942  {
    940     pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_prevRAPisBLA, m_cListPic );
     943    pcSlice->checkCRA(pcSlice->getRPS(), m_pocCRA, m_associatedIRAPType, m_cListPic );
    941944    // Set reference list
    942945#if H_MV   
    943 #if H_MV5
    944946    std::vector< TComPic* > tempRefPicLists[2];
    945947    std::vector< Bool     > usedAsLongTerm [2];
     
    948950    pcSlice->getTempRefPicLists( m_cListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr);
    949951    pcSlice->setRefPicList     ( tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
    950 #else
    951     pcSlice->setRefPicList( m_cListPic, m_refPicSetInterLayer, true );   
    952 #endif
    953952#if H_3D_ARP
    954953    pcSlice->setARPStepNum();
     
    978977#if H_3D
    979978    pcSlice->setIvPicLists( m_ivPicLists );         
    980 #if H_3D_IV_MERGE   
     979#if H_3D_IV_MERGE
     980#if H_3D_FCO
     981    //assert( !getIsDepth() );
     982#else
    981983    assert( !getIsDepth() || ( pcSlice->getTexturePic() != 0 ) );
     984#endif
    982985#endif   
    983986#endif
     
    10371040      pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList()  );
    10381041    }
    1039     pcSlice->getScalingList()->setUseTransformSkip(pcSlice->getPPS()->getUseTransformSkip());
    10401042    if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag())
    10411043    {
     
    10841086  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
    10851087  assert( vps != 0 );
    1086 #if H_MV5
    10871088  m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) );
    10881089#else
    1089   Int layerIdInVPS = vps->getLayerIdInVps( m_layerId );
    1090   m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( layerIdInVPS ), ( vps->getDepthId( layerIdInVPS ) == 1 ) );
    1091 #endif
    1092 #else
    10931090  m_cEntropyDecoder.decodeSPS( sps );
    10941091#endif
     
    10991096{
    11001097  TComPPS* pps = new TComPPS();
    1101 #if H_MV5
    11021098#if H_MV
    11031099  pps->setLayerId( getLayerId() );
    1104 #endif
    11051100#endif
    11061101  m_cEntropyDecoder.decodePPS( pps );
     
    11121107  if(nalUnitType == NAL_UNIT_SUFFIX_SEI)
    11131108  {
    1114 #if H_MV5
    11151109#if H_MV
    11161110    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) );
     
    11181112    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    11191113#endif
    1120 #else
    1121     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 
    1122 #endif
    11231114  }
    11241115  else
    11251116  {
    1126 #if H_MV5
    11271117#if H_MV
    11281118    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS( m_layerId ) );
     
    11301120    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    11311121#endif
    1132 #else
    1133     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() );
    1134 #endif
    11351122    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
    11361123    if (activeParamSets.size()>0)
     
    11391126      m_parameterSetManagerDecoder.applyPrefetchedPS();
    11401127      assert(seiAps->activeSeqParamSetId.size()>0);
    1141 #if H_MV5
    11421128#if H_MV
    11431129      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0], m_layerId ))
    1144 #else
    1145       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
    1146 #endif
    11471130#else
    11481131      if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))
     
    12211204Bool TDecTop::isSkipPictureForBLA(Int& iPOCLastDisplay)
    12221205{
    1223   if (m_prevRAPisBLA && m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N))
     1206  if ((m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_N_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_associatedIRAPType == NAL_UNIT_CODED_SLICE_BLA_W_RADL) &&
     1207       m_apcSlicePilot->getPOC() < m_pocCRA && (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N))
    12241208  {
    12251209    iPOCLastDisplay++;
     
    13061290}
    13071291
    1308 #if H_MV5
    13091292Void TDecTop::xResetPocInPicBuffer()
    13101293{
     
    13241307}
    13251308#endif
    1326 #endif
    13271309//! \}
Note: See TracChangeset for help on using the changeset viewer.