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/TLibCommon/TComSlice.cpp

    r724 r730  
    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
    1712 , m_vpsVUI                 (  NULL )
     1718, m_vpsVUI                    (NULL)
    17131719#endif
    17141720{
     
    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++)
     
    17481762      m_outputLayerFlag[i][j] = false;
    17491763    }
    1750   }
    1751  
     1764  } 
     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++ )
     
    20732108    numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) );
    20742109  }
     2110
    20752111  return numLayersInIdList;
    2076 }
     2112#endif
     2113}
     2114
     2115#if H_MV_6_HRD_O0217_13
     2116Int    TComVPS::getNumOutputLayerSets()
     2117{
     2118  Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1;
     2119  if ( getMoreOutputLayerSetsThanDefaultFlag( ) )
     2120  {     
     2121    numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1);
     2122  }
     2123  return numOutputLayerSets;
     2124}
     2125#endif
     2126
    20772127Int TComVPS::getNumViews()
    20782128{
     
    21042154  return dependentFlag;
    21052155}
     2156
     2157#if H_MV_6_HRD_O0217_13
     2158Void TComVPS::deriveLayerSetLayerIdList()
     2159{
     2160  m_layerSetLayerIdList.resize( getVpsNumLayerSetsMinus1() + 1 );
     2161  for (Int i = 0; i <= getVpsNumLayerSetsMinus1(); i++ )
     2162  {
     2163    for( Int m = 0; m  <= getVpsMaxLayerId(); m++ )
     2164    {
     2165      if( getLayerIdIncludedFlag( i, m) )
     2166      {
     2167        m_layerSetLayerIdList[ i ].push_back( m );       
     2168      }
     2169    }
     2170  }
     2171}
     2172
     2173Void TComVPS::deriveTargetLayerIdLists()
     2174{
     2175  m_targetDecLayerIdLists.resize( getNumOutputLayerSets() );
     2176  m_targetOptLayerIdLists.resize( getNumOutputLayerSets() );
     2177
     2178  for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ )
     2179  {
     2180    Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1;     
     2181    Int lsIdx                = targetDecLayerSetIdx;
     2182
     2183    for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
     2184    {
     2185      m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
     2186      if( getOutputLayerFlag( targetOptLayerSetIdx, j  )) // This seems to be wrong in draft text
     2187      {
     2188        m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
     2189      }
     2190    } 
     2191  }
     2192}
     2193#endif
    21062194#endif // H_MV
    21072195
     
    21572245, m_spsInferScalingListFlag   ( false )
    21582246, m_spsScalingListRefLayerId  ( 0 )
     2247
     2248#if !H_MV_6_PS_REP_FORM_18_19_20
    21592249, m_updateRepFormatFlag       ( true )
     2250#else
     2251, m_updateRepFormatFlag       ( false )
     2252, m_spsRepFormatIdx           ( 0 )
     2253#endif
    21602254, m_interViewMvVertConstraintFlag (false)
    21612255#endif
     
    21732267  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    21742268  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
     2269#if H_MV_6_PSEM_O0142_3
     2270  m_spsExtensionFlag = false;
     2271  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ )
     2272  {
     2273    m_spsExtensionTypeFlag[ i ] = false;
     2274  }
     2275#endif
     2276#if H_MV_6_SHVC_O0098_36
     2277  m_numScaledRefLayerOffsets = 0;
     2278
     2279  for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ )
     2280  {
     2281    m_scaledRefLayerId             [i] = -1;
     2282  }
     2283
     2284  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
     2285  {
     2286    m_scaledRefLayerLeftOffset     [i] = 0;
     2287    m_scaledRefLayerTopOffset      [i] = 0;
     2288    m_scaledRefLayerRightOffset    [i] = 0;
     2289    m_scaledRefLayerBottomOffset   [i] = 0;
     2290  }
     2291#endif
    21752292}
    21762293
     
    23532470  if ( layerIdCurr > 0 )
    23542471  {
     2472#if H_MV_6_PS_REP_FORM_18_19_20
     2473    Int            repFormatIdx = getUpdateRepFormatFlag() ?  getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ;
     2474    TComRepFormat* repFormat    = vps->getRepFormat( repFormatIdx );
     2475#else
    23552476    TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) );
     2477
    23562478    if ( !getUpdateRepFormatFlag() )
    23572479    {       
     2480#endif
    23582481      setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() );         
    23592482      //// ToDo: add when supported:
     
    23682491      setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 );
    23692492      setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
     2493#if !H_MV_6_PS_REP_FORM_18_19_20
    23702494    }
    23712495    else
     2496#else
     2497    if ( getLayerId() > 0 && getUpdateRepFormatFlag() )
     2498#endif
    23722499    {
    23732500      assert( getChromaFormatIdc()      <=  repFormat->getChromaFormatVpsIdc()         );
     
    23982525  }
    23992526}
     2527
    24002528#endif
    24012529#if H_3D
     
    26682796#if H_MV
    26692797Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 )
    2670 {
     2798{ 
    26712799  refPicSetInterLayer0.clear();
    26722800  refPicSetInterLayer1.clear();
     
    27132841
    27142842}
     2843
     2844
    27152845Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
    27162846{
    2717   // Fill targetDecLayerIdSet with all layers if empty.
     2847  // Fill targetDecLayerIdSet with all layers if empty (at encoder side)
    27182848  if (targetDecLayerIdSet.size() == 0 )   
    27192849  {
     
    27222852      targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) );
    27232853    }
    2724   }     
     2854  } 
    27252855
    27262856  Int numTargetDecLayers = (Int) targetDecLayerIdSet.size();
     
    27312861    {
    27322862      break;
     2863    }       
    27332864  }       
    2734   }       
    27352865
    27362866  for( Int i = 0; i <= latestDecIdx; i++ )
     
    27392869    {
    27402870      TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc );
    2741       if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    2742       {
    2743         Bool remainingInterLayerReferencesFlag = false;
    2744         for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
     2871#if H_MV_LAYER_WISE_STARTUP
     2872      if ( pcPic )
     2873      {
     2874#endif
     2875        if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() )
    27452876        {
    2746           TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();
    2747           if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
     2877          Bool remainingInterLayerReferencesFlag = false;
     2878          for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
     2879          {
     2880            TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS();
     2881            if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
     2882            {
     2883              for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
     2884              {
     2885                if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
     2886                {
     2887                  remainingInterLayerReferencesFlag = true;
     2888                }
     2889              }
     2890            }
     2891          }
     2892          if( !remainingInterLayerReferencesFlag )
    27482893          {
    2749             for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
    2750             {
    2751               if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
    2752               {
    2753                 remainingInterLayerReferencesFlag = true;
     2894            pcPic->getSlice(0)->setReferenced( false );                   
    27542895          }
    27552896        }
    2756           }
    2757         }
    2758         if( !remainingInterLayerReferencesFlag )
    2759         {
    2760           pcPic->getSlice(0)->setReferenced( false );                   
    2761       }
    2762     }
    2763   }
    2764 }
     2897#if H_MV_LAYER_WISE_STARTUP
     2898      }
     2899#endif
     2900    }
     2901  }
    27652902}
    27662903
     
    27732910    {     
    27742911      if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true );
    2775        
     2912
    27762913      m_apcRefPicList[li][rIdx]->print( false );
    27772914    }
     
    28162953  return pcPic;
    28172954}
     2955
     2956
     2957#if H_MV_6_ILDDS_ILREFPICS_27_34
     2958Int  TComSlice::getRefLayerPicFlag( Int i )
     2959{
     2960  TComVPS* vps = getVPS();
     2961  Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) );
     2962
     2963  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  &&
     2964    ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() );
     2965
     2966  return refLayerPicFlag;       
     2967}   
     2968
     2969Int TComSlice::getRefLayerPicIdc( Int j )
     2970
     2971  Int refLayerPicIdc = -1;
     2972  Int curj = 0;
     2973  for( Int i = 0;  i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )
     2974  {
     2975    if( getRefLayerPicFlag( i ) )
     2976    {
     2977      if ( curj == j )
     2978      {
     2979        refLayerPicIdc = i;         
     2980        break;
     2981      }
     2982      curj++;
     2983    }
     2984  }
     2985
     2986  assert( curj == j );
     2987  assert( refLayerPicIdc != -1 );
     2988  return refLayerPicIdc;
     2989}
     2990
     2991Int  TComSlice::getNumRefLayerPics( )
     2992
     2993  Int numRefLayerPics = 0;
     2994  for( Int i = 0;  i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ )
     2995  {
     2996    numRefLayerPics += getRefLayerPicFlag( i );
     2997  }
     2998  return numRefLayerPics;
     2999}
     3000#endif
     3001
     3002
     3003
    28183004Int TComSlice::getNumActiveRefLayerPics()
    28193005{
     
    28263012  else if (getVPS()->getAllRefLayersActiveFlag() )
    28273013  {
     3014#if H_MV_6_ILDDS_ILREFPICS_27_34
     3015    numActiveRefLayerPics = getNumRefLayerPics();
     3016#else
    28283017    numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() );
     3018#endif
    28293019  }
    28303020  else if ( !getInterLayerPredEnabledFlag() )
     
    28343024  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
    28353025  {
     3026#if H_MV_6_ILDDS_ILREFPICS_27_34
     3027    numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0;
     3028#else
    28363029    numActiveRefLayerPics = 1;
     3030#endif
    28373031  }
    28383032  else
     
    34343628TComVPSVUI::TComVPSVUI()
    34353629{
     3630#if H_MV_6_PS_O0223_29
     3631  m_crossLayerIrapAlignedFlag = true;
     3632#endif
    34363633  m_bitRatePresentVpsFlag = false;
    34373634  m_picRatePresentVpsFlag = false;
     
    34613658    }
    34623659  }
    3463 }
    3464 #endif
     3660#if H_MV_6_PS_O0118_33 
     3661  for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
     3662  {
     3663    m_videoSignalInfo          [i] = NULL;     
     3664  }
     3665#endif
     3666
     3667#if H_MV_6_HRD_O0164_15
     3668  m_vpsVuiBspHrdPresentFlag = false;
     3669  m_vpsVuiBspHrdParameters  = new TComVpsVuiBspHrdParameters();
     3670#endif
     3671}
     3672
     3673#if H_MV_6_PS_O0118_33
     3674TComVPSVUI::~TComVPSVUI()
     3675{
     3676  for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
     3677  {
     3678    if (m_videoSignalInfo[ i ] != NULL )      delete m_videoSignalInfo[ i ];   
     3679    m_videoSignalInfo    [ i ] = NULL;
     3680  }
     3681
     3682#if H_MV_6_HRD_O0164_15
     3683  if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters;
     3684  m_vpsVuiBspHrdParameters = NULL;
     3685#endif
     3686}
     3687#endif
     3688
     3689#if H_MV_6_PS_REP_FORM_18_19_20
     3690Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag )
     3691{
     3692  if ( !encoderFlag )
     3693  {
     3694    setChromaAndBitDepthVpsPresentFlag( prevRepFormat->getChromaAndBitDepthVpsPresentFlag() );
     3695    setSeparateColourPlaneVpsFlag     ( prevRepFormat->getSeparateColourPlaneVpsFlag     () );
     3696    setBitDepthVpsLumaMinus8          ( prevRepFormat->getBitDepthVpsLumaMinus8          () );
     3697    setBitDepthVpsChromaMinus8        ( prevRepFormat->getBitDepthVpsChromaMinus8        () );
     3698  }
     3699  else
     3700  {
     3701    assert( getChromaAndBitDepthVpsPresentFlag() == prevRepFormat->getChromaAndBitDepthVpsPresentFlag() );
     3702    assert( getSeparateColourPlaneVpsFlag     () == prevRepFormat->getSeparateColourPlaneVpsFlag     () );
     3703    assert( getBitDepthVpsLumaMinus8          () == prevRepFormat->getBitDepthVpsLumaMinus8          () );
     3704    assert( getBitDepthVpsChromaMinus8        () == prevRepFormat->getBitDepthVpsChromaMinus8        () );
     3705  }
     3706}
     3707#endif
     3708
     3709#if H_MV_6_HRD_O0164_15
     3710Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h )
     3711{
     3712  // It is a requirement of bitstream conformance that bitstream partition with index j shall not include
     3713  // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j
     3714  // in the range of 0 to num_bitstream_partitions[ h ] – 1, inclusive, such that i is less than j.
     3715
     3716  for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ )
     3717  {       
     3718    for ( Int partI = 0; partI < partJ; partI++ )
     3719    {
     3720      for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ )
     3721      {
     3722        if ( m_layerInBspFlag[ h ][partJ][layerJ ] )
     3723        {
     3724          for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ )
     3725          {
     3726            if ( m_layerInBspFlag[ h ][partI][layerI] )
     3727            {
     3728              assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) );
     3729            }
     3730          }
     3731        }
     3732      }
     3733    }
     3734  }
     3735}
     3736#endif
     3737#endif
Note: See TracChangeset for help on using the changeset viewer.