Changeset 968 in 3DVCSoftware


Ignore:
Timestamp:
5 Jul 2014, 09:11:50 (10 years ago)
Author:
tech
Message:

Cleanup part 2.

Location:
branches/HTM-11.1-dev0/source/Lib
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r967 r968  
    23582358   
    23592359    TComMv cDv = depthRefineFlag ? DvInfo.m_acDoNBDV : DvInfo.m_acNBDV;
    2360 #if SEC_VER_DONBDV_H0103
    23612360    if( depthRefineFlag )
    23622361    {
    23632362      cDv.setVer(0);
    23642363    }
    2365 #endif
    23662364   
    23672365    Int depthPosX = Clip3(0,   iPictureWidth - iWidth,  iBlkX + ((cDv.getHor()+2)>>2));
     
    32543252 *   false: otherwise
    32553253 */
    3256 #if ETRIKHU_CLEANUP_H0083
    32573254inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount)
    3258 #else
    3259 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    3260   Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3261 #endif
    32623255{
    32633256  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
     
    32753268  }
    32763269
    3277 #if ETRIKHU_CLEANUP_H0083
    32783270  TComMvField mvVSP[2];
    32793271  UChar dirVSP;
    3280 #else
    3281   rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3282 #endif
    3283 
    32843272  Bool  refViewAvailFlag = false;
    32853273  UChar predFlag[2]      = {0, 0};
     
    32953283        refViewAvailFlag      = true;
    32963284        predFlag[iRefListIdX] = 1;
    3297 #if ETRIKHU_CLEANUP_H0083
    32983285        mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    32993286#if H_3D_NBDV
    33003287        mvVSP[0+iRefListIdX].getMv().setIDVFlag (false);
    33013288#endif
    3302 #else
    3303         pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    3304 #if H_3D_NBDV
    3305         pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].getMv().setIDVFlag (false);
    3306 #endif
    3307 #endif
    3308       }
    3309     }
    3310   }
    3311 
    3312 #if ETRIKHU_CLEANUP_H0083
     3289      }
     3290    }
     3291  }
     3292
    33133293  dirVSP = (predFlag[0] | (predFlag[1] << 1));
    33143294  m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true, false);
    3315 #else
    3316   // Set values to be returned
    3317   abCandIsInter        [iCount] = true;
    3318   puhInterDirNeighbours[iCount] = (predFlag[0] | (predFlag[1] << 1));
    3319   vspFlag              [iCount] = 1;
    3320 #endif
    3321 
    33223295  if ( mrgCandIdx == iCount )
    33233296  {
     
    33333306
    33343307#if H_3D_IV_MERGE
    3335 #if ETRIKHU_CLEANUP_H0083
    33363308inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx )
    3337 #else
    3338 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,
    3339   Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3340 #endif
    33413309{
    33423310  for(Int iLoop = 0; iLoop < 2; iLoop ++ )
     
    33463314    {
    33473315      Int iFirDispCand = -1;
    3348 #if ETRIKHU_CLEANUP_H0083
    33493316      TComMvField mvIvDcShift[2];
    33503317      UChar dirIvDcShift;
    33513318
    33523319      if (xGetPosFirstAvailDmvCand(MRG_IVSHIFT, iFirDispCand))
    3353 #else
    3354       if (xGetPosFirstAvailDmvCand(iCount, pcMvFieldNeighbours, ivCandDir, iPosIvDC, vspFlag, iFirDispCand))
    3355 #endif
    33563320      {
    33573321        TComMv cMv;
    3358 #if ETRIKHU_CLEANUP_H0083
    33593322        cMv = m_mergCands[iFirDispCand].m_cMvField[0].getMv();
    3360 #else
    3361         cMv = pcMvFieldNeighbours[(iFirDispCand<<1)].getMv();
    3362 #endif
    33633323        cMv.setHor(cMv.getHor()+4);
    33643324        if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps()))
     
    33703330#endif
    33713331
    3372 #if ETRIKHU_CLEANUP_H0083
    33733332        dirIvDcShift = m_mergCands[iFirDispCand].m_uDir;
    33743333        mvIvDcShift[0].setMvField(cMv, m_mergCands[iFirDispCand].m_cMvField[0].getRefIdx() );
    33753334        mvIvDcShift[1].setMvField(m_mergCands[iFirDispCand].m_cMvField[1].getMv(), m_mergCands[iFirDispCand].m_cMvField[1].getRefIdx() );
    33763335        m_mergCands[MRG_IVSHIFT].setCand(mvIvDcShift, dirIvDcShift, false, false);
    3377 #else
    3378         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3379 
    3380         abCandIsInter        [ iCount ] = true;
    3381         puhInterDirNeighbours[ iCount ] = puhInterDirNeighbours[iFirDispCand];
    3382         pcMvFieldNeighbours  [ iCount << 1      ].setMvField(cMv, pcMvFieldNeighbours[( iFirDispCand << 1)].getRefIdx() );
    3383         pcMvFieldNeighbours  [(iCount << 1) + 1 ].setMvField(pcMvFieldNeighbours[(iFirDispCand << 1) + 1].getMv(), pcMvFieldNeighbours[( iFirDispCand << 1) + 1].getRefIdx() );
    3384 #endif
    33853336       
    33863337        if( mrgCandIdx == iCount )
     
    33883339          return true;
    33893340        }
    3390 
    33913341        iCount++;
    33923342        break;
     
    34133363      if( !iLoop && ivCandDir[0] > 0)
    34143364      {
    3415 #if ETRIKHU_CLEANUP_H0083
    34163365        if(tmpDir == m_mergCands[MRG_IVMC].m_uDir && m_mergCands[MRG_IVMC].m_cMvField[0]==tmpMV[0] && m_mergCands[MRG_IVMC].m_cMvField[1]==tmpMV[1])
    3417 #else
    3418         if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1])
    3419 #endif
    34203366        {
    34213367            bRemove                         = true;
     
    34243370      if(!bRemove)
    34253371      {
    3426 #if ETRIKHU_CLEANUP_H0083
    34273372#if H_3D_NBDV
    34283373        if(iLoop) // For IvMcShift candidate
     
    34333378#endif
    34343379        m_mergCands[MRG_IVSHIFT].setCand(tmpMV, tmpDir, false, false);
    3435 #else
    3436         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3437 
    3438         abCandIsInter[ iCount ] = true;
    3439         puhInterDirNeighbours[ iCount ] = ivCandDir[iLoop + 2];
    3440         if( ( ivCandDir[iLoop + 2] & 1 ) == 1 )
    3441         {
    3442           pcMvFieldNeighbours[ iCount<<1 ].setMvField( ivCandMv[ (iLoop<<1) + 4 ], ivCandRefIdx[ (iLoop<<1) + 4 ] );
    3443         }
    3444         if( ( ivCandDir[iLoop + 2] & 2 ) == 2 )
    3445         {
    3446           pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( ivCandMv[ (iLoop<<1) + 5 ], ivCandRefIdx[ (iLoop<<1) + 5 ] );
    3447         }
    3448 #if H_3D_NBDV
    3449         if(iLoop) // For IvMcShift candidate
    3450         {
    3451           pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    3452           pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    3453         }
    3454 #endif
    3455 #endif
    34563380        if( mrgCandIdx == iCount )
    34573381        {
     
    34663390}
    34673391
    3468 #if ETRIKHU_CLEANUP_H0083
    34693392inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
    34703393{
     
    34833406  return false; 
    34843407}
    3485 #else
    3486 inline Bool TComDataCU::xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& posFirstAvailDmvCand )
    3487 {
    3488   // ivCandDir[0] == true --> IvMC is available and excluded in loop over merge list.
    3489   for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
    3490   {
    3491     if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
    3492     {
    3493       continue;
    3494     }
    3495     else if((pcMvFieldNeighbours[currListPos<<1].getRefIdx() != -1 ) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), pcMvFieldNeighbours[currListPos<<1].getRefIdx())->getViewIndex()))
    3496     {
    3497       posFirstAvailDmvCand = currListPos;
    3498       return true;
    3499     }
    3500   }
    3501  return false; 
    3502 }
    3503 #endif
    35043408                                     
    35053409#endif
    35063410
    35073411#if H_3D
    3508 #if ETRIKHU_CLEANUP_H0083
    3509 
    35103412Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
    35113413#if H_3D_VSP
     
    35803482  assert(iCount == getSlice()->getMaxNumMergeCand());
    35813483}
    3582 #else
    3583 Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV)
    3584 {
    3585   iCount3DV++;
    3586   for (int i=num; i>0; i--)
    3587   {
    3588     pcMvFieldNeighbours[(start+i)<<1].setMvField(pcMvFieldNeighbours[(start+i-1)<<1].getMv(), pcMvFieldNeighbours[(start+i-1)<<1].getRefIdx());
    3589     pcMvFieldNeighbours[((start+i)<<1)+1].setMvField(pcMvFieldNeighbours[((start+i-1)<<1)+1].getMv(), pcMvFieldNeighbours[((start+i-1)<<1)+1].getRefIdx());
    3590     puhInterDirNeighbours[start+i] = puhInterDirNeighbours[start+i-1];
    3591     iVSPIndexTrue[start+i] = iVSPIndexTrue[start+i-1];
    3592     inheritedVSPDisInfo[start+i].m_acDvInfo   = inheritedVSPDisInfo[start+i-1].m_acDvInfo;
    3593   }
    3594   TComMv  cZeroMv;
    3595   pcMvFieldNeighbours[start<<1].setMvField( cZeroMv, NOT_VALID );
    3596   pcMvFieldNeighbours[(start<<1)+1].setMvField( cZeroMv, NOT_VALID );
    3597   puhInterDirNeighbours[start] = 0;
    3598   iVSPIndexTrue[start] = 0;
    3599   inheritedVSPDisInfo[start].m_acDvInfo = m_cDefaultDisInfo;
    3600 
    3601   return;
    3602 }
    3603 #endif
    36043484
    36053485/** Constructs a list of merging candidates
     
    39753855#endif
    39763856#if H_3D_VSP
    3977 #if !ETRIKHU_CLEANUP_H0083
    3978       , Int* vspFlag
    3979 #endif
    39803857      , InheritedVSPDisInfo*  inheritedVSPDisInfo
    39813858#endif
    39823859#if H_3D_SPIVMP
    3983 #if ETRIKHU_CLEANUP_H0083
    39843860      , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    3985 #else
    3986       , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    3987 #endif
    39883861#endif
    39893862      , Int& numValidMergeCand, Int mrgCandIdx
     
    39963869  ////////////////////////////
    39973870  TComMv cZeroMv;
    3998 #if !ETRIKHU_CLEANUP_H0083
    3999   Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
    4000 #endif
    40013871#else
    40023872  Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
     
    40643934#if H_3D_DBBP
    40653935  Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx);
    4066 #if MTK_DIS_SPBIP8X4_H0205
    40673936  assert(bDBBPFlag == getDBBPFlag(0)); 
    40683937#endif
    4069 #endif
    40703938
    40713939#if H_3D
    4072 #if !ETRIKHU_CLEANUP_H0083
    4073   Int  iPosLeftAbove[2] = {-1, -1};
    4074 
    4075   Int iCountHEVC = 0;
    4076   Int iCount3DV = 0;
    4077   Int numA1B1B0 = 0;
    4078   Int numA0B2 = 0;
    4079 #endif
    40803940#if H_3D_NBDV
    40813941  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 
     
    40853945  }
    40863946#endif
    4087 
    4088 
    4089 #if ETRIKHU_CLEANUP_H0083
    4090 
    4091 
    40923947  // Clean version for MCL construction align with WD
    40933948  // init mergCands list
     
    42334088  }
    42344089
    4235 
    4236 #if !ETRIKHU_BUGFIX_H0083
    4237   Bool A1_was_available = m_mergCands[MRG_A1].m_bAvailable;
    4238   Bool B1_was_available = m_mergCands[MRG_B1].m_bAvailable;
    4239 #endif
    4240 
    4241 
    4242 #else
    4243   //left
    4244   UInt uiLeftPartIdx = 0;
    4245   TComDataCU* pcCULeft = 0;
    4246   pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 
    4247   if (getAvailableFlagA1())
    4248   {
    4249     iPosLeftAbove[0] = numA1B1B0;
    4250 #if H_3D_VSP
    4251     if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
    4252 #if H_3D_IC
    4253       && !bICFlag
    4254 #endif
    4255 #if H_3D_ARP
    4256       && !bARPFlag
    4257 #endif
    4258 #if H_3D_DBBP
    4259       && !bDBBPFlag
    4260 #endif
    4261       )
    4262     {
    4263       vspFlag[numA1B1B0] = 1;
    4264     }
    4265 #endif
    4266     numA1B1B0++;
    4267   }
    4268 
    4269   // above
    4270   UInt uiAbovePartIdx = 0;
    4271   TComDataCU* pcCUAbove = 0;
    4272   pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
    4273   if ( getAvailableFlagB1())
    4274   {
    4275     iPosLeftAbove[1] = numA1B1B0;
    4276 #if H_3D_VSP
    4277     if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
    4278 #if H_3D_IC
    4279       && !bICFlag
    4280 #endif
    4281 #if H_3D_ARP
    4282       && !bARPFlag
    4283 #endif
    4284 #if H_3D_DBBP
    4285       && !bDBBPFlag
    4286 #endif
    4287       )
    4288     {
    4289       vspFlag[numA1B1B0] = 1;
    4290     }
    4291 #endif
    4292 
    4293     numA1B1B0++;
    4294   }
    4295 
    4296   // above right
    4297   UInt uiAboveRightPartIdx = 0;
    4298   TComDataCU* pcCUAboveRight = 0;
    4299   pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
    4300   if ( getAvailableFlagB0())
    4301   {
    4302 #if H_3D_VSP
    4303     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
    4304 #if H_3D_IC
    4305       && !bICFlag
    4306 #endif
    4307 #if H_3D_ARP
    4308       && !bARPFlag
    4309 #endif
    4310 #if H_3D_DBBP
    4311       && !bDBBPFlag
    4312 #endif
    4313       )
    4314     {
    4315       vspFlag[numA1B1B0] = 1;
    4316     }
    4317 #endif
    4318     numA1B1B0++;
    4319   }
    4320  
    4321   // left bottom
    4322   UInt uiLeftBottomPartIdx = 0;
    4323   TComDataCU* pcCULeftBottom = getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
    4324   if ( getAvailableFlagA0())
    4325   {
    4326 #if H_3D_VSP
    4327     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
    4328 #if H_3D_IC
    4329       && !bICFlag
    4330 #endif
    4331 #if H_3D_ARP
    4332       && !bARPFlag
    4333 #endif
    4334 #if H_3D_DBBP
    4335       && !bDBBPFlag
    4336 #endif
    4337       )
    4338     {
    4339       vspFlag[numA1B1B0] = 1;
    4340     }
    4341 #endif
    4342     iCountHEVC++;
    4343     numA0B2++;
    4344   }
    4345  
    4346   // above left
    4347   UInt uiAboveLeftPartIdx = 0;
    4348   TComDataCU* pcCUAboveLeft = 0;
    4349   pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
    4350   if (getAvailableFlagB2())
    4351   {
    4352 #if H_3D_VSP
    4353     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
    4354 #if H_3D_IC
    4355       && !bICFlag
    4356 #endif
    4357 #if H_3D_ARP
    4358       && !bARPFlag
    4359 #endif
    4360 #if H_3D_DBBP
    4361       && !bDBBPFlag
    4362 #endif
    4363       )
    4364     {
    4365       vspFlag[numA1B1B0+iCountHEVC] = 1;
    4366     }
    4367 #endif
    4368     iCountHEVC++;
    4369     numA0B2++;
    4370   }
    4371 
    4372   iCountHEVC = numValidMergeCand;
    4373 #endif
    43744090#endif
    43754091
     
    43814097  /////////////////////////////////////////////
    43824098
    4383 #if SHARP_SIMPLE_MERGE_H0062
    43844099  bMPIFlag &= (nPSW + nPSH > 12);
    4385 #endif
    43864100  if( bMPIFlag)
    43874101  {
     
    43904104    tmpDir        =  0;
    43914105
    4392 #if ETRIKHU_CLEANUP_H0083
    43934106    Bool bSPIVMPFlag = false;
    4394 #endif
    43954107
    43964108    TComPic * pcTexPic = m_pcSlice->getTexturePic();
     
    44494161      if( pcDefaultCU->getPredictionMode( iTexCenterAbsPartIdx ) != MODE_INTRA )
    44504162      {
    4451           for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4163        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4164        {
     4165          RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4166
     4167          TComMvField cDefaultMvField;
     4168          pcDefaultCU->getMvField( pcDefaultCU, iTexCenterAbsPartIdx, eCurrRefPicList, cDefaultMvField );
     4169          Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     4170          if (iDefaultRefIdx >= 0)
    44524171          {
    4453               RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    4454 
    4455               TComMvField cDefaultMvField;
    4456               pcDefaultCU->getMvField( pcDefaultCU, iTexCenterAbsPartIdx, eCurrRefPicList, cDefaultMvField );
    4457               Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
    4458               if (iDefaultRefIdx >= 0)
     4172            Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eCurrRefPicList, iDefaultRefIdx);
     4173            for (Int iRefPicList = 0; iRefPicList < m_pcSlice->getNumRefIdx( eCurrRefPicList ); iRefPicList++)
     4174            {
     4175              if (iDefaultRefPOC == m_pcSlice->getRefPOC(eCurrRefPicList, iRefPicList))
    44594176              {
    4460                   Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eCurrRefPicList, iDefaultRefIdx);
    4461                   for (Int iRefPicList = 0; iRefPicList < m_pcSlice->getNumRefIdx( eCurrRefPicList ); iRefPicList++)
    4462                   {
    4463                       if (iDefaultRefPOC == m_pcSlice->getRefPOC(eCurrRefPicList, iRefPicList))
    4464                       {
    4465 #if ETRIKHU_CLEANUP_H0083
    4466                         bSPIVMPFlag = true;
    4467 #else
    4468                           pbSPIVMPFlag[iCount] = true;
    4469 #endif
    4470                           TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
    4471                           cMv >>= 2;
    4472                           clipMv( cMv );
    4473                           cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
    4474                           break;
    4475                       }
    4476                   }
     4177                bSPIVMPFlag = true;
     4178                TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
     4179                cMv >>= 2;
     4180                clipMv( cMv );
     4181                cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
     4182                break;
    44774183              }
     4184            }
    44784185          }
    4479       }
    4480 #if ETRIKHU_CLEANUP_H0083
     4186        }
     4187      }
    44814188      if ( bSPIVMPFlag == true )
    4482 #else
    4483       if ( pbSPIVMPFlag[iCount] == true )
    4484 #endif
    44854189      {   
    44864190          iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
     
    44924196      if ( iInterDirSaved != 0 )
    44934197      {
    4494       for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight)
    4495       {
    4496         for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iPUWidth)
     4198        for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight)
    44974199        {
    4498           iTexPosX     = j + iOffsetX;
    4499           iTexPosY     = i + iOffsetY;
    4500           pcTexRec->getCUAddrAndPartIdx( iTexPosX, iTexPosY, iTexCUAddr, iTexAbsPartIdx );
    4501           pcTexCU  = pcTexPic->getCU( iTexCUAddr );
    4502 
    4503           if( pcTexCU && !pcTexCU->isIntra(iTexAbsPartIdx) )
     4200          for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iPUWidth)
    45044201          {
    4505             for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4202            iTexPosX     = j + iOffsetX;
     4203            iTexPosY     = i + iOffsetY;
     4204            pcTexRec->getCUAddrAndPartIdx( iTexPosX, iTexPosY, iTexCUAddr, iTexAbsPartIdx );
     4205            pcTexCU  = pcTexPic->getCU( iTexCUAddr );
     4206
     4207            if( pcTexCU && !pcTexCU->isIntra(iTexAbsPartIdx) )
    45064208            {
    4507               RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    4508               TComMvField cTexMvField;
    4509               pcTexCU->getMvField( pcTexCU, iTexAbsPartIdx, eCurrRefPicList, cTexMvField );
    4510               Int iValidDepRef = getPic()->isTextRefValid( eCurrRefPicList, cTexMvField.getRefIdx() );
    4511               if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
     4209              for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
    45124210              {
    4513                 TComMv cMv = cTexMvField.getMv() + cMvRounding;
    4514                 cMv >>=2;         
     4211                RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4212                TComMvField cTexMvField;
     4213                pcTexCU->getMvField( pcTexCU, iTexAbsPartIdx, eCurrRefPicList, cTexMvField );
     4214                Int iValidDepRef = getPic()->isTextRefValid( eCurrRefPicList, cTexMvField.getRefIdx() );
     4215                if( (cTexMvField.getRefIdx()>=0) && ( iValidDepRef >= 0 ) )
     4216                {
     4217                  TComMv cMv = cTexMvField.getMv() + cMvRounding;
     4218                  cMv >>=2;         
    45154219#if !(NTT_BUG_FIX_TK54)
    4516                 this->clipMv( cMv );
    4517 #endif
    4518                 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
     4220                  this->clipMv( cMv );
     4221#endif
     4222                  pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iValidDepRef);
     4223                }
    45194224              }
    45204225            }
     4226            puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
     4227            if (puhInterDirSP[iPartition] == 0)
     4228            {
     4229              if (iInterDirSaved != 0)
     4230              {
     4231                puhInterDirSP[iPartition] = iInterDirSaved;
     4232                pcMvFieldSP[2*iPartition] = cMvFieldSaved[0];
     4233                pcMvFieldSP[2*iPartition + 1] = cMvFieldSaved[1];
     4234              }
     4235            }
     4236            if (iPUHeight + iPUWidth == 12)
     4237            {
     4238              if (puhInterDirSP[iPartition] == 3)
     4239              {
     4240                puhInterDirSP[iPartition] = 1;
     4241                pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     4242              }
     4243            }
     4244
     4245            iPartition ++;
    45214246          }
    4522           puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
    4523           if (puhInterDirSP[iPartition] == 0)
    4524           {
    4525             if (iInterDirSaved != 0)
    4526             {
    4527               puhInterDirSP[iPartition] = iInterDirSaved;
    4528               pcMvFieldSP[2*iPartition] = cMvFieldSaved[0];
    4529               pcMvFieldSP[2*iPartition + 1] = cMvFieldSaved[1];
    4530             }
    4531           }
    4532 #if MTK_DIS_SPBIP8X4_H0205
    4533               if (iPUHeight + iPUWidth == 12)
    4534               {
    4535                 if (puhInterDirSP[iPartition] == 3)
    4536                 {
    4537                   puhInterDirSP[iPartition] = 1;
    4538                   pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
    4539                 }
    4540               }
    4541 #endif
    4542 
    4543           iPartition ++;
    45444247        }
    4545       }
    45464248#if H_3D
    45474249      }
     
    45534255    {
    45544256      Int iCnloop = 0;
    4555 #if ETRIKHU_CLEANUP_H0083
    45564257      for(iCnloop = 0; iCnloop < 2; iCnloop ++)
    45574258      {
     
    45684269      m_mergCands[MRG_T].setCand( tmpMV, tmpDir, false, bSPIVMPFlag);
    45694270
    4570 #else
    4571       Bool bRemoveSpa = false; //pruning
    4572 
    4573       for(Int i = 0; i < 2; i ++)
    4574       {
    4575         iCnloop = iPosLeftAbove[i];
    4576         if ( iCnloop == -1 )
    4577         {
    4578           continue;
    4579         }
    4580         if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
    4581         {
    4582           bRemoveSpa                      = true;
    4583           break;
    4584         }     
    4585       }
    4586 
    4587       if (!bRemoveSpa)
    4588       {
    4589         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4590       }
    4591       else
    4592       {
    4593         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
    4594         if (iCnloop<numA1B1B0)
    4595         {
    4596           numA1B1B0--;
    4597         }
    4598         iCountHEVC--;
    4599 
    4600         if (iPosLeftAbove[0] != -1)
    4601         {
    4602           if (iCnloop == iPosLeftAbove[0])
    4603           {
    4604             iPosLeftAbove[0] = -1;
    4605           }
    4606           else
    4607           {
    4608             iPosLeftAbove[0]++;
    4609           }
    4610         }
    4611         if (iPosLeftAbove[1] != -1)
    4612         {
    4613           if (iCnloop == iPosLeftAbove[1])
    4614           {
    4615             iPosLeftAbove[1] = -1;
    4616           }
    4617           else
    4618           {
    4619             if (iCnloop > iPosLeftAbove[1])
    4620             {
    4621               iPosLeftAbove[1]++;
    4622             }
    4623           }
    4624         }
    4625       }
    4626       pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
    4627       pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
    4628 
    4629       puhInterDirNeighbours[iCount] = tmpDir;
    4630 #endif
    46314271      if ( mrgCandIdx == iCount )
    46324272      {
     
    47074347      if( tmpDir != 0 )
    47084348      {
    4709 #if !ETRIKHU_CLEANUP_H0083
    4710         rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4711 #endif
    47124349        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    47134350        m_iUseDDDCandIdx = iCount;
    47144351
    4715 #if ETRIKHU_CLEANUP_H0083
    47164352        m_mergCands[MRG_D].setCand( tmpMV, tmpDir, false, false);
    47174353        if ( mrgCandIdx == iCount )
     
    47204356        }
    47214357        iCount ++;
    4722 #else
    4723         if( tmpDir == 1 )
    4724         {
    4725           pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
    4726         }
    4727         else if( tmpDir == 2  )
    4728         {
    4729           pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
    4730         }
    4731 
    4732         abCandIsInter        [ iCount ] = true;
    4733         puhInterDirNeighbours[ iCount ] = tmpDir;
    4734 
    4735         if ( mrgCandIdx == iCount )
    4736         {
    4737           return;
    4738         }
    4739         iCount ++;
    4740 
    4741         Int iLeftAboveAvail = 0;
    4742         if( iPosLeftAbove[ 0 ] != -1 )
    4743         {
    4744           iPosLeftAbove[ 0 ] = iCount;
    4745           iLeftAboveAvail = 1;
    4746         }
    4747         if( iPosLeftAbove[ 1 ] != -1 )
    4748         {
    4749           iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    4750         }
    4751 #endif
    47524358      }
    47534359    }
     
    47574363  //////// DERIVE IvMC, IvMCShift,IvDCShift, IvDC  Candidates /////
    47584364  /////////////////////////////////////////////////////////////////
    4759 
    4760 #if !ETRIKHU_CLEANUP_H0083
    4761   Int  posIvDC          = -1;
    4762 #endif
    47634365
    47644366  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
     
    47724374  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    47734375
    4774 #if SHARP_SIMPLE_MERGE_H0062
    47754376  ivMvPredFlag &= (nPSW + nPSH > 12);
    4776 #endif
    47774377  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    47784378  {
     
    48074407
    48084408    Bool bRemoveSpa = false; //pruning
    4809 #if !ETRIKHU_CLEANUP_H0083
    4810     Bool bIvMC = false;
    4811     Int iCnloop=0;
    4812 #endif
    48134409
    48144410    if (!bIsDepth)
     
    48164412      for(Int i = 0; i < 2; i ++)
    48174413      {
    4818 #if ETRIKHU_CLEANUP_H0083
    48194414        if ( !m_mergCands[MRG_A1 + i].m_bAvailable ) // prunning to A1, B1
    48204415        {
     
    48264421          break;
    48274422        }     
    4828 #else
    4829         iCnloop = iPosLeftAbove[i];
    4830         if ( iCnloop == -1 )
    4831         {
    4832           continue;
    4833         }
    4834         if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
    4835         {
    4836           bRemoveSpa                      = true;
    4837           break;
    4838         }     
    4839 #endif
    48404423      }
    48414424    }
    48424425    if (bIsDepth)
    48434426    {
    4844 #if ETRIKHU_CLEANUP_H0083
    48454427      if (m_mergCands[MRG_T].m_bAvailable && ivCandDir[0] == m_mergCands[MRG_T].m_uDir && tmpMV[0]==m_mergCands[MRG_T].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_T].m_cMvField[1])
    48464428      {
    48474429        bRemoveSpa                      = true;
    48484430      }
    4849 #else
    4850       iCnloop = iCount-1;
    4851       for(; iCnloop >= 0; iCnloop --)
    4852       {
    4853 #if H_3D_DDD
    4854           if( iCnloop == m_iUseDDDCandIdx )
    4855           {
    4856               continue;
    4857           }
    4858 #endif
    4859         if(ivCandDir[0] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==tmpMV[0] && pcMvFieldNeighbours[(iCnloop<<1)+1]==tmpMV[1])  // F0125 compatible with F0093
    4860         {
    4861           bRemoveSpa                      = true;
    4862           break;
    4863         }
    4864       }
    4865 #endif
    4866     }
    4867 
     4431    }
    48684432    if (!bRemoveSpa)
    48694433    {
    4870 #if !ETRIKHU_CLEANUP_H0083
    4871       bIvMC = true;
    4872       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    4873 
    4874       if (iPosLeftAbove[0] != -1)
    4875       {
    4876         iPosLeftAbove[0]++;
    4877       }
    4878       if (iPosLeftAbove[1] != -1)
    4879       {
    4880         iPosLeftAbove[1]++;
    4881       }
    4882     }
    4883     else if (bRemoveSpa && !bIsDepth)
    4884     {
    4885       bIvMC = true;
    4886       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
    4887 
    4888       if (iCnloop<numA1B1B0)
    4889       {
    4890         numA1B1B0--;
    4891       }
    4892       iCountHEVC--;
    4893 
    4894       if (iPosLeftAbove[0] != -1)
    4895       {
    4896         if (iCnloop == iPosLeftAbove[0])
    4897         {
    4898           iPosLeftAbove[0] = -1;
    4899         }
    4900         else
    4901         {
    4902           iPosLeftAbove[0]++;
    4903         }
    4904       }
    4905       if (iPosLeftAbove[1] != -1)
    4906       {
    4907         if (iCnloop == iPosLeftAbove[1])
    4908         {
    4909           iPosLeftAbove[1] = -1;
    4910         }
    4911         else
    4912         {
    4913           if (iCnloop > iPosLeftAbove[1])
    4914           {
    4915             iPosLeftAbove[1]++;
    4916           }
    4917         }
    4918       }
    4919     }
    4920 
    4921     if (bIvMC)
    4922     {
    4923 #endif
    4924 #if ETRIKHU_CLEANUP_H0083
    49254434      Bool SPIVMPFlag = false;
    4926 #if MTK_DIS_SPBIP8X4_H0205
    49274435      if(!m_pcSlice->getIsDepth())
    4928 #else
    4929       if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    4930 #endif
    49314436      {
    49324437        SPIVMPFlag = true;
     
    49354440      SPIVMPFlag &= !bDBBPFlag;
    49364441#endif
    4937 #else
    4938       if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    4939       {
    4940           pbSPIVMPFlag[iCount] = true;
    4941       }
    4942 #if H_3D_DBBP
    4943       pbSPIVMPFlag[iCount] &= !bDBBPFlag;
    4944 #endif
    4945 #endif
    4946 #if ETRIKHU_CLEANUP_H0083
     4442
    49474443      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);
    4948 #else
    4949       if( ( ivCandDir[0] & 1 ) == 1 )
    4950       {
    4951         pcMvFieldNeighbours[iCount<<1].setMvField( ivCandMv[ 0 ], ivCandRefIdx[ 0 ] );
    4952       }
    4953       if( ( ivCandDir[0] & 2 ) == 2 )
    4954       {
    4955         pcMvFieldNeighbours[(iCount<<1)+1].setMvField( ivCandMv[ 1 ], ivCandRefIdx[ 1 ] );
    4956       }
    4957 
    4958       puhInterDirNeighbours[ iCount ] = ivCandDir[0];
    4959 #endif
    49604444
    49614445      if ( mrgCandIdx == iCount )
     
    49754459
    49764460#if H_3D
    4977 #if ETRIKHU_CLEANUP_H0083
    49784461  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable + m_mergCands[MRG_B0].m_bAvailable;
    4979 #else
    4980   iCount += numA1B1B0;
    4981 #endif
    49824462#else
    49834463  //left
     
    51084588    for(Int i = 0; i < 2; i ++)
    51094589    {
    5110 #if ETRIKHU_CLEANUP_H0083
    51114590      if ( !m_mergCands[MRG_A1+i].m_bAvailable )
    5112 #else
    5113       Int iCnloop = iPosLeftAbove[i];
    5114       if ( iCnloop == -1 )
    5115 #endif
    51164591      {
    51174592        continue;
    51184593      }
    5119 #if ETRIKHU_CLEANUP_H0083
    5120 #if ETRIKHU_BUGFIX_H0083
    51214594      if (ivCandDir[1] == m_mergCands[MRG_A1+i].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+i].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+i].m_cMvField[1])
    5122 #else
    5123       Int offset = 0;
    5124       offset += A1_was_available;
    5125       offset += B1_was_available;
    5126       offset += m_mergCands[MRG_B0].m_bAvailable;
    5127       if (puhInterDirNeighbours[offset] == m_mergCands[MRG_A1+i].m_uDir && pcMvFieldNeighbours[(offset<<1)]==m_mergCands[MRG_A1+i].m_cMvField[0] && pcMvFieldNeighbours[(offset<<1)+1]==m_mergCands[MRG_A1+i].m_cMvField[1])
    5128 #endif
    5129 #else
    5130       if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
    5131 #endif
    51324595      {
    51334596        bRemoveSpa                      = true;
     
    51374600    if(!bRemoveSpa)
    51384601    {
    5139 #if ETRIKHU_CLEANUP_H0083
    51404602#if H_3D_NBDV
    51414603      tmpMV[0].getMv().setIDVFlag (false);
     
    51434605#endif
    51444606      m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false);
    5145 #else
    5146       rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    5147       puhInterDirNeighbours[ iCount ] = ivCandDir[1];
    5148       if( ( ivCandDir[1] & 1 ) == 1 )
    5149       {
    5150         pcMvFieldNeighbours[ iCount<<1    ].setMvField( ivCandMv[ 2 ], ivCandRefIdx[ 2 ] );
    5151       }
    5152       if( ( ivCandDir[1] & 2 ) == 2 )
    5153       {
    5154         pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( ivCandMv[ 3 ], ivCandRefIdx[ 3 ] );
    5155       }
    5156 #if H_3D_NBDV
    5157       pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
    5158       pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false);
    5159 #endif
    5160       posIvDC  = iCount;
    5161 #endif
     4607
    51624608      if ( mrgCandIdx == iCount )
    51634609        return;
     
    51874633      !bARPFlag &&
    51884634#endif
    5189 #if SHARP_SIMPLE_MERGE_H0062
     4635#if H_3D
    51904636      (nPSW + nPSH > 12) &&
    51914637#endif
     
    51934639      !bDBBPFlag &&
    51944640#endif
    5195 #if ETRIKHU_CLEANUP_H0083
    51964641      xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) )
    5197 #else
    5198       xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
    5199 #endif
    52004642  {
    52014643    return;
     
    52134655
    52144656#if H_3D
    5215 #if ETRIKHU_CLEANUP_H0083
    52164657  iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable;
    5217 #else
    5218   iCount += numA0B2;
    5219 #endif
    52204658#else
    52214659  //left bottom
     
    52914729  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    52924730  {
    5293 #if ETRIKHU_CLEANUP_H0083
    52944731    if(xAddIvMRGCand( mrgCandIdx,  iCount, ivCandDir, ivCandMv, ivCandRefIdx ) )
    5295 #else
    5296     if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
    5297 #endif
    52984732    {
    52994733      return;
     
    53064740  }
    53074741#endif
    5308 
    5309 #if H_3D
    5310 #if !ETRIKHU_CLEANUP_H0083
    5311   if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
    5312   {
    5313     iCount = getSlice()->getMaxNumMergeCand();
    5314   }
    5315   else
    5316   {
    5317     iCount = iCountHEVC + iCount3DV;
    5318   }
    5319   numValidMergeCand = iCount;
    5320 #endif
    5321 #else
     4742#if !H_3D
    53224743  if ( getSlice()->getEnableTMVPFlag())
    53234744  {
     
    54074828    }
    54084829  }
    5409   // early termination
     4830  // early termination 
    54104831  if (iCount == getSlice()->getMaxNumMergeCand())
    54114832  {
     
    71766597
    71776598  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7178 #if SEC_VER_DONBDV_H0103
    71796599  if( depthRefineFlag )
    71806600  {
    71816601    cDv.setVer(0);
    71826602  }
    7183 #endif
    71846603
    71856604  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     
    73216740
    73226741  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7323 #if SEC_VER_DONBDV_H0103
    73246742  if( depthRefineFlag )
    73256743  {
    73266744    cDv.setVer(0);
    73276745  }
    7328 #endif
    73296746
    73306747  Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
     
    73476764  if(!m_pcSlice->getIsDepth())
    73486765  {
    7349 #if MTK_DIS_SPBIP8X4_H0205
    73506766    if (!getDBBPFlag(0))
    7351 #else
    7352     if( getPartitionSize(0) == SIZE_2Nx2N )
    7353 #endif
    73546767    {
    73556768      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     
    75086921
    75096922            }
    7510 #if MTK_DIS_SPBIP8X4_H0205
    75116923            if (iSPHeight + iSPWidth == 12)
    75126924            {
     
    75176929              }
    75186930            }
    7519 #endif
    75206931            iPartition ++;
    75216932          }
     
    75396950    iCurrPosY  += ( iHeight >> 1 );
    75406951  }
    7541 #if MTK_DIS_SPBIP8X4_H0205
    75426952  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7543 #else
    7544   for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7545 #endif
    75466953#else
    75476954  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
  • branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComDataCU.h

    r967 r968  
    231231#endif
    232232
    233 #if ETRIKHU_CLEANUP_H0083
     233#if H_3D_IV_MERGE
    234234  TComMotionCand  m_mergCands[MRG_IVSHIFT+1];
    235235  Int           m_baseListidc;
     
    242242  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    243243#if H_3D_VSP
    244 #if ETRIKHU_CLEANUP_H0083
    245244  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount);
    246 #else
    247   Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    248                              Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo);
    249 #endif
    250245#endif
    251246#if H_3D_IV_MERGE
    252 #if ETRIKHU_CLEANUP_H0083
    253247  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
    254 #else
    255   Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv,
    256                                Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo   );
    257 #endif
    258 #if ETRIKHU_CLEANUP_H0083
    259248  Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
    260 #else
    261   Bool          xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int*  ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand );
    262 #endif
    263249#endif
    264250
     
    500486   
    501487#if H_3D
    502 #if !ETRIKHU_CLEANUP_H0083
    503   Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
    504 #endif
    505488  Bool          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    506489  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
     
    656639  Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;}
    657640  Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;}
    658 #if ETRIKHU_CLEANUP_H0083
    659641  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
    660642  Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     
    667649    , Int& numValidMergeCand
    668650    );
    669 #else
    670   Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
    671 #endif
    672651  Void          getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1);
    673652  Void          xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     
    676655#endif
    677656#if H_3D_VSP
    678 #if !ETRIKHU_CLEANUP_H0083
    679                                             , Int* vspFlag
    680 #endif
    681657                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
    682658#endif
    683659#if H_3D_SPIVMP
    684 #if ETRIKHU_CLEANUP_H0083
    685660                                            , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    686 #else
    687                                             , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    688 #endif
    689661#endif
    690662                                            , Int& numValidMergeCand, Int mrgCandIdx = -1
  • branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComMotionInfo.h

    r950 r968  
    198198//! \}
    199199
    200 #if ETRIKHU_CLEANUP_H0083
     200#if H_3D_IV_MERGE
    201201class TComMotionCand
    202202{
  • branches/HTM-11.1-dev0/source/Lib/TLibCommon/TypeDef.h

    r967 r968  
    328328#define MTK_DMM_SIMP_CODE_H0092           1   // Remove CABAC context for DMM1 mode coding
    329329
    330 
    331330#define QC_IV_PRED_CONSTRAINT_H0137       1   // Constraint on inter-view (motion) prediction tools
    332 #define ETRIKHU_BUGFIX_H0083              1   // bug-fix for DV candidate pruning
    333331#define ETRIKHU_CLEANUP_H0083             1   // cleaned-up source code for constructing merging candidate list
    334 #define ETRIKHU_CLEANUP_H0083_MISSING     1   // missing guard macros added by GT
    335 #define SHARP_SIMPLE_MERGE_H0062          1   // Restrict 3D-HEVC merge cand in small PUs
    336 #define MTK_DIS_SPBIP8X4_H0205            1   // Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
    337 
    338 #if H_3D_NBDV
    339 #define SEC_VER_DONBDV_H0103              1   // Vertical DV Restriction for DoNBDV
    340 #endif
    341332#endif
    342333
     
    919910
    920911/// merging candidates
    921 #if ETRIKHU_CLEANUP_H0083
     912#if H_3D
    922913enum DefaultMergCandOrder
    923914{
  • branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r967 r968  
    432432    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    433433    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    434 #if !ETRIKHU_CLEANUP_H0083
    435       ,vspFlag
    436 #endif
    437434      , inheritedVSPDisInfo
    438435#if H_3D_SPIVMP
    439 #if !ETRIKHU_CLEANUP_H0083_MISSING
    440       , bSPIVMPFlag
    441 #endif
    442436      , pcMvFieldSP, puhInterDirSP
    443437#endif
    444438      , numValidMergeCand, uiMergeIndex );
    445439
    446 #if ETRIKHU_CLEANUP_H0083
    447440    m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    448441#if H_3D_SPIVMP
     
    450443#endif
    451444      , numValidMergeCand );
    452 #endif
    453445    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    454446#else
  • branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r967 r968  
    300300          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    301301          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
    302 #if !ETRIKHU_CLEANUP_H0083
    303             ,vspFlag
    304 #endif
    305302            , inheritedVSPDisInfo
    306303#if H_3D_SPIVMP
    307 #if !ETRIKHU_CLEANUP_H0083_MISSING
    308             , bSPIVMPFlag
    309 #endif
    310304            , pcMvFieldSP, puhInterDirSP
    311305#endif
    312306            , numValidMergeCand );
    313 
    314 #if ETRIKHU_CLEANUP_H0083
    315307          pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    316308#if H_3D_SPIVMP
     
    318310#endif
    319311            , numValidMergeCand );
    320 #endif
    321312          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    322313
     
    352343        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    353344        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
    354 #if !ETRIKHU_CLEANUP_H0083
    355           , vspFlag
    356 #endif
    357345          , inheritedVSPDisInfo
    358346#if H_3D_SPIVMP
    359 #if !ETRIKHU_CLEANUP_H0083_MISSING
    360             , bSPIVMPFlag
    361 #endif
    362347          , pcMvFieldSP, puhInterDirSP
    363348#endif
    364349          ,numValidMergeCand, uiMergeIndex );
    365 
    366 #if ETRIKHU_CLEANUP_H0083
    367350        pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
    368351#if H_3D_SPIVMP
     
    370353#endif
    371354          ,numValidMergeCand );
    372 #endif
    373355        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    374356        if(vspFlag[uiMergeIndex])
  • branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r967 r968  
    21582158  {
    21592159    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
    2160 #if MTK_DIS_SPBIP8X4_H0205
    21612160    UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;
    21622161    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
    2163 #endif
    21642162  }
    21652163}
  • branches/HTM-11.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r967 r968  
    18151815    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    18161816    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    1817 #if !ETRIKHU_CLEANUP_H0083
    1818       , vspFlag
    1819 #endif
    18201817      , inheritedVSPDisInfo
    18211818#if H_3D_SPIVMP
    1822 #if !ETRIKHU_CLEANUP_H0083_MISSING
    1823       , bSPIVMPFlag
    1824 #endif
    18251819      , pcMvFieldSP, puhInterDirSP
    18261820#endif
     
    18281822      );
    18291823
    1830 #if ETRIKHU_CLEANUP_H0083
    18311824    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
    18321825#if H_3D_SPIVMP
     
    18351828      , numValidMergeCand
    18361829      );
    1837 #endif
    18381830
    18391831#else
  • branches/HTM-11.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r967 r968  
    36813681      pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    36823682#if H_3D_VSP
    3683 #if !ETRIKHU_CLEANUP_H0083
    3684                                         , vspFlag
    3685 #endif
    36863683                                        , inheritedVSPDisInfo
    36873684#endif
    36883685#if H_3D_SPIVMP
    3689 #if !ETRIKHU_CLEANUP_H0083_MISSING
    3690         , pbSPIVMPFlag
    3691 #endif
    36923686        , pcMvFieldSP, puhInterDirSP
    36933687#endif
     
    36953689        );
    36963690
    3697 #if ETRIKHU_CLEANUP_H0083
    36983691      pcCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
    36993692#if H_3D_VSP
     
    37053698                                        , numValidMergeCand
    37063699        );
    3707 #endif
    37083700#else
    37093701      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     
    37193711    pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    37203712#if H_3D_VSP
    3721 #if !ETRIKHU_CLEANUP_H0083
    3722                                       , vspFlag
    3723 #endif
    37243713                                      , inheritedVSPDisInfo
    37253714#endif
    37263715#if H_3D_SPIVMP
    3727 #if !ETRIKHU_CLEANUP_H0083_MISSING
    3728       , pbSPIVMPFlag
    3729 #endif
    37303716      , pcMvFieldSP, puhInterDirSP
    37313717#endif
     
    37333719      );
    37343720
    3735 #if ETRIKHU_CLEANUP_H0083
    37363721    pcCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
    37373722#if H_3D_VSP
     
    37433728                                      , numValidMergeCand
    37443729      );
    3745 #endif
    37463730#else
    37473731    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
Note: See TracChangeset for help on using the changeset viewer.