Ignore:
Timestamp:
28 Jun 2013, 00:40:00 (11 years ago)
Author:
seregin
Message:

update to HM11.0

File:
1 edited

Legend:

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

    r300 r302  
    6565, m_deblockingFilterBetaOffsetDiv2 ( 0 )
    6666, m_deblockingFilterTcOffsetDiv2   ( 0 )
    67 #if !L0034_COMBINED_LIST_CLEANUP
    68 , m_bRefPicListModificationFlagLC ( false )
    69 , m_bRefPicListCombinationFlag    ( false )
    70 #endif
    7167, m_bCheckLDC                     ( false )
    7268, m_iSliceQpDelta                 ( 0 )
     
    8884#else
    8985, m_dLambda                       ( 0.0 )
    90 #endif
    91 #if !L0034_COMBINED_LIST_CLEANUP
    92 , m_bNoBackPredFlag             ( false )
    9386#endif
    9487, m_uiTLayer                      ( 0 )
     
    119112, m_enableTMVPFlag                ( true )
    120113{
    121 #if L0034_COMBINED_LIST_CLEANUP
    122114  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
    123 #else
    124   m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
    125 #endif
    126115
    127116#if SVC_EXTENSION
     
    148137  initEqualRef();
    149138 
    150 #if L0034_COMBINED_LIST_CLEANUP
    151139  for ( Int idx = 0; idx < MAX_NUM_REF; idx++ )
    152140  {
    153141    m_list1IdxToList0Idx[idx] = -1;
    154142  }
    155 #else
    156   for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    157   {
    158     m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;
    159     m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;
    160     m_eListIdFromIdxOfLC[iNumCount]=0;
    161     m_iRefIdxFromIdxOfLC[iNumCount]=0;
    162     m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;
    163     m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    164   }   
    165 #endif
    166143  for(Int iNumCount = 0; iNumCount < MAX_NUM_REF; iNumCount++)
    167144  {
     
    210187  m_colRefIdx = 0;
    211188  initEqualRef();
    212 #if !L0034_COMBINED_LIST_CLEANUP
    213   m_bNoBackPredFlag = false;
    214   m_bRefPicListCombinationFlag = false;
    215   m_bRefPicListModificationFlagLC = false;
    216 #endif
    217189  m_bCheckLDC = false;
    218190  m_iSliceQpDeltaCb = 0;
    219191  m_iSliceQpDeltaCr = 0;
    220 
    221 #if !L0034_COMBINED_LIST_CLEANUP
    222   m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
    223 #endif
    224192
    225193  m_maxNumMergeCand = MRG_MAX_NUM_CANDS;
     
    364332}
    365333
    366 #if L0034_COMBINED_LIST_CLEANUP
    367334Void TComSlice::setList1IdxToList0Idx()
    368335{
     
    381348  }
    382349}
    383 #else
    384 Void TComSlice::generateCombinedList()
    385 {
    386   if(m_aiNumRefIdx[REF_PIC_LIST_C] > 0)
    387   {
    388     m_aiNumRefIdx[REF_PIC_LIST_C]=0;
    389     for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++)
    390     {
    391       m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1;
    392       m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1;
    393       m_eListIdFromIdxOfLC[iNumCount]=0;
    394       m_iRefIdxFromIdxOfLC[iNumCount]=0;
    395       m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1;
    396       m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1;
    397     }
    398 
    399     for (Int iNumRefIdx = 0; iNumRefIdx < MAX_NUM_REF; iNumRefIdx++)
    400     {
    401       if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_0])
    402       {
    403         Bool bTempRefIdxInL2 = true;
    404         for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )
    405         {
    406           if ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )
    407           {
    408             m_iRefIdxOfL1FromRefIdxOfL0[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];
    409             m_iRefIdxOfL0FromRefIdxOfL1[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;
    410             bTempRefIdxInL2 = false;
    411             break;
    412           }
    413         }
    414 
    415         if(bTempRefIdxInL2 == true)
    416         {
    417           m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0;
    418           m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;
    419           m_iRefIdxOfLC[REF_PIC_LIST_0][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;
    420         }
    421       }
    422 
    423       if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_1])
    424       {
    425         Bool bTempRefIdxInL2 = true;
    426         for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ )
    427         {
    428           if ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() )
    429           {
    430             m_iRefIdxOfL0FromRefIdxOfL1[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC];
    431             m_iRefIdxOfL1FromRefIdxOfL0[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx;
    432             bTempRefIdxInL2 = false;
    433             break;
    434           }
    435         }
    436         if(bTempRefIdxInL2 == true)
    437         {
    438           m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_1;
    439           m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx;
    440           m_iRefIdxOfLC[REF_PIC_LIST_1][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++;
    441         }
    442       }
    443     }
    444   }
    445 }
    446 #endif
    447350
    448351#if FIX1071
     352#if SVC_EXTENSION
    449353Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr, TComPic** ilpPic)
     354#else
     355Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
     356#endif
    450357#else
    451358Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
     
    456363#endif
    457364  {
    458     if( m_eSliceType == I_SLICE )
     365    if (m_eSliceType == I_SLICE)
    459366    {
    460367      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
    461368      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
     369     
    462370      return;
    463371    }
     
    672580    }
    673581   
    674     assert(numPocTotalCurr != 0);
     582    assert(numPocTotalCurr > 0);
    675583   
    676584    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
     
    699607    {
    700608      rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    701     }
     609    }   
     610
    702611#if REF_IDX_FRAMEWORK
    703612    if( m_layerId > 0 )
     
    718627    }
    719628#endif
     629  assert(cIdx == numPocTotalCurr);
     630
    720631  if (m_eSliceType==B_SLICE)
    721632  {
     
    732643    {
    733644      rpsCurrList1[cIdx] = RefPicSetLtCurr[i];
    734     }
     645    }   
     646
    735647#if REF_IDX_FRAMEWORK
    736648    if( m_layerId > 0 )
     
    751663    }
    752664#endif
     665
     666    assert(cIdx == numPocTotalCurr);
    753667  }
    754668
    755669  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
    756670
    757   for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[0]-1); rIdx ++)
    758   {
    759     m_apcRefPicList[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? rpsCurrList0[ m_RefPicListModification.getRefPicSetIdxL0(rIdx) ] : rpsCurrList0[rIdx % numPocTotalCurr];
    760     m_bIsUsedAsLongTerm[0][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL0() ? (m_RefPicListModification.getRefPicSetIdxL0(rIdx) >= (NumPocStCurr0 + NumPocStCurr1))
    761                                   : ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1));
    762   }
    763   if ( m_eSliceType == P_SLICE )
     671  for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)
     672  {
     673    cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;
     674    assert(cIdx >= 0 && cIdx < numPocTotalCurr);
     675    m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];
     676    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
     677  }
     678  if ( m_eSliceType != B_SLICE )
    764679  {
    765680    m_aiNumRefIdx[1] = 0;
     
    768683  else
    769684  {
    770     for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[1]-1); rIdx ++)
    771     {
    772       m_apcRefPicList[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ? rpsCurrList1[ m_RefPicListModification.getRefPicSetIdxL1(rIdx) ] : rpsCurrList1[rIdx % numPocTotalCurr];
    773       m_bIsUsedAsLongTerm[1][rIdx] = m_RefPicListModification.getRefPicListModificationFlagL1() ?
    774                                   (m_RefPicListModification.getRefPicSetIdxL1(rIdx) >= (NumPocStCurr0 + NumPocStCurr1)): ((rIdx % numPocTotalCurr) >= (NumPocStCurr0 + NumPocStCurr1));
     685    for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)
     686    {
     687      cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;
     688      assert(cIdx >= 0 && cIdx < numPocTotalCurr);
     689      m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];
     690      m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
    775691    }
    776692  }
     
    1071987  m_deblockingFilterTcOffsetDiv2 = pSrc->m_deblockingFilterTcOffsetDiv2;
    1072988 
    1073 #if L0034_COMBINED_LIST_CLEANUP
    1074989  for (i = 0; i < 2; i++)
    1075 #else
    1076   for (i = 0; i < 3; i++)
    1077 #endif
    1078990  {
    1079991    m_aiNumRefIdx[i]     = pSrc->m_aiNumRefIdx[i];
    1080992  }
    1081993
    1082 #if L0034_COMBINED_LIST_CLEANUP
    1083994  for (i = 0; i < MAX_NUM_REF; i++)
    1084995  {
    1085996    m_list1IdxToList0Idx[i] = pSrc->m_list1IdxToList0Idx[i];
    1086997  }
    1087 #else
    1088   for (i = 0; i < 2; i++)
    1089   {
    1090     for (j = 0; j < MAX_NUM_REF_LC; j++)
    1091     {
    1092        m_iRefIdxOfLC[i][j]  = pSrc->m_iRefIdxOfLC[i][j];
    1093     }
    1094   }
    1095   for (i = 0; i < MAX_NUM_REF_LC; i++)
    1096   {
    1097     m_eListIdFromIdxOfLC[i] = pSrc->m_eListIdFromIdxOfLC[i];
    1098     m_iRefIdxFromIdxOfLC[i] = pSrc->m_iRefIdxFromIdxOfLC[i];
    1099     m_iRefIdxOfL1FromRefIdxOfL0[i] = pSrc->m_iRefIdxOfL1FromRefIdxOfL0[i];
    1100     m_iRefIdxOfL0FromRefIdxOfL1[i] = pSrc->m_iRefIdxOfL0FromRefIdxOfL1[i];
    1101   }
    1102   m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC;
    1103   m_bRefPicListCombinationFlag    = pSrc->m_bRefPicListCombinationFlag;
    1104 #endif
    1105998  m_bCheckLDC             = pSrc->m_bCheckLDC;
    1106999  m_iSliceQpDelta        = pSrc->m_iSliceQpDelta;
     
    11641057  }
    11651058
    1166 #if !L0034_COMBINED_LIST_CLEANUP
    1167   m_bNoBackPredFlag      = pSrc->m_bNoBackPredFlag;
    1168 #endif
    11691059  m_uiTLayer                      = pSrc->m_uiTLayer;
    11701060  m_bTLayerSwitchingFlag          = pSrc->m_bTLayerSwitchingFlag;
     
    14711361/** Function for constructing an explicit Reference Picture Set out of the available pictures in a referenced Reference Picture Set
    14721362*/
     1363#if FIX1071
     1364Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1365#else
    14731366Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet)
     1367#endif
    14741368{
    14751369  TComPic* rpcPic;
     
    14961390        // and should be added to the explicit Reference Picture Set
    14971391        pcRPS->setDeltaPOC(k, pReferencePictureSet->getDeltaPOC(i));
     1392#if FIX1071
     1393        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i) && (!isRAP));
     1394#else
    14981395        pcRPS->setUsed(k, pReferencePictureSet->getUsed(i));
     1396#endif
    14991397        if(pcRPS->getDeltaPOC(k) < 0)
    15001398        {
     
    16741572  {
    16751573    m_numReorderPics[i] = 0;
    1676 #if L0323_DPB
    16771574    m_uiMaxDecPicBuffering[i] = 1;
    1678 #else
    1679     m_uiMaxDecPicBuffering[i] = 0;
    1680 #endif
    16811575    m_uiMaxLatencyIncrease[i] = 0;
    16821576  }
     
    17861680, m_pcmLog2MaxSize            (  5)
    17871681, m_uiPCMLog2MinSize          (  7)
    1788 #if !L0034_COMBINED_LIST_CLEANUP
    1789 , m_bUseLComb                 (false)
    1790 #endif
    17911682, m_bitDepthY                 (  8)
    17921683, m_bitDepthC                 (  8)
     
    18201711  {
    18211712    m_uiMaxLatencyIncrease[i] = 0;
    1822 #if L0323_DPB
    18231713    m_uiMaxDecPicBuffering[i] = 1;
    1824 #else
    1825     m_uiMaxDecPicBuffering[i] = 0;
    1826 #endif
    18271714    m_numReorderPics[i]       = 0;
    18281715  }
     
    18621749  TComHRD *hrd = vui->getHrdParameters();
    18631750
    1864 #if L0043_TIMING_INFO
    18651751  TimingInfo *timingInfo = vui->getTimingInfo();
    18661752  timingInfo->setTimingInfoPresentFlag( true );
     
    18861772    break;
    18871773  }
    1888 #else
    1889   hrd->setTimingInfoPresentFlag( true );
    1890   switch( frameRate )
    1891   {
    1892   case 24:
    1893     hrd->setNumUnitsInTick( 1125000 );    hrd->setTimeScale    ( 27000000 );
    1894     break;
    1895   case 25:
    1896     hrd->setNumUnitsInTick( 1080000 );    hrd->setTimeScale    ( 27000000 );
    1897     break;
    1898   case 30:
    1899     hrd->setNumUnitsInTick( 900900 );     hrd->setTimeScale    ( 27000000 );
    1900     break;
    1901   case 50:
    1902     hrd->setNumUnitsInTick( 540000 );     hrd->setTimeScale    ( 27000000 );
    1903     break;
    1904   case 60:
    1905     hrd->setNumUnitsInTick( 450450 );     hrd->setTimeScale    ( 27000000 );
    1906     break;
    1907   default:
    1908     hrd->setNumUnitsInTick( 1001 );       hrd->setTimeScale    ( 60000 );
    1909     break;
    1910   }
    1911 #endif
    19121774
    19131775  Bool rateCnt = ( bitRate > 0 );
     
    19221784    hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
    19231785    hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
    1924 #if L0044_DU_DPB_OUTPUT_DELAY_HRD
    19251786    hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
    1926 #endif
    19271787  }
    19281788  else
     
    19531813  UInt birateValue, cpbSizeValue;
    19541814  UInt ducpbSizeValue;
    1955 #if L0363_DU_BIT_RATE
    19561815  UInt duBitRateValue = 0;
    1957 #endif
    19581816
    19591817  for( i = 0; i < MAX_TLAYER; i ++ )
     
    19671825    cpbSizeValue = bitRate;                                     // 1 second
    19681826    ducpbSizeValue = bitRate/numDU;
    1969 #if L0363_DU_BIT_RATE
    19701827    duBitRateValue = bitRate;
    1971 #endif
    19721828    for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
    19731829    {
     
    19801836      hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
    19811837      hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
    1982 #if L0363_DU_BIT_RATE
    19831838      hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
    1984 #endif
    19851839      hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
    19861840    }
     
    25592413  , m_profileIdc      (0)
    25602414  , m_levelIdc        (0)
    2561 #if L0046_CONSTRAINT_FLAGS
    25622415, m_progressiveSourceFlag  (false)
    25632416, m_interlacedSourceFlag   (false)
    25642417, m_nonPackedConstraintFlag(false)
    25652418, m_frameOnlyConstraintFlag(false)
    2566 #endif
    25672419{
    25682420  ::memset(m_profileCompatibilityFlag, 0, sizeof(m_profileCompatibilityFlag));
     
    25952447  // Copy all information related to general profile
    25962448  this->getGeneralPTL()->copyProfileInfo(ptl->getGeneralPTL());
    2597 }
    2598 #endif
    2599 #if SIGNAL_BITRATE_PICRATE_IN_VPS
    2600 TComBitRatePicRateInfo::TComBitRatePicRateInfo()
    2601 {
    2602   ::memset(m_bitRateInfoPresentFlag, 0, sizeof(m_bitRateInfoPresentFlag));
    2603   ::memset(m_picRateInfoPresentFlag, 0, sizeof(m_picRateInfoPresentFlag));
    2604   ::memset(m_avgBitRate,             0, sizeof(m_avgBitRate));
    2605   ::memset(m_maxBitRate,             0, sizeof(m_maxBitRate));
    2606   ::memset(m_constantPicRateIdc,     0, sizeof(m_constantPicRateIdc));
    2607   ::memset(m_avgPicRate,             0, sizeof(m_avgPicRate));
    26082449}
    26092450#endif
Note: See TracChangeset for help on using the changeset viewer.