Changeset 332 in 3DVCSoftware for trunk/source/Lib


Ignore:
Timestamp:
21 Apr 2013, 19:13:11 (12 years ago)
Author:
tech
Message:

Merged branch 6.1-Cleanup@329.

Location:
trunk/source/Lib
Files:
44 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/CommonDef.h

    r314 r332  
    140140#define PDM_MERGE_POS                     0         // position of pdm in merge list (0..4)
    141141
    142 #if H3D_IVMP
    143 #define DMV_MERGE_POS                     4
    144 #else
    145 #define DMV_MERGE_POS                     1
    146 #endif
    147 
    148142#if H3D_IVMP&!H3D_NBDV
    149143#define PDM_AMVP_POS                      0         // position of pdm in amvp list  (0..3)
  • trunk/source/Lib/TLibCommon/ContextTables.h

    r296 r332  
    434434
    435435#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    436 #if FIX_DMM_CTX_INIT_C0034
    437436static const UChar
    438 #else
    439 static const Short
    440 #endif
    441437INIT_DMM_FLAG[3][NUM_DMM_FLAG_CTX] =
    442438{
     
    452448};
    453449
    454 #if FIX_DMM_CTX_INIT_C0034
    455450static const UChar
    456 #else
    457 static const Short
    458 #endif
    459451INIT_DMM_MODE[3][NUM_DMM_MODE_CTX] =
    460452{
     
    470462};
    471463
    472 #if FIX_DMM_CTX_INIT_C0034
    473464static const UChar
    474 #else
    475 static const Short
    476 #endif
    477465INIT_DMM_DATA[3][NUM_DMM_DATA_CTX] =
    478466{
  • trunk/source/Lib/TLibCommon/TComDataCU.cpp

    r313 r332  
    31653165}
    31663166
    3167 #if LG_RESTRICTEDRESPRED_M24766
     3167#if H3D_IVRP
    31683168Void TComDataCU::getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx, Bool bLCU)
    31693169{
     
    32503250#endif
    32513251
    3252 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3253 Int TComDataCU::getResiPredMode(UInt uiPartAddr)
    3254 {
    3255   Int iAddResiShift = -1;
    3256 
    3257   for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
    3258   {
    3259     RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    3260     Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
    3261     if(iBestRefIdx >= 0 && getSlice()->getViewId() == getSlice()->getRefViewId(eRefList, iBestRefIdx))
    3262       iAddResiShift++;
    3263   }
    3264 
    3265   return iAddResiShift;
    3266 }
    3267 
    3268 Void TComDataCU::getPUResiPredShift(Int *iPUResiPredShift, UInt uiAbsPartIndex)
    3269 {
    3270   UInt uiPartSize = getPartitionSize(uiAbsPartIndex);
    3271   UInt uiPartAddr;
    3272   Int iWidth, iHeight;
    3273   Int iAddResiShift;
    3274 
    3275   if(uiPartSize == SIZE_2Nx2N)
    3276   {
    3277     iAddResiShift = getResiPredMode(uiAbsPartIndex);
    3278     for(UInt i = 0; i < 4; i++)
    3279       iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiAbsPartIndex) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3280     return;
    3281   }
    3282 
    3283   if(uiPartSize == SIZE_2NxN || uiPartSize == SIZE_2NxnU || uiPartSize == SIZE_2NxnD)
    3284   {
    3285     for(UInt i = 0; i < 2; i++)
    3286     {
    3287       getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
    3288       uiPartAddr += uiAbsPartIndex;
    3289       iAddResiShift = getResiPredMode(uiPartAddr);
    3290       iPUResiPredShift[2*i] = iPUResiPredShift[2*i+1] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3291     }
    3292     return;
    3293   }
    3294 
    3295   if(uiPartSize == SIZE_Nx2N || uiPartSize == SIZE_nLx2N || uiPartSize == SIZE_nRx2N)
    3296   {
    3297     for(UInt i = 0; i < 2; i++)
    3298     {
    3299       getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
    3300       uiPartAddr += uiAbsPartIndex;
    3301       iAddResiShift = getResiPredMode(uiPartAddr);
    3302       iPUResiPredShift[i] = iPUResiPredShift[2+i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3303     }
    3304     return;
    3305   }
    3306 
    3307   if(uiPartSize == SIZE_NxN)
    3308   {
    3309     for(UInt i = 0; i < 4; i++)
    3310     {
    3311       getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIndex, true);
    3312       uiPartAddr += uiAbsPartIndex;
    3313       iAddResiShift = getResiPredMode(uiPartAddr);
    3314       iPUResiPredShift[i] = (getSlice()->getPPS()->getUseWP() || getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3315     }
    3316   }
    3317 
    3318 }
    3319 #endif
    3320 
    33213252Void TComDataCU::getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField )
    33223253{
     
    36533584#endif //H3D_NBDV
    36543585
    3655 #if MTK_MDIVRP_C0138
     3586#if H3D_IVRP
    36563587  Bool bDVAvail = true;
    36573588#endif
     
    36683599#if MERL_VSP_C0152
    36693600            , true
    3670 #endif
     3601#endif     
    36713602);
    36723603  }
     
    36933624    cDisInfo.m_acMvCand[0].setVer(0);
    36943625    cDisInfo.m_aVIdxCan[0] = 0;
    3695 #if MTK_MDIVRP_C0138
     3626#if H3D_IVRP
    36963627    bDVAvail = false;
    36973628#endif
     
    37483679
    37493680  Int iPdmDir[2] = {0, 0};
    3750 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    37513681  getUnifiedMvPredCan(uiPUIdx, REF_PIC_LIST_0, 0, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir, true);
    37523682  Int iPdmInterDir;
    3753 #else
    3754   Int     iPdmInterDir      = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir );
    3755 #endif
    37563683#else // H3D_NBDV
    37573684  Int iPdmDir[2] = {0, 0};
     
    37603687  iPdmDir[1] = iPdmInterDir;
    37613688#endif // H3D_NBDV
    3762 #if MTK_MDIVRP_C0138
     3689#if H3D_IVRP
    37633690  if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail)
    37643691  {
     
    37673694#endif
    37683695
    3769   if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 )
     3696  if( iPdmDir[0] && !bNoPdmMerge )
    37703697  {
    37713698    abCandIsInter        [ iCount ] = true;
     
    37983725    }
    37993726    iCount ++;
    3800   }
    3801 
    3802   if(extraMergeCand)
    3803   {
    3804     if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 1)
    3805     {
    3806       assert(iCount < MRG_MAX_NUM_CANDS_MEM);
    3807       abCandIsInter        [ iCount ] = true;
    3808       puhInterDirNeighbours[ iCount ] = iPdmDir[1];
    3809       if( ( iPdmDir[1] & 1 ) == 1 )
    3810       {
    3811         pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] );
    3812       }
    3813       if( ( iPdmDir[1] & 2 ) == 2 )
    3814       {
    3815         pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] );
    3816       }
    3817 #if H3D_NBDV
    3818       pcMvFieldNeighbours[iCount<<1    ].getMv().m_bDvMcp = false;
    3819       pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false;
    3820 #endif
    3821       if ( mrgCandIdx == iCount )
    3822           return;
    3823       iCount ++;
    3824     }   
    3825   }
     3727  } 
     3728 
    38263729#endif //  H3D_IVMP
    38273730
     
    39103813  }
    39113814
    3912 #if H3D_IVMP
    3913   if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 1 )
    3914   {
    3915     abCandIsInter        [ iCount ] = true;
    3916     puhInterDirNeighbours[ iCount ] = iPdmInterDir;
    3917     if( ( iPdmInterDir & 1 ) == 1 )
    3918     {
    3919       pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    3920     }
    3921 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    3922     else
    3923     {
    3924       pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
    3925     }
    3926 #endif
    3927     if( ( iPdmInterDir & 2 ) == 2 )
    3928     {
    3929       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    3930     }
    3931 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    3932     else
    3933     {
    3934       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
    3935     }
    3936 #endif
    3937     if ( mrgCandIdx == iCount )
    3938     {
    3939       return;
    3940     }
    3941     iCount ++;
    3942   }
    3943 #endif //  H3D_IVMP
    3944 
    3945 #if MERL_VSP_COMPENSATION_C0152
    3946   //===== vsp 1 =====
    3947   if( iCount < 4 + extraMergeCand )
    3948     if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
    3949       return;
    3950 #endif
    3951 
    39523815  // above
    39533816  UInt uiAbovePartIdx = 0;
     
    40223885  }
    40233886
    4024 #if H3D_IVMP
    4025   if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 2 )
    4026   {
    4027     abCandIsInter        [ iCount ] = true;
    4028     puhInterDirNeighbours[ iCount ] = iPdmInterDir;
    4029     if( ( iPdmInterDir & 1 ) == 1 )
    4030     {
    4031       pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    4032     }
    4033 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    4034     else
    4035     {
    4036       pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
    4037     }
    4038 #endif
    4039     if( ( iPdmInterDir & 2 ) == 2 )
    4040     {
    4041       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    4042     }
    4043 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    4044     else
    4045     {
    4046       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
    4047     }
    4048 #endif
    4049     if ( mrgCandIdx == iCount )
    4050     {
    4051       return;
    4052     }
    4053     iCount ++;
    4054   }
    4055 #endif //  H3D_IVMP
    4056 
    4057 #if MERL_VSP_COMPENSATION_C0152
    4058   //===== vsp 2 =====
    4059   if( iCount < 4 + extraMergeCand )
    4060     if ( !xAddVspMergeCand(2, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
    4061       return;
    4062 #endif
    4063 
    40643887  // above right
    40653888  UInt uiAboveRightPartIdx = 0;
     
    41093932
    41103933#if H3D_IVMP
    4111   if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 3 )
    4112   {
    4113     abCandIsInter        [ iCount ] = true;
    4114     puhInterDirNeighbours[ iCount ] = iPdmInterDir;
    4115     if( ( iPdmInterDir & 1 ) == 1 )
    4116     {
    4117       pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    4118     }
    4119 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    4120     else
    4121     {
    4122       pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
    4123     }
    4124 #endif
    4125     if( ( iPdmInterDir & 2 ) == 2 )
    4126     {
    4127       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    4128     }
    4129 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    4130     else
    4131     {
    4132       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
    4133     }
    4134 #endif
    4135     if ( mrgCandIdx == iCount )
    4136     {
    4137       return;
    4138     }
    4139     iCount ++;
    4140   }
    41413934
    41423935  if(extraMergeCand)
    41433936  {
    4144     if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 4)
     3937    if(!bNoPdmMerge && iPdmDir[1] )
    41453938    {
    41463939      assert(iCount < MRG_MAX_NUM_CANDS_MEM);
     
    41873980#endif // H3D_IVMP
    41883981
    4189 #if MERL_VSP_COMPENSATION_C0152
    4190   //===== vsp 3 =====
    4191   if( iCount < 4 + extraMergeCand )
    4192     if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
    4193       return;
    4194 #endif
    4195 
    4196 #if MERL_VSP_C0152
    4197 #if VSP_MERGE_POS < 4
    4198 #if H3D_IVMP
    4199   if( iCount < 4 + extraMergeCand )
    4200 #else
    4201   if( iCount < 4 )
    4202 #endif
    4203   {
    4204 #endif
    4205 #endif
    42063982
    42073983  //left bottom
     
    42504026    iCount ++;
    42514027  }
    4252 #if MERL_VSP_C0152
    4253 #if VSP_MERGE_POS < 4
    4254   }
    4255 #endif
    4256 #endif
    4257  
    4258 #if H3D_IVMP
    4259   if( iPdmDir[0]   && !bNoPdmMerge && PDM_MERGE_POS == 4 )
    4260   {
    4261     abCandIsInter        [ iCount ] = true;
    4262     puhInterDirNeighbours[ iCount ] = iPdmInterDir;
    4263     if( ( iPdmInterDir & 1 ) == 1 )
    4264     {
    4265       pcMvFieldNeighbours[ iCount<<1    ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );
    4266     }
    4267 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    4268     else
    4269     {
    4270       pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );
    4271     }
    4272 #endif
    4273     if( ( iPdmInterDir & 2 ) == 2 )
    4274     {
    4275       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );
    4276     }
    4277 #if FIX_CU_BASED_MRG_CAND_LIST_B0136
    4278     else
    4279     {
    4280       pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );
    4281     }
    4282 #endif
    4283     if ( mrgCandIdx == iCount )
    4284     {
    4285       return;
    4286     }
    4287     iCount ++;
    4288   }
    4289 #endif //  H3D_IVMP
    4290 
    4291 #if MERL_VSP_COMPENSATION_C0152
    4292   //===== vsp 4 =====
    4293   if( iCount < 4 + extraMergeCand )
    4294     if ( !xAddVspMergeCand(4, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )
    4295       return;
    4296 #endif
     4028 
    42974029 
    42984030  // above left
     
    51644896
    51654897#if MERL_VSP_C0152
    5166 #if LGE_SIMP_DVP_REFINE_C0112
    5167 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine)
    5168 #else
    5169 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec)
    5170 #endif
     4898Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iBlkWidth, Int iBlkHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine)
    51714899{
    51724900  Int depStride =  pcBaseViewDepthPicYuv->getStride();
    51734901
    5174   Int width  = pcBaseViewDepthPicYuv->getWidth();
    5175   Int height = pcBaseViewDepthPicYuv->getHeight();
    5176 #if MTK_DVPREFINE_BVSP_BUG_FIX
    5177   Int depthPosX = Clip3(0,   width - iWidth,  iBlkX + (mv->getHor()>>2));
    5178   Int depthPosY = Clip3(0,   height - iHeight,  iBlkY + (mv->getVer()>>2));
    5179 #else
    5180   Int depthPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + (mv->getHor()>>2));
    5181   Int depthPosY = Clip3(0,   height- iHeight - 1,  iBlkY + (mv->getVer()>>2));
    5182 #endif
    5183   Pel *depth  = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride;
    5184   Pel  maxDepth = 0;
    5185 #if LGE_SIMP_DVP_REFINE_C0112
     4902  Int iPictureWidth  = pcBaseViewDepthPicYuv->getWidth();
     4903  Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight();
     4904
     4905  Int depthPosX = Clip3(0,   iPictureWidth - iBlkWidth,  iBlkX + (mv->getHor()>>2));
     4906  Int depthPosY = Clip3(0,   iPictureHeight- iBlkHeight,  iBlkY + (mv->getVer()>>2));
     4907
     4908  Pel *pDepthPel   = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride;
     4909  Pel  maxDepthVal = 0;
     4910
    51864911  if ( bSimpleDvpRefine )
    51874912  {
    5188 #if MTK_DVPREFINE_BVSP_BUG_FIX
    5189     Int depthStartPosX = Clip3(0,   width - iWidth,  iBlkX + (mv->getHor()>>2));
    5190     Int depthStartPosY = Clip3(0,   height - iHeight,  iBlkY + (mv->getVer()>>2));
    5191     Int depthEndPosX = Clip3(0,   width - 1,  iBlkX + iWidth - 1  + (mv->getHor()>>2));
    5192     Int depthEndPosY = Clip3(0,   height - 1,  iBlkY + iHeight - 1 + (mv->getVer()>>2));
    5193 #else
    5194     Int depthStartPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + (mv->getHor()>>2));
    5195     Int depthStartPosY = Clip3(0,   height- iHeight - 1,  iBlkY + (mv->getVer()>>2));
    5196     Int depthEndPosX = Clip3(0,   width - iWidth  - 1,  iBlkX + iWidth  + (mv->getHor()>>2));
    5197     Int depthEndPosY = Clip3(0,   height- iHeight - 1,  iBlkY + iHeight + (mv->getVer()>>2));
    5198 #endif
     4913    Int depthStartPosX = Clip3(0,   iPictureWidth - iBlkWidth,  iBlkX + (mv->getHor()>>2));
     4914    Int depthStartPosY = Clip3(0,   iPictureHeight- iBlkHeight,  iBlkY + (mv->getVer()>>2));
     4915    Int depthEndPosX   = Clip3(0,   iPictureWidth - 1,  iBlkX + iBlkWidth - 1 + (mv->getHor()>>2));
     4916    Int depthEndPosY   = Clip3(0,   iPictureHeight - 1,  iBlkY + iBlkHeight - 1 + (mv->getVer()>>2));
    51994917    Int iCenterX = (depthStartPosX + depthEndPosX) >> 1;
    52004918    Int iCenterY = (depthStartPosY + depthEndPosY) >> 1;
     
    52094927    for (Int i = 0; i < 5; i++)
    52104928    {
    5211       if (maxDepth < aiDepth[i])
    5212         maxDepth = aiDepth[i];
     4929      if (maxDepthVal < aiDepth[i])
     4930        maxDepthVal = aiDepth[i];
    52134931    }
    52144932  }
    52154933  else
    52164934  {
    5217     for (Int j = 0; j < iHeight; j++)
    5218     {
    5219       for (Int i = 0; i < iWidth; i++)
    5220       {
    5221         if (maxDepth < depth[i])
    5222           maxDepth = depth[i];
    5223       }
    5224       depth += depStride;
    5225     }
    5226   }
    5227 #else
    5228   for (Int j = 0; j < iHeight; j++)
    5229   {
    5230     for (Int i = 0; i < iWidth; i++)
    5231     {
    5232       if (maxDepth < depth[i])
    5233         maxDepth = depth[i];
    5234     }
    5235     depth += depStride;
    5236   }
    5237 #endif
    5238   Int disparity = aiShiftLUT[ maxDepth ] << iShiftPrec;
    5239 
    5240   return disparity;
    5241 }
    5242 #if LGE_SIMP_DVP_REFINE_C0112
     4935    for (Int j = 0; j < iBlkHeight; j++)
     4936    {
     4937      for (Int i = 0; i < iBlkWidth; i++)
     4938      {
     4939        if (maxDepthVal < pDepthPel[i])
     4940          maxDepthVal = pDepthPel[i];
     4941  }
     4942      pDepthPel += depStride;
     4943    }
     4944  }
     4945
     4946  Int iDisp = aiShiftLUT[ maxDepthVal ] << iShiftPrec;
     4947
     4948  return iDisp;
     4949}
    52434950Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine)
    5244 #else
    5245 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred)
    5246 #endif
    52474951{
    52484952  if (picDepth)
     
    52574961    Int* aiShiftLUT;
    52584962    Int  iShiftPrec;
     4963
    52594964    getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec);
    5260 #if LGE_SIMP_DVP_REFINE_C0112
    5261     Pel x = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine );
    5262 #else
    5263     Pel x = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec);
    5264 #endif
    5265     cMvPred->setHor(x);
     4965
     4966    Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine );
     4967    cMvPred->setHor( iDisp );
    52664968    clipMv(*cMvPred);
    52674969  }
     
    52704972
    52714973#if H3D_NBDV
    5272 Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo , Bool bParMerge
     4974
     4975Bool TComDataCU::xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, UInt uiPartIdx, UInt uiPartAddr, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, McpDisInfo* paMvpDvInfo, UInt uiMvpDvPos, Bool bDepthRefine )
     4976{
     4977  if( pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
     4978  {
     4979    Bool bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
     4980    for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     4981    {
     4982      RefPicList eRefPicList = RefPicList(iList);
     4983      Int      refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ;
     4984      TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
     4985
     4986      if( refId >= 0)
     4987      {
     4988        Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId );
     4989        if (refViewIdx != m_pcSlice->getViewId()) // DCP
     4990        {         
     4991          clipMv(cMvPred);
     4992
     4993          TComPic* picDepth = getSlice()->getRefPicBaseDepth();
     4994
     4995          if (picDepth && bDepthRefine)
     4996            estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);
     4997
     4998          pNbDvInfo->m_acMvCand[ pNbDvInfo->iN   ] = cMvPred;
     4999          pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++ ] = refViewIdx;
     5000
     5001          return true;
     5002        }
     5003        else if ( bSearchForMvpDv && cMvPred.m_bDvMcp && bTmpIsSkipped )
     5004        {
     5005          assert( uiMvpDvPos < MCP_DIS_CANS );
     5006          paMvpDvInfo->m_acMvCand[iList][ uiMvpDvPos ] = TComMv( cMvPred.m_iDvMcpDispX, cMvPred.m_iDvMcpDispY );
     5007          paMvpDvInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = 0; // works only for CTC
     5008          paMvpDvInfo->m_bAvailab[iList][ uiMvpDvPos ] = true;
     5009          paMvpDvInfo->m_bFound                        = true;
     5010        }
     5011      }
     5012#if MERL_VSP_C0152
     5013      else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
     5014      {
     5015        TComPic* picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
     5016        if (picDepth && bDepthRefine)
     5017          estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
     5018
     5019        cMvPred.setVer(0);
     5020
     5021        pNbDvInfo->m_acMvCand[ pNbDvInfo->iN]   = cMvPred;
     5022        pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++] = 0; // refViewIdx;
     5023        return true;
     5024      }
     5025#endif
     5026    }
     5027  }
     5028  return false;
     5029}
     5030
     5031
     5032Void TComDataCU::xDeriveRightBottomNbIdx( PartSize eCUMode, UInt uiPartIdx, Int &riLCUIdxRBNb, Int &riPartIdxRBNb )
     5033{
     5034  UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 
     5035  Int uiLCUIdx = getAddr();
     5036
     5037  UInt uiPartIdxRB;
     5038  deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 
     5039  UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
     5040
     5041  if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
     5042  {
     5043    riLCUIdxRBNb  = -1;
     5044    riPartIdxRBNb = -1;
     5045  }
     5046  else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
     5047  {
     5048    riLCUIdxRBNb  = -1;
     5049    riPartIdxRBNb = -1;
     5050  }
     5051  else
     5052  {
     5053    if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU
     5054      ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
     5055    {
     5056      riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
     5057      riLCUIdxRBNb  = uiLCUIdx;
     5058    }
     5059    else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
     5060    {
     5061      riPartIdxRBNb = -1;
     5062      riLCUIdxRBNb  = -1;
     5063    }
     5064    else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
     5065    {
     5066      riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
     5067      riLCUIdxRBNb = uiLCUIdx + 1;
     5068    }
     5069    else //is the right bottom corner of LCU                       
     5070    {
     5071      riPartIdxRBNb = -1;
     5072      riLCUIdxRBNb  = -1;
     5073    }
     5074  }
     5075}
     5076
     5077
     5078Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerge
    52735079#if MERL_VSP_C0152
    52745080                                , Bool bDepthRefine
     
    52765082                                )
    52775083{
    5278   PartSize eCUMode = getPartitionSize( uiPartAddr );
    5279   TComDataCU* pcTmpCU = NULL;
    5280   pDInfo->iN = 0;
    5281 
    5282   RefPicList eRefPicList = REF_PIC_LIST_0 ;
    5283   //-- Get Spatial MV
    5284   UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB;
    5285   UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();
    5286 
    5287   const Int iNumofDvMCP = 7;
    5288 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    5289   Int   aiDvMcpDvCandX[2][iNumofDvMCP] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
    5290   Int   aiDvMcpDvCandY[2][iNumofDvMCP] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
    5291 #else
    5292   Int   aiDvMcpDvCand[2][iNumofDvMCP] = {{0,},    {0,}}; // dummy, 5 spatial + 1 temporal
    5293 #endif
    5294   Bool  abDvMcpFlag  [2][iNumofDvMCP] = {{false,},{false,}};
    5295   TComMv cTmpMvPred, cMv;
    5296   Bool  bTmpIsSkipped = false;
    5297   Bool  bDvMcpIsFound = false;
    5298   Int   iLCUAddrDiff = 0;
    5299 
     5084  //// ******* Init variables ******* /////
     5085  // Init disparity struct for results
     5086  pDInfo->iN = 0;   
     5087
     5088  // Init struct for disparities from MCP neighboring blocks
     5089  McpDisInfo cMvpDvInfo;
     5090  cMvpDvInfo.m_bFound = false;
     5091  for (UInt iCurDvMcpCand = 0; iCurDvMcpCand < MCP_DIS_CANS; iCurDvMcpCand++)
     5092  {
     5093    for (UInt iList = 0; iList < 2; iList++)
     5094    {
     5095      cMvpDvInfo.m_acMvCand[iList][iCurDvMcpCand].setZero();
     5096      cMvpDvInfo.m_aVIdxCan[iList][iCurDvMcpCand] = 0;
     5097      cMvpDvInfo.m_bAvailab[iList][iCurDvMcpCand] = false;
     5098    }
     5099  }
     5100
     5101  // Get Positions 
     5102  PartSize eCUMode    = getPartitionSize( uiPartAddr );   
     5103  UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 
     5104
     5105  deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT );
     5106  deriveLeftBottomIdxGeneral  ( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB );
     5107
     5108  // Get parameters for parallel merge
    53005109  Int xP, yP, nPSW, nPSH;
    53015110  if( bParMerge)
    53025111    this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
    53035112
    5304   deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT );
    5305   deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB );
    5306 
    5307 #if MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097
    5308   // copied from getInterMergeCand()
     5113  //// ******* Get disparity from temporal neighboring blocks ******* /////
    53095114  if ( getSlice()->getPPS()->getEnableTMVPFlag() )
    53105115  {
    53115116    TComMv cColMv;
    53125117    Int iTargetViewIdx = 0;
    5313     Int iTStartViewIdx = 0;
    5314     UInt uiPartIdxRB, uiBRIdx;
    5315 #if !MTK_SIMPLIFY_DVTC_C0135
    5316     Int uiViewIdxCurr= getSlice()->getViewId();
    5317 #endif
     5118    Int iTStartViewIdx = 0;   
     5119
     5120    ///*** Derive center position ***
    53185121    UInt uiPartIdxCenter;
     5122    Int  uiLCUIdx   = getAddr();
     5123
    53195124    xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter );
    53205125
    5321     Int uiLCUIdx = getAddr();
    5322     Int uiLCUnew = uiLCUIdx;
    5323     eCUMode = getPartitionSize( 0 );
    5324     deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 
    5325     uiBRIdx = uiPartIdxLT;
    5326     UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
    5327 #if MTK_SIMPLIFY_DVTC_C0135
    5328     if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
    5329     {
    5330       uiLCUnew = -1;
    5331     }
    5332     else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
    5333     {
    5334       uiLCUnew = -1;
    5335     }
    5336     else
    5337 #else
    5338     if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ))  // image boundary check
    5339 #endif
    5340     {
    5341       if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU
    5342       ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
    5343       {
    5344         uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
    5345       }
    5346       else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
    5347       {
    5348         uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
    5349 #if MTK_SIMPLIFY_DVTC_C0135
    5350         uiLCUnew = -1;
    5351 #else
    5352         uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU();
    5353 #endif
    5354       }
    5355       else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
    5356       {
    5357         uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
    5358         uiLCUnew = uiLCUIdx + 1;
    5359       }
    5360       else //is the right bottom corner of LCU                       
    5361       {
    5362         uiBRIdx = 0;
    5363 #if MTK_SIMPLIFY_DVTC_C0135
    5364         uiLCUnew = -1;
    5365 #else
    5366         uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1;
    5367 #endif
    5368       }
    5369     }
    5370     const Int iNumofCandPic = 2;
    5371     for(Int i =0; i < iNumofCandPic; i++)
    5372     {
    5373       Int lpRef=0;
    5374       if(i == 0)
    5375       {   //check the col-located picture
    5376         eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);
    5377 #if COLLOCATED_REF_IDX
    5378         lpRef = getSlice()->getColRefIdx();
    5379 #else
    5380         Int lpRef = 0;
    5381 #endif
    5382       }
    5383       else
    5384       {
    5385         if(!(getPic()->getRapbCheck()))
     5126    ///*** Derive bottom right neighbour position ***
     5127    eCUMode          = getPartitionSize( 0 ); // Necessary?   
     5128    Int iLCUIdxRBNb  = -1;   
     5129    Int iPartIdxRBNb = -1;
     5130
     5131    xDeriveRightBottomNbIdx( eCUMode, uiPartIdx, iLCUIdxRBNb, iPartIdxRBNb );
     5132
     5133    ///*** Search temporal candidate pictures for disparity vector ***
     5134    const Int iNumCandPics = 2;
     5135    for(Int curCandPic = 0; curCandPic < iNumCandPics; curCandPic++)
     5136    {
     5137      // Get candidate picture
     5138      RefPicList eCurRefPicList   = REF_PIC_LIST_0 ;
     5139      Int        curCandPicRefIdx = 0;
     5140
     5141      if( curCandPic == 0 ) // check the co-located picture
     5142      {
     5143        eCurRefPicList   = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);
     5144        curCandPicRefIdx = getSlice()->getColRefIdx();
     5145      }
     5146      else                  // check RAP
     5147      {
     5148        if( !(getPic()->getRapbCheck()) )
    53865149          break;
    5387         eRefPicList=getPic()->getRapRefList();
    5388         lpRef=getPic()->getRapRefIdx();
    5389       }
    5390 
    5391       if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() )
    5392       {
    5393 #if !MTK_SIMPLIFY_DVTC_C0135
    5394         if (uiViewIdxCurr > 1) 
     5150
     5151        eCurRefPicList   = getPic()->getRapRefList();
     5152        curCandPicRefIdx = getPic()->getRapRefIdx();
     5153      }
     5154
     5155      // Check BR and Center       
     5156      if( m_pcSlice->getViewId() == getSlice()->getRefPic( eCurRefPicList, curCandPicRefIdx)->getViewId() )
     5157      {
     5158        for(Int curPosition = 0; curPosition < 2; curPosition++)
    53955159        {
    5396 #endif
    5397           if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
     5160          Bool bCheck = false;
     5161          if ( curPosition == 0 && iLCUIdxRBNb >= 0 )
     5162            bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb,  cColMv, iTargetViewIdx, iTStartViewIdx);
     5163
     5164          if (curPosition == 1 )
     5165            bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx,   uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx );
     5166
     5167          if( bCheck )
    53985168          {
    53995169            clipMv(cColMv);
    5400 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
     5170            TComPic* picDepth = getSlice()->getRefPicBaseDepth();
     5171            if (picDepth && bDepthRefine)
     5172              estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
     5173
    54015174            pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    54025175            pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5403 #else
    5404             {
    5405               TComPic* picDepth = NULL;
    5406               picDepth = getSlice()->getRefPicBaseDepth();
    5407               if (picDepth && bDepthRefine)
    5408 #if LGE_SIMP_DVP_REFINE_C0112
    5409                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
    5410 #else
    5411                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
    5412 #endif
    5413 
    5414               pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5415               pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5416             }
    5417 #endif
    54185176            return ;
    54195177          }
    5420 #if !MTK_SIMPLIFY_DVTC_C0135
    5421         }
    5422 #endif
    5423         if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx ))
    5424         {
    5425           clipMv(cColMv);
    5426 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5427             pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5428             pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5429 #else
    5430             {
    5431               TComPic* picDepth = NULL;
    5432               picDepth = getSlice()->getRefPicBaseDepth();
    5433               if (picDepth && bDepthRefine)
    5434 #if LGE_SIMP_DVP_REFINE_C0112
    5435                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
    5436 #else
    5437                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
    5438 #endif
    5439               pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5440               pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5441             }
    5442 #endif
    5443           return ;
    5444         }
    5445 #if !MTK_SIMPLIFY_DVTC_C0135
    5446         if(uiViewIdxCurr == 1) 
    5447         {
    5448           if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
    5449           {
    5450             clipMv(cColMv);
    5451 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5452             pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5453             pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5454 #else
    5455             {
    5456               TComPic* picDepth = NULL;
    5457               picDepth = getSlice()->getRefPicBaseDepth();
    5458               if (picDepth && bDepthRefine)
    5459 #if LGE_SIMP_DVP_REFINE_C0112
    5460                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
    5461 #else
    5462                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
    5463 #endif
    5464               pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5465               pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5466             }
    5467 #endif
    5468             return ;
    5469           }
    5470         }
    5471 #endif
    5472       }
    5473     }
     5178        } // Loop positions
     5179      }
     5180    } // Loop candidate views
    54745181  } // if TMVP Flag
    5475 #endif
     5182
    54765183  UInt uiIdx = 0;
     5184  Bool        bCheckMcpDv = false;   
     5185  TComDataCU* pcTmpCU     = NULL;
     5186
     5187
     5188  //// ******* Get disparity from left block ******* /////
    54775189  pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false);
    54785190  if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) )
     
    54895201  }
    54905202
    5491   if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    5492   {
    5493     bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    5494     for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
    5495     {
    5496       eRefPicList = RefPicList(iList);
    5497       Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ;
    5498       if( refId >= 0)
    5499       {
    5500         Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    5501         if (refViewIdx != m_pcSlice->getViewId()) // DCP
     5203  bCheckMcpDv = true;
     5204  if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFT, bDepthRefine ) )
     5205    return;
     5206
     5207
     5208  //// ******* Get disparity from above block ******* /////
     5209  pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true);
     5210  if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) )
     5211  {
     5212    pcTmpCU = NULL;
     5213  }
     5214
     5215  if (pcTmpCU && bParMerge)
     5216  {
     5217    if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP))
     5218    {
     5219      pcTmpCU = NULL;
     5220    }
     5221  }
     5222
     5223  if(pcTmpCU != NULL )
     5224  {
     5225    bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0);
     5226    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVE, bDepthRefine ) )
     5227      return;
     5228  }
     5229
     5230  //// ******* Get disparity from above right block ******* /////
     5231  pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true);
     5232
     5233  if (pcTmpCU && bParMerge)
     5234  {
     5235    if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP))
     5236    {
     5237      pcTmpCU = NULL;
     5238    }
     5239  }
     5240
     5241  if(pcTmpCU != NULL )
     5242  {
     5243    bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0);
     5244    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVERIGHT, bDepthRefine ) )
     5245      return;
     5246  }
     5247
     5248
     5249  //// ******* Get disparity from below left block ******* /////
     5250  pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false);
     5251
     5252  if (pcTmpCU && bParMerge)
     5253  {
     5254    if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP))
     5255    {
     5256      pcTmpCU = NULL;
     5257    }
     5258  }
     5259
     5260  if( pcTmpCU != NULL )
     5261  {
     5262    bCheckMcpDv = true;
     5263    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFTBELOW, bDepthRefine ) )
     5264      return;
     5265  }
     5266
     5267
     5268  //// ******* Get disparity from above left block ******* /////
     5269  pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true);
     5270  assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));
     5271
     5272  if (pcTmpCU && bParMerge)
     5273  {
     5274    if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP))
     5275    {
     5276      pcTmpCU = NULL;
     5277    }
     5278  }
     5279
     5280  if( pcTmpCU != NULL )
     5281  {
     5282    bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1);
     5283    if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVELEFT, bDepthRefine ) )
     5284      return;
     5285  }
     5286
     5287  //// ******* Search MCP blocks ******* /////
     5288  if( cMvpDvInfo.m_bFound )
     5289  {
     5290    for( Int curPos = 0 ; curPos < MCP_DIS_CANS ; curPos++ )
     5291    {
     5292      for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
     5293      {
     5294        if( cMvpDvInfo.m_bAvailab[iList][curPos] )
    55025295        {
    5503           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5504           clipMv(cMvPred);
    5505 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5506           pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5507           pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5508 #else
    5509           {
    5510             TComPic* picDepth = NULL;
    5511             picDepth = getSlice()->getRefPicBaseDepth();
    5512             if (picDepth && bDepthRefine)
    5513 #if LGE_SIMP_DVP_REFINE_C0112
    5514               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);
    5515 #else
    5516               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
    5517 #endif
    5518             pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5519             pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5520           }
    5521 #endif
     5296          TComMv cDispVec = cMvpDvInfo.m_acMvCand[iList][ curPos ];
     5297          clipMv( cDispVec );
     5298
     5299          TComPic* picDepth = getSlice()->getRefPicBaseDepth();
     5300          if (picDepth && bDepthRefine)
     5301            estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cDispVec, true);
     5302
     5303          pDInfo->m_acMvCand[ pDInfo->iN]   = cDispVec;
     5304          pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;
    55225305          return;
    55235306        }
    5524         else // MCP
    5525         {
    5526           cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5527           if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
    5528           {
    5529 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    5530             aiDvMcpDvCandX[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX;
    5531             aiDvMcpDvCandY[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispY;
    5532 #else
    5533             aiDvMcpDvCand[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX;
    5534 #endif
    5535             abDvMcpFlag  [iList][DVFROM_LEFT] = true;
    5536             bDvMcpIsFound = true;
    5537           }
    5538         }
    5539       }
    5540 #if MERL_VSP_C0152
    5541       else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
    5542       {
    5543         TComPic* picDepth = NULL;
    5544         TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
    5545         picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
    5546         if (picDepth && bDepthRefine)
    5547           estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
    5548         myMv.setVer(0);
    5549 
    5550         pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
    5551         pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
    5552         return;
    5553       }
    5554 #endif
    5555     }
    5556   }
    5557 
    5558   pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true);
    5559   if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) )
    5560   {
    5561     pcTmpCU = NULL;
    5562   }
    5563 
    5564   if (pcTmpCU && bParMerge)
    5565   {
    5566     if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP))
    5567     {
    5568       pcTmpCU = NULL;
    5569     }
    5570   }
    5571 
    5572   if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    5573   {
    5574     iLCUAddrDiff = getAddr() - pcTmpCU->getAddr();
    5575     bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    5576     for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
    5577     {
    5578       eRefPicList = RefPicList(iList);
    5579       Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ;
    5580       if( refId >= 0)
    5581       {
    5582         Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    5583         if (refViewIdx!= m_pcSlice->getViewId())
    5584         {
    5585           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5586           clipMv(cMvPred);
    5587 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5588           pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5589           pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5590 #else
    5591           {
    5592             TComPic* picDepth = NULL;
    5593             picDepth = getSlice()->getRefPicBaseDepth();
    5594             if (picDepth && bDepthRefine)
    5595 #if LGE_SIMP_DVP_REFINE_C0112
    5596               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);
    5597 #else
    5598               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
    5599 #endif
    5600             pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5601             pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5602           }
    5603 #endif
    5604           return;
    5605         }
    5606         else if(iLCUAddrDiff == 0) //MCP, within same LCU
    5607         {
    5608           cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5609           if( cTmpMvPred.m_bDvMcp  && bTmpIsSkipped )
    5610           {
    5611 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    5612             aiDvMcpDvCandX[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX;
    5613             aiDvMcpDvCandY[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispY;
    5614 #else
    5615             aiDvMcpDvCand[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX;
    5616 #endif
    5617             abDvMcpFlag  [iList][DVFROM_ABOVE] = true;
    5618             bDvMcpIsFound = true;
    5619           }
    5620         }
    5621       }
    5622 #if MERL_VSP_C0152
    5623       else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
    5624       {
    5625         TComPic* picDepth = NULL;
    5626         TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
    5627         picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
    5628         if (picDepth && bDepthRefine)
    5629           estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
    5630         myMv.setVer(0);
    5631 
    5632         pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
    5633         pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
    5634         return;
    5635       }
    5636 #endif
    5637     }
    5638   }
    5639 
    5640   pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true);
    5641 
    5642   if (pcTmpCU && bParMerge)
    5643   {
    5644     if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP))
    5645     {
    5646       pcTmpCU = NULL;
    5647     }
    5648   }
    5649 
    5650   if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) )
    5651   {
    5652     iLCUAddrDiff = getAddr() - pcTmpCU->getAddr();
    5653     bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    5654     for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
    5655     {
    5656       eRefPicList = RefPicList(iList);
    5657       Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ;
    5658       if( refId >= 0)
    5659       {
    5660         Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    5661         if (refViewIdx!= m_pcSlice->getViewId())
    5662         {
    5663           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5664           clipMv(cMvPred);
    5665 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5666           pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5667           pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5668 #else
    5669           {
    5670             TComPic* picDepth = NULL;
    5671             picDepth = getSlice()->getRefPicBaseDepth();
    5672             if (picDepth && bDepthRefine)
    5673 #if LGE_SIMP_DVP_REFINE_C0112
    5674               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);
    5675 #else
    5676               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
    5677 #endif
    5678             pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5679             pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5680           }
    5681 #endif
    5682           return;
    5683         }
    5684         else if(iLCUAddrDiff == 0)
    5685         {
    5686           cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5687           if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
    5688           {
    5689 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    5690             aiDvMcpDvCandX[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX;
    5691             aiDvMcpDvCandY[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispY;
    5692 #else
    5693             aiDvMcpDvCand[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX;
    5694 #endif
    5695             abDvMcpFlag  [iList][DVFROM_ABOVERIGHT] = true;
    5696             bDvMcpIsFound = true;
    5697           }
    5698         }
    5699       }
    5700 #if MERL_VSP_C0152
    5701       else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
    5702       {
    5703         TComPic* picDepth = NULL;
    5704         TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
    5705         picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
    5706         if (picDepth && bDepthRefine)
    5707           estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
    5708         myMv.setVer(0);
    5709 
    5710         pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
    5711         pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
    5712         return;
    5713       }
    5714 #endif
    5715     }
    5716   }
    5717 
    5718   pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false);
    5719 
    5720   if (pcTmpCU && bParMerge)
    5721   {
    5722     if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP))
    5723     {
    5724       pcTmpCU = NULL;
    5725     }
    5726   }
    5727 
    5728   if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    5729   {
    5730     bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    5731     for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
    5732     {
    5733       eRefPicList = RefPicList(iList);
    5734       Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ;
    5735       if( refId >= 0)
    5736       {
    5737         Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    5738         if (refViewIdx!= m_pcSlice->getViewId())
    5739         {
    5740           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5741           clipMv(cMvPred);
    5742 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5743           pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5744           pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5745 #else
    5746           {
    5747             TComPic* picDepth = NULL;
    5748             picDepth = getSlice()->getRefPicBaseDepth();
    5749             if (picDepth && bDepthRefine)
    5750 #if LGE_SIMP_DVP_REFINE_C0112
    5751               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);
    5752 #else
    5753               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
    5754 #endif
    5755             pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5756             pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5757           }
    5758 #endif
    5759           return;
    5760         }
    5761         else // MCP
    5762         {
    5763           cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5764           if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
    5765           {
    5766 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    5767             aiDvMcpDvCandX[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX;
    5768             aiDvMcpDvCandY[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispY;
    5769 #else
    5770             aiDvMcpDvCand[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX;
    5771 #endif
    5772             abDvMcpFlag  [iList][DVFROM_LEFTBELOW] = true;
    5773             bDvMcpIsFound = true;
    5774           }
    5775         }
    5776       }
    5777 #if MERL_VSP_C0152
    5778       else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
    5779       {
    5780         TComPic* picDepth = NULL;
    5781         TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
    5782         picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
    5783         if (picDepth && bDepthRefine)
    5784           estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
    5785         myMv.setVer(0);
    5786 
    5787         pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
    5788         pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
    5789         return;
    5790       }
    5791 #endif
    5792     }
    5793   }
    5794 
    5795   // Above predictor search
    5796   pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true);
    5797   assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr));
    5798 
    5799   if (pcTmpCU && bParMerge)
    5800   {
    5801     if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP))
    5802     {
    5803       pcTmpCU = NULL;
    5804     }
    5805   }
    5806 
    5807   if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ))
    5808   {
    5809     iLCUAddrDiff = getAddr() - pcTmpCU->getAddr();
    5810 
    5811     bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx );
    5812     for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
    5813     {
    5814       eRefPicList = RefPicList(iList);
    5815       Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ;
    5816       if( refId >= 0)
    5817       {
    5818         Int refViewIdx  = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId);
    5819         if (refViewIdx!= m_pcSlice->getViewId())
    5820         {
    5821           TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5822           clipMv(cMvPred);
    5823 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5824           pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5825           pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5826 #else
    5827           {
    5828             TComPic* picDepth = NULL;
    5829             picDepth = getSlice()->getRefPicBaseDepth();
    5830             if (picDepth && bDepthRefine)
    5831 #if LGE_SIMP_DVP_REFINE_C0112
    5832               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);
    5833 #else
    5834               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);
    5835 #endif
    5836             pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;
    5837             pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;
    5838           }
    5839 #endif
    5840           return;
    5841         }
    5842         else if(iLCUAddrDiff <= 1)
    5843         {
    5844           cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);
    5845           if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )
    5846           {
    5847 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    5848             aiDvMcpDvCandX[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX;
    5849             aiDvMcpDvCandY[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispY;
    5850 #else
    5851             aiDvMcpDvCand[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX;
    5852 #endif
    5853             abDvMcpFlag  [iList][DVFROM_ABOVELEFT] = true;
    5854             bDvMcpIsFound = true;
    5855           }
    5856         }
    5857       }
    5858 #if MERL_VSP_C0152
    5859       else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP
    5860       {
    5861         TComPic* picDepth = NULL;
    5862         TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx );
    5863         picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth();
    5864         if (picDepth && bDepthRefine)
    5865           estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv);
    5866         myMv.setVer(0);
    5867 
    5868         pDInfo->m_acMvCand[ pDInfo->iN] = myMv;
    5869         pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx;
    5870         return;
    5871       }
    5872 #endif
    5873     }
    5874   }
    5875 #if !MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097
    5876   // copied from getInterMergeCand()
    5877   if ( getSlice()->getPPS()->getEnableTMVPFlag() )
    5878   {
    5879     TComMv cColMv;
    5880     Int iTargetViewIdx = 0;
    5881     Int iTStartViewIdx = 0;
    5882     UInt uiPartIdxRB, uiBRIdx;
    5883 #if !MTK_SIMPLIFY_DVTC_C0135
    5884     Int uiViewIdxCurr= getSlice()->getViewId();
    5885 #endif
    5886     UInt uiPartIdxCenter;
    5887     xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter );
    5888 
    5889     Int uiLCUIdx = getAddr();
    5890     Int uiLCUnew = uiLCUIdx;
    5891     eCUMode = getPartitionSize( 0 );
    5892     deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 
    5893     uiBRIdx = uiPartIdxLT;
    5894     UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];
    5895 #if MTK_SIMPLIFY_DVTC_C0135
    5896     if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() )
    5897     {
    5898       uiLCUnew = -1;
    5899     }
    5900     else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )
    5901     {
    5902       uiLCUnew = -1;
    5903     }
    5904     else
    5905 #else
    5906     if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() ))  // image boundary check
    5907 #endif
    5908     {
    5909       if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) &&           // is not at the last column of LCU
    5910       ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row    of LCU
    5911       {
    5912         uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];
    5913       }
    5914       else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 )           // is not at the last column of LCU But is last row of LCU
    5915       {
    5916         uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];
    5917 #if MTK_SIMPLIFY_DVTC_C0135
    5918         uiLCUnew = -1;
    5919 #else
    5920         uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU();
    5921 #endif
    5922       }
    5923       else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU
    5924       {
    5925         uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];
    5926         uiLCUnew = uiLCUIdx + 1;
    5927       }
    5928       else //is the right bottom corner of LCU                       
    5929       {
    5930         uiBRIdx = 0;
    5931 #if MTK_SIMPLIFY_DVTC_C0135
    5932         uiLCUnew = -1;
    5933 #else
    5934         uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1;
    5935 #endif
    5936       }
    5937     }
    5938     const Int iNumofCandPic = 2;
    5939     for(Int i =0; i < iNumofCandPic; i++)
    5940     {
    5941       Int lpRef=0;
    5942       if(i == 0)
    5943       {   //check the col-located picture
    5944         eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);
    5945 #if COLLOCATED_REF_IDX
    5946         lpRef = getSlice()->getColRefIdx();
    5947 #else
    5948         Int lpRef = 0;
    5949 #endif
    5950       }
    5951       else
    5952       {
    5953         if(!(getPic()->getRapbCheck()))
    5954           break;
    5955         eRefPicList=getPic()->getRapRefList();
    5956         lpRef=getPic()->getRapRefIdx();
    5957       }
    5958 
    5959       if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() )
    5960       {
    5961 #if !MTK_SIMPLIFY_DVTC_C0135
    5962         if (uiViewIdxCurr > 1) 
    5963         {
    5964 #endif
    5965           if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
    5966           {
    5967             clipMv(cColMv);
    5968 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5969             pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5970             pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5971 #else
    5972             {
    5973               TComPic* picDepth = NULL;
    5974               picDepth = getSlice()->getRefPicBaseDepth();
    5975               if (picDepth && bDepthRefine)
    5976 #if LGE_SIMP_DVP_REFINE_C0112
    5977                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
    5978 #else
    5979                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
    5980 #endif
    5981 
    5982               pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5983               pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5984             }
    5985 #endif
    5986             return ;
    5987           }
    5988 #if !MTK_SIMPLIFY_DVTC_C0135
    5989         }
    5990 #endif
    5991         if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter,  cColMv, iTargetViewIdx, iTStartViewIdx ))
    5992         {
    5993           clipMv(cColMv);
    5994 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    5995             pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    5996             pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    5997 #else
    5998             {
    5999               TComPic* picDepth = NULL;
    6000               picDepth = getSlice()->getRefPicBaseDepth();
    6001               if (picDepth && bDepthRefine)
    6002 #if LGE_SIMP_DVP_REFINE_C0112
    6003                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
    6004 #else
    6005                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
    6006 #endif
    6007               pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    6008               pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    6009             }
    6010 #endif
    6011           return ;
    6012         }
    6013 #if !MTK_SIMPLIFY_DVTC_C0135
    6014         if(uiViewIdxCurr == 1) 
    6015         {
    6016           if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )
    6017           {
    6018             clipMv(cColMv);
    6019 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    6020             pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    6021             pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    6022 #else
    6023             {
    6024               TComPic* picDepth = NULL;
    6025               picDepth = getSlice()->getRefPicBaseDepth();
    6026               if (picDepth && bDepthRefine)
    6027 #if LGE_SIMP_DVP_REFINE_C0112
    6028                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);
    6029 #else
    6030                 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);
    6031 #endif
    6032               pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;
    6033               pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;
    6034             }
    6035 #endif
    6036             return ;
    6037           }
    6038         }
    6039 #endif
    6040       }
    6041     }
    6042   } // if TMVP Flag
    6043 #endif
    6044 
    6045   if( bDvMcpIsFound ) // skip dvmcp
    6046   {
    6047     for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial
    6048     {
    6049       for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)
    6050       {
    6051         if( abDvMcpFlag[iList][i]==true )
    6052         {
    6053 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    6054           TComMv dv( aiDvMcpDvCandX[iList][ i ], aiDvMcpDvCandY[iList][ i ] );
    6055 #else
    6056           TComMv dv( aiDvMcpDvCand[iList][ i ], 0 );
    6057 #endif
    6058           clipMv( dv );
    6059 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    6060           pDInfo->m_acMvCand[ pDInfo->iN] = dv;
    6061           pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;
    6062 #else
    6063           {
    6064             TComPic* picDepth = NULL;
    6065             picDepth = getSlice()->getRefPicBaseDepth();
    6066             if (picDepth && bDepthRefine)
    6067 #if LGE_SIMP_DVP_REFINE_C0112
    6068               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv, true);
    6069 #else
    6070               estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv);
    6071 #endif
    6072             pDInfo->m_acMvCand[ pDInfo->iN] = dv;
    6073             pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;
    6074           }
    6075 #endif
    6076           return;
    6077         }
    6078 
    60795307      }
    60805308    }
     
    61315359#endif
    61325360              );
     5361
    61335362#if FCO_DVP_REFINE_C0132_C0170
    61345363      if(getPic()->getDepthCoded() )
     
    61535382        cDisInfo.m_aVIdxCan[0] = 0;
    61545383      }
    6155 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    61565384      Int paiPdmRefIdx[4] = {-1, -1, -1, -1};
    61575385      Int iPdmDir[4]      = {-1, -1, -1, -1};
    6158 #if QC_C0051_FIXED_BY_MTK
    61595386      TComMv cPdmMvPred[4];
    6160 #else
    6161       TComMv cPdmMvPred[2];
    6162 #endif
    61635387      cPdmMvPred[0].m_bDvMcp = cPdmMvPred[1].m_bDvMcp = false;
    61645388      if(getUnifiedMvPredCan(uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, cPdmMvPred, &cDisInfo, iPdmDir, false))
    6165 #else // QC_AMVP_MRG_UNIFY_IVCAN_C0051
    6166       TComMv  cPdmMvPred;
    6167       if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )
    6168 #endif // QC_AMVP_MRG_UNIFY_IVCAN_C0051
    61695389#else // H3D_NBDV
    61705390      if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )
    61715391#endif
    61725392
    6173 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    61745393      {
    61755394        clipMv( cPdmMvPred[0] );
     
    61805399        pInfo->m_acMvCand[0].set(0,0);
    61815400      }
    6182 #else
    6183       {
    6184         clipMv( cPdmMvPred );
    6185         pInfo->m_acMvCand[0] = cPdmMvPred;
    6186       }
    6187       else
    6188       {
    6189         pInfo->m_acMvCand[0].set(0,0);
    6190       }
    6191 #endif
    61925401    }
    61935402  }
     
    67715980  iColViewIdx = pColCU->getSlice()->getViewId();
    67725981#if MERL_VSP_C0152
    6773   //TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
    67745982  if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0)
    67755983  {
     
    67865994    if(pColCU->getSlice()->isInterB())
    67875995    {
    6788 #if !QC_NBDV_LDB_FIX_C0055
    6789       if(ilist == 0 )
    6790         eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(1-getSlice()->getColDir());
    6791       else
    6792         eColRefPicList = getSlice()->getCheckLDC() ? (eRefPicList== REF_PIC_LIST_0? REF_PIC_LIST_1:REF_PIC_LIST_0 ): RefPicList(getSlice()->getColDir());
    6793 #else
    67945996        eColRefPicList = RefPicList(ilist);
    6795 #endif
    67965997    }
    67975998
     
    79337134}
    79347135#else //H3D_NBDV
    7935 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    79367136Bool
    79377137TComDataCU::getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
     
    79437143  return false;
    79447144}
    7945 #else
    7946 Int
    7947 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm )
    7948 {
    7949   TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
    7950   ROFRS( pcDepthMapGenerator, 0 );
    7951   return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo, iPdm );
    7952 }
    7953 Bool
    7954 TComDataCU::getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge )
    7955 {
    7956   TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator();
    7957   ROFRS( pcDepthMapGenerator, false );
    7958   if (pDInfo->iN > 0 && pcDepthMapGenerator->getDisCanPdmMvPred(this, uiPartIdx, eRefPicList, iRefIdx, rcMv, pDInfo, bMerge )) //bug fix li
    7959     return true;
    7960   return false;
    7961 }
    7962 #endif
    79637145#endif //H3D_NBDV
    79647146
     
    80007182  else
    80017183#endif
    8002   getDisMvpCandNBDV( 0, 0,  &cDisInfo, false );
     7184
     7185  getDisMvpCandNBDV( 0, 0,  &cDisInfo, false ); 
     7186
    80037187  if( cDisInfo.iN == 0)
    80047188  {
     
    80087192  else
    80097193  {
    8010 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    80117194    Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0], bRecon );       
    8012 #else
    8013     Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0].getHor(), bRecon );
    8014 #endif
    80157195    m_pePartSize[0] = m_peSaved;
    80167196    return bAvailable;
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r299 r332  
    287287  );
    288288#if H3D_NBDV
     289  Void          xDeriveRightBottomNbIdx( PartSize eCUMode, UInt uiPartIdx, Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb );
     290  Bool          xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, UInt uiPartIdx, UInt uiPartAddr, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, McpDisInfo* paMvpDvInfo, UInt uiMvpDvPos, Bool bDepthRefine );
    289291  Bool          xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
    290292#endif
     
    533535  Bool          getPdmMvPred              ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
    534536#else //!H3D_NBDV
    535 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    536537  Bool          getUnifiedMvPredCan       ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
    537 #else //QC_AMVP_MRG_UNIFY_IVCAN_C0051
    538   Bool          getPdmMvPredDisCan        ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false );
    539   Int           getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm );
    540 #endif //QC_AMVP_MRG_UNIFY_IVCAN_C0051
    541538  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
    542539  Void          getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerg = false
     
    550547
    551548#if MERL_VSP_C0152
    552 #if LGE_SIMP_DVP_REFINE_C0112
    553549  Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine = false);
    554550  Void          estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false);
    555 #else
    556   Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec);
    557   Void          estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred);
    558 #endif
    559551#endif
    560552  Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
     
    579571  // member functions for accessing partition information
    580572  // -------------------------------------------------------------------------------------------------------------------
    581 #if LG_RESTRICTEDRESPRED_M24766
     573#if H3D_IVRP
    582574  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
    583 #else
    584   Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
    585 #endif
    586 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    587   Int           getResiPredMode(UInt uiPartAddr);
    588   Void          getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex);
    589575#endif
    590576  UChar         getNumPartInter       ();
     
    601587  Void          fillMvpCandBase       ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
    602588  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1);
    603 #else
    604   Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
    605589#endif
    606590  Bool          isDiffMER             ( Int xN, Int yN, Int xP, Int yP);
     
    831815  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    832816  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
     817 
     818
    833819#endif
    834820};
  • trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp

    r296 r332  
    605605
    606606#if H3D_IVMP
    607 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    608607Bool
    609608TComDepthMapGenerator::getPdmCandidate(TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge )
     
    636635  for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ )
    637636  {
    638 #if MTK_C0138_FIXED
     637
    639638    UInt        uiBaseId    = uiBId;
    640 #else
    641     UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
    642 #endif
    643639    TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
    644640    for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ )
     
    785781  return false;
    786782}
    787 #else // QC_AMVP_MRG_UNIFY_IVCAN_C0051
    788 #if H3D_NBDV
    789 Int
    790 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm )
    791 #else
    792 Int
    793 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv )
    794 #endif
    795 {
    796   AOF  ( m_bCreated && m_bInit );
    797 
    798 #if !H3D_NBDV
    799   ROFRS( m_bPDMAvailable, 0 );
    800 #endif
    801 
    802   TComSlice*    pcSlice     = pcCU->getSlice ();
    803   TComSPS*      pcSPS       = pcSlice->getSPS();
    804   AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
    805   Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
    806   ROTRS( !bPdmMerge, 0 );
    807 
    808   Bool abPdmAvailable[4] = {false, false, false, false};
    809 
    810   Int iValid = 0;
    811   Int iViewId = 0;
    812   for( UInt uiBId = 0; uiBId < m_uiCurrViewId && iValid==0; uiBId++ )
    813   {
    814     UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
    815     TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
    816     for( Int iRefListId = 0; iRefListId < 2 && iValid==0; iRefListId++ )
    817     {
    818       RefPicList  eRefPicListTest = RefPicList( iRefListId );
    819       Int         iNumRefPics = pcSlice->getNumRefIdx( eRefPicListTest ) ;
    820       for( Int iRefIndex = 0; iRefIndex < iNumRefPics; iRefIndex++ )
    821       {
    822         if(pcBasePic->getPOC() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getPOC()
    823           && pcBasePic->getViewId() == pcSlice->getRefPic( eRefPicListTest, iRefIndex )->getViewId())
    824         {
    825           iValid=1;
    826           iViewId = uiBaseId;
    827           break;
    828         }
    829       }
    830     }
    831   }
    832   if (iValid == 0)
    833     return 0;
    834 
    835   //--- get base CU/PU and check prediction mode ---
    836   TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( iViewId );
    837   TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
    838 
    839 #if H3D_NBDV
    840   Int  iCurrPosX, iCurrPosY;
    841   UInt          uiPartAddr;
    842   Int           iWidth;
    843   Int           iHeight;
    844 
    845   pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
    846   pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
    847   iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
    848   iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
    849 
    850   Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) );
    851   Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 ));
    852   Int         iBaseCUAddr;
    853   Int         iBaseAbsPartIdx;
    854   pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
    855 #else
    856   Int  iPrdDepth, iCurrPosX, iCurrPosY;
    857   Bool bAvailable  = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY );
    858   AOF( bAvailable );
    859   TComPicYuv* pcBasePdm   = pcBasePic->getPredDepthMap();
    860   Int         iDisparity  = xGetDisparityFromVirtDepth( iViewId, iPrdDepth );
    861   Int         iShiftX     = m_uiSubSampExpX + 2;
    862   Int         iAddX       = ( 1 << iShiftX ) >> 1;
    863   Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) );
    864   Int         iBasePosY   = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY                               );
    865   Int         iBaseCUAddr;
    866   Int         iBaseAbsPartIdx;
    867   pcBaseRec->getCUAddrAndPartIdx( iBasePosX<< m_uiSubSampExpX , iBasePosY<< m_uiSubSampExpY , iBaseCUAddr, iBaseAbsPartIdx );
    868 #endif
    869 
    870   TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    871 
    872   if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTER || pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_SKIP )
    873   {
    874     for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ )
    875     {
    876       RefPicList  eBaseRefPicList = RefPicList( uiBaseRefListId );
    877       TComMvField cBaseMvField;
    878       pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    879       Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    880 
    881       if (iBaseRefIdx >= 0)
    882       {
    883         Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
    884         if (iBaseRefPOC != pcSlice->getPOC())   
    885         {
    886           for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eBaseRefPicList ); iPdmRefIdx++)
    887           {
    888             if (iBaseRefPOC == pcSlice->getRefPOC(eBaseRefPicList, iPdmRefIdx))
    889             {
    890               abPdmAvailable[ uiBaseRefListId ] = true;
    891               paiPdmRefIdx  [ uiBaseRefListId ] = iPdmRefIdx;
    892               TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
    893 #if H3D_NBDV
    894               cMv.m_bDvMcp = true;
    895               cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor();
    896 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    897               cMv.m_iDvMcpDispY = pDInfo->m_acMvCand[0].getVer();
    898 #endif
    899 #endif //H3D_NBDV
    900               pcCU->clipMv( cMv );
    901               pacPdmMv      [ uiBaseRefListId ] = cMv;
    902               break;
    903             }
    904           }
    905         }
    906       }
    907     }
    908   }
    909   Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 );
    910 
    911   iPdm[0] = iPdmInterDir;
    912     for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
    913     {
    914       RefPicList  eRefPicList       = RefPicList( iRefListId );
    915       Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicList );
    916       for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
    917       {
    918         if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC())
    919         {
    920           abPdmAvailable[ iRefListId+2 ] = true;
    921           paiPdmRefIdx  [ iRefListId+2 ] = iPdmRefIdx;
    922 #if H3D_NBDV
    923           TComMv cMv = pDInfo->m_acMvCand[0];
    924           cMv.setVer(0);
    925 #else
    926           TComMv cMv(iDisparity, 0);
    927 #endif
    928           pcCU->clipMv( cMv );
    929           pacPdmMv      [ iRefListId + 2] = cMv;
    930           break;
    931         }
    932       }
    933     }
    934     iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ;
    935     iPdm[1] = iPdmInterDir;
    936 
    937   return iPdmInterDir;
    938 }
    939 
    940 #if H3D_NBDV
    941 Bool
    942 TComDepthMapGenerator::getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge )
    943 {
    944   rcMv.m_bDvMcp = false;
    945   AOF  ( m_bCreated && m_bInit );
    946   AOF  ( iRefIdx >= 0 );
    947   AOF  ( pcCU );
    948   TComSlice*    pcSlice     = pcCU->getSlice ();
    949   TComSPS*      pcSPS       = pcSlice->getSPS();
    950   AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
    951   TComPic*      pcRefPic    = pcSlice->getRefPic( eRefPicList, iRefIdx );
    952   UInt          uiRefViewId = pcRefPic->getSPS()->getViewId();
    953   Int           iRefPoc     = pcRefPic->getPOC();
    954   Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
    955   AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
    956   AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
    957   Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
    958   Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
    959   Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
    960   ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false );
    961   ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false );
    962   ROTRS(                  bMerge   && !bPdmMerge, false );
    963   Int  iCurrPosX, iCurrPosY;
    964   TComMv cDisMv;
    965 
    966   if( bInterview )
    967   {
    968     rcMv = pDInfo->m_acMvCand[0];
    969     rcMv.setVer(0);
    970     return      true;
    971   }
    972   for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ )
    973   {
    974     UInt        uiBaseId    = uiBId;
    975 
    976     if (m_uiCurrViewId >1 && uiBaseId ==1 )
    977       continue;
    978 
    979     TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
    980     TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
    981     UInt          uiPartAddr;
    982     Int           iWidth;
    983     Int           iHeight;
    984 
    985     pcCU->getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
    986     pcBaseRec->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
    987     iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
    988     iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
    989     Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (pDInfo->m_acMvCand[0].getHor() + 2 ) >> 2 ) );
    990     Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (pDInfo->m_acMvCand[0].getVer() + 2 ) >> 2 )); 
    991     Int         iBaseCUAddr;
    992     Int         iBaseAbsPartIdx;
    993     pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
    994     TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    995     if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP )
    996     {
    997       continue;
    998     }
    999     for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ )
    1000     {
    1001       RefPicList  eBaseRefPicList = RefPicList( uiBaseRefListId );
    1002       TComMvField cBaseMvField;
    1003       pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    1004       Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    1005       Int         iBaseRefPoc     = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) );
    1006       if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc )
    1007       {
    1008         rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() );
    1009         // save disparity vector when a merge candidate for IVMP is set as DV-MCP
    1010         if( bMerge )
    1011         {
    1012           rcMv.m_bDvMcp = true;
    1013           rcMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor();
    1014 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    1015           rcMv.m_iDvMcpDispY = pDInfo->m_acMvCand[0].getVer();
    1016 #endif
    1017         }
    1018         else { // AMVP ?
    1019           rcMv.m_bDvMcp = false;
    1020         }
    1021         return true;
    1022       }
    1023     }
    1024   }
    1025   return false;
    1026 }
    1027 #else // H3D_NBDV
    1028 Bool 
    1029 TComDepthMapGenerator::getPdmMvPred( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge )
    1030 {
    1031   AOF  ( m_bCreated && m_bInit );
    1032   AOF  ( iRefIdx >= 0 );
    1033   AOF  ( pcCU );
    1034   ROFRS( m_bPDMAvailable, false );
    1035 
    1036   TComSlice*    pcSlice     = pcCU->getSlice ();
    1037   TComPic*      pcPic       = pcCU->getPic   ();
    1038   TComSPS*      pcSPS       = pcSlice->getSPS();
    1039   AOF  ( pcPic->getPredDepthMap() );
    1040   AOF  ( pcSPS->getViewId() == m_uiCurrViewId );
    1041  
    1042   TComPic*      pcRefPic    = pcSlice->getRefPic( eRefPicList, iRefIdx );
    1043   UInt          uiRefViewId = pcRefPic->getSPS()->getViewId();
    1044   Int           iRefPoc     = pcRefPic->getPOC();
    1045   Bool          bInterview  = ( uiRefViewId < m_uiCurrViewId );
    1046   AOT(  bInterview && iRefPoc != pcSlice->getPOC() );
    1047   AOT( !bInterview && iRefPoc == pcSlice->getPOC() );
    1048 
    1049   Bool          bPdmIView   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_IVIEW ) == PDM_USE_FOR_IVIEW );
    1050   Bool          bPdmInter   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_INTER ) == PDM_USE_FOR_INTER );
    1051   Bool          bPdmMerge   = ( ( pcSPS->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) == PDM_USE_FOR_MERGE );
    1052   ROTRS( ( bInterview && !bMerge ) && !bPdmIView, false );
    1053   ROTRS( (!bInterview && !bMerge ) && !bPdmInter, false );
    1054   ROTRS(                  bMerge   && !bPdmMerge, false );
    1055 
    1056   //===== get predicted depth for middle position of current PU ===== 
    1057   Int  iPrdDepth, iCurrPosX, iCurrPosY;
    1058   Bool bAvailable  = xGetPredDepth( pcCU, uiPartIdx, iPrdDepth, &iCurrPosX, &iCurrPosY );
    1059   AOF( bAvailable );
    1060  
    1061   //===== inter-view motion vector prediction =====
    1062   if( bInterview )
    1063   {
    1064     Int         iDisparity  = xGetDisparityFromVirtDepth( uiRefViewId, iPrdDepth );
    1065     rcMv.set  ( iDisparity, 0 );
    1066     return      true;
    1067   }
    1068  
    1069   //===== inter motion vector prediction =====
    1070   for( UInt uiBId = 0; uiBId < m_uiCurrViewId; uiBId++ )
    1071   {
    1072     //--- get base CU/PU and check prediction mode ---
    1073     UInt        uiBaseId    = m_auiBaseIdList[ uiBId ];
    1074 #if PDM_REMOVE_DEPENDENCE
    1075     if( uiBaseId != 0)
    1076       continue;
    1077 #endif
    1078     TComPic*    pcBasePic   = m_pcAUPicAccess->getPic( uiBaseId );
    1079     TComPicYuv* pcBasePdm   = pcBasePic->getPredDepthMap();
    1080     TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
    1081     Int         iDisparity  = xGetDisparityFromVirtDepth( uiBaseId, iPrdDepth );
    1082     Int         iShiftX     = m_uiSubSampExpX + 2;
    1083     Int         iAddX       = ( 1 << iShiftX ) >> 1;
    1084     Int         iBasePosX   = Clip3( 0, pcBasePdm->getWidth () - 1, iCurrPosX + ( ( iDisparity + iAddX ) >> iShiftX ) );
    1085     Int         iBasePosY   = Clip3( 0, pcBasePdm->getHeight() - 1, iCurrPosY                               );
    1086     Int         iBaseCUAddr;
    1087     Int         iBaseAbsPartIdx;
    1088     pcBaseRec->getCUAddrAndPartIdx( iBasePosX << m_uiSubSampExpX, iBasePosY << m_uiSubSampExpY, iBaseCUAddr, iBaseAbsPartIdx );
    1089     TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
    1090     if( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_INTER && pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) != MODE_SKIP )
    1091     {
    1092       continue;
    1093     }
    1094 
    1095     for( UInt uiBaseRefListId = 0; uiBaseRefListId < 2; uiBaseRefListId++ )
    1096     {
    1097       RefPicList  eBaseRefPicList = RefPicList( uiBaseRefListId );
    1098       TComMvField cBaseMvField;
    1099       pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
    1100       Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
    1101       Int         iBaseRefPoc     = ( iBaseRefIdx >= 0 ? pcBaseCU->getSlice()->getRefPic( eBaseRefPicList, iBaseRefIdx )->getPOC() : -(1<<30) );
    1102       if( iBaseRefIdx >= 0 && iBaseRefPoc == iRefPoc )
    1103       {
    1104         rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() );
    1105         return true;
    1106       }
    1107     }
    1108   }
    1109   return false;
    1110 }
    1111 #endif // H3D_NBDV
    1112 #endif // QC_AMVP_MRG_UNIFY_IVCAN_C0051
    1113783
    1114784
  • trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h

    r296 r332  
    152152#if H3D_IVMP
    153153#if H3D_NBDV
    154 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051
    155154  Bool  getPdmCandidate       ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
    156 #else
    157   Int   getPdmMergeCandidate  ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm );
    158   Bool  getPdmMvPredDisCan    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
    159   Bool  getDisCanPdmMvPred    ( TComDataCU*   pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge );
    160 #endif
    161155#else
    162156  Int   getPdmMergeCandidate  ( TComDataCU*   pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r296 r332  
    6666  Int    iN;                                ///< number of motion vector predictor candidates
    6767} DisInfo;
     68
     69typedef struct _McpDisCand
     70{
     71  TComMv m_acMvCand[2][ MCP_DIS_CANS ];            ///< array of motion vector predictor candidates
     72  Int    m_aVIdxCan[2][ MCP_DIS_CANS ];            ///< array of motion vector predictor candidates
     73  Bool   m_bAvailab[2][ MCP_DIS_CANS ];
     74  Bool   m_bFound;                                 ///< number of motion vector predictor candidates
     75} McpDisInfo;
     76
    6877#endif
    6978// Class definition
  • trunk/source/Lib/TLibCommon/TComMv.h

    r296 r332  
    6060  Bool  m_bDvMcp;       // is dv-mcp ?
    6161  Int   m_iDvMcpDispX;  // disparity for dv-mcp
    62 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    6362  Int   m_iDvMcpDispY;  // disparity for dv-mcp
    64 #endif
    6563#endif
    6664
     
    7573  , m_bDvMcp(false)
    7674  , m_iDvMcpDispX(0)
    77 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    7875  , m_iDvMcpDispY(0)
    79 #endif
    8076#endif
    8177  {
     
    8884  , m_bDvMcp(false)
    8985  , m_iDvMcpDispX(0)
    90 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    9186  , m_iDvMcpDispY(0)
    92 #endif
    9387#endif
    9488  {
  • trunk/source/Lib/TLibCommon/TComPic.cpp

    r313 r332  
    8585  m_aaiCodedScale     = 0;
    8686  m_aaiCodedOffset    = 0;
    87 #if OL_QTLIMIT_PREDCODING_B0068
     87#if H3D_QTL
    8888  m_bReduceBitsQTL    = 0;
    8989#endif
  • trunk/source/Lib/TLibCommon/TComPic.h

    r313 r332  
    121121  Int**                 m_aaiCodedOffset;
    122122
    123 #if OL_QTLIMIT_PREDCODING_B0068
     123#if H3D_QTL
    124124  Bool                  m_bReduceBitsQTL;
    125125#endif
     
    203203#endif
    204204
    205 #if OL_QTLIMIT_PREDCODING_B0068
     205#if H3D_QTL
    206206  Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
    207207  Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
  • trunk/source/Lib/TLibCommon/TComPicYuv.cpp

    r313 r332  
    468468Void TComPicYuv::setLumaTo( Pel pVal )
    469469{
    470   xSetPels( getLumaAddr(), getStride(), getWidth(), getHeight() >> 1, pVal );
     470  xSetPels( getLumaAddr(), getStride(), getWidth(), getHeight(), pVal );
    471471}
    472472
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r313 r332  
    636636#endif
    637637      {
    638 #if DEPTH_MAP_GENERATION
    639638#if MERL_VSP_C0152
    640639        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
     
    642641        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
    643642#endif
    644 #else
    645 #if MERL_VSP_C0152
    646         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
    647 #else
    648         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
    649 #endif
    650 #endif
    651643      }
    652644      else
    653645      {
    654 #if DEPTH_MAP_GENERATION
    655646#if MERL_VSP_C0152
    656647        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
     
    658649        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    659650#endif
    660 #else
    661 #if MERL_VSP_C0152
    662         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    663 #else
    664         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    665 #endif
    666 #endif
    667651      }
    668652#if LGE_ILLUCOMP_B0045
     
    677661    else
    678662    {
    679 #if DEPTH_MAP_GENERATION
    680663      if( xCheckIdenticalMotion( pcCU, uiPartAddr ) && !bPrdDepthMap )
    681 #else
    682       if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    683 #endif
    684       {
    685 #if DEPTH_MAP_GENERATION
     664      {
    686665#if MERL_VSP_C0152
    687666        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
     
    689668        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    690669#endif
    691 #else
    692 #if MERL_VSP_C0152
    693         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
    694 #else
    695         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
    696 #endif
    697 #endif
    698670      }
    699671      else
    700672      {
    701 #if DEPTH_MAP_GENERATION
    702673#if MERL_VSP_C0152
    703674        xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
     
    705676        xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
    706677#endif
    707 #else
    708 #if MERL_VSP_C0152
    709         xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
    710 #else
    711         xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
    712 #endif
    713 #endif
    714678      }
    715679    }
     
    721685    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    722686
    723 #if DEPTH_MAP_GENERATION
    724687    if( bPrdDepthMap )
    725688    {
     
    727690      iHeight >>= uiSubSampExpY;
    728691    }
    729 #endif
    730692
    731693    if ( eRefPicList != REF_PIC_LIST_X )
     
    737699#endif
    738700      {
    739 #if DEPTH_MAP_GENERATION
    740701#if MERL_VSP_C0152
    741702        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
     
    743704        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
    744705#endif
    745 #else
    746 #if MERL_VSP_C0152
    747         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
    748 #else
    749         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true );
    750 #endif
    751 #endif
    752706  }
    753707  else
    754708  {
    755 #if DEPTH_MAP_GENERATION
    756709#if MERL_VSP_C0152
    757710        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
     
    759712        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    760713#endif
    761 #else
    762 #if MERL_VSP_C0152
    763         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    764 #else
    765         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    766 #endif
    767 #endif
    768       }
    769 #if DEPTH_MAP_GENERATION
     714      }
    770715#if MERL_VSP_C0152
    771716      xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
     
    773718      xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    774719#endif
    775 #else
    776 #if MERL_VSP_C0152
    777       xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    778 #else
    779       xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false );
    780 #endif
    781 #endif
     720
    782721#if LGE_ILLUCOMP_B0045
    783722      if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr))
     
    793732      if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )
    794733      {
    795 #if DEPTH_MAP_GENERATION
    796734#if MERL_VSP_C0152
    797735        xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
     
    799737        xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    800738#endif
    801 #else
    802 #if MERL_VSP_C0152
    803         xPredInterUni (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
    804 #else
    805         xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false );
    806 #endif
    807 #endif   
    808739      }
    809740      else
    810741      {
    811 #if DEPTH_MAP_GENERATION
    812742#if MERL_VSP_C0152
    813743        xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
     
    815745        xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap );
    816746#endif   
    817 #else
    818 #if MERL_VSP_C0152
    819         xPredInterBi  (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
    820 #else
    821         xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx );
    822 #endif
    823 #endif
    824747      }
    825748    }
     
    828751}
    829752
    830 #if MTK_MDIVRP_C0138
     753#if H3D_IVRP
    831754Void TComPrediction::residualPrediction(TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred)
    832755{
     
    847770#endif
    848771
    849 #if DEPTH_MAP_GENERATION
    850772#if MERL_VSP_C0152
    851773Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi )
    852774#else
    853775Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi )
    854 #endif
    855 #else
    856 #if MERL_VSP_C0152
    857 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi )
    858 #else
    859 Void TComPrediction::xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi )
    860 #endif
    861776#endif
    862777{
     
    887802  {
    888803    UInt uiRShift = 0;
    889 #if PDM_REMOVE_DEPENDENCE
    890804    if( pcCU->getPic()->getStoredPDMforV2() == 1 )
    891805      xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMapTemp(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 );
    892806    else
    893 #endif
    894807      xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 );
    895808
     
    1001914
    1002915
    1003 #if DEPTH_MAP_GENERATION
    1004916#if MERL_VSP_C0152
    1005917Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
     
    1007919Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap )
    1008920#endif
    1009 #else
    1010 #if MERL_VSP_C0152
    1011 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx )
    1012 #else
    1013 Void TComPrediction::xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx )
    1014 #endif
    1015 #endif
    1016921{
    1017922  TComYuv* pcMbYuv;
     
    1050955    if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 )
    1051956    {
    1052 #if DEPTH_MAP_GENERATION
    1053957#if MERL_VSP_C0152
    1054958      xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
    1055959#else
    1056960      xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
    1057 #endif
    1058 #else
    1059 #if MERL_VSP_C0152
    1060       xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
    1061 #else
    1062       xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
    1063 #endif
    1064961#endif
    1065962    }
     
    1073970#endif
    1074971      {
    1075 #if DEPTH_MAP_GENERATION
    1076972#if MERL_VSP_C0152
    1077973        xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
     
    1079975        xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true );
    1080976#endif
    1081 #else
    1082 #if MERL_VSP_C0152
    1083         xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
    1084 #else
    1085         xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true );
    1086 #endif
    1087 #endif
    1088977      }
    1089978      else
    1090979      {
    1091 #if DEPTH_MAP_GENERATION
    1092980#if MERL_VSP_C0152
    1093981        xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    1094982#else
    1095983        xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false );
    1096 #endif
    1097 #else
    1098 #if MERL_VSP_C0152
    1099         xPredInterUni ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, false );
    1100 #else
    1101         xPredInterUni ( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, false );
    1102 #endif
    1103984#endif
    1104985      }
     
    11321013  else
    11331014  {
    1134 #if DEPTH_MAP_GENERATION
    11351015    if ( bPrdDepthMap )
    11361016    {
     
    11461026      xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
    11471027    }
    1148 #else
    1149     xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred );
    1150 #endif
    11511028  }
    11521029}
     
    11551032
    11561033Void
    1157 #if DEPTH_MAP_GENERATION
    11581034TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset
    11591035#if LGE_ILLUCOMP_DEPTH_C0046
     
    11611037#endif
    11621038)
    1163 #else
    1164 TComPrediction::xPredInterPrdDepthMap( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset )
    1165 #endif
    1166 {
    1167 #if DEPTH_MAP_GENERATION
     1039{
    11681040  Int     iShiftX     = 2 + uiSubSampExpX;
    11691041  Int     iShiftY     = 2 + uiSubSampExpY;
     
    11821054  Int     iDstStride  = rpcYuv->getStride();
    11831055  Int     iRefOffset  = iHor + iVer * iRefStride;
    1184 #else
    1185   Int     iFPelMask   = ~3;
    1186   Int     iRefStride  = pcPicYuvRef->getStride();
    1187   Int     iDstStride  = rpcYuv->getStride();
    1188   Int     iHor        = ( pcMv->getHor() + 2 ) & iFPelMask;
    1189   Int     iVer        = ( pcMv->getVer() + 2 ) & iFPelMask;
    1190 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
    1191   if( pcCU->getSlice()->getSPS()->isDepth() )
    1192   {
    1193     iHor = pcMv->getHor() * 4;
    1194     iVer = pcMv->getVer() * 4;
    1195 }
    1196 #endif
    1197 #if !QC_MVHEVC_B0046
    1198   Int     ixFrac      = iHor & 0x3;
    1199   Int     iyFrac      = iVer & 0x3;
    1200 #endif
    1201   Int     iRefOffset  = ( iHor >> 2 ) + ( iVer >> 2 ) * iRefStride;
    1202 #endif
    12031056
    12041057  Pel*    piRefY      = pcPicYuvRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr ) + iRefOffset;
     
    14541307  Int dstStride = dstPic->getStride();
    14551308  Int depStride =  pPicBaseDepth->getStride();
    1456 #if MTK_DVPREFINE_BVSP_BUG_FIX
    14571309  Int depthPosX = Clip3(0,   widthLuma - size_x,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
    14581310  Int depthPosY = Clip3(0,   heightLuma- size_y,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
    1459 #else
    1460   Int depthPosX = Clip3(0,   widthLuma - size_x - 1,  (posX/nTxtPerDepthX) + (mv->getHor()>>2));
    1461   Int depthPosY = Clip3(0,   heightLuma- size_y - 1,  (posY/nTxtPerDepthY) + (mv->getVer()>>2));
    1462 #endif
    14631311  Pel *ref    = refPic->getLumaAddr() + posX + posY * refStride;
    14641312  Pel *dst    = dstPic->getLumaAddr(partAddr);
     
    16181466    depthPosX = posX * nDepthPerTxtX + (mv->getHor()>>2);        //mv denotes the disparity for VSP
    16191467  }
    1620 #if MTK_DVPREFINE_BVSP_BUG_FIX
    16211468  depthPosX = Clip3(0, widthDepth - (size_x<<1), depthPosX);
    1622 #else
    1623   depthPosX = Clip3(0, widthDepth - (size_x<<1) - 1, depthPosX);
    1624 #endif
    16251469  if ( heightChroma > heightDepth )
    16261470  {
     
    16351479    depthPosY = posY * nDepthPerTxtY + (mv->getVer()>>2);     //mv denotes the disparity for VSP
    16361480  }
    1637 #if MTK_DVPREFINE_BVSP_BUG_FIX
    16381481  depthPosY = Clip3(0, heightDepth - (size_y<<1), depthPosY);
    1639 #else
    1640   depthPosY = Clip3(0, heightDepth - (size_y<<1) - 1, depthPosY);
    1641 #endif
    16421482
    16431483  Pel *refCb  = refPic->getCbAddr() + posX + posY * refStride;
     
    23842224  iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
    23852225  iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
    2386 #if FIX_LGE_ILLUCOMP_B0045
    23872226  iRefX   = iCUPelX + (pMv->getHor() >> 2);
    23882227  iRefY   = iCUPelY + (pMv->getVer() >> 2);
    2389 #else
    2390   iRefX   = iCUPelX + (pMv->getHor() >> 3);
    2391   iRefY   = iCUPelY + (pMv->getVer() >> 3);
    2392 #endif
    23932228  uiWidth = pcCU->getWidth(0) >> 1;
    23942229  uiHeight = pcCU->getHeight(0) >> 1;
     
    30372872  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
    30382873
    3039 #if HHI_DMM_DELTADC_Q1_C0034
    3040 #else
    3041   if( bDelta )
    3042   {
    3043     xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
    3044     xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
    3045   }
    3046 #endif
    3047 
    30482874  // assign wedge pred DCs to prediction
    30492875  if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
     
    30642890  piMask += iMaskStride+1;
    30652891  getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
    3066 
    3067 #if HHI_DMM_DELTADC_Q1_C0034
    3068 #else
    3069   if( bDelta )
    3070   {
    3071     xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
    3072     xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
    3073   }
    3074 #endif
    30752892
    30762893  // assign wedge pred DCs to prediction
     
    32493066  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
    32503067
    3251 #if HHI_DMM_DELTADC_Q1_C0034
    3252 #else
    3253   if( bDelta )
    3254   {
    3255     xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
    3256     xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
    3257   }
    3258 #endif
    3259 
    32603068  // assign wedge pred DCs to prediction
    32613069  if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
     
    32923100  piMask += iMaskStride+1;
    32933101  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
    3294 
    3295 #if HHI_DMM_DELTADC_Q1_C0034
    3296 #else
    3297   if( bDelta )
    3298   {
    3299     xDeltaDCQuantScaleUp( pcCU, iDeltaDC1 );
    3300     xDeltaDCQuantScaleUp( pcCU, iDeltaDC2 );
    3301   }
    3302 #endif
    33033102
    33043103  // assign wedge pred DCs to prediction
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r296 r332  
    8686 
    8787  // motion compensation functions
    88 #if DEPTH_MAP_GENERATION
    8988#if MERL_VSP_C0152
    9089  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,        Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false );
     
    9291  Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false );
    9392#endif
    94 #else
    95 #if MERL_VSP_C0152
    96   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,        Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false          );
    97 #else
    98   Void xPredInterUni            ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false          );
    99 #endif
    100 #endif
    101 
    102 #if DEPTH_MAP_GENERATION
     93
    10394#if MERL_VSP_C0152
    10495  Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,       UInt uiAbsPartIdx,   Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap );
     
    111102#endif
    112103      );
    113 #else
    114 #if MERL_VSP_C0152
    115   Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,     UInt uiAbsPartIdx,     Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx          );
    116 #else
    117   Void xPredInterBi             ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight,                         TComYuv*& rpcYuvPred, Int iPartIdx          );
    118 #endif
    119   Void xPredInterPrdDepthMap    ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight,                         TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset );
    120 #endif
     104
    121105#if MERL_VSP_C0152
    122106  Void xPredInterUniBWVSP         ( TComDataCU* pcCU,                          UInt uiPartAddr, UInt uiAbsPartIdx,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi=false );
     
    179163 
    180164  // inter
    181 #if DEPTH_MAP_GENERATION
    182165#if MERL_VSP_C0152
    183166  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 );
     
    185168  Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 );
    186169#endif
    187 #else
    188 #if MERL_VSP_C0152
    189   Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx,, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
    190 #else
    191   Void motionCompensation         ( TComDataCU*  pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 );
    192 #endif
    193 #endif
    194 
    195 #if MTK_MDIVRP_C0138
     170
     171#if H3D_IVRP
    196172  Void residualPrediction         (TComDataCU* pcCU, TComYuv* pcYuvPred, TComYuv* pcYuvResPred);
    197173#endif
  • trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp

    r313 r332  
    184184  AOF  ( pcPic );
    185185
    186 #if MTK_MDIVRP_C0138
     186#if H3D_IVRP
    187187  if (pcPic->getSPS()->getViewId() != 0)
    188188  {
     
    227227
    228228#if H3D_NBDV
    229 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    230229Bool
    231230TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, TComMv iDisp, Bool bRecon  )
    232 #else
    233 Bool
    234 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp, Bool bRecon  )
    235 #endif
    236231#else
    237232Bool
     
    248243  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos );
    249244#if H3D_NBDV
    250 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    251   return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp, bRecon);   
    252 #else
    253245  return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp, bRecon);
    254 #endif
    255246#else
    256247  return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, bRecon);
     
    259250 
    260251#if H3D_NBDV
    261 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    262252Bool
    263253TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp, Bool bRecon) 
    264254#else
    265255Bool
    266 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp, Bool bRecon)
    267 #endif
    268 #else
    269 Bool
    270256TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Bool bRecon)
    271257#endif
    272258{
    273 #if MTK_C0138_FIXED
    274259  UInt  uiBaseViewId  = 0;
    275 #else
    276   UInt  uiBaseViewId  = m_pcDepthMapGenerator->getBaseViewId( 0 );
    277 #endif
    278260  if( !pcYuv )
    279261  {
     
    282264  UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos;
    283265#if H3D_NBDV
    284 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    285266  xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp, &uiXPosInRefView , &uiYPosInRefView , bRecon  );
    286 #else
    287   xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp, &uiXPosInRefView , &uiYPosInRefView , bRecon  );
    288 #endif
    289267#else
    290268  xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, &uiXPosInRefView , &uiYPosInRefView , bRecon    );
    291269#endif
    292 #if MTK_MDIVRP_C0138
    293270  return true;
    294 #else
    295   return xIsNonZeroByCBF( uiBaseViewId , uiXPosInRefView , uiYPosInRefView , uiBlkWidth , uiBlkHeight );
    296 #endif
    297271}
    298272
     
    411385  Pel*    pRes      = pcCUResidual->getLumaAddr();
    412386  UInt    uiLumaTrMode, uiChromaTrMode;
    413 #if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    414   Int     iPUPredResiShift[4];
    415 #endif
    416387  pcCU->convertTransIdx             ( 0, pcCU->getTransformIdx( 0 ), uiLumaTrMode, uiChromaTrMode );
    417388    m_pcTrQuant->setQPforQuant      ( pcCU->getQP( 0 ), !pcCU->getSlice()->getDepth(), pcCU->getSlice()->getSliceType(), TEXT_LUMA, pcCU->getSlice()->getSPS()->getQpBDOffsetY(), 0 );
     
    429400  m_pcTrQuant->invRecurTransformNxN ( pcCU, 0, TEXT_CHROMA_V, pRes, 0, pcCUResidual->getCStride(), uiWidth, uiHeight, uiChromaTrMode, 0, piCoeff );
    430401
    431 #if !MTK_MDIVRP_C0138
    432   if( pcCU->getResPredFlag( 0 ) )
    433   {
    434     AOF( pcCU->getResPredAvail( 0 ) );
    435     Bool bOK = pcCU->getResidualSamples( 0, true, m_ppcYuvTmp[0] );
    436     AOF( bOK );
    437 #if LG_RESTRICTEDRESPRED_M24766
    438     pcCU->getPUResiPredShift(iPUPredResiShift, 0);
    439     pcCUResidual->add(iPUPredResiShift, pcCU->getPartitionSize(0), m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
    440 #else
    441     pcCUResidual->add( m_ppcYuvTmp[0], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
    442 #endif
    443   }
    444 #endif
    445 
    446402  //===== clear inter-view predicted parts =====
    447403  for( UInt uiPartIdx = 0; uiPartIdx < pcCU->getNumPartInter(); uiPartIdx++ )
     
    500456
    501457#if H3D_NBDV
    502 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    503458Void 
    504459TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp
    505460                                             ,UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon )
    506 #else // MTK_RELEASE_DV_CONSTRAINT_C0129
    507 Void 
    508 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp
    509                                              ,UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon)
    510 #endif // MTK_RELEASE_DV_CONSTRAINT_C0129
    511461#else // H3D_NBDV
    512462Void 
     
    531481  //===== get disparity =====
    532482#if H3D_NBDV
    533 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    534483  Int iDisparity_y = iDisp.getVer();
    535484  Int iDisparity   = iDisp.getHor();
    536 #else
    537   Int iDisparity = iDisp;
    538 #endif
    539485#else //H3D_NBDV
    540486  Int           iMidPosX    = Int( uiXPos + ( ( uiBlkWidth  - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpX();
     
    549495  Int           iYRefPosX0  = Int( uiXPos )     + ( iDisparity >> 2 );
    550496  Int           iYRefPosX1  = iYRefPosX0        + 1;
    551 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    552497  Int           iYMaxPosY   = Int( uiPicHeight ) - 1;
    553498  Int           iYWeight3   = ( iDisparity_y & 3 );
     
    555500  Int           iYRefPosY0  = Max( 0, Min( iYMaxPosY, Int( uiYPos )     + ( iDisparity_y >> 2 )) );
    556501  Int           iYRefPosY1  = Max( 0, Min( iYMaxPosY, iYRefPosY0 + 1 ));
    557 #endif
    558502  Int           iYMaxPosX   = Int( uiPicWidth ) - 1;
    559503  Int           iSrcStrideY = pcBaseRes->getStride   ();
    560504  Int           iDesStrideY = pcYuv    ->getStride   ();
    561 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    562505  Pel*          pSrcSamplesY0= pcBaseRes->getLumaAddr ( 0 ) + iYRefPosY0 * iSrcStrideY;
    563506  Pel*          pSrcSamplesY1= pcBaseRes->getLumaAddr ( 0 ) + iYRefPosY1 * iSrcStrideY;
    564 #else
    565   Pel*          pSrcSamplesY= pcBaseRes->getLumaAddr ( 0 ) + uiYPos * iSrcStrideY;
    566 #endif
    567507  Pel*          pDesSamplesY= pcYuv    ->getLumaAddr ();
    568508
     
    575515    return;
    576516
    577 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    578517  for(   Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY0 += iSrcStrideY, pSrcSamplesY1 += iSrcStrideY, pDesSamplesY += iDesStrideY )
    579 #else
    580   for(   Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY += iSrcStrideY, pDesSamplesY += iDesStrideY )
    581 #endif
    582518  {
    583519    for( Int iX = 0; iX < iYWidth; iX++ )
     
    585521      Int iXPic0        = Max( 0, Min( iYMaxPosX, iYRefPosX0 + iX ) );
    586522      Int iXPic1        = Max( 0, Min( iYMaxPosX, iYRefPosX1 + iX ) );
    587 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    588523      Pel Temp1,Temp2;
    589524      Temp1 =( iYWeight0 * pSrcSamplesY0[iXPic0] + iYWeight1 * pSrcSamplesY0[iXPic1] + 2 ) >> 2;
    590525      Temp2 =( iYWeight0 * pSrcSamplesY1[iXPic0] + iYWeight1 * pSrcSamplesY1[iXPic1] + 2 ) >> 2;
    591526      pDesSamplesY[iX]  = ( iYWeight2 * Temp1 + iYWeight3 * Temp2 + 2 ) >> 2;
    592 #else
    593       pDesSamplesY[iX]  = ( iYWeight0 * pSrcSamplesY[iXPic0] + iYWeight1 * pSrcSamplesY[iXPic1] + 2 ) >> 2;
    594 #endif
    595527    }
    596528  }
     
    603535  Int           iCRefPosX0  = Int( uiXPos     >> 1 ) + ( iDisparity >> 3 );
    604536  Int           iCRefPosX1  = iCRefPosX0             + 1;
    605 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    606537  Int           iCMaxPosY   = Int( uiPicHeight >> 1 ) - 1;
    607538  Int           iCWeight3   = ( iDisparity_y & 7 );
     
    609540  Int           iCRefPosY0  = Max( 0, Min( iCMaxPosY, Int( uiYPos >> 1 )     + ( iDisparity_y >> 3 )) );
    610541  Int           iCRefPosY1  = Max( 0, Min( iCMaxPosY, iCRefPosY0 + 1 ));
    611 #endif
    612542  Int           iCMaxPosX   = Int( uiPicWidth >> 1 ) - 1;
    613543  Int           iSrcStrideC = pcBaseRes->getCStride();
    614544  Int           iDesStrideC = pcYuv    ->getCStride();
    615 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    616 #if FIX_CHROMA_RESIDUAL_C0129
     545
    617546  Pel*          pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY0 * iSrcStrideC;
    618547  Pel*          pSrcSamplesU1= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY1 * iSrcStrideC;
    619548  Pel*          pSrcSamplesV0= pcBaseRes->getCrAddr ( 0 ) + iCRefPosY0 * iSrcStrideC;
    620549  Pel*          pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + iCRefPosY1 * iSrcStrideC;
    621 #else
    622   Pel*          pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + ( iCRefPosY0 >> 1 ) * iSrcStrideC;
    623   Pel*          pSrcSamplesU1= pcBaseRes->getCbAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC;
    624   Pel*          pSrcSamplesV0= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY0 >> 1 ) * iSrcStrideC;
    625   Pel*          pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC;
    626 #endif
    627 #else
    628   Pel*          pSrcSamplesU= pcBaseRes->getCbAddr ( 0 ) + ( uiYPos >> 1 ) * iSrcStrideC;
    629   Pel*          pSrcSamplesV= pcBaseRes->getCrAddr ( 0 ) + ( uiYPos >> 1 ) * iSrcStrideC;
    630 #endif
    631550  Pel*          pDesSamplesU= pcYuv    ->getCbAddr ();
    632551  Pel*          pDesSamplesV= pcYuv    ->getCrAddr ();
    633 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    634552  for(   Int iY = 0; iY < iCHeight; iY++, pSrcSamplesU0 += iSrcStrideC, pSrcSamplesU1 += iSrcStrideC, pDesSamplesU += iDesStrideC,
    635553                                          pSrcSamplesV0 += iSrcStrideC, pSrcSamplesV1 += iSrcStrideC, pDesSamplesV += iDesStrideC )
    636 #else
    637   for(   Int iY = 0; iY < iCHeight; iY++, pSrcSamplesU += iSrcStrideC, pDesSamplesU += iDesStrideC,
    638                                           pSrcSamplesV += iSrcStrideC, pDesSamplesV += iDesStrideC )
    639 #endif
    640554  {
    641555    for( Int iX = 0; iX < iCWidth; iX++ )
     
    643557      Int iXPic0        = Max( 0, Min( iCMaxPosX, iCRefPosX0 + iX ) );
    644558      Int iXPic1        = Max( 0, Min( iCMaxPosX, iCRefPosX1 + iX ) );
    645 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    646559      Pel Temp1,Temp2;
    647560      Temp1 =( iCWeight0 * pSrcSamplesU0[iXPic0] + iCWeight1 * pSrcSamplesU0[iXPic1] + 4 ) >> 3;
     
    651564      Temp2 =( iCWeight0 * pSrcSamplesV1[iXPic0] + iCWeight1 * pSrcSamplesV1[iXPic1] + 4 ) >> 3;
    652565      pDesSamplesV[iX]  = ( iCWeight2 * Temp1 + iCWeight3 * Temp2 + 4 ) >> 3;
    653 #else
    654       pDesSamplesU[iX]  = ( iCWeight0 * pSrcSamplesU[iXPic0] + iCWeight1 * pSrcSamplesU[iXPic1] + 4 ) >> 3;
    655       pDesSamplesV[iX]  = ( iCWeight0 * pSrcSamplesV[iXPic0] + iCWeight1 * pSrcSamplesV[iXPic1] + 4 ) >> 3;
    656 #endif
    657566    }
    658567  }
  • trunk/source/Lib/TLibCommon/TComResidualGenerator.h

    r296 r332  
    7070
    7171#if H3D_NBDV
    72 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    7372  Bool  getResidualSamples    ( TComDataCU*   pcCU,  UInt uiPUIdx, TComYuv* pcYuv, TComMv iDisp_x, Bool bRecon );
    7473  Bool  getResidualSamples    ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv , TComMv iDisp_x, Bool bRecon );
    75 #else
    76   Bool  getResidualSamples    ( TComDataCU*   pcCU,  UInt uiPUIdx, TComYuv* pcYuv, Int iDisp, Bool bRecon );
    77   Bool  getResidualSamples    ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv , Int iDisp, Bool bRecon );
    78 #endif
    7974#else // H3D_NBDV
    8075  Bool  getResidualSamples    ( TComDataCU*   pcCU,  UInt uiPUIdx, TComYuv* pcYuv, Bool bRecon );
     
    9085  Void  xClearResidual        (                      TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight );
    9186#if H3D_NBDV
    92 #if MTK_RELEASE_DV_CONSTRAINT_C0129
    9387  Void  xSetPredResidualBlock ( TComPic*      pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp, UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon  );   
    94 #else
    95   Void  xSetPredResidualBlock ( TComPic*      pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp, UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon  );
    96 #endif
    9788#else
    9889  Void  xSetPredResidualBlock ( TComPic*      pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon  );
  • trunk/source/Lib/TLibCommon/TComRom.cpp

    r296 r332  
    306306
    307307#if RWTH_SDC_DLT_B0036
    308 #if SAIT_SDC_C0096
    309308UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES] = { DC_IDX, DMM_WEDGE_FULL_IDX, PLANAR_IDX };
    310 #else
    311 UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES] = { DC_IDX, DMM_WEDGE_FULL_IDX, DMM_WEDGE_PREDDIR_IDX, PLANAR_IDX };
    312 #endif
    313309#endif
    314310
  • trunk/source/Lib/TLibCommon/TComRom.h

    r296 r332  
    194194
    195195#if RWTH_SDC_DLT_B0036
    196 #if SAIT_SDC_C0096
    197196#define RWTH_SDC_NUM_PRED_MODES 3
    198 #else
    199 #define RWTH_SDC_NUM_PRED_MODES 4
    200 #endif
    201197extern      UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES];
    202198#endif
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r313 r332  
    15461546, m_bUseDMM34                   (false)
    15471547#endif
    1548 #if OL_QTLIMIT_PREDCODING_B0068
     1548#if H3D_QTL
    15491549, m_bUseQTLPC                 (false)
    15501550#endif
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r313 r332  
    375375#endif
    376376
    377 #if OL_QTLIMIT_PREDCODING_B0068
     377#if H3D_QTL
    378378  Bool m_bUseQTLPC;
    379379#endif
     
    617617#endif
    618618
    619 #if OL_QTLIMIT_PREDCODING_B0068
     619#if H3D_QTL
    620620  Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
    621621  Bool getUseQTLPC()         { return m_bUseQTLPC; }
  • trunk/source/Lib/TLibCommon/TComYuv.cpp

    r296 r332  
    392392}
    393393
    394 #if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    395 Void
    396 TComYuv::add(Int *iPUResiPredShift, PartSize uhPartitionSize,  TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
    397 {
    398   addLuma   (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth,    iHeight,    bSubtract );
    399   addChroma (iPUResiPredShift, uhPartitionSize, pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract );
    400 }
    401 #else
    402394Void
    403395TComYuv::add( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
     
    406398  addChroma ( pcYuvAdd, iWidth>>1, iHeight>>1, bSubtract );
    407399}
    408 #endif
    409 
    410 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    411 Void
    412 TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset)
    413 {
    414   switch(uhPartitionSize)
    415   {   
    416   case SIZE_2NxN:
    417     iXOffset = iWidth;      iYOffset = iHeight >> 1;   break;
    418   case SIZE_2NxnU:
    419     iXOffset = iWidth;      iYOffset = iHeight >> 2;   break;
    420   case SIZE_2NxnD:
    421     iXOffset = iWidth;      iYOffset = (iHeight >> 1) + (iHeight >> 2);   break;
    422   case SIZE_Nx2N:
    423     iXOffset = iWidth >> 1; iYOffset = iHeight; break;
    424   case SIZE_nLx2N:
    425     iXOffset = iWidth >> 2; iYOffset = iHeight; break;
    426   case SIZE_nRx2N:
    427     iXOffset = (iWidth >> 1) + (iWidth >> 2); iYOffset = iHeight; break;
    428   case SIZE_NxN:
    429     iXOffset = iWidth >> 1; iYOffset = iHeight >> 1;  break;
    430   default:
    431     assert(uhPartitionSize == SIZE_2Nx2N);
    432     iXOffset = iWidth;     iYOffset = iHeight;    break;
    433   }
    434 }
    435 #endif
    436 
    437 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    438 Void
    439 TComYuv::addLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
    440 #else
     400
     401
    441402Void
    442403TComYuv::addLuma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
    443 #endif
    444404{
    445405  Int   iScale      = ( bSubtract ? -1 : 1 );
     
    449409  Pel*  pDstSamples = getLumaAddr();
    450410
    451 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    452   Int iXOffset, iYOffset;
    453 
    454   getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset);
    455 
    456   for( Int iY = 0; iY < iYOffset; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
    457   {
    458     if(iPUResiPredShift[0] >= 0)
    459     {
    460       for( Int iX = 0; iX < iXOffset; iX++ )
    461       {
    462         pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[0]);
    463       }
    464     }
    465 
    466     if(iPUResiPredShift[1] >= 0)
    467     {
    468       for( Int iX = iXOffset; iX < iWidth; iX++ )
    469       {
    470         pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[1]);
    471       }
    472     }
    473   }
    474 
    475   for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
    476   {
    477     if(iPUResiPredShift[2] >= 0)
    478     {
    479       for( Int iX = 0; iX < iXOffset; iX++ )
    480       {
    481         pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[2]);
    482       }
    483     }
    484 
    485     if(iPUResiPredShift[3] >= 0)
    486     {
    487       for( Int iX = iXOffset; iX < iWidth; iX++ )
    488       {
    489         pDstSamples[iX] += iScale * (pAddSamples[iX] >> iPUResiPredShift[3]);
    490       }
    491     }
    492   }
    493 #else
    494411  for( Int iY = 0; iY < iHeight; iY++, pDstSamples += iDstStride, pAddSamples += iAddStride )
    495412  {
     
    499416    }
    500417  }
    501 #endif
    502 }
    503 
    504 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    505 Void
    506 TComYuv::addChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
    507 #else
     418}
     419
    508420Void
    509421TComYuv::addChroma( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract )
    510 #endif
    511422{
    512423  Int   iScale        = ( bSubtract ? -1 : 1 );
     
    518429  Pel*  pDstSamplesCr = getCrAddr();
    519430
    520 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    521   Int iXOffset, iYOffset;
    522  
    523   getPUXYOffset(uhPartitionSize, iWidth, iHeight, iXOffset, iYOffset);
    524 
    525   for( Int iY = 0; iY < iYOffset; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
    526     pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
    527   {
    528     if(iPUResiPredShift[0] >= 0)
    529     {
    530       for( Int iX = 0; iX < iXOffset; iX++ )
    531       {
    532         pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[0]);
    533         pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[0]);
    534       }
    535     }
    536 
    537     if(iPUResiPredShift[1] >= 0)
    538     {
    539       for( Int iX = iXOffset; iX < iWidth; iX++ )
    540       {
    541         pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[1]);
    542         pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[1]);
    543       }
    544     }
    545   }
    546 
    547   for( Int iY = iYOffset; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
    548     pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
    549   {
    550     if(iPUResiPredShift[2] >= 0)
    551     {
    552       for( Int iX = 0; iX < iXOffset; iX++ )
    553       {
    554         pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[2]);
    555         pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[2]);
    556       }
    557     }
    558 
    559     if(iPUResiPredShift[3] >= 0)
    560     {
    561       for( Int iX = iXOffset; iX < iWidth; iX++ )
    562       {
    563         pDstSamplesCb[iX] += iScale * (pAddSamplesCb[iX] >> iPUResiPredShift[3]);
    564         pDstSamplesCr[iX] += iScale * (pAddSamplesCr[iX] >> iPUResiPredShift[3]);
    565       }
    566     }
    567   }
    568 #else
    569431  for( Int iY = 0; iY < iHeight; iY++, pDstSamplesCb += iDstStride, pAddSamplesCb += iAddStride,
    570432                                       pDstSamplesCr += iDstStride, pAddSamplesCr += iAddStride  )
     
    576438    }
    577439  }
    578 #endif
    579440}
    580441
     
    676537}
    677538
    678 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    679 Void TComYuv::subtract(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    680 {
    681   subtractLuma  (iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize    );
    682   subtractChroma(iPUResiPredShift, uhPartitionSize, pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize>>1 );
    683 }
    684 #else
    685539Void TComYuv::subtract( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    686540{
     
    688542  subtractChroma( pcYuvSrc0, pcYuvSrc1,  uiTrUnitIdx, uiPartSize>>1 );
    689543}
    690 #endif
    691 
    692 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    693 Void TComYuv::subtractLuma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    694 #else
     544
    695545Void TComYuv::subtractLuma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    696 #endif
    697546{
    698547  Int x, y;
     
    706555  Int  iDstStride  = getStride();
    707556
    708 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    709   Int iXOffset, iYOffset;
    710 
    711   getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset);
    712 
    713 #if FIX_LG_RESTRICTEDRESPRED_M24766
    714   for ( y = 0; y < iYOffset; y++ )
    715   {
    716     if(iPUResiPredShift[0] >= 0)
    717     {
    718       for ( x = 0; x < iXOffset; x++ )
    719       {
    720         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[0]);
    721       }
    722     }
    723 
    724     if(iPUResiPredShift[1] >= 0)
    725     {
    726       for ( x = iXOffset; x < uiPartSize; x++ )
    727       {
    728         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[1]);
    729       }
     557  for ( y = uiPartSize-1; y >= 0; y-- )
     558  {
     559    for ( x = uiPartSize-1; x >= 0; x-- )
     560    {
     561      pDst[x] = pSrc0[x] - pSrc1[x];
    730562    }
    731563    pSrc0 += iSrc0Stride;
     
    733565    pDst  += iDstStride;
    734566  }
    735 
    736   for ( y = iYOffset; y < uiPartSize; y++ )
    737   {
    738     if(iPUResiPredShift[2] >= 0)
    739     {
    740       for ( x = 0; x < iXOffset; x++ )
    741       {
    742         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
    743       }
    744     }
    745 
    746     if(iPUResiPredShift[3] >= 0)
    747     {
    748       for ( x = iXOffset; x < uiPartSize; x++ )
    749       {
    750         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
    751       }
    752     }
    753     pSrc0 += iSrc0Stride;
    754     pSrc1 += iSrc1Stride;
    755     pDst  += iDstStride;
    756   }
    757 #else
    758   for ( y = uiPartSize-1; y >= iYOffset; y-- )
    759   {
    760     if(iPUResiPredShift[3] >= 0)
    761     {
    762       for ( x = uiPartSize-1; x >= iXOffset; x-- )
    763       {
    764         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
    765       }
    766     }
    767 
    768     if(iPUResiPredShift[2] >= 0)
    769     {
    770       for ( x = iXOffset-1; x >= 0; x-- )
    771       {
    772         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
    773       }
    774     }
    775     pSrc0 += iSrc0Stride;
    776     pSrc1 += iSrc1Stride;
    777     pDst  += iDstStride;
    778   }
    779 
    780   for ( y = iYOffset-1; y >= 0; y-- )
    781   {
    782     if(iPUResiPredShift[1] >= 0)
    783     {
    784       for ( x = uiPartSize-1; x >= iXOffset; x-- )
    785       {
    786         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[3]);
    787       }
    788     }
    789 
    790     if(iPUResiPredShift[0] >= 0)
    791     {
    792       for ( x = iXOffset-1; x >= 0; x-- )
    793       {
    794         pDst[x] = pSrc0[x] - (pSrc1[x] >> iPUResiPredShift[2]);
    795       }
    796     }
    797     pSrc0 += iSrc0Stride;
    798     pSrc1 += iSrc1Stride;
    799     pDst  += iDstStride;
    800   }
    801 #endif
    802 #else
    803   for ( y = uiPartSize-1; y >= 0; y-- )
    804   {
    805     for ( x = uiPartSize-1; x >= 0; x-- )
    806     {
    807       pDst[x] = pSrc0[x] - pSrc1[x];
    808     }
    809     pSrc0 += iSrc0Stride;
    810     pSrc1 += iSrc1Stride;
    811     pDst  += iDstStride;
    812   }
    813 #endif
    814 }
    815 
    816 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    817 Void TComYuv::subtractChroma(Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    818 #else
     567}
     568
    819569Void TComYuv::subtractChroma( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize )
    820 #endif
    821570{
    822571  Int x, y;
     
    832581  Int  iSrc1Stride = pcYuvSrc1->getCStride();
    833582  Int  iDstStride  = getCStride();
    834 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    835   Int iXOffset, iYOffset;
    836  
    837   getPUXYOffset(uhPartitionSize, uiPartSize, uiPartSize, iXOffset, iYOffset);
    838 
    839 #if FIX_LG_RESTRICTEDRESPRED_M24766
    840   for ( y = 0; y < iYOffset; y++ )
    841   {
    842     if(iPUResiPredShift[0] >= 0)
    843     {
    844       for ( x = 0; x < iXOffset; x++ )
    845       {
    846         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]);
    847         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]);
    848       }
    849     }
    850 
    851     if(iPUResiPredShift[1] >= 0)
    852     {
    853       for ( x = iXOffset; x < uiPartSize; x++ )
    854       {
    855         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]);
    856         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]);
    857       }
     583  for ( y = uiPartSize-1; y >= 0; y-- )
     584  {
     585    for ( x = uiPartSize-1; x >= 0; x-- )
     586    {
     587      pDstU[x] = pSrcU0[x] - pSrcU1[x];
     588      pDstV[x] = pSrcV0[x] - pSrcV1[x];
    858589    }
    859590    pSrcU0 += iSrc0Stride;
     
    864595    pDstV  += iDstStride;
    865596  }
    866 
    867   for ( y = iYOffset; y < uiPartSize; y++ )
    868   {
    869     if(iPUResiPredShift[2] >= 0)
    870     {
    871       for ( x = 0; x < iXOffset; x++ )
    872       {
    873         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]);
    874         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]);
    875       }
    876     }
    877 
    878     if(iPUResiPredShift[3] >= 0)
    879     {
    880       for ( x = iXOffset; x < uiPartSize; x++ )
    881       {
    882         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]);
    883         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]);
    884       }
    885     }
    886     pSrcU0 += iSrc0Stride;
    887     pSrcU1 += iSrc1Stride;
    888     pSrcV0 += iSrc0Stride;
    889     pSrcV1 += iSrc1Stride;
    890     pDstU  += iDstStride;
    891     pDstV  += iDstStride;
    892   }
    893 #else
    894   for ( y = uiPartSize-1; y >= iYOffset; y-- )
    895   {
    896     if(iPUResiPredShift[3] >= 0)
    897     {
    898       for ( x = uiPartSize-1; x >= iXOffset; x-- )
    899       {
    900         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[3]);
    901         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[3]);
    902       }
    903     }
    904 
    905     if(iPUResiPredShift[2] >= 0)
    906     {
    907       for ( x = iXOffset-1; x >= 0; x-- )
    908       {
    909         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[2]);
    910         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[2]);
    911       }
    912     }
    913     pSrcU0 += iSrc0Stride;
    914     pSrcU1 += iSrc1Stride;
    915     pSrcV0 += iSrc0Stride;
    916     pSrcV1 += iSrc1Stride;
    917     pDstU  += iDstStride;
    918     pDstV  += iDstStride;
    919   }
    920 
    921   for ( y = iYOffset-1; y >= 0; y-- )
    922   {
    923     if(iPUResiPredShift[1] >= 0)
    924     {
    925       for ( x = uiPartSize-1; x >= iXOffset; x-- )
    926       {
    927         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[1]);
    928         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[1]);
    929       }
    930     }
    931 
    932     if(iPUResiPredShift[0] >= 0)
    933     {
    934       for ( x = iXOffset-1; x >= 0; x-- )
    935       {
    936         pDstU[x] = pSrcU0[x] - (pSrcU1[x]>>iPUResiPredShift[0]);
    937         pDstV[x] = pSrcV0[x] - (pSrcV1[x]>>iPUResiPredShift[0]);
    938       }
    939     }
    940     pSrcU0 += iSrc0Stride;
    941     pSrcU1 += iSrc1Stride;
    942     pSrcV0 += iSrc0Stride;
    943     pSrcV1 += iSrc1Stride;
    944     pDstU  += iDstStride;
    945     pDstV  += iDstStride;
    946   }
    947 #endif
    948 #else
    949   for ( y = uiPartSize-1; y >= 0; y-- )
    950   {
    951     for ( x = uiPartSize-1; x >= 0; x-- )
    952     {
    953       pDstU[x] = pSrcU0[x] - pSrcU1[x];
    954       pDstV[x] = pSrcV0[x] - pSrcV1[x];
    955     }
    956     pSrcU0 += iSrc0Stride;
    957     pSrcU1 += iSrc1Stride;
    958     pSrcV0 += iSrc0Stride;
    959     pSrcV1 += iSrc1Stride;
    960     pDstU  += iDstStride;
    961     pDstV  += iDstStride;
    962   }
    963 #endif
    964597}
    965598
  • trunk/source/Lib/TLibCommon/TComYuv.h

    r296 r332  
    146146  Void    addClipPartLuma   ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize ); //GT
    147147
    148 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    149   //  pcYuvSrc0 - pcYuvSrc1 -> m_apiBuf
    150   Void    subtract          (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    151   Void    subtractLuma      (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    152   Void    subtractChroma    (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    153 #else
    154148  Void    subtract          ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    155149  Void    subtractLuma      ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    156150  Void    subtractChroma    ( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt uiTrUnitIdx, UInt uiPartSize );
    157 #endif
    158151 
    159152  //  (pcYuvSrc0 + pcYuvSrc1)/2 for YUV partition
     
    166159  //   Remove High frequency
    167160  Void    removeHighFreq    ( TComYuv* pcYuvSrc, UInt uiPartIdx, UInt uiWidht, UInt uiHeight );
    168 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    169   Void    getPUXYOffset     (PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset);
    170   Void    add               (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
    171   Void    addLuma           (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
    172   Void    addChroma         (Int *iPUResiPredShift, PartSize uhPartitionSize, TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
    173 #else
    174161  Void    add               ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract = false );
    175162  Void    addLuma           ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
    176163  Void    addChroma         ( TComYuv* pcYuvAdd, Int iWidth, Int iHeight, Bool bSubtract );
    177 #endif
    178164
    179165  Void    clip              ( Int iWidth, Int iHeight );
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r313 r332  
    5757#define HHI_DMM_PRED_TEX                  1   // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction )
    5858                                              // HHIQC_DMMFASTSEARCH_B0039, fast Wedgelet search for DMM modes 1 and 3
     59                                              // HHI_DMM_DELTADC_Q1_C0034   JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values
     60                                              // FIX_DMM_CTX_INIT_C0034 JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short)
    5961
    6062#define LGE_EDGE_INTRA_A0070              1   // JCT3V-A0070
    61 
    62 #define HHI_DMM_DELTADC_Q1_C0034          1   // JCT3V-C0034: no quantization and fast encoder search for DMM delta DC values
    63 #if ( HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA ) && HHI_DMM_PRED_TEX
    6463#define LGE_DMM3_SIMP_C0044               1
    65 #endif
    66 #define FIX_DMM_CTX_INIT_C0034            1   // JCT3V-C0034 fix for wrong init type of DMM contexts (UChar instead of Short)
    6764
    6865///// ***** SDC *********
    6966#define RWTH_SDC_DLT_B0036                1   // JCT3V-B0036: Simplified Depth Coding + Depth Lookup Table
    70 #if RWTH_SDC_DLT_B0036
    71 #define SAIT_SDC_C0096                    1   // JCT3V-C0096: Improved Simple Depth Coding(removal of DMM2 among four SDC modes(DC, Planar, DMM1 and DMM2))
    72 #endif
    73 #define FIX_SDC_ENC_C0143                 1   // JCT3V-C0143 fix for unnecessary encoder checks in case of SDC
     67                                              // SAIT_SDC_C0096 JCT3V-C0096: Improved Simple Depth Coding(removal of DMM2 among four SDC modes(DC, Planar, DMM1 and DMM2))
     68                                              // FIX_SDC_ENC_C0143, JCT3V-C0143 fix for unnecessary encoder checks in case of SDC
    7469
    7570///// ***** TMVP/AMVP *********
     
    8782                                              // OL_DISMV_POS_B0069            , different pos for disparity MV candidate, B0069
    8883                                              // MTK_INTERVIEW_MERGE_A0049     , second part
    89 #define QC_AMVP_MRG_UNIFY_IVCAN_C0051     1
    90 #define QC_C0051_FIXED_BY_MTK             1   // Bug fix for C0051 implementation
     84                                              // QC_C0051_FIXED_BY_MTK             1   // Bug fix for C0051 implementation
     85                                              // QC_AMVP_MRG_UNIFY_IVCAN_C0051     1
    9186
    9287
     
    9590                                              // HHI_INTER_VIEW_RESIDUAL_PRED
    9691                                              // QC_SIMPLIFIEDIVRP_M24938
    97 #if H3D_IVRP       
    98 #define LG_RESTRICTEDRESPRED_M24766       1   // Restricted inter-view residual prediction
    99 #define FIX_LG_RESTRICTEDRESPRED_M24766   1
    100 #else                                 
    101 #define LG_RESTRICTEDRESPRED_M24766       0
    102 #endif
    103 
    104 #define MTK_MDIVRP_C0138                  1   // Mode-dependent inter-view residual prediction
    105 #define MTK_C0138_FIXED                   1   // Fix for IBP coding structure in view direction (not CTC)
    106 
     92                                              // MTK_C0138_FIXED                   // Fix for IBP coding structure in view direction (not CTC)
     93                                              // MTK_MDIVRP_C0138
     94                                              // LG_RESTRICTEDRESPRED_M24766       1   // Restricted inter-view residual prediction
     95                                              // FIX_LG_RESTRICTEDRESPRED_M24766   1
    10796
    10897///// ***** DISPARITY VECTOR DERIVATION *********
     
    117106                                              // FIX_LGE_IVMP_PARALLEL_MERGE_B0136
    118107
    119 #define QC_NBDV_LDB_FIX_C0055             1   // JCT3V-C0055
    120 #define MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097     1   // JCT3V-C0141/C0097
    121 #define MTK_RELEASE_DV_CONSTRAINT_C0129   1   // JCT3V-C0129
    122 #define MTK_SIMPLIFY_DVTC_C0135           1   // JCT3V-C0135
    123 #define FIX_CHROMA_RESIDUAL_C0129         1
     108                                              // QC_NBDV_LDB_FIX_C0055
     109                                              // MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097
     110                                              // MTK_RELEASE_DV_CONSTRAINT_C0129   
     111                                              // MTK_SIMPLIFY_DVTC_C0135           
     112                                              // FIX_CHROMA_RESIDUAL_C0129       
    124113
    125114///// ***** MOTION PARAMETER INHERITANCE  *********
     
    145134///// ***** ILLUMINATION COMPENSATON *********
    146135#define LGE_ILLUCOMP_B0045                1   // JCT2-B0045 Illumination compensation for Luma and Chroma
     136                                              // LGE_ILLUCOMP_B0045_ENCSIMP
     137                                              // FIX_LGE_ILLUCOMP_B0045           
    147138#if LGE_ILLUCOMP_B0045
    148 #define LGE_ILLUCOMP_B0045_ENCSIMP        1
    149 #define FIX_LGE_ILLUCOMP_B0045            1
    150139#define LGE_ILLUCOMP_DEPTH_C0046          1   // JCT2-C0046 Apply illumination compensation to depth
    151140#if LGE_ILLUCOMP_DEPTH_C0046
     
    158147
    159148///// ***** QUADTREE LIMITATION *********
    160 #define OL_QTLIMIT_PREDCODING_B0068       1    //JCT3V-B0068
    161 #define HHI_QTLPC_RAU_OFF_C0160           1   // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
     149#define H3D_QTL                            1 // OL_QTLIMIT_dPREDCODING_B0068 //JCT3V-B0068
     150                                             // HHI_QTLPC_RAU_OFF_C0160     // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units
    162151
    163152///// ***** OTHERS *********
     
    186175///// ***** VSP *********
    187176#define MERL_VSP_C0152                    1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools
     177                                            // LGE_SIMP_DVP_REFINE_C0112           
     178                                            // MERL_MTK_VSP_DVP_REFINE_C0152_C0131
    188179#if MERL_VSP_C0152
    189180#define MERL_VSP_C0152_BugFix_ForNoDepthCase     1// MERL bugfix for test condition of no depth
     
    205196
    206197#define MERL_VSP_COMPENSATION_C0152          1 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add   (nocand).
    207 #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131  1 // JCT3V-C0152 && JCT3V-C0131: 1: refine disparity vector using a warped depth block; 0: not to refine  (mvp2off).
     198
    208199
    209200#define MERL_VSP_BLOCKSIZE_C0152             4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4.
    210201#define VSP_MERGE_POS                        5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5.
    211 #define LGE_SIMP_DVP_REFINE_C0112            1 // JCT3V-C0112: 1: simplification of refining disparity vector using a warped depth block
    212 #define MTK_DVPREFINE_BVSP_BUG_FIX               1
     202                                               //MTK_DVPREFINE_BVSP_BUG_FIX               1
    213203
    214204#else // !MERL_VSP_C0152
    215205#define MERL_VSP_COMPENSATION_C0152          0 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add
    216 #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131  0 // JCT3V-C0152 && JCT3V-C0131: 1: refine disparity vector using a warped depth block; 0: not to refine
    217206#define MERL_VSP_BLOCKSIZE_C0152             4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4.
    218 #define LGE_SIMP_DVP_REFINE_C0112            0 // JCT3V-C0112: 1: simplification of refining disparity vector using a warped depth block
    219207#endif
    220208
     
    223211#if H3D_NBDV                   
    224212#define DIS_CANS                          1
     213#define MCP_DIS_CANS                      7
    225214#endif                                 
    226215
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r313 r332  
    12061206#endif
    12071207#endif
    1208 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     1208#if HHI_MPI || H3D_QTL
    12091209Void TDecCavlc::parseSPS(TComSPS* pcSPS, Bool bIsDepth)
    12101210#else
     
    14471447    }
    14481448#endif
    1449 #if OL_QTLIMIT_PREDCODING_B0068
     1449#if H3D_QTL
    14501450    if( bIsDepth )
    14511451    {
  • trunk/source/Lib/TLibDecoder/TDecCAVLC.h

    r296 r332  
    114114  Void  parseVPS            ( TComVPS* pcVPS );
    115115#endif
    116 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     116#if HHI_MPI || H3D_QTL
    117117  Void  parseSPS            ( TComSPS* pcSPS, Bool bIsDepth );
    118118#else
  • trunk/source/Lib/TLibDecoder/TDecCu.cpp

    r296 r332  
    409409    }
    410410#endif
    411 #if H3D_IVRP && !MTK_MDIVRP_C0138
    412     m_pcEntropyDecoder->decodeResPredFlag( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 );
    413 #endif
    414411    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    415412    return;
     
    460457#endif
    461458
    462 #if H3D_IVRP && !MTK_MDIVRP_C0138
    463   if( !pcCU->isIntra( uiAbsPartIdx ) )
    464   {
    465     m_pcEntropyDecoder->decodeResPredFlag    ( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth], 0 );
    466   }
    467 #endif
    468459#if LGE_ILLUCOMP_DEPTH_C0046 && HHI_MPI
    469460  }
     
    679670  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
    680671#endif
    681 #if MTK_MDIVRP_C0138
     672#if H3D_IVRP
    682673  if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
    683674  {
     
    691682#endif
    692683
    693 #if H3D_IVRP && !MTK_MDIVRP_C0138
    694   if( pcCU->getResPredFlag( 0 ) )
    695   {
    696     AOF( pcCU->getResPredAvail( 0 ) );
    697     Bool bOK = pcCU->getResidualSamples( 0,
    698 #if QC_SIMPLIFIEDIVRP_M24938
    699       true,
    700 #endif
    701       m_ppcYuvResPred[uiDepth] );
    702     AOF( bOK );
    703 #if LG_RESTRICTEDRESPRED_M24766
    704     Int iPUResiPredShift[4];
    705     pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    706     m_ppcYuvReco[uiDepth]->add(iPUResiPredShift, pcCU->getPartitionSize(0), m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
    707 #else
    708     m_ppcYuvReco[uiDepth]->add( m_ppcYuvResPred[uiDepth], pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
    709 #endif
    710   }
    711 #endif
    712 
    713684  // inter recon
    714685  xDecodeInterTexture( pcCU, 0, uiDepth );
     
    722693  {
    723694#if H3D_IVRP
    724 #if MTK_MDIVRP_C0138
    725695    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
    726 #else
    727     if( pcCU->getResPredFlag( 0 ) )
    728 #endif
    729696    {
    730697      m_ppcYuvReco[uiDepth]->clip( pcCU->getWidth( 0 ), pcCU->getHeight( 0 ) );
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r296 r332  
    108108}
    109109
    110 #if H3D_IVRP && !MTK_MDIVRP_C0138
    111 Void
    112 TDecEntropy::decodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
    113 {
    114   Bool  bResPredAvailable   = false;
    115   Bool  bResPredFlag        = false;
    116 
    117   Bool  bResPredAllowed     =                    (!pcCU->getSlice()->getSPS()->isDepth                () );
    118   bResPredAllowed           = bResPredAllowed && ( pcCU->getSlice()->getSPS()->getViewId              () );
    119   bResPredAllowed           = bResPredAllowed && ( pcCU->getSlice()->getSPS()->getMultiviewResPredMode() );
    120   bResPredAllowed           = bResPredAllowed && (!pcCU->isIntra           ( uiAbsPartIdx )              );
    121 
    122   // check if supported
    123   if( bResPredAllowed )
    124   {
    125     bResPredAvailable       = pcSubCU->getResidualSamples( uiPUIdx , false  );
    126   }
    127 
    128   // read from bitstream
    129   if( bResPredAvailable )
    130   {
    131 #if LG_RESTRICTEDRESPRED_M24766
    132     Int iPUResiPredShift[4];
    133     pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx);
    134     if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0  || iPUResiPredShift[2] >= 0  || iPUResiPredShift[3] >= 0 )
    135 #endif
    136     m_pcEntropyDecoderIf->parseResPredFlag( pcCU, bResPredFlag, uiAbsPartIdx, uiDepth );
    137   }
    138 
    139   // set data
    140   pcCU->setResPredAvailSubParts ( bResPredAvailable, uiAbsPartIdx, uiPUIdx, uiDepth );
    141   pcCU->setResPredFlagSubParts  ( bResPredFlag,      uiAbsPartIdx, uiPUIdx, uiDepth );
    142 }
    143 #endif
    144 
    145110Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    146111{
  • trunk/source/Lib/TLibDecoder/TDecEntropy.h

    r296 r332  
    7272  virtual Void  parseVPS                  ( TComVPS* pcVPS )                       = 0;
    7373#endif
    74 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     74#if HHI_MPI || H3D_QTL
    7575  virtual Void  parseSPS                  ( TComSPS* pcSPS, Bool bIsDepth )                       = 0;
    7676#else
     
    171171#endif
    172172 
    173 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     173#if HHI_MPI || H3D_QTL
    174174  Void    decodeSPS                   ( TComSPS* pcSPS, Bool bIsDepth ) { m_pcEntropyDecoderIf->parseSPS(pcSPS, bIsDepth); }
    175175#else
     
    198198  Void decodeMergeFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx );
    199199  Void decodeMergeIndex        ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth );
    200 #if H3D_IVRP && !MTK_MDIVRP_C0138
    201   Void decodeResPredFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx );
    202 #endif
    203200  Void decodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    204201  Void decodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • trunk/source/Lib/TLibDecoder/TDecSbac.cpp

    r296 r332  
    707707  UInt uiSymbol;
    708708
    709 #if OL_QTLIMIT_PREDCODING_B0068
     709#if H3D_QTL
    710710  Bool bParseSplitFlag    = true;
    711711
     
    715715  Bool bIntraSliceDetect  = (pcCU->getSlice()->getSliceType() == I_SLICE);
    716716
    717 #if HHI_QTLPC_RAU_OFF_C0160
    718717  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    719718  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTLPC())
    720 #else
    721   if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
    722 #endif
    723719  {
    724720    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    733729    DTRACE_CABAC_VL( g_nSymbolCounter++ )
    734730    DTRACE_CABAC_T( "\tSplitFlag\n" )
    735 #if OL_QTLIMIT_PREDCODING_B0068
     731#if H3D_QTL
    736732  }
    737733  else
     
    755751  PartSize eMode;
    756752
    757 #if OL_QTLIMIT_PREDCODING_B0068
     753#if H3D_QTL
    758754  Bool bParsePartSize    = true;
    759755  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
     
    762758  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
    763759
    764 #if HHI_QTLPC_RAU_OFF_C0160
    765760  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    766761  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTLPC())
    767 #else
    768   if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
    769 #endif
    770762  {
    771763    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    781773  if ( pcCU->isIntra( uiAbsPartIdx ) )
    782774  {
    783 #if OL_QTLIMIT_PREDCODING_B0068
     775#if H3D_QTL
    784776    if(bParsePartSize)
    785777    {
     
    791783      }
    792784      eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;
    793 #if OL_QTLIMIT_PREDCODING_B0068
     785#if H3D_QTL
    794786    }
    795787#endif
     
    809801  else
    810802  {
    811 #if OL_QTLIMIT_PREDCODING_B0068
     803#if H3D_QTL
    812804    if(bParsePartSize)
    813805    {
     
    849841        }
    850842      }
    851 #if OL_QTLIMIT_PREDCODING_B0068
     843#if H3D_QTL
    852844    }
    853845#endif
  • trunk/source/Lib/TLibDecoder/TDecSbac.h

    r296 r332  
    8888  Void  parseVPS                  ( TComVPS* pcVPS )  {}
    8989#endif
    90 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     90#if HHI_MPI || H3D_QTL
    9191  Void  parseSPS                  ( TComSPS* pcSPS, Bool bIsDepth ) {}
    9292#else
  • trunk/source/Lib/TLibDecoder/TDecTop.cpp

    r313 r332  
    12571257  TComRPSList* rps = new TComRPSList();
    12581258  sps->setRPSList(rps);
    1259 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     1259#if HHI_MPI || H3D_QTL
    12601260  m_cEntropyDecoder.decodeSPS( sps, m_isDepth );
    12611261#else
  • trunk/source/Lib/TLibEncoder/TEncCavlc.cpp

    r313 r332  
    442442#endif
    443443#endif
    444 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     444#if HHI_MPI || H3D_QTL
    445445Void TEncCavlc::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
    446446#else
     
    632632#endif
    633633
    634 #if OL_QTLIMIT_PREDCODING_B0068
     634#if H3D_QTL
    635635  if( bIsDepth )
    636636  {
  • trunk/source/Lib/TLibEncoder/TEncCavlc.h

    r296 r332  
    114114#endif
    115115
    116 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     116#if HHI_MPI || H3D_QTL
    117117  Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
    118118#else
  • trunk/source/Lib/TLibEncoder/TEncCfg.h

    r296 r332  
    309309#endif
    310310
    311 #if OL_QTLIMIT_PREDCODING_B0068
     311#if H3D_QTL
    312312  Bool     m_bUseQTLPC;
    313313#endif
     
    790790#endif
    791791
    792 #if OL_QTLIMIT_PREDCODING_B0068
     792#if H3D_QTL
    793793  Void      setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
    794794  Bool      getUseQTLPC()         { return m_bUseQTLPC; }
  • trunk/source/Lib/TLibEncoder/TEncCu.cpp

    r296 r332  
    420420  TComPic* pcPic = rpcBestCU->getPic();
    421421
    422 #if OL_QTLIMIT_PREDCODING_B0068
     422#if H3D_QTL
    423423  TComSPS *sps         = pcPic->getSlice(0)->getSPS();
    424424  TComPic *pcTexture   = rpcBestCU->getSlice()->getTexturePic();
     
    427427  Bool  bIntraSliceDetect = (rpcBestCU->getSlice()->getSliceType() == I_SLICE);
    428428
    429 #if HHI_QTLPC_RAU_OFF_C0160
    430429  Bool rapPic     = (rpcBestCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || rpcBestCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    431 #endif
    432430
    433431  Bool bTry2NxN = true;
     
    571569      rpcTempCU->initEstData( uiDepth, iQP );
    572570
    573 #if OL_QTLIMIT_PREDCODING_B0068
     571#if H3D_QTL
    574572      //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
    575573
    576 #if HHI_QTLPC_RAU_OFF_C0160
    577574      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTLPC())
    578 #else
    579       if(depthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC())
    580 #endif
    581575      {
    582576        TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU
     
    602596      {
    603597#if H3D_IVRP
    604 #if MTK_MDIVRP_C0138
    605598        Bool  bResPredAvailable   = false;
    606599        UInt uiResPrdId = 0;
    607 #else
    608         // check availability of residual prediction
    609         Bool  bResPredAvailable   = false;
    610         Bool  bResPredAllowed     =                    (!rpcBestCU->getSlice()->getSPS()->isDepth                () );
    611         bResPredAllowed           = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getViewId              () );
    612         bResPredAllowed           = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getMultiviewResPredMode() );
    613         if( bResPredAllowed )
    614         {
    615           bResPredAvailable       = rpcBestCU->getResidualSamples( 0, true , m_ppcResPredTmp[uiDepth] );
    616         }
    617 
    618         for( UInt uiResPrdId = 0; uiResPrdId < ( bResPredAvailable ? 2 : 1 ); uiResPrdId++ )
    619 #endif
    620600        {
    621601          Bool bResPredFlag  = ( uiResPrdId > 0 );
     
    648628            }
    649629          }
    650 #if LGE_ILLUCOMP_B0045_ENCSIMP
     630#if LGE_ILLUCOMP_B0045
    651631          if(bICFlag && rpcBestCU->getMergeFlag(0) && !rpcBestCU->getICFlag(0))
    652632          {
     
    661641            rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    662642#endif
    663 #if FIX_LGE_ILLUCOMP_B0045
     643#if LGE_ILLUCOMP_B0045
    664644            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    665645#endif
     
    684664      } // != I_SLICE
    685665
    686 #if LGE_ILLUCOMP_B0045_ENCSIMP
     666#if LGE_ILLUCOMP_B0045
    687667    bICEnabled = rpcBestCU->getICFlag(0);
    688668#endif
    689669
    690 #if OL_QTLIMIT_PREDCODING_B0068
    691 
    692 #if HHI_QTLPC_RAU_OFF_C0160
     670#if H3D_QTL
     671
    693672      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTLPC())
    694 #else
    695       if(depthMapDetect && !bIntraSliceDetect  && sps->getUseQTLPC())
    696 #endif
    697673      {
    698674        bTrySplitDQP = bTrySplit;
     
    712688          bTrySplitDQP = bTrySplit;
    713689        }
    714 #if OL_QTLIMIT_PREDCODING_B0068
     690#if H3D_QTL
    715691      }
    716692#endif
     
    739715      {
    740716#if H3D_IVRP
    741 #if MTK_MDIVRP_C0138
    742717        Bool  bResPredAvailable   = false;
    743718        UInt uiResPrdId = 0;
    744 #else
    745         // check availability of residual prediction
    746         Bool  bResPredAvailable   = false;
    747         Bool  bResPredAllowed     =                    (!rpcBestCU->getSlice()->getSPS()->isDepth                () );
    748         bResPredAllowed           = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getViewId              () );
    749         bResPredAllowed           = bResPredAllowed && ( rpcBestCU->getSlice()->getSPS()->getMultiviewResPredMode() );
    750         if( bResPredAllowed )
    751         {
    752           bResPredAvailable       = rpcBestCU->getResidualSamples( 0, true, m_ppcResPredTmp[uiDepth] );
    753         }
    754 
    755         for( UInt uiResPrdId = 0; uiResPrdId < ( bResPredAvailable ? 2 : 1 ); uiResPrdId++ )
    756 #endif
    757719        {
    758720          Bool bResPredFlag  = ( uiResPrdId > 0 );
     
    772734              if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu)
    773735              {
    774 #if OL_QTLIMIT_PREDCODING_B0068 //try InterNxN
     736#if H3D_QTL //try InterNxN
    775737                if(bTrySplit)
    776738                {
     
    785747#endif
    786748                  rpcTempCU->initEstData( uiDepth, iQP );
    787 #if OL_QTLIMIT_PREDCODING_B0068
     749#if H3D_QTL
    788750                }
    789751#endif
     
    793755
    794756          { // 2NxN, Nx2N
    795 #if OL_QTLIMIT_PREDCODING_B0068 //try Nx2N
     757#if H3D_QTL //try Nx2N
    796758            if(bTryNx2N)
    797759            {
     
    802764                rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    803765#endif
    804 #if FIX_LGE_ILLUCOMP_B0045
     766#if LGE_ILLUCOMP_B0045
    805767                rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    806768#endif
     
    816778                }
    817779              }
    818 #if OL_QTLIMIT_PREDCODING_B0068
     780#if H3D_QTL
    819781            }
    820782#endif
    821783
    822 #if OL_QTLIMIT_PREDCODING_B0068 //try 2NxN
     784#if H3D_QTL //try 2NxN
    823785            if(bTry2NxN)
    824786            {
     
    829791                rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    830792#endif
    831 #if FIX_LGE_ILLUCOMP_B0045
     793#if LGE_ILLUCOMP_B0045
    832794                rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    833795#endif
     
    843805                }
    844806              }
    845 #if OL_QTLIMIT_PREDCODING_B0068
     807#if H3D_QTL
    846808            }
    847809#endif
     
    866828            if ( bTestAMP_Hor )
    867829            {
    868 #if OL_QTLIMIT_PREDCODING_B0068 //try 2NxnU & 2NxnD
     830#if H3D_QTL //try 2NxnU & 2NxnD
    869831              if(bTry2NxN)
    870832              {
     
    875837                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    876838#endif
    877 #if FIX_LGE_ILLUCOMP_B0045
     839#if LGE_ILLUCOMP_B0045
    878840                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    879841#endif
     
    894856                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    895857#endif
    896 #if FIX_LGE_ILLUCOMP_B0045
     858#if LGE_ILLUCOMP_B0045
    897859                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    898860#endif
     
    908870                  }
    909871                }
    910 #if OL_QTLIMIT_PREDCODING_B0068
     872#if H3D_QTL
    911873              }
    912874#endif
     
    915877            else if ( bTestMergeAMP_Hor )
    916878            {
    917 #if OL_QTLIMIT_PREDCODING_B0068 //try 2NxnU & 2NxnD Merge
     879#if H3D_QTL //try 2NxnU & 2NxnD Merge
    918880              if(bTry2NxN)
    919881              {
     
    924886                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    925887#endif
    926 #if FIX_LGE_ILLUCOMP_B0045
     888#if LGE_ILLUCOMP_B0045
    927889                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    928890#endif
     
    943905                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    944906#endif
    945 #if FIX_LGE_ILLUCOMP_B0045
     907#if LGE_ILLUCOMP_B0045
    946908                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    947909#endif
     
    957919                  }
    958920                }
    959 #if OL_QTLIMIT_PREDCODING_B0068
     921#if H3D_QTL
    960922              }
    961923#endif
     
    966928            if ( bTestAMP_Ver )
    967929            {
    968 #if OL_QTLIMIT_PREDCODING_B0068 //try nLx2N & nRx2N
     930#if H3D_QTL //try nLx2N & nRx2N
    969931              if(bTryNx2N)
    970932              {
     
    975937                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    976938#endif
    977 #if FIX_LGE_ILLUCOMP_B0045
     939#if LGE_ILLUCOMP_B0045
    978940                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    979941#endif
     
    994956                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    995957#endif
    996 #if FIX_LGE_ILLUCOMP_B0045
     958#if LGE_ILLUCOMP_B0045
    997959                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    998960#endif
     
    1004966                  rpcTempCU->initEstData( uiDepth, iQP );
    1005967                }
    1006 #if OL_QTLIMIT_PREDCODING_B0068
     968#if H3D_QTL
    1007969              }
    1008970#endif
     
    1011973            else if ( bTestMergeAMP_Ver )
    1012974            {
    1013 #if OL_QTLIMIT_PREDCODING_B0068 //try nLx2N & nRx2N (Merge)
     975#if H3D_QTL //try nLx2N & nRx2N (Merge)
    1014976              if(bTryNx2N)
    1015977              {
     
    1020982                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    1021983#endif
    1022 #if FIX_LGE_ILLUCOMP_B0045
     984#if LGE_ILLUCOMP_B0045
    1023985                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    1024986#endif
     
    10391001                  rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag );
    10401002#endif
    1041 #if FIX_LGE_ILLUCOMP_B0045
     1003#if LGE_ILLUCOMP_B0045
    10421004                  rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    10431005#endif
     
    10491011                  rpcTempCU->initEstData( uiDepth, iQP );
    10501012                }
    1051 #if OL_QTLIMIT_PREDCODING_B0068
     1013#if H3D_QTL
    10521014              }
    10531015#endif
     
    11431105          if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth )
    11441106          {
    1145 #if OL_QTLIMIT_PREDCODING_B0068 //Try IntraNxN
     1107#if H3D_QTL //Try IntraNxN
    11461108            if(bTrySplit)
    11471109            {
     
    11551117                rpcTempCU->initEstData( uiDepth, iQP );
    11561118              }
    1157 #if OL_QTLIMIT_PREDCODING_B0068
     1119#if H3D_QTL
    11581120            }
    11591121#endif
     
    18051767        );
    18061768#endif
    1807 #if H3D_IVRP && !MTK_MDIVRP_C0138
    1808     m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
    1809 #endif
    18101769    finishCU(pcCU,uiAbsPartIdx,uiDepth);
    18111770    return;
     
    18391798#endif
    18401799        );
    1841 #endif
    1842 #if H3D_IVRP && !MTK_MDIVRP_C0138
    1843     if( !pcCU->isIntra( uiAbsPartIdx ) )
    1844     {
    1845       m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 );
    1846     }
    18471800#endif
    18481801#if HHI_MPI
     
    18801833  Int numValidMergeCand = 0;
    18811834
    1882 #if H3D_IVRP && !MTK_MDIVRP_C0138
    1883   Bool  bResPrdAvail  = rpcTempCU->getResPredAvail( 0 );
    1884   Bool  bResPrdFlag   = rpcTempCU->getResPredFlag ( 0 );
    1885 #endif
    18861835#if LGE_ILLUCOMP_B0045
    18871836  Bool  bICFlag = rpcTempCU->getICFlag(0);
     
    19161865  rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    19171866#endif
    1918 #if MTK_MDIVRP_C0138
     1867#if H3D_IVRP
    19191868  Bool bResPredAvail = rpcTempCU->getResPredAvail(0);
    19201869#endif
     
    19781927
    19791928#if H3D_IVRP
    1980 #if MTK_MDIVRP_C0138
    19811929          rpcTempCU->setResPredAvailSubParts(bResPredAvail, 0, 0, uhDepth);
    1982 #else
    1983           rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth );
    1984           rpcTempCU->setResPredFlagSubParts ( bResPrdFlag,  0, 0, uhDepth );
    1985 #endif
    19861930#endif
    19871931#if LGE_ILLUCOMP_B0045
     
    20011945            m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    20021946#endif
    2003 #if MTK_MDIVRP_C0138
     1947#if H3D_IVRP
    20041948            if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
    20051949            {
     
    20201964              m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] );
    20211965#endif
    2022 #if MTK_MDIVRP_C0138
     1966#if H3D_IVRP
    20231967              if (uiMergeCand == 0 && rpcTempCU->getResPredAvail(0))
    20241968              {
     
    21202064#endif
    21212065  rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
    2122  
    2123 #if H3D_IVRP
    2124 #if !LG_RESTRICTEDRESPRED_M24766
    2125   if( rpcTempCU->getResPredFlag( 0 ) )
    2126   { // subtract residual prediction from original in motion search
    2127     m_ppcOrigYuv[uhDepth]->add( m_ppcResPredTmp [uhDepth], rpcTempCU->getWidth( 0 ), rpcTempCU->getHeight( 0 ), true );
    2128   }
    2129 #endif
    2130 #endif
    21312066
    21322067#if AMP_MRG
    21332068  rpcTempCU->setMergeAMP (true);
    21342069  #if HHI_INTERVIEW_SKIP
    2135 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    2136   m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG);
    2137 #else
    21382070  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG  );
    2139 #endif
    21402071#else
    21412072  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG );
     
    21462077#else 
    21472078  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
    2148 #endif
    2149 #endif
    2150 
    2151 #if H3D_IVRP
    2152 #if !LG_RESTRICTEDRESPRED_M24766
    2153   if( rpcTempCU->getResPredFlag( 0 ) )
    2154   { // add residual prediction to original again
    2155     m_ppcOrigYuv[uhDepth]->add( m_ppcResPredTmp [uhDepth], rpcTempCU->getWidth( 0 ), rpcTempCU->getHeight( 0 ) );
    2156   }
    21572079#endif
    21582080#endif
  • trunk/source/Lib/TLibEncoder/TEncEntropy.cpp

    r296 r332  
    122122#endif
    123123
    124 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     124#if HHI_MPI || H3D_QTL
    125125Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth )
    126126{
     
    455455}
    456456
    457 #if H3D_IVRP && !MTK_MDIVRP_C0138
    458 Void
    459 TEncEntropy::encodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD )
    460 {
    461   if( bRD )
    462   {
    463     uiAbsPartIdx = 0;
    464   }
    465 
    466   // check whether flag is coded
    467   ROTVS( pcCU->getSlice()->getSPS()->isDepth                () );
    468   ROFVS( pcCU->getSlice()->getSPS()->getViewId              () );
    469   ROFVS( pcCU->getSlice()->getSPS()->getMultiviewResPredMode() );
    470   ROTVS( pcCU->isIntra           ( uiAbsPartIdx )              );
    471   ROFVS( pcCU->getResPredAvail   ( uiAbsPartIdx )              );
    472 #if LG_RESTRICTEDRESPRED_M24766
    473   Int iPUResiPredShift[4];
    474   pcCU->getPUResiPredShift(iPUResiPredShift, uiAbsPartIdx);
    475   if(iPUResiPredShift[0] >= 0 || iPUResiPredShift[1] >= 0  || iPUResiPredShift[2] >= 0  || iPUResiPredShift[3] >= 0 )
    476 #endif
    477   // encode flag
    478   m_pcEntropyCoderIf->codeResPredFlag( pcCU, uiAbsPartIdx );
    479 }
    480 #endif
    481457
    482458/** parse the fixed length code (smaller than one max value) in ALF
  • trunk/source/Lib/TLibEncoder/TEncEntropy.h

    r296 r332  
    8080#endif
    8181
    82 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     82#if HHI_MPI || H3D_QTL
    8383  virtual Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth )                       = 0;
    8484#else
     
    222222#endif
    223223  // SPS
    224 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     224#if HHI_MPI || H3D_QTL
    225225  Void encodeSPS               ( TComSPS* pcSPS, Bool bIsDepth );
    226226#else
     
    250250  Void encodeMergeFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx );
    251251  Void encodeMergeIndex   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
    252 #if H3D_IVRP && !MTK_MDIVRP_C0138
    253   Void encodeResPredFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false );
    254 #endif
    255252  Void encodeAlfCtrlFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    256253
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r313 r332  
    887887        m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    888888        pcSlice->getSPS()->setNumSubstreams( pcSlice->getPPS()->getNumSubstreams() );
    889 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     889#if HHI_MPI || H3D_QTL
    890890        m_pcEntropyCoder->encodeSPS(pcSlice->getSPS(), m_pcEncTop->getIsDepth());
    891891#else
  • trunk/source/Lib/TLibEncoder/TEncSbac.cpp

    r296 r332  
    376376#endif
    377377
    378 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     378#if HHI_MPI || H3D_QTL
    379379Void TEncSbac::codeSPS( TComSPS* pcSPS, Bool bIsDepth )
    380380#else
     
    578578  PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
    579579
    580 #if OL_QTLIMIT_PREDCODING_B0068
     580#if H3D_QTL
    581581  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
    582582  TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
     
    584584  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
    585585 
    586 #if HHI_QTLPC_RAU_OFF_C0160
    587586  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    588587  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag())
    589 #else
    590   if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag())
    591 #endif
    592588  {
    593589    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     
    855851  assert( uiCtx < 3 );
    856852
    857 #if OL_QTLIMIT_PREDCODING_B0068
     853#if H3D_QTL
    858854  Bool bCodeSplitFlag    = true;
    859855
     
    863859  Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE);
    864860
    865 #if HHI_QTLPC_RAU_OFF_C0160
    866861  Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
    867862  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag())
    868 #else
    869   if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag())
    870 #endif
    871863  {
    872864    TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
  • trunk/source/Lib/TLibEncoder/TEncSbac.h

    r296 r332  
    102102#endif
    103103 
    104 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     104#if HHI_MPI || H3D_QTL
    105105  Void  codeSPS                 ( TComSPS* pcSPS, Bool bIsDepth );
    106106#else
  • trunk/source/Lib/TLibEncoder/TEncSearch.cpp

    r296 r332  
    23112311      for( UInt uiSDC=0; uiSDC<=uiUseSDC; uiSDC++ )
    23122312      {
    2313 #if FIX_SDC_ENC_C0143
    23142313        for( UInt uiRes = 0; uiRes<=uiSDC; uiRes++ )
    2315 #else
    2316         for( UInt uiRes = 0; uiRes<=uiUseSDC; uiRes++ )
    2317 #endif
    23182314        {
    23192315#endif
     
    29092905 * \returns Void
    29102906 */
     2907
     2908Void TEncSearch::xMergeEstimation( TComDataCU*     pcCU,
     2909                                 TComYuv*        pcYuvOrg,
     2910                                 Int             iPUIdx,
     2911                                 UInt&           uiInterDir,
     2912                                 TComMvField*    pacMvField,
     2913                                 UInt&           uiMergeIndex,
     2914                                 UInt&           ruiCost
    29112915#if CU_BASED_MRG_CAND_LIST
    2912 #if LG_RESTRICTEDRESPRED_M24766
    2913 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
    2914 #else
    2915 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand )
    2916 #endif
    2917 #else
    2918 #if LG_RESTRICTEDRESPRED_M24766
    2919 #if MERL_VSP_C0152 || MTK_MDIVRP_C0138
    2920 #if !MTK_MDIVRP_C0138
    2921 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue )
    2922 #endif
    2923 #if !MERL_VSP_C0152
    2924 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    2925 #endif
    2926 #if MERL_VSP_C0152 && MTK_MDIVRP_C0138
    2927 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue  )
    2928 #endif
    2929 #else
    2930 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    2931 #endif
    2932 #else
    2933 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost )
    2934 #endif
    2935 #endif
     2916                                 , TComMvField* cMvFieldNeighbours, 
     2917                                 UChar* uhInterDirNeighbours,
     2918                                 Int& numValidMergeCand
     2919#endif
     2920#if MERL_VSP_C0152
     2921                                 , Int* iVSPIndexTrue
     2922#endif
     2923                                 )
    29362924{
    29372925#if !CU_BASED_MRG_CAND_LIST
     
    29852973  const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
    29862974#endif
    2987 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    2988   Int iPUResiPredShift[4];
    2989   Int iLastAddResiShift = -1000;
    2990 #endif
    29912975  ruiCost = MAX_UINT;
    29922976  for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
     
    30142998        }
    30152999        pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
    3016       }
    3017 #endif
    3018 #if LG_RESTRICTEDRESPRED_M24766  && !MTK_MDIVRP_C0138
    3019       Int iAddResiShift;
    3020       UInt uiPartAddr;
    3021       Int iRoiWidth, iRoiHeight;
    3022 
    3023       pcCU->getPartIndexAndSize( iPUIdx, uiPartAddr, iRoiWidth, iRoiHeight );
    3024       iAddResiShift = pcCU->getResiPredMode(uiPartAddr);
    3025       iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1 - iAddResiShift : -1);
    3026 
    3027       if( pcCU->getResPredFlag( 0 ))
    3028       { // subtract residual prediction from original in motion search
    3029         if(iLastAddResiShift != iAddResiShift)
    3030         {
    3031           //add subtracted residual last time
    3032           if(iLastAddResiShift >= 0)
    3033           {
    3034             iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3035             pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3036           }
    3037           //subtract residual
    3038           if(iAddResiShift >= 0)
    3039           {
    3040             iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift;
    3041             pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );
    3042           }
    3043           iLastAddResiShift = iAddResiShift;
    3044         }
    30453000      }
    30463001#endif
     
    30663021    }
    30673022  }
    3068 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3069   if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    3070   {
    3071     iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3072     pcYuvOrg->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3073   }
    3074 #endif
    30753023}
    30763024
     
    30853033 */
    30863034#if AMP_MRG
    3087 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3088 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
    3089 #else
    30903035Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG)
    3091 #endif
    30923036#else
    30933037Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes )
     
    31883132    for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT;
    31893133    UInt          uiBitsTempL0[MAX_NUM_REF];
    3190 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3191     Int iPUResiPredShift[4] = {0, 0, 0, 0};
    3192 #endif
    31933134    xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits);
    31943135   
     
    32093150    {
    32103151#endif
    3211 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3212       Bool bLastResiFlag = false;
    3213 #endif
    32143152
    32153153    //  Uni-directional prediction
     
    32203158      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    32213159      {
    3222 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3223         if( pcCU->getResPredFlag( 0 ))
    3224         {
    3225           if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp))
    3226           { // subtract residual prediction from original in motion search
    3227             if(!bLastResiFlag)
    3228               pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );
    3229             bLastResiFlag = true;
    3230           }
    3231           else
    3232           {
    3233             if(bLastResiFlag)
    3234               pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3235             bLastResiFlag = false;
    3236           }
    3237         }
    3238 #endif
    32393160        uiBitsTemp = uiMbBits[iRefList];
    32403161        if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 )
     
    33943315      }
    33953316    }
    3396 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3397     if( pcCU->getResPredFlag( 0 ) && bLastResiFlag)
    3398     { // subtract residual prediction from original in motion search
    3399       pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3400     }
    3401 #endif
    34023317    //  Bi-directional prediction
    34033318    if ( pcCU->getSlice()->isInterB() )
    34043319    {
    3405 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3406       Int iLastAddResiShift = -1000;
    3407 #endif
    34083320      cMvBi[0] = cMv[0];            cMvBi[1] = cMv[1];
    34093321      iRefIdxBi[0] = iRefIdx[0];    iRefIdxBi[1] = iRefIdx[1];
     
    34993411#else
    35003412          uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS];
    3501 #endif
    3502 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3503           Int iAddResiShift = -1, iPredFrom = 0;
    3504           Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr);
    3505 
    3506           iPredFrom = iBestRefIdx >= 0 ? 3 : 1;
    3507           if(iBestRefIdx >= 0 && pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0, iBestRefIdx))
    3508             iAddResiShift++;
    3509           if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp))
    3510             iAddResiShift++;
    3511           iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || iPredFrom != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3512 
    3513           if( pcCU->getResPredFlag( 0 ) )
    3514           {
    3515             if(iLastAddResiShift != iAddResiShift)
    3516             {
    3517               //add substracted residual last time
    3518               if(iLastAddResiShift >= 0 )
    3519               {
    3520                 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3521                 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3522               }
    3523               //substract residual
    3524               if(iAddResiShift >= 0)
    3525               {
    3526                 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift;
    3527                 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );
    3528               }
    3529               iLastAddResiShift = iAddResiShift;
    3530             }
    3531           }
    35323413#endif
    35333414          // call ME
     
    35813462        }
    35823463      } // for loop-iter
    3583 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3584       if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)
    3585       {
    3586         iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;
    3587         pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3588       }
    3589 #endif
    35903464    } // if (B_SLICE)
    35913465#if ZERO_MVD_EST
     
    37963670      if (bTestNormalMC)
    37973671      {
    3798 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3799         Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr);
    3800         iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \
    3801           (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3)? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);
    3802         if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)
    3803         {
    3804           pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true);
    3805         }
    3806 #endif
    38073672        xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() );
    38083673        uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits );
    3809 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    3810         if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)
    3811         {
    3812           pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));
    3813         }
    3814 #endif
    38153674      }
    38163675#else
     
    38273686      // find Merge result
    38283687      UInt uiMRGCost = MAX_UINT;
     3688
     3689
     3690xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost
    38293691#if CU_BASED_MRG_CAND_LIST
    3830 #if LG_RESTRICTEDRESPRED_M24766
    3831       xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    3832 #else
    3833       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
    3834 #endif
    3835 #else
    3836 #if LG_RESTRICTEDRESPRED_M24766
    3837 #if MERL_VSP_C0152 || MTK_MDIVRP_C0138
    3838 
    3839 #if !MTK_MDIVRP_C0138
    3840       xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
    3841 #endif
    3842 
    3843 #if !MERL_VSP_C0152
    3844       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    3845 #endif
    3846 
    3847 #if MERL_VSP_C0152 && MTK_MDIVRP_C0138
    3848       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost,  iVSPIndexTrue );
    3849 #endif
    3850 
    3851 #else
    3852       xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    3853 #endif
    3854 
    3855 
    3856 #else
    3857       xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost );
    3858 #endif
    3859 #endif
     3692                 , cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand,
     3693#endif
     3694#if MERL_VSP_C0152
     3695                 , iVSPIndexTrue
     3696#endif
     3697        );
     3698
    38603699      if ( uiMRGCost < uiMECost )
    38613700      {
     
    47754614  UInt      uiWidth      = pcCU->getWidth ( 0 );
    47764615  UInt      uiHeight     = pcCU->getHeight( 0 );
    4777 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    4778   Int       iPUResiPredShift[4];
    4779 #endif
    47804616  //  No residual coding : SKIP mode
    47814617  if ( ePredMode == MODE_SKIP && bSkipRes )
     
    47854621    pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    47864622   
    4787 #if MTK_MDIVRP_C0138
     4623#if H3D_IVRP
    47884624    if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0))
    47894625    {
    47904626      rpcYuvRec->clip( uiWidth, uiHeight );
    47914627    }
    4792 #else
    4793 #if H3D_IVRP
    4794     // add residual prediction
    4795     if( pcCU->getResPredFlag( 0 ) )
    4796     {
    4797 #if LG_RESTRICTEDRESPRED_M24766
    4798       pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    4799       rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight );
    4800 #else
    4801       rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight );
    4802 #endif
    4803       rpcYuvRec->clip( uiWidth, uiHeight );
    4804     }
    4805 #endif
    48064628#endif
    48074629
     
    48534675      );
    48544676#endif
    4855 #if H3D_IVRP && !MTK_MDIVRP_C0138
    4856     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    4857 #endif
    48584677#if HHI_MPI
    48594678    }
     
    49224741  else
    49234742  {
    4924 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    4925     iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;
    4926     rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth );
    4927 #else
    49284743  rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth );
    4929 #endif
    4930 #if H3D_IVRP && !MTK_MDIVRP_C0138
    4931     // subtract residual prediction
    4932     if( pcCU->getResPredFlag( 0 ) )
    4933     {
    4934 #if LG_RESTRICTEDRESPRED_M24766
    4935       pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    4936       rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResi, rpcYuvResPrd, 0, uiWidth );
    4937 #else
    4938       rpcYuvResi->subtract( rpcYuvResi, rpcYuvResPrd, 0, uiWidth );
    4939 #endif
    4940     }
    4941 #endif
    49424744  }
    49434745#else
     
    51344936#endif
    51354937  }
    5136 #if H3D_IVRP && !MTK_MDIVRP_C0138
    5137   // add residual prediction
    5138   if( pcCU->getResPredFlag( 0 ) )
    5139   {
    5140     pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );
    5141 #if LG_RESTRICTEDRESPRED_M24766
    5142     pcCU->getPUResiPredShift(iPUResiPredShift, 0);
    5143     rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd,   uiWidth, uiHeight );
    5144     iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;
    5145     rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResiBest, uiWidth, uiHeight );
    5146 #else
    5147     rpcYuvRec->add( rpcYuvResPrd,   uiWidth, uiHeight );
    5148     rpcYuvRec->add( rpcYuvResiBest, uiWidth, uiHeight );
    5149 #endif
    5150     rpcYuvRec->clip( uiWidth, uiHeight );
    5151   }
    5152   else
    5153 #endif
    51544938  rpcYuvRec->addClip ( pcYuvPred, rpcYuvResiBest, 0, uiWidth );
    51554939 
     
    61705954      );
    61715955#endif
    6172 #if H3D_IVRP && !MTK_MDIVRP_C0138
    6173     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    6174 #endif
    61755956    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    61765957  }
     
    61965977#endif
    61975978      );
    6198 #endif
    6199 #if H3D_IVRP && !MTK_MDIVRP_C0138
    6200     m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );
    62015979#endif
    62025980#if HHI_MPI
     
    65346312    Int iFullDeltaDC2 = riDeltaDC2;
    65356313
    6536 #if HHI_DMM_DELTADC_Q1_C0034
    6537 #else
    6538     xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC1 );
    6539     xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC2 );
    6540 #endif
    6541 
    65426314    Dist uiBestDist     = RDO_DIST_MAX;
    65436315    UInt  uiBestQStepDC1 = 0;
     
    65516323    uiDeltaDC2Max += (uiDeltaDC2Max>>1);
    65526324
    6553 #if HHI_DMM_DELTADC_Q1_C0034
    65546325    // limit search range to [0, IBDI_MAX]
    65556326    if( iFullDeltaDC1 <  0 && uiDeltaDC1Max >                abs(iPredDC1) ) { uiDeltaDC1Max =                abs(iPredDC1); }
     
    66986469      }
    66996470    }
    6700 #else
    6701     for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++  )
    6702     {
    6703       Int iLevelDeltaDC1 = (Int)(uiQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1);
    6704       xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 );
    6705 
    6706       Int iTestDC1 = Clip( iPredDC1 + iLevelDeltaDC1 );
    6707       for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++  )
    6708       {
    6709         Int iLevelDeltaDC2 = (Int)(uiQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1);
    6710         xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 );
    6711 
    6712         Int iTestDC2 = Clip( iPredDC2 + iLevelDeltaDC2 );
    6713 
    6714         assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iTestDC1, iTestDC2 );
    6715        
    6716         Dist uiActDist = RDO_DIST_MAX;
    6717 #if SAIT_VSO_EST_A0033
    6718         if ( m_pcRdCost->getUseEstimatedVSD() )
    6719         {         
    6720           TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();
    6721           TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();
    6722           uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );
    6723 #if LGE_WVSO_A0119
    6724           if ( m_pcRdCost->getUseWVSO() )
    6725           {   
    6726             Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
    6727             Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();
    6728             Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
    6729             uiActDist = (iDWeight * iD + iVSDWeight * (Dist) uiActDist) / ( iDWeight + iVSDWeight);
    6730           }
    6731 #endif // LGE_WVSO_A0119
    6732         }
    6733         else       
    6734 #endif // SAIT_VSO_EST_A0033
    6735         {       
    6736           uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride,  piOrig, uiStride, uiWidth, uiHeight, false, 0 );
    6737 #if LGE_WVSO_A0119
    6738           if ( m_pcRdCost->getUseWVSO() )
    6739           {   
    6740             Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();
    6741             Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();
    6742             Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );
    6743             uiActDist = (iDWeight * iD + iVSOWeight * (Dist) uiActDist) / ( iDWeight + iVSOWeight);
    6744           }
    6745 #endif // LGE_WVSO_A0119
    6746         }
    6747 
    6748         if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX )
    6749         {
    6750           uiBestDist     = uiActDist;
    6751           uiBestQStepDC1 = uiQStepDC1;
    6752           uiBestQStepDC2 = uiQStepDC2;
    6753         }
    6754       }
    6755     }
    6756 #endif
     6471
    67576472    iFullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1);
    67586473    iFullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1);
    6759 #if HHI_DMM_DELTADC_Q1_C0034
    6760 #else
    6761     xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC1 );
    6762     xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC2 );
    6763 #endif
     6474
    67646475    riDeltaDC1 = iFullDeltaDC1;
    67656476    riDeltaDC2 = iFullDeltaDC2;
     
    67676478#endif
    67686479
    6769 #if HHI_DMM_DELTADC_Q1_C0034
    6770 #else
    6771   xDeltaDCQuantScaleDown( pcCU, riDeltaDC1 );
    6772   xDeltaDCQuantScaleDown( pcCU, riDeltaDC2 );
    6773 #endif
    67746480}
    67756481#endif
  • trunk/source/Lib/TLibEncoder/TEncSearch.h

    r296 r332  
    196196  Void predInterSearch          ( TComDataCU* pcCU,
    197197                                  TComYuv*    pcOrgYuv,
    198 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    199                                   TComYuv*    rpcResiPredYuv,
    200 #endif
    201198                                  TComYuv*&   rpcPredYuv,
    202199                                  TComYuv*&   rpcResiYuv,
     
    501498  Void xMergeEstimation           ( TComDataCU*     pcCU,
    502499                                    TComYuv*        pcYuvOrg,
    503 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138
    504                                     TComYuv*        rpcResiPredYuv,
    505 #endif
    506500                                    Int             iPartIdx,
    507501                                    UInt&           uiInterDir,
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r313 r332  
    11931193    }
    11941194
    1195 #if OL_QTLIMIT_PREDCODING_B0068
     1195#if H3D_QTL
    11961196    rpcPic->setReduceBitsFlag(true);
    11971197#endif
     
    12351235    }
    12361236
    1237 #if OL_QTLIMIT_PREDCODING_B0068
     1237#if H3D_QTL
    12381238    rpcPic->setReduceBitsFlag(false);
    12391239#endif
  • trunk/source/Lib/TLibEncoder/TEncTop.cpp

    r313 r332  
    703703#endif
    704704
    705 #if OL_QTLIMIT_PREDCODING_B0068
     705#if H3D_QTL
    706706  m_cSPS.setUseQTLPC( m_bUseQTLPC );
    707707#endif
  • trunk/source/Lib/TLibExtractor/TExtrTop.cpp

    r296 r332  
    7979     TComRPSList cRPS;
    8080     cSPS.setRPSList( &cRPS );
    81 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068
     81#if HHI_MPI || H3D_QTL
    8282#if VIDYO_VPS_INTEGRATION
    8383     m_cEntropyDecoder.decodeSPS( &cSPS, m_cVPS.getDepthFlag(uiLayerId) );
Note: See TracChangeset for help on using the changeset viewer.