Changeset 851 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder


Ignore:
Timestamp:
2 Aug 2014, 00:34:01 (10 years ago)
Author:
qualcomm
Message:

R0223: Restrictions on POC reset-related syntax elements (Macro: POC_RESET_RESTRICTIONS)

Allow mixing of CRA and BLA pictures without requiring POC resetting (adoption) and other restrictions that were not implemented before.

From: Adarsh K. Ramasubramonian <aramasub@…>

Location:
branches/SHM-dev/source/Lib/TLibDecoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r850 r851  
    34393439  {
    34403440    READ_CODE( 2, uiCode,       "poc_reset_idc"); rpcSlice->setPocResetIdc(uiCode);
     3441#if POC_RESET_RESTRICTIONS
     3442    /* The value of poc_reset_idc shall not be equal to 1 or 2 for a RASL picture, a RADL picture,
     3443       a sub-layer non-reference picture, or a picture that has TemporalId greater than 0,
     3444       or a picture that has discardable_flag equal to 1. */
     3445    if( rpcSlice->getPocResetIdc() == 1 || rpcSlice->getPocResetIdc() == 2 )
     3446    {
     3447      assert( !rpcSlice->isRASL() );
     3448      assert( !rpcSlice->isRADL() );
     3449      assert( !rpcSlice->isSLNR() );
     3450      assert( rpcSlice->getTLayer() == 0 );
     3451      assert( rpcSlice->getDiscardableFlag() == 0 );
     3452    }
     3453
     3454    // The value of poc_reset_idc of a CRA or BLA picture shall be less than 3.
     3455    if( rpcSlice->getPocResetIdc() == 3)
     3456    {
     3457      assert( ! ( rpcSlice->isCRA() || rpcSlice->isBLA() ) );
     3458    }
     3459#endif
    34413460  }
    34423461  else
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r850 r851  
    4343UInt  TDecTop::m_uiPrevLayerId = MAX_UINT;
    4444Bool  TDecTop::m_bFirstSliceInSequence = true;
     45#if POC_RESET_RESTRICTIONS
     46Bool  TDecTop::m_checkPocRestrictionsForCurrAu       = false;
     47Int   TDecTop::m_pocResetIdcOrCurrAu                 = -1;
     48Bool  TDecTop::m_baseLayerIdrFlag                    = false;
     49Bool  TDecTop::m_baseLayerPicPresentFlag             = false;
     50Bool  TDecTop::m_baseLayerIrapFlag                   = false;
     51Bool  TDecTop::m_nonBaseIdrPresentFlag               = false;
     52Int   TDecTop::m_nonBaseIdrType                      = -1;
     53Bool  TDecTop::m_picNonIdrWithRadlPresentFlag        = false;
     54Bool  TDecTop::m_picNonIdrNoLpPresentFlag            = false;
     55#endif
    4556#endif
    4657
     
    104115#if Q0074_SEI_COLOR_MAPPING
    105116  m_ColorMapping = new TDecColorMapping();
     117#endif
     118
     119#if POC_RESET_RESTRICTIONS
     120  resetPocRestrictionCheckParameters();
    106121#endif
    107122}
     
    940955
    941956  m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType);
     957#if POC_RESET_RESTRICTIONS
     958  m_apcSlicePilot->setTLayer( nalu.m_temporalId );
     959#endif
    942960  Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N ||
    943961                           m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N   ||
     
    11161134    if(( m_layerId < m_uiPrevLayerId) ||( ( m_layerId == m_uiPrevLayerId) && bNewPOC)) // Decoding a lower layer than or same layer as previous - mark all earlier pictures as not in current AU
    11171135    {
     1136#if POC_RESET_RESTRICTIONS
     1137      // New access unit; reset all variables related to POC reset restrictions
     1138      resetPocRestrictionCheckParameters();
     1139#endif
    11181140      markAllPicsAsNoCurrAu();
    11191141    }
     
    11321154    {
    11331155      m_parseIdc = 3; // Proceed to decoding POC and RPS
    1134     } 
     1156    }
    11351157  }
    11361158#endif
     
    16221644#if POC_RESET_IDC_DECODER
    16231645    pcPic->setCurrAuFlag( true );
     1646#if POC_RESET_RESTRICTIONS
     1647    if( pcPic->getLayerId() > 0 && m_apcSlicePilot->isIDR() && !m_nonBaseIdrPresentFlag )
     1648    {
     1649      // IDR picture with nuh_layer_id > 0 present
     1650      m_nonBaseIdrPresentFlag = true;
     1651      m_nonBaseIdrType = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL);
     1652    }
     1653    else
     1654    {
     1655      if( m_apcSlicePilot->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL )
     1656      {
     1657        // Picture with nal_unit_type not equal IDR_W_RADL present
     1658        m_picNonIdrWithRadlPresentFlag = true;
     1659      }
     1660      if( m_apcSlicePilot->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_N_LP )
     1661      {
     1662        // Picture with nal_unit_type not equal IDR_N_LP present
     1663        m_picNonIdrNoLpPresentFlag = true;
     1664      }
     1665    }
     1666    if( !m_checkPocRestrictionsForCurrAu )  // Will be true for the first slice/picture of the AU
     1667    {
     1668      m_checkPocRestrictionsForCurrAu = true;
     1669      m_pocResetIdcOrCurrAu = m_apcSlicePilot->getPocResetIdc();
     1670      if( pcPic->getLayerId() == 0 )
     1671      {
     1672        // Base layer picture is present
     1673        m_baseLayerPicPresentFlag = true;
     1674        if( m_apcSlicePilot->isIRAP() )
     1675        {
     1676          // Base layer picture is IRAP
     1677          m_baseLayerIrapFlag = true;
     1678        }
     1679        if( m_apcSlicePilot->isIDR() )
     1680        {
     1681          // Base layer picture is IDR
     1682          m_baseLayerIdrFlag = true;
     1683        }
     1684        else
     1685        {
     1686          if( m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag())
     1687          {
     1688            /* When the picture with nuh_layer_id equal to 0 in an access unit is not an IDR picture
     1689            and vps_base_layer_internal_flag is equal to 1, the value of poc_reset_idc shall not be equal to 2
     1690            for any picture in the access unit. */
     1691            assert( m_apcSlicePilot->getPocResetIdc() != 2 );
     1692          }
     1693        }
     1694      }
     1695    }
     1696    else
     1697    {
     1698      // The value of poc_reset_idc of all coded pictures that are present in the bitstream in an access unit shall be the same.
     1699      assert( m_pocResetIdcOrCurrAu == m_apcSlicePilot->getPocResetIdc() );
     1700
     1701      /* When the picture in an access unit with nuh_layer_id equal to 0 is an IRAP picture and vps_base_layer_internal_flag is equal to 1
     1702      and there is at least one other picture in the same access unit that is not an IRAP picture,
     1703      the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */
     1704      if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )
     1705      {
     1706        assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 );
     1707      }
     1708
     1709      /* When the picture with nuh_layer_id equal to 0 in an access unit is an IDR picture and
     1710      vps_base_layer_internal_flag is equal to 1 and there is at least one non-IDR picture in the same access unit,
     1711      the value of poc_reset_idc shall be equal to 2 for all pictures in the access unit. */
     1712      if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )
     1713      {
     1714        assert( m_apcSlicePilot->getPocResetIdc() == 2 );
     1715      }
     1716
     1717      /* When there is at least one picture that has nuh_layer_id greater than 0 and that is an IDR picture
     1718      with a particular value of nal_unit_type in an access unit and there is at least one other coded picture
     1719      that is present in the bitstream in the same access unit with a different value of nal_unit_type,
     1720      the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */
     1721      if( m_nonBaseIdrPresentFlag &&
     1722            ( m_nonBaseIdrType == 1 && m_picNonIdrWithRadlPresentFlag 
     1723             || m_nonBaseIdrType == 0 && m_picNonIdrNoLpPresentFlag )
     1724        )
     1725      {
     1726        assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 );
     1727      }
     1728    }
     1729#endif
    16241730#endif
    16251731
     
    26752781}
    26762782#endif
    2677 
     2783#if POC_RESET_RESTRICTIONS
     2784Void TDecTop::resetPocRestrictionCheckParameters()
     2785{
     2786  TDecTop::m_checkPocRestrictionsForCurrAu       = false;
     2787  TDecTop::m_pocResetIdcOrCurrAu                 = -1;
     2788  TDecTop::m_baseLayerIdrFlag                    = false;
     2789  TDecTop::m_baseLayerPicPresentFlag             = false;
     2790  TDecTop::m_baseLayerIrapFlag                   = false;
     2791  TDecTop::m_nonBaseIdrPresentFlag               = false;
     2792  TDecTop::m_nonBaseIdrType                      = -1;
     2793  TDecTop::m_picNonIdrWithRadlPresentFlag        = false;
     2794  TDecTop::m_picNonIdrNoLpPresentFlag            = false;
     2795}
     2796#endif
    26782797#endif //SVC_EXTENSION
    26792798
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r850 r851  
    213213#endif
    214214
     215#if POC_RESET_RESTRICTIONS
     216  static Bool                    m_checkPocRestrictionsForCurrAu;
     217  static Int                     m_pocResetIdcOrCurrAu;
     218  static Bool                    m_baseLayerIdrFlag;
     219  static Bool                    m_baseLayerPicPresentFlag;
     220  static Bool                    m_baseLayerIrapFlag;
     221  static Bool                    m_nonBaseIdrPresentFlag;
     222  static Int                     m_nonBaseIdrType;
     223  static Bool                    m_picNonIdrWithRadlPresentFlag;
     224  static Bool                    m_picNonIdrNoLpPresentFlag;
     225#endif
     226
    215227  TDecTop();
    216228  virtual ~TDecTop();
     
    357369  Void initAsymLut(TComSlice *pcSlice);
    358370#endif
     371#if POC_RESET_RESTRICTIONS
     372  Void resetPocRestrictionCheckParameters();
     373#endif
    359374};// END CLASS DEFINITION TDecTop
    360375
    361376
     377
    362378//! \}
    363379
Note: See TracChangeset for help on using the changeset viewer.