Ignore:
Timestamp:
13 Apr 2014, 14:27:40 (10 years ago)
Author:
etri-htm
Message:

H0083 Bug-fix and clean ups on merge list construction

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-10.2-dev1-ETRI/source/Lib/TLibCommon/TComDataCU.cpp

    r897 r911  
    32583258 *   false: otherwise
    32593259 */
     3260#if ETRIKHU_CLEANUP_H0083
     3261inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount)
     3262#else
    32603263inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    32613264  Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
     3265#endif
    32623266{
    32633267  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
     
    32753279  }
    32763280
     3281#if ETRIKHU_CLEANUP_H0083
     3282  TComMvField mvVSP[2];
     3283  UChar dirVSP;
     3284#else
    32773285  rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
     3286#endif
    32783287
    32793288  Bool  refViewAvailFlag = false;
     
    32903299        refViewAvailFlag      = true;
    32913300        predFlag[iRefListIdX] = 1;
     3301#if ETRIKHU_CLEANUP_H0083
     3302        mvVSP[0+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
     3303#if H_3D_NBDV
     3304        mvVSP[0+iRefListIdX].getMv().setIDVFlag (false);
     3305#endif
     3306#else
    32923307        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
    32933308#if H_3D_NBDV
    32943309        pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].getMv().setIDVFlag (false);
    32953310#endif
    3296       }
    3297     }
    3298   }
    3299 
     3311#endif
     3312      }
     3313    }
     3314  }
     3315
     3316#if ETRIKHU_CLEANUP_H0083
     3317  dirVSP = (predFlag[0] | (predFlag[1] << 1));
     3318  m_mergCands[MRG_VSP].setCand( mvVSP, dirVSP, true, false);
     3319#else
    33003320  // Set values to be returned
    33013321  abCandIsInter        [iCount] = true;
    33023322  puhInterDirNeighbours[iCount] = (predFlag[0] | (predFlag[1] << 1));
    33033323  vspFlag              [iCount] = 1;
     3324#endif
    33043325
    33053326  if ( mrgCandIdx == iCount )
     
    33163337
    33173338#if H_3D_IV_MERGE
     3339#if ETRIKHU_CLEANUP_H0083
     3340inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx )
     3341#else
    33183342inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv,
    33193343  Int* ivCandRefIdx, Int iPosIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
     3344#endif
    33203345{
    33213346  for(Int iLoop = 0; iLoop < 2; iLoop ++ )
     
    33253350    {
    33263351      Int iFirDispCand = -1;
     3352#if ETRIKHU_CLEANUP_H0083
     3353      TComMvField mvIvDcShift[2];
     3354      UChar dirIvDcShift;
     3355
     3356      if (xGetPosFirstAvailDmvCand(MRG_IVSHIFT, iFirDispCand))
     3357#else
    33273358      if (xGetPosFirstAvailDmvCand(iCount, pcMvFieldNeighbours, ivCandDir, iPosIvDC, vspFlag, iFirDispCand))
     3359#endif
    33283360      {
    33293361        TComMv cMv;
     3362#if ETRIKHU_CLEANUP_H0083
     3363        cMv = m_mergCands[iFirDispCand].m_cMvField[0].getMv();
     3364#else
    33303365        cMv = pcMvFieldNeighbours[(iFirDispCand<<1)].getMv();
     3366#endif
    33313367        cMv.setHor(cMv.getHor()+4);
    33323368        if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps()))
     
    33383374#endif
    33393375
     3376#if ETRIKHU_CLEANUP_H0083
     3377        dirIvDcShift = m_mergCands[iFirDispCand].m_uDir;
     3378        mvIvDcShift[0].setMvField(cMv, m_mergCands[iFirDispCand].m_cMvField[0].getRefIdx() );
     3379        mvIvDcShift[1].setMvField(m_mergCands[iFirDispCand].m_cMvField[1].getMv(), m_mergCands[iFirDispCand].m_cMvField[1].getRefIdx() );
     3380        m_mergCands[MRG_IVSHIFT].setCand(mvIvDcShift, dirIvDcShift, false, false);
     3381#else
    33403382        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    33413383
     
    33443386        pcMvFieldNeighbours  [ iCount << 1      ].setMvField(cMv, pcMvFieldNeighbours[( iFirDispCand << 1)].getRefIdx() );
    33453387        pcMvFieldNeighbours  [(iCount << 1) + 1 ].setMvField(pcMvFieldNeighbours[(iFirDispCand << 1) + 1].getMv(), pcMvFieldNeighbours[( iFirDispCand << 1) + 1].getRefIdx() );
    3346        
     3388#endif
     3389
    33473390        if( mrgCandIdx == iCount )
    33483391        {
     
    33743417      if( !iLoop && ivCandDir[0] > 0)
    33753418      {
     3419#if ETRIKHU_CLEANUP_H0083
     3420        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])
     3421#else
    33763422        if(tmpDir == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==tmpMV[0] && pcMvFieldNeighbours[1]==tmpMV[1])
     3423#endif
    33773424        {
    33783425            bRemove                         = true;
     
    33813428      if(!bRemove)
    33823429      {
     3430#if ETRIKHU_CLEANUP_H0083
     3431#if H_3D_NBDV
     3432        if(iLoop) // For IvMcShift candidate
     3433        {
     3434          tmpMV[0].getMv().setIDVFlag (false);
     3435          tmpMV[1].getMv().setIDVFlag (false);
     3436        }
     3437#endif
     3438        m_mergCands[MRG_IVSHIFT].setCand(tmpMV, tmpDir, false, false);
     3439#else
    33833440        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    33843441
     
    34003457        }
    34013458#endif
     3459#endif
    34023460        if( mrgCandIdx == iCount )
    34033461        {
     
    34123470}
    34133471
     3472#if ETRIKHU_CLEANUP_H0083
     3473inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
     3474{
     3475  for ( Int currListPos = 0; currListPos < iCount; currListPos++ )
     3476  {
     3477    if ( !m_mergCands[currListPos].m_bAvailable || ( currListPos == MRG_IVMC ) || ( currListPos == MRG_IVDC ) || ( m_mergCands[currListPos].m_iVspFlag != 0 ))
     3478    {
     3479      continue;
     3480    }
     3481    else if((m_mergCands[currListPos].m_bAvailable) && (m_mergCands[currListPos].m_cMvField[0].getRefIdx() != -1 ) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), m_mergCands[currListPos].m_cMvField[0].getRefIdx())->getViewIndex()))
     3482    {
     3483      posFirstAvailDmvCand = currListPos;
     3484      return true;
     3485    }
     3486  }
     3487  return false; 
     3488}
     3489#else
    34143490inline Bool TComDataCU::xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& posFirstAvailDmvCand )
    34153491{
     
    34293505 return false; 
    34303506}
    3431                                      
     3507#endif
     3508
    34323509#endif
    34333510
    34343511#if H_3D
     3512#if ETRIKHU_CLEANUP_H0083
     3513
     3514Void TComDataCU::buildMCL(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
     3515#if H_3D_VSP
     3516  , Int* vspFlag
     3517#endif
     3518#if H_3D_SPIVMP
     3519  , Bool* pbSPIVMPFlag
     3520#endif
     3521  , Int& numValidMergeCand
     3522  )
     3523{
     3524  if (!( getSlice()->getIsDepth() || getSlice()->getViewIndex()>0))  // for only dependent texture
     3525  {
     3526    return;
     3527  }
     3528
     3529  Int iCount = 0;
     3530  TComMv cZeroMv;
     3531
     3532  // init temporal list
     3533  TComMvField extMergeCandList[MRG_MAX_NUM_CANDS_MEM << 1];
     3534  UChar uhInterDirNeighboursExt[MRG_MAX_NUM_CANDS_MEM];
     3535  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ++ui )
     3536  {
     3537    uhInterDirNeighboursExt[ui] = puhInterDirNeighbours[ui];
     3538    extMergeCandList[ui<<1].setMvField(cZeroMv, NOT_VALID);
     3539    extMergeCandList[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
     3540    vspFlag[ui] = 0;
     3541  }
     3542
     3543  // add candidates to temporal list
     3544  // insert MPI ... IvShift candidate
     3545  for (Int i=0; i<=MRG_IVSHIFT; i++)
     3546  {
     3547    if (m_mergCands[i].m_bAvailable)
     3548    {
     3549      m_mergCands[i].getCand(iCount, extMergeCandList, uhInterDirNeighboursExt, vspFlag, pbSPIVMPFlag);
     3550      iCount++;
     3551      if (iCount >= getSlice()->getMaxNumMergeCand())
     3552        break;
     3553    }
     3554  }
     3555
     3556  // insert remaining base candidates
     3557  while (iCount < getSlice()->getMaxNumMergeCand() && m_baseListidc < getSlice()->getMaxNumMergeCand())
     3558  {
     3559    uhInterDirNeighboursExt[iCount] = puhInterDirNeighbours[m_baseListidc];
     3560    extMergeCandList[iCount<<1].setMvField(pcMvFieldNeighbours[m_baseListidc<<1].getMv(), pcMvFieldNeighbours[m_baseListidc<<1].getRefIdx());
     3561    if ( getSlice()->isInterB() )
     3562    {
     3563      extMergeCandList[(iCount<<1)+1].setMvField(pcMvFieldNeighbours[(m_baseListidc<<1)+1].getMv(), pcMvFieldNeighbours[(m_baseListidc<<1)+1].getRefIdx());
     3564    }
     3565    m_baseListidc++;
     3566    iCount++;
     3567  }
     3568
     3569  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ )
     3570  {
     3571    puhInterDirNeighbours[ui] = 0;
     3572    pcMvFieldNeighbours[ui<<1].setMvField(cZeroMv, NOT_VALID);
     3573    pcMvFieldNeighbours[(ui<<1)+1].setMvField(cZeroMv, NOT_VALID);
     3574  }
     3575  // copy extMergeCandList to output
     3576  for( UInt ui = 0; ui < getSlice()->getMaxNumMergeCand(); ui++ )
     3577  {
     3578    puhInterDirNeighbours[ui] = uhInterDirNeighboursExt[ui];
     3579    pcMvFieldNeighbours[ui<<1].setMvField(extMergeCandList[ui<<1].getMv(), extMergeCandList[ui<<1].getRefIdx());
     3580    if ( getSlice()->isInterB() )
     3581      pcMvFieldNeighbours[(ui<<1)+1].setMvField(extMergeCandList[(ui<<1)+1].getMv(), extMergeCandList[(ui<<1)+1].getRefIdx());
     3582  }
     3583  numValidMergeCand = iCount;
     3584  assert(iCount == getSlice()->getMaxNumMergeCand());
     3585}
     3586#else
    34353587Void TComDataCU::rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV)
    34363588{
     
    34533605  return;
    34543606}
     3607#endif
    34553608
    34563609/** Constructs a list of merging candidates
     
    38263979#endif
    38273980#if H_3D_VSP
    3828       , Int* vspFlag
     3981#if !ETRIKHU_CLEANUP_H0083
     3982  , Int* vspFlag
     3983#endif
    38293984      , InheritedVSPDisInfo*  inheritedVSPDisInfo
    38303985#endif
    38313986#if H_3D_SPIVMP
     3987#if ETRIKHU_CLEANUP_H0083
     3988      , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     3989#else
    38323990      , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     3991#endif
    38333992#endif
    38343993      , Int& numValidMergeCand, Int mrgCandIdx
     
    38414000  ////////////////////////////
    38424001  TComMv cZeroMv;
     4002#if !ETRIKHU_CLEANUP_H0083
    38434003  Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];
     4004#endif
    38444005#else
    38454006  Bool abCandIsInter[ MRG_MAX_NUM_CANDS ];
     
    39104071
    39114072#if H_3D
     4073#if !ETRIKHU_CLEANUP_H0083
    39124074  Int  iPosLeftAbove[2] = {-1, -1};
    39134075
     
    39164078  Int numA1B1B0 = 0;
    39174079  Int numA0B2 = 0;
    3918 
     4080#endif
    39194081#if H_3D_NBDV
    39204082  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 
     
    39254087#endif
    39264088
     4089
     4090#if ETRIKHU_CLEANUP_H0083
     4091
     4092
     4093  // Clean version for MCL construction align with WD
     4094  // init mergCands list
     4095  for (Int i = 0; i<MRG_IVSHIFT+1; i++)
     4096  {
     4097    m_mergCands[i].init();
     4098  }
     4099
     4100  m_baseListidc = 0;
     4101
     4102  //left
     4103  UInt uiLeftPartIdx = 0;
     4104  TComDataCU* pcCULeft = 0;
     4105  pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 
     4106
     4107  if (getAvailableFlagA1())
     4108  {
     4109    m_mergCands[MRG_A1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4110#if H_3D_VSP
     4111    ,
     4112      (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
     4113#if H_3D_IC
     4114      && !bICFlag
     4115#endif
     4116#if H_3D_ARP
     4117      && !bARPFlag
     4118#endif
     4119      )
     4120#endif
     4121      , false
     4122      );
     4123    m_baseListidc++;
     4124  }
     4125
     4126  // above
     4127  UInt uiAbovePartIdx = 0;
     4128  TComDataCU* pcCUAbove = 0;
     4129  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
     4130
     4131  if (getAvailableFlagB1())
     4132  {
     4133    m_mergCands[MRG_B1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4134#if H_3D_VSP
     4135    ,
     4136      ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
     4137#if H_3D_IC
     4138      && !bICFlag
     4139#endif
     4140#if H_3D_ARP
     4141      && !bARPFlag
     4142#endif
     4143      )
     4144#endif
     4145      , false
     4146      );
     4147    m_baseListidc++;
     4148  }
     4149
     4150  // above right
     4151  UInt uiAboveRightPartIdx = 0;
     4152  TComDataCU* pcCUAboveRight = 0;
     4153  pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
     4154
     4155  if (getAvailableFlagB0())
     4156  {
     4157    m_mergCands[MRG_B0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4158#if H_3D_VSP
     4159    ,
     4160      ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
     4161#if H_3D_IC
     4162      && !bICFlag
     4163#endif
     4164#if H_3D_ARP
     4165      && !bARPFlag
     4166#endif
     4167      )
     4168#endif
     4169      , false
     4170      );
     4171    m_baseListidc++;
     4172  }
     4173
     4174  // left bottom
     4175  UInt uiLeftBottomPartIdx = 0;
     4176  TComDataCU* pcCULeftBottom = getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
     4177
     4178  if (getAvailableFlagA0())
     4179  {
     4180    m_mergCands[MRG_A0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4181#if H_3D_VSP
     4182    ,
     4183      (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
     4184#if H_3D_IC
     4185      && !bICFlag
     4186#endif
     4187#if H_3D_ARP
     4188      && !bARPFlag
     4189#endif
     4190      )
     4191#endif
     4192      , false
     4193      );
     4194    m_baseListidc++;
     4195  }
     4196
     4197  // above left
     4198  UInt uiAboveLeftPartIdx = 0;
     4199  TComDataCU* pcCUAboveLeft = 0;
     4200  pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
     4201
     4202  if (getAvailableFlagB2())
     4203  {
     4204    m_mergCands[MRG_B2].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4205#if H_3D_VSP
     4206    ,
     4207      ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
     4208#if H_3D_IC
     4209      && !bICFlag
     4210#endif
     4211#if H_3D_ARP
     4212      && !bARPFlag
     4213#endif
     4214      )
     4215#endif
     4216      , false
     4217      );
     4218    m_baseListidc++;
     4219  }
     4220
     4221
     4222#if !ETRIKHU_BUGFIX_H0083
     4223  Bool A1_was_available = m_mergCands[MRG_A1].m_bAvailable;
     4224  Bool B1_was_available = m_mergCands[MRG_B1].m_bAvailable;
     4225#endif
     4226
     4227
     4228#else
    39274229  //left
    39284230  UInt uiLeftPartIdx = 0;
     
    40414343  iCountHEVC = numValidMergeCand;
    40424344#endif
     4345#endif
    40434346
    40444347
     
    40544357    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    40554358    tmpDir        =  0;
     4359
     4360#if ETRIKHU_CLEANUP_H0083
     4361    Bool bSPIVMPFlag = false;
     4362#endif
    40564363
    40574364    TComPic * pcTexPic = m_pcSlice->getTexturePic();
     
    41264433                      if (iDefaultRefPOC == m_pcSlice->getRefPOC(eCurrRefPicList, iRefPicList))
    41274434                      {
     4435#if ETRIKHU_CLEANUP_H0083
     4436                        bSPIVMPFlag = true;
     4437#else
    41284438                          pbSPIVMPFlag[iCount] = true;
     4439#endif
    41294440                          TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
    41304441                          cMv >>= 2;
     
    41374448          }
    41384449      }
     4450#if ETRIKHU_CLEANUP_H0083
     4451      if ( bSPIVMPFlag == true )
     4452#else
    41394453      if ( pbSPIVMPFlag[iCount] == true )
     4454#endif
    41404455      {   
    41414456          iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
     
    41914506                if (iInterDirSaved ==0)
    41924507                {
     4508#if ETRIKHU_CLEANUP_H0083
     4509                  bSPIVMPFlag = true;
     4510#else
    41934511                  pbSPIVMPFlag[iCount] = true;
     4512#endif
    41944513                  tmpDir = puhInterDirSP[iPartition];
    41954514                  tmpMV[0] = pcMvFieldSP[2*iPartition];
     
    42234542    {
    42244543      Int iCnloop = 0;
     4544#if ETRIKHU_CLEANUP_H0083
     4545      for(iCnloop = 0; iCnloop < 2; iCnloop ++)
     4546      {
     4547        if ( !m_mergCands[MRG_A1+iCnloop].m_bAvailable )  // prunning to A1, B1
     4548        {
     4549          continue;
     4550        }
     4551        if (tmpDir == m_mergCands[MRG_A1+iCnloop].m_uDir && tmpMV[0]==m_mergCands[MRG_A1+iCnloop].m_cMvField[0] && tmpMV[1]==m_mergCands[MRG_A1+iCnloop].m_cMvField[1])
     4552        {
     4553          m_mergCands[MRG_A1+iCnloop].m_bAvailable = false;
     4554          break;
     4555        }     
     4556      }
     4557      m_mergCands[MRG_T].setCand( tmpMV, tmpDir, false, bSPIVMPFlag);
     4558
     4559#else
    42254560      Bool bRemoveSpa = false; //pruning
    42264561
     
    42824617
    42834618      puhInterDirNeighbours[iCount] = tmpDir;
    4284 
     4619#endif
    42854620      if ( mrgCandIdx == iCount )
    42864621      {
     
    43614696      if( tmpDir != 0 )
    43624697      {
     4698#if !ETRIKHU_CLEANUP_H0083
    43634699        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4700#endif
    43644701        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    43654702        m_iUseDDDCandIdx = iCount;
    43664703
     4704#if ETRIKHU_CLEANUP_H0083
     4705        m_mergCands[MRG_D].setCand( tmpMV, tmpDir, false, false);
     4706        if ( mrgCandIdx == iCount )
     4707        {
     4708          return;
     4709        }
     4710        iCount ++;
     4711#else
    43674712        if( tmpDir == 1 )
    43684713        {
     
    43934738          iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    43944739        }
     4740#endif
    43954741      }
    43964742    }
     
    44014747  /////////////////////////////////////////////////////////////////
    44024748
     4749#if !ETRIKHU_CLEANUP_H0083
    44034750  Int  posIvDC          = -1;
     4751#endif
    44044752
    44054753  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
     
    44414789
    44424790    Bool bRemoveSpa = false; //pruning
     4791#if !ETRIKHU_CLEANUP_H0083
    44434792    Bool bIvMC = false;
    44444793    Int iCnloop=0;
     4794#endif
    44454795
    44464796    if (!bIsDepth)
     
    44484798      for(Int i = 0; i < 2; i ++)
    44494799      {
     4800#if ETRIKHU_CLEANUP_H0083
     4801        if ( !m_mergCands[MRG_A1 + i].m_bAvailable ) // prunning to A1, B1
     4802        {
     4803          continue;
     4804        }
     4805        if (ivCandDir[0] == 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])
     4806        {
     4807          m_mergCands[MRG_A1+i].m_bAvailable = false;
     4808          break;
     4809        }     
     4810#else
    44504811        iCnloop = iPosLeftAbove[i];
    44514812        if ( iCnloop == -1 )
     
    44584819          break;
    44594820        }     
     4821#endif
    44604822      }
    44614823    }
    44624824    if (bIsDepth)
    44634825    {
     4826#if ETRIKHU_CLEANUP_H0083
     4827      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])
     4828      {
     4829        bRemoveSpa                      = true;
     4830      }
     4831#else
    44644832      iCnloop = iCount-1;
    44654833      for(; iCnloop >= 0; iCnloop --)
     
    44774845        }
    44784846      }
     4847#endif
    44794848    }
    44804849
    44814850    if (!bRemoveSpa)
    44824851    {
     4852#if !ETRIKHU_CLEANUP_H0083
    44834853      bIvMC = true;
    44844854      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
     
    45334903    if (bIvMC)
    45344904    {
     4905#endif
     4906#if ETRIKHU_CLEANUP_H0083
     4907      Bool SPIVMPFlag = false;
     4908      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
     4909      {
     4910        SPIVMPFlag = true;
     4911      }
     4912#if H_3D_DBBP
     4913      SPIVMPFlag &= !bDBBPFlag;
     4914#endif
     4915#else
    45354916      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    45364917      {
     
    45404921      pbSPIVMPFlag[iCount] &= !bDBBPFlag;
    45414922#endif
     4923#endif
     4924#if ETRIKHU_CLEANUP_H0083
     4925      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);
     4926#else
    45424927      if( ( ivCandDir[0] & 1 ) == 1 )
    45434928      {
     
    45504935
    45514936      puhInterDirNeighbours[ iCount ] = ivCandDir[0];
     4937#endif
    45524938
    45534939      if ( mrgCandIdx == iCount )
     
    45674953
    45684954#if H_3D
     4955#if ETRIKHU_CLEANUP_H0083
     4956  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable + m_mergCands[MRG_B0].m_bAvailable;
     4957#else
    45694958  iCount += numA1B1B0;
     4959#endif
    45704960#else
    45714961  //left
     
    46965086    for(Int i = 0; i < 2; i ++)
    46975087    {
     5088#if ETRIKHU_CLEANUP_H0083
     5089      if ( !m_mergCands[MRG_A1+i].m_bAvailable )
     5090#else
    46985091      Int iCnloop = iPosLeftAbove[i];
    46995092      if ( iCnloop == -1 )
     5093#endif
    47005094      {
    47015095        continue;
    47025096      }
     5097#if ETRIKHU_CLEANUP_H0083
     5098#if ETRIKHU_BUGFIX_H0083
     5099      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])
     5100#else
     5101      Int offset = 0;
     5102      offset += A1_was_available;
     5103      offset += B1_was_available;
     5104      offset += m_mergCands[MRG_B0].m_bAvailable;
     5105      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])
     5106#endif
     5107#else
    47035108      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
     5109#endif
    47045110      {
    47055111        bRemoveSpa                      = true;
     
    47095115    if(!bRemoveSpa)
    47105116    {
     5117#if ETRIKHU_CLEANUP_H0083
     5118#if H_3D_NBDV
     5119      tmpMV[0].getMv().setIDVFlag (false);
     5120      tmpMV[1].getMv().setIDVFlag (false);
     5121#endif
     5122      m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false);
     5123#else
    47115124      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    47125125      puhInterDirNeighbours[ iCount ] = ivCandDir[1];
     
    47245137#endif
    47255138      posIvDC  = iCount;
     5139#endif
    47265140      if ( mrgCandIdx == iCount )
    47275141        return;
     
    47515165      !bARPFlag &&
    47525166#endif
     5167#if ETRIKHU_CLEANUP_H0083
     5168      xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) )
     5169#else
    47535170      xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     5171#endif
    47545172  {
    47555173    return;
     
    47675185
    47685186#if H_3D
     5187#if ETRIKHU_CLEANUP_H0083
     5188  iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable;
     5189#else
    47695190  iCount += numA0B2;
     5191#endif
    47705192#else
    47715193  //left bottom
     
    48415263  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    48425264  {
     5265#if ETRIKHU_CLEANUP_H0083
     5266    if(xAddIvMRGCand( mrgCandIdx,  iCount, ivCandDir, ivCandMv, ivCandRefIdx ) )
     5267#else
    48435268    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     5269#endif
    48445270    {
    48455271      return;
     
    48545280
    48555281#if H_3D
     5282#if !ETRIKHU_CLEANUP_H0083
    48565283  if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
    48575284  {
     
    48635290  }
    48645291  numValidMergeCand = iCount;
     5292#endif
    48655293#else
    48665294  if ( getSlice()->getEnableTMVPFlag())
Note: See TracChangeset for help on using the changeset viewer.