Ignore:
Timestamp:
9 Dec 2013, 17:16:03 (10 years ago)
Author:
tech
Message:

MV HEVC 6 HLS changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.0-dev0/source/Lib/TLibDecoder/TDecTop.cpp

    r724 r730  
    635635#if H_MV
    636636  m_apcSlicePilot->setVPS(vps); 
     637#if H_MV_6_PS_0092_17
     638  // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
     639  assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) );   
     640  // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
     641  assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) );
     642#endif
    637643  sps->inferRepFormat  ( vps , m_layerId );
    638644  sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) );
     
    665671
    666672#if H_MV
     673#if H_MV_FIX_SKIP_PICTURES
     674Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag  )
     675#else
    667676Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag )
     677#endif
    668678{
    669679  assert( nalu.m_layerId == m_layerId );
    670 
    671680#else
    672681Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay )
     
    722731#endif
    723732#endif
     733
     734#if H_MV_LAYER_WISE_STARTUP
     735    xCeckNoClrasOutput();
     736#endif
    724737    // Skip pictures due to random access
    725738    if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))
    726739    {
    727     m_prevSliceSkipped = true;
    728     m_skippedPOC = m_apcSlicePilot->getPOC();
     740      m_prevSliceSkipped = true;
     741      m_skippedPOC = m_apcSlicePilot->getPOC();
     742#if H_MV_FIX_SKIP_PICTURES
     743      sliceSkippedFlag = true;
     744#endif
    729745      return false;
    730746    }
     
    732748    if (isSkipPictureForBLA(iPOCLastDisplay))
    733749    {
    734     m_prevSliceSkipped = true;
    735     m_skippedPOC = m_apcSlicePilot->getPOC();
     750      m_prevSliceSkipped = true;
     751      m_skippedPOC = m_apcSlicePilot->getPOC();
     752#if H_MV_FIX_SKIP_PICTURES
     753      sliceSkippedFlag = true;
     754#endif
    736755      return false;
    737756    }
     
    788807    xCreateLostPicture(lostPoc-1);
    789808  }
     809 
    790810  if (m_bFirstSliceInPicture)
    791811  {
     
    11711191
    11721192#if H_MV
     1193#if H_MV_FIX_SKIP_PICTURES
     1194Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag )
     1195#else
    11731196Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag)
     1197#endif
    11741198#else
    11751199Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay)
     
    12161240    case NAL_UNIT_CODED_SLICE_RASL_R:
    12171241#if H_MV
     1242#if H_MV_FIX_SKIP_PICTURES
     1243      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag );
     1244#else
    12181245      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag);
     1246#endif
    12191247#else
    12201248      return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay);
     
    12421270    return true;
    12431271  }
     1272
    12441273  return false;
    12451274}
     
    12651294    return true;
    12661295  }
     1296#if H_MV_LAYER_WISE_STARTUP
     1297  else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet.
     1298#else
    12671299  else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet.
     1300#endif
    12681301  {
    12691302    if (   m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA
     
    12721305        || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL )
    12731306    {
     1307
     1308#if H_MV_LAYER_WISE_STARTUP
     1309      if ( xAllRefLayersInitilized() )
     1310      {
     1311        m_layerInitilizedFlag[ m_layerId ] = true;
     1312        m_pocRandomAccess = m_apcSlicePilot->getPOC();
     1313      }
     1314      else
     1315      {
     1316        return true;
     1317      }
     1318#else
    12741319      // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT.
    12751320      m_pocRandomAccess = m_apcSlicePilot->getPOC();
     1321#endif
    12761322    }
    12771323    else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
    12781324    {
     1325#if H_MV_LAYER_WISE_STARTUP
     1326      if ( xAllRefLayersInitilized() )
     1327      {
     1328        m_layerInitilizedFlag[ m_layerId ] = true;
     1329        m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
     1330      }
     1331      else
     1332      {
     1333        return true;
     1334      }
     1335#else
    12791336      m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable.
     1337#endif
    12801338    }
    12811339    else
    12821340    {
     1341#if H_MV_FIX_SKIP_PICTURES
     1342      static Bool warningMessage[MAX_NUM_LAYERS];
     1343      static Bool warningInitFlag = false;
     1344     
     1345      if (!warningInitFlag)
     1346      {
     1347        for ( Int i = 0; i < MAX_NUM_LAYERS; i++)
     1348        {
     1349          warningMessage[i] = true;
     1350        }
     1351        warningInitFlag = true;
     1352      }
     1353
     1354      if ( warningMessage[getLayerId()] )
     1355      {
     1356        printf("\nLayer%3d   No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() );
     1357        warningMessage[m_layerId] = false;
     1358      }
     1359#else
    12831360      static Bool warningMessage = false;
    12841361      if(!warningMessage)
     
    12871364        warningMessage = true;
    12881365      }
     1366#endif
    12891367      return true;
    12901368    }
     
    12961374    return true;
    12971375  }
     1376#if H_MV_LAYER_WISE_STARTUP
     1377  return !m_layerInitilizedFlag[ getLayerId() ];
     1378#else
    12981379  // if we reach here, then the picture is not skipped.
    12991380  return false;
     1381#endif
    13001382}
    13011383
     
    13381420  }
    13391421}
     1422
     1423#if H_MV_LAYER_WISE_STARTUP
     1424Void TDecTop::xCeckNoClrasOutput()
     1425{
     1426  // This part needs further testing!
     1427  if ( getLayerId() == 0 )
     1428  {   
     1429    NalUnitType nut = m_apcSlicePilot->getNalUnitType();
     1430
     1431    Bool isBLA =  ( nut == NAL_UNIT_CODED_SLICE_BLA_W_LP  )  || ( nut == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_W_RADL );
     1432    Bool isIDR  = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP );
     1433    Bool noClrasOutputFlag  = isBLA || ( isIDR  &&  m_apcSlicePilot->getCrossLayerBlaFlag() );
     1434
     1435    if ( noClrasOutputFlag )
     1436    {
     1437      for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++)
     1438      {
     1439        m_layerInitilizedFlag[i] = false;
     1440      }
     1441    }
     1442  }
     1443}
     1444
     1445Bool TDecTop::xAllRefLayersInitilized()
     1446{
     1447  Bool allRefLayersInitilizedFlag = true;
     1448  TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 );
     1449  for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId()  ); i++ )
     1450  {
     1451    Int refLayerId = vps->getRefLayerId( m_layerId, i );
     1452    allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ];
     1453  }
     1454
     1455  return allRefLayersInitilizedFlag;
     1456}
     1457#endif
    13401458#endif
    13411459//! \}
Note: See TracChangeset for help on using the changeset viewer.