Ignore:
Timestamp:
26 Jan 2013, 19:36:53 (11 years ago)
Author:
mitsubishi-htm
Message:

-Integration of JCT3V-C0152 & JCT3V-C0131
-This check-in enable C0131 only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComDataCU.cpp

    r210 r231  
    5151#endif
    5252
     53#if MERL_VSP_C0152
     54
     55#define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && !( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] )
     56
     57inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo )
     58{
     59  Int vspIdx = (Int) pcCURef->getVSPIndex(uiIdx);
     60  if( vspIdx != 0 )
     61  {
     62    Int idx = vspIdx - 1;
     63    bVspMvZeroDone[idx] = true;
     64    iVSPIndexTrue [idx] = iCount;
     65
     66    // no need to reset Inter Dir
     67
     68    // set MV using checked disparity
     69    if (vspIdx < 4)
     70    {
     71      pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCand[0],  NOT_VALID );
     72      if ( pcCURef->getSlice()->isInterB() )
     73      {
     74         pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCand[0],  NOT_VALID );
     75      }
     76    }
     77  }
     78}
     79
     80inline Bool TComDataCU::xAddVspMergeCand( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
     81                                          UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo )
     82{
     83  if( ucVspMergePos == VSP_MERGE_POS )
     84  {
     85    Int idx = vspIdx - 1;
     86    {
     87      if( getSlice()->getSPS()->getViewId() != 0 && bVspMvZeroDone[idx] == false )
     88      {
     89        {
     90          abCandIsInter [iCount] = true;
     91          bVspMvZeroDone[idx] = true;
     92
     93          // get Inter Dir
     94          Int iInterDir = ((getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 :
     95            (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2));
     96          puhInterDirNeighbours[iCount] = iInterDir; // The direction information does not matter
     97          // get Mv using checked disparity vector
     98          if (vspIdx < 4) // spatial
     99          {
     100            pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID );
     101            if ( getSlice()->isInterB() )
     102            {
     103              pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], NOT_VALID );
     104            }
     105          }
     106          iVSPIndexTrue[idx] = iCount;
     107#if SIMP_MRG_PRUN
     108          if ( mrgCandIdx == iCount )
     109          {
     110            return false;
     111          }
     112#endif
     113          iCount ++;
     114        }
     115      }
     116    }
     117  }
     118  return true;
     119}
     120#endif
     121
    53122// ====================================================================================================================
    54123// Constructor / destructor / create / destroy
     
    79148#endif
    80149  m_puhMergeIndex      = NULL;
     150#if MERL_VSP_C0152
     151  m_piVSPIndex         = NULL;
     152#endif
    81153  m_puhLumaIntraDir    = NULL;
    82154  m_puhChromaIntraDir  = NULL;
     
    213285#endif
    214286    m_puhMergeIndex      = (UChar* )xMalloc(UChar,  uiNumPartition);
     287#if MERL_VSP_C0152
     288    m_piVSPIndex         = (Char*  )xMalloc(Char,   uiNumPartition);
     289#endif
    215290#if HHI_INTER_VIEW_RESIDUAL_PRED
    216291    m_pbResPredAvailable = (Bool*  )xMalloc(Bool,   uiNumPartition);
     
    364439    if ( m_pbICFlag           ) { xFree(m_pbICFlag);            m_pbICFlag          = NULL; }
    365440#endif
     441#if MERL_VSP_C0152
     442    if ( m_piVSPIndex         ) { xFree(m_piVSPIndex);          m_piVSPIndex        = NULL; }
     443#endif
    366444    if ( m_puhMergeIndex      ) { xFree(m_puhMergeIndex);       m_puhMergeIndex     = NULL; }
    367445#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    558636#endif
    559637    m_puhMergeIndex[ui]=pcFrom->m_puhMergeIndex[ui];
     638#if MERL_VSP_C0152
     639    m_piVSPIndex[ui] = pcFrom->m_piVSPIndex[ui];
     640#endif
    560641    m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui];
    561642    m_puhChromaIntraDir[ui]=pcFrom->m_puhChromaIntraDir[ui];
     
    598679#endif
    599680    memset( m_puhMergeIndex     + firstElement, 0,                        numElements * sizeof( *m_puhMergeIndex ) );
     681#if MERL_VSP_C0152
     682    memset( m_piVSPIndex        + firstElement, 0,                        numElements * sizeof( *m_piVSPIndex ) );
     683#endif
    600684    memset( m_puhLumaIntraDir   + firstElement, 2,                        numElements * sizeof( *m_puhLumaIntraDir ) );
    601685    memset( m_puhChromaIntraDir + firstElement, 0,                        numElements * sizeof( *m_puhChromaIntraDir ) );
     
    781865#endif
    782866      m_puhMergeIndex[ui] = 0;
     867#if MERL_VSP_C0152
     868      m_piVSPIndex[ui] = 0;
     869#endif
    783870#if HHI_INTER_VIEW_RESIDUAL_PRED
    784871      m_pbResPredAvailable[ui] = 0;
     
    876963  Int iSizeInUchar = sizeof( UChar  ) * m_uiNumPartition;
    877964  Int iSizeInBool  = sizeof( Bool   ) * m_uiNumPartition;
     965#if MERL_VSP_C0152
     966  Int iSizeInChar  = sizeof( Char   ) * m_uiNumPartition;
     967#endif
    878968
    879969#if H0736_AVC_STYLE_QP_RANGE
     
    893983#endif
    894984  memset( m_puhMergeIndex,      0, iSizeInUchar );
     985#if MERL_VSP_C0152
     986  memset( m_piVSPIndex,         0, iSizeInChar );
     987#endif
    895988#if HHI_INTER_VIEW_RESIDUAL_PRED
    896989  memset( m_pbResPredAvailable, 0, iSizeInBool  );
     
    9731066#endif
    9741067      m_puhMergeIndex[ui]=pcCU->m_puhMergeIndex[uiPartOffset+ui];
     1068#if MERL_VSP_C0152
     1069      m_piVSPIndex[ui]=pcCU->m_piVSPIndex[uiPartOffset+ui];
     1070#endif
    9751071      m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui];
    9761072      m_puhChromaIntraDir[ui]=pcCU->m_puhChromaIntraDir[uiPartOffset+ui];
     
    11171213#endif
    11181214  m_puhMergeIndex       = pcCU->getMergeIndex()       + uiPart;
     1215#if MERL_VSP_C0152
     1216  m_piVSPIndex          = pcCU->getVSPIndex()         + uiPart;
     1217#endif
    11191218#if HHI_INTER_VIEW_RESIDUAL_PRED
    11201219  m_pbResPredAvailable  = pcCU->getResPredAvail()     + uiPart;
     
    12271326  m_uiCUAddr           = pcCU->getAddr();
    12281327  m_uiAbsIdxInLCU      = uiAbsPartIdx;
    1229  
     1328
    12301329  Int iRastPartIdx     = g_auiZscanToRaster[uiAbsPartIdx];
    12311330  m_uiCUPelX           = pcCU->getCUPelX() + m_pcPic->getMinCUWidth ()*( iRastPartIdx % m_pcPic->getNumPartInWidth() );
     
    12571356#endif
    12581357  m_puhMergeIndex      = pcCU->getMergeIndex()            + uiAbsPartIdx;
     1358#if MERL_VSP_C0152
     1359  m_piVSPIndex         = pcCU->getVSPIndex()              + uiAbsPartIdx;
     1360#endif
    12591361#if HHI_INTER_VIEW_RESIDUAL_PRED
    12601362  m_pbResPredAvailable = pcCU->getResPredAvail()          + uiAbsPartIdx;
     
    12881390  Int iSizeInUchar  = sizeof( UChar ) * uiNumPartition;
    12891391  Int iSizeInBool   = sizeof( Bool  ) * uiNumPartition;
     1392#if MERL_VSP_C0152
     1393  Int iSizeInChar   = sizeof( Char )  * uiNumPartition;
     1394#endif
    12901395 
    12911396#if H0736_AVC_STYLE_QP_RANGE
     
    13061411#endif
    13071412  memcpy( m_puhMergeIndex       + uiOffset, pcCU->getMergeIndex(),        iSizeInUchar );
     1413#if MERL_VSP_C0152
     1414  memcpy( m_piVSPIndex          + uiOffset, pcCU->getVSPIndex(),          iSizeInChar );
     1415#endif
    13081416#if HHI_INTER_VIEW_RESIDUAL_PRED
    13091417  memcpy( m_pbResPredAvailable  + uiOffset, pcCU->getResPredAvail(),      iSizeInBool  );
     
    14191527  Int iSizeInUchar  = sizeof( UChar ) * m_uiNumPartition;
    14201528  Int iSizeInBool   = sizeof( Bool  ) * m_uiNumPartition;
     1529#if MERL_VSP_C0152
     1530  Int iSizeInChar   = sizeof( Char  ) * m_uiNumPartition;
     1531#endif
    14211532 
    14221533#if H0736_AVC_STYLE_QP_RANGE
     
    14401551#endif
    14411552  memcpy( rpcCU->getMergeIndex()        + m_uiAbsIdxInLCU, m_puhMergeIndex,       iSizeInUchar );
     1553#if MERL_VSP_C0152
     1554  memcpy( rpcCU->getVSPIndex()          + m_uiAbsIdxInLCU, m_piVSPIndex,         iSizeInChar );
     1555#endif
    14421556#if HHI_INTER_VIEW_RESIDUAL_PRED
    14431557  memcpy( rpcCU->getResPredAvail()      + m_uiAbsIdxInLCU, m_pbResPredAvailable,  iSizeInBool  );
     
    15471661  Int iSizeInUchar  = sizeof( UChar  ) * uiQNumPart;
    15481662  Int iSizeInBool   = sizeof( Bool   ) * uiQNumPart;
     1663#if MERL_VSP_C0152
     1664  Int iSizeInChar   = sizeof( Char   ) * uiQNumPart;
     1665#endif
    15491666 
    15501667#if H0736_AVC_STYLE_QP_RANGE
     
    15661683#endif
    15671684  memcpy( rpcCU->getMergeIndex()        + uiPartOffset, m_puhMergeIndex,       iSizeInUchar );
     1685#if MERL_VSP_C0152
     1686  memcpy( rpcCU->getVSPIndex()          + uiPartOffset, m_piVSPIndex,         iSizeInChar );
     1687#endif
    15681688#if HHI_INTER_VIEW_RESIDUAL_PRED
    15691689  memcpy( rpcCU->getResPredAvail()      + uiPartOffset, m_pbResPredAvailable,  iSizeInBool  );
     
    30333153}
    30343154
     3155#if MERL_VSP_C0152
     3156Void TComDataCU::setVSPIndexSubParts ( Char iVSPIdx, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     3157{
     3158  setSubPart<Char>( iVSPIdx, m_piVSPIndex, uiAbsPartIdx, uiDepth, uiPartIdx );
     3159}
     3160#endif
     3161
    30353162#if HHI_INTER_VIEW_RESIDUAL_PRED
    30363163Void TComDataCU::setResPredAvailSubParts( Bool bResPredAvailable, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     
    30843211
    30853212      if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx))
    3086       {
    30873213        return true;
    3088       }
    30893214    }
    30903215  }
     
    36183743 */
    36193744#if SIMP_MRG_PRUN
     3745#if MERL_VSP_C0152
     3746Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx )
     3747#else
    36203748Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx )
     3749#endif
    36213750#else
    36223751Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand )
     
    36453774#endif
    36463775
     3776#if MERL_VSP_C0152
     3777  Bool bVspMvZeroDone[3] = {false, false, false};
     3778#endif
     3779 
    36473780  Int iCount = 0;
    36483781
     
    36873820    getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo
    36883821#if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047
    3689 ,
    3690 true
     3822            , true
     3823#endif
     3824#if MERL_VSP_C0152
     3825            , true
    36913826#endif
    36923827);
     
    37143849  Int     iPdmInterDir      = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv );
    37153850#endif
     3851
    37163852#if QC_MRG_CANS_B0048
    37173853  if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 )
     
    37853921  }
    37863922#endif
     3923
     3924#if MERL_VSP_COMPENSATION_C0152
     3925  //===== vsp 0 =====
     3926  if( iCount < 4 + extraMergeCand )
     3927    if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
     3928      return;
     3929#endif
     3930
    37873931  //left
    37883932  UInt uiLeftPartIdx = 0;
     
    38053949  if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N)))
    38063950  {
    3807   if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) )
     3951  if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx )
     3952#if MERL_VSP_C0152
     3953     CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1)
     3954#endif
     3955  )
    38083956  {
    38093957    abCandIsInter[iCount] = true;
     
    38524000    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    38534001#endif
     4002#if MERL_VSP_C0152
     4003     xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
     4004#endif
    38544005#if SIMP_MRG_PRUN
    38554006    if ( mrgCandIdx == iCount )
     
    39024053    iCount ++;
    39034054  }
     4055#endif
     4056
     4057#if MERL_VSP_COMPENSATION_C0152
     4058  //===== vsp 1 =====
     4059  if( iCount < 4 + extraMergeCand )
     4060    if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
     4061      return;
    39044062#endif
    39054063
     
    39284086#if SIMP_MRG_PRUN
    39294087  if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx )
     4088#if MERL_VSP_C0152
     4089    CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1)
     4090#endif
    39304091    && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD))
    39314092    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) )
     
    39784139    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    39794140#endif
     4141#if MERL_VSP_C0152
     4142     xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
     4143#endif
    39804144#if SIMP_MRG_PRUN
    39814145    if ( mrgCandIdx == iCount )
     
    40304194    iCount ++;
    40314195  }
     4196#endif
     4197
     4198#if MERL_VSP_COMPENSATION_C0152
     4199  //===== vsp 2 =====
     4200  if( iCount < 4 + extraMergeCand )
     4201    if ( !xAddVspMergeCand(2, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
     4202      return;
    40324203#endif
    40334204
     
    40504221#endif
    40514222#if SIMP_MRG_PRUN
    4052   if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
     4223  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx )
     4224#if MERL_VSP_C0152
     4225    CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx, 1)
     4226#endif
     4227    && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) )
    40534228#else
    40544229  if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) )
     
    40744249    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    40754250#endif
     4251#if MERL_VSP_C0152
     4252    xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
     4253#endif
    40764254#if SIMP_MRG_PRUN
    40774255    if ( mrgCandIdx == iCount )
     
    41284306    {
    41294307      assert(iCount < MRG_MAX_NUM_CANDS_MEM);
    4130       Bool bRemoveSpa = false; //prunign to A1, B1
     4308      Bool bRemoveSpa = false; //pruning to A1, B1
    41314309      abCandIsInter        [ iCount ] = true;
    41324310      puhInterDirNeighbours[ iCount ] = iPdmDir[1];
     
    41734351  }
    41744352#endif
     4353#if MERL_VSP_COMPENSATION_C0152
     4354  //===== vsp 3 =====
     4355  if( iCount < 4 + extraMergeCand )
     4356    if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
     4357      return;
     4358#endif
     4359
     4360#if MERL_VSP_C0152
     4361#if VSP_MERGE_POS < 4
     4362#if HHI_INTER_VIEW_MOTION_PRED
     4363  if( iCount < 4 + extraMergeCand )
     4364#else
     4365  if( iCount < 4 )
     4366#endif
     4367  {
     4368#endif
     4369#endif
     4370
    41754371  //left bottom
    41764372  UInt uiLeftBottomPartIdx = 0;
     
    41914387#endif
    41924388#if SIMP_MRG_PRUN
    4193   if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
     4389  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx )
     4390#if MERL_VSP_C0152
     4391    CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx, 1)
     4392#endif
     4393    && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) )
    41944394#else
    41954395  if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) )
     
    42154415    pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    42164416#endif
     4417#if MERL_VSP_C0152
     4418     xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
     4419#endif
    42174420#if SIMP_MRG_PRUN
    42184421    if ( mrgCandIdx == iCount )
     
    42234426    iCount ++;
    42244427  }
    4225 
     4428#if MERL_VSP_C0152
     4429#if VSP_MERGE_POS < 4
     4430  }
     4431#endif
     4432#endif
     4433 
    42264434#if HHI_INTER_VIEW_MOTION_PRED
    42274435#if QC_MRG_CANS_B0048
     
    42634471#endif
    42644472
    4265   // above left
     4473#if MERL_VSP_COMPENSATION_C0152
     4474  //===== vsp 4 =====
     4475  if( iCount < 4 + extraMergeCand )
     4476    if ( !xAddVspMergeCand(4, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
     4477      return;
     4478#endif
     4479 
     4480  // above left
    42664481#if HHI_INTER_VIEW_MOTION_PRED
    42674482  if( iCount < 4 + extraMergeCand )
     
    42884503#if SIMP_MRG_PRUN
    42894504    if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx )
     4505#if MERL_VSP_C0152
     4506     CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx, 1)
     4507#endif
    42904508     && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
    42914509     && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) )
     
    43144532      pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    43154533#endif
     4534#if MERL_VSP_C0152
     4535     xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ;
     4536#endif
    43164537#if SIMP_MRG_PRUN
    43174538      if ( mrgCandIdx == iCount )
     
    43234544    }
    43244545  }
     4546
     4547#if MERL_VSP_COMPENSATION_C0152
     4548  //===== vsp 5 =====
     4549  if( iCount < 4 + extraMergeCand )
     4550    if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
     4551      return;
     4552#endif
    43254553
    43264554  if ( getSlice()->getPPS()->getEnableTMVPFlag()
     
    43564584    Int uiLCUIdx = getAddr();
    43574585    PartSize eCUMode = getPartitionSize( 0 );
     4586
     4587#if MERL_VSP_C0152 // Potential bug, not related to BW_VSP
     4588    if (eCUMode==SIZE_NxN)
     4589    {
     4590      printf("Size NxN ???");
     4591      assert(0);
     4592    }
     4593#endif
    43584594
    43594595    deriveRightBottomIdx( eCUMode, uiPUIdx, uiPartIdxRB ); 
     
    45984834    {
    45994835      Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];
    4600       if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
     4836#if MERL_VSP_C0152
     4837      Bool bValid = true;
     4838      if (pcMvFieldNeighbours[i<<1].getRefIdx() < 0 || pcMvFieldNeighbours[(j<<1)+1].getRefIdx() < 0) // NOT_VALID
     4839        bValid = false;
     4840#endif
     4841      if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)
     4842#if MERL_VSP_C0152
     4843       && bValid
     4844#endif
     4845         )
    46014846      {
    46024847        abCandIsInter[uiArrayAddr] = true;
     
    47705015  if( uiIter == 0 )
    47715016  {
    4772     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     5017    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     5018#if MERL_VSP_C0152
     5019     && !pcCorner->getVSPIndex( uiCornerPUIdx )
     5020#endif
     5021    )
    47735022    {
    47745023      rbValidCand = true;
     
    48055054  else
    48065055  {
    4807     if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) )
     5056    if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx )
     5057#if MERL_VSP_C0152
     5058     && !pcCorner->getVSPIndex( uiCornerPUIdx )
     5059#endif
     5060    )
    48085061    {
    48095062      rbValidCand = true;
     
    49545207#endif
    49555208  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     5209#if MERL_VSP_C0152
     5210  if(! pcTmpCU->getVSPIndex(uiIdx))
     5211#endif
    49565212  {
    49575213    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    49805236
    49815237  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5238#if MERL_VSP_C0152
     5239  if(! pcTmpCU->getVSPIndex(uiIdx))
     5240#endif
    49825241  {
    49835242    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    50065265#endif
    50075266  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     5267#if MERL_VSP_C0152
     5268  if(! pcTmpCU->getVSPIndex(uiIdx))
     5269#endif
    50085270  {
    50095271    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    50315293#endif
    50325294  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5295#if MERL_VSP_C0152
     5296  if(! pcTmpCU->getVSPIndex(uiIdx))
     5297#endif
    50335298  {
    50345299    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    50595324#endif
    50605325  if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
     5326#if MERL_VSP_C0152
     5327  if(! pcTmpCU->getVSPIndex(uiIdx))
     5328#endif
    50615329  {
    50625330    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     
    52575525}
    52585526
     5527#if MERL_VSP_C0152
     5528Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec)
     5529{
     5530  Int depStride =  pcBaseViewDepthPicYuv->getStride();
     5531
     5532  Int width  = pcBaseViewDepthPicYuv->getWidth();
     5533  Int height = pcBaseViewDepthPicYuv->getHeight();
     5534
     5535  Int depthPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + (mv->getHor()>>2));
     5536  Int depthPosY = Clip3(0,   height- iHeight - 1,  iBlkY + (mv->getVer()>>2));
     5537
     5538  Pel *depth  = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride;
     5539  Pel  maxDepth = 0;
     5540
     5541  for (Int j = 0; j < iHeight; j++)
     5542  {
     5543    for (Int i = 0; i < iWidth; i++)
     5544    {
     5545      if (maxDepth < depth[i])
     5546        maxDepth = depth[i];
     5547    }
     5548    depth += depStride;
     5549  }
     5550
     5551  Int disparity = aiShiftLUT[ maxDepth ] << iShiftPrec;
     5552
     5553  return disparity;
     5554}
     5555
     5556Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred)
     5557{
     5558  if (picDepth)
     5559  {
     5560    UInt uiAbsPartAddrCurrCU = m_uiAbsIdxInLCU + uiPartAddr;
     5561    Int iWidth, iHeight;
     5562    getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); // The modified value of uiPartAddr won't be used any more
     5563   
     5564    TComPicYuv* pcBaseViewDepthPicYuv = picDepth->getPicYuvRec();
     5565    Int iBlkX = ( getAddr() % picDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ];
     5566    Int iBlkY = ( getAddr() / picDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ];
     5567    Int* aiShiftLUT;
     5568    Int  iShiftPrec;
     5569    getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec);
     5570   
     5571    Pel x = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec );
     5572
     5573    cMvPred->setHor(x);
     5574    clipMv(*cMvPred);
     5575  }
     5576}
     5577#endif
     5578
    52595579#if LGE_DVMCP_A0126
    52605580#if QC_SIMPLE_NBDV_B0047
     
    52635583                                , Bool bParMerge
    52645584#endif
     5585#if MERL_VSP_C0152
     5586                                , Bool bDepthRefine
     5587#endif
    52655588#else
    52665589Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0
     
    53455668      {
    53465669        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    5347         if (refViewIdx!= m_pcSlice->getViewId()) // DCP
     5670        if (refViewIdx != m_pcSlice->getViewId()) // DCP
    53485671        {
    53495672          TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    53505673          clipMv(cMvPred);
     5674#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    53515675          pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    53525676          pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5677#else
     5678          {
     5679            TComPic* picDepth = NULL;
     5680            picDepth = getSlice()->getRefPicBaseDepth();
     5681            if (picDepth && bDepthRefine)
     5682              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
     5683            pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
     5684            pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5685          }
     5686#endif
    53535687          return;
    53545688        }
     
    53645698        }
    53655699      }
     5700#if MERL_VSP_C0152
     5701      else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
     5702      {
     5703        TComPic* picDepth = NULL;
     5704        TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
     5705        picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
     5706        if (picDepth && bDepthRefine)
     5707          estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
     5708        myMv.setVer(0);
     5709
     5710        pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
     5711        pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
     5712        return;
     5713      }
     5714#endif
    53665715    }
    53675716  }
     
    54055754          TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    54065755          clipMv(cMvPred);
     5756#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    54075757          pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    54085758          pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5759#else
     5760          {
     5761            TComPic* picDepth = NULL;
     5762            picDepth = getSlice()->getRefPicBaseDepth();
     5763            if (picDepth && bDepthRefine)
     5764              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
     5765            pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
     5766            pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5767          }
     5768#endif
    54095769          return;
    54105770        }
     
    54245784        }
    54255785      }
     5786#if MERL_VSP_C0152
     5787      else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
     5788      {
     5789        TComPic* picDepth = NULL;
     5790        TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
     5791        picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
     5792        if (picDepth && bDepthRefine)
     5793          estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
     5794        myMv.setVer(0);
     5795
     5796        pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
     5797        pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
     5798        return;
     5799      }
     5800#endif
    54265801    }
    54275802  }
     
    54595834          TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    54605835          clipMv(cMvPred);
     5836#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    54615837          pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    54625838          pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5839#else
     5840          {
     5841            TComPic* picDepth = NULL;
     5842            picDepth = getSlice()->getRefPicBaseDepth();
     5843            if (picDepth && bDepthRefine)
     5844              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
     5845            pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
     5846            pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5847          }
     5848#endif
    54635849          return;
    54645850        }
     
    54785864        }
    54795865      }
     5866#if MERL_VSP_C0152
     5867      else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
     5868      {
     5869        TComPic* picDepth = NULL;
     5870        TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
     5871        picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
     5872        if (picDepth && bDepthRefine)
     5873          estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
     5874        myMv.setVer(0);
     5875
     5876        pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
     5877        pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
     5878        return;
     5879      }
     5880#endif
    54805881    }
    54815882  }
     
    55095910          TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    55105911          clipMv(cMvPred);
     5912#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    55115913          pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    55125914          pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5915#else
     5916          {
     5917            TComPic* picDepth = NULL;
     5918            picDepth = getSlice()->getRefPicBaseDepth();
     5919            if (picDepth && bDepthRefine)
     5920              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
     5921            pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
     5922            pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5923          }
     5924#endif
    55135925          return;
    55145926        }
     
    55245936        }
    55255937      }
     5938#if MERL_VSP_C0152
     5939      else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
     5940      {
     5941        TComPic* picDepth = NULL;
     5942        TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
     5943        picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
     5944        if (picDepth && bDepthRefine)
     5945          estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
     5946        myMv.setVer(0);
     5947
     5948        pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
     5949        pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
     5950        return;
     5951      }
     5952#endif
    55265953    }
    55275954  }
     
    55615988          TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    55625989          clipMv(cMvPred);
     5990#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    55635991          pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    55645992          pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     5993#else
     5994          {
     5995            TComPic* picDepth = NULL;
     5996            picDepth = getSlice()->getRefPicBaseDepth();
     5997            if (picDepth && bDepthRefine)
     5998              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
     5999            pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
     6000            pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
     6001          }
     6002#endif
    55656003          return;
    55666004        }
     
    55806018        }
    55816019      }
     6020#if MERL_VSP_C0152
     6021      else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
     6022      {
     6023        TComPic* picDepth = NULL;
     6024        TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
     6025        picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
     6026        if (picDepth && bDepthRefine)
     6027          estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
     6028        myMv.setVer(0);
     6029
     6030        pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
     6031        pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
     6032        return;
     6033      }
     6034#endif
    55826035    }
    55836036  }
     
    58106263          {
    58116264            clipMv(cColMv);
    5812             pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
    5813             pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     6265#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
     6266            pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
     6267            pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
     6268#else
     6269            {
     6270              TComPic* picDepth = NULL;
     6271              picDepth = getSlice()->getRefPicBaseDepth();
     6272              if (picDepth && bDepthRefine)
     6273                estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
     6274
     6275              pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
     6276              pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
     6277            }
     6278#endif
    58146279            return ;
    58156280          }
     
    58196284        {
    58206285          clipMv(cColMv);
    5821           pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
    5822           pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     6286#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
     6287            pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
     6288            pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
     6289#else
     6290            {
     6291              TComPic* picDepth = NULL;
     6292              picDepth = getSlice()->getRefPicBaseDepth();
     6293              if (picDepth && bDepthRefine)
     6294                estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
     6295              pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
     6296              pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
     6297            }
     6298#endif
    58236299          return ;
    58246300        }
     
    58286304          {
    58296305            clipMv(cColMv);
    5830             pDInfo->m_acMvCand[pDInfo->iN] = cColMv;
    5831             pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx;
     6306#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
     6307            pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
     6308            pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
     6309#else
     6310            {
     6311              TComPic* picDepth = NULL;
     6312              picDepth = getSlice()->getRefPicBaseDepth();
     6313              if (picDepth && bDepthRefine)
     6314                estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
     6315              pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
     6316              pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
     6317            }
     6318#endif
    58326319            return ;
    58336320          }
     
    58526339          TComMv dv( aiDvMcpDvCand[iList][ i ], 0 );
    58536340          clipMv( dv );
    5854           pDInfo->m_acMvCand[ pDInfo->iN  ] = dv;
    5855           pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;
     6341#if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
     6342          pDInfo->m_acMvCand[ pDInfo->iN] = dv;
     6343          pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;
     6344#else
     6345          {
     6346            TComPic* picDepth = NULL;
     6347            picDepth = getSlice()->getRefPicBaseDepth();
     6348            if (picDepth && bDepthRefine)
     6349              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv);
     6350            pDInfo->m_acMvCand[ pDInfo->iN] = dv;
     6351            pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;
     6352          }
     6353#endif
    58566354          return;
    58576355        }
     
    58636361}
    58646362#endif
     6363
    58656364#endif
    58666365
     
    59046403#if QC_SIMPLE_NBDV_B0047
    59056404#if FIX_LGE_IVMP_PARALLEL_MERGE_B0136
    5906       getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false);
     6405      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false
     6406#if MERL_VSP_C0152
     6407            , true
     6408#endif
     6409              );
    59076410#else
    59086411      getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);
     
    64076910  }
    64086911 
     6912#if MERL_VSP_C0152
     6913  if(pcTmpCU != NULL && pcTmpCU->getVSPIndex(uiIdx))
     6914  {
     6915    return false;
     6916  }
     6917#endif
     6918
    64096919  if ( pcTmpCU != NULL && m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) )
    64106920  {
     
    65157025  TComDataCU* pcTmpCU = NULL;
    65167026  UInt uiIdx;
     7027
    65177028  switch( eDir )
    65187029  {
     
    65727083    return false;
    65737084  }
    6574  
     7085
     7086#if MERL_VSP_C0152
     7087  if(pcTmpCU->getVSPIndex(uiIdx))
     7088  {
     7089    return false;
     7090  }
     7091#endif
    65757092  RefPicList eRefPicList2nd = REF_PIC_LIST_0;
    65767093  if(       eRefPicList == REF_PIC_LIST_0 )
     
    67027219  TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    67037220  iColViewIdx = pColCU->getSlice()->getViewId();
    6704 
     7221#if MERL_VSP_C0152
     7222  //TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
     7223  if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0)
     7224  {
     7225    return false;
     7226  }
     7227#endif
    67057228
    67067229  if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr))
     
    70267549    return false;
    70277550  }
    7028  
     7551
    70297552  if( m_pcSlice->getRefPic( eRefPicList, iRefIdx )->getViewId() != m_pcSlice->getViewId() )
    70307553  {
     
    70717594    }
    70727595  }
     7596
     7597#if MERL_VSP_C0152 // Preventive
     7598  if (pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiPartIdxCenter) < 0) // NOT_VALID
     7599    return false;
     7600#endif
    70737601 
    70747602  // Scale the vector.
     
    78468374  memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc,       sizeof( m_puhInterDir[0] ) * uiNumPartition );
    78478375
     8376#if MERL_VSP_C0152 && MTK_UNCONSTRAINED_MVI_B0083
     8377  memcpy( m_piVSPIndex + uiAbsPartIdxDst,  pcCU->getVSPIndex() + uiAbsPartIdxSrc, sizeof( m_piVSPIndex[0] ) * uiNumPartition );
     8378#endif
     8379
    78488380#if !MTK_UNCONSTRAINED_MVI_B0083
    78498381  memcpy( m_apiMVPIdx[0] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition );
     
    79538485#if QC_SIMPLE_NBDV_B0047
    79548486#if FIX_LGE_IVMP_PARALLEL_MERGE_B0136
    7955   getDisMvpCand2( 0, 0,  &cDisInfo, false);
     8487  getDisMvpCand2( 0, 0,  &cDisInfo, false );
    79568488#else
    79578489  getDisMvpCand2( 0, 0,  &cDisInfo);
Note: See TracChangeset for help on using the changeset viewer.