Changeset 322 in 3DVCSoftware
- Timestamp:
- 14 Apr 2013, 18:28:30 (12 years ago)
- Location:
- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
r313 r322 5164 5164 5165 5165 #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 5166 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iBlkWidth, Int iBlkHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine) 5171 5167 { 5172 5168 Int depStride = pcBaseViewDepthPicYuv->getStride(); 5173 5169 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 5170 Int iPictureWidth = pcBaseViewDepthPicYuv->getWidth(); 5171 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(); 5172 5173 Int depthPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + (mv->getHor()>>2)); 5174 Int depthPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + (mv->getVer()>>2)); 5175 5176 Pel *pDepthPel = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride; 5177 Pel maxDepthVal = 0; 5178 5186 5179 if ( bSimpleDvpRefine ) 5187 5180 { 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 5181 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + (mv->getHor()>>2)); 5182 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + (mv->getVer()>>2)); 5183 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + (mv->getHor()>>2)); 5184 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + (mv->getVer()>>2)); 5199 5185 Int iCenterX = (depthStartPosX + depthEndPosX) >> 1; 5200 5186 Int iCenterY = (depthStartPosY + depthEndPosY) >> 1; … … 5209 5195 for (Int i = 0; i < 5; i++) 5210 5196 { 5211 if (maxDepth < aiDepth[i])5212 maxDepth = aiDepth[i];5197 if (maxDepthVal < aiDepth[i]) 5198 maxDepthVal = aiDepth[i]; 5213 5199 } 5214 5200 } 5215 5201 else 5216 5202 { 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 5203 for (Int j = 0; j < iBlkHeight; j++) 5204 { 5205 for (Int i = 0; i < iBlkWidth; i++) 5206 { 5207 if (maxDepthVal < pDepthPel[i]) 5208 maxDepthVal = pDepthPel[i]; 5209 } 5210 pDepthPel += depStride; 5211 } 5212 } 5213 5214 Int iDisp = aiShiftLUT[ maxDepthVal ] << iShiftPrec; 5215 5216 return iDisp; 5217 } 5243 5218 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 5244 #else5245 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred)5246 #endif5247 5219 { 5248 5220 if (picDepth) … … 5257 5229 Int* aiShiftLUT; 5258 5230 Int iShiftPrec; 5231 5259 5232 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); 5233 5234 Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine ); 5235 cMvPred->setHor( iDisp ); 5266 5236 clipMv(*cMvPred); 5267 5237 } … … 5270 5240 5271 5241 #if H3D_NBDV 5272 Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo , Bool bParMerge 5242 5243 Bool TComDataCU::xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, UInt uiPartIdx, UInt uiPartAddr, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, McpDisInfo* paMvpDvInfo, UInt uiMvpDvPos ) 5244 { 5245 Bool bDepthRefine = true; 5246 5247 if( pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5248 { 5249 Bool bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5250 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5251 { 5252 RefPicList eRefPicList = RefPicList(iList); 5253 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5254 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5255 5256 if( refId >= 0) 5257 { 5258 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId ); 5259 if (refViewIdx != m_pcSlice->getViewId()) // DCP 5260 { 5261 clipMv(cMvPred); 5262 5263 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5264 5265 if (picDepth && bDepthRefine) 5266 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5267 5268 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 5269 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++ ] = refViewIdx; 5270 5271 return true; 5272 } 5273 else if ( bSearchForMvpDv && cMvPred.m_bDvMcp && bTmpIsSkipped ) 5274 { 5275 paMvpDvInfo->m_acMvCand[iList][ uiMvpDvPos ] = cMvPred; 5276 paMvpDvInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = refViewIdx; 5277 paMvpDvInfo->m_bAvailab[iList][ uiMvpDvPos ] = true; 5278 paMvpDvInfo->m_bFound = true; 5279 } 5280 } 5281 #if MERL_VSP_C0152 5282 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5283 { 5284 TComPic* picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5285 if (picDepth && bDepthRefine) 5286 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5287 5288 cMvPred.setVer(0); 5289 5290 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN] = cMvPred; 5291 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++] = 0; // refViewIdx; 5292 return true; 5293 } 5294 #endif 5295 } 5296 } 5297 return false; 5298 } 5299 5300 5301 Void TComDataCU::xDeriveRightBottomNbIdx( PartSize eCUMode, UInt uiPartIdx, Int &riLCUIdxRBNb, Int &riPartIdxRBNb ) 5302 { 5303 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 5304 Int uiLCUIdx = getAddr(); 5305 5306 UInt uiPartIdxRB; 5307 deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 5308 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5309 5310 if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 5311 { 5312 riLCUIdxRBNb = -1; 5313 riPartIdxRBNb = -1; 5314 } 5315 else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 5316 { 5317 riLCUIdxRBNb = -1; 5318 riPartIdxRBNb = -1; 5319 } 5320 else 5321 { 5322 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5323 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 5324 { 5325 riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 5326 } 5327 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 5328 { 5329 riPartIdxRBNb = -1; 5330 riLCUIdxRBNb = -1; 5331 } 5332 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 5333 { 5334 riPartIdxRBNb = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 5335 riLCUIdxRBNb = uiLCUIdx + 1; 5336 } 5337 else //is the right bottom corner of LCU 5338 { 5339 riPartIdxRBNb = -1; 5340 riLCUIdxRBNb = -1; 5341 } 5342 } 5343 } 5344 5345 5346 Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerge 5273 5347 #if MERL_VSP_C0152 5274 5348 , Bool bDepthRefine 5275 5349 #endif 5276 5350 ) 5277 { 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 5351 { 5352 //// ******* Init variables ******* ///// 5353 // Init disparity struct for results 5354 pDInfo->iN = 0; 5355 5356 // Init struct for disparities from MCP neighboring blocks 5357 McpDisInfo cMvpDvInfo; 5358 cMvpDvInfo.m_bFound = false; 5359 for (UInt iCurDvMcpCand = 0; iCurDvMcpCand < MCP_DIS_CANS; iCurDvMcpCand++) 5360 { 5361 for (UInt iList = 0; iList < 2; iList++) 5362 { 5363 cMvpDvInfo.m_acMvCand[iList][iCurDvMcpCand].setZero(); 5364 cMvpDvInfo.m_aVIdxCan[iList][iCurDvMcpCand] = 0; 5365 cMvpDvInfo.m_bAvailab[iList][iCurDvMcpCand] = false; 5366 } 5367 } 5368 5369 // Get Positions 5370 PartSize eCUMode = getPartitionSize( uiPartAddr ); 5371 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 5372 5373 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); 5374 deriveLeftBottomIdxGeneral ( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB ); 5375 5376 // Get parameters for parallel merge 5300 5377 Int xP, yP, nPSW, nPSH; 5301 5378 if( bParMerge) 5302 5379 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH); 5303 5380 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() 5381 //// ******* Get disparity from temporal neighboring blocks ******* ///// 5309 5382 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 5310 {5383 { 5311 5384 TComMv cColMv; 5312 5385 Int iTargetViewIdx = 0; 5313 Int iTStartViewIdx = 0; 5314 UInt uiPartIdxRB, uiBRIdx; 5315 #if !MTK_SIMPLIFY_DVTC_C0135 5316 Int uiViewIdxCurr= getSlice()->getViewId(); 5317 #endif 5386 Int iTStartViewIdx = 0; 5387 5388 ///*** Derive center position *** 5318 5389 UInt uiPartIdxCenter; 5390 Int uiLCUIdx = getAddr(); 5391 5319 5392 xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter ); 5320 5393 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())) 5394 ///*** Derive bottom right neighbour position *** 5395 eCUMode = getPartitionSize( 0 ); // Necessary? 5396 Int iLCUIdxRBNb = -1; 5397 Int iPartIdxRBNb = -1; 5398 5399 xDeriveRightBottomNbIdx( eCUMode, uiPartIdx, iLCUIdxRBNb, iPartIdxRBNb ); 5400 5401 ///*** Search temporal candidate pictures for disparity vector *** 5402 const Int iNumCandPics = 2; 5403 for(Int curCandPic = 0; curCandPic < iNumCandPics; curCandPic++) 5404 { 5405 // Get candidate picture 5406 RefPicList eCurRefPicList = REF_PIC_LIST_0 ; 5407 Int curCandPicRefIdx = 0; 5408 5409 if( curCandPic == 0 ) // check the co-located picture 5410 { 5411 eCurRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 5412 curCandPicRefIdx = getSlice()->getColRefIdx(); 5413 } 5414 else // check RAP 5415 { 5416 if( !(getPic()->getRapbCheck()) ) 5386 5417 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) 5418 5419 eCurRefPicList = getPic()->getRapRefList(); 5420 curCandPicRefIdx = getPic()->getRapRefIdx(); 5421 } 5422 5423 // Check BR and Center 5424 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eCurRefPicList, curCandPicRefIdx)->getViewId() ) 5395 5425 { 5396 #endif 5397 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 5426 for(Int curPosition = 0; curPosition < 2; curPosition++) 5398 5427 { 5428 Bool bCheck = false; 5429 if ( curPosition == 0 && iLCUIdxRBNb >= 0 ) 5430 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, iLCUIdxRBNb, iPartIdxRBNb, cColMv, iTargetViewIdx, iTStartViewIdx); 5431 5432 if (curPosition == 1 ) 5433 bCheck = xGetColDisMV( eCurRefPicList, curCandPicRefIdx, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ); 5434 5435 if( bCheck ) 5436 { 5399 5437 clipMv(cColMv); 5400 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5401 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5402 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5403 #else 5404 { 5405 TComPic* picDepth = NULL; 5406 picDepth = getSlice()->getRefPicBaseDepth(); 5438 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5407 5439 if (picDepth && bDepthRefine) 5408 #if LGE_SIMP_DVP_REFINE_C01125409 5440 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5410 #else5411 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);5412 #endif5413 5441 5414 5442 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5415 5443 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5416 }5417 #endif5418 5444 return ; 5419 5445 } 5420 #if !MTK_SIMPLIFY_DVTC_C0135 5446 } // Loop positions 5421 5447 } 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 } 5448 } // Loop candidate views 5474 5449 } // if TMVP Flag 5475 #endif 5450 5476 5451 UInt uiIdx = 0; 5452 Bool bCheckMcpDv = false; 5453 TComDataCU* pcTmpCU = NULL; 5454 5455 5456 //// ******* Get disparity from left block ******* ///// 5477 5457 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 5478 5458 if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) ) … … 5489 5469 } 5490 5470 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 5502 { 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 5471 bCheckMcpDv = true; 5472 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFT ) ) 5473 return; 5474 5475 5476 //// ******* Get disparity from above block ******* ///// 5477 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 5478 if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) ) 5479 { 5480 pcTmpCU = NULL; 5481 } 5482 5483 if (pcTmpCU && bParMerge) 5484 { 5485 if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 5486 { 5487 pcTmpCU = NULL; 5488 } 5489 } 5490 5491 if(pcTmpCU != NULL ) 5492 { 5493 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5494 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVE ) ) 5495 return; 5496 } 5497 5498 //// ******* Get disparity from above right block ******* ///// 5499 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 5500 5501 if (pcTmpCU && bParMerge) 5502 { 5503 if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP)) 5504 { 5505 pcTmpCU = NULL; 5506 } 5507 } 5508 5509 if(pcTmpCU != NULL ) 5510 { 5511 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5512 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVERIGHT ) ) 5522 5513 return; 5523 5514 } 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)) 5515 5516 5517 //// ******* Get disparity from below left block ******* ///// 5518 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 5519 5520 if (pcTmpCU && bParMerge) 5521 { 5522 if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP)) 5567 5523 { 5568 5524 pcTmpCU = NULL; … … 5570 5526 } 5571 5527 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 5528 if( pcTmpCU != NULL ) 5529 { 5530 bCheckMcpDv = true; 5531 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFTBELOW ) ) 5604 5532 return; 5605 5533 } 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); 5534 5535 5536 //// ******* Get disparity from above left block ******* ///// 5537 5538 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 5539 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 5641 5540 5642 5541 if (pcTmpCU && bParMerge) 5643 5542 { 5644 if (!pcTmpCU->isDiffMER(xP +nPSW, yP-1, xP, yP))5543 if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP)) 5645 5544 { 5646 5545 pcTmpCU = NULL; … … 5648 5547 } 5649 5548 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 5549 if( pcTmpCU != NULL ) 5550 { 5551 bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1); 5552 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVELEFT ) ) 5682 5553 return; 5683 5554 } 5684 else if(iLCUAddrDiff == 0) 5555 5556 //// ******* Search MCP blocks ******* ///// 5557 if( cMvpDvInfo.m_bFound ) 5558 { 5559 for( Int curPos = 1 ; curPos < MCP_DIS_CANS - 1 ; curPos++ ) 5685 5560 { 5686 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5687 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5561 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5688 5562 { 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 5563 if( cMvpDvInfo.m_bAvailab[iList][curPos] ) 5564 { 5565 TComMv cDispVec = cMvpDvInfo.m_acMvCand[iList][ curPos ]; 5566 clipMv( cDispVec ); 5567 5568 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5569 if (picDepth && bDepthRefine) 5570 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); 5571 5572 pDInfo->m_acMvCand[ pDInfo->iN] = cDispVec; 5573 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 5759 5574 return; 5760 5575 } 5761 else // MCP5762 {5763 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx);5764 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped )5765 {5766 #if MTK_RELEASE_DV_CONSTRAINT_C01295767 aiDvMcpDvCandX[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX;5768 aiDvMcpDvCandY[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispY;5769 #else5770 aiDvMcpDvCand[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX;5771 #endif5772 abDvMcpFlag [iList][DVFROM_LEFTBELOW] = true;5773 bDvMcpIsFound = true;5774 }5775 }5776 }5777 #if MERL_VSP_C01525778 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP5779 {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 #endif5792 }5793 }5794 5795 // Above predictor search5796 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_C01315824 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;5825 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;5826 #else5827 {5828 TComPic* picDepth = NULL;5829 picDepth = getSlice()->getRefPicBaseDepth();5830 if (picDepth && bDepthRefine)5831 #if LGE_SIMP_DVP_REFINE_C01125832 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true);5833 #else5834 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred);5835 #endif5836 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred;5837 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx;5838 }5839 #endif5840 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_C01295848 aiDvMcpDvCandX[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX;5849 aiDvMcpDvCandY[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispY;5850 #else5851 aiDvMcpDvCand[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX;5852 #endif5853 abDvMcpFlag [iList][DVFROM_ABOVELEFT] = true;5854 bDvMcpIsFound = true;5855 }5856 }5857 }5858 #if MERL_VSP_C01525859 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP5860 {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 #endif5873 }5874 }5875 #if !MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C00975876 // 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_C01355884 Int uiViewIdxCurr= getSlice()->getViewId();5885 #endif5886 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_C01355896 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 else5905 #else5906 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 check5907 #endif5908 {5909 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU5910 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU5911 {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 LCU5915 {5916 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];5917 #if MTK_SIMPLIFY_DVTC_C01355918 uiLCUnew = -1;5919 #else5920 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU();5921 #endif5922 }5923 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU5924 {5925 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];5926 uiLCUnew = uiLCUIdx + 1;5927 }5928 else //is the right bottom corner of LCU5929 {5930 uiBRIdx = 0;5931 #if MTK_SIMPLIFY_DVTC_C01355932 uiLCUnew = -1;5933 #else5934 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1;5935 #endif5936 }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 picture5944 eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0);5945 #if COLLOCATED_REF_IDX5946 lpRef = getSlice()->getColRefIdx();5947 #else5948 Int lpRef = 0;5949 #endif5950 }5951 else5952 {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_C01355962 if (uiViewIdxCurr > 1)5963 {5964 #endif5965 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) )5966 {5967 clipMv(cColMv);5968 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C01315969 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;5970 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;5971 #else5972 {5973 TComPic* picDepth = NULL;5974 picDepth = getSlice()->getRefPicBaseDepth();5975 if (picDepth && bDepthRefine)5976 #if LGE_SIMP_DVP_REFINE_C01125977 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);5978 #else5979 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);5980 #endif5981 5982 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;5983 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;5984 }5985 #endif5986 return ;5987 }5988 #if !MTK_SIMPLIFY_DVTC_C01355989 }5990 #endif5991 if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx ))5992 {5993 clipMv(cColMv);5994 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C01315995 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;5996 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;5997 #else5998 {5999 TComPic* picDepth = NULL;6000 picDepth = getSlice()->getRefPicBaseDepth();6001 if (picDepth && bDepthRefine)6002 #if LGE_SIMP_DVP_REFINE_C01126003 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);6004 #else6005 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);6006 #endif6007 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;6008 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;6009 }6010 #endif6011 return ;6012 }6013 #if !MTK_SIMPLIFY_DVTC_C01356014 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_C01316020 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;6021 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;6022 #else6023 {6024 TComPic* picDepth = NULL;6025 picDepth = getSlice()->getRefPicBaseDepth();6026 if (picDepth && bDepthRefine)6027 #if LGE_SIMP_DVP_REFINE_C01126028 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true);6029 #else6030 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv);6031 #endif6032 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;6033 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx;6034 }6035 #endif6036 return ;6037 }6038 }6039 #endif6040 }6041 }6042 } // if TMVP Flag6043 #endif6044 6045 if( bDvMcpIsFound ) // skip dvmcp6046 {6047 for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial6048 {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_C01296054 TComMv dv( aiDvMcpDvCandX[iList][ i ], aiDvMcpDvCandY[iList][ i ] );6055 #else6056 TComMv dv( aiDvMcpDvCand[iList][ i ], 0 );6057 #endif6058 clipMv( dv );6059 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C01316060 pDInfo->m_acMvCand[ pDInfo->iN] = dv;6061 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;6062 #else6063 {6064 TComPic* picDepth = NULL;6065 picDepth = getSlice()->getRefPicBaseDepth();6066 if (picDepth && bDepthRefine)6067 #if LGE_SIMP_DVP_REFINE_C01126068 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv, true);6069 #else6070 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv);6071 #endif6072 pDInfo->m_acMvCand[ pDInfo->iN] = dv;6073 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0;6074 }6075 #endif6076 return;6077 }6078 6079 5576 } 6080 5577 } … … 6771 6268 iColViewIdx = pColCU->getSlice()->getViewId(); 6772 6269 #if MERL_VSP_C0152 6773 //TComDataCU *pColCU = pColPic->getCU( uiCUAddr );6774 6270 if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0) 6775 6271 { … … 6786 6282 if(pColCU->getSlice()->isInterB()) 6787 6283 { 6788 #if !QC_NBDV_LDB_FIX_C00556789 if(ilist == 0 )6790 eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(1-getSlice()->getColDir());6791 else6792 eColRefPicList = getSlice()->getCheckLDC() ? (eRefPicList== REF_PIC_LIST_0? REF_PIC_LIST_1:REF_PIC_LIST_0 ): RefPicList(getSlice()->getColDir());6793 #else6794 6284 eColRefPicList = RefPicList(ilist); 6795 #endif6796 6285 } 6797 6286 … … 8008 7497 else 8009 7498 { 8010 #if MTK_RELEASE_DV_CONSTRAINT_C01298011 7499 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0], bRecon ); 8012 #else8013 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0].getHor(), bRecon );8014 #endif8015 7500 m_pePartSize[0] = m_peSaved; 8016 7501 return bAvailable; -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.h
r299 r322 287 287 ); 288 288 #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 ); 289 291 Bool xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 290 292 #endif … … 550 552 551 553 #if MERL_VSP_C0152 552 #if LGE_SIMP_DVP_REFINE_C0112553 554 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine = false); 554 555 Void estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false); 555 #else556 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 #endif559 556 #endif 560 557 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); … … 601 598 Void fillMvpCandBase ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); 602 599 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1); 603 #else604 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );605 600 #endif 606 601 Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); … … 831 826 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 832 827 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 828 829 833 830 #endif 834 831 }; -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r296 r322 894 894 cMv.m_bDvMcp = true; 895 895 cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 896 #if MTK_RELEASE_DV_CONSTRAINT_C0129897 896 cMv.m_iDvMcpDispY = pDInfo->m_acMvCand[0].getVer(); 898 #endif899 897 #endif //H3D_NBDV 900 898 pcCU->clipMv( cMv ); … … 1012 1010 rcMv.m_bDvMcp = true; 1013 1011 rcMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); 1014 #if MTK_RELEASE_DV_CONSTRAINT_C01291015 1012 rcMv.m_iDvMcpDispY = pDInfo->m_acMvCand[0].getVer(); 1016 #endif1017 1013 } 1018 1014 else { // AMVP ? -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComMotionInfo.h
r296 r322 66 66 Int iN; ///< number of motion vector predictor candidates 67 67 } DisInfo; 68 69 typedef 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 68 77 #endif 69 78 // Class definition -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComMv.h
r296 r322 60 60 Bool m_bDvMcp; // is dv-mcp ? 61 61 Int m_iDvMcpDispX; // disparity for dv-mcp 62 #if MTK_RELEASE_DV_CONSTRAINT_C012963 62 Int m_iDvMcpDispY; // disparity for dv-mcp 64 #endif65 63 #endif 66 64 … … 75 73 , m_bDvMcp(false) 76 74 , m_iDvMcpDispX(0) 77 #if MTK_RELEASE_DV_CONSTRAINT_C012978 75 , m_iDvMcpDispY(0) 79 #endif80 76 #endif 81 77 { … … 88 84 , m_bDvMcp(false) 89 85 , m_iDvMcpDispX(0) 90 #if MTK_RELEASE_DV_CONSTRAINT_C012991 86 , m_iDvMcpDispY(0) 92 #endif93 87 #endif 94 88 { -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComResidualGenerator.cpp
r313 r322 227 227 228 228 #if H3D_NBDV 229 #if MTK_RELEASE_DV_CONSTRAINT_C0129230 229 Bool 231 230 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, TComMv iDisp, Bool bRecon ) 232 #else233 Bool234 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp, Bool bRecon )235 #endif236 231 #else 237 232 Bool … … 248 243 pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos ); 249 244 #if H3D_NBDV 250 #if MTK_RELEASE_DV_CONSTRAINT_C0129251 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp, bRecon);252 #else253 245 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp, bRecon); 254 #endif255 246 #else 256 247 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, bRecon); … … 259 250 260 251 #if H3D_NBDV 261 #if MTK_RELEASE_DV_CONSTRAINT_C0129262 252 Bool 263 253 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp, Bool bRecon) 264 254 #else 265 255 Bool 266 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp, Bool bRecon)267 #endif268 #else269 Bool270 256 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Bool bRecon) 271 257 #endif … … 282 268 UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos; 283 269 #if H3D_NBDV 284 #if MTK_RELEASE_DV_CONSTRAINT_C0129285 270 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp, &uiXPosInRefView , &uiYPosInRefView , bRecon ); 286 #else287 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp, &uiXPosInRefView , &uiYPosInRefView , bRecon );288 #endif289 271 #else 290 272 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, &uiXPosInRefView , &uiYPosInRefView , bRecon ); … … 500 482 501 483 #if H3D_NBDV 502 #if MTK_RELEASE_DV_CONSTRAINT_C0129503 484 Void 504 485 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, TComMv iDisp 505 486 ,UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon ) 506 #else // MTK_RELEASE_DV_CONSTRAINT_C0129507 Void508 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp509 ,UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon)510 #endif // MTK_RELEASE_DV_CONSTRAINT_C0129511 487 #else // H3D_NBDV 512 488 Void … … 531 507 //===== get disparity ===== 532 508 #if H3D_NBDV 533 #if MTK_RELEASE_DV_CONSTRAINT_C0129534 509 Int iDisparity_y = iDisp.getVer(); 535 510 Int iDisparity = iDisp.getHor(); 536 #else537 Int iDisparity = iDisp;538 #endif539 511 #else //H3D_NBDV 540 512 Int iMidPosX = Int( uiXPos + ( ( uiBlkWidth - 1 ) >> 1 ) ) >> m_pcDepthMapGenerator->getSubSampExpX(); … … 549 521 Int iYRefPosX0 = Int( uiXPos ) + ( iDisparity >> 2 ); 550 522 Int iYRefPosX1 = iYRefPosX0 + 1; 551 #if MTK_RELEASE_DV_CONSTRAINT_C0129552 523 Int iYMaxPosY = Int( uiPicHeight ) - 1; 553 524 Int iYWeight3 = ( iDisparity_y & 3 ); … … 555 526 Int iYRefPosY0 = Max( 0, Min( iYMaxPosY, Int( uiYPos ) + ( iDisparity_y >> 2 )) ); 556 527 Int iYRefPosY1 = Max( 0, Min( iYMaxPosY, iYRefPosY0 + 1 )); 557 #endif558 528 Int iYMaxPosX = Int( uiPicWidth ) - 1; 559 529 Int iSrcStrideY = pcBaseRes->getStride (); 560 530 Int iDesStrideY = pcYuv ->getStride (); 561 #if MTK_RELEASE_DV_CONSTRAINT_C0129562 531 Pel* pSrcSamplesY0= pcBaseRes->getLumaAddr ( 0 ) + iYRefPosY0 * iSrcStrideY; 563 532 Pel* pSrcSamplesY1= pcBaseRes->getLumaAddr ( 0 ) + iYRefPosY1 * iSrcStrideY; 564 #else565 Pel* pSrcSamplesY= pcBaseRes->getLumaAddr ( 0 ) + uiYPos * iSrcStrideY;566 #endif567 533 Pel* pDesSamplesY= pcYuv ->getLumaAddr (); 568 534 … … 575 541 return; 576 542 577 #if MTK_RELEASE_DV_CONSTRAINT_C0129578 543 for( Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY0 += iSrcStrideY, pSrcSamplesY1 += iSrcStrideY, pDesSamplesY += iDesStrideY ) 579 #else580 for( Int iY = 0; iY < iYHeight; iY++, pSrcSamplesY += iSrcStrideY, pDesSamplesY += iDesStrideY )581 #endif582 544 { 583 545 for( Int iX = 0; iX < iYWidth; iX++ ) … … 585 547 Int iXPic0 = Max( 0, Min( iYMaxPosX, iYRefPosX0 + iX ) ); 586 548 Int iXPic1 = Max( 0, Min( iYMaxPosX, iYRefPosX1 + iX ) ); 587 #if MTK_RELEASE_DV_CONSTRAINT_C0129588 549 Pel Temp1,Temp2; 589 550 Temp1 =( iYWeight0 * pSrcSamplesY0[iXPic0] + iYWeight1 * pSrcSamplesY0[iXPic1] + 2 ) >> 2; 590 551 Temp2 =( iYWeight0 * pSrcSamplesY1[iXPic0] + iYWeight1 * pSrcSamplesY1[iXPic1] + 2 ) >> 2; 591 552 pDesSamplesY[iX] = ( iYWeight2 * Temp1 + iYWeight3 * Temp2 + 2 ) >> 2; 592 #else593 pDesSamplesY[iX] = ( iYWeight0 * pSrcSamplesY[iXPic0] + iYWeight1 * pSrcSamplesY[iXPic1] + 2 ) >> 2;594 #endif595 553 } 596 554 } … … 603 561 Int iCRefPosX0 = Int( uiXPos >> 1 ) + ( iDisparity >> 3 ); 604 562 Int iCRefPosX1 = iCRefPosX0 + 1; 605 #if MTK_RELEASE_DV_CONSTRAINT_C0129606 563 Int iCMaxPosY = Int( uiPicHeight >> 1 ) - 1; 607 564 Int iCWeight3 = ( iDisparity_y & 7 ); … … 609 566 Int iCRefPosY0 = Max( 0, Min( iCMaxPosY, Int( uiYPos >> 1 ) + ( iDisparity_y >> 3 )) ); 610 567 Int iCRefPosY1 = Max( 0, Min( iCMaxPosY, iCRefPosY0 + 1 )); 611 #endif612 568 Int iCMaxPosX = Int( uiPicWidth >> 1 ) - 1; 613 569 Int iSrcStrideC = pcBaseRes->getCStride(); 614 570 Int iDesStrideC = pcYuv ->getCStride(); 615 #if MTK_RELEASE_DV_CONSTRAINT_C0129 571 616 572 #if FIX_CHROMA_RESIDUAL_C0129 617 573 Pel* pSrcSamplesU0= pcBaseRes->getCbAddr ( 0 ) + iCRefPosY0 * iSrcStrideC; … … 625 581 Pel* pSrcSamplesV1= pcBaseRes->getCrAddr ( 0 ) + ( iCRefPosY1 >> 1 ) * iSrcStrideC; 626 582 #endif 627 #else628 Pel* pSrcSamplesU= pcBaseRes->getCbAddr ( 0 ) + ( uiYPos >> 1 ) * iSrcStrideC;629 Pel* pSrcSamplesV= pcBaseRes->getCrAddr ( 0 ) + ( uiYPos >> 1 ) * iSrcStrideC;630 #endif631 583 Pel* pDesSamplesU= pcYuv ->getCbAddr (); 632 584 Pel* pDesSamplesV= pcYuv ->getCrAddr (); 633 #if MTK_RELEASE_DV_CONSTRAINT_C0129634 585 for( Int iY = 0; iY < iCHeight; iY++, pSrcSamplesU0 += iSrcStrideC, pSrcSamplesU1 += iSrcStrideC, pDesSamplesU += iDesStrideC, 635 586 pSrcSamplesV0 += iSrcStrideC, pSrcSamplesV1 += iSrcStrideC, pDesSamplesV += iDesStrideC ) 636 #else637 for( Int iY = 0; iY < iCHeight; iY++, pSrcSamplesU += iSrcStrideC, pDesSamplesU += iDesStrideC,638 pSrcSamplesV += iSrcStrideC, pDesSamplesV += iDesStrideC )639 #endif640 587 { 641 588 for( Int iX = 0; iX < iCWidth; iX++ ) … … 643 590 Int iXPic0 = Max( 0, Min( iCMaxPosX, iCRefPosX0 + iX ) ); 644 591 Int iXPic1 = Max( 0, Min( iCMaxPosX, iCRefPosX1 + iX ) ); 645 #if MTK_RELEASE_DV_CONSTRAINT_C0129646 592 Pel Temp1,Temp2; 647 593 Temp1 =( iCWeight0 * pSrcSamplesU0[iXPic0] + iCWeight1 * pSrcSamplesU0[iXPic1] + 4 ) >> 3; … … 651 597 Temp2 =( iCWeight0 * pSrcSamplesV1[iXPic0] + iCWeight1 * pSrcSamplesV1[iXPic1] + 4 ) >> 3; 652 598 pDesSamplesV[iX] = ( iCWeight2 * Temp1 + iCWeight3 * Temp2 + 4 ) >> 3; 653 #else654 pDesSamplesU[iX] = ( iCWeight0 * pSrcSamplesU[iXPic0] + iCWeight1 * pSrcSamplesU[iXPic1] + 4 ) >> 3;655 pDesSamplesV[iX] = ( iCWeight0 * pSrcSamplesV[iXPic0] + iCWeight1 * pSrcSamplesV[iXPic1] + 4 ) >> 3;656 #endif657 599 } 658 600 } -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComResidualGenerator.h
r296 r322 70 70 71 71 #if H3D_NBDV 72 #if MTK_RELEASE_DV_CONSTRAINT_C012973 72 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, TComMv iDisp_x, Bool bRecon ); 74 73 Bool getResidualSamples ( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv , TComMv iDisp_x, Bool bRecon ); 75 #else76 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 #endif79 74 #else // H3D_NBDV 80 75 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Bool bRecon ); … … 90 85 Void xClearResidual ( TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight ); 91 86 #if H3D_NBDV 92 #if MTK_RELEASE_DV_CONSTRAINT_C012993 87 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 #else95 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 #endif97 88 #else 98 89 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, UInt * puiXPosInRefView , UInt * puiYPosInRefView , Bool bRecon ); -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TypeDef.h
r313 r322 117 117 // FIX_LGE_IVMP_PARALLEL_MERGE_B0136 118 118 119 #define QC_NBDV_LDB_FIX_C0055 1 // JCT3V-C0055120 #define MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097 1 // JCT3V-C0141/C0097121 #define MTK_RELEASE_DV_CONSTRAINT_C0129 1 // JCT3V-C0129 122 #define MTK_SIMPLIFY_DVTC_C0135 1 // JCT3V-C0135 119 // QC_NBDV_LDB_FIX_C0055 120 // MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097 121 // MTK_RELEASE_DV_CONSTRAINT_C0129 122 // MTK_SIMPLIFY_DVTC_C0135 123 123 #define FIX_CHROMA_RESIDUAL_C0129 1 124 124 … … 186 186 ///// ***** VSP ********* 187 187 #define MERL_VSP_C0152 1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools 188 // LGE_SIMP_DVP_REFINE_C0112 189 // MERL_MTK_VSP_DVP_REFINE_C0152_C0131 188 190 #if MERL_VSP_C0152 189 191 #define MERL_VSP_C0152_BugFix_ForNoDepthCase 1// MERL bugfix for test condition of no depth … … 205 207 206 208 #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). 209 208 210 209 211 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 210 212 #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 block212 213 #define MTK_DVPREFINE_BVSP_BUG_FIX 1 213 214 214 215 #else // !MERL_VSP_C0152 215 216 #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 refine217 217 #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 block219 218 #endif 220 219 … … 223 222 #if H3D_NBDV 224 223 #define DIS_CANS 1 224 #define MCP_DIS_CANS 1 225 225 #endif 226 226
Note: See TracChangeset for help on using the changeset viewer.