Ignore:
Timestamp:
4 Sep 2015, 21:28:58 (9 years ago)
Author:
tech
Message:

Clean-ups. HLS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.0-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r1313 r1317  
    66 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
     8
    89 *
    910 * Redistribution and use in source and binary forms, with or without
     
    112113, m_encCABACTableIdx              (I_SLICE)
    113114#if NH_MV
    114 , m_availableForTMVPRefFlag       ( true )
    115115, m_refPicSetInterLayer0          ( NULL )
    116116, m_refPicSetInterLayer1          ( NULL )
     
    121121, m_isDepth                       (false)
    122122#endif
    123 #if !H_MV_HLS7_GEN
     123#if NH_MV
    124124, m_pocResetFlag                  (false)
    125 #endif
    126 #if NH_MV
    127125, m_crossLayerBlaFlag             (false)
    128126#endif
     
    134132, m_pocResetIdc                   (0)
    135133, m_pocResetPeriodId              (0)
     134, m_hasPocResetPeriodIdPresent    (false)
    136135, m_fullPocResetFlag              (false)
    137136, m_pocLsbVal                     (0)
    138 , m_pocMsbValPresentFlag          (false)
    139 , m_pocMsbVal                     (0)
     137, m_pocMsbCycleValPresentFlag     (false)
     138, m_pocMsbCycleVal                (0)
    140139, m_pocMsbValRequiredFlag         (false)
    141140#endif
     
    155154#endif
    156155{
     156
     157#if NH_MV
     158  m_shortTermRefPicSetIdx = 0;
     159  m_numLongTermSps        = 0;
     160  m_numLongTermPics       = 0;
     161  for (Int i = 0; i < MAX_NUM_PICS_RPS; i++)
     162  {
     163    m_ltIdxSps          [i] = 0;
     164    m_deltaPocMsbCycleLt[i] = 0;
     165  }
     166  setSliceTemporalMvpEnabledFlag( false );
     167#endif
    157168  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    158169  {
     
    790801#endif
    791802
     803
    792804Int TComSlice::getNumRpsCurrTempList() const
    793805{
     
    806818  }
    807819#if NH_MV
    808   numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
     820    numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
    809821#endif
    810822  return numRpsCurrTempList;
     
    10971109  m_pcVPS                = pSrc->m_pcVPS;
    10981110#endif
    1099   m_pRPS                = pSrc->m_pRPS;  m_iLastIDR             = pSrc->m_iLastIDR;
     1111  m_pRPS                = pSrc->m_pRPS;
     1112  m_iLastIDR             = pSrc->m_iLastIDR;
    11001113
    11011114  m_pcPic                = pSrc->m_pcPic;
     
    11551168#if NH_MV
    11561169  // Additional slice header syntax elements
    1157 #if !H_MV_HLS7_GEN
    11581170  m_pocResetFlag               = pSrc->m_pocResetFlag;
    1159 #endif
    11601171  m_discardableFlag            = pSrc->m_discardableFlag;
    11611172  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
     
    26702681  }
    26712682}
    2672 #endif
    2673 
     2683
     2684#endif
    26742685#endif // NH_MV
    26752686
     
    27192730, m_uiBitsForPOC              (  8)
    27202731, m_numLongTermRefPicSPS      (  0)
     2732#if NH_MV
     2733, m_numShortTermRefPicSets    (   0)
     2734#endif
    27212735, m_uiMaxTrSize               ( 32)
    27222736, m_bUseSAO                   (false)
     
    27502764  for ( Int i = 0; i < MAX_TLAYER; i++ )
    27512765  {
     2766#if NH_MV
     2767    m_uiSpsMaxLatencyIncreasePlus1[i] = 0;
     2768#else
    27522769    m_uiMaxLatencyIncrease[i] = 0;
     2770#endif
    27532771    m_uiMaxDecPicBuffering[i] = 1;
    27542772    m_numReorderPics[i]       = 0;
     
    30813099Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
    30823100{
    3083   const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
    3084 
    30853101  if ( getMultiLayerExtSpsFlag() )
    30863102  {
     3103    const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx ));
    30873104    Int layerIdx = 0;         
    30883105    while (layerIdx < (Int) targetDecLayerIdList.size() )
     
    31093126        // This preliminary fix needs to be checked.
    31103127        assert( getNumReorderPics( i )     == maxNumReorderPics       );
    3111         assert( getMaxLatencyIncrease( i ) == maxLatencyIncreasePlus1 );
     3128        assert( getSpsMaxLatencyIncreasePlus1( i ) == maxLatencyIncreasePlus1 );
    31123129
    31133130      }
     
    31173134        setMaxDecPicBuffering( maxDecPicBufferingMinus1 + 1 , i);
    31183135        setNumReorderPics    ( maxNumReorderPics, i );
    3119         setMaxLatencyIncrease( maxLatencyIncreasePlus1 - 1 , i);
     3136        setSpsMaxLatencyIncreasePlus1( maxLatencyIncreasePlus1 , i);
    31203137      }
    31213138    }   
     
    34123429  }
    34133430}
    3414 
    34153431Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 )
    34163432{
     
    34353451    for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[li]-1); rIdx ++)
    34363452    {     
    3437       if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true );
     3453      if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( 1 );
     3454      m_apcRefPicList[li][rIdx]->print( 0 );     
    34383455       
    3439       m_apcRefPicList[li][rIdx]->print( false );
    34403456    }
    34413457  }
     
    34563472  m_refPicSetInterLayer1 = refPicSetInterLayer1;
    34573473}
     3474
     3475TComPic* TComSlice::getRefPicSetInterLayer( Int setIdc, Int i ) const
     3476{
     3477  TComPic* pic = NULL;
     3478  if (setIdc == 0 )
     3479  {
     3480    pic = (*m_refPicSetInterLayer0)[ i ];
     3481  }
     3482  else if (setIdc == 1 )
     3483  {
     3484    pic = (*m_refPicSetInterLayer1)[ i ];
     3485  }
     3486
     3487  assert( pic != NULL );   
     3488
     3489  return pic;
     3490}
     3491
    34583492
    34593493TComPic* TComSlice::getPicFromRefPicSetInterLayer(Int setIdc, Int layerId ) const
     
    35723606#endif
    35733607}
     3608#endif
    35743609#if NH_3D_NBDV
    35753610Void TComSlice::setDefaultRefView()
     
    36873722      if( iViewIdx<getViewIndex() && !bIsDepth )
    36883723      {
    3689         setBaseViewRefPicList( ivPicLists->getPicList( iLayerId ), iViewIdx );
     3724        setBaseViewRefPicList( ivPicLists->getSubDpb( iLayerId, false ), iViewIdx );
    36903725      }
    36913726    }
     
    37103745        if ( pcCurrPic->getViewIndex() != pcRefPic->getViewIndex() )
    37113746        {
    3712           existInterViewRef = true;       
     3747          existInterViewRef = true;
    37133748        }
    37143749      }
     
    38333868#if NH_3D
    38343869Void TComSlice::setIvPicLists( TComPicLists* m_ivPicLists )
    3835 {
     3870{ 
    38363871  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
    3837   {    
     3872  {
    38383873    for ( Int depthId = 0; depthId < 2; depthId++ )
    38393874    {
     
    39203955}
    39213956#endif
    3922 #endif
     3957
    39233958
    39243959
     
    39333968}
    39343969
    3935 Bool TComSlice::inferPocMsbValPresentFlag()
     3970Bool TComSlice::inferPocMsbCycleValPresentFlag()
    39363971{
    39373972  Bool pocMsbValPresentFlag;
     
    39523987}
    39533988
     3989
     3990Void TComSlice::f834decProcForRefPicListConst()
     3991{
     3992  // This process is invoked at the beginning of the decoding process for each P or B slice.
     3993  assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE );
     3994
     3995  // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into
     3996  // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B
     3997  // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0.
     3998
     3999  // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1
     4000  // are derived as follows:
     4001
     4002  // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr )
     4003  Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() );
     4004
     4005  // and the list RefPicListTemp0 is constructed as follows:
     4006  std::vector<TComPic*> refPicListTemp0;
     4007  refPicListTemp0.resize((MAX_NUM_REF+1),NULL);
     4008
     4009  const TComDecodedRps* decRps = getPic()->getDecodedRps();
     4010
     4011  const std::vector<TComPic*>& refPicSetStCurrBefore  = decRps->m_refPicSetStCurrBefore;
     4012  const std::vector<TComPic*>& refPicSetStCurrAfter   = decRps->m_refPicSetStCurrAfter;
     4013  const std::vector<TComPic*>& refPicSetLtCurr        = decRps->m_refPicSetLtCurr;
     4014
     4015  const Int                    numPocStCurrBefore     = decRps->m_numPocStCurrBefore;
     4016  const Int                    numPocStCurrAfter      = decRps->m_numPocStCurrAfter;
     4017  const Int                    numPocLtCurr           = decRps->m_numPocLtCurr;
     4018
     4019  const Int                    numActiveRefLayerPics0 = decRps->m_numActiveRefLayerPics0;
     4020  const Int                    numActiveRefLayerPics1 = decRps->m_numActiveRefLayerPics1;
     4021
     4022  const std::vector<TComPic*>& refPicSetInterLayer0   = decRps->m_refPicSetInterLayer0;
     4023  const std::vector<TComPic*>& refPicSetInterLayer1   = decRps->m_refPicSetInterLayer1;
     4024
     4025  Int rIdx = 0;
     4026  while( rIdx < numRpsCurrTempList0 )
     4027  {
     4028    for(Int  i = 0; i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4029    {
     4030      refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ];
     4031    }   
     4032
     4033    for(Int  i = 0; i < numActiveRefLayerPics0; rIdx++, i++ )
     4034    {
     4035      refPicListTemp0[ rIdx ] = refPicSetInterLayer0[ i ];
     4036    }
     4037
     4038    for(Int  i = 0;  i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )  // (F 65)
     4039    {
     4040      refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ];
     4041    }
     4042
     4043    for(Int  i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4044    {
     4045      refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ];
     4046    }
     4047
     4048    for(Int  i = 0; i < numActiveRefLayerPics1; rIdx++, i++ )
     4049    {
     4050      refPicListTemp0[ rIdx ] = refPicSetInterLayer1[ i ];
     4051    }
     4052  }
     4053
     4054  // The list RefPicList0 is constructed as follows:
     4055  TComRefPicListModification* rplm  = getRefPicListModification();
     4056  for( rIdx = 0; rIdx  <=  getNumRefIdxL0ActiveMinus1(); rIdx++ )      //  (F 66)
     4057  {
     4058    m_apcRefPicList[ 0 ][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ];
     4059    // The decoding process below slice level requires the status
     4060    // of the reference pictures, when decoding the RPS. So store it here.
     4061    m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm();
     4062    m_aiRefPOCList     [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC();
     4063    m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId();
     4064  } 
     4065
     4066  std::vector<TComPic*> refPicListTemp1;
     4067  refPicListTemp1.resize((MAX_NUM_REF+1),NULL);
     4068
     4069  if (getSliceType() == B_SLICE )
     4070  {
     4071    // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to
     4072    // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows:       
     4073    Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() );
     4074
     4075    rIdx = 0;
     4076    while( rIdx < numRpsCurrTempList1 )
     4077    {
     4078      for( Int i = 0; i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4079      {
     4080        refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ];
     4081      }
     4082      for( Int i = 0; i< numActiveRefLayerPics1; rIdx++, i++ )
     4083      {
     4084        refPicListTemp1[ rIdx ] = refPicSetInterLayer1[ i ];
     4085      }
     4086      for( Int i = 0;  i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )  // (F 67)
     4087      {
     4088        refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ];
     4089      }         
     4090      for( Int i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4091      {
     4092        refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ];
     4093      }
     4094      for( Int i = 0; i< numActiveRefLayerPics0; rIdx++, i++ )
     4095      {
     4096        refPicListTemp1[ rIdx ] = refPicSetInterLayer0[ i ];
     4097      }
     4098    }
     4099  }
     4100
     4101  if (getSliceType() == B_SLICE )
     4102  {
     4103    //   When the slice is a B slice, the list RefPicList1 is constructed as follows:
     4104    for( rIdx = 0; rIdx  <=  getNumRefIdxL1ActiveMinus1(); rIdx++ )      // (F 68)
     4105    {
     4106      m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ];
     4107
     4108      // The decoding process below slice level requires the marking status
     4109      // of the reference pictures, when decoding the RPS. So store it here.
     4110      m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm();
     4111      m_aiRefPOCList     [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC();
     4112      m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId();
     4113    }   
     4114  }
     4115}
     4116
     4117
     4118Void TComSlice::cl834DecProcForRefPicListConst()
     4119{
     4120  // This process is invoked at the beginning of the decoding process for each P or B slice.
     4121  assert( getSliceType() == B_SLICE || getSliceType() == P_SLICE );
     4122
     4123  // Reference pictures are addressed through reference indices as specified in clause 8.5.3.3.2. A reference index is an index into
     4124  // a reference picture list. When decoding a P slice, there is a single reference picture list RefPicList0. When decoding a B
     4125  // slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0.
     4126
     4127  // At the beginning of the decoding process for each slice, the reference picture lists RefPicList0 and, for B slices, RefPicList1
     4128  // are derived as follows:
     4129
     4130  // The variable NumRpsCurrTempList0 is set equal to Max( num_ref_idx_l0_active_minus1 + 1, NumPicTotalCurr )
     4131  Int numRpsCurrTempList0 = std::max( getNumRefIdxL0ActiveMinus1() + 1, getNumPicTotalCurr() );
     4132
     4133  // and the list RefPicListTemp0 is constructed as follows:
     4134  std::vector<TComPic*> refPicListTemp0;
     4135  refPicListTemp0.resize((MAX_NUM_REF+1),NULL);
     4136
     4137  const TComDecodedRps* decRps = getPic()->getDecodedRps();
     4138
     4139  const std::vector<TComPic*>& refPicSetStCurrBefore = decRps->m_refPicSetStCurrBefore;
     4140  const std::vector<TComPic*>& refPicSetStCurrAfter  = decRps->m_refPicSetStCurrAfter;
     4141  const std::vector<TComPic*>& refPicSetLtCurr       = decRps->m_refPicSetLtCurr;
     4142   
     4143  const Int                    numPocStCurrBefore    = decRps->m_numPocStCurrBefore;
     4144  const Int                    numPocStCurrAfter     = decRps->m_numPocStCurrAfter;
     4145  const Int                    numPocLtCurr          = decRps->m_numPocLtCurr;
     4146
     4147  Int rIdx = 0;
     4148  while( rIdx < numRpsCurrTempList0 )
     4149  {
     4150    for(Int  i = 0; i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4151    {
     4152      refPicListTemp0[ rIdx ] = refPicSetStCurrBefore[ i ];
     4153    }   
     4154
     4155    for(Int  i = 0;  i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )  // (8 8)
     4156    {
     4157      refPicListTemp0[ rIdx ] = refPicSetStCurrAfter[ i ];
     4158    }
     4159
     4160    for(Int  i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList0; rIdx++, i++ )
     4161    {
     4162      refPicListTemp0[ rIdx ] = refPicSetLtCurr[ i ];
     4163    }
     4164  }
     4165
     4166  // The list RefPicList0 is constructed as follows:
     4167
     4168  TComRefPicListModification* rplm = getRefPicListModification();
     4169  for( rIdx = 0; rIdx  <=  getNumRefIdxL0ActiveMinus1(); rIdx++ )      //   (8-9)
     4170  {
     4171    m_apcRefPicList[0][ rIdx ] = rplm->getRefPicListModificationFlagL0( ) ? refPicListTemp0[ rplm->getListEntryL0( rIdx )] : refPicListTemp0[ rIdx ];
     4172
     4173    // The decoding process below slice level requires the marking status
     4174    // of the reference pictures, when decoding the RPS. So store it here.
     4175    m_bIsUsedAsLongTerm[ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getIsLongTerm();
     4176    m_aiRefPOCList     [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getPOC();
     4177    m_aiRefLayerIdList [ 0 ][ rIdx ] = m_apcRefPicList[ 0 ][ rIdx ]->getLayerId();
     4178  }
     4179
     4180  std::vector<TComPic*> refPicListTemp1;
     4181  refPicListTemp1.resize((MAX_NUM_REF+1),NULL);
     4182
     4183  if (getSliceType() == B_SLICE )
     4184  {
     4185    // When the slice is a B slice, the variable NumRpsCurrTempList1 is set equal to
     4186    // Max( num_ref_idx_l1_active_minus1 + 1, NumPicTotalCurr ) and the list RefPicListTemp1 is constructed as follows:
     4187    Int numRpsCurrTempList1 = std::max( getNumRefIdxL1ActiveMinus1() + 1, getNumPicTotalCurr() );
     4188
     4189    rIdx = 0;
     4190    while( rIdx < numRpsCurrTempList1 )
     4191    {
     4192      for( Int i = 0; i < numPocStCurrAfter  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4193      {
     4194        refPicListTemp1[ rIdx ] = refPicSetStCurrAfter[ i ];
     4195      }
     4196      for( Int i = 0;  i < numPocStCurrBefore  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )  // (8-10)
     4197      {
     4198        refPicListTemp1[ rIdx ] = refPicSetStCurrBefore[ i ];
     4199      }         
     4200      for( Int i = 0; i < numPocLtCurr  &&  rIdx < numRpsCurrTempList1; rIdx++, i++ )
     4201      {
     4202        refPicListTemp1[ rIdx ] = refPicSetLtCurr[ i ];
     4203      }
     4204    }
     4205  }
     4206
     4207  if (getSliceType() == B_SLICE )
     4208  {
     4209    //   When the slice is a B slice, the list RefPicList1 is constructed as follows:
     4210    for( rIdx = 0; rIdx  <=  getNumRefIdxL1ActiveMinus1(); rIdx++ )      // (F 68)
     4211    {
     4212      m_apcRefPicList[ 1 ][ rIdx ] = rplm->getRefPicListModificationFlagL1() ? refPicListTemp1[ rplm->getListEntryL1( rIdx ) ] : refPicListTemp1[ rIdx ];
     4213
     4214      // The decoding process below slice level requires the marking status
     4215      // of the reference pictures, when decoding the RPS. So store it here.
     4216      m_bIsUsedAsLongTerm[ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getIsLongTerm();
     4217      m_aiRefPOCList     [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getPOC();
     4218      m_aiRefLayerIdList [ 1 ][ rIdx ] = m_apcRefPicList[ 1 ][ rIdx ]->getLayerId();
     4219    }
     4220  }
     4221}
     4222
     4223Int TComSlice::getNumPicTotalCurr() const
     4224{
     4225  Int numPicTotalCurr = 0;
     4226#if NH_MV_FIX_NUM_POC_TOTAL_CUR
     4227  if ( !isIdr()  )
     4228  {
     4229    const TComStRefPicSet* stRps = getStRps( getCurrRpsIdx() );
     4230#endif
     4231    for( Int i = 0; i < stRps->getNumNegativePicsVar(); i++ )
     4232    {
     4233      if( stRps->getUsedByCurrPicS0Var( i ) )
     4234      {
     4235        numPicTotalCurr++;
     4236      }
     4237    }
     4238    for( Int i = 0; i < stRps->getNumPositivePicsVar(); i++)  //(7 55)
     4239    {
     4240      if( stRps->getUsedByCurrPicS1Var(i) )
     4241      {
     4242        numPicTotalCurr++;
     4243      }
     4244    }
     4245    for( Int i = 0; i < getNumLongTermSps() + getNumLongTermPics(); i++ )
     4246    {
     4247      if( getUsedByCurrPicLtVar( i ) )
     4248      {
     4249        numPicTotalCurr++;
     4250      }
     4251    }
     4252#if NH_MV_FIX_NUM_POC_TOTAL_CUR
     4253  }
     4254#endif
     4255
     4256  if ( decProcAnnexF() )
     4257  {
     4258    numPicTotalCurr += getNumActiveRefLayerPics();
     4259  }
     4260  return numPicTotalCurr;
     4261}
     4262
     4263
     4264
     4265Int TComSlice::getPocLsbLtVar( Int i )
     4266{
     4267  Int pocLsbLtVar;
     4268  if (i < getNumLongTermSps() )
     4269  {
     4270
     4271    pocLsbLtVar = getSPS()->getLtRefPicPocLsbSps( getLtIdxSps( i ) );
     4272  }
     4273  else
     4274  {
     4275    pocLsbLtVar = getPocLsbLt( i );
     4276  }
     4277  return pocLsbLtVar;
     4278}
     4279
     4280
     4281Bool TComSlice::getUsedByCurrPicLtVar( Int i ) const
     4282{
     4283  Bool usedByCurrPicLtVar;
     4284  if (i < getNumLongTermSps() )
     4285  {
     4286    usedByCurrPicLtVar = getSPS()->getUsedByCurrPicLtSPSFlag( getLtIdxSps( i ) );
     4287  }
     4288  else
     4289  {
     4290    usedByCurrPicLtVar = getUsedByCurrPicLtFlag( i );
     4291  }
     4292  return usedByCurrPicLtVar;
     4293}
     4294
     4295
     4296Int TComSlice::getDeltaPocMsbCycleLtVar( Int i ) const
     4297{
     4298  Int deltaPocMsbCycleVar;
     4299  if (i == 0 || i == getNumLongTermSps() )
     4300  {
     4301    deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i );
     4302  }
     4303  else
     4304  {
     4305    deltaPocMsbCycleVar = getDeltaPocMsbCycleLt( i ) + getDeltaPocMsbCycleLtVar( i - 1 );
     4306  }
     4307  return deltaPocMsbCycleVar;
     4308}
    39544309
    39554310#endif
     
    40744429
    40754430Void TComSlice::checkInCompPredRefLayers()
    4076 {
     4431{ 
    40774432  if ( getInCompPredFlag() )
    40784433  {
    40794434    for (Int i = 0; i < getNumCurCmpLIds(); i++ )
    4080     {
     4435    {     
    40814436      assert( getIvPic(!getIsDepth(), getInCmpRefViewIdcs( i ) ) != NULL );       
    40824437      //  It is a requirement of bitstream conformance that there
    40834438      //  is a picture in the DPB with PicOrderCntVal equal to the PicOrderCntVal of the current picture,
    40844439      //  and a nuh_layer_id value equal to ViewCompLayerId[ inCmpRefViewIdcs[ i ] ][ !DepthFlag ].
     4440    }
     4441  }
     4442}
     4443
     4444Void TComSlice::setPocsInCurrRPSs()
     4445{
     4446  // Currently only needed at decoder side;
     4447  m_pocsInCurrRPSs.clear();   
     4448  std::vector<TComPic*>** rpsCurr = getPic()->getDecodedRps()->m_refPicSetsCurr;
     4449  for (Int i = 0 ; i < 3; i++ )
     4450  {
     4451    for( Int j = 0; j < rpsCurr[i]->size(); j++ )
     4452    {
     4453      m_pocsInCurrRPSs.push_back( (*rpsCurr[i])[j]->getPOC() );
    40854454    }
    40864455  }
     
    46134982
    46144983  ProfileTierLevel* curProfileTierLevel = getGeneralPTL( );
     4984  assert( curProfileTierLevel != NULL );
    46154985
    46164986  if( !profilePresentFlag )
     
    46445014Void TComPTL::inferSubLayerValues(Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL)
    46455015{
    4646   assert( k == 0 || refPTL != NULL );
    4647 
     5016  assert( k == 0 || refPTL != NULL );   
    46485017  for (Int i = maxNumSubLayersMinus1; i >= 0; i--)
    46495018  {
     
    46655034    }   
    46665035
     5036    assert( refProfileTierLevel != NULL );
    46675037    ProfileTierLevel* curProfileTierLevel = getSubLayerPTL( i );
     5038    assert( curProfileTierLevel != NULL );
    46685039    if( !getSubLayerLevelPresentFlag( i ) )
    46695040    {
     
    48835254}
    48845255
     5256
     5257Int TComDpbSize::getVpsMaxLatencyPictures( Int i, Int j ) const
     5258{
     5259  return getMaxVpsNumReorderPics( i, j ) + getMaxVpsLatencyIncreasePlus1(i, j) - 1;
     5260}
     5261
    48855262Void Window::scaleOffsets( Int scal )
    48865263{
     
    48945271  }
    48955272}
    4896 #endif
     5273
     5274Void TComStRefPicSet::inferRps( Int stRpsIdx, TComSPS* sps, Bool encoder )
     5275{
     5276  if ( getInterRefPicSetPredictionFlag() )
     5277  {
     5278    // When inter_ref_pic_set_prediction_flag is equal to 1, the variables DeltaPocS0[ stRpsIdx ][ i ], UsedByCurrPicS0[ stRpsIdx ][ i ],
     5279    // NumNegativePics[ stRpsIdx ], DeltaPocS1[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ] and NumPositivePics[ stRpsIdx ] are
     5280    // derived as follows:
     5281
     5282    Int i = 0;
     5283    Int refRpsIdx = getRefRpsIdx( stRpsIdx );
     5284    TComStRefPicSet* refRps = sps->getStRefPicSet( refRpsIdx );
     5285
     5286    for( Int j = refRps->getNumPositivePicsVar( ) - 1; j >= 0; j-- )
     5287    {
     5288      Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps();
     5289      if( dPoc < 0  &&  getUseDeltaFlag( refRps->getNumNegativePicsVar( ) + j ) )
     5290      {
     5291        setDeltaPocS0Var     ( i, dPoc );
     5292        setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumNegativePicsVar( ) + j ) );
     5293      }
     5294    }
     5295    if( getDeltaRps() < 0  && getUseDeltaFlag( refRps->getNumDeltaPocs() ) )   //   (7 59)
     5296    {
     5297      setDeltaPocS0Var( i,  getDeltaRps() );
     5298      setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() ) );
     5299    }
     5300    for( Int j = 0; j < refRps->getNumNegativePicsVar(); j++ )
     5301    {
     5302      Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps();
     5303      if( dPoc < 0  &&  getUseDeltaFlag( j ) )
     5304      {
     5305        setDeltaPocS0Var( i , dPoc);
     5306        setUsedByCurrPicS0Var( i++ , getUsedByCurrPicFlag( j )) ;
     5307      }
     5308    }
     5309
     5310    setNumNegativePicsVar( i );
     5311
     5312    i = 0;
     5313    for( Int j = refRps->getNumNegativePicsVar() - 1; j  >=  0; j-- )
     5314    {
     5315      Int dPoc = refRps->getDeltaPocS0Var( j ) + getDeltaRps();
     5316      if( dPoc > 0  &&  getUseDeltaFlag( j ) )
     5317      {
     5318        setDeltaPocS1Var( i, dPoc );
     5319        setUsedByCurrPicS1Var(  i++, getUsedByCurrPicFlag( j ) ) ;
     5320      }
     5321    }
     5322
     5323    if( getDeltaRps() > 0  &&  getUseDeltaFlag( refRps->getNumDeltaPocs() ) ) //  (7 60)
     5324    {
     5325      setDeltaPocS1Var( i , getDeltaRps() );
     5326      setUsedByCurrPicS1Var( i++ , getUsedByCurrPicFlag( refRps->getNumDeltaPocs() ));
     5327    }
     5328
     5329    for( Int j = 0; j < refRps->getNumPositivePicsVar( ); j++)
     5330    {
     5331      Int dPoc = refRps->getDeltaPocS1Var( j ) + getDeltaRps();
     5332      if( dPoc > 0  &&  getUseDeltaFlag( refRps->getNumNegativePicsVar() + j ) )
     5333      {
     5334        setDeltaPocS1Var( i, dPoc);
     5335        setUsedByCurrPicS1Var( i++, getUsedByCurrPicFlag( refRps->getNumNegativePicsVar() + j ));
     5336      }
     5337    }
     5338    setNumPositivePicsVar(  i );
     5339  }
     5340  else
     5341  {
     5342    // When inter_ref_pic_set_prediction_flag is equal to 0, the variables NumNegativePics[ stRpsIdx ], NumPositivePics[ stRpsIdx ],
     5343    // UsedByCurrPicS0[ stRpsIdx ][ i ], UsedByCurrPicS1[ stRpsIdx ][ i ], DeltaPocS0[ stRpsIdx ][ i ] and DeltaPocS1[ stRpsIdx ][ i ]
     5344    // are derived as follows:
     5345
     5346    setNumNegativePicsVar( getNumNegativePics( ) );        //  (7 61)
     5347    setNumPositivePicsVar( getNumPositivePics( ) );         //  (7 62)
     5348
     5349    for (Int i = 0 ; i < getNumNegativePics(); i++ )
     5350    {     
     5351      setUsedByCurrPicS0Var( i,  getUsedByCurrPicS0Flag( i ) ); //  (7 63)
     5352      if (i == 0 )
     5353      {
     5354        setDeltaPocS0Var( i , -( getDeltaPocS0Minus1( i ) + 1 )); // (7 65)
     5355      }
     5356      else
     5357      {
     5358        setDeltaPocS0Var( i , getDeltaPocS0Var( i - 1 ) - ( getDeltaPocS0Minus1( i ) + 1 )); //  (7 67)
     5359      }
     5360    }
     5361
     5362    for (Int i = 0 ; i < getNumPositivePics(); i++ )
     5363    {     
     5364      setUsedByCurrPicS1Var( i,  getUsedByCurrPicS1Flag( i ) ); //  (7 64)
     5365
     5366      if (i == 0 )
     5367      {
     5368        setDeltaPocS1Var( i , getDeltaPocS1Minus1( i ) + 1    );      // (7 66)
     5369      }
     5370      else
     5371      {
     5372        setDeltaPocS1Var( i , getDeltaPocS1Var( i - 1 ) + ( getDeltaPocS1Minus1( i ) + 1 )); //  (7 68)
     5373      }
     5374    }
     5375  }
     5376}
     5377
     5378#endif
Note: See TracChangeset for help on using the changeset viewer.