Changeset 738 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp


Ignore:
Timestamp:
10 Dec 2013, 13:50:12 (10 years ago)
Author:
tech
Message:

Merged HTM-9.0-dev0@731. (MV-HEVC 6 HLS)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r724 r738  
    110110#endif
    111111, m_pocResetFlag                  (false)
     112#if H_MV_6_RALS_O0149_11
     113, m_crossLayerBlaFlag             (false)
     114#endif
    112115, m_discardableFlag               (false)
    113116, m_interLayerPredEnabledFlag     (false)
     
    148151  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    149152  {
    150    m_interLayerPredLayerIdc[ i ] = i;
     153    m_interLayerPredLayerIdc[ i ] = -1;
    151154  }
    152155#endif
     
    17091712, m_hrdOpSetIdx               (NULL)
    17101713, m_cprmsPresentFlag          (NULL)
     1714#if H_MV_6_HRD_O0217_13
     1715, m_dpbSize                   (NULL)
     1716#endif
    17111717#if H_MV
    17121718, m_vpsVUI                 (  NULL )
     
    17241730    for( Int layerId = 0; layerId < MAX_VPS_NUH_LAYER_ID_PLUS1; layerId++ )
    17251731    {
     1732#if H_MV_6_HRD_O0217_13
     1733      m_layerIdIncludedFlag[lsIdx][layerId] = (( lsIdx == 0 ) && ( layerId == 0 )) ;
     1734#else
    17261735      m_layerIdIncludedFlag[lsIdx][layerId] = false;
     1736#endif
    17271737    }
    17281738  }
     
    17381748  m_moreOutputLayerSetsThanDefaultFlag = false;   
    17391749  m_numAddOutputLayerSetsMinus1        = -1;   
     1750#if H_MV_6_PS_0109_25
     1751  m_defaultOneTargetOutputLayerIdc     = 0;
     1752#else
    17401753  m_defaultOneTargetOutputLayerFlag    = false;
     1754#endif
    17411755 
    17421756  for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++)
     
    17491763    }
    17501764  }
    1751  
     1765#if H_MV_6_GEN_0153_28
     1766  m_altOutputLayerFlag       = false;
     1767#endif
    17521768  m_maxOneActiveRefLayerFlag = false;
    17531769  m_directDepTypeLenMinus2   = 0;         
     
    17861802    m_layerIdInNuh      [i] = ( i == 0 ) ? 0 : -1;
    17871803    m_numDirectRefLayers[i] = 0;
     1804#if !H_MV_6_ILDDS_O0225_30
    17881805    m_maxTidIlRefPicPlus1[i] = 7;
     1806#endif
    17891807    m_vpsRepFormatIdx    [i] = 0;
     1808#if H_MV_6_MISC_O0062_31
     1809    m_pocLsbNotPresentFlag[i] = 0;
     1810#endif
    17901811    m_repFormat          [i] = NULL;
    17911812    m_viewIdVal          [i] = 0;
     
    18211842      m_directDependencyType[i][j] = -1;
    18221843      m_refLayerId[i][j]           = -1;
     1844#if H_MV_6_ILDDS_O0225_30     
     1845      m_maxTidIlRefPicsPlus1[i][j]  = 7;
     1846#endif
    18231847    }
    18241848
     
    18331857  }
    18341858  m_vpsVUI = new TComVPSVUI;
     1859#if H_MV_6_HRD_O0217_13
     1860  m_dpbSize = new TComDpbSize;
     1861#endif
     1862#
    18351863#if H_3D
    18361864  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
     
    18661894#if H_MV
    18671895  if ( m_vpsVUI          != NULL )     delete m_vpsVUI;
     1896#if H_MV_6_HRD_O0217_13
     1897  if ( m_dpbSize         != NULL )     delete m_dpbSize;
     1898#endif
     1899
    18681900  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
    18691901  {
     
    20682100  assert( lsIdx >= 0 );
    20692101  assert( lsIdx <= getVpsNumLayerSetsMinus1() );
     2102#if H_MV_6_HRD_O0217_13
     2103  return (Int) m_layerSetLayerIdList[ lsIdx ].size();
     2104#else
    20702105  Int numLayersInIdList = 0;
    20712106  for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ )
     
    20742109  }
    20752110  return numLayersInIdList;
    2076 }
     2111#endif
     2112}
     2113
     2114#if H_MV_6_HRD_O0217_13
     2115Int    TComVPS::getNumOutputLayerSets()
     2116{
     2117  Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1;
     2118  if ( getMoreOutputLayerSetsThanDefaultFlag( ) )
     2119  {     
     2120    numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1);
     2121}
     2122  return numOutputLayerSets;
     2123}
     2124#endif
     2125
    20772126Int TComVPS::getNumViews()
    20782127{
     
    21042153  return dependentFlag;
    21052154}
     2155
     2156#if H_MV_6_HRD_O0217_13
     2157Void TComVPS::deriveLayerSetLayerIdList()
     2158{
     2159  m_layerSetLayerIdList.resize( getVpsNumLayerSetsMinus1() + 1 );
     2160  for (Int i = 0; i <= getVpsNumLayerSetsMinus1(); i++ )
     2161  {
     2162    for( Int m = 0; m  <= getVpsMaxLayerId(); m++ )
     2163    {
     2164      if( getLayerIdIncludedFlag( i, m) )
     2165      {
     2166        m_layerSetLayerIdList[ i ].push_back( m );       
     2167      }
     2168    }
     2169  }
     2170}
     2171
     2172Void TComVPS::deriveTargetLayerIdLists()
     2173{
     2174  m_targetDecLayerIdLists.resize( getNumOutputLayerSets() );
     2175  m_targetOptLayerIdLists.resize( getNumOutputLayerSets() );
     2176
     2177  for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ )
     2178  {
     2179    Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1;     
     2180    Int lsIdx                = targetDecLayerSetIdx;
     2181
     2182    for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
     2183    {
     2184      m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
     2185      if( getOutputLayerFlag( targetOptLayerSetIdx, j  )) // This seems to be wrong in draft text
     2186      {
     2187        m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
     2188      }
     2189    } 
     2190  }
     2191}
     2192#endif
    21062193#endif // H_MV
    21072194
     
    21572244, m_spsInferScalingListFlag   ( false )
    21582245, m_spsScalingListRefLayerId  ( 0 )
     2246
     2247#if !H_MV_6_PS_REP_FORM_18_19_20
    21592248, m_updateRepFormatFlag       ( true )
     2249#else
     2250, m_updateRepFormatFlag       ( false )
     2251, m_spsRepFormatIdx           ( 0 )
     2252#endif
    21602253, m_interViewMvVertConstraintFlag (false)
    21612254#endif
     
    21732266  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    21742267  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
     2268#if H_MV_6_PSEM_O0142_3
     2269  m_spsExtensionFlag = false;
     2270  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
     2271  {
     2272    m_spsExtensionTypeFlag[ i ] = false;
     2273  }
     2274#endif
     2275#if H_MV_6_SHVC_O0098_36
     2276  m_numScaledRefLayerOffsets = 0;
     2277
     2278  for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ )
     2279  {
     2280    m_scaledRefLayerId             [i] = -1;
     2281  }
     2282
     2283  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
     2284  {
     2285    m_scaledRefLayerLeftOffset     [i] = 0;
     2286    m_scaledRefLayerTopOffset      [i] = 0;
     2287    m_scaledRefLayerRightOffset    [i] = 0;
     2288    m_scaledRefLayerBottomOffset   [i] = 0;
     2289  }
     2290#endif
    21752291}
    21762292
     
    23532469  if ( layerIdCurr > 0 )
    23542470  {
     2471#if H_MV_6_PS_REP_FORM_18_19_20
     2472    Int            repFormatIdx = getUpdateRepFormatFlag() ?  getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ;
     2473    TComRepFormat* repFormat    = vps->getRepFormat( repFormatIdx );
     2474#else
    23552475    TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) );
    23562476    if ( !getUpdateRepFormatFlag() )
    23572477    {       
     2478#endif
    23582479      setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() );         
    23592480      //// ToDo: add when supported:
     
    23682489      setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 );
    23692490      setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
     2491#if !H_MV_6_PS_REP_FORM_18_19_20
    23702492    }
    23712493    else
     2494#else
     2495    if ( getLayerId() > 0 && getUpdateRepFormatFlag() )
     2496#endif
    23722497    {
    23732498      assert( getChromaFormatIdc()      <=  repFormat->getChromaFormatVpsIdc()         );
     
    27152840Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
    27162841{
    2717   // Fill targetDecLayerIdSet with all layers if empty.
     2842  // Fill targetDecLayerIdSet with all layers if empty (at encoder side)
    27182843  if (targetDecLayerIdSet.size() == 0 )   
    27192844  {
     
    27392864    {
    27402865      TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc );
     2866#if H_MV_LAYER_WISE_STARTUP
     2867      if ( pcPic )
     2868      {
     2869#endif
    27412870      if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    27422871      {
     
    27612890      }
    27622891    }
     2892#if H_MV_LAYER_WISE_STARTUP
     2893      }
     2894#endif
    27632895  }
    27642896}
     
    28162948  return pcPic;
    28172949}
     2950
     2951
     2952#if H_MV_6_ILDDS_ILREFPICS_27_34
     2953Int  TComSlice::getRefLayerPicFlag( Int i )
     2954{
     2955  TComVPS* vps = getVPS();
     2956  Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) );
     2957
     2958  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  &&
     2959    ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );
     2960
     2961  return refLayerPicFlag;       
     2962}   
     2963
     2964Int TComSlice::getRefLayerPicIdc( Int j )
     2965
     2966  Int refLayerPicIdc = -1;
     2967  Int curj = 0;
     2968  for( Int i = 0;  i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )
     2969  {
     2970    if( getRefLayerPicFlag( i ) )
     2971    {
     2972      if ( curj == j )
     2973      {
     2974        refLayerPicIdc = i;         
     2975        break;
     2976      }
     2977      curj++;
     2978    }
     2979  }
     2980
     2981  assert( curj == j );
     2982  assert( refLayerPicIdc != -1 );
     2983  return refLayerPicIdc;
     2984}
     2985
     2986Int  TComSlice::getNumRefLayerPics( )
     2987
     2988  Int numRefLayerPics = 0;
     2989  for( Int i = 0;  i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )
     2990  {
     2991    numRefLayerPics += getRefLayerPicFlag( i );
     2992  }
     2993  return numRefLayerPics;
     2994}
     2995#endif
     2996
     2997
     2998
    28182999Int TComSlice::getNumActiveRefLayerPics()
    28193000{
     
    28263007  else if (getVPS()->getAllRefLayersActiveFlag() )
    28273008  {
     3009#if H_MV_6_ILDDS_ILREFPICS_27_34
     3010    numActiveRefLayerPics = getNumRefLayerPics();
     3011#else
    28283012    numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() );
     3013#endif
    28293014  }
    28303015  else if ( !getInterLayerPredEnabledFlag() )
     
    28343019  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
    28353020  {
     3021#if H_MV_6_ILDDS_ILREFPICS_27_34
     3022    numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0;
     3023#else
    28363024    numActiveRefLayerPics = 1;
     3025#endif
    28373026  }
    28383027  else
     
    34343623TComVPSVUI::TComVPSVUI()
    34353624{
     3625#if H_MV_6_PS_O0223_29
     3626  m_crossLayerIrapAlignedFlag = true;
     3627#endif
    34363628  m_bitRatePresentVpsFlag = false;
    34373629  m_picRatePresentVpsFlag = false;
     
    34613653    }
    34623654  }
    3463 }
    3464 #endif
     3655#if H_MV_6_PS_O0118_33 
     3656  for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
     3657  {
     3658    m_videoSignalInfo          [i] = NULL;     
     3659  }
     3660#endif
     3661
     3662#if H_MV_6_HRD_O0164_15
     3663  m_vpsVuiBspHrdPresentFlag = false;
     3664  m_vpsVuiBspHrdParameters  = new TComVpsVuiBspHrdParameters();
     3665#endif
     3666}
     3667
     3668#if H_MV_6_PS_O0118_33
     3669TComVPSVUI::~TComVPSVUI()
     3670{
     3671  for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
     3672  {
     3673    if (m_videoSignalInfo[ i ] != NULL )      delete m_videoSignalInfo[ i ];   
     3674    m_videoSignalInfo    [ i ] = NULL;
     3675  }
     3676
     3677#if H_MV_6_HRD_O0164_15
     3678  if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters;
     3679  m_vpsVuiBspHrdParameters = NULL;
     3680#endif
     3681}
     3682#endif
     3683
     3684#if H_MV_6_PS_REP_FORM_18_19_20
     3685Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag )
     3686{
     3687  if ( !encoderFlag )
     3688  {
     3689    setChromaAndBitDepthVpsPresentFlag( prevRepFormat->getChromaAndBitDepthVpsPresentFlag() );
     3690    setSeparateColourPlaneVpsFlag     ( prevRepFormat->getSeparateColourPlaneVpsFlag     () );
     3691    setBitDepthVpsLumaMinus8          ( prevRepFormat->getBitDepthVpsLumaMinus8          () );
     3692    setBitDepthVpsChromaMinus8        ( prevRepFormat->getBitDepthVpsChromaMinus8        () );
     3693  }
     3694  else
     3695  {
     3696    assert( getChromaAndBitDepthVpsPresentFlag() == prevRepFormat->getChromaAndBitDepthVpsPresentFlag() );
     3697    assert( getSeparateColourPlaneVpsFlag     () == prevRepFormat->getSeparateColourPlaneVpsFlag     () );
     3698    assert( getBitDepthVpsLumaMinus8          () == prevRepFormat->getBitDepthVpsLumaMinus8          () );
     3699    assert( getBitDepthVpsChromaMinus8        () == prevRepFormat->getBitDepthVpsChromaMinus8        () );
     3700}
     3701}
     3702#endif
     3703
     3704#if H_MV_6_HRD_O0164_15
     3705Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h )
     3706{
     3707  // It is a requirement of bitstream conformance that bitstream partition with index j shall not include
     3708  // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j
     3709  // in the range of 0 to num_bitstream_partitions[ h ] – 1, inclusive, such that i is less than j.
     3710
     3711  for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ )
     3712  {       
     3713    for ( Int partI = 0; partI < partJ; partI++ )
     3714    {
     3715      for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ )
     3716      {
     3717        if ( m_layerInBspFlag[ h ][partJ][layerJ ] )
     3718        {
     3719          for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ )
     3720          {
     3721            if ( m_layerInBspFlag[ h ][partI][layerI] )
     3722            {
     3723              assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) );
     3724            }
     3725          }
     3726        }
     3727      }
     3728    }
     3729  }
     3730}
     3731#endif
     3732#endif
Note: See TracChangeset for help on using the changeset viewer.