Changeset 1534 in SHVCSoftware


Ignore:
Timestamp:
22 Mar 2016, 19:58:32 (9 years ago)
Author:
seregin
Message:

integration of multi-view support from JCTVC-W0134

Location:
branches/SHM-dev/source
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp

    r1532 r1534  
    713713  Int*    cfg_auxId[MAX_LAYERS];
    714714#endif
     715#if VIEW_SCALABILITY
     716  Int*     cfg_viewOrderIndex         [MAX_LAYERS];
     717  Int*     cfg_viewId                 [MAX_LAYERS];
     718#endif
    715719
    716720  Int*    cfg_numSamplePredRefLayers  [MAX_LAYERS];
     
    889893    cfg_auxId[layer]                = &m_apcLayerCfg[layer]->m_auxId;
    890894#endif
     895#if VIEW_SCALABILITY
     896    cfg_viewOrderIndex[layer]       = &m_apcLayerCfg[layer]->m_viewOrderIndex;
     897    cfg_viewId[layer]               = &m_apcLayerCfg[layer]->m_viewId;
     898#endif
    891899    cfg_layerSwitchOffBegin[layer]  = &m_apcLayerCfg[layer]->m_layerSwitchOffBegin;
    892900    cfg_layerSwitchOffEnd[layer]    = &m_apcLayerCfg[layer]->m_layerSwitchOffEnd;
     
    10431051#if AUXILIARY_PICTURES
    10441052  ("AuxId%d",                                       cfg_auxId,                                 0, m_numLayers, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh")
     1053#endif
     1054#if VIEW_SCALABILITY
     1055  ("ViewOrderIndex%d",                              cfg_viewOrderIndex,                       -1, m_numLayers, "View Order Index per layer")
     1056  ("ViewId%d",                                      cfg_viewId,                               -1, m_numLayers, "View Id per View Order Index")
    10451057#endif
    10461058  ("ConformanceMode%d",                             cfg_conformanceMode,                       0, m_numLayers, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping")
     
    30213033  // check validity of input parameters
    30223034#if SVC_EXTENSION
     3035#if VIEW_SCALABILITY
     3036  if( m_scalabilityMask[VIEW_ORDER_INDEX] )
     3037  {
     3038
     3039    std::vector<Int> uniqueViewOrderIndices;
     3040    std::vector<Int> uniqueViewIds;
     3041    for( Int layer_idx = 0; layer_idx < m_numLayers; layer_idx++ )
     3042    {
     3043      Bool isIn = false;
     3044      for( Int uni = 0; uni < uniqueViewOrderIndices.size(); uni++ )
     3045      {
     3046        isIn = isIn || ( *(cfg_viewOrderIndex[ layer_idx ]) == uniqueViewOrderIndices[ uni ] );
     3047      }
     3048      if ( !isIn )
     3049      {
     3050        uniqueViewOrderIndices.push_back( *(cfg_viewOrderIndex[ layer_idx ]) );
     3051      }
     3052
     3053      isIn = false;
     3054      for( Int uni = 0; uni < uniqueViewIds.size(); uni++ )
     3055      {
     3056        isIn = isIn || ( *(cfg_viewId[ layer_idx ]) == uniqueViewIds[ uni ] );
     3057      }
     3058      if( !isIn )
     3059      {
     3060        uniqueViewIds.push_back( *(cfg_viewId[ layer_idx ]) );
     3061      }
     3062
     3063      assert(uniqueViewIds.size()==uniqueViewOrderIndices.size());
     3064
     3065      m_iNumberOfViews=uniqueViewIds.size();
     3066
     3067    }
     3068
     3069    m_ViewIdVal = uniqueViewIds;
     3070    m_iNumberOfViews = (Int)uniqueViewOrderIndices.size();
     3071  }
     3072#endif
     3073
    30233074  for( UInt layerIdx = 0; layerIdx < m_numLayers; layerIdx++ )
    30243075  {
     
    40784129  }
    40794130#endif
     4131#if VIEW_SCALABILITY
     4132  if (m_scalabilityMask[VIEW_ORDER_INDEX])
     4133  {   
     4134    xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewId < 0 , "ViewId must be greater than or equal to 0");
     4135    xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewOrderIndex < 0 , "ViewOrderIndex must be greater than or equal to 0");
     4136
     4137    if( layerIdx > 0 )
     4138    {
     4139      xConfirmPara(m_apcLayerCfg[layerIdx]->m_viewOrderIndex < m_apcLayerCfg[layerIdx-1]->m_viewOrderIndex, "ViewOrderIndex shall be increasing");
     4140    }
     4141
     4142  }
     4143#endif
    40804144#if CGS_3D_ASYMLUT
    40814145  xConfirmPara( m_nCGSFlag < 0 || m_nCGSFlag > 1 , "0<=CGS<=1" );
     
    42264290
    42274291#if SVC_EXTENSION
     4292#if VIEW_SCALABILITY
     4293  if( m_scalabilityMask[VIEW_ORDER_INDEX] )
     4294  {
     4295    printf("ViewOrderIndex                         : %d\n", m_apcLayerCfg[layer]->m_viewOrderIndex );
     4296    printf("ViewId                                 : %d\n", m_apcLayerCfg[layer]->m_viewId );
     4297  }
     4298#endif
    42284299      printf("PTL index                              : %d\n", m_apcLayerCfg[layerIdx]->m_layerPTLIdx );
    42294300    }
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h

    r1526 r1534  
    118118  Int       m_numLayers;                                      ///< number of layers
    119119  Int       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask
     120#if VIEW_SCALABILITY
     121  Int       m_iNumberOfViews;                                 ///< number of views
     122  std::vector<Int> m_ViewIdVal;
     123#endif 
    120124  Bool      m_maxTidRefPresentFlag;
    121125
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h

    r1526 r1534  
    5454  Int       m_auxId;
    5555#endif
     56#if VIEW_SCALABILITY
     57  Int       m_viewOrderIndex;
     58  Int       m_viewId;
     59#endif
    5660
    5761  Int       m_extraRPSs;                                     ///< extra RPSs added to handle CRA
     
    173177  Int*    getPredLayerIds() const              { return m_predLayerIds;             }
    174178  Int     getPredLayerIdx(Int i) const         { return m_predLayerIds[i];          }
     179#if VIEW_SCALABILITY
     180  Int     getViewOrderIndex()                  { return m_viewOrderIndex;       }
     181  Int     getViewId()                          { return m_viewId;               }
     182#endif
    175183
    176184  Int     getRepFormatIdx() const              { return m_repFormatIdx;         }
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1526 r1534  
    468468    m_cTEncTop.setBottomRightTileIndex                              ( m_bottomRightTileIndex );
    469469    m_cTEncTop.setIlcIdc                                            ( m_ilcIdc );
     470#endif
     471#if VIEW_SCALABILITY
     472    m_cTEncTop.setUseDisparitySearchRangeRestriction                ( m_scalabilityMask[VIEW_ORDER_INDEX] );
    470473#endif
    471474
     
    971974
    972975  UInt i = 0, dimIdLen = 0;
     976#if VIEW_SCALABILITY
     977  Int curDimId=0;
     978
     979  if( m_scalabilityMask[VIEW_ORDER_INDEX] )
     980  {
     981    UInt maxViewOrderIndex = 0,maxViewId=0;
     982    UInt voiLen = 1,vidLen=1;
     983
     984    for( i = 0; i < vps->getMaxLayers(); i++ )
     985    {
     986      if( m_apcLayerCfg[i]->getViewOrderIndex() > maxViewOrderIndex )
     987      {
     988        maxViewOrderIndex = m_apcLayerCfg[i]->getViewOrderIndex();
     989      }
     990
     991      if( m_apcLayerCfg[i]->getViewId() > maxViewId )
     992      {
     993        maxViewId = m_apcLayerCfg[i]->getViewId();
     994      }
     995
     996    }
     997    while((1 << voiLen) < (maxViewOrderIndex + 1))
     998    {
     999      voiLen++;
     1000    }
     1001
     1002    while((1 << vidLen) < (maxViewId + 1))
     1003    {
     1004      vidLen++;
     1005    }
     1006
     1007    vps->setDimensionIdLen(0, voiLen);
     1008    vps->setViewIdLen(vidLen);
     1009
     1010    for( i = 0; i < vps->getMaxLayers(); i++ )
     1011    {
     1012      vps->setDimensionId(i, 0, m_apcLayerCfg[i]->getViewOrderIndex());         
     1013    }
     1014
     1015    for( i = 0; i < m_iNumberOfViews; i++ )
     1016    {
     1017      vps->setViewIdVal(i, m_ViewIdVal[i]);
     1018    }
     1019
     1020    curDimId++;
     1021  }
     1022#endif
    9731023
    9741024  while((1 << dimIdLen) < m_numLayers)
     
    9761026    dimIdLen++;
    9771027  }
     1028#if VIEW_SCALABILITY
     1029  vps->setDimensionIdLen(curDimId, dimIdLen);
     1030#else
    9781031  vps->setDimensionIdLen(0, dimIdLen);
     1032#endif
    9791033  vps->setNuhLayerIdPresentFlag(false);
    9801034  vps->setLayerIdInNuh(0, 0);
     
    9841038    vps->setLayerIdInNuh(i, m_apcLayerCfg[i]->m_layerId);   
    9851039    vps->setLayerIdxInVps(vps->getLayerIdInNuh(i), i);
     1040#if VIEW_SCALABILITY
     1041    vps->setDimensionId(i, curDimId, i);
     1042#else
    9861043    vps->setDimensionId(i, 0, i);
    987 
     1044#endif
    9881045    if( m_apcLayerCfg[i]->m_layerId != i )
    9891046    {
     
    10931150      scalabilityTypes += m_scalabilityMask[i];
    10941151    }
     1152#if VIEW_SCALABILITY
     1153    assert( scalabilityTypes <= 3 );
     1154#else
    10951155#if AUXILIARY_PICTURES
    10961156    assert( scalabilityTypes <= 2 );
    10971157#else
    10981158    assert( scalabilityTypes == 1 );
     1159#endif
    10991160#endif
    11001161    vps->setNumScalabilityTypes(scalabilityTypes);
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp

    r1502 r1534  
    33173317
    33183318#if REF_IDX_ME_ZEROMV
    3319 Bool TComDataCU::xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
     3319Bool TComDataCU::checkZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1)
    33203320{
    33213321  Bool checkZeroMVILR = true;
    33223322
    3323   if(uhInterDir&0x1)  //list0
    3324   {
    3325     Int refIdxL0 = cMvFieldL0.getRefIdx();
    3326     TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_0, refIdxL0);
    3327 
    3328     if(refPic->isILR(m_pcPic->getLayerId()))
    3329     {
    3330       checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);
    3331 
    3332       // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture,
    3333       // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture
    3334       checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() );
    3335     }
    3336   }
    3337   if(uhInterDir&0x2)  //list1
    3338   {
    3339     Int refIdxL1  = cMvFieldL1.getRefIdx();
    3340     TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_1, refIdxL1);
    3341 
    3342     if(refPic->isILR(m_pcPic->getLayerId()))
    3343     {
    3344       checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);
    3345 
    3346       // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture,
    3347       // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture
    3348       checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() );
     3323  if( m_pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer
     3324  {
     3325    if( uhInterDir & 0x1 )  //list0
     3326    {
     3327      Int refIdxL0 = cMvFieldL0.getRefIdx();
     3328      TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_0, refIdxL0);
     3329
     3330      if(refPic->isILR(m_pcPic->getLayerId()))
     3331      {
     3332        checkZeroMVILR &= (cMvFieldL0.getHor() == 0 && cMvFieldL0.getVer() == 0);
     3333
     3334        // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture,
     3335        // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture
     3336        checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() );
     3337      }
     3338    }
     3339
     3340    if( uhInterDir & 0x2 )  //list1
     3341    {
     3342      Int refIdxL1  = cMvFieldL1.getRefIdx();
     3343      TComPic* refPic = m_pcSlice->getRefPic(REF_PIC_LIST_1, refIdxL1);
     3344
     3345      if(refPic->isILR(m_pcPic->getLayerId()))
     3346      {
     3347        checkZeroMVILR &= (cMvFieldL1.getHor() == 0 && cMvFieldL1.getVer() == 0);
     3348
     3349        // It is a requirement of bitstream conformance that when the reference picture represented by the variable refIdxLX is an inter-layer reference picture,
     3350        // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture
     3351        checkZeroMVILR &= m_pcSlice->getVPS()->isSamplePredictionType( m_pcPic->getLayerIdx(), refPic->getLayerIdx() );
     3352      }
    33493353    }
    33503354  }
     
    33533357}
    33543358
    3355 Bool TComDataCU::xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)
    3356 {
    3357   RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;
    3358   assert(eRefPicList == REF_PIC_LIST_1);
    3359 
     3359Bool TComDataCU::checkZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx)
     3360{
    33603361  Bool checkZeroMVILR = true;
    33613362
    3362   if(getSlice()->getRefPic(eRefPicList, iRefIdx)->isILR(m_pcPic->getLayerId()))
    3363   {
    3364     AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();
    3365     TComMv    cMv        = pcAMVPInfo->m_acMvCand[MvpIdx];
    3366     checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);
     3363  if( m_pcSlice->getVPS()->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer
     3364  {
     3365    RefPicList eRefPicList = iRefList > 0? REF_PIC_LIST_1: REF_PIC_LIST_0;
     3366    assert(eRefPicList == REF_PIC_LIST_1);
     3367
     3368    if( m_pcSlice->getRefPic(eRefPicList, iRefIdx)->isILR(m_pcPic->getLayerId()) )
     3369    {
     3370      AMVPInfo* pcAMVPInfo = getCUMvField(eRefPicList)->getAMVPInfo();
     3371      TComMv    cMv        = pcAMVPInfo->m_acMvCand[MvpIdx];
     3372      checkZeroMVILR &= (cMv.getHor() == 0 && cMv.getVer() == 0);
     3373    }
    33673374  }
    33683375
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h

    r1483 r1534  
    487487#endif
    488488#if REF_IDX_ME_ZEROMV
    489   Bool          xCheckZeroMVILRMerge          ( UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1);
    490   Bool          xCheckZeroMVILRMvdL1Zero      ( Int iRefList, Int iRefIdx, Int MvpIdx);
     489  Bool          checkZeroMVILRMerge           ( UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1);
     490  Bool          checkZeroMVILRMvdL1Zero       ( Int iRefList, Int iRefIdx, Int MvpIdx);
    491491#endif
    492492  TComDataCU*   getBaseColCU                  ( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int** posScalingFactor, Bool motionMapping = false );
  • branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r1502 r1534  
    585585      // VpsInterLayerSamplePredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture
    586586      assert( pcCU->getSlice()->getVPS()->isSamplePredictionType( pcCU->getPic()->getLayerIdx(), refPic->getLayerIdx() ) );
    587 
     587#if VIEW_SCALABILITY
     588      if( pcCU->getSlice()->getSPS()->getInterViewMvVertConstraintFlag() )
     589      {
     590        assert( cMv.getVer()<= (56<<2) );
     591      }
     592#endif
    588593#if REF_IDX_ME_ZEROMV
    589594      // It is a requirement of bitstream conformance that the variables mvLX[ 0 ] and mvLX[ 1 ] shall be equal to 0 if the value of refIdxLX corresponds to an inter-layer reference picture.
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1525 r1534  
    567567
    568568#if SVC_EXTENSION
     569#if VIEW_SCALABILITY
     570  std::vector<TComPic*> refPicSetInterLayer0;
     571  std::vector<TComPic*> refPicSetInterLayer1;
     572  const TComVPS* cVPS=getVPS();
     573
     574  Int viewIdCurrLayerId  = cVPS->getViewIdVal(cVPS->getViewIndex(m_layerId) );
     575  Int viewId0            = cVPS->getViewIdVal( 0 );
     576  for( i=0; i< m_activeNumILRRefIdx ;i++)
     577  {
     578      Int refLayerIdc = m_interLayerPredLayerIdc[i];       
     579      Int maxTidIlRefPicsPlus1 = getVPS()->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx());
     580      if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     581      {
     582          Int viewIdRefPicLayerIdi = cVPS->getViewIdVal( ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx() );
     583          Bool refPicSet0Flag =
     584              ( ( viewIdCurrLayerId <=  viewId0  &&  viewIdCurrLayerId <=  viewIdRefPicLayerIdi )  ||
     585              ( viewIdCurrLayerId >=  viewId0  &&  viewIdCurrLayerId >=  viewIdRefPicLayerIdi ) );
     586
     587          if ( refPicSet0Flag )
     588          {
     589              refPicSetInterLayer0.push_back( ilpPic[refLayerIdc] );
     590          }
     591          else
     592          {
     593              refPicSetInterLayer1.push_back( ilpPic[refLayerIdc] );
     594          }
     595
     596      }
     597  }
     598 
     599
     600  if( m_layerId > 0 )
     601  {
     602      for( i = 0; i < refPicSetInterLayer0.size() && cIdx < numPicTotalCurr; cIdx ++, i ++)     
     603      {
     604          rpsCurrList0[cIdx] = refPicSetInterLayer0[i];
     605      }
     606  }
     607#else
    569608    // initial reference picture list construction
    570609    if( m_layerId > 0 )
     
    584623      }
    585624    }
     625#endif
    586626#endif //SVC_EXTENSION
    587627
     
    594634    rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
    595635  }
     636#if VIEW_SCALABILITY
     637  if( m_layerId > 0 )
     638  {
     639      for( i = 0; i < refPicSetInterLayer1.size(); cIdx++, i++ )     
     640      {
     641          rpsCurrList0[cIdx] = refPicSetInterLayer1[i];
     642      }
     643  }
     644#else
    596645  assert(cIdx == numPicTotalCurr);
     646#endif
    597647
    598648  if (m_eSliceType==B_SLICE)
     
    603653      rpsCurrList1[cIdx] = RefPicSetStCurr1[i];
    604654    }
     655#if VIEW_SCALABILITY
     656    if( m_layerId > 0 )
     657    {
     658        for( i = 0; i < refPicSetInterLayer1.size(); cIdx ++, i ++)     
     659        {
     660            rpsCurrList1[cIdx] = refPicSetInterLayer1[i];
     661        }
     662    }
     663#endif
    605664    for ( i=0; i<NumPicStCurr0; i++, cIdx++)
    606665    {
     
    612671    }   
    613672
     673#if VIEW_SCALABILITY
     674    if( m_layerId > 0 )
     675    {
     676      for( i = 0; i < refPicSetInterLayer0.size(); cIdx ++, i ++)
     677      {
     678        rpsCurrList1[cIdx] = refPicSetInterLayer0[i];
     679      }
     680    }
     681#else
    614682#if SVC_EXTENSION
    615683    if( m_layerId > 0 )
     
    630698    }
    631699#endif //SVC_EXTENSION
    632 
    633700    assert(cIdx == numPicTotalCurr);
     701#endif
    634702  }
    635703
     
    643711
    644712#if SVC_EXTENSION
     713#if VIEW_SCALABILITY
     714    m_bIsUsedAsLongTerm[REF_PIC_LIST_0][rIdx] = (cIdx<NumPicStCurr0 || (cIdx>=NumPicStCurr0+refPicSetInterLayer0.size() && cIdx<NumPicStCurr0+refPicSetInterLayer0.size()+NumPicStCurr1)) ? false : true;
     715#else
    645716    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPicStCurr0 && cIdx < NumPicStCurr0 + m_activeNumILRRefIdx ) || ( cIdx >= NumPicStCurr0 + NumPicStCurr1 + m_activeNumILRRefIdx );
     717#endif
    646718#else
    647719    m_bIsUsedAsLongTerm[REF_PIC_LIST_0][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
     
    660732      assert(cIdx >= 0 && cIdx < numPicTotalCurr);
    661733      m_apcRefPicList[REF_PIC_LIST_1][rIdx] = rpsCurrList1[ cIdx ];
     734#if VIEW_SCALABILITY
     735      m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = (cIdx<NumPicStCurr1 || (cIdx>=NumPicStCurr1+refPicSetInterLayer1.size() && cIdx<NumPicStCurr1+refPicSetInterLayer1.size()+NumPicStCurr0)) ? false : true;
     736#else
    662737      m_bIsUsedAsLongTerm[REF_PIC_LIST_1][rIdx] = ( cIdx >= NumPicStCurr0 + NumPicStCurr1 );
     738#endif
    663739    }
    664740  }
     
    699775  return numRpsCurrTempList;
    700776}
     777
     778#if VIEW_SCALABILITY
     779Int TComSlice::getNumRpsInterLayerX(Int li, TComPic** ilpPic)
     780{
     781  assert(li==0 || li==1);
     782
     783  Int viewIdCurrLayerId  = m_pcVPS->getViewIdVal(m_pcVPS->getViewIndex(m_layerId) );
     784  Int viewId0            = m_pcVPS->getViewIdVal( 0 );
     785  Int numInterLayer0 = 0;
     786  Int numInterLayer1 = 0;
     787
     788  for( Int i=0; i < m_activeNumILRRefIdx; i++ )
     789  {
     790    Int refLayerIdc = m_interLayerPredLayerIdc[i];       
     791    Int maxTidIlRefPicsPlus1 = m_pcVPS->getMaxTidIlRefPicsPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx(), getLayerIdx());
     792
     793    if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxTidIlRefPicsPlus1-1) || (maxTidIlRefPicsPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) )
     794    {
     795      Int viewIdRefPicLayerIdi = m_pcVPS->getViewIdVal( ilpPic[refLayerIdc]->getSlice(0)->getLayerIdx() );
     796      Bool refPicSet0Flag = ( ( viewIdCurrLayerId <= viewId0 && viewIdCurrLayerId <= viewIdRefPicLayerIdi ) || ( viewIdCurrLayerId >= viewId0 && viewIdCurrLayerId >= viewIdRefPicLayerIdi ) );
     797
     798      if( refPicSet0Flag )
     799      {
     800        numInterLayer0++;
     801      }
     802      else
     803      {
     804        numInterLayer1++;
     805      }
     806    }
     807  }
     808
     809  if( li==0 )
     810  {
     811    return numInterLayer0;
     812  }
     813  else
     814  {
     815    return numInterLayer1;
     816  }
     817}
     818#endif
    701819
    702820Void TComSlice::initEqualRef()
     
    34773595}
    34783596
     3597#if VIEW_SCALABILITY
     3598Void TComSlice::setRefPicListModificationSvc( TComPic** ilpPic )
     3599#else
    34793600Void TComSlice::setRefPicListModificationSvc()
     3601#endif
    34803602{
    34813603  if( !m_pcPPS->getListsModificationPresentFlag())
     
    34913613  TComRefPicListModification* refPicListModification = &m_RefPicListModification;
    34923614  Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList();  // total number of ref pics in listTemp0 including inter-layer ref pics
    3493 #if SVC_EXTENSION
    3494   Int numberOfPocBeforeCurr = this->getNumNegativeRpsCurrTempList();  // number of negative temporal ref pics
    3495 #endif
     3615  Int numberOfPocBeforeCurr = getNumNegativeRpsCurrTempList();  // number of negative temporal ref pics
    34963616
    34973617  assert(m_aiNumRefIdx[REF_PIC_LIST_0] > 0);
     
    34993619
    35003620  //set L0 inter-layer reference picture modification
    3501 #if SVC_EXTENSION
    3502   Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true;
    3503 
    3504   if( m_activeNumILRRefIdx > 1 )
    3505   {
    3506     hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] >= (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true;
    3507   }
    3508 #else
    3509   Bool hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == numberOfRpsCurrTempList) ? false : true;
    3510 #endif
     3621#if VIEW_SCALABILITY
     3622  Int numberOfPocAfterCurr = 0;
     3623  Int numberOfInterLayer0 = 0;
     3624  Int numberOfInterLayer1 = 0;
     3625#endif
     3626
     3627  Bool hasModification = false;
     3628
     3629  if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer
     3630  {
     3631    hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] == (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true;
     3632
     3633    if( m_activeNumILRRefIdx > 1 )
     3634    {
     3635      hasModification = (m_aiNumRefIdx[REF_PIC_LIST_0] >= (numberOfPocBeforeCurr + m_activeNumILRRefIdx)) ? false : true;
     3636    }
     3637  }
     3638#if VIEW_SCALABILITY
     3639  else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view
     3640  {
     3641    numberOfPocAfterCurr = getNumfPositiveRpsCurrTempList();
     3642    numberOfInterLayer0 = getNumRpsInterLayerX(0, ilpPic);
     3643    numberOfInterLayer1 = getNumRpsInterLayerX(1, ilpPic);
     3644
     3645    if( (numberOfInterLayer1 > 0 && m_aiNumRefIdx[REF_PIC_LIST_0] < numberOfRpsCurrTempList) || (numberOfInterLayer1 == 0 && m_aiNumRefIdx[REF_PIC_LIST_0] < numberOfPocBeforeCurr + numberOfInterLayer0 ) )
     3646    {
     3647      hasModification = true;
     3648    }
     3649    else
     3650    {
     3651      hasModification = false;
     3652    }
     3653  } 
     3654#endif
     3655
    35113656  hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_0] > 1 );
    35123657  refPicListModification->setRefPicListModificationFlagL0(hasModification);
     
    35263671      }
    35273672    }
    3528     else
     3673    else if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer
    35293674    {
    35303675      // number of ILRPs included into the reference picture list with the list modification
     
    35333678      for(Int i = includeNumILRP; i > 0; i-- )
    35343679      {
    3535 #if SVC_EXTENSION
    35363680        if( numberOfPocBeforeCurr >= m_aiNumRefIdx[REF_PIC_LIST_0] )
    35373681        {
     
    35473691          }
    35483692        }
    3549 #else
    3550         refPicListModification->setRefPicSetIdxL0(m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i);
    3551 #endif
    3552       }
    3553     }
     3693      }
     3694    }
     3695#if VIEW_SCALABILITY
     3696    else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view
     3697    {
     3698      Int includeNumILRP = m_activeNumILRRefIdx;
     3699      Int iNumILRP = includeNumILRP;
     3700
     3701      if( numberOfInterLayer1 > 0 )
     3702      {
     3703        if( m_aiNumRefIdx[REF_PIC_LIST_0] < numberOfPocBeforeCurr + m_activeNumILRRefIdx )
     3704        {
     3705          for( Int i = 0; i < numberOfInterLayer0 && iNumILRP > 0; i++, iNumILRP-- )
     3706          {
     3707            refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - includeNumILRP + i, numberOfPocBeforeCurr + i );
     3708          }
     3709
     3710          for( Int i = 0; i < numberOfInterLayer1 && iNumILRP > 0; i++, iNumILRP-- )
     3711          {
     3712            refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - includeNumILRP +numberOfInterLayer0+ i, numberOfRpsCurrTempList-  numberOfInterLayer1 + i );
     3713          }
     3714        }
     3715        else
     3716        {
     3717          iNumILRP -= numberOfInterLayer0;
     3718
     3719          for( Int i = numberOfInterLayer1; i >0 && iNumILRP > 0; i--, iNumILRP-- )
     3720          {
     3721            refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfRpsCurrTempList - i );
     3722          }
     3723        }
     3724      }
     3725      else
     3726      {
     3727        for( Int i = numberOfInterLayer0; i >0 && iNumILRP >0 ; i--, iNumILRP-- )
     3728        {
     3729          refPicListModification->setRefPicSetIdxL0( m_aiNumRefIdx[REF_PIC_LIST_0] - i, numberOfPocBeforeCurr + numberOfInterLayer0 - i );
     3730        }
     3731      }
     3732    }
     3733#endif
    35543734  }
    35553735
    35563736  //set L1 inter-layer reference picture modification
    3557   hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] >= numberOfRpsCurrTempList) ? false : true;
     3737  if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer
     3738  {
     3739    hasModification = (m_aiNumRefIdx[REF_PIC_LIST_1] >= numberOfRpsCurrTempList) ? false : true;
     3740  }
     3741#if VIEW_SCALABILITY
     3742  else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view
     3743  {
     3744    if( (numberOfInterLayer0 > 0 && m_aiNumRefIdx[REF_PIC_LIST_1] < numberOfRpsCurrTempList) || (numberOfInterLayer0 == 0 && m_aiNumRefIdx[REF_PIC_LIST_1] < numberOfPocAfterCurr + numberOfInterLayer1) )
     3745    {
     3746      hasModification = true;
     3747    }
     3748    else
     3749    {
     3750      hasModification = false;
     3751    }
     3752  }
     3753#endif
    35583754  hasModification = hasModification && ( m_aiNumRefIdx[REF_PIC_LIST_1] > 1 );
    35593755
     
    35733769      }
    35743770    }
    3575     else
     3771    else if( m_pcVPS->getScalabilityMask( SCALABILITY_ID ) ) //scalable layer
    35763772    {
    35773773      Int includeNumILRP = min(m_aiNumRefIdx[REF_PIC_LIST_1], m_activeNumILRRefIdx);
     
    35823778      }
    35833779    }
     3780#if VIEW_SCALABILITY
     3781    else if( m_pcVPS->getScalabilityMask( VIEW_ORDER_INDEX ) ) //multi-view
     3782    {
     3783      Int includeNumILRP = m_activeNumILRRefIdx;
     3784      Int iNumILRP=includeNumILRP;
     3785
     3786      if( numberOfInterLayer0 > 0 )
     3787      {
     3788        if( m_aiNumRefIdx[REF_PIC_LIST_1] < numberOfPocAfterCurr + m_activeNumILRRefIdx )
     3789        {
     3790          for( Int i = 0; i < numberOfInterLayer1 && iNumILRP>0; i++,iNumILRP-- )
     3791          {
     3792            refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - includeNumILRP + i, numberOfPocAfterCurr + i);
     3793          }
     3794
     3795          for(Int i = 0; i < numberOfInterLayer0 && iNumILRP>0; i++,iNumILRP-- )
     3796          {
     3797            refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - includeNumILRP +numberOfInterLayer1+ i, numberOfRpsCurrTempList-numberOfInterLayer0+i);
     3798          }
     3799        }
     3800        else
     3801        {
     3802          iNumILRP -= numberOfInterLayer1;
     3803          for( Int i = numberOfInterLayer0; i > 0 && iNumILRP > 0; i--,iNumILRP-- )
     3804          {
     3805            refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfRpsCurrTempList - i);
     3806          }
     3807        }
     3808      }
     3809      else
     3810      {
     3811        for( Int i = numberOfInterLayer1; i >0 && iNumILRP>0; i--, iNumILRP-- )
     3812        {
     3813          refPicListModification->setRefPicSetIdxL1(m_aiNumRefIdx[REF_PIC_LIST_1] - i, numberOfPocAfterCurr + numberOfInterLayer1 - i);
     3814        }
     3815      }
     3816    }
     3817#endif
    35843818  }
    35853819  return;
     
    36383872  }
    36393873}
     3874
     3875#if VIEW_SCALABILITY
     3876Int TComSlice::getNumfPositiveRpsCurrTempList()
     3877{
     3878  if( m_eSliceType == I_SLICE )
     3879  {
     3880    return 0;
     3881  }
     3882
     3883  Int numPocAfterCurr = 0;
     3884
     3885  for( UInt i = 0; i < m_pRPS->getNumberOfPositivePictures(); i++ )
     3886  {
     3887    if( m_pRPS->getUsed(i) )
     3888    {
     3889      numPocAfterCurr++;
     3890    }
     3891  }
     3892
     3893  return numPocAfterCurr;
     3894}
     3895#endif
     3896
    36403897#endif //SVC_EXTENSION
    36413898
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1502 r1534  
    14431443  Bool             m_inferScalingListFlag;
    14441444  UInt             m_scalingListRefLayerId;
     1445#if VIEW_SCALABILITY
     1446  Bool             m_interViewMvVertConstraintFlag;
     1447#endif
    14451448#endif //SVC_EXTENSION
    14461449
     
    15991602
    16001603  Void                   inferSPS( const UInt layerId, TComVPS* vps );
     1604
     1605#if VIEW_SCALABILITY
     1606  Void                   setInterViewMvVertConstraintFlag( Bool val )                                    { m_interViewMvVertConstraintFlag = val;                               }
     1607  Bool                   getInterViewMvVertConstraintFlag() const                                        { return m_interViewMvVertConstraintFlag;                              }
     1608#endif
    16011609#endif //SVC_EXTENSION
    16021610};
     
    23512359  Void                        setFullPelBaseRec( UInt refLayerIdc, TComPicYuv* p)    { m_pcFullPelBaseRec[refLayerIdc] = p;                          }
    23522360  TComPicYuv*                 getFullPelBaseRec( UInt refLayerIdc)                   { return  m_pcFullPelBaseRec[refLayerIdc];                      }
    2353 
     2361#if VIEW_SCALABILITY
     2362  Int                         getNumRpsInterLayerX( Int li, TComPic** ilpPic );
     2363  Void                        setRefPicListModificationSvc( TComPic** ilpPic );
     2364  Int                         getNumfPositiveRpsCurrTempList();
     2365#else
    23542366  Void                        setRefPicListModificationSvc();
     2367#endif
    23552368  Int                         getNumILRRefIdx()                                      { return  m_pcVPS->getNumDirectRefLayers( m_layerId );          }
    23562369
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1531 r1534  
    7272#define NO_CLRAS_OUTPUT_FLAG             1
    7373
     74#define VIEW_SCALABILITY                 0      ///< JCTVC-W0134: multi-view support
     75
    7476/// scalability types
    7577enum ScalabilityType
     
    8789
    8890/// normative encoder constraints --------
    89 #define REF_IDX_ME_ZEROMV                1      ///< JCTVC-L0051: use zero motion for inter-layer reference picture (without fractional ME)
    90 
     91#define REF_IDX_ME_ZEROMV                1      ///< JCTVC-L0051: use zero motion for inter-layer reference picture for scalable layer (without fractional ME)
    9192/// encoder settings ---------------------
    9293#define FAST_INTRA_SHVC                  1      ///< JCTVC-M0115: reduction number of intra modes in the EL (encoder only)
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1533 r1534  
    21862186    READ_CODE(32, uiCode, "reserved_zero_34bits");  READ_CODE(2, uiCode, "reserved_zero_34bits");
    21872187  }
     2188#if VIEW_SCALABILITY
     2189  else if( ptl->getProfileIdc() == Profile::MULTIVIEWMAIN )
     2190  {
     2191    READ_FLAG(    uiCode, "general_max_12bit_constraint_flag" ); assert (uiCode == 1);
     2192    READ_FLAG(    uiCode, "general_max_10bit_constraint_flag" ); assert (uiCode == 1);
     2193    READ_FLAG(    uiCode, "general_max_8bit_constraint_flag"  ); assert (uiCode == 1);
     2194    READ_FLAG(    uiCode, "general_max_422chroma_constraint_flag"  ); assert (uiCode == 1);
     2195    READ_FLAG(    uiCode, "general_max_420chroma_constraint_flag"  ); assert (uiCode == 1);
     2196    READ_FLAG(    uiCode, "general_max_monochrome_constraint_flag" ); assert (uiCode == 0);
     2197    READ_FLAG(    uiCode, "general_intra_constraint_flag"); assert (uiCode == 0);
     2198    READ_FLAG(    uiCode, "general_one_picture_only_constraint_flag"); assert (uiCode == 0);
     2199    READ_FLAG(    uiCode, "general_lower_bit_rate_constraint_flag"); assert (uiCode == 1);
     2200    READ_CODE(32, uiCode, "general_reserved_zero_34bits");  READ_CODE(2, uiCode, "general_reserved_zero_34bits");
     2201  }
     2202#endif
    21882203  else
    21892204  {
     
    35563571
    35573572  READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );
     3573 
     3574#if VIEW_SCALABILITY
     3575  pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
     3576#else
     3577  // Vertical MV component restriction is not used in SHVC CTC
     3578  assert( uiCode == 0 );
     3579#endif
    35583580}
    35593581
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1531 r1534  
    839839  // set motion mapping flag
    840840  m_apcSlicePilot->setMFMEnabledFlag( ( m_apcSlicePilot->getNumMotionPredRefLayers() > 0 && m_apcSlicePilot->getActiveNumILRRefIdx() && !m_apcSlicePilot->isIntra() ) ? true : false );
     841
     842#if VIEW_SCALABILITY
     843  if( vps->getViewIndex(nalu.m_nuhLayerId) == 1 && sps->getPTL()->getGeneralPTL()->getProfileIdc() == Profile::MULTIVIEWMAIN )
     844  {
     845    assert( sps->getInterViewMvVertConstraintFlag() == 1 );
     846  }
     847#endif
    841848#endif
    842849
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1533 r1534  
    14451445    WRITE_CODE(0, 32,  "general_reserved_zero_34bits");  WRITE_CODE(0, 2,  "general_reserved_zero_34bits");
    14461446  }
     1447#if VIEW_SCALABILITY
     1448  else if( ptl->getProfileIdc() == Profile::MULTIVIEWMAIN )
     1449  {
     1450    WRITE_FLAG(true,   "general_max_12bit_constraint_flag");
     1451    WRITE_FLAG(true,   "general_max_10bit_constraint_flag");
     1452    WRITE_FLAG(true,   "general_max_8bit_constraint_flag");
     1453    WRITE_FLAG(true,   "general_max_422chroma_constraint_flag");
     1454    WRITE_FLAG(true,   "general_max_420chroma_constraint_flag");
     1455    WRITE_FLAG(false,  "general_max_monochrome_constraint_flag");
     1456    WRITE_FLAG(false,  "general_intra_constraint_flag");
     1457    WRITE_FLAG(false,  "general_one_picture_only_constraint_flag");
     1458    WRITE_FLAG(true,   "general_lower_bit_rate_constraint_flag");
     1459    WRITE_CODE(0, 32,  "general_reserved_zero_34bits");  WRITE_CODE(0, 2,  "general_reserved_zero_34bits");
     1460  }
     1461#endif
    14471462  else
    14481463  {
     
    19942009
    19952010  WRITE_CODE( vps->getViewIdLen( ), 4, "view_id_len" );
     2011#if !VIEW_SCALABILITY
    19962012  assert ( vps->getNumViews() >= (1<<vps->getViewIdLen()) );
     2013#endif
    19972014
    19982015  if ( vps->getViewIdLen() > 0 )
     
    24602477
    24612478  // Vertical MV component restriction is not used in SHVC CTC
     2479#if VIEW_SCALABILITY
     2480  WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0 , "inter_view_mv_vert_constraint_flag" );
     2481#else
    24622482  WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
     2483#endif
    24632484}
    24642485
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1475 r1534  
    399399
    400400#if SVC_EXTENSION
    401   UInt      m_layerId;   
     401  UInt      m_layerId;
    402402  UInt      m_numLayer;
    403403  Bool      m_elRapSliceBEnabled;
     
    483483  Int                                 m_TMVPConstraintsSEIEnabled;
    484484#endif
     485
     486#if VIEW_SCALABILITY
     487  Bool                                m_bUseDisparitySearchRangeRestriction;
     488#endif
    485489#endif //SVC_EXTENSION
    486490
     
    12531257#endif
    12541258#endif
     1259#if VIEW_SCALABILITY
     1260  Void      setUseDisparitySearchRangeRestriction ( Bool b ) { m_bUseDisparitySearchRangeRestriction = b; }
     1261  Bool      getUseDisparitySearchRangeRestriction ()         { return  m_bUseDisparitySearchRangeRestriction; }
     1262#endif
    12551263#endif //SVC_EXTENSION
    12561264};
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r1502 r1534  
    12991299    {
    13001300#if REF_IDX_ME_ZEROMV
    1301       Bool bZeroMVILR = rpcTempCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]);
    1302       if(bZeroMVILR)
     1301      Bool bZeroMVILR = rpcTempCU->checkZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]);
     1302
     1303      if( bZeroMVILR )
    13031304      {
    13041305#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1531 r1534  
    20292029    {
    20302030      pcSlice->setILRPic( m_pcEncTop->getIlpList() );
     2031#if VIEW_SCALABILITY
     2032      pcSlice->setRefPicListModificationSvc(m_pcEncTop->getIlpList());
     2033#else
    20312034      pcSlice->setRefPicListModificationSvc();
     2035#endif
    20322036      pcSlice->setRefPicList( rcListPic, false, m_pcEncTop->getIlpList());
    20332037
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1514 r1534  
    28882888  {
    28892889#if REF_IDX_ME_ZEROMV
    2890     Bool bZeroMVILR = pcCU->xCheckZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]);
    2891     if(bZeroMVILR)
     2890    Bool bZeroMVILR = pcCU->checkZeroMVILRMerge(uhInterDirNeighbours[uiMergeCand], cMvFieldNeighbours[0 + 2*uiMergeCand], cMvFieldNeighbours[1 + 2*uiMergeCand]);
     2891
     2892    if( bZeroMVILR )
    28922893    {
    28932894#endif
     
    31133114        {
    31143115#if REF_IDX_ME_ZEROMV
    3115           Bool bZeroMVILR = pcCU->xCheckZeroMVILRMvdL1Zero(iRefList, iRefIdxTemp, aaiMvpIdx[iRefList][iRefIdxTemp]);
    3116           if(bZeroMVILR)
     3116          Bool bZeroMVILR = pcCU->checkZeroMVILRMvdL1Zero(iRefList, iRefIdxTemp, aaiMvpIdx[iRefList][iRefIdxTemp]);
     3117
     3118          if( bZeroMVILR )
    31173119          {
    31183120#endif
     
    38643866
    38653867  TComMv      cMvPred = *pcMvPred;
    3866 
     3868#if VIEW_SCALABILITY
     3869  m_vertRestriction = m_pcEncCfg->getUseDisparitySearchRangeRestriction() && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->getPOC() == pcCU->getSlice()->getPOC();
     3870#endif
    38673871  if ( bBi )
    38683872  {
     
    38823886  //  Do integer search
    38833887#if REF_IDX_ME_ZEROMV
    3884   if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId()))  //ILR reference pic
     3888  //scalable layer
     3889  if( pcCU->getSlice()->getVPS()->getScalabilityMask( SCALABILITY_ID ) && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId()) )  //ILR reference pic
    38853890  {
    38863891    rcMv.setZero();  //use Mv(0, 0) for integer ME
     
    39183923
    39193924#if REF_IDX_ME_ZEROMV
    3920   if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId()))  //ILR reference pic
     3925  //scalable layer
     3926  if( pcCU->getSlice()->getVPS()->getScalabilityMask( SCALABILITY_ID ) && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdxPred )->isILR(pcCU->getPic()->getLayerId()))  //ILR reference pic
    39213927  {
    39223928    xPatternSearchFracDIFMv0( pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost );
     
    39503956  rcMvSrchRngRB.setHor( cTmpMvPred.getHor() + (iSrchRng << iMvShift) );
    39513957  rcMvSrchRngRB.setVer( cTmpMvPred.getVer() + (iSrchRng << iMvShift) );
     3958#if VIEW_SCALABILITY
     3959  if( m_vertRestriction )
     3960  {
     3961    Int mvRestricted = ( 56 - 1 ) << iMvShift ; // -1 to consider subpel search
     3962    if( rcMvSrchRngRB.getVer() > mvRestricted )
     3963    {
     3964      rcMvSrchRngRB.setVer( mvRestricted );
     3965    }
     3966  }
     3967#endif
    39523968  pcCU->clipMv        ( rcMvSrchRngLT );
    39533969  pcCU->clipMv        ( rcMvSrchRngRB );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.h

    r1487 r1534  
    120120  Bool            m_isInitialized;
    121121
    122 #if SVC_EXTENSION && N0383_IL_CONSTRAINED_TILE_SETS_SEI
     122#if SVC_EXTENSION
     123#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    123124  Bool            m_disableILP;
     125#endif
     126#if VIEW_SCALABILITY
     127  Bool            m_vertRestriction;
     128#endif
    124129#endif
    125130
     
    473478  inline  Void  setDistParamComp( ComponentID compIdx )  { m_cDistParam.compIdx = compIdx; }
    474479
    475 #if SVC_EXTENSION && REF_IDX_ME_ZEROMV
     480#if SVC_EXTENSION
     481#if REF_IDX_ME_ZEROMV
    476482  Void xPatternSearchFracDIFMv0  ( TComPattern*  pcPatternKey,
    477483                                   Pel*          piRefY,
     
    485491                                   UInt&         ruiCost     );
    486492#endif
    487 #endif //SVC_EXTENSION 
     493#endif
     494
     495#if VIEW_SCALABILITY
     496  TComMv xCheckMVVertRestriction( TComMv mv );
     497#endif
     498#endif //SVC_EXTENSION
    488499
    489500};// END CLASS DEFINITION TEncSearch
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1513 r1534  
    848848    m_cSPS.setLayerId(m_layerId);
    849849  }
     850#if VIEW_SCALABILITY
     851  if( m_bUseDisparitySearchRangeRestriction )
     852  {
     853    m_cSPS.setInterViewMvVertConstraintFlag( true );
     854  }
     855  else
     856  {
     857    m_cSPS.setInterViewMvVertConstraintFlag( false );
     858  }
     859#endif
    850860#endif //SVC_EXTENSION
    851861
Note: See TracChangeset for help on using the changeset viewer.