Ignore:
Timestamp:
27 Mar 2014, 18:52:26 (10 years ago)
Author:
tech
Message:

Cleanups part 1.

File:
1 edited

Legend:

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

    r872 r876  
    24632463  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    24642464  uiCtx    = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0;
    2465  
    2466 #if !MTK_ARP_FLAG_CABAC_SIMP_G0061       
    2467   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2468   uiCtx   += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0;
    2469 #endif
    2470   return uiCtx;
    2471 }
    2472 #endif
    2473 #if !MTK_IC_FLAG_CABAC_SIMP_G0061
    2474 #if H_3D_IC
    2475 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx )
    2476 {
    2477   UInt        uiCtx = 0;
    2478 
    2479   TComDataCU* pcTempCU = NULL;
    2480   UInt        uiTempPartIdx = 0;
    2481 
    2482   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2483   uiCtx    = ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
    2484 
    2485   pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
    2486   uiCtx    += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
    2487 
    2488   return uiCtx;
    2489 }
    2490 #endif
     2465    return uiCtx;
     2466}
    24912467#endif
    24922468#if H_3D_DBBP
     
    35823558inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
    35833559  Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
    3584   {
    3585 #if MTK_NBDV_IVREF_FIX_G0067
     3560{
    35863561  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
    3587 #else
    3588   if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )
    3589 #endif
    35903562  {
    35913563    return false;
     
    35943566  Int refViewIdx = pDInfo->m_aVIdxCan;
    35953567  TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx );
    3596  
     3568
    35973569  if( picDepth == NULL ) // No depth reference avail
    35983570  {
     
    36023574
    36033575  rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
    3604  
     3576
    36053577  Bool  refViewAvailFlag = false;
    36063578  UChar predFlag[2]      = {0, 0};
     
    36093581  Int   viewIdInRefListX = -1;
    36103582#endif
    3611  
     3583
    36123584  for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
    36133585  {
     
    36453617        predFlag[refListIdY] = 1;
    36463618        TComMv  cMv = pDInfo->m_acNBDV;
    3647        
     3619
    36483620        Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId();
    36493621        Int currViewId       = m_pcSlice->getViewId();
    3650        
     3622
    36513623        //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed):
    36523624        // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx  );
    3653        
     3625
    36543626        Int iScale      = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX );
    3655        
     3627
    36563628        // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX.
    36573629        if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() )
     
    44494421  if( bMPIFlag)
    44504422  {
    4451 #if QC_SPIVMP_MPI_G0119
    44524423    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    44534424    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
     
    45564527    }
    45574528#endif
    4558 #else
    4559     UInt uiPartIdxCenter;
    4560     xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );   
    4561     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
    4562     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
    4563     Int tRef[2]={-1, -1};
    4564 
    4565 #if H_3D_FCO
    4566     TComPic * pcTexturePic = m_pcSlice->getTexturePic();
    4567     TComDataCU *pcTextureCU = 0;
    4568     if ( pcTexturePic )
    4569       pcTextureCU = pcTexturePic->getCU( getAddr() );
    4570 #else
    4571     TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
    4572 #endif
    4573 
    4574 #if H_3D_FCO
    4575     if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
    4576 #else
    4577     if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
    4578 #endif
    4579     {
    4580       pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] );
    4581       tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() );
    4582       if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
    4583       {
    4584         TComMv cMvPred = tmpMV[0].getMv();
    4585         const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4586         cMvPred+=cAdd;
    4587         cMvPred>>=2;
    4588         clipMv(cMvPred);
    4589         tmpMV[0].setMvField(cMvPred,tRef[0]);
    4590       }
    4591       if ( getSlice()->isInterB() )
    4592       {
    4593         pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, tmpMV[1] );
    4594         tRef[1] = getPic()->isTextRefValid( REF_PIC_LIST_1, tmpMV[1].getRefIdx() );
    4595         if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
     4529    if( tmpDir != 0 )
     4530    {
     4531      Int iCnloop = 0;
     4532      Bool bRemoveSpa = false; //pruning
     4533
     4534      for(Int i = 0; i < 2; i ++)
     4535      {
     4536        iCnloop = iPosLeftAbove[i];
     4537        if ( iCnloop == -1 )
    45964538        {
    4597           TComMv cMvPred = tmpMV[1].getMv();
    4598           const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
    4599           cMvPred+=cAdd;
    4600           cMvPred>>=2;
    4601           clipMv(cMvPred);
    4602           tmpMV[1].setMvField(cMvPred,tRef[1]);
     4539          continue;
    46034540        }
    4604       }
    4605 
    4606       tmpDir = 0;
    4607       if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
    4608       {
    4609         tmpDir += ((tmpMV[0].getRefIdx()>=0)?1:0);
    4610       }
    4611       if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
    4612       {
    4613         tmpDir += ((tmpMV[1].getRefIdx()>=0)?2:0);
    4614       }
    4615 #endif
    4616       if( tmpDir != 0 )
    4617       {
    4618         Int iCnloop = 0;
    4619         Bool bRemoveSpa = false; //pruning
    4620 
    4621         for(Int i = 0; i < 2; i ++)
     4541        if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
    46224542        {
    4623           iCnloop = iPosLeftAbove[i];
    4624           if ( iCnloop == -1 )
     4543          bRemoveSpa                      = true;
     4544          break;
     4545        }     
     4546      }
     4547
     4548      if (!bRemoveSpa)
     4549      {
     4550        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
     4551      }
     4552      else
     4553      {
     4554        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
     4555        if (iCnloop<numA1B1B0)
     4556        {
     4557          numA1B1B0--;
     4558        }
     4559        iCountHEVC--;
     4560
     4561        if (iPosLeftAbove[0] != -1)
     4562        {
     4563          if (iCnloop == iPosLeftAbove[0])
    46254564          {
    4626             continue;
     4565            iPosLeftAbove[0] = -1;
    46274566          }
    4628           if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
     4567          else
    46294568          {
    4630             bRemoveSpa                      = true;
    4631             break;
    4632           }     
     4569            iPosLeftAbove[0]++;
     4570          }
    46334571        }
    4634 
    4635         if (!bRemoveSpa)
     4572        if (iPosLeftAbove[1] != -1)
    46364573        {
    4637           rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
    4638         }
    4639         else
    4640         {
    4641           rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
    4642           if (iCnloop<numA1B1B0)
     4574          if (iCnloop == iPosLeftAbove[1])
    46434575          {
    4644             numA1B1B0--;
     4576            iPosLeftAbove[1] = -1;
    46454577          }
    4646           iCountHEVC--;
    4647 
    4648           if (iPosLeftAbove[0] != -1)
     4578          else
    46494579          {
    4650             if (iCnloop == iPosLeftAbove[0])
     4580            if (iCnloop > iPosLeftAbove[1])
    46514581            {
    4652               iPosLeftAbove[0] = -1;
    4653             }
    4654             else
    4655             {
    4656               iPosLeftAbove[0]++;
    4657             }
    4658           }
    4659           if (iPosLeftAbove[1] != -1)
    4660           {
    4661             if (iCnloop == iPosLeftAbove[1])
    4662             {
    4663               iPosLeftAbove[1] = -1;
    4664             }
    4665             else
    4666             {
    4667               if (iCnloop > iPosLeftAbove[1])
    4668               {
    4669                 iPosLeftAbove[1]++;
    4670               }
     4582              iPosLeftAbove[1]++;
    46714583            }
    46724584          }
    46734585        }
    4674 #if QC_SPIVMP_MPI_G0119
    4675         pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
    4676         pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
    4677 #else
    4678         if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
    4679         {
    4680           pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tRef[0]);
    4681         }
    4682         if ( getSlice()->isInterB())
    4683         {
    4684           if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
    4685           {
    4686             pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tRef[1]);
    4687           }
    4688         }
    4689 #endif
    4690         puhInterDirNeighbours[iCount] = tmpDir;
    4691 
    4692         if ( mrgCandIdx == iCount )
    4693         {
    4694           return;
    4695         }
    4696         iCount ++;
    4697       }
    4698 #if !QC_SPIVMP_MPI_G0119
    4699     }
    4700 #endif
     4586      }
     4587      pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
     4588      pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
     4589
     4590      puhInterDirNeighbours[iCount] = tmpDir;
     4591
     4592      if ( mrgCandIdx == iCount )
     4593      {
     4594        return;
     4595      }
     4596      iCount ++;
     4597    }
    47014598  }
    47024599#if MTK_DDD_G0063
     
    48364733  Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
    48374734
    4838 #if MTK_NBDV_IVREF_FIX_G0067
    48394735  if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
    4840 #else
    4841   if ( ivMvPredFlag )
    4842 #endif
    48434736  {
    48444737    getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
     
    48484741  //////// INTER VIEW MOTION COMP(IvMC) /////////
    48494742  ///////////////////////////////////////////////
    4850 #if QC_DEPTH_MERGE_SIMP_G0127
    48514743  if( getSlice()->getIsDepth() )
    48524744  {
    48534745    ivCandDir[1] = ivCandDir[2] = ivCandDir[3] = 0;
    48544746  }
    4855 #endif
     4747
    48564748  if( ivCandDir[0] )
    48574749  {
     
    49614853    if (bIvMC)
    49624854    {
    4963 #if QC_SPIVMP_MPI_G0119
    4964       if(!m_pcSlice->getIsDepth())
    4965 #endif
    4966 #if SEC_SPIVMP_MCP_SIZE_G0077
    4967         if(getPartitionSize(0) == SIZE_2Nx2N)
     4855      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
     4856      {
    49684857          pbSPIVMPFlag[iCount] = true;
    4969 #else
    4970       pbSPIVMPFlag[iCount] = true;
    4971 #endif
     4858      }
    49724859#if H_3D_DBBP
    49734860      pbSPIVMPFlag[iCount] &= !bDBBPFlag;
     
    51114998  //////// INTER VIEW DISP COMP (IvDC) ////////
    51124999  /////////////////////////////////////////////
    5113 #if QC_DEPTH_MERGE_SIMP_G0127
    51145000  if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    5115 #else
    5116   if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())
    5117 #endif
    51185001  {
    51195002    assert(iCount < getSlice()->getMaxNumMergeCand());
     
    52765159  //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
    52775160  ////////////////////////////////////////////////////
    5278 #if QC_DEPTH_MERGE_SIMP_G0127
    52795161  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
    5280 #else
    5281   if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() )
    5282 #endif
    52835162  {
    52845163    if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
     
    66456524#endif
    66466525#if H_3D_IV_MERGE
    6647 #if SEC_DEPTH_DV_DERIVAITON_G0074
    66486526Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    6649 #else
    6650 Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
    6651 #endif
    6652 {
    6653 #if SEC_DEPTH_DV_DERIVAITON_G0074
     6527{
     6528
    66546529  assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
    66556530
     
    66626537
    66636538  return true;
    6664 #else
    6665   Pel pDepPos[3] = {0, 0, 0};
    6666   assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
    6667   Bool bDepAvail = false;
    6668   Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
    6669   Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
    6670   TComMv cMv;
    6671 
    6672   Int xP, yP, nPSW, nPSH;
    6673   this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
    6674 
    6675   if(xP != 0 && yP != 0)
    6676   {
    6677     pDepPos[0] = pDepth[ (yP-1) * iDepStride + (xP-1) ];
    6678     bDepAvail = true;
    6679   }
    6680 
    6681   if(xP != 0)
    6682   {
    6683     pDepPos[1] = pDepth[ (yP+nPSH-1) * iDepStride + (xP-1) ];
    6684     bDepAvail = true;
    6685   }
    6686 
    6687   if(yP != 0)
    6688   {
    6689     pDepPos[2] = pDepth[ (yP-1) * iDepStride + (xP+nPSW-1) ];
    6690     bDepAvail = true;
    6691   }
    6692 
    6693   if (bDepAvail)
    6694   {
    6695     Pel pAvgDepth = (xP != 0 && yP != 0) ? ((5*pDepPos[0] + 5*pDepPos[1] + 6*pDepPos[2] + 8)>>4) : (xP == 0) ? pDepPos[2] : pDepPos[1];
    6696     Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ pAvgDepth ];
    6697     cMv.setHor(iDisp);
    6698     cMv.setVer(0);
    6699     pDisp->m_acNBDV = cMv;
    6700     pDisp->m_aVIdxCan = 0;
    6701     return true;
    6702   }
    6703   else
    6704   { 
    6705     cMv.setZero();
    6706     pDisp->m_acNBDV = cMv;
    6707     pDisp->m_aVIdxCan = 0;
    6708     return false;
    6709   }
    6710 #endif
    67116539}
    67126540#endif
     
    67256553  // Init disparity struct for results
    67266554  pDInfo->bDV = false;   
    6727 #if MTK_NBDV_IVREF_FIX_G0067
    67286555  pDInfo->m_aVIdxCan = -1;
    6729 #endif
     6556
    67306557  // Init struct for disparities from MCP neighboring blocks
    67316558  IDVInfo cIDVInfo;
     
    72487075{
    72497076  Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId());
    7250 #if QC_SPIVMP_MPI_G0119
    72517077  if( getSlice()->getIsDepth() )
    72527078  {
    72537079    iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size();
    72547080  }
    7255 #endif
     7081
    72567082  iNumSPInOneLine = iPUWidth/iSubPUSize;
    72577083  iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine;
     
    73107136  TComSlice*    pcSlice = getSlice (); 
    73117137  Int iViewIndex        = pDInfo->m_aVIdxCan;
    7312  
     7138
    73137139  //--- get base CU/PU and check prediction mode ---
    73147140  TComPic*    pcBasePic   = pcSlice->getIvPic( bIsDepth, iViewIndex );
     
    73347160
    73357161  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7336  
     7162
    73377163  Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
    73387164#if H_3D_NBDV
     
    73477173  //////////sub-PU IvMC///////////
    73487174  ////////////////////////////////
    7349 #if QC_SPIVMP_MPI_G0119
    73507175  if(!m_pcSlice->getIsDepth())
    73517176  {
    7352 #endif 
    7353 #if SEC_SPIVMP_MCP_SIZE_G0077
    7354   if( getPartitionSize(0) == SIZE_2Nx2N )
    7355   {
    7356 #endif
    7357   Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
    7358   getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
    7359 
    7360   for (Int i=0; i<iNumSP; i++)
    7361   {
    7362     puhInterDirSP[i] = 0;
    7363     pcMvFieldSP[2*i].getMv().set(0, 0);
    7364     pcMvFieldSP[2*i+1].getMv().set(0,0);
    7365     pcMvFieldSP[2*i].setRefIdx(-1);
    7366     pcMvFieldSP[2*i+1].setRefIdx(-1);
    7367   }
    7368 
    7369   Int         iBaseCUAddr;
    7370   Int         iBaseAbsPartIdx;
    7371   TComDataCU* pcBaseCU;
    7372   Int iPartition = 0;
     7177    if( getPartitionSize(0) == SIZE_2Nx2N )
     7178    {
     7179      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
     7180      getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
     7181
     7182      for (Int i=0; i<iNumSP; i++)
     7183      {
     7184        puhInterDirSP[i] = 0;
     7185        pcMvFieldSP[2*i].getMv().set(0, 0);
     7186        pcMvFieldSP[2*i+1].getMv().set(0,0);
     7187        pcMvFieldSP[2*i].setRefIdx(-1);
     7188        pcMvFieldSP[2*i+1].setRefIdx(-1);
     7189      }
     7190
     7191      Int         iBaseCUAddr;
     7192      Int         iBaseAbsPartIdx;
     7193      TComDataCU* pcBaseCU;
     7194      Int iPartition = 0;
    73737195#if !KHU_SIMP_SPIVMP_G0147
    7374   Int iInterDirLast = 0;
    7375   TComMvField cMvFieldLast[2];
    7376 #endif
    7377 
    7378   Int iDelX = iSPWidth/2;
    7379   Int iDelY = iSPHeight/2;
     7196      Int iInterDirLast = 0;
     7197      TComMvField cMvFieldLast[2];
     7198#endif
     7199
     7200      Int iDelX = iSPWidth/2;
     7201      Int iDelY = iSPHeight/2;
    73807202
    73817203#if KHU_SIMP_SPIVMP_G0147
    7382   Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
    7383   Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
    7384   Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
    7385 
    7386   if(iWidth == iSPWidth && iHeight == iSPHeight)
    7387   {
    7388     iCenterPosX = iCurrPosX + (iWidth >> 1);
    7389     iCenterPosY = iCurrPosY + (iHeight >> 1);
    7390   }
    7391 
    7392   Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
    7393   Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );
    7394 
    7395   pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
    7396   TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
    7397   if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
    7398   {
    7399     for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
    7400     {
    7401       RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    7402       Bool stopLoop = false;
    7403       for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
    7404       {
    7405         RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7406         TComMvField cDefaultMvField;
    7407         pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
    7408         Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
    7409         if (iDefaultRefIdx >= 0)
    7410         {
    7411           Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
    7412           if (iDefaultRefPOC != pcSlice->getPOC())   
    7413           {
    7414             for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    7415             {
    7416               if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    7417               {
    7418                 abPdmAvailable[ uiCurrRefListId ] = true;
    7419                 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
    7420 #if H_3D_NBDV
    7421 #if H_3D_IV_MERGE
    7422                 if( !bIsDepth )
    7423                 {
    7424 #endif
    7425                   cMv.setIDVFlag   (true);
    7426                   cMv.setIDVHor    (cDv.getHor());                 
    7427                   cMv.setIDVVer    (cDv.getVer()); 
    7428                   cMv.setIDVVId    (iViewIndex);
    7429 #if H_3D_IV_MERGE
    7430                 }
    7431 #endif
    7432 #endif
    7433                 clipMv( cMv );
    7434                 paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
    7435                 pacPdmMv      [ uiCurrRefListId ] = cMv;
    7436                 stopLoop = true;
    7437                 break;
    7438               }
    7439             }
    7440           }
    7441         }
    7442       }
    7443     }
    7444   }
    7445   availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
    7446 
    7447   if(availableMcDc[0])
    7448   {
    7449 #endif
    7450   Int         iBasePosX, iBasePosY;
    7451   for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
    7452   {
    7453     for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
    7454     {
    7455       iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
    7456       iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));
    7457 
    7458       pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
    7459       pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7460       if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    7461       {
    7462         for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     7204      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
     7205      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
     7206      Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
     7207
     7208      if(iWidth == iSPWidth && iHeight == iSPHeight)
     7209      {
     7210        iCenterPosX = iCurrPosX + (iWidth >> 1);
     7211        iCenterPosY = iCurrPosY + (iHeight >> 1);
     7212      }
     7213
     7214      Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     7215      Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) );
     7216
     7217      pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
     7218      TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
     7219      if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
     7220      {
     7221        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
    74637222        {
    74647223          RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
    7465           Bool bLoop_stop = false;
    7466           for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     7224          Bool stopLoop = false;
     7225          for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
    74677226          {
    7468             RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
    7469             TComMvField cBaseMvField;
    7470             pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    7471             Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    7472             if (iBaseRefIdx >= 0)
     7227            RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     7228            TComMvField cDefaultMvField;
     7229            pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
     7230            Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
     7231            if (iDefaultRefIdx >= 0)
    74737232            {
    7474               Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
    7475               if (iBaseRefPOC != pcSlice->getPOC())   
     7233              Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
     7234              if (iDefaultRefPOC != pcSlice->getPOC())   
    74767235              {
    74777236                for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
    74787237                {
    7479                   if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     7238                  if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
    74807239                  {
    74817240                    abPdmAvailable[ uiCurrRefListId ] = true;
    7482                     TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    7483 
     7241                    TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
     7242#if H_3D_NBDV
     7243#if H_3D_IV_MERGE
    74847244                    if( !bIsDepth )
    74857245                    {
     7246#endif
    74867247                      cMv.setIDVFlag   (true);
    74877248                      cMv.setIDVHor    (cDv.getHor());                 
    74887249                      cMv.setIDVVer    (cDv.getVer()); 
    74897250                      cMv.setIDVVId    (iViewIndex);
     7251#if H_3D_IV_MERGE
    74907252                    }
    7491 
     7253#endif
     7254#endif
    74927255                    clipMv( cMv );
    7493                     bLoop_stop = true;
    7494 
    7495                     pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
     7256                    paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
     7257                    pacPdmMv      [ uiCurrRefListId ] = cMv;
     7258                    stopLoop = true;
    74967259                    break;
    74977260                  }
     
    75027265        }
    75037266      }
    7504 
    7505       puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
    7506       if (puhInterDirSP[iPartition] == 0)
    7507       {
     7267      availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
     7268
     7269      if(availableMcDc[0])
     7270      {
     7271#endif
     7272        Int         iBasePosX, iBasePosY;
     7273        for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
     7274        {
     7275          for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
     7276          {
     7277            iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
     7278            iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 ));
     7279
     7280            pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
     7281            pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     7282            if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
     7283            {
     7284              for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
     7285              {
     7286                RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
     7287                Bool bLoop_stop = false;
     7288                for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
     7289                {
     7290                  RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
     7291                  TComMvField cBaseMvField;
     7292                  pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
     7293                  Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
     7294                  if (iBaseRefIdx >= 0)
     7295                  {
     7296                    Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
     7297                    if (iBaseRefPOC != pcSlice->getPOC())   
     7298                    {
     7299                      for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
     7300                      {
     7301                        if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
     7302                        {
     7303                          abPdmAvailable[ uiCurrRefListId ] = true;
     7304                          TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
     7305
     7306                          if( !bIsDepth )
     7307                          {
     7308                            cMv.setIDVFlag   (true);
     7309                            cMv.setIDVHor    (cDv.getHor());                 
     7310                            cMv.setIDVVer    (cDv.getVer()); 
     7311                            cMv.setIDVVId    (iViewIndex);
     7312                          }
     7313
     7314                          clipMv( cMv );
     7315                          bLoop_stop = true;
     7316
     7317                          pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
     7318                          break;
     7319                        }
     7320                      }
     7321                    }
     7322                  }
     7323                }
     7324              }
     7325            }
     7326
     7327            puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
     7328            if (puhInterDirSP[iPartition] == 0)
     7329            {
    75087330#if KHU_SIMP_SPIVMP_G0147
    7509         puhInterDirSP[iPartition] = availableMcDc[0];
    7510         pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
    7511         pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
     7331              puhInterDirSP[iPartition] = availableMcDc[0];
     7332              pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
     7333              pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
    75127334#else
    7513         if (iInterDirLast != 0)
    7514         {
    7515           puhInterDirSP[iPartition] = iInterDirLast;
    7516           pcMvFieldSP[2*iPartition] = cMvFieldLast[0];
    7517           pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1];
    7518         }
    7519 #endif
    7520       }
     7335              if (iInterDirLast != 0)
     7336              {
     7337                puhInterDirSP[iPartition] = iInterDirLast;
     7338                pcMvFieldSP[2*iPartition] = cMvFieldLast[0];
     7339                pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1];
     7340              }
     7341#endif
     7342            }
    75217343#if !KHU_SIMP_SPIVMP_G0147
    7522       else
    7523       {
    7524         if (iInterDirLast ==0)
    7525         {
    7526           availableMcDc[0] = puhInterDirSP[iPartition];
    7527           paiPdmRefIdx  [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx();
    7528           pacPdmMv      [ 0 ] = pcMvFieldSP[2*iPartition].getMv();
    7529           paiPdmRefIdx  [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx();
    7530           pacPdmMv      [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv();
    7531 
    7532           if (iPartition != 0)
    7533           {
    7534             for (Int iPart = iPartition-1; iPart >= 0; iPart--)
     7344            else
    75357345            {
    7536               puhInterDirSP[iPart] = puhInterDirSP[iPartition];
    7537               pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
    7538               pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
     7346              if (iInterDirLast ==0)
     7347              {
     7348                availableMcDc[0] = puhInterDirSP[iPartition];
     7349                paiPdmRefIdx  [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx();
     7350                pacPdmMv      [ 0 ] = pcMvFieldSP[2*iPartition].getMv();
     7351                paiPdmRefIdx  [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx();
     7352                pacPdmMv      [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv();
     7353
     7354                if (iPartition != 0)
     7355                {
     7356                  for (Int iPart = iPartition-1; iPart >= 0; iPart--)
     7357                  {
     7358                    puhInterDirSP[iPart] = puhInterDirSP[iPartition];
     7359                    pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
     7360                    pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
     7361                  }
     7362                }
     7363              }
     7364              iInterDirLast = puhInterDirSP[iPartition];
     7365              cMvFieldLast[0] = pcMvFieldSP[2*iPartition];
     7366              cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];
    75397367            }
     7368#endif
     7369            iPartition ++;
     7370
    75407371          }
    75417372        }
    7542         iInterDirLast = puhInterDirSP[iPartition];
    7543         cMvFieldLast[0] = pcMvFieldSP[2*iPartition];
    7544         cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];
    7545       }
    7546 #endif
    7547       iPartition ++;
    7548 
    7549     }
    7550   }
    75517373#if KHU_SIMP_SPIVMP_G0147
    7552   }
    7553 #endif
    7554 #if SEC_SPIVMP_MCP_SIZE_G0077
    7555   }
    7556 #endif
    7557 
    7558   iCurrPosX  += ( iWidth  >> 1 );
    7559   iCurrPosY  += ( iHeight >> 1 );
    7560 #if QC_SPIVMP_MPI_G0119
    7561  }
    7562 #endif
     7374      }
     7375#endif
     7376    }
     7377
     7378    iCurrPosX  += ( iWidth  >> 1 );
     7379    iCurrPosY  += ( iHeight >> 1 );
     7380  }
    75637381#endif
    75647382
     
    75687386
    75697387#if H_3D_SPIVMP
    7570 #if QC_SPIVMP_MPI_G0119
    7571  if(m_pcSlice->getIsDepth())
    7572  {
    7573    iCurrPosX  += ( iWidth  >> 1 );
    7574    iCurrPosY  += ( iHeight >> 1 );
    7575  }
    7576 #if QC_DEPTH_MERGE_SIMP_G0127
    7577 #if SEC_SPIVMP_MCP_SIZE_G0077
     7388  if(m_pcSlice->getIsDepth())
     7389  {
     7390    iCurrPosX  += ( iWidth  >> 1 );
     7391    iCurrPosY  += ( iHeight >> 1 );
     7392  }
    75787393  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    75797394#else
    7580  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    7581 #endif
    7582 #else
    7583 #if SEC_SPIVMP_MCP_SIZE_G0077
    7584  for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < 2; iLoopCan ++)
    7585 #else
    7586  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)
    7587 #endif
    7588 #endif
    7589 #else
    7590 #if SEC_SPIVMP_MCP_SIZE_G0077
    7591  for(Int iLoopCan = (getPartitionSize(uiPartAddr) == SIZE_2Nx2N ? 1 : 0); iLoopCan < 2; iLoopCan ++)
    7592 #else
    7593   for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
    7594 #endif
    7595 #endif
    7596 #else
    75977395  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    75987396#endif
     
    76017399    // iLoopCan == 1 --> IvMCShift
    76027400
    7603 #if !H_3D_SPIVMP || QC_SPIVMP_MPI_G0119
    76047401    Int         iBaseCUAddr;
    76057402    Int         iBaseAbsPartIdx;
    7606 #endif
    76077403
    76087404    Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 );
    76097405    Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
    76107406
    7611 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119
    7612     iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
    7613     iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
    7614 #else
    76157407    Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
    76167408    Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );
    7617 #endif
    76187409    pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
    76197410
    7620 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119
    7621     pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7622 #else
    76237411    TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    7624 #endif
    76257412    if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
    76267413    {
     
    76767463  }
    76777464#if H_3D_SPIVMP
    7678 #if QC_SPIVMP_MPI_G0119
    7679 #if QC_DEPTH_MERGE_SIMP_G0127
    76807465  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)
    76817466#else
    7682   for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)
    7683 #endif
    7684 #else
    7685   for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
    7686 #endif
    7687 #else
    76887467  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    76897468#endif
     
    76917470    availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0);
    76927471  }
    7693  
    7694  
     7472
     7473
    76957474  ////////////////////////////////
    76967475  /////// IvDC + IvDCShift ///////
    76977476  ////////////////////////////////
    7698 #if QC_DEPTH_MERGE_SIMP_G0127
     7477
    76997478  if( !getSlice()->getIsDepth() )
    77007479  {
    7701 #endif
    7702   for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
    7703   {
    7704     RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
    7705     Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
    7706     for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    7707     {
    7708       if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
    7709       {
    7710         for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7480    for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
     7481    {
     7482      RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
     7483      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
     7484      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
     7485      {
     7486        if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
    77117487        {
    7712           Int ioffsetDV = (iLoopCan == 0) ? 0 : 4;
    7713           abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
    7714           paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
     7488          for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7489          {
     7490            Int ioffsetDV = (iLoopCan == 0) ? 0 : 4;
     7491            abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
     7492            paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
    77157493#if H_3D_NBDV_REF
    7716           TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
    7717 #endif
    7718           cMv.setHor( cMv.getHor() + ioffsetDV );
     7494            TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     7495#endif
     7496            cMv.setHor( cMv.getHor() + ioffsetDV );
    77197497#if H_3D_IV_MERGE
    7720           if( bIsDepth )
    7721             cMv.setHor((cMv.getHor()+2)>>2);
    7722 #endif
    7723           cMv.setVer( 0 );
    7724           clipMv( cMv );
    7725           pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
     7498            if( bIsDepth )
     7499            {
     7500              cMv.setHor((cMv.getHor()+2)>>2);
     7501            }
     7502#endif
     7503            cMv.setVer( 0 );
     7504            clipMv( cMv );
     7505            pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
     7506          }
     7507          break;
    77267508        }
    7727         break;
    7728       }
    7729     }
    7730   }
    7731   for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
    7732   {
    7733     availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 );
    7734   }
    7735 #if QC_DEPTH_MERGE_SIMP_G0127
    7736   }
    7737 #endif
     7509      }
     7510    }
     7511    for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
     7512    {
     7513      availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 );
     7514    }
     7515  }
    77387516  return false;
    77397517}
Note: See TracChangeset for help on using the changeset viewer.