Ignore:
Timestamp:
3 Jun 2013, 20:08:00 (12 years ago)
Author:
seregin
Message:

initial multilayer reference implementation

Location:
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon
Files:
6 edited

Legend:

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

    r212 r253  
    17501750  // check BL mode
    17511751  UInt          uiCUAddrBase, uiAbsPartAddrBase;
    1752   TComDataCU*   pcTempCU = getBaseColCU( uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );
     1752  // the right reference layerIdc should be specified, currently it is set to 0
     1753  TComDataCU*   pcTempCU = getBaseColCU(0, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase );
    17531754
    17541755  if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA )
     1756  {
    17551757    return( NUM_INTRA_MODE-1 );
     1758  }
    17561759
    17571760  // compute set of enabled modes g_reducedSetIntraModes[...]
     
    41824185
    41834186#if SVC_COL_BLK
    4184 TComDataCU*  TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
     4187TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
    41854188{
    41864189#if 1 // it should provide identical resutls
     
    41884191  UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ];
    41894192
    4190   return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );
     4193  return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );
    41914194#else
    41924195  TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
     
    42374240}
    42384241
    4239 TComDataCU*  TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
    4240 {
    4241   TComPic* cBaseColPic = m_pcSlice->getBaseColPic();
     4242TComDataCU*  TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )
     4243{
     4244  TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc);
    42424245
    42434246#if !SIMPLIFIED_MV_POS_SCALING
     
    42694272  Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowLeftOffset();
    42704273  Int topStartL  = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowTopOffset();
    4271   Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[m_layerId][0] + (1<<15)) >> 16;
    4272   Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[m_layerId][1] + (1<<15)) >> 16;
     4274  Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
     4275  Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
    42734276#else
    4274   Int iBX = (uiPelX*g_posScalingFactor[m_layerId][0] + (1<<15)) >> 16;
    4275   Int iBY = (uiPelY*g_posScalingFactor[m_layerId][1] + (1<<15)) >> 16;
     4277  Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
     4278  Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
    42764279#endif
    42774280#else
     
    42954298  const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow();
    42964299
    4297   Int widthBL   = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
    4298   Int heightBL  = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
     4300  Int widthBL   = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
     4301  Int heightBL  = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
    42994302#endif
    43004303  if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture
  • branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComDataCU.h

    r212 r253  
    554554
    555555#if SVC_COL_BLK
    556   TComDataCU*   getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
    557   TComDataCU*   getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
     556  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
     557  TComDataCU*   getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );
    558558  Void          scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );
    559559#endif
  • branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComPic.cpp

    r191 r253  
    6767, m_pNDBFilterYuvTmp                      (NULL)
    6868, m_bCheckLTMSB                           (false)
     69{
    6970#if SVC_EXTENSION
    70 , m_bSpatialEnhLayer( false )
    71 , m_pcFullPelBaseRec( NULL )
    72 #endif
    73 {
     71  memset( m_pcFullPelBaseRec, NULL, sizeof( m_pcFullPelBaseRec ) );
     72  memset( m_bSpatialEnhLayer, false, sizeof( m_bSpatialEnhLayer ) );
     73#endif
    7474  m_apcPicYuv[0]      = NULL;
    7575  m_apcPicYuv[1]      = NULL;
     
    9191  m_apcPicYuv[1]  = new TComPicYuv;  m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
    9292
    93   if (m_bSpatialEnhLayer)
    94   {
    95     m_pcFullPelBaseRec = new TComPicYuv;  m_pcFullPelBaseRec->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     93  for( Int i = 0; i < MAX_LAYERS; i++ )
     94  {
     95    if( m_bSpatialEnhLayer[i] )
     96    {
     97      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps );
     98    }
    9699  }
    97100
     
    173176  deleteSEIs(m_SEIs);
    174177#if SVC_EXTENSION && SVC_UPSAMPLING
    175   if (m_bSpatialEnhLayer)
    176   {
    177     m_pcFullPelBaseRec->destroy();
    178     delete m_pcFullPelBaseRec;
    179     m_pcFullPelBaseRec  = NULL;
     178  for( Int i = 0; i < MAX_LAYERS; i++ )
     179  {
     180    if( m_bSpatialEnhLayer[i] )
     181    {
     182      m_pcFullPelBaseRec[i]->destroy();
     183      delete m_pcFullPelBaseRec[i];
     184      m_pcFullPelBaseRec[i]  = NULL;
     185    }
    180186  }
    181187#endif
     
    564570Void TComPic::copyUpsampledMvField(TComPic* pcPicBase)
    565571{
     572  UInt refLayerIdc = pcPicBase->getLayerId();
    566573#if AVC_SYNTAX && !ILP_DECODED_PICTURE
    567574  const Window &confBL = pcPicBase->getConformanceWindow();
     
    592599
    593600      TComDataCU *pcColCU = 0;
    594       pcColCU = pcCUDes->getBaseColCU(pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);
     601      pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);
    595602
    596603#if AVC_SYNTAX && !ILP_DECODED_PICTURE
  • branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComPic.h

    r191 r253  
    9292  SEIMessages  m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
    9393#if SVC_EXTENSION
    94   Bool                  m_bSpatialEnhLayer;       // whether current layer is a spatial enhancement layer,
    95   TComPicYuv*           m_pcFullPelBaseRec;    // upsampled base layer recontruction for difference domain inter prediction
     94  Bool                  m_bSpatialEnhLayer[MAX_LAYERS];       // whether current layer is a spatial enhancement layer,
     95  TComPicYuv*           m_pcFullPelBaseRec[MAX_LAYERS];    // upsampled base layer recontruction for difference domain inter prediction
    9696#endif
    9797
     
    114114  Void          setLayerId (UInt layerId) { m_layerId = layerId; }
    115115  UInt          getLayerId ()               { return m_layerId; }
    116   Bool          isSpatialEnhLayer()             { return m_bSpatialEnhLayer; }
    117   Void          setSpatialEnhLayerFlag (Bool b) { m_bSpatialEnhLayer = b; }
    118   Void          setFullPelBaseRec   ( TComPicYuv* p) { m_pcFullPelBaseRec = p; }
    119   TComPicYuv*   getFullPelBaseRec   ()  { return  m_pcFullPelBaseRec;  }
     116  Bool          isSpatialEnhLayer(UInt refLayerIdc)             { return m_bSpatialEnhLayer[refLayerIdc]; }
     117  Void          setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; }
     118  Void          setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; }
     119  TComPicYuv*   getFullPelBaseRec   (UInt refLayerIdc)  { return  m_pcFullPelBaseRec[refLayerIdc];  }
    120120#endif
    121121#if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM
  • branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.cpp

    r248 r253  
    9292#if SVC_EXTENSION
    9393, m_layerId                     ( 0 )
    94 , m_pcBaseColPic                  ( NULL )
    9594#endif
    9695, m_bTLayerSwitchingFlag          ( false )
     
    122121  m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0;
    123122#endif
    124  
     123
     124#if SVC_EXTENSION
     125  memset( m_pcBaseColPic, NULL, sizeof( m_pcBaseColPic ) );
    125126#if REF_IDX_FRAMEWORK
    126127#if JCTVC_M0458_INTERLAYER_RPS_SIG
     
    131132  m_numILRRefIdx = 0;
    132133#endif
     134#endif
    133135#endif
    134136
     
    518520
    519521#if REF_IDX_FRAMEWORK
    520   //inter-layer reference picture
     522  for( UInt i = 0; i < m_activeNumILRRefIdx; i++ )
     523  {
     524    UInt refLayerIdc = m_interLayerPredLayerIdc[i];
     525    //inter-layer reference picture
    521526#if REF_IDX_MFM
    522527
    523528#if ILR_RESTR
    524   Int maxSubLayerForILPPlus1 = (getLayerId() > 0 && m_activeNumILRRefIdx > 0)? getVPS()->getMaxSublayerForIlpPlus1(ilpPic[0]->getSlice(0)->getLayerId()) : 0;
     529    Int maxSubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0;
    525530#if ZERO_NUM_DIRECT_LAYERS
    526   if( getLayerId() > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[0]->getSlice(0)->getTLayer())<=  maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[0]->getSlice(0)->getRapPicFlag()) )  )
    527 #else
    528   if( getLayerId() && ( ( (Int)(ilpPic[0]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[0]->getSlice(0)->getRapPicFlag()) )  )
     531    if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=  maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
     532#else
     533    if( m_layerId > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )  )
    529534#endif
    530535
    531536#else
    532537#if ZERO_NUM_DIRECT_LAYERS
    533   if( m_layerId > 0 && m_activeNumILRRefIdx > 0 )
    534 #else
    535   if (getLayerId())
    536 #endif
    537 #endif
    538   {
    539     if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag())
    540     {
    541       ilpPic[0]->copyUpsampledMvField(getBaseColPic());
    542     }
    543     else
    544     {
    545       ilpPic[0]->initUpsampledMvField();
    546     }
    547   #endif
    548     ilpPic[0]->setIsLongTerm(1);
     538    if( m_layerId > 0 && m_activeNumILRRefIdx > 0 )
     539#else
     540    if( m_layerId > 0 )
     541#endif
     542#endif
     543    {
     544      if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && m_pcSPS->getMFMEnabledFlag())
     545      {
     546        ilpPic[refLayerIdc]->copyUpsampledMvField( m_pcBaseColPic[refLayerIdc] );
     547      }
     548      else
     549      {
     550        ilpPic[refLayerIdc]->initUpsampledMvField();
     551      }
     552#endif
     553      ilpPic[refLayerIdc]->setIsLongTerm(1);
     554    }
    549555  }
    550556#endif
     
    555561#if ILR_RESTR
    556562  Int numInterLayerRPSPics = 0;
    557   if (getLayerId()>0)
    558   {
    559     for (i=0; i < getVPS()->getNumDirectRefLayers(getLayerId()); i++)
    560     {
    561       maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());
     563  if( m_layerId > 0 )
     564  {
     565    for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ )
     566    {
     567      Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());
    562568      if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) )
    563569      {
     
    571577    }
    572578#if MAX_ONE_RESAMPLING_DIRECT_LAYERS
    573     if(getVPS()->getScalabilityMask(1))
     579    if( m_pcVPS->getScalabilityMask(1) )
    574580    {
    575581      Int numResampler = 0;
     
    583589      Int widthEL   = getPic()->getPicYuvRec()->getWidth();
    584590      Int heightEL  = getPic()->getPicYuvRec()->getHeight();     
    585       for (i=0; i < m_activeNumILRRefIdx; i++)
    586       {
    587         Int widthBL   =  ilpPic[getInterLayerPredLayerIdc(i)]->getSlice(0)->getBaseColPic()->getPicYuvRec()->getWidth();
    588         Int heightBL  =  ilpPic[getInterLayerPredLayerIdc(i)]->getSlice(0)->getBaseColPic()->getPicYuvRec()->getHeight();
     591      for( i=0; i < m_activeNumILRRefIdx; i++ )
     592      {
     593        UInt refLayerIdc = m_interLayerPredLayerIdc[i];
     594        Int widthBL   =  ilpPic[refLayerIdc]->getSlice(0)->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();
     595        Int heightBL  =  ilpPic[refLayerIdc]->getSlice(0)->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight();
    589596
    590597        if(!(widthEL == widthBL && heightEL == heightBL && (scalingOffset)))
     
    660667    }
    661668#if REF_IDX_FRAMEWORK
    662     if(getLayerId())
     669    if( m_layerId > 0 )
    663670    {
    664671#if JCTVC_M0458_INTERLAYER_RPS_SIG
     
    668675#endif
    669676      {
     677        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    670678#if ILR_RESTR
    671          maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());
    672         if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag()) )
    673 #endif
    674         rpsCurrList0[cIdx] = ilpPic[i];
     679         Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
     680        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     681#endif
     682        rpsCurrList0[cIdx] = ilpPic[refLayerIdc];
    675683      }
    676684    }
     
    692700    }
    693701#if REF_IDX_FRAMEWORK
    694     if(getLayerId())
     702    if( m_layerId > 0 )
    695703    {
    696704#if JCTVC_M0458_INTERLAYER_RPS_SIG
     
    700708#endif
    701709      {
     710        Int refLayerIdc = m_interLayerPredLayerIdc[i];
    702711#if ILR_RESTR
    703         maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());
    704         if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag()) )
    705 #endif
    706         rpsCurrList1[cIdx] = ilpPic[i];
     712        Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId());
     713        if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     714#endif
     715        rpsCurrList1[cIdx] = ilpPic[refLayerIdc];
    707716      }
    708717    }
     
    737746Void TComSlice::setRefPicListModificationSvc()
    738747{
    739   if( !this->getPPS()->getListsModificationPresentFlag())
     748  if( !m_pcPPS->getListsModificationPresentFlag())
    740749  {
    741750    return;
    742751  }
    743752
    744   if(this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA)
     753  if(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA)
    745754  {
    746755    return;
    747756  }
    748757
    749   TComRefPicListModification* refPicListModification = this->getRefPicListModification();
     758  TComRefPicListModification* refPicListModification = &m_RefPicListModification;
    750759  Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList();  // total number of ref pics in listTemp0 including inter-layer ref pics
    751760
     
    821830
    822831#if REF_IDX_FRAMEWORK
    823   if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() &&
    824     (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
    825     (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) )
     832  if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() &&
     833    (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
     834    (m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) ) )
    826835#else
    827836  if (m_eSliceType == I_SLICE)
     
    846855  }
    847856#if REF_IDX_FRAMEWORK
    848   if(getLayerId())
     857  if( m_layerId > 0 )
    849858  {
    850859#if JCTVC_M0458_INTERLAYER_RPS_SIG
     
    25932602#endif
    25942603
    2595 Void TComSlice::setBaseColPic(  TComList<TComPic*>& rcListPic, UInt layerID )
     2604Void TComSlice::setBaseColPic(  TComList<TComPic*>& rcListPic, UInt refLayerIdc )
    25962605
    2597   if (layerID == 0)
    2598   {
    2599     m_pcBaseColPic = NULL;
     2606  if(m_layerId == 0)
     2607  {
     2608    memset( m_pcBaseColPic, NULL, sizeof( m_pcBaseColPic ) );
    26002609    return;
    26012610  }       
    2602   setBaseColPic(xGetRefPic(rcListPic, getPOC()));
     2611  setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC()));
    26032612}
    26042613#endif
    26052614
    26062615#if REF_IDX_MFM
    2607 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL )
    2608 {
    2609   //set reference picture POC of each ILP reference
    2610   Int thePoc = ilpPic[0]->getPOC();
    2611   assert(thePoc >= 0);
    2612   assert(thePoc == pcRefPicBL->getPOC());
    2613 
    2614   ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL );
    2615 
    2616   //copy reference pictures marking from the reference layer
    2617   ilpPic[0]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0));
    2618  
    2619   for( Int refList = 0; refList < 2; refList++ )
    2620   {
    2621     RefPicList refPicList = RefPicList( refList );
    2622    
    2623     //set reference POC of ILP
    2624     ilpPic[0]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList));
    2625     assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) >= 0);
    2626     assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF);
    2627 
    2628     //initialize reference POC of ILP
    2629     for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++)
    2630     {
    2631       ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx);
    2632       ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx);
    2633     }
    2634 
    2635     for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++)
    2636     {
    2637       ilpPic[0]->getSlice(0)->setRefPOC(0, refPicList, refIdx);
    2638       ilpPic[0]->getSlice(0)->setRefPic(NULL, refPicList, refIdx);
     2616Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic** pcRefPicRL )
     2617{
     2618  for( UInt i = 0; i < m_activeNumILRRefIdx; i++ )
     2619  {
     2620    UInt refLayerIdc = m_interLayerPredLayerIdc[i];
     2621
     2622    TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc];
     2623    //set reference picture POC of each ILP reference
     2624    Int thePoc = ilpPic[refLayerIdc]->getPOC();
     2625    assert(thePoc >= 0);
     2626    assert(thePoc == pcRefPicBL->getPOC());
     2627
     2628    ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL );
     2629
     2630    //copy reference pictures marking from the reference layer
     2631    ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0));
     2632
     2633    for( Int refList = 0; refList < 2; refList++ )
     2634    {
     2635      RefPicList refPicList = RefPicList( refList );
     2636
     2637      //set reference POC of ILP
     2638      ilpPic[refLayerIdc]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList));
     2639      assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) >= 0);
     2640      assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF);
     2641
     2642      //initialize reference POC of ILP
     2643      for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++)
     2644      {
     2645        ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx);
     2646        ilpPic[refLayerIdc]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx);
     2647      }
     2648
     2649      for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++)
     2650      {
     2651        ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx);
     2652        ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx);
     2653      }
    26392654    }
    26402655  }
  • branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.h

    r216 r253  
    14941494#if SVC_EXTENSION
    14951495  UInt        m_layerId;
    1496   TComPic*    m_pcBaseColPic;
    1497   TComPicYuv* m_pcFullPelBaseRec;
     1496  TComPic*    m_pcBaseColPic[MAX_LAYERS];
     1497  TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];
    14981498#endif
    14991499  Bool        m_bTLayerSwitchingFlag;
     
    17761776
    17771777#if SVC_EXTENSION
    1778   Void      setBaseColPic       ( TComList<TComPic*>& rcListPic , UInt layerID );
    1779   Void      setBaseColPic       ( TComPic* p)     { m_pcBaseColPic = p; }
    1780   TComPic*  getBaseColPic       ()                { return m_pcBaseColPic; }
     1778  Void      setBaseColPic       ( TComList<TComPic*>& rcListPic , UInt refLayerIdc );
     1779  Void      setBaseColPic       (UInt refLayerIdc, TComPic* p)     { m_pcBaseColPic[refLayerIdc] = p; }
     1780  TComPic*  getBaseColPic       (UInt refLayerIdc)                { return m_pcBaseColPic[refLayerIdc]; }
     1781  TComPic** getBaseColPic       ()                { return &m_pcBaseColPic[0]; }
    17811782
    17821783  Void      setLayerId (UInt layerId)   { m_layerId = layerId; }
    17831784  UInt      getLayerId ()               { return m_layerId;    }
    17841785
    1785   Void        setFullPelBaseRec   ( TComPicYuv* p) { m_pcFullPelBaseRec = p; }
    1786   TComPicYuv* getFullPelBaseRec   ()               { return  m_pcFullPelBaseRec;  }
     1786  Void        setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; }
     1787  TComPicYuv* getFullPelBaseRec   (UInt refLayerIdc)               { return  m_pcFullPelBaseRec[refLayerIdc];  }
    17871788
    17881789#if AVC_SYNTAX
     
    17951796
    17961797#if REF_IDX_MFM
    1797   Void      setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL);
     1798  Void      setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL);
    17981799#endif
    17991800
     
    18141815#endif
    18151816#endif
     1817
     1818TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); }
    18161819
    18171820#endif //SVC_EXTENSION
Note: See TracChangeset for help on using the changeset viewer.