Changeset 587 in 3DVCSoftware
- Timestamp:
- 22 Aug 2013, 01:41:37 (11 years ago)
- Location:
- branches/HTM-DEV-2.0-dev1-QC-INTRA-MTK
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-2.0-dev1-QC-INTRA-MTK/source/Lib/TLibCommon/TComDataCU.cpp
r576 r587 3085 3085 3086 3086 #endif 3087 3088 #if QC_INRIA_MTK_MRG_E0126 3089 inline Bool TComDataCU::xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iPdmDir, TComMv* acPdmMv, 3090 Int* aiPdmRefIdx, Int iPosDmv, Int* vspFlag ) 3091 { 3092 for(Int iLoop = 0; iLoop < 2; iLoop ++ ) 3093 { 3094 if( iLoop == 1 ) 3095 { 3096 Int iFirDispCand = -1; 3097 if (xFirstDmvAvai(iCount, pcMvFieldNeighbours, iPdmDir, iPosDmv, vspFlag, iFirDispCand)) 3098 { 3099 TComMv cMv; 3100 cMv = pcMvFieldNeighbours[(iFirDispCand<<1)].getMv(); 3101 cMv.setHor(cMv.getHor()+4); 3102 if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps())) 3103 { 3104 cMv.setVer(0); 3105 } 3106 clipMv( cMv ); 3107 abCandIsInter[ iCount ] = true; 3108 puhInterDirNeighbours[ iCount ] = puhInterDirNeighbours[iFirDispCand]; 3109 pcMvFieldNeighbours[ iCount<<1 ].setMvField(cMv, pcMvFieldNeighbours[( iFirDispCand << 1)].getRefIdx() ); 3110 pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField(pcMvFieldNeighbours[(iFirDispCand << 1) + 1].getMv(), pcMvFieldNeighbours[( iFirDispCand << 1) + 1].getRefIdx() ); 3111 if( mrgCandIdx == iCount ) 3112 { 3113 return true; 3114 } 3115 iCount++; 3116 break; 3117 } 3118 } 3119 if(iPdmDir[iLoop + 2]) 3120 { 3121 abCandIsInter[ iCount ] = true; 3122 puhInterDirNeighbours[ iCount ] = iPdmDir[iLoop + 2]; 3123 if( ( iPdmDir[iLoop + 2] & 1 ) == 1 ) 3124 { 3125 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ (iLoop<<1) + 4 ], aiPdmRefIdx[ (iLoop<<1) + 4 ] ); 3126 } 3127 if( ( iPdmDir[iLoop + 2] & 2 ) == 2 ) 3128 { 3129 pcMvFieldNeighbours[ (iCount<<1)+1 ].setMvField( acPdmMv[ (iLoop<<1) + 5 ], aiPdmRefIdx[ (iLoop<<1) + 5 ] ); 3130 } 3131 3132 bool bRemove = false; 3133 if(!iLoop && iPdmDir[0] > 0) 3134 { 3135 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[0] && pcMvFieldNeighbours[0]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3136 { 3137 bRemove = true; 3138 abCandIsInter [ iCount ] = false; 3139 puhInterDirNeighbours[iCount] = 0; 3140 TComMv cZeroMv; 3141 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 3142 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 3143 } 3144 } 3145 if(!bRemove) 3146 { 3147 #if H_3D_NBDV 3148 if(iLoop) 3149 { 3150 pcMvFieldNeighbours[iCount<<1 ].getMv().setIDVFlag (false); 3151 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 3152 } 3153 #endif 3154 if( mrgCandIdx == iCount ) 3155 { 3156 return true; 3157 } 3158 iCount++; 3159 } 3160 break; 3161 } 3162 } 3163 return false; 3164 } 3165 3166 inline Bool TComDataCU::xFirstDmvAvai( Int& iCount, TComMvField* pcMvFieldNeighbours, Int* iPdmDir, Int iPosDmv, Int* vspFlag, Int& iFirDispCand ) 3167 { 3168 for ( Int i = (iPdmDir[0] ? 1: 0); i < iCount; i++ ) 3169 { 3170 if ( ( i == iPosDmv ) || ( vspFlag[ i ] == 1 ) ) 3171 { 3172 continue; 3173 } 3174 else if((pcMvFieldNeighbours[i<<1].getRefIdx()!=-1) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), pcMvFieldNeighbours[i<<1].getRefIdx())->getViewIndex())) 3175 { 3176 iFirDispCand = i; 3177 return true; 3178 } 3179 } 3180 return false; 3181 } 3182 3183 #endif 3087 3184 /** Constructs a list of merging candidates 3088 3185 * \param uiAbsPartIdx … … 3136 3233 3137 3234 //===== add merge with predicted depth maps ===== 3235 #if QC_INRIA_MTK_MRG_E0126 3236 TComMv acPdmMv [8]; 3237 Int aiPdmRefIdx [8] = {-1, -1, -1, -1, -1, -1, -1, -1}; 3238 Int iPosDmv = -1; 3239 #else 3138 3240 TComMv acPdmMv [4]; 3139 3241 Int aiPdmRefIdx [4] = {-1, -1, -1, -1}; 3242 #endif 3140 3243 Bool bLeftAvai = false; 3141 3244 Int iPosLeftAbove[2] = {-1, -1}; … … 3247 3350 } 3248 3351 3352 #if QC_INRIA_MTK_MRG_E0126 3353 Int iPdmDir[4] = {0, 0, 0, 0}; 3354 #else 3249 3355 Int iPdmDir[2] = {0, 0}; 3356 #endif 3250 3357 3251 3358 if ( ivMvPredFlag ) … … 3517 3624 pcMvFieldNeighbours[(iCount<<1)+1].getMv().setIDVFlag (false); 3518 3625 #endif 3626 #if QC_INRIA_MTK_MRG_E0126 3627 iPosDmv = iCount; 3628 #endif 3519 3629 if ( mrgCandIdx == iCount ) 3520 3630 return; … … 3634 3744 return; 3635 3745 } 3746 #if QC_INRIA_MTK_MRG_E0126 3747 if( ivMvPredFlag ) 3748 { 3749 if(xAddIvMRGCand( mrgCandIdx, iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, iPdmDir, acPdmMv, aiPdmRefIdx, iPosDmv, vspFlag)) 3750 { 3751 return; 3752 } 3753 //early termination 3754 if (iCount == getSlice()->getMaxNumMergeCand()) 3755 { 3756 return; 3757 } 3758 } 3759 #endif 3636 3760 if ( getSlice()->getEnableTMVPFlag()) 3637 3761 { … … 5513 5637 TComMv cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 5514 5638 5639 #if !QC_INRIA_MTK_MRG_E0126 5515 5640 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) ); 5516 5641 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 )); … … 5521 5646 5522 5647 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 5523 5648 #endif 5649 #if QC_INRIA_MTK_MRG_E0126 5650 Bool abPdmAvailable[8] = {false, false, false, false, false, false, false, false}; 5651 #else 5524 5652 Bool abPdmAvailable[4] = {false, false, false, false}; 5653 #endif 5525 5654 #if H_3D_NBDV 5655 #if QC_INRIA_MTK_MRG_E0126 5656 for( Int i = 0; i < 8; i++) 5657 #else 5526 5658 for( Int i = 0; i < 4; i++) 5659 #endif 5527 5660 { 5528 5661 pacPdmMv[i].setIDVFlag (false); 5529 5662 } 5663 #endif 5664 #if QC_INRIA_MTK_MRG_E0126 5665 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5666 { 5667 Int iBaseCUAddr; 5668 Int iBaseAbsPartIdx; 5669 5670 Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth/2)*4) + 4 ); 5671 Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 ); 5672 5673 Int iBasePosX = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) ); 5674 Int iBasePosY = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 5675 pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx ); 5676 5677 TComDataCU* pcBaseCU = pcBasePic->getCU( iBaseCUAddr ); 5530 5678 #endif 5531 5679 if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA )) … … 5551 5699 if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx)) 5552 5700 { 5701 #if QC_INRIA_MTK_MRG_E0126 5702 abPdmAvailable[ (uiCurrRefListId + (iLoopCan<<2)) ] = true; 5703 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 5704 #if H_3D_NBDV 5705 cMv.setIDVFlag (true); 5706 cMv.setIDVHor (cDv.getHor()); 5707 cMv.setIDVVer (cDv.getVer()); 5708 #if MTK_DVMCP_FIX_E0172 5709 cMv.setIDVVId (iViewIndex); 5710 #endif 5711 #endif 5712 clipMv( cMv ); 5713 paiPdmRefIdx [ (uiCurrRefListId + (iLoopCan<<2)) ] = iPdmRefIdx; 5714 pacPdmMv [ (uiCurrRefListId + (iLoopCan<<2)) ] = cMv; 5715 #else 5553 5716 abPdmAvailable[ uiCurrRefListId ] = true; 5554 5717 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); … … 5564 5727 paiPdmRefIdx [ uiCurrRefListId ] = iPdmRefIdx; 5565 5728 pacPdmMv [ uiCurrRefListId ] = cMv; 5729 #endif 5566 5730 stopLoop = true; 5567 5731 break; … … 5573 5737 } 5574 5738 } 5739 #if QC_INRIA_MTK_MRG_E0126 5740 } 5741 #endif 5742 #if QC_INRIA_MTK_MRG_E0126 5743 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5744 { 5745 availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0); 5746 } 5747 #else 5575 5748 availableMcDc[0] = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 5749 #endif 5576 5750 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 5577 5751 { … … 5586 5760 #endif 5587 5761 { 5762 #if QC_INRIA_MTK_MRG_E0126 5763 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5764 { 5765 Int ioffsetDV = (iLoopCan == 0) ? 0 : 4; 5766 abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true; 5767 paiPdmRefIdx [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx; 5768 #if H_3D_NBDV_REF 5769 TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 5770 #endif 5771 cMv.setHor( cMv.getHor() + ioffsetDV ); 5772 cMv.setVer( 0 ); 5773 clipMv( cMv ); 5774 pacPdmMv [iRefListId + 2 + (iLoopCan<<2)] = cMv; 5775 } 5776 break; 5777 #else 5588 5778 abPdmAvailable[ iRefListId+2 ] = true; 5589 5779 paiPdmRefIdx [ iRefListId+2 ] = iPdmRefIdx; … … 5596 5786 pacPdmMv [ iRefListId + 2] = cMv; 5597 5787 break; 5598 } 5599 } 5600 } 5788 #endif 5789 } 5790 } 5791 } 5792 #if QC_INRIA_MTK_MRG_E0126 5793 for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++) 5794 { 5795 availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 ); 5796 } 5797 #else 5601 5798 availableMcDc[1] = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ); 5799 #endif 5602 5800 return false; 5603 5801 } -
branches/HTM-DEV-2.0-dev1-QC-INTRA-MTK/source/Lib/TLibCommon/TComDataCU.h
r566 r587 257 257 #endif 258 258 #endif 259 #if QC_INRIA_MTK_MRG_E0126 260 Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iPdmDir, TComMv* acPdmMv, 261 Int* aiPdmRefIdx, Int iPosDmv, Int* vspFlag ); 262 Bool xFirstDmvAvai( Int& iCount, TComMvField* pcMvFieldNeighbours, Int* iPdmDir, Int iPosDmv, Int* vspFlag, Int& iFirDispCand ); 263 #endif 259 264 260 265 Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); -
branches/HTM-DEV-2.0-dev1-QC-INTRA-MTK/source/Lib/TLibCommon/TComSlice.cpp
r542 r587 1510 1510 } 1511 1511 #endif 1512 #if H_3D_TMVP 1512 1513 m_ivMvScalingFlag = true; 1514 #endif 1513 1515 #endif 1514 1516 -
branches/HTM-DEV-2.0-dev1-QC-INTRA-MTK/source/Lib/TLibCommon/TypeDef.h
r581 r587 175 175 #define DVFROM_ABOVELEFT 4 176 176 #define IDV_CANDS 5 177 #endif 178 //// **** Inter-view motion prediction for merge ********* 179 #if H_3D_IV_MERGE 180 #define QC_INRIA_MTK_MRG_E0126 1 // additional merge candidates JCT3V-E0126 177 181 #endif 178 182 ///// ***** ADVANCED INTERVIEW RESIDUAL PREDICTION *********
Note: See TracChangeset for help on using the changeset viewer.