Changeset 935 in 3DVCSoftware


Ignore:
Timestamp:
22 Apr 2014, 15:17:54 (10 years ago)
Author:
tech
Message:

Merged 10.2-dev1-MediaTek@934.

Location:
branches/HTM-10.2-dev0/source/Lib
Files:
10 edited

Legend:

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

    r888 r935  
    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() );
     3388#endif
    33463389       
    33473390        if( mrgCandIdx == iCount )
     
    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}
     3507#endif
    34313508                                     
    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
     3981#if !ETRIKHU_CLEANUP_H0083
    38283982      , 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 ];
     
    39074068#if H_3D_DBBP
    39084069  Bool bDBBPFlag = getDBBPFlag(uiAbsPartIdx);
     4070#if MTK_DIS_SPBIP8X4_H0205
     4071  assert(bDBBPFlag == getDBBPFlag(0)); 
     4072#endif
    39094073#endif
    39104074
    39114075#if H_3D
     4076#if !ETRIKHU_CLEANUP_H0083
    39124077  Int  iPosLeftAbove[2] = {-1, -1};
    39134078
     
    39164081  Int numA1B1B0 = 0;
    39174082  Int numA0B2 = 0;
    3918 
     4083#endif
    39194084#if H_3D_NBDV
    39204085  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++) 
     
    39254090#endif
    39264091
     4092
     4093#if ETRIKHU_CLEANUP_H0083
     4094
     4095
     4096  // Clean version for MCL construction align with WD
     4097  // init mergCands list
     4098  for (Int i = 0; i<MRG_IVSHIFT+1; i++)
     4099  {
     4100    m_mergCands[i].init();
     4101  }
     4102
     4103  m_baseListidc = 0;
     4104
     4105  //left
     4106  UInt uiLeftPartIdx = 0;
     4107  TComDataCU* pcCULeft = 0;
     4108  pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB ); 
     4109
     4110  if (getAvailableFlagA1())
     4111  {
     4112    m_mergCands[MRG_A1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4113#if H_3D_VSP
     4114    ,
     4115      (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
     4116#if H_3D_IC
     4117      && !bICFlag
     4118#endif
     4119#if H_3D_ARP
     4120      && !bARPFlag
     4121#endif
     4122      )
     4123#endif
     4124      , false
     4125      );
     4126    m_baseListidc++;
     4127  }
     4128
     4129  // above
     4130  UInt uiAbovePartIdx = 0;
     4131  TComDataCU* pcCUAbove = 0;
     4132  pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT );
     4133
     4134  if (getAvailableFlagB1())
     4135  {
     4136    m_mergCands[MRG_B1].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4137#if H_3D_VSP
     4138    ,
     4139      ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0)
     4140#if H_3D_IC
     4141      && !bICFlag
     4142#endif
     4143#if H_3D_ARP
     4144      && !bARPFlag
     4145#endif
     4146      )
     4147#endif
     4148      , false
     4149      );
     4150    m_baseListidc++;
     4151  }
     4152
     4153  // above right
     4154  UInt uiAboveRightPartIdx = 0;
     4155  TComDataCU* pcCUAboveRight = 0;
     4156  pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT );
     4157
     4158  if (getAvailableFlagB0())
     4159  {
     4160    m_mergCands[MRG_B0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4161#if H_3D_VSP
     4162    ,
     4163      ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0)
     4164#if H_3D_IC
     4165      && !bICFlag
     4166#endif
     4167#if H_3D_ARP
     4168      && !bARPFlag
     4169#endif
     4170      )
     4171#endif
     4172      , false
     4173      );
     4174    m_baseListidc++;
     4175  }
     4176
     4177  // left bottom
     4178  UInt uiLeftBottomPartIdx = 0;
     4179  TComDataCU* pcCULeftBottom = getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );
     4180
     4181  if (getAvailableFlagA0())
     4182  {
     4183    m_mergCands[MRG_A0].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4184#if H_3D_VSP
     4185    ,
     4186      (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
     4187#if H_3D_IC
     4188      && !bICFlag
     4189#endif
     4190#if H_3D_ARP
     4191      && !bARPFlag
     4192#endif
     4193      )
     4194#endif
     4195      , false
     4196      );
     4197    m_baseListidc++;
     4198  }
     4199
     4200  // above left
     4201  UInt uiAboveLeftPartIdx = 0;
     4202  TComDataCU* pcCUAboveLeft = 0;
     4203  pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr );
     4204
     4205  if (getAvailableFlagB2())
     4206  {
     4207    m_mergCands[MRG_B2].setCand( &pcMvFieldNeighbours[m_baseListidc<<1], puhInterDirNeighbours[m_baseListidc]
     4208#if H_3D_VSP
     4209    ,
     4210      ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0)
     4211#if H_3D_IC
     4212      && !bICFlag
     4213#endif
     4214#if H_3D_ARP
     4215      && !bARPFlag
     4216#endif
     4217      )
     4218#endif
     4219      , false
     4220      );
     4221    m_baseListidc++;
     4222  }
     4223
     4224
     4225#if !ETRIKHU_BUGFIX_H0083
     4226  Bool A1_was_available = m_mergCands[MRG_A1].m_bAvailable;
     4227  Bool B1_was_available = m_mergCands[MRG_B1].m_bAvailable;
     4228#endif
     4229
     4230
     4231#else
    39274232  //left
    39284233  UInt uiLeftPartIdx = 0;
     
    40414346  iCountHEVC = numValidMergeCand;
    40424347#endif
     4348#endif
    40434349
    40444350
     
    40494355  /////////////////////////////////////////////
    40504356
     4357#if SHARP_SIMPLE_MERGE_H0062
     4358  bMPIFlag &= (nPSW + nPSH > 12);
     4359#endif
    40514360  if( bMPIFlag)
    40524361  {
     
    40544363    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    40554364    tmpDir        =  0;
     4365
     4366#if ETRIKHU_CLEANUP_H0083
     4367    Bool bSPIVMPFlag = false;
     4368#endif
    40564369
    40574370    TComPic * pcTexPic = m_pcSlice->getTexturePic();
     
    40924405      Int         iTexPosX, iTexPosY;
    40934406      const TComMv cMvRounding( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
     4407#if MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
     4408     
     4409      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iPUWidth ) >> 1 )  * iPUWidth + ( iPUWidth >> 1 );
     4410      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iPUHeight ) >> 1 )  * iPUHeight + (iPUHeight >> 1);
     4411      Int         iTexCenterCUAddr, iTexCenterAbsPartIdx;
     4412
     4413      if(iWidth == iPUWidth && iHeight == iPUHeight)
     4414      {
     4415          iCenterPosX = iCurrPosX + (iWidth >> 1);
     4416          iCenterPosY = iCurrPosY + (iHeight >> 1);
     4417      }
     4418
     4419      // derivation of center motion parameters from the collocated texture CU
     4420
     4421      pcTexRec->getCUAddrAndPartIdx( iCenterPosX , iCenterPosY , iTexCenterCUAddr, iTexCenterAbsPartIdx );
     4422      TComDataCU* pcDefaultCU    = pcTexPic->getCU( iTexCenterCUAddr );
     4423
     4424      if( pcDefaultCU->getPredictionMode( iTexCenterAbsPartIdx ) != MODE_INTRA )
     4425      {
     4426          for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     4427          {
     4428              RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     4429
     4430              TComMvField cDefaultMvField;
     4431              pcDefaultCU->getMvField( pcDefaultCU, iTexCenterAbsPartIdx, eCurrRefPicList, cDefaultMvField );
     4432              Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     4433              if (iDefaultRefIdx >= 0)
     4434              {
     4435                  Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eCurrRefPicList, iDefaultRefIdx);
     4436                  for (Int iRefPicList = 0; iRefPicList < m_pcSlice->getNumRefIdx( eCurrRefPicList ); iRefPicList++)
     4437                  {
     4438                      if (iDefaultRefPOC == m_pcSlice->getRefPOC(eCurrRefPicList, iRefPicList))
     4439                      {
     4440#if ETRIKHU_CLEANUP_H0083
     4441                        bSPIVMPFlag = true;
     4442#else
     4443                          pbSPIVMPFlag[iCount] = true;
     4444#endif
     4445                          TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
     4446                          cMv >>= 2;
     4447                          clipMv( cMv );
     4448                          cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
     4449                          break;
     4450                      }
     4451                  }
     4452              }
     4453          }
     4454      }
     4455#if ETRIKHU_CLEANUP_H0083
     4456      if ( bSPIVMPFlag == true )
     4457#else
     4458      if ( pbSPIVMPFlag[iCount] == true )
     4459#endif
     4460      {   
     4461          iInterDirSaved = (cMvFieldSaved[0].getRefIdx()!=-1 ? 1: 0) + (cMvFieldSaved[1].getRefIdx()!=-1 ? 2: 0);
     4462          tmpDir = iInterDirSaved;
     4463          tmpMV[0] = cMvFieldSaved[0];
     4464          tmpMV[1] = cMvFieldSaved[1];
     4465      }
     4466
     4467      if ( iInterDirSaved != 0 )
     4468      {
     4469#endif
    40944470      for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iPUHeight)
    40954471      {
     
    41304506            }
    41314507          }
     4508#if MTK_DIS_SPBIP8X4_H0205
     4509              if (iPUHeight + iPUWidth == 12)
     4510              {
     4511                if (puhInterDirSP[iPartition] == 3)
     4512                {
     4513                  puhInterDirSP[iPartition] = 1;
     4514                  pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     4515                }
     4516              }
     4517#endif
     4518#if !MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
    41324519          else
    41334520          {
    41344521            if (iInterDirSaved ==0)
    41354522            {
     4523#if ETRIKHU_CLEANUP_H0083
     4524                  bSPIVMPFlag = true;
     4525#else
    41364526              pbSPIVMPFlag[iCount] = true;
     4527#endif
    41374528              tmpDir = puhInterDirSP[iPartition];
    41384529              tmpMV[0] = pcMvFieldSP[2*iPartition];
     
    41534544            cMvFieldSaved[1] = pcMvFieldSP[2*iPartition + 1];
    41544545          }
     4546#endif
    41554547          iPartition ++;
    41564548        }
    41574549      }
     4550#if MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133
     4551      }
     4552#endif
    41584553#if H_3D_FCO
    41594554    }
     
    41624557    {
    41634558      Int iCnloop = 0;
     4559#if ETRIKHU_CLEANUP_H0083
     4560      for(iCnloop = 0; iCnloop < 2; iCnloop ++)
     4561      {
     4562        if ( !m_mergCands[MRG_A1+iCnloop].m_bAvailable )  // prunning to A1, B1
     4563        {
     4564          continue;
     4565        }
     4566        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])
     4567        {
     4568          m_mergCands[MRG_A1+iCnloop].m_bAvailable = false;
     4569          break;
     4570        }     
     4571      }
     4572      m_mergCands[MRG_T].setCand( tmpMV, tmpDir, false, bSPIVMPFlag);
     4573
     4574#else
    41644575      Bool bRemoveSpa = false; //pruning
    41654576
     
    42214632
    42224633      puhInterDirNeighbours[iCount] = tmpDir;
    4223 
     4634#endif
    42244635      if ( mrgCandIdx == iCount )
    42254636      {
     
    43004711      if( tmpDir != 0 )
    43014712      {
     4713#if !ETRIKHU_CLEANUP_H0083
    43024714        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4715#endif
    43034716        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
    43044717        m_iUseDDDCandIdx = iCount;
    43054718
     4719#if ETRIKHU_CLEANUP_H0083
     4720        m_mergCands[MRG_D].setCand( tmpMV, tmpDir, false, false);
     4721        if ( mrgCandIdx == iCount )
     4722        {
     4723          return;
     4724        }
     4725        iCount ++;
     4726#else
    43064727        if( tmpDir == 1 )
    43074728        {
     
    43324753          iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
    43334754        }
     4755#endif
    43344756      }
    43354757    }
     
    43404762  /////////////////////////////////////////////////////////////////
    43414763
     4764#if !ETRIKHU_CLEANUP_H0083
    43424765  Int  posIvDC          = -1;
     4766#endif
    43434767
    43444768  // { IvMCL0, IvMCL1, IvDCL0, IvDCL1, IvMCL0Shift, IvMCL1Shift, IvDCL0Shift, IvDCL1Shift }; 
     
    43524776  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    43534777
     4778#if SHARP_SIMPLE_MERGE_H0062
     4779  ivMvPredFlag &= (nPSW + nPSH > 12);
     4780#endif
    43544781  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    43554782  {
     4783#if SEC_ADAPT_DISABLE_IVMP
     4784    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP, bICFlag );
     4785#else
    43564786    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
     4787#endif
    43574788  } 
    43584789
     
    43804811
    43814812    Bool bRemoveSpa = false; //pruning
     4813#if !ETRIKHU_CLEANUP_H0083
    43824814    Bool bIvMC = false;
    43834815    Int iCnloop=0;
     4816#endif
    43844817
    43854818    if (!bIsDepth)
     
    43874820      for(Int i = 0; i < 2; i ++)
    43884821      {
     4822#if ETRIKHU_CLEANUP_H0083
     4823        if ( !m_mergCands[MRG_A1 + i].m_bAvailable ) // prunning to A1, B1
     4824        {
     4825          continue;
     4826        }
     4827        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])
     4828        {
     4829          m_mergCands[MRG_A1+i].m_bAvailable = false;
     4830          break;
     4831        }     
     4832#else
    43894833        iCnloop = iPosLeftAbove[i];
    43904834        if ( iCnloop == -1 )
     
    43974841          break;
    43984842        }     
     4843#endif
    43994844      }
    44004845    }
    44014846    if (bIsDepth)
    44024847    {
     4848#if ETRIKHU_CLEANUP_H0083
     4849      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])
     4850      {
     4851        bRemoveSpa                      = true;
     4852      }
     4853#else
    44034854      iCnloop = iCount-1;
    44044855      for(; iCnloop >= 0; iCnloop --)
     
    44164867        }
    44174868      }
     4869#endif
    44184870    }
    44194871
    44204872    if (!bRemoveSpa)
    44214873    {
     4874#if !ETRIKHU_CLEANUP_H0083
    44224875      bIvMC = true;
    44234876      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
     
    44724925    if (bIvMC)
    44734926    {
     4927#endif
     4928#if ETRIKHU_CLEANUP_H0083
     4929      Bool SPIVMPFlag = false;
     4930#if MTK_DIS_SPBIP8X4_H0205
     4931      if(!m_pcSlice->getIsDepth())
     4932#else
     4933      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
     4934#endif
     4935      {
     4936        SPIVMPFlag = true;
     4937      }
     4938#if H_3D_DBBP
     4939      SPIVMPFlag &= !bDBBPFlag;
     4940#endif
     4941#else
    44744942      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
    44754943      {
     
    44794947      pbSPIVMPFlag[iCount] &= !bDBBPFlag;
    44804948#endif
     4949#endif
     4950#if ETRIKHU_CLEANUP_H0083
     4951      m_mergCands[MRG_IVMC].setCand( tmpMV, ivCandDir[0], false, SPIVMPFlag);
     4952#else
    44814953      if( ( ivCandDir[0] & 1 ) == 1 )
    44824954      {
     
    44894961
    44904962      puhInterDirNeighbours[ iCount ] = ivCandDir[0];
     4963#endif
    44914964
    44924965      if ( mrgCandIdx == iCount )
     
    45064979
    45074980#if H_3D
     4981#if ETRIKHU_CLEANUP_H0083
     4982  iCount += m_mergCands[MRG_A1].m_bAvailable + m_mergCands[MRG_B1].m_bAvailable + m_mergCands[MRG_B0].m_bAvailable;
     4983#else
    45084984  iCount += numA1B1B0;
     4985#endif
    45094986#else
    45104987  //left
     
    46355112    for(Int i = 0; i < 2; i ++)
    46365113    {
     5114#if ETRIKHU_CLEANUP_H0083
     5115      if ( !m_mergCands[MRG_A1+i].m_bAvailable )
     5116#else
    46375117      Int iCnloop = iPosLeftAbove[i];
    46385118      if ( iCnloop == -1 )
     5119#endif
    46395120      {
    46405121        continue;
    46415122      }
     5123#if ETRIKHU_CLEANUP_H0083
     5124#if ETRIKHU_BUGFIX_H0083
     5125      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])
     5126#else
     5127      Int offset = 0;
     5128      offset += A1_was_available;
     5129      offset += B1_was_available;
     5130      offset += m_mergCands[MRG_B0].m_bAvailable;
     5131      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])
     5132#endif
     5133#else
    46425134      if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1])
     5135#endif
    46435136      {
    46445137        bRemoveSpa                      = true;
     
    46485141    if(!bRemoveSpa)
    46495142    {
     5143#if ETRIKHU_CLEANUP_H0083
     5144#if H_3D_NBDV
     5145      tmpMV[0].getMv().setIDVFlag (false);
     5146      tmpMV[1].getMv().setIDVFlag (false);
     5147#endif
     5148      m_mergCands[MRG_IVDC].setCand( tmpMV, ivCandDir[1], false, false);
     5149#else
    46505150      rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    46515151      puhInterDirNeighbours[ iCount ] = ivCandDir[1];
     
    46635163#endif
    46645164      posIvDC  = iCount;
     5165#endif
    46655166      if ( mrgCandIdx == iCount )
    46665167        return;
     
    46905191      !bARPFlag &&
    46915192#endif
     5193#if SHARP_SIMPLE_MERGE_H0062
     5194      (nPSW + nPSH > 12) &&
     5195#endif
     5196#if ETRIKHU_CLEANUP_H0083
     5197      xAddVspCand( mrgCandIdx, &cDisInfo, iCount ) )
     5198#else
    46925199      xAddVspCand( mrgCandIdx, &cDisInfo, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     5200#endif
    46935201  {
    46945202    return;
     
    47065214
    47075215#if H_3D
     5216#if ETRIKHU_CLEANUP_H0083
     5217  iCount += m_mergCands[MRG_A0].m_bAvailable + m_mergCands[MRG_B2].m_bAvailable;
     5218#else
    47085219  iCount += numA0B2;
     5220#endif
    47095221#else
    47105222  //left bottom
     
    47805292  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    47815293  {
     5294#if ETRIKHU_CLEANUP_H0083
     5295    if(xAddIvMRGCand( mrgCandIdx,  iCount, ivCandDir, ivCandMv, ivCandRefIdx ) )
     5296#else
    47825297    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     5298#endif
    47835299    {
    47845300      return;
     
    47935309
    47945310#if H_3D
     5311#if !ETRIKHU_CLEANUP_H0083
    47955312  if (iCountHEVC + iCount3DV > getSlice()->getMaxNumMergeCand())
    47965313  {
     
    48025319  }
    48035320  numValidMergeCand = iCount;
     5321#endif
    48045322#else
    48055323  if ( getSlice()->getEnableTMVPFlag())
     
    67597277, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    67607278#endif
     7279#if SEC_ADAPT_DISABLE_IVMP
     7280, Bool bICFlag
     7281#endif
    67617282)
    67627283{
     
    67947315    pacPdmMv[i].setIDVFlag   (false);
    67957316  }
     7317#endif
     7318
     7319#if SEC_ADAPT_DISABLE_IVMP
     7320  if(!bICFlag)
     7321  {
    67967322#endif
    67977323
     
    68027328  if(!m_pcSlice->getIsDepth())
    68037329  {
     7330#if MTK_DIS_SPBIP8X4_H0205
     7331    if (!getDBBPFlag(0))
     7332#else
    68047333    if( getPartitionSize(0) == SIZE_2Nx2N )
     7334#endif
    68057335    {
    68067336      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     
    69597489
    69607490            }
     7491#if MTK_DIS_SPBIP8X4_H0205
     7492            if (iSPHeight + iSPWidth == 12)
     7493            {
     7494              if (puhInterDirSP[iPartition] == 3)
     7495              {
     7496                puhInterDirSP[iPartition] = 1;
     7497                pcMvFieldSP[2*iPartition + 1].setMvField(TComMv(0,0), -1);
     7498              }
     7499            }
     7500#endif
    69617501            iPartition ++;
    69627502          }
     
    69807520    iCurrPosY  += ( iHeight >> 1 );
    69817521  }
     7522#if MTK_DIS_SPBIP8X4_H0205
     7523  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getDBBPFlag(0)) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7524#else
    69827525  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
     7526#endif
    69837527#else
    69847528  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     
    70627606  }
    70637607
     7608#if SEC_ADAPT_DISABLE_IVMP
     7609  }
     7610#endif
    70647611
    70657612  ////////////////////////////////
  • branches/HTM-10.2-dev0/source/Lib/TLibCommon/TComDataCU.h

    r884 r935  
    233233#endif
    234234
     235#if ETRIKHU_CLEANUP_H0083
     236  TComMotionCand  m_mergCands[MRG_IVSHIFT+1];
     237  Int           m_baseListidc;
     238#endif
     239
    235240protected:
    236241 
     
    239244  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    240245#if H_3D_VSP
     246#if ETRIKHU_CLEANUP_H0083
     247  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount);
     248#else
    241249  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    242250                             Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo);
    243251#endif
     252#endif
    244253#if H_3D_IV_MERGE
     254#if ETRIKHU_CLEANUP_H0083
     255  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
     256#else
    245257  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int*   ivCandDir, TComMv* ivCandMv,
    246258                               Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo   );
     259#endif
     260#if ETRIKHU_CLEANUP_H0083
     261  Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
     262#else
    247263  Bool          xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int*  ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand );
     264#endif
    248265#endif
    249266
     
    485502   
    486503#if H_3D
     504#if !ETRIKHU_CLEANUP_H0083
    487505  Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
     506#endif
    488507  Bool          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    489508  Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
     
    508527#if H_3D_SPIVMP
    509528    , TComMvField* pcMFieldSP, UChar* puhInterDirSP
     529#endif
     530#if SEC_ADAPT_DISABLE_IVMP
     531    , Bool bICFlag
    510532#endif
    511533    );   
     
    635657  Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;}
    636658  Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;}
     659#if ETRIKHU_CLEANUP_H0083
    637660  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
     661  Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     662#if H_3D_VSP
     663    , Int* vspFlag
     664#endif
     665#if H_3D_SPIVMP
     666    , Bool* pbSPIVMPFlag
     667#endif
     668    , Int& numValidMergeCand
     669    );
     670#else
     671  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
     672#endif
    638673  Void          getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1);
    639674  Void          xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     
    642677#endif
    643678#if H_3D_VSP
     679#if !ETRIKHU_CLEANUP_H0083
    644680                                            , Int* vspFlag
     681#endif
    645682                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
    646683#endif
    647684#if H_3D_SPIVMP
     685#if ETRIKHU_CLEANUP_H0083
     686                                            , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     687#else
    648688                                            , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     689#endif
    649690#endif
    650691                                            , Int& numValidMergeCand, Int mrgCandIdx = -1
  • branches/HTM-10.2-dev0/source/Lib/TLibCommon/TComMotionInfo.h

    r884 r935  
    198198//! \}
    199199
     200#if ETRIKHU_CLEANUP_H0083
     201class TComMotionCand
     202{
     203public:
     204  Bool                  m_bAvailable;
     205  TComMvField           m_cMvField[2];
     206  UChar                 m_uDir;
     207#if H_3D_VSP
     208  Int                   m_iVspFlag;
     209#endif 
     210  Bool                  m_bSPIVMPFlag;
     211
     212public:
     213  TComMotionCand()
     214  {
     215    m_bAvailable = false;
     216    m_uDir = 0;
     217#if H_3D_VSP
     218    m_iVspFlag = 0;
     219#endif
     220    m_bSPIVMPFlag = false;
     221  }
     222
     223  ~TComMotionCand()
     224  {
     225
     226  }
     227
     228  Void init()
     229  {
     230    TComMv cZeroMv;
     231
     232    m_bAvailable = false;
     233    m_uDir = 0;
     234#if H_3D_VSP
     235    m_iVspFlag = 0;
     236#endif
     237    m_bSPIVMPFlag = false;
     238    m_cMvField[0].setMvField(cZeroMv, NOT_VALID);
     239    m_cMvField[1].setMvField(cZeroMv, NOT_VALID);
     240  }
     241
     242  Void setCand(TComMvField* pcMvFieldNeighbours, UChar uhInterDirNeighbours
     243#if H_3D_VSP
     244    , Int vspFlag
     245#endif
     246    , Bool bSPIVMPFlag
     247    )
     248  {
     249    m_bAvailable = true;
     250    m_cMvField[0] = pcMvFieldNeighbours[0];
     251    m_cMvField[1] = pcMvFieldNeighbours[1];
     252    m_uDir = uhInterDirNeighbours;
     253#if H_3D_VSP
     254    m_iVspFlag = vspFlag;
     255#endif
     256    m_bSPIVMPFlag = bSPIVMPFlag;
     257  }
     258
     259
     260  Void getCand(Int iCount, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
     261#if H_3D_VSP
     262    , Int* vspFlag
     263#endif
     264    , Bool* pbSPIVMPFlag
     265    )
     266  {
     267    pcMvFieldNeighbours[iCount<<1] = m_cMvField[0];
     268    pcMvFieldNeighbours[(iCount<<1) + 1] = m_cMvField[1];
     269    puhInterDirNeighbours[iCount] = m_uDir;
     270#if H_3D_VSP
     271    vspFlag[iCount] = m_iVspFlag;
     272#endif
     273    pbSPIVMPFlag[iCount] = m_bSPIVMPFlag;
     274  }
     275};
     276#endif
     277
     278
    200279#endif // __TCOMMOTIONINFO__
  • branches/HTM-10.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r888 r935  
    519519      Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC();
    520520      Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC();
     521#if MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085
     522      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
     523#else
    521524      if(RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
     525#endif
    522526      {
    523527        return true;
  • branches/HTM-10.2-dev0/source/Lib/TLibCommon/TypeDef.h

    r888 r935  
    108108                                              // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
    109109                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053
     110#define MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085 1   // Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
    110111
    111112#define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
     
    159160                                              // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074
    160161                                              // QC_DEPTH_MERGE_SIMP_G0127 Remove DV candidate and shifting candidate for depth coding
     162
     163#define SEC_ADAPT_DISABLE_IVMP            1   // Disalbing IVMP merge candidates when IC is enabled, JCT3V-H0070
    161164
    162165#define H_3D_TMVP                         1   // QC_TMVP_C0047
     
    224227#endif
    225228
     229#define ETRIKHU_BUGFIX_H0083              1   // bug-fix for DV candidate pruning
     230#define ETRIKHU_CLEANUP_H0083             1   // cleaned-up source code for constructing merging candidate list
     231#define SHARP_SIMPLE_MERGE_H0062          1   // Restrict 3D-HEVC merge cand in small PUs
     232#define MTK_DIS_SPBIP8X4_H0205            1   // Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
     233
    226234// Rate Control
    227235#define KWU_FIX_URQ                       1
     
    325333
    326334#define H_MV_HLS7_GEN                        0  // General changes (not tested)
    327 
     335#define MPI_SUBPU_DEFAULT_MV_H0077_H0099_H0111_H0133    1
    328336
    329337
     
    799807};
    800808
     809/// merging candidates
     810#if ETRIKHU_CLEANUP_H0083
     811enum DefaultMergCandOrder
     812{
     813  MRG_T = 0,            ///< MPI
     814  MRG_D,                ///< DDD
     815  MRG_IVMC,             ///< Temporal inter-view
     816  MRG_A1,               ///< Left
     817  MRG_B1,               ///< Above
     818  MRG_B0,               ///< Above right
     819  MRG_IVDC,             ///< Disparity inter-view
     820  MRG_VSP,              ///< VSP
     821  MRG_A0,               ///< Left bottom
     822  MRG_B2,               ///< Above left
     823  MRG_IVSHIFT,          ///< Shifted IVMC of Shifted IVDC. (These are mutually exclusive)
     824  MRG_COL               ///< Temporal co-located
     825};
     826#endif
     827
    801828/// coefficient scanning type used in ACS
    802829enum COEFF_SCAN_TYPE
  • branches/HTM-10.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r884 r935  
    431431    m_ppcCU[uiDepth]->initAvailableFlags();
    432432    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    433     m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
     433    m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
     434#if !ETRIKHU_CLEANUP_H0083
     435      ,vspFlag
     436#endif
     437      , inheritedVSPDisInfo
    434438#if H_3D_SPIVMP
    435       , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     439      , pcMvFieldSP, puhInterDirSP
    436440#endif
    437441      , numValidMergeCand, uiMergeIndex );
     442
     443#if ETRIKHU_CLEANUP_H0083
     444    m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
     445#if H_3D_SPIVMP
     446      , bSPIVMPFlag
     447#endif
     448      , numValidMergeCand );
     449#endif
    438450    pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    439451#else
  • branches/HTM-10.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r884 r935  
    292292          pcSubCU->initAvailableFlags();
    293293          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    294           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
     294          pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
     295#if !ETRIKHU_CLEANUP_H0083
     296            ,vspFlag
     297#endif
     298            , inheritedVSPDisInfo
    295299#if H_3D_SPIVMP
    296             , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     300            , pcMvFieldSP, puhInterDirSP
    297301#endif
    298302            , numValidMergeCand );
     303
     304#if ETRIKHU_CLEANUP_H0083
     305          pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
     306#if H_3D_SPIVMP
     307            , bSPIVMPFlag
     308#endif
     309            , numValidMergeCand );
     310#endif
    299311          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    300312
     
    329341        pcSubCU->initAvailableFlags();
    330342        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    331         pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo
     343        pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
     344#if !ETRIKHU_CLEANUP_H0083
     345          , vspFlag
     346#endif
     347          , inheritedVSPDisInfo
    332348#if H_3D_SPIVMP
    333           , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     349          , pcMvFieldSP, puhInterDirSP
    334350#endif
    335351          ,numValidMergeCand, uiMergeIndex );
     352
     353#if ETRIKHU_CLEANUP_H0083
     354        pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag
     355#if H_3D_SPIVMP
     356          , bSPIVMPFlag
     357#endif
     358          ,numValidMergeCand );
     359#endif
    336360        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    337361        if(vspFlag[uiMergeIndex])
  • branches/HTM-10.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r884 r935  
    21532153  {
    21542154    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
     2155#if MTK_DIS_SPBIP8X4_H0205
     2156    UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;
     2157    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
     2158#endif
    21552159  }
    21562160}
  • branches/HTM-10.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r884 r935  
    18141814    rpcTempCU->initAvailableFlags();
    18151815    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    1816     rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag,inheritedVSPDisInfo
     1816    rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
     1817#if !ETRIKHU_CLEANUP_H0083
     1818      , vspFlag
     1819#endif
     1820      , inheritedVSPDisInfo
    18171821#if H_3D_SPIVMP
    1818       , bSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     1822      , pcMvFieldSP, puhInterDirSP
    18191823#endif
    18201824      , numValidMergeCand
    18211825      );
     1826
     1827#if ETRIKHU_CLEANUP_H0083
     1828    rpcTempCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours, vspFlag
     1829#if H_3D_SPIVMP
     1830      , bSPIVMPFlag
     1831#endif
     1832      , numValidMergeCand
     1833      );
     1834#endif
     1835
    18221836#else
    18231837    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
  • branches/HTM-10.2-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r884 r935  
    36973697      pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
    36983698#if H_3D_VSP
     3699#if !ETRIKHU_CLEANUP_H0083
    36993700                                        , vspFlag
     3701#endif
    37003702                                        , inheritedVSPDisInfo
    37013703#endif
    37023704#if H_3D_SPIVMP
    3703                                         , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     3705        , pcMvFieldSP, puhInterDirSP
     3706#endif
     3707        , numValidMergeCand
     3708        );
     3709
     3710#if ETRIKHU_CLEANUP_H0083
     3711      pcCU->buildMCL( cMvFieldNeighbours,uhInterDirNeighbours
     3712#if H_3D_VSP
     3713        , vspFlag
     3714#endif
     3715#if H_3D_SPIVMP
     3716        , pbSPIVMPFlag
    37043717#endif
    37053718                                        , numValidMergeCand
    37063719        );
     3720#endif
    37073721#else
    37083722      pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand );
     
    37183732    pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
    37193733#if H_3D_VSP
     3734#if !ETRIKHU_CLEANUP_H0083
    37203735                                      , vspFlag
     3736#endif
    37213737                                      , inheritedVSPDisInfo
    37223738#endif
    37233739#if H_3D_SPIVMP
    3724                                       , pbSPIVMPFlag, pcMvFieldSP, puhInterDirSP
     3740      , pcMvFieldSP, puhInterDirSP
     3741#endif
     3742      , numValidMergeCand
     3743      );
     3744
     3745#if ETRIKHU_CLEANUP_H0083
     3746    pcCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours
     3747#if H_3D_VSP
     3748      , vspFlag
     3749#endif
     3750#if H_3D_SPIVMP
     3751      , pbSPIVMPFlag
    37253752#endif
    37263753                                      , numValidMergeCand
    37273754      );
     3755#endif
    37283756#else
    37293757    pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand
Note: See TracChangeset for help on using the changeset viewer.