Ignore:
Timestamp:
28 Apr 2013, 08:49:16 (12 years ago)
Author:
seregin
Message:

update to HM10.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp

    r125 r133  
    5454, m_iPOC                          ( 0 )
    5555, m_iLastIDR                      ( 0 )
    56 , m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR )
     56, m_eNalUnitType                  ( NAL_UNIT_CODED_SLICE_IDR_W_RADL )
    5757, m_eSliceType                    ( I_SLICE )
    5858, m_iSliceQp                      ( 0 )
     
    6565, m_deblockingFilterBetaOffsetDiv2 ( 0 )
    6666, m_deblockingFilterTcOffsetDiv2   ( 0 )
     67#if !L0034_COMBINED_LIST_CLEANUP
    6768, m_bRefPicListModificationFlagLC ( false )
    6869, m_bRefPicListCombinationFlag    ( false )
     70#endif
    6971, m_bCheckLDC                     ( false )
    7072, m_iSliceQpDelta                 ( 0 )
     
    8486, m_dLambda                       ( 0.0 )
    8587#endif
    86 , m_bNoBackPredFlag               ( false )
     88#if !L0034_COMBINED_LIST_CLEANUP
     89, m_bNoBackPredFlag             ( false )
     90#endif
    8791, m_uiTLayer                      ( 0 )
    8892#if SVC_EXTENSION
     
    113117, m_enableTMVPFlag                ( true )
    114118{
     119#if L0034_COMBINED_LIST_CLEANUP
     120  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
     121#else
    115122  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
     123#endif
    116124 
    117125#if REF_LIST_BUGFIX
     
    120128  initEqualRef();
    121129 
     130#if L0034_COMBINED_LIST_CLEANUP
     131  for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )
     132  {
     133    m_list1IdxToList0Idx[idx] = -1;
     134  }
     135#else
    122136  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    123137  {
     
    129143    m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    130144  }   
     145#endif
    131146  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++)
    132147  {
     
    136151    m_aiRefPOCList  [1][iNumCount] = 0;
    137152  }
    138   resetWpScaling(m_weightPredTable);
     153  resetWpScaling();
    139154  initWpAcDcParam();
    140155  m_saoEnabledFlag = false;
     
    173188  m_colRefIdx = 0;
    174189  initEqualRef();
     190#if !L0034_COMBINED_LIST_CLEANUP
    175191  m_bNoBackPredFlag = false;
    176192  m_bRefPicListCombinationFlag = false;
    177193  m_bRefPicListModificationFlagLC = false;
     194#endif
    178195  m_bCheckLDC = false;
    179196  m_iSliceQpDeltaCb = 0;
    180197  m_iSliceQpDeltaCr = 0;
    181198
     199#if !L0034_COMBINED_LIST_CLEANUP
    182200  m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
     201#endif
    183202
    184203  m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
     
    194213Bool TComSlice::getRapPicFlag()
    195214{
    196   return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
     215  return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    197216      || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
    198217      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    199       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
    200       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
     218      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     219      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
    201220      || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
    202221}
     
    213232}
    214233
    215 Void  TComSlice::sortPicList        (TComList<TComPic*>& rcListPic)
     234Void  TComSlice::sortPicList(TComList<TComPic*>& rcListPic)
    216235{
    217236  TComPic*    pcPicExtract;
     
    268287
    269288
    270 TComPic* TComSlice::xGetLongTermRefPic (TComList<TComPic*>& rcListPic,
    271                                         Int                 poc)
     289TComPic* TComSlice::xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb)
    272290{
    273291  TComList<TComPic*>::iterator  iterPic = rcListPic.begin(); 
    274292  TComPic*                      pcPic = *(iterPic);
    275293  TComPic*                      pcStPic = pcPic;
     294 
     295  Int pocCycle = 1 << getSPS()->getBitsForPOC();
     296  if (!pocHasMsb)
     297  {
     298    poc = poc % pocCycle;
     299  }
     300 
    276301  while ( iterPic != rcListPic.end() )
    277302  {
    278303    pcPic = *(iterPic);
    279     if(pcPic && (pcPic->getPOC()%(1<<getSPS()->getBitsForPOC())) == (poc%(1<<getSPS()->getBitsForPOC())))
    280     {
    281       if(pcPic->getIsLongTerm())
     304    if (pcPic && pcPic->getPOC()!=this->getPOC() && pcPic->getSlice( 0 )->isReferenced())
     305    {
     306      Int picPoc = pcPic->getPOC();
     307      if (!pocHasMsb)
     308      {
     309        picPoc = picPoc % pocCycle;
     310      }
     311     
     312      if (poc == picPoc)
     313      {
     314       if (pcPic->getIsLongTerm())
    282315      {
    283316        return pcPic;
     
    289322      break;
    290323    }
     324    }
    291325
    292326    iterPic++;
    293327  }
     328 
    294329  return  pcStPic;
    295330}
    296331
    297 Void TComSlice::setRefPOCList       ()
     332Void TComSlice::setRefPOCList()
    298333{
    299334  for (Int iDir = 0; iDir < 2; iDir++)
     
    307342}
    308343
     344#if L0034_COMBINED_LIST_CLEANUP
     345Void TComSlice::setList1IdxToList0Idx()
     346{
     347  Int idxL0, idxL1;
     348  for ( idxL1 = 0; idxL1 < getNumRefIdx( REF_PIC_LIST_1 ); idxL1++ )
     349  {
     350    m_list1IdxToList0Idx[idxL1] = -1;
     351    for ( idxL0 = 0; idxL0 < getNumRefIdx( REF_PIC_LIST_0 ); idxL0++ )
     352    {
     353      if ( m_apcRefPicList[REF_PIC_LIST_0][idxL0]->getPOC() == m_apcRefPicList[REF_PIC_LIST_1][idxL1]->getPOC() )
     354      {
     355        m_list1IdxToList0Idx[idxL1] = idxL0;
     356        break;
     357      }
     358    }
     359  }
     360}
     361#else
    309362Void TComSlice::generateCombinedList()
    310363{
     
    369422  }
    370423}
    371 
    372 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic)
    373 {
     424#endif
     425
     426#if FIX1071
     427Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
     428#else
     429Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
     430#endif
     431{
     432#if FIX1071
     433  if (!checkNumPocTotalCurr)
     434#endif
     435  {
    374436#if REF_IDX_FRAMEWORK
    375437  if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() &&
    376       (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) &&
     438      (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
    377439      (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) )
    378440#else
     
    388450  m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
    389451  m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     452  }
    390453
    391454  TComPic*  pcRefPic= NULL;
     
    410473    }
    411474  }
     475 
    412476  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
    413477  {
     
    422486    }
    423487  }
     488 
    424489  for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
    425490  {
    426491    if(m_pcRPS->getUsed(i))
    427492    {
    428       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     493      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    429494      pcRefPic->setIsLongTerm(1);
    430495      pcRefPic->getPicYuvRec()->extendPicBorder();
     
    434499    if(pcRefPic==NULL)
    435500    {
    436       pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     501      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    437502    }
    438503    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
     
    443508  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
    444509  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
    445 
    446   {
     510#if FIX1071
     511  if (checkNumPocTotalCurr)
     512  {
     513    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
     514    // – If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
     515    // – Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
     516    if (getRapPicFlag())
     517    {
     518      assert(numPocTotalCurr == 0);
     519    }
     520
     521    if (m_eSliceType == I_SLICE)
     522  {
     523      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
     524      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     525     
     526      return;
     527    }
     528   
     529    assert(numPocTotalCurr != 0);
     530   
     531    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     532    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
     533  }
     534#endif
     535 
    447536    Int cIdx = 0;
    448537    for ( i=0; i<NumPocStCurr0; i++, cIdx++)
     
    458547      rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    459548    }
    460   }
    461549
    462550  if (m_eSliceType==B_SLICE)
    463551  {
    464     Int cIdx = 0;
     552    cIdx = 0;
    465553    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
    466554    {
     
    509597  }
    510598
    511   if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)
     599  if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)
     600  {
    512601    return;
     602  }
    513603
    514604  TComRefPicListModification* refPicListModification = this->getRefPicListModification();
     
    589679
    590680  //temporal reference pictures
    591   if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) )
     681  if( !(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) )
    592682  {
    593683    for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
     
    619709      if(m_pcRPS->getUsed(i))
    620710      {
    621         pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     711        pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    622712        pcRefPic->setIsLongTerm(1);
    623713        pcRefPic->getPicYuvRec()->extendPicBorder();
     
    627717      if(pcRefPic==NULL)
    628718      {
    629         pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i));
     719        pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
    630720      }
    631721      pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i)); 
     
    636726#if REF_IDX_MFM
    637727  assert(m_aiNumILRRefIdx == 1);
    638   if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())
     728  if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())
    639729  {
    640730    ilpPic[0]->copyUpsampledMvField(getBaseColPic());
     
    672762  {
    673763    for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList0; cIdx++,i++)
    674       refPicListTemp0[cIdx] = RefPicSetStCurr0[ i ];   
    675     for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList0; cIdx++,i++)
    676       refPicListTemp0[cIdx] = RefPicSetStCurr1[ i ];
    677     for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList0; cIdx++,i++)
     764    {
     765      refPicListTemp0[cIdx] = RefPicSetStCurr0[ i ];
     766    }
     767    for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList0; cIdx++,i++)
     768    {
     769      refPicListTemp0[cIdx] = RefPicSetStCurr1[ i ];
     770    }
     771    for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList0; cIdx++,i++)
     772    {
    678773      refPicListTemp0[cIdx] = RefPicSetLtCurr[ i ];
     774    }
    679775    for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList0; cIdx++,i++)
     776    {
    680777      refPicListTemp0[cIdx] = ilpPic[ i ];
     778    }
    681779  }
    682780  cIdx = 0;
    683781  while (cIdx<numRpsCurrTempList1 && m_eSliceType==B_SLICE)
    684782  {
    685     for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++)
     783    for ( i=0; i<NumPocStCurr1 && cIdx<numRpsCurrTempList1; cIdx++,i++)
     784    {
    686785      refPicListTemp1[cIdx] = RefPicSetStCurr1[ i ];
    687     for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList1; cIdx++,i++)
    688       refPicListTemp1[cIdx] = RefPicSetStCurr0[ i ];
    689     for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList1; cIdx++,i++)
     786    }
     787    for ( i=0; i<NumPocStCurr0 && cIdx<numRpsCurrTempList1; cIdx++,i++)
     788    {
     789      refPicListTemp1[cIdx] = RefPicSetStCurr0[ i ];
     790    }
     791    for ( i=0; i<NumPocLtCurr && cIdx<numRpsCurrTempList1; cIdx++,i++)
     792    {
    690793      refPicListTemp1[cIdx] = RefPicSetLtCurr[ i ];
     794    }
    691795    for ( i=0; i<m_aiNumILRRefIdx && cIdx<numRpsCurrTempList1; cIdx++,i++)
     796    {
    692797      refPicListTemp1[cIdx] = ilpPic[ i ];
     798    }
    693799  }
    694800  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
     
    724830#if REF_IDX_FRAMEWORK
    725831  if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() &&
    726     (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) &&
     832    (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
    727833    (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) )
    728834#else
     
    793899}
    794900
    795 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA)
     901Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic)
    796902{
    797903  for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
     
    806912    if(pocCRA < MAX_UINT && getPOC() > pocCRA)
    807913    {
     914      if (!pReferencePictureSet->getCheckLTMSBPresent(i))
     915      {
     916        assert(xGetLongTermRefPic(rcListPic, pReferencePictureSet->getPOC(i), false)->getPOC() >= pocCRA);
     917      }
     918      else
     919      {
    808920      assert(pReferencePictureSet->getPOC(i) >= pocCRA);
    809921    }
    810922  }
    811   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
     923  }
     924  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) // IDR picture found
    812925  {
    813926    pocCRA = getPOC();
     
    819932    prevRAPisBLA = false;
    820933  }
    821   else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    822          || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     934  else if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     935         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    823936         || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP ) // BLA picture found
    824937  {
     
    851964  Int pocCurr = getPOC();
    852965
    853   if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    854     || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     966  if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     967    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    855968    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
    856     || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR
     969    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    857970    || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )  // IDR or BLA picture
    858971  {
     
    866979      iterPic++;
    867980    }
    868     if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA
    869       || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLANT
     981    if ( getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     982      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    870983      || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP )
    871984    {
     
    881994      {
    882995        rpcPic = *(iterPic);
    883         if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA) rpcPic->getSlice(0)->setReferenced(false);
     996        if (rpcPic->getPOC() != pocCurr && rpcPic->getPOC() != pocCRA)
     997        {
     998          rpcPic->getSlice(0)->setReferenced(false);
     999        }
    8841000        iterPic++;
    8851001      }
     
    9121028  m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2;
    9131029 
     1030#if L0034_COMBINED_LIST_CLEANUP
     1031  for (i = 0; i < 2; i++)
     1032#else
    9141033  for (i = 0; i < 3; i++)
     1034#endif
    9151035  {
    9161036    m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
    9171037  }
    9181038
     1039#if L0034_COMBINED_LIST_CLEANUP
     1040  for (i = 0; i < MAX_NUM_REF; i++)
     1041  {
     1042    m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];
     1043  }
     1044#else
    9191045  for (i = 0; i < 2; i++)
    9201046  {
     
    9331059  m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;
    9341060  m_bRefPicListCombinationFlag    = pSrc->m_bRefPicListCombinationFlag;
     1061#endif
    9351062  m_bCheckLDC             = pSrc->m_bCheckLDC;
    9361063  m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
     
    9841111  }
    9851112
     1113#if !L0034_COMBINED_LIST_CLEANUP
    9861114  m_bNoBackPredFlag      = pSrc->m_bNoBackPredFlag;
     1115#endif
    9871116  m_uiTLayer                      = pSrc->m_uiTLayer;
    9881117  m_bTLayerSwitchingFlag          = pSrc->m_bTLayerSwitchingFlag;
     
    10181147
    10191148Int TComSlice::m_prevPOC = 0;
     1149
    10201150/** Function for setting the slice's temporal layer ID and corresponding temporal_layer_switching_point_flag.
    10211151 * \param uiTLayer Temporal layer ID of the current slice
     
    10781208  Int i, isReference;
    10791209
    1080   Int j = 0;
    10811210  // loop through all pictures in the reference picture buffer
    10821211  TComList<TComPic*>::iterator iterPic = rcListPic.begin();
    10831212  while ( iterPic != rcListPic.end())
    10841213  {
    1085     j++;
    10861214    rpcPic = *(iterPic++);
     1215
     1216    if(!rpcPic->getSlice( 0 )->isReferenced())
     1217    {
     1218      continue;
     1219    }
    10871220
    10881221    isReference = 0;
     
    11231256    {           
    11241257      rpcPic->getSlice( 0 )->setReferenced( false );   
     1258      rpcPic->setUsedByCurr(0);
    11251259      rpcPic->setIsLongTerm(0);
    11261260    }
     
    11281262    assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getUsedByCurr()==0||rpcPic->getTLayer()<=this->getTLayer());
    11291263    //check that pictures of higher or equal temporal layer are not in the RPS if the current picture is a TSA picture
    1130     if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
     1264    if(this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TLA_R || this->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N)
    11311265    {
    11321266      assert(rpcPic->getSlice( 0 )->isReferenced()==0||rpcPic->getTLayer()<this->getTLayer());
     
    11451279{
    11461280  TComPic* rpcPic;
    1147   Int i, isAvailable, j;
     1281  Int i, isAvailable;
    11481282  Int atLeastOneLost = 0;
    11491283  Int atLeastOneRemoved = 0;
     
    11541288  for(i=pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i<pReferencePictureSet->getNumberOfPictures();i++)
    11551289  {
    1156     j = 0;
    11571290    isAvailable = 0;
    11581291    // loop through all pictures in the reference picture buffer
     
    11601293    while ( iterPic != rcListPic.end())
    11611294    {
    1162       j++;
    11631295      rpcPic = *(iterPic++);
    11641296      if(pReferencePictureSet->getCheckLTMSBPresent(i)==true)
     
    11831315      while ( iterPic != rcListPic.end())
    11841316      {
    1185         j++;
    11861317        rpcPic = *(iterPic++);
    11871318
    1188         if((rpcPic->getPicSym()->getSlice(0)->getPOC()%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC())) == (this->getPOC() + pReferencePictureSet->getDeltaPOC(i))%(1<<rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC()) && rpcPic->getSlice(0)->isReferenced())
     1319        Int pocCycle = 1 << rpcPic->getPicSym()->getSlice(0)->getSPS()->getBitsForPOC();
     1320        Int curPoc = rpcPic->getPicSym()->getSlice(0)->getPOC();
     1321        Int refPoc = pReferencePictureSet->getPOC(i);
     1322        if (!pReferencePictureSet->getCheckLTMSBPresent(i))
     1323        {
     1324          curPoc = curPoc % pocCycle;
     1325          refPoc = refPoc % pocCycle;
     1326        }
     1327       
     1328        if (rpcPic->getSlice(0)->isReferenced() && curPoc == refPoc)
    11891329        {
    11901330          isAvailable = 1;
     
    12241364  for(i=0;i<pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures();i++)
    12251365  {
    1226     j = 0;
    12271366    isAvailable = 0;
    12281367    // loop through all pictures in the reference picture buffer
     
    12301369    while ( iterPic != rcListPic.end())
    12311370    {
    1232       j++;
    12331371      rpcPic = *(iterPic++);
    12341372
     
    12471385        {
    12481386          if(printErrors)
     1387          {
    12491388            printf("\nShort-term reference picture with POC = %3d seems to have been removed or not correctly decoded.", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
     1389          }
    12501390          atLeastOneRemoved = 1;
    12511391        }
     
    12531393        {
    12541394          if(printErrors)
     1395          {
    12551396            printf("\nShort-term reference picture with POC = %3d is lost or not correctly decoded!", this->getPOC() + pReferencePictureSet->getDeltaPOC(i));
     1397          }
    12561398          atLeastOneLost = 1;
    12571399          iPocLost=this->getPOC() + pReferencePictureSet->getDeltaPOC(i);
     
    13991541 * \returns Void
    14001542 */
    1401 Void  TComSlice::resetWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
     1543Void  TComSlice::resetWpScaling()
    14021544{
    14031545  for ( Int e=0 ; e<2 ; e++ )
     
    14071549      for ( Int yuv=0 ; yuv<3 ; yuv++ )
    14081550      {
    1409         wpScalingParam  *pwp = &(wp[e][i][yuv]);
     1551        wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
    14101552        pwp->bPresentFlag      = false;
    14111553        pwp->uiLog2WeightDenom = 0;
     
    14231565Void  TComSlice::initWpScaling()
    14241566{
    1425   initWpScaling(m_weightPredTable);
    1426 }
    1427 
    1428 /** set WP tables
    1429  * \param wpScalingParam
    1430  * \returns Void
    1431  */
    1432 Void  TComSlice::initWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3])
    1433 {
    14341567  for ( Int e=0 ; e<2 ; e++ )
    14351568  {
     
    14381571      for ( Int yuv=0 ; yuv<3 ; yuv++ )
    14391572      {
    1440         wpScalingParam  *pwp = &(wp[e][i][yuv]);
    1441         if ( !pwp->bPresentFlag ) {
     1573        wpScalingParam  *pwp = &(m_weightPredTable[e][i][yuv]);
     1574        if ( !pwp->bPresentFlag )
     1575        {
    14421576          // Inferring values not present :
    14431577          pwp->iWeight = (1 << pwp->uiLog2WeightDenom);
     
    14821616  {
    14831617    m_numReorderPics[i] = 0;
     1618#if L0323_DPB
     1619    m_uiMaxDecPicBuffering[i] = 1;
     1620#else
    14841621    m_uiMaxDecPicBuffering[i] = 0;
     1622#endif
    14851623    m_uiMaxLatencyIncrease[i] = 0;
    14861624  }
     
    15161654TComVPS::~TComVPS()
    15171655{
    1518   if( m_hrdParameters    != NULL )     delete m_hrdParameters;
    1519   if( m_hrdOpSetIdx      != NULL )     delete m_hrdOpSetIdx;
    1520   if( m_cprmsPresentFlag != NULL )     delete m_cprmsPresentFlag;
     1656  if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
     1657  if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
     1658  if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
    15211659}
    15221660
     
    15331671, m_picWidthInLumaSamples     (352)
    15341672, m_picHeightInLumaSamples    (288)
     1673, m_log2MinCodingBlockSize    (  0)
     1674, m_log2DiffMaxMinCodingBlockSize (0)
    15351675, m_uiMaxCUWidth              ( 32)
    15361676, m_uiMaxCUHeight             ( 32)
    15371677, m_uiMaxCUDepth              (  3)
    1538 , m_uiMinTrDepth              (  0)
    1539 , m_uiMaxTrDepth              (  1)
    15401678, m_bLongTermRefsPresent      (false)
    15411679, m_uiQuadtreeTULog2MaxSize   (  0)
     
    15471685, m_pcmLog2MaxSize            (  5)
    15481686, m_uiPCMLog2MinSize          (  7)
     1687#if !L0034_COMBINED_LIST_CLEANUP
    15491688, m_bUseLComb                 (false)
     1689#endif
    15501690, m_bitDepthY                 (  8)
    15511691, m_bitDepthC                 (  8)
     
    15721712  {
    15731713    m_uiMaxLatencyIncrease[i] = 0;
     1714#if L0323_DPB
     1715    m_uiMaxDecPicBuffering[i] = 1;
     1716#else
    15741717    m_uiMaxDecPicBuffering[i] = 0;
     1718#endif
    15751719    m_numReorderPics[i]       = 0;
    15761720  }
     
    15911735  m_RPSList.create(numRPS);
    15921736}
     1737
    15931738Void TComSPS::setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess )
    15941739{
     
    18351980  return m_POC[bufferNum];
    18361981}
     1982
    18371983Void TComReferencePictureSet::setPOC(Int bufferNum, Int POC)
    18381984{
    18391985  m_POC[bufferNum] = POC;
    18401986}
     1987
    18411988Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum)
    18421989{
    18431990  return m_bCheckLTMSB[bufferNum];
    18441991}
     1992
    18451993Void TComReferencePictureSet::setCheckLTMSBPresent(Int bufferNum, Bool b)
    18461994{
     
    20222170  return (defaultCounter == (SCALING_LIST_NUM * SCALING_LIST_SIZE_NUM - 4)) ? false : true; // -4 for 32x32
    20232171}
     2172
    20242173/** get scaling matrix from RefMatrixID
    20252174 * \param sizeId size index
     
    20312180  ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
    20322181}
     2182
    20332183/** parse syntax infomation
    20342184 *  \param pchFile syntax infomation
     
    21232273  m_scalingListCoef[SCALING_LIST_32x32][3] = m_scalingListCoef[SCALING_LIST_32x32][1]; // copy address for 32x32
    21242274}
     2275
    21252276/** destroy quantization matrix array
    21262277 */
     
    21352286  }
    21362287}
     2288
    21372289/** get default address of quantization matrix
    21382290 * \param sizeId size index
     
    21642316  return src;
    21652317}
     2318
    21662319/** process of default matrix
    21672320 * \param sizeId size index
     
    21732326  setScalingListDC(sizeId,listId,SCALING_LIST_DC);
    21742327}
     2328
    21752329/** check DC value of matrix for default matrix signaling
    21762330 */
     
    22402394//! activate a PPS and depending on isIDR parameter also SPS and VPS
    22412395//! \returns true, if activation is successful
    2242 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR)
     2396Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
    22432397{
    22442398  TComPPS *pps = m_ppsMap.getPS(ppsId);
     
    22462400  {
    22472401    Int spsId = pps->getSPSId();
    2248     if (!isIDR && (spsId != m_activeSPSId))
    2249     {
    2250       printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR.");
     2402    if (!isIRAP && (spsId != m_activeSPSId))
     2403    {
     2404      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
    22512405      return false;
    22522406    }
     
    22552409    {
    22562410      Int vpsId = sps->getVPSId();
    2257       if (!isIDR && (vpsId != m_activeVPSId))
    2258       {
    2259         printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR.");
     2411      if (!isIRAP && (vpsId != m_activeVPSId))
     2412      {
     2413        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
    22602414        return false;
    22612415      }
     
    24032557    assert(iRefPicNum == 1);
    24042558#if RAP_MFM_INIT
    2405     if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())
     2559    if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())
    24062560#else
    24072561    if( getPOC() != 0 )
Note: See TracChangeset for help on using the changeset viewer.