Changeset 876 in 3DVCSoftware for branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 27 Mar 2014, 18:52:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
r872 r876 2463 2463 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2464 2464 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 2465 2466 #if !MTK_ARP_FLAG_CABAC_SIMP_G0061 2467 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2468 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 2469 #endif 2470 return uiCtx; 2471 } 2472 #endif 2473 #if !MTK_IC_FLAG_CABAC_SIMP_G0061 2474 #if H_3D_IC 2475 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) 2476 { 2477 UInt uiCtx = 0; 2478 2479 TComDataCU* pcTempCU = NULL; 2480 UInt uiTempPartIdx = 0; 2481 2482 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2483 uiCtx = ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0; 2484 2485 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2486 uiCtx += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0; 2487 2488 return uiCtx; 2489 } 2490 #endif 2465 return uiCtx; 2466 } 2491 2467 #endif 2492 2468 #if H_3D_DBBP … … 3582 3558 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, 3583 3559 Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ) 3584 { 3585 #if MTK_NBDV_IVREF_FIX_G0067 3560 { 3586 3561 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1) 3587 #else3588 if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )3589 #endif3590 3562 { 3591 3563 return false; … … 3594 3566 Int refViewIdx = pDInfo->m_aVIdxCan; 3595 3567 TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx ); 3596 3568 3597 3569 if( picDepth == NULL ) // No depth reference avail 3598 3570 { … … 3602 3574 3603 3575 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV); 3604 3576 3605 3577 Bool refViewAvailFlag = false; 3606 3578 UChar predFlag[2] = {0, 0}; … … 3609 3581 Int viewIdInRefListX = -1; 3610 3582 #endif 3611 3583 3612 3584 for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ ) 3613 3585 { … … 3645 3617 predFlag[refListIdY] = 1; 3646 3618 TComMv cMv = pDInfo->m_acNBDV; 3647 3619 3648 3620 Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId(); 3649 3621 Int currViewId = m_pcSlice->getViewId(); 3650 3622 3651 3623 //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed): 3652 3624 // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx ); 3653 3625 3654 3626 Int iScale = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX ); 3655 3627 3656 3628 // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX. 3657 3629 if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) … … 4449 4421 if( bMPIFlag) 4450 4422 { 4451 #if QC_SPIVMP_MPI_G01194452 4423 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4453 4424 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); … … 4556 4527 } 4557 4528 #endif 4558 #else 4559 UInt uiPartIdxCenter; 4560 xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter ); 4561 tmpMV[0].setMvField( cZeroMv, NOT_VALID ); 4562 tmpMV[1].setMvField( cZeroMv, NOT_VALID ); 4563 Int tRef[2]={-1, -1}; 4564 4565 #if H_3D_FCO 4566 TComPic * pcTexturePic = m_pcSlice->getTexturePic(); 4567 TComDataCU *pcTextureCU = 0; 4568 if ( pcTexturePic ) 4569 pcTextureCU = pcTexturePic->getCU( getAddr() ); 4570 #else 4571 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 4572 #endif 4573 4574 #if H_3D_FCO 4575 if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 4576 #else 4577 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 4578 #endif 4579 { 4580 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] ); 4581 tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() ); 4582 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4583 { 4584 TComMv cMvPred = tmpMV[0].getMv(); 4585 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4586 cMvPred+=cAdd; 4587 cMvPred>>=2; 4588 clipMv(cMvPred); 4589 tmpMV[0].setMvField(cMvPred,tRef[0]); 4590 } 4591 if ( getSlice()->isInterB() ) 4592 { 4593 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, tmpMV[1] ); 4594 tRef[1] = getPic()->isTextRefValid( REF_PIC_LIST_1, tmpMV[1].getRefIdx() ); 4595 if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) ) 4529 if( tmpDir != 0 ) 4530 { 4531 Int iCnloop = 0; 4532 Bool bRemoveSpa = false; //pruning 4533 4534 for(Int i = 0; i < 2; i ++) 4535 { 4536 iCnloop = iPosLeftAbove[i]; 4537 if ( iCnloop == -1 ) 4596 4538 { 4597 TComMv cMvPred = tmpMV[1].getMv(); 4598 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 4599 cMvPred+=cAdd; 4600 cMvPred>>=2; 4601 clipMv(cMvPred); 4602 tmpMV[1].setMvField(cMvPred,tRef[1]); 4539 continue; 4603 4540 } 4604 } 4605 4606 tmpDir = 0; 4607 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4608 { 4609 tmpDir += ((tmpMV[0].getRefIdx()>=0)?1:0); 4610 } 4611 if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) ) 4612 { 4613 tmpDir += ((tmpMV[1].getRefIdx()>=0)?2:0); 4614 } 4615 #endif 4616 if( tmpDir != 0 ) 4617 { 4618 Int iCnloop = 0; 4619 Bool bRemoveSpa = false; //pruning 4620 4621 for(Int i = 0; i < 2; i ++) 4541 if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1]) 4622 4542 { 4623 iCnloop = iPosLeftAbove[i]; 4624 if ( iCnloop == -1 ) 4543 bRemoveSpa = true; 4544 break; 4545 } 4546 } 4547 4548 if (!bRemoveSpa) 4549 { 4550 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4551 } 4552 else 4553 { 4554 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV); 4555 if (iCnloop<numA1B1B0) 4556 { 4557 numA1B1B0--; 4558 } 4559 iCountHEVC--; 4560 4561 if (iPosLeftAbove[0] != -1) 4562 { 4563 if (iCnloop == iPosLeftAbove[0]) 4625 4564 { 4626 continue;4565 iPosLeftAbove[0] = -1; 4627 4566 } 4628 if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])4567 else 4629 4568 { 4630 bRemoveSpa = true; 4631 break; 4632 } 4569 iPosLeftAbove[0]++; 4570 } 4633 4571 } 4634 4635 if (!bRemoveSpa) 4572 if (iPosLeftAbove[1] != -1) 4636 4573 { 4637 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV); 4638 } 4639 else 4640 { 4641 rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV); 4642 if (iCnloop<numA1B1B0) 4574 if (iCnloop == iPosLeftAbove[1]) 4643 4575 { 4644 numA1B1B0--;4576 iPosLeftAbove[1] = -1; 4645 4577 } 4646 iCountHEVC--; 4647 4648 if (iPosLeftAbove[0] != -1) 4578 else 4649 4579 { 4650 if (iCnloop == iPosLeftAbove[0])4580 if (iCnloop > iPosLeftAbove[1]) 4651 4581 { 4652 iPosLeftAbove[0] = -1; 4653 } 4654 else 4655 { 4656 iPosLeftAbove[0]++; 4657 } 4658 } 4659 if (iPosLeftAbove[1] != -1) 4660 { 4661 if (iCnloop == iPosLeftAbove[1]) 4662 { 4663 iPosLeftAbove[1] = -1; 4664 } 4665 else 4666 { 4667 if (iCnloop > iPosLeftAbove[1]) 4668 { 4669 iPosLeftAbove[1]++; 4670 } 4582 iPosLeftAbove[1]++; 4671 4583 } 4672 4584 } 4673 4585 } 4674 #if QC_SPIVMP_MPI_G0119 4675 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx()); 4676 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx()); 4677 #else 4678 if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) ) 4679 { 4680 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tRef[0]); 4681 } 4682 if ( getSlice()->isInterB()) 4683 { 4684 if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) ) 4685 { 4686 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tRef[1]); 4687 } 4688 } 4689 #endif 4690 puhInterDirNeighbours[iCount] = tmpDir; 4691 4692 if ( mrgCandIdx == iCount ) 4693 { 4694 return; 4695 } 4696 iCount ++; 4697 } 4698 #if !QC_SPIVMP_MPI_G0119 4699 } 4700 #endif 4586 } 4587 pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx()); 4588 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx()); 4589 4590 puhInterDirNeighbours[iCount] = tmpDir; 4591 4592 if ( mrgCandIdx == iCount ) 4593 { 4594 return; 4595 } 4596 iCount ++; 4597 } 4701 4598 } 4702 4599 #if MTK_DDD_G0063 … … 4836 4733 Bool ivMvPredFlag = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() ); 4837 4734 4838 #if MTK_NBDV_IVREF_FIX_G00674839 4735 if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1) 4840 #else4841 if ( ivMvPredFlag )4842 #endif4843 4736 { 4844 4737 getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP ); … … 4848 4741 //////// INTER VIEW MOTION COMP(IvMC) ///////// 4849 4742 /////////////////////////////////////////////// 4850 #if QC_DEPTH_MERGE_SIMP_G01274851 4743 if( getSlice()->getIsDepth() ) 4852 4744 { 4853 4745 ivCandDir[1] = ivCandDir[2] = ivCandDir[3] = 0; 4854 4746 } 4855 #endif 4747 4856 4748 if( ivCandDir[0] ) 4857 4749 { … … 4961 4853 if (bIvMC) 4962 4854 { 4963 #if QC_SPIVMP_MPI_G0119 4964 if(!m_pcSlice->getIsDepth()) 4965 #endif 4966 #if SEC_SPIVMP_MCP_SIZE_G0077 4967 if(getPartitionSize(0) == SIZE_2Nx2N) 4855 if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N ) 4856 { 4968 4857 pbSPIVMPFlag[iCount] = true; 4969 #else 4970 pbSPIVMPFlag[iCount] = true; 4971 #endif 4858 } 4972 4859 #if H_3D_DBBP 4973 4860 pbSPIVMPFlag[iCount] &= !bDBBPFlag; … … 5111 4998 //////// INTER VIEW DISP COMP (IvDC) //////// 5112 4999 ///////////////////////////////////////////// 5113 #if QC_DEPTH_MERGE_SIMP_G01275114 5000 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 5115 #else5116 if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())5117 #endif5118 5001 { 5119 5002 assert(iCount < getSlice()->getMaxNumMergeCand()); … … 5276 5159 //////// SHIFTED IV (IvMCShift + IvDCShift) //////// 5277 5160 //////////////////////////////////////////////////// 5278 #if QC_DEPTH_MERGE_SIMP_G01275279 5161 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 5280 #else5281 if( ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() )5282 #endif5283 5162 { 5284 5163 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) ) … … 6645 6524 #endif 6646 6525 #if H_3D_IV_MERGE 6647 #if SEC_DEPTH_DV_DERIVAITON_G00746648 6526 Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 6649 #else 6650 Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp) 6651 #endif 6652 { 6653 #if SEC_DEPTH_DV_DERIVAITON_G0074 6527 { 6528 6654 6529 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N); 6655 6530 … … 6662 6537 6663 6538 return true; 6664 #else6665 Pel pDepPos[3] = {0, 0, 0};6666 assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);6667 Bool bDepAvail = false;6668 Pel *pDepth = this->getPic()->getPicYuvRec()->getLumaAddr();6669 Int iDepStride = this->getPic()->getPicYuvRec()->getStride();6670 TComMv cMv;6671 6672 Int xP, yP, nPSW, nPSH;6673 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);6674 6675 if(xP != 0 && yP != 0)6676 {6677 pDepPos[0] = pDepth[ (yP-1) * iDepStride + (xP-1) ];6678 bDepAvail = true;6679 }6680 6681 if(xP != 0)6682 {6683 pDepPos[1] = pDepth[ (yP+nPSH-1) * iDepStride + (xP-1) ];6684 bDepAvail = true;6685 }6686 6687 if(yP != 0)6688 {6689 pDepPos[2] = pDepth[ (yP-1) * iDepStride + (xP+nPSW-1) ];6690 bDepAvail = true;6691 }6692 6693 if (bDepAvail)6694 {6695 Pel pAvgDepth = (xP != 0 && yP != 0) ? ((5*pDepPos[0] + 5*pDepPos[1] + 6*pDepPos[2] + 8)>>4) : (xP == 0) ? pDepPos[2] : pDepPos[1];6696 Int iDisp = getSlice()->getDepthToDisparityB( 0 )[ pAvgDepth ];6697 cMv.setHor(iDisp);6698 cMv.setVer(0);6699 pDisp->m_acNBDV = cMv;6700 pDisp->m_aVIdxCan = 0;6701 return true;6702 }6703 else6704 {6705 cMv.setZero();6706 pDisp->m_acNBDV = cMv;6707 pDisp->m_aVIdxCan = 0;6708 return false;6709 }6710 #endif6711 6539 } 6712 6540 #endif … … 6725 6553 // Init disparity struct for results 6726 6554 pDInfo->bDV = false; 6727 #if MTK_NBDV_IVREF_FIX_G00676728 6555 pDInfo->m_aVIdxCan = -1; 6729 #endif 6556 6730 6557 // Init struct for disparities from MCP neighboring blocks 6731 6558 IDVInfo cIDVInfo; … … 7248 7075 { 7249 7076 Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId()); 7250 #if QC_SPIVMP_MPI_G01197251 7077 if( getSlice()->getIsDepth() ) 7252 7078 { 7253 7079 iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size(); 7254 7080 } 7255 #endif 7081 7256 7082 iNumSPInOneLine = iPUWidth/iSubPUSize; 7257 7083 iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine; … … 7310 7136 TComSlice* pcSlice = getSlice (); 7311 7137 Int iViewIndex = pDInfo->m_aVIdxCan; 7312 7138 7313 7139 //--- get base CU/PU and check prediction mode --- 7314 7140 TComPic* pcBasePic = pcSlice->getIvPic( bIsDepth, iViewIndex ); … … 7334 7160 7335 7161 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 7336 7162 7337 7163 Bool abPdmAvailable[8] = {false, false, false, false, false, false, false, false}; 7338 7164 #if H_3D_NBDV … … 7347 7173 //////////sub-PU IvMC/////////// 7348 7174 //////////////////////////////// 7349 #if QC_SPIVMP_MPI_G01197350 7175 if(!m_pcSlice->getIsDepth()) 7351 7176 { 7352 #endif 7353 #if SEC_SPIVMP_MCP_SIZE_G0077 7354 if( getPartitionSize(0) == SIZE_2Nx2N ) 7355 { 7356 #endif 7357 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 7358 getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 7359 7360 for (Int i=0; i<iNumSP; i++) 7361 { 7362 puhInterDirSP[i] = 0; 7363 pcMvFieldSP[2*i].getMv().set(0, 0); 7364 pcMvFieldSP[2*i+1].getMv().set(0,0); 7365 pcMvFieldSP[2*i].setRefIdx(-1); 7366 pcMvFieldSP[2*i+1].setRefIdx(-1); 7367 } 7368 7369 Int iBaseCUAddr; 7370 Int iBaseAbsPartIdx; 7371 TComDataCU* pcBaseCU; 7372 Int iPartition = 0; 7177 if( getPartitionSize(0) == SIZE_2Nx2N ) 7178 { 7179 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 7180 getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 7181 7182 for (Int i=0; i<iNumSP; i++) 7183 { 7184 puhInterDirSP[i] = 0; 7185 pcMvFieldSP[2*i].getMv().set(0, 0); 7186 pcMvFieldSP[2*i+1].getMv().set(0,0); 7187 pcMvFieldSP[2*i].setRefIdx(-1); 7188 pcMvFieldSP[2*i+1].setRefIdx(-1); 7189 } 7190 7191 Int iBaseCUAddr; 7192 Int iBaseAbsPartIdx; 7193 TComDataCU* pcBaseCU; 7194 Int iPartition = 0; 7373 7195 #if !KHU_SIMP_SPIVMP_G0147 7374 Int iInterDirLast = 0;7375 TComMvField cMvFieldLast[2];7376 #endif 7377 7378 Int iDelX = iSPWidth/2;7379 Int iDelY = iSPHeight/2;7196 Int iInterDirLast = 0; 7197 TComMvField cMvFieldLast[2]; 7198 #endif 7199 7200 Int iDelX = iSPWidth/2; 7201 Int iDelY = iSPHeight/2; 7380 7202 7381 7203 #if KHU_SIMP_SPIVMP_G0147 7382 Int iCenterPosX = iCurrPosX + ( ( iWidth / iSPWidth ) >> 1 ) * iSPWidth + ( iSPWidth >> 1 ); 7383 Int iCenterPosY = iCurrPosY + ( ( iHeight / iSPHeight ) >> 1 ) * iSPHeight + (iSPHeight >> 1); 7384 Int iRefCenterCUAddr, iRefCenterAbsPartIdx; 7385 7386 if(iWidth == iSPWidth && iHeight == iSPHeight) 7387 { 7388 iCenterPosX = iCurrPosX + (iWidth >> 1); 7389 iCenterPosY = iCurrPosY + (iHeight >> 1); 7390 } 7391 7392 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 7393 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 7394 7395 pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx ); 7396 TComDataCU* pcDefaultCU = pcBasePic->getCU( iRefCenterCUAddr ); 7397 if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA )) 7398 { 7399 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7400 { 7401 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 7402 Bool stopLoop = false; 7403 for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop) 7404 { 7405 RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 7406 TComMvField cDefaultMvField; 7407 pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField ); 7408 Int iDefaultRefIdx = cDefaultMvField.getRefIdx(); 7409 if (iDefaultRefIdx >= 0) 7410 { 7411 Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx); 7412 if (iDefaultRefPOC != pcSlice->getPOC()) 7413 { 7414 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 7415 { 7416 if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 7417 { 7418 abPdmAvailable[ uiCurrRefListId ] = true; 7419 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 7420 #if H_3D_NBDV 7421 #if H_3D_IV_MERGE 7422 if( !bIsDepth ) 7423 { 7424 #endif 7425 cMv.setIDVFlag (true); 7426 cMv.setIDVHor (cDv.getHor()); 7427 cMv.setIDVVer (cDv.getVer()); 7428 cMv.setIDVVId (iViewIndex); 7429 #if H_3D_IV_MERGE 7430 } 7431 #endif 7432 #endif 7433 clipMv( cMv ); 7434 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 7435 pacPdmMv [ uiCurrRefListId ] = cMv; 7436 stopLoop = true; 7437 break; 7438 } 7439 } 7440 } 7441 } 7442 } 7443 } 7444 } 7445 availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0); 7446 7447 if(availableMcDc[0]) 7448 { 7449 #endif 7450 Int iBasePosX, iBasePosY; 7451 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) 7452 { 7453 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth) 7454 { 7455 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 )); 7456 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 7457 7458 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx ); 7459 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 7460 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 7461 { 7462 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7204 Int iCenterPosX = iCurrPosX + ( ( iWidth / iSPWidth ) >> 1 ) * iSPWidth + ( iSPWidth >> 1 ); 7205 Int iCenterPosY = iCurrPosY + ( ( iHeight / iSPHeight ) >> 1 ) * iSPHeight + (iSPHeight >> 1); 7206 Int iRefCenterCUAddr, iRefCenterAbsPartIdx; 7207 7208 if(iWidth == iSPWidth && iHeight == iSPHeight) 7209 { 7210 iCenterPosX = iCurrPosX + (iWidth >> 1); 7211 iCenterPosY = iCurrPosY + (iHeight >> 1); 7212 } 7213 7214 Int iRefCenterPosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 7215 Int iRefCenterPosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 7216 7217 pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx ); 7218 TComDataCU* pcDefaultCU = pcBasePic->getCU( iRefCenterCUAddr ); 7219 if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA )) 7220 { 7221 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7463 7222 { 7464 7223 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 7465 Bool bLoop_stop = false;7466 for(Int iLoop = 0; iLoop < 2 && ! bLoop_stop; ++iLoop)7224 Bool stopLoop = false; 7225 for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop) 7467 7226 { 7468 RefPicList e BaseRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId );7469 TComMvField c BaseMvField;7470 pc BaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );7471 Int i BaseRefIdx = cBaseMvField.getRefIdx();7472 if (i BaseRefIdx >= 0)7227 RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 7228 TComMvField cDefaultMvField; 7229 pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField ); 7230 Int iDefaultRefIdx = cDefaultMvField.getRefIdx(); 7231 if (iDefaultRefIdx >= 0) 7473 7232 { 7474 Int i BaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);7475 if (i BaseRefPOC != pcSlice->getPOC())7233 Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx); 7234 if (iDefaultRefPOC != pcSlice->getPOC()) 7476 7235 { 7477 7236 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 7478 7237 { 7479 if (i BaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))7238 if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 7480 7239 { 7481 7240 abPdmAvailable[ uiCurrRefListId ] = true; 7482 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 7483 7241 TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer()); 7242 #if H_3D_NBDV 7243 #if H_3D_IV_MERGE 7484 7244 if( !bIsDepth ) 7485 7245 { 7246 #endif 7486 7247 cMv.setIDVFlag (true); 7487 7248 cMv.setIDVHor (cDv.getHor()); 7488 7249 cMv.setIDVVer (cDv.getVer()); 7489 7250 cMv.setIDVVId (iViewIndex); 7251 #if H_3D_IV_MERGE 7490 7252 } 7491 7253 #endif 7254 #endif 7492 7255 clipMv( cMv ); 7493 bLoop_stop = true;7494 7495 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);7256 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 7257 pacPdmMv [ uiCurrRefListId ] = cMv; 7258 stopLoop = true; 7496 7259 break; 7497 7260 } … … 7502 7265 } 7503 7266 } 7504 7505 puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0); 7506 if (puhInterDirSP[iPartition] == 0) 7507 { 7267 availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0); 7268 7269 if(availableMcDc[0]) 7270 { 7271 #endif 7272 Int iBasePosX, iBasePosY; 7273 for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight) 7274 { 7275 for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth) 7276 { 7277 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 )); 7278 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 7279 7280 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx ); 7281 pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 7282 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 7283 { 7284 for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ ) 7285 { 7286 RefPicList eCurrRefPicList = RefPicList( uiCurrRefListId ); 7287 Bool bLoop_stop = false; 7288 for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop) 7289 { 7290 RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 - uiCurrRefListId ) : RefPicList( uiCurrRefListId ); 7291 TComMvField cBaseMvField; 7292 pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField ); 7293 Int iBaseRefIdx = cBaseMvField.getRefIdx(); 7294 if (iBaseRefIdx >= 0) 7295 { 7296 Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx); 7297 if (iBaseRefPOC != pcSlice->getPOC()) 7298 { 7299 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++) 7300 { 7301 if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 7302 { 7303 abPdmAvailable[ uiCurrRefListId ] = true; 7304 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 7305 7306 if( !bIsDepth ) 7307 { 7308 cMv.setIDVFlag (true); 7309 cMv.setIDVHor (cDv.getHor()); 7310 cMv.setIDVVer (cDv.getVer()); 7311 cMv.setIDVVId (iViewIndex); 7312 } 7313 7314 clipMv( cMv ); 7315 bLoop_stop = true; 7316 7317 pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx); 7318 break; 7319 } 7320 } 7321 } 7322 } 7323 } 7324 } 7325 } 7326 7327 puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0); 7328 if (puhInterDirSP[iPartition] == 0) 7329 { 7508 7330 #if KHU_SIMP_SPIVMP_G0147 7509 puhInterDirSP[iPartition] = availableMcDc[0];7510 pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);7511 pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);7331 puhInterDirSP[iPartition] = availableMcDc[0]; 7332 pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]); 7333 pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]); 7512 7334 #else 7513 if (iInterDirLast != 0)7514 {7515 puhInterDirSP[iPartition] = iInterDirLast;7516 pcMvFieldSP[2*iPartition] = cMvFieldLast[0];7517 pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1];7518 }7519 #endif 7520 }7335 if (iInterDirLast != 0) 7336 { 7337 puhInterDirSP[iPartition] = iInterDirLast; 7338 pcMvFieldSP[2*iPartition] = cMvFieldLast[0]; 7339 pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1]; 7340 } 7341 #endif 7342 } 7521 7343 #if !KHU_SIMP_SPIVMP_G0147 7522 else 7523 { 7524 if (iInterDirLast ==0) 7525 { 7526 availableMcDc[0] = puhInterDirSP[iPartition]; 7527 paiPdmRefIdx [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx(); 7528 pacPdmMv [ 0 ] = pcMvFieldSP[2*iPartition].getMv(); 7529 paiPdmRefIdx [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx(); 7530 pacPdmMv [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv(); 7531 7532 if (iPartition != 0) 7533 { 7534 for (Int iPart = iPartition-1; iPart >= 0; iPart--) 7344 else 7535 7345 { 7536 puhInterDirSP[iPart] = puhInterDirSP[iPartition]; 7537 pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition]; 7538 pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1]; 7346 if (iInterDirLast ==0) 7347 { 7348 availableMcDc[0] = puhInterDirSP[iPartition]; 7349 paiPdmRefIdx [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx(); 7350 pacPdmMv [ 0 ] = pcMvFieldSP[2*iPartition].getMv(); 7351 paiPdmRefIdx [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx(); 7352 pacPdmMv [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv(); 7353 7354 if (iPartition != 0) 7355 { 7356 for (Int iPart = iPartition-1; iPart >= 0; iPart--) 7357 { 7358 puhInterDirSP[iPart] = puhInterDirSP[iPartition]; 7359 pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition]; 7360 pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1]; 7361 } 7362 } 7363 } 7364 iInterDirLast = puhInterDirSP[iPartition]; 7365 cMvFieldLast[0] = pcMvFieldSP[2*iPartition]; 7366 cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1]; 7539 7367 } 7368 #endif 7369 iPartition ++; 7370 7540 7371 } 7541 7372 } 7542 iInterDirLast = puhInterDirSP[iPartition];7543 cMvFieldLast[0] = pcMvFieldSP[2*iPartition];7544 cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];7545 }7546 #endif7547 iPartition ++;7548 7549 }7550 }7551 7373 #if KHU_SIMP_SPIVMP_G0147 7552 } 7553 #endif 7554 #if SEC_SPIVMP_MCP_SIZE_G0077 7555 } 7556 #endif 7557 7558 iCurrPosX += ( iWidth >> 1 ); 7559 iCurrPosY += ( iHeight >> 1 ); 7560 #if QC_SPIVMP_MPI_G0119 7561 } 7562 #endif 7374 } 7375 #endif 7376 } 7377 7378 iCurrPosX += ( iWidth >> 1 ); 7379 iCurrPosY += ( iHeight >> 1 ); 7380 } 7563 7381 #endif 7564 7382 … … 7568 7386 7569 7387 #if H_3D_SPIVMP 7570 #if QC_SPIVMP_MPI_G0119 7571 if(m_pcSlice->getIsDepth()) 7572 { 7573 iCurrPosX += ( iWidth >> 1 ); 7574 iCurrPosY += ( iHeight >> 1 ); 7575 } 7576 #if QC_DEPTH_MERGE_SIMP_G0127 7577 #if SEC_SPIVMP_MCP_SIZE_G0077 7388 if(m_pcSlice->getIsDepth()) 7389 { 7390 iCurrPosX += ( iWidth >> 1 ); 7391 iCurrPosY += ( iHeight >> 1 ); 7392 } 7578 7393 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 7579 7394 #else 7580 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++)7581 #endif7582 #else7583 #if SEC_SPIVMP_MCP_SIZE_G00777584 for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < 2; iLoopCan ++)7585 #else7586 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)7587 #endif7588 #endif7589 #else7590 #if SEC_SPIVMP_MCP_SIZE_G00777591 for(Int iLoopCan = (getPartitionSize(uiPartAddr) == SIZE_2Nx2N ? 1 : 0); iLoopCan < 2; iLoopCan ++)7592 #else7593 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)7594 #endif7595 #endif7596 #else7597 7395 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7598 7396 #endif … … 7601 7399 // iLoopCan == 1 --> IvMCShift 7602 7400 7603 #if !H_3D_SPIVMP || QC_SPIVMP_MPI_G01197604 7401 Int iBaseCUAddr; 7605 7402 Int iBaseAbsPartIdx; 7606 #endif7607 7403 7608 7404 Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 ); 7609 7405 Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 ); 7610 7406 7611 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G01197612 iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );7613 iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) );7614 #else7615 7407 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 7616 7408 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 7617 #endif7618 7409 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 7619 7410 7620 #if H_3D_SPIVMP && !QC_SPIVMP_MPI_G01197621 pcBaseCU = pcBasePic->getCU( iBaseCUAddr );7622 #else7623 7411 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 7624 #endif7625 7412 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) 7626 7413 { … … 7676 7463 } 7677 7464 #if H_3D_SPIVMP 7678 #if QC_SPIVMP_MPI_G01197679 #if QC_DEPTH_MERGE_SIMP_G01277680 7465 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 7681 7466 #else 7682 for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++)7683 #endif7684 #else7685 for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)7686 #endif7687 #else7688 7467 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7689 7468 #endif … … 7691 7470 availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0); 7692 7471 } 7693 7694 7472 7473 7695 7474 //////////////////////////////// 7696 7475 /////// IvDC + IvDCShift /////// 7697 7476 //////////////////////////////// 7698 #if QC_DEPTH_MERGE_SIMP_G0127 7477 7699 7478 if( !getSlice()->getIsDepth() ) 7700 7479 { 7701 #endif 7702 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 7703 { 7704 RefPicList eRefPicListDMV = RefPicList( iRefListId ); 7705 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListDMV ); 7706 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 7707 { 7708 if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan)) 7709 { 7710 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7480 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 7481 { 7482 RefPicList eRefPicListDMV = RefPicList( iRefListId ); 7483 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicListDMV ); 7484 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 7485 { 7486 if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan)) 7711 7487 { 7712 Int ioffsetDV = (iLoopCan == 0) ? 0 : 4; 7713 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 7714 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 7488 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7489 { 7490 Int ioffsetDV = (iLoopCan == 0) ? 0 : 4; 7491 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 7492 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 7715 7493 #if H_3D_NBDV_REF 7716 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;7717 #endif 7718 cMv.setHor( cMv.getHor() + ioffsetDV );7494 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 7495 #endif 7496 cMv.setHor( cMv.getHor() + ioffsetDV ); 7719 7497 #if H_3D_IV_MERGE 7720 if( bIsDepth ) 7721 cMv.setHor((cMv.getHor()+2)>>2); 7722 #endif 7723 cMv.setVer( 0 ); 7724 clipMv( cMv ); 7725 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; 7498 if( bIsDepth ) 7499 { 7500 cMv.setHor((cMv.getHor()+2)>>2); 7501 } 7502 #endif 7503 cMv.setVer( 0 ); 7504 clipMv( cMv ); 7505 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; 7506 } 7507 break; 7726 7508 } 7727 break; 7728 } 7729 } 7730 } 7731 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7732 { 7733 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 7734 } 7735 #if QC_DEPTH_MERGE_SIMP_G0127 7736 } 7737 #endif 7509 } 7510 } 7511 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 7512 { 7513 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 7514 } 7515 } 7738 7516 return false; 7739 7517 }
Note: See TracChangeset for help on using the changeset viewer.