Changeset 231 in 3DVCSoftware for branches/HTM-5.1-dev3-MERL/source/Lib
- Timestamp:
- 26 Jan 2013, 19:36:53 (12 years ago)
- Location:
- branches/HTM-5.1-dev3-MERL/source/Lib
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev3-MERL/source/Lib/TAppCommon/TAppComCamPara.cpp
r106 r231 89 89 } 90 90 91 92 91 Void 93 92 TAppComCamPara::xCreate2dArray( UInt uiNum1Ids, UInt uiNum2Ids, Int**& raaiArray ) … … 928 927 } 929 928 930 931 929 Void 932 930 TAppComCamPara::xSetShiftParametersAndLUT( UInt uiFrame ) -
branches/HTM-5.1-dev3-MERL/source/Lib/TAppCommon/TAppComCamPara.h
r102 r231 107 107 Int**** m_aiSynthViewShiftLUT; ///< Disparity LUT 108 108 109 110 109 protected: 111 110 // create and delete arrays … … 143 142 Void xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Bool bExternalReference, Double****& radLUT, Int****& raiLUT, Double***& radShiftParams, Int64***& raiShiftParams ); 144 143 Void xSetShiftParametersAndLUT ( UInt uiFrame ); 145 146 144 147 145 // getting conversion parameters for disparity to virtual depth conversion -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComDataCU.cpp
r210 r231 51 51 #endif 52 52 53 #if MERL_VSP_C0152 54 55 #define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && !( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] ) 56 57 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) 58 { 59 Int vspIdx = (Int) pcCURef->getVSPIndex(uiIdx); 60 if( vspIdx != 0 ) 61 { 62 Int idx = vspIdx - 1; 63 bVspMvZeroDone[idx] = true; 64 iVSPIndexTrue [idx] = iCount; 65 66 // no need to reset Inter Dir 67 68 // set MV using checked disparity 69 if (vspIdx < 4) 70 { 71 pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCand[0], NOT_VALID ); 72 if ( pcCURef->getSlice()->isInterB() ) 73 { 74 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCand[0], NOT_VALID ); 75 } 76 } 77 } 78 } 79 80 inline Bool TComDataCU::xAddVspMergeCand( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 81 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDInfo ) 82 { 83 if( ucVspMergePos == VSP_MERGE_POS ) 84 { 85 Int idx = vspIdx - 1; 86 { 87 if( getSlice()->getSPS()->getViewId() != 0 && bVspMvZeroDone[idx] == false ) 88 { 89 { 90 abCandIsInter [iCount] = true; 91 bVspMvZeroDone[idx] = true; 92 93 // get Inter Dir 94 Int iInterDir = ((getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 && getSlice()->getNumRefIdx(REF_PIC_LIST_1) > 0) ? 3 : 95 (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2)); 96 puhInterDirNeighbours[iCount] = iInterDir; // The direction information does not matter 97 // get Mv using checked disparity vector 98 if (vspIdx < 4) // spatial 99 { 100 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID ); 101 if ( getSlice()->isInterB() ) 102 { 103 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], NOT_VALID ); 104 } 105 } 106 iVSPIndexTrue[idx] = iCount; 107 #if SIMP_MRG_PRUN 108 if ( mrgCandIdx == iCount ) 109 { 110 return false; 111 } 112 #endif 113 iCount ++; 114 } 115 } 116 } 117 } 118 return true; 119 } 120 #endif 121 53 122 // ==================================================================================================================== 54 123 // Constructor / destructor / create / destroy … … 79 148 #endif 80 149 m_puhMergeIndex = NULL; 150 #if MERL_VSP_C0152 151 m_piVSPIndex = NULL; 152 #endif 81 153 m_puhLumaIntraDir = NULL; 82 154 m_puhChromaIntraDir = NULL; … … 213 285 #endif 214 286 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 287 #if MERL_VSP_C0152 288 m_piVSPIndex = (Char* )xMalloc(Char, uiNumPartition); 289 #endif 215 290 #if HHI_INTER_VIEW_RESIDUAL_PRED 216 291 m_pbResPredAvailable = (Bool* )xMalloc(Bool, uiNumPartition); … … 364 439 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 365 440 #endif 441 #if MERL_VSP_C0152 442 if ( m_piVSPIndex ) { xFree(m_piVSPIndex); m_piVSPIndex = NULL; } 443 #endif 366 444 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } 367 445 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 558 636 #endif 559 637 m_puhMergeIndex[ui]=pcFrom->m_puhMergeIndex[ui]; 638 #if MERL_VSP_C0152 639 m_piVSPIndex[ui] = pcFrom->m_piVSPIndex[ui]; 640 #endif 560 641 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; 561 642 m_puhChromaIntraDir[ui]=pcFrom->m_puhChromaIntraDir[ui]; … … 598 679 #endif 599 680 memset( m_puhMergeIndex + firstElement, 0, numElements * sizeof( *m_puhMergeIndex ) ); 681 #if MERL_VSP_C0152 682 memset( m_piVSPIndex + firstElement, 0, numElements * sizeof( *m_piVSPIndex ) ); 683 #endif 600 684 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); 601 685 memset( m_puhChromaIntraDir + firstElement, 0, numElements * sizeof( *m_puhChromaIntraDir ) ); … … 781 865 #endif 782 866 m_puhMergeIndex[ui] = 0; 867 #if MERL_VSP_C0152 868 m_piVSPIndex[ui] = 0; 869 #endif 783 870 #if HHI_INTER_VIEW_RESIDUAL_PRED 784 871 m_pbResPredAvailable[ui] = 0; … … 876 963 Int iSizeInUchar = sizeof( UChar ) * m_uiNumPartition; 877 964 Int iSizeInBool = sizeof( Bool ) * m_uiNumPartition; 965 #if MERL_VSP_C0152 966 Int iSizeInChar = sizeof( Char ) * m_uiNumPartition; 967 #endif 878 968 879 969 #if H0736_AVC_STYLE_QP_RANGE … … 893 983 #endif 894 984 memset( m_puhMergeIndex, 0, iSizeInUchar ); 985 #if MERL_VSP_C0152 986 memset( m_piVSPIndex, 0, iSizeInChar ); 987 #endif 895 988 #if HHI_INTER_VIEW_RESIDUAL_PRED 896 989 memset( m_pbResPredAvailable, 0, iSizeInBool ); … … 973 1066 #endif 974 1067 m_puhMergeIndex[ui]=pcCU->m_puhMergeIndex[uiPartOffset+ui]; 1068 #if MERL_VSP_C0152 1069 m_piVSPIndex[ui]=pcCU->m_piVSPIndex[uiPartOffset+ui]; 1070 #endif 975 1071 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; 976 1072 m_puhChromaIntraDir[ui]=pcCU->m_puhChromaIntraDir[uiPartOffset+ui]; … … 1117 1213 #endif 1118 1214 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 1215 #if MERL_VSP_C0152 1216 m_piVSPIndex = pcCU->getVSPIndex() + uiPart; 1217 #endif 1119 1218 #if HHI_INTER_VIEW_RESIDUAL_PRED 1120 1219 m_pbResPredAvailable = pcCU->getResPredAvail() + uiPart; … … 1227 1326 m_uiCUAddr = pcCU->getAddr(); 1228 1327 m_uiAbsIdxInLCU = uiAbsPartIdx; 1229 1328 1230 1329 Int iRastPartIdx = g_auiZscanToRaster[uiAbsPartIdx]; 1231 1330 m_uiCUPelX = pcCU->getCUPelX() + m_pcPic->getMinCUWidth ()*( iRastPartIdx % m_pcPic->getNumPartInWidth() ); … … 1257 1356 #endif 1258 1357 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1358 #if MERL_VSP_C0152 1359 m_piVSPIndex = pcCU->getVSPIndex() + uiAbsPartIdx; 1360 #endif 1259 1361 #if HHI_INTER_VIEW_RESIDUAL_PRED 1260 1362 m_pbResPredAvailable = pcCU->getResPredAvail() + uiAbsPartIdx; … … 1288 1390 Int iSizeInUchar = sizeof( UChar ) * uiNumPartition; 1289 1391 Int iSizeInBool = sizeof( Bool ) * uiNumPartition; 1392 #if MERL_VSP_C0152 1393 Int iSizeInChar = sizeof( Char ) * uiNumPartition; 1394 #endif 1290 1395 1291 1396 #if H0736_AVC_STYLE_QP_RANGE … … 1306 1411 #endif 1307 1412 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 1413 #if MERL_VSP_C0152 1414 memcpy( m_piVSPIndex + uiOffset, pcCU->getVSPIndex(), iSizeInChar ); 1415 #endif 1308 1416 #if HHI_INTER_VIEW_RESIDUAL_PRED 1309 1417 memcpy( m_pbResPredAvailable + uiOffset, pcCU->getResPredAvail(), iSizeInBool ); … … 1419 1527 Int iSizeInUchar = sizeof( UChar ) * m_uiNumPartition; 1420 1528 Int iSizeInBool = sizeof( Bool ) * m_uiNumPartition; 1529 #if MERL_VSP_C0152 1530 Int iSizeInChar = sizeof( Char ) * m_uiNumPartition; 1531 #endif 1421 1532 1422 1533 #if H0736_AVC_STYLE_QP_RANGE … … 1440 1551 #endif 1441 1552 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 1553 #if MERL_VSP_C0152 1554 memcpy( rpcCU->getVSPIndex() + m_uiAbsIdxInLCU, m_piVSPIndex, iSizeInChar ); 1555 #endif 1442 1556 #if HHI_INTER_VIEW_RESIDUAL_PRED 1443 1557 memcpy( rpcCU->getResPredAvail() + m_uiAbsIdxInLCU, m_pbResPredAvailable, iSizeInBool ); … … 1547 1661 Int iSizeInUchar = sizeof( UChar ) * uiQNumPart; 1548 1662 Int iSizeInBool = sizeof( Bool ) * uiQNumPart; 1663 #if MERL_VSP_C0152 1664 Int iSizeInChar = sizeof( Char ) * uiQNumPart; 1665 #endif 1549 1666 1550 1667 #if H0736_AVC_STYLE_QP_RANGE … … 1566 1683 #endif 1567 1684 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1685 #if MERL_VSP_C0152 1686 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 1687 #endif 1568 1688 #if HHI_INTER_VIEW_RESIDUAL_PRED 1569 1689 memcpy( rpcCU->getResPredAvail() + uiPartOffset, m_pbResPredAvailable, iSizeInBool ); … … 3033 3153 } 3034 3154 3155 #if MERL_VSP_C0152 3156 Void TComDataCU::setVSPIndexSubParts ( Char iVSPIdx, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3157 { 3158 setSubPart<Char>( iVSPIdx, m_piVSPIndex, uiAbsPartIdx, uiDepth, uiPartIdx ); 3159 } 3160 #endif 3161 3035 3162 #if HHI_INTER_VIEW_RESIDUAL_PRED 3036 3163 Void TComDataCU::setResPredAvailSubParts( Bool bResPredAvailable, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) … … 3084 3211 3085 3212 if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3086 {3087 3213 return true; 3088 }3089 3214 } 3090 3215 } … … 3618 3743 */ 3619 3744 #if SIMP_MRG_PRUN 3745 #if MERL_VSP_C0152 3746 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx ) 3747 #else 3620 3748 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3749 #endif 3621 3750 #else 3622 3751 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand ) … … 3645 3774 #endif 3646 3775 3776 #if MERL_VSP_C0152 3777 Bool bVspMvZeroDone[3] = {false, false, false}; 3778 #endif 3779 3647 3780 Int iCount = 0; 3648 3781 … … 3687 3820 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo 3688 3821 #if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047 3689 , 3690 true 3822 , true 3823 #endif 3824 #if MERL_VSP_C0152 3825 , true 3691 3826 #endif 3692 3827 ); … … 3714 3849 Int iPdmInterDir = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv ); 3715 3850 #endif 3851 3716 3852 #if QC_MRG_CANS_B0048 3717 3853 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 ) … … 3785 3921 } 3786 3922 #endif 3923 3924 #if MERL_VSP_COMPENSATION_C0152 3925 //===== vsp 0 ===== 3926 if( iCount < 4 + extraMergeCand ) 3927 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 3928 return; 3929 #endif 3930 3787 3931 //left 3788 3932 UInt uiLeftPartIdx = 0; … … 3805 3949 if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N))) 3806 3950 { 3807 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) ) 3951 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 3952 #if MERL_VSP_C0152 3953 CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1) 3954 #endif 3955 ) 3808 3956 { 3809 3957 abCandIsInter[iCount] = true; … … 3852 4000 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3853 4001 #endif 4002 #if MERL_VSP_C0152 4003 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4004 #endif 3854 4005 #if SIMP_MRG_PRUN 3855 4006 if ( mrgCandIdx == iCount ) … … 3902 4053 iCount ++; 3903 4054 } 4055 #endif 4056 4057 #if MERL_VSP_COMPENSATION_C0152 4058 //===== vsp 1 ===== 4059 if( iCount < 4 + extraMergeCand ) 4060 if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4061 return; 3904 4062 #endif 3905 4063 … … 3928 4086 #if SIMP_MRG_PRUN 3929 4087 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 4088 #if MERL_VSP_C0152 4089 CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1) 4090 #endif 3930 4091 && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD)) 3931 4092 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) … … 3978 4139 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3979 4140 #endif 4141 #if MERL_VSP_C0152 4142 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4143 #endif 3980 4144 #if SIMP_MRG_PRUN 3981 4145 if ( mrgCandIdx == iCount ) … … 4030 4194 iCount ++; 4031 4195 } 4196 #endif 4197 4198 #if MERL_VSP_COMPENSATION_C0152 4199 //===== vsp 2 ===== 4200 if( iCount < 4 + extraMergeCand ) 4201 if ( !xAddVspMergeCand(2, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4202 return; 4032 4203 #endif 4033 4204 … … 4050 4221 #endif 4051 4222 #if SIMP_MRG_PRUN 4052 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4223 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) 4224 #if MERL_VSP_C0152 4225 CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx, 1) 4226 #endif 4227 && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4053 4228 #else 4054 4229 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) ) … … 4074 4249 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4075 4250 #endif 4251 #if MERL_VSP_C0152 4252 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4253 #endif 4076 4254 #if SIMP_MRG_PRUN 4077 4255 if ( mrgCandIdx == iCount ) … … 4128 4306 { 4129 4307 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 4130 Bool bRemoveSpa = false; //pruni gnto A1, B14308 Bool bRemoveSpa = false; //pruning to A1, B1 4131 4309 abCandIsInter [ iCount ] = true; 4132 4310 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; … … 4173 4351 } 4174 4352 #endif 4353 #if MERL_VSP_COMPENSATION_C0152 4354 //===== vsp 3 ===== 4355 if( iCount < 4 + extraMergeCand ) 4356 if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4357 return; 4358 #endif 4359 4360 #if MERL_VSP_C0152 4361 #if VSP_MERGE_POS < 4 4362 #if HHI_INTER_VIEW_MOTION_PRED 4363 if( iCount < 4 + extraMergeCand ) 4364 #else 4365 if( iCount < 4 ) 4366 #endif 4367 { 4368 #endif 4369 #endif 4370 4175 4371 //left bottom 4176 4372 UInt uiLeftBottomPartIdx = 0; … … 4191 4387 #endif 4192 4388 #if SIMP_MRG_PRUN 4193 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4389 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) 4390 #if MERL_VSP_C0152 4391 CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx, 1) 4392 #endif 4393 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4194 4394 #else 4195 4395 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ) … … 4215 4415 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4216 4416 #endif 4417 #if MERL_VSP_C0152 4418 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4419 #endif 4217 4420 #if SIMP_MRG_PRUN 4218 4421 if ( mrgCandIdx == iCount ) … … 4223 4426 iCount ++; 4224 4427 } 4225 4428 #if MERL_VSP_C0152 4429 #if VSP_MERGE_POS < 4 4430 } 4431 #endif 4432 #endif 4433 4226 4434 #if HHI_INTER_VIEW_MOTION_PRED 4227 4435 #if QC_MRG_CANS_B0048 … … 4263 4471 #endif 4264 4472 4265 // above left 4473 #if MERL_VSP_COMPENSATION_C0152 4474 //===== vsp 4 ===== 4475 if( iCount < 4 + extraMergeCand ) 4476 if ( !xAddVspMergeCand(4, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4477 return; 4478 #endif 4479 4480 // above left 4266 4481 #if HHI_INTER_VIEW_MOTION_PRED 4267 4482 if( iCount < 4 + extraMergeCand ) … … 4288 4503 #if SIMP_MRG_PRUN 4289 4504 if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) 4505 #if MERL_VSP_C0152 4506 CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx, 1) 4507 #endif 4290 4508 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4291 4509 && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) … … 4314 4532 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4315 4533 #endif 4534 #if MERL_VSP_C0152 4535 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4536 #endif 4316 4537 #if SIMP_MRG_PRUN 4317 4538 if ( mrgCandIdx == iCount ) … … 4323 4544 } 4324 4545 } 4546 4547 #if MERL_VSP_COMPENSATION_C0152 4548 //===== vsp 5 ===== 4549 if( iCount < 4 + extraMergeCand ) 4550 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4551 return; 4552 #endif 4325 4553 4326 4554 if ( getSlice()->getPPS()->getEnableTMVPFlag() … … 4356 4584 Int uiLCUIdx = getAddr(); 4357 4585 PartSize eCUMode = getPartitionSize( 0 ); 4586 4587 #if MERL_VSP_C0152 // Potential bug, not related to BW_VSP 4588 if (eCUMode==SIZE_NxN) 4589 { 4590 printf("Size NxN ???"); 4591 assert(0); 4592 } 4593 #endif 4358 4594 4359 4595 deriveRightBottomIdx( eCUMode, uiPUIdx, uiPartIdxRB ); … … 4598 4834 { 4599 4835 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 4600 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 4836 #if MERL_VSP_C0152 4837 Bool bValid = true; 4838 if (pcMvFieldNeighbours[i<<1].getRefIdx() < 0 || pcMvFieldNeighbours[(j<<1)+1].getRefIdx() < 0) // NOT_VALID 4839 bValid = false; 4840 #endif 4841 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2) 4842 #if MERL_VSP_C0152 4843 && bValid 4844 #endif 4845 ) 4601 4846 { 4602 4847 abCandIsInter[uiArrayAddr] = true; … … 4770 5015 if( uiIter == 0 ) 4771 5016 { 4772 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 5017 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 5018 #if MERL_VSP_C0152 5019 && !pcCorner->getVSPIndex( uiCornerPUIdx ) 5020 #endif 5021 ) 4773 5022 { 4774 5023 rbValidCand = true; … … 4805 5054 else 4806 5055 { 4807 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 5056 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 5057 #if MERL_VSP_C0152 5058 && !pcCorner->getVSPIndex( uiCornerPUIdx ) 5059 #endif 5060 ) 4808 5061 { 4809 5062 rbValidCand = true; … … 4954 5207 #endif 4955 5208 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5209 #if MERL_VSP_C0152 5210 if(! pcTmpCU->getVSPIndex(uiIdx)) 5211 #endif 4956 5212 { 4957 5213 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4980 5236 4981 5237 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5238 #if MERL_VSP_C0152 5239 if(! pcTmpCU->getVSPIndex(uiIdx)) 5240 #endif 4982 5241 { 4983 5242 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5006 5265 #endif 5007 5266 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5267 #if MERL_VSP_C0152 5268 if(! pcTmpCU->getVSPIndex(uiIdx)) 5269 #endif 5008 5270 { 5009 5271 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5031 5293 #endif 5032 5294 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5295 #if MERL_VSP_C0152 5296 if(! pcTmpCU->getVSPIndex(uiIdx)) 5297 #endif 5033 5298 { 5034 5299 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5059 5324 #endif 5060 5325 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5326 #if MERL_VSP_C0152 5327 if(! pcTmpCU->getVSPIndex(uiIdx)) 5328 #endif 5061 5329 { 5062 5330 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5257 5525 } 5258 5526 5527 #if MERL_VSP_C0152 5528 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec) 5529 { 5530 Int depStride = pcBaseViewDepthPicYuv->getStride(); 5531 5532 Int width = pcBaseViewDepthPicYuv->getWidth(); 5533 Int height = pcBaseViewDepthPicYuv->getHeight(); 5534 5535 Int depthPosX = Clip3(0, width - iWidth - 1, iBlkX + (mv->getHor()>>2)); 5536 Int depthPosY = Clip3(0, height- iHeight - 1, iBlkY + (mv->getVer()>>2)); 5537 5538 Pel *depth = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride; 5539 Pel maxDepth = 0; 5540 5541 for (Int j = 0; j < iHeight; j++) 5542 { 5543 for (Int i = 0; i < iWidth; i++) 5544 { 5545 if (maxDepth < depth[i]) 5546 maxDepth = depth[i]; 5547 } 5548 depth += depStride; 5549 } 5550 5551 Int disparity = aiShiftLUT[ maxDepth ] << iShiftPrec; 5552 5553 return disparity; 5554 } 5555 5556 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred) 5557 { 5558 if (picDepth) 5559 { 5560 UInt uiAbsPartAddrCurrCU = m_uiAbsIdxInLCU + uiPartAddr; 5561 Int iWidth, iHeight; 5562 getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); // The modified value of uiPartAddr won't be used any more 5563 5564 TComPicYuv* pcBaseViewDepthPicYuv = picDepth->getPicYuvRec(); 5565 Int iBlkX = ( getAddr() % picDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5566 Int iBlkY = ( getAddr() / picDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5567 Int* aiShiftLUT; 5568 Int iShiftPrec; 5569 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec); 5570 5571 Pel x = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec ); 5572 5573 cMvPred->setHor(x); 5574 clipMv(*cMvPred); 5575 } 5576 } 5577 #endif 5578 5259 5579 #if LGE_DVMCP_A0126 5260 5580 #if QC_SIMPLE_NBDV_B0047 … … 5263 5583 , Bool bParMerge 5264 5584 #endif 5585 #if MERL_VSP_C0152 5586 , Bool bDepthRefine 5587 #endif 5265 5588 #else 5266 5589 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 … … 5345 5668 { 5346 5669 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5347 if (refViewIdx != m_pcSlice->getViewId()) // DCP5670 if (refViewIdx != m_pcSlice->getViewId()) // DCP 5348 5671 { 5349 5672 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5350 5673 clipMv(cMvPred); 5674 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5351 5675 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5352 5676 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5677 #else 5678 { 5679 TComPic* picDepth = NULL; 5680 picDepth = getSlice()->getRefPicBaseDepth(); 5681 if (picDepth && bDepthRefine) 5682 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5683 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5684 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5685 } 5686 #endif 5353 5687 return; 5354 5688 } … … 5364 5698 } 5365 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 5366 5715 } 5367 5716 } … … 5405 5754 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5406 5755 clipMv(cMvPred); 5756 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5407 5757 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5408 5758 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5759 #else 5760 { 5761 TComPic* picDepth = NULL; 5762 picDepth = getSlice()->getRefPicBaseDepth(); 5763 if (picDepth && bDepthRefine) 5764 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5765 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5766 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5767 } 5768 #endif 5409 5769 return; 5410 5770 } … … 5424 5784 } 5425 5785 } 5786 #if MERL_VSP_C0152 5787 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5788 { 5789 TComPic* picDepth = NULL; 5790 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5791 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5792 if (picDepth && bDepthRefine) 5793 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5794 myMv.setVer(0); 5795 5796 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5797 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5798 return; 5799 } 5800 #endif 5426 5801 } 5427 5802 } … … 5459 5834 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5460 5835 clipMv(cMvPred); 5836 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5461 5837 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5462 5838 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5839 #else 5840 { 5841 TComPic* picDepth = NULL; 5842 picDepth = getSlice()->getRefPicBaseDepth(); 5843 if (picDepth && bDepthRefine) 5844 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5845 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5846 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5847 } 5848 #endif 5463 5849 return; 5464 5850 } … … 5478 5864 } 5479 5865 } 5866 #if MERL_VSP_C0152 5867 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5868 { 5869 TComPic* picDepth = NULL; 5870 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5871 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5872 if (picDepth && bDepthRefine) 5873 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5874 myMv.setVer(0); 5875 5876 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5877 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5878 return; 5879 } 5880 #endif 5480 5881 } 5481 5882 } … … 5509 5910 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5510 5911 clipMv(cMvPred); 5912 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5511 5913 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5512 5914 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5915 #else 5916 { 5917 TComPic* picDepth = NULL; 5918 picDepth = getSlice()->getRefPicBaseDepth(); 5919 if (picDepth && bDepthRefine) 5920 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5921 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5922 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5923 } 5924 #endif 5513 5925 return; 5514 5926 } … … 5524 5936 } 5525 5937 } 5938 #if MERL_VSP_C0152 5939 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5940 { 5941 TComPic* picDepth = NULL; 5942 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5943 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5944 if (picDepth && bDepthRefine) 5945 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5946 myMv.setVer(0); 5947 5948 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5949 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5950 return; 5951 } 5952 #endif 5526 5953 } 5527 5954 } … … 5561 5988 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5562 5989 clipMv(cMvPred); 5990 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5563 5991 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5564 5992 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5993 #else 5994 { 5995 TComPic* picDepth = NULL; 5996 picDepth = getSlice()->getRefPicBaseDepth(); 5997 if (picDepth && bDepthRefine) 5998 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5999 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 6000 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 6001 } 6002 #endif 5565 6003 return; 5566 6004 } … … 5580 6018 } 5581 6019 } 6020 #if MERL_VSP_C0152 6021 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 6022 { 6023 TComPic* picDepth = NULL; 6024 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 6025 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 6026 if (picDepth && bDepthRefine) 6027 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 6028 myMv.setVer(0); 6029 6030 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 6031 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 6032 return; 6033 } 6034 #endif 5582 6035 } 5583 6036 } … … 5810 6263 { 5811 6264 clipMv(cColMv); 5812 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5813 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 6265 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 6266 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 6267 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 6268 #else 6269 { 6270 TComPic* picDepth = NULL; 6271 picDepth = getSlice()->getRefPicBaseDepth(); 6272 if (picDepth && bDepthRefine) 6273 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 6274 6275 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 6276 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 6277 } 6278 #endif 5814 6279 return ; 5815 6280 } … … 5819 6284 { 5820 6285 clipMv(cColMv); 5821 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5822 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 6286 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 6287 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 6288 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 6289 #else 6290 { 6291 TComPic* picDepth = NULL; 6292 picDepth = getSlice()->getRefPicBaseDepth(); 6293 if (picDepth && bDepthRefine) 6294 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 6295 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 6296 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 6297 } 6298 #endif 5823 6299 return ; 5824 6300 } … … 5828 6304 { 5829 6305 clipMv(cColMv); 5830 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5831 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 6306 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 6307 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 6308 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 6309 #else 6310 { 6311 TComPic* picDepth = NULL; 6312 picDepth = getSlice()->getRefPicBaseDepth(); 6313 if (picDepth && bDepthRefine) 6314 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 6315 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 6316 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 6317 } 6318 #endif 5832 6319 return ; 5833 6320 } … … 5852 6339 TComMv dv( aiDvMcpDvCand[iList][ i ], 0 ); 5853 6340 clipMv( dv ); 5854 pDInfo->m_acMvCand[ pDInfo->iN ] = dv; 5855 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6341 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 6342 pDInfo->m_acMvCand[ pDInfo->iN] = dv; 6343 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6344 #else 6345 { 6346 TComPic* picDepth = NULL; 6347 picDepth = getSlice()->getRefPicBaseDepth(); 6348 if (picDepth && bDepthRefine) 6349 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv); 6350 pDInfo->m_acMvCand[ pDInfo->iN] = dv; 6351 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6352 } 6353 #endif 5856 6354 return; 5857 6355 } … … 5863 6361 } 5864 6362 #endif 6363 5865 6364 #endif 5866 6365 … … 5904 6403 #if QC_SIMPLE_NBDV_B0047 5905 6404 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 5906 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false); 6405 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false 6406 #if MERL_VSP_C0152 6407 , true 6408 #endif 6409 ); 5907 6410 #else 5908 6411 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); … … 6407 6910 } 6408 6911 6912 #if MERL_VSP_C0152 6913 if(pcTmpCU != NULL && pcTmpCU->getVSPIndex(uiIdx)) 6914 { 6915 return false; 6916 } 6917 #endif 6918 6409 6919 if ( pcTmpCU != NULL && m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) ) 6410 6920 { … … 6515 7025 TComDataCU* pcTmpCU = NULL; 6516 7026 UInt uiIdx; 7027 6517 7028 switch( eDir ) 6518 7029 { … … 6572 7083 return false; 6573 7084 } 6574 7085 7086 #if MERL_VSP_C0152 7087 if(pcTmpCU->getVSPIndex(uiIdx)) 7088 { 7089 return false; 7090 } 7091 #endif 6575 7092 RefPicList eRefPicList2nd = REF_PIC_LIST_0; 6576 7093 if( eRefPicList == REF_PIC_LIST_0 ) … … 6702 7219 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 6703 7220 iColViewIdx = pColCU->getSlice()->getViewId(); 6704 7221 #if MERL_VSP_C0152 7222 //TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 7223 if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0) 7224 { 7225 return false; 7226 } 7227 #endif 6705 7228 6706 7229 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr)) … … 7026 7549 return false; 7027 7550 } 7028 7551 7029 7552 if( m_pcSlice->getRefPic( eRefPicList, iRefIdx )->getViewId() != m_pcSlice->getViewId() ) 7030 7553 { … … 7071 7594 } 7072 7595 } 7596 7597 #if MERL_VSP_C0152 // Preventive 7598 if (pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiPartIdxCenter) < 0) // NOT_VALID 7599 return false; 7600 #endif 7073 7601 7074 7602 // Scale the vector. … … 7846 8374 memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc, sizeof( m_puhInterDir[0] ) * uiNumPartition ); 7847 8375 8376 #if MERL_VSP_C0152 && MTK_UNCONSTRAINED_MVI_B0083 8377 memcpy( m_piVSPIndex + uiAbsPartIdxDst, pcCU->getVSPIndex() + uiAbsPartIdxSrc, sizeof( m_piVSPIndex[0] ) * uiNumPartition ); 8378 #endif 8379 7848 8380 #if !MTK_UNCONSTRAINED_MVI_B0083 7849 8381 memcpy( m_apiMVPIdx[0] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition ); … … 7953 8485 #if QC_SIMPLE_NBDV_B0047 7954 8486 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 7955 getDisMvpCand2( 0, 0, &cDisInfo, false );8487 getDisMvpCand2( 0, 0, &cDisInfo, false ); 7956 8488 #else 7957 8489 getDisMvpCand2( 0, 0, &cDisInfo); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComDataCU.h
r189 r231 197 197 #endif 198 198 UChar* m_puhMergeIndex; ///< array of merge candidate indices 199 #if MERL_VSP_C0152 200 Char* m_piVSPIndex; ///< array of VSP flags to indicate the current block uses synthetic predictor or not 201 ///< value 0: non-VSP, value 1: VSP 202 #endif 199 203 #if AMP_MRG 200 204 Bool m_bIsMergeAMP; … … 279 283 Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 280 284 Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); 281 285 #if MERL_VSP_C0152 286 inline Bool xAddVspMergeCand ( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount, 287 UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo ); 288 inline Void xInheritVspMode ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) ; 289 #endif 282 290 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); 283 291 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); … … 366 374 Void copyTextureMotionDataFrom( TComDataCU* pcCU, UInt uiDepth, UInt uiAbsPartIdxSrc, UInt uiAbsPartIdxDst = 0 ); 367 375 #endif 368 369 // -------------------------------------------------------------------------------------------------------------------376 377 // ------------------------------------------------------------------------------------------------------------------- 370 378 // member functions for CU data 371 379 // ------------------------------------------------------------------------------------------------------------------- … … 471 479 Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } 472 480 Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 481 482 #if MERL_VSP_C0152 483 Char* getVSPIndex () { return m_piVSPIndex; } 484 Char getVSPIndex ( UInt uiIdx ) { return m_piVSPIndex[uiIdx]; } 485 Void setVSPIndex ( UInt uiIdx, Int n ) { m_piVSPIndex[uiIdx] = n; } 486 Void setVSPIndexSubParts( Char bVSPIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 487 #endif 488 473 489 template <typename T> 474 490 Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); … … 555 571 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo 556 572 #if LGE_IVMP_PARALLEL_MERGE_B0136 557 , Bool bParMerg = false 573 , Bool bParMerg = false 574 #endif 575 #if MERL_VSP_C0152 576 , Bool bDepthRefine = false 558 577 #endif 559 578 ); … … 567 586 #endif 568 587 588 #endif 589 590 #if MERL_VSP_C0152 591 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec); 592 Void estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred); 569 593 #endif 570 594 Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); … … 685 709 Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); 686 710 #if SIMP_MRG_PRUN 687 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); 688 #else 689 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand ); 690 #endif 691 Void deriveLeftRightTopIdxGeneral ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); 692 Void deriveLeftBottomIdxGeneral ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); 711 #if MERL_VSP_C0152 712 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, Int mrgCandIdx = -1 ); 713 #else 714 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); 715 #endif 716 #else 717 Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand ); 718 #endif 719 Void deriveLeftRightTopIdxGeneral( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); 720 Void deriveLeftBottomIdxGeneral ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); 693 721 694 722 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r189 r231 562 562 m_cTmpPic.dump( acFilename, ( pcPic->getPOC() != 0 ) ); 563 563 } 564 564 565 #endif 565 566 … … 744 745 Int iNumRefPics = pcSlice->getNumRefIdx( eRefPicList ); 745 746 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 746 {747 { 747 748 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 748 749 { -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComLoopFilter.cpp
r56 r231 439 439 440 440 //-- Set BS for Intra MB : BS = 4 or 3 441 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) ) 441 if ( pcCUP->isIntra(uiPartP) || pcCUQ->isIntra(uiPartQ) 442 #if MERL_VSP_C0152 443 || pcCUP->getVSPIndex(uiPartP) || pcCUQ->getVSPIndex(uiPartQ) 444 #endif 445 ) 442 446 { 443 447 uiBs = 2; … … 445 449 446 450 //-- Set BS for not Intra MB : BS = 2 or 1 or 0 447 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) ) 451 if ( !pcCUP->isIntra(uiPartP) && !pcCUQ->isIntra(uiPartQ) 452 #if MERL_VSP_C0152 453 && !pcCUP->getVSPIndex(uiPartP) && !pcCUQ->getVSPIndex(uiPartQ) 454 #endif 455 ) 448 456 { 449 457 #if NSQT_LFFIX … … 542 550 } // enf of "if( not Intra )" 543 551 552 #if MERL_VSP_C0152 553 if ( pcCUP->getVSPIndex(uiPartP) || pcCUQ->getVSPIndex(uiPartQ)) 554 { 555 uiBs = 0; 556 } 557 #endif 558 544 559 m_aapucBS[iDir][uiAbsPartIdx] = uiBs; 545 560 } -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComMotionInfo.cpp
r189 r231 378 378 379 379 #if MTK_UNCONSTRAINED_MVI_B0083 380 Void TComCUMvField::setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir ) 380 Void TComCUMvField::setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir 381 ) 381 382 { 382 383 PredMode predMode = MODE_INTRA; … … 386 387 { 387 388 predMode = static_cast<PredMode>( pePredMode[ iPartAddr+i ] ); 388 if( predMode ==MODE_INTRA)389 if( predMode == MODE_INTRA ) 389 390 { 390 391 m_pcMv[iPartAddr+i] = cMv; -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComPic.cpp
r210 r231 703 703 } 704 704 705 706 705 //! \} -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComPrediction.cpp
r210 r231 54 54 { 55 55 m_piYuvExt = NULL; 56 #if MERL_VSP_C0152 57 m_pDepth = (Int*) malloc(64*64*sizeof(Int)); // TODO: Use a smart way to determine the size of the array 58 if (m_pDepth == NULL) 59 { 60 printf("ERROR: UKTGHU, No memory allocated.\n"); 61 } 62 #endif 56 63 } 57 64 … … 59 66 { 60 67 68 #if MERL_VSP_C0152 69 if (m_pDepth != NULL) 70 { 71 free(m_pDepth); 72 } 73 #endif 61 74 delete[] m_piYuvExt; 62 75 … … 886 899 } 887 900 } 901 902 #if MERL_VSP_C0152 903 #if DEPTH_MAP_GENERATION 904 Void TComPrediction::motionCompensationBWVSP( TComDataCU* pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx, RefPicList eRefPicList, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY ) 905 #else 906 Void TComPrediction::motionCompensationBWVSP ( TComDataCU* pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx, RefPicList eRefPicList, Int iPartIdx ) 907 #endif 908 { 909 Int iWidth; 910 Int iHeight; 911 UInt uiPartAddr; 912 913 if ( iPartIdx >= 0 ) 914 { 915 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 916 917 #if DEPTH_MAP_GENERATION 918 if( bPrdDepthMap ) 919 { 920 iWidth >>= uiSubSampExpX; 921 iHeight >>= uiSubSampExpY; 922 } 923 #endif 924 925 if ( eRefPicList != REF_PIC_LIST_X ) 926 { 927 #if LGE_ILLUCOMP_B0045 928 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 929 #else 930 if( pcCU->getSlice()->getPPS()->getUseWP()) 931 #endif 932 { 933 #if DEPTH_MAP_GENERATION 934 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 935 #else 936 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true ); 937 #endif 938 } 939 else 940 { 941 #if DEPTH_MAP_GENERATION 942 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false ); 943 #else 944 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false ); 945 #endif 946 } 947 #if LGE_ILLUCOMP_B0045 948 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 949 #else 950 if( pcCU->getSlice()->getPPS()->getUseWP()) 951 #endif 952 { 953 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); 954 } 955 } 956 else 957 { 958 #if DEPTH_MAP_GENERATION 959 if( xCheckIdenticalMotion( pcCU, uiPartAddr ) && !bPrdDepthMap ) 960 #else 961 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 962 #endif 963 { 964 #if DEPTH_MAP_GENERATION 965 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false ); 966 #else 967 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false ); 968 #endif 969 } 970 else 971 { 972 #if DEPTH_MAP_GENERATION 973 xPredInterBiBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap ); 974 #else 975 xPredInterBiBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, pcYuvPred, iPartIdx ); 976 #endif 977 } 978 } 979 return; 980 } 981 982 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartInter(); iPartIdx++ ) 983 { 984 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 985 986 #if DEPTH_MAP_GENERATION 987 if( bPrdDepthMap ) 988 { 989 iWidth >>= uiSubSampExpX; 990 iHeight >>= uiSubSampExpY; 991 } 992 #endif 993 994 if ( eRefPicList != REF_PIC_LIST_X ) 995 { 996 #if LGE_ILLUCOMP_B0045 997 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 998 #else 999 if( pcCU->getSlice()->getPPS()->getUseWP()) 1000 #endif 1001 { 1002 #if DEPTH_MAP_GENERATION 1003 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr , iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 1004 #else 1005 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, true ); 1006 #endif 1007 } 1008 else 1009 { 1010 #if DEPTH_MAP_GENERATION 1011 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false ); 1012 #else 1013 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false ); 1014 #endif 1015 } 1016 #if DEPTH_MAP_GENERATION 1017 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false ); 1018 #else 1019 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false ); 1020 #endif 1021 #if LGE_ILLUCOMP_B0045 1022 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 1023 #else 1024 if( pcCU->getSlice()->getPPS()->getUseWP()) 1025 #endif 1026 { 1027 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); 1028 } 1029 } 1030 else 1031 { 1032 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1033 { 1034 #if DEPTH_MAP_GENERATION 1035 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false ); 1036 #else 1037 xPredInterUniBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred, iPartIdx, false ); 1038 #endif 1039 } 1040 else 1041 { 1042 #if DEPTH_MAP_GENERATION 1043 xPredInterBiBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, pcYuvPred, iPartIdx, bPrdDepthMap ); 1044 #else 1045 xPredInterBiBWVSP (pcCU, uiPartAddr, uiAbsPartIdx+uiPartAddr, iWidth, iHeight, pcYuvPred, iPartIdx ); 1046 #endif 1047 } 1048 } 1049 } 1050 1051 return; 1052 } 1053 1054 1055 // Output: rpcYuvPred 1056 #if DEPTH_MAP_GENERATION 1057 Void TComPrediction::xPredInterUniBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi ) 1058 #else 1059 Void TComPrediction::xPredInterUniBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi ) 1060 #endif 1061 { 1062 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1063 Int vspIdx = pcCU->getVSPIndex(uiPartAddr); 1064 if (vspIdx != 0) 1065 { 1066 if (iRefIdx >= 0) 1067 { 1068 printf("vspIdx = %d, iRefIdx = %d\n", vspIdx, iRefIdx); 1069 } 1070 assert (iRefIdx < 0); // assert (iRefIdx == NOT_VALID); 1071 } 1072 else 1073 { 1074 assert (iRefIdx >= 0); 1075 } 1076 1077 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1078 pcCU->clipMv(cMv); 1079 1080 #if DEPTH_MAP_GENERATION 1081 if( bPrdDepthMap ) 1082 { 1083 UInt uiRShift = 0; 1084 #if PDM_REMOVE_DEPENDENCE 1085 if( pcCU->getPic()->getStoredPDMforV2() == 1 ) 1086 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMapTemp(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 1087 else 1088 #endif 1089 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPredDepthMap(), uiPartAddr, &cMv, iWidth, iHeight, uiSubSampExpX, uiSubSampExpY, rpcYuvPred, uiRShift, 0 ); 1090 1091 return; 1092 } 1093 #endif 1094 1095 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1096 if( pcCU->getSlice()->getSPS()->isDepth() ) 1097 { 1098 if (vspIdx != 0) 1099 { // depth, vsp 1100 // get depth estimator here 1101 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); 1102 TComPicYuv* pcBaseViewDepthPicYuv = NULL; 1103 if (vspIdx < 4) // spatial 1104 { 1105 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 1106 } 1107 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1108 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1109 Int* pShiftLUT; 1110 Int iShiftPrec; 1111 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec); 1112 //using disparity to find the depth block of the base view as the depth block estimator of the current block 1113 //using depth block estimator and base view texture to get Backward warping 1114 xPredInterLumaBlkFromDM ( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1115 xPredInterChromaBlkFromDM( pcBaseViewDepthPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1116 } 1117 else 1118 { // depth, non-vsp 1119 UInt uiRShift = ( bi ? 14-g_uiBitDepth-g_uiBitIncrement : 0 ); 1120 UInt uiOffset = bi ? IF_INTERNAL_OFFS : 0; 1121 #if DEPTH_MAP_GENERATION 1122 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, 0, 0, rpcYuvPred, uiRShift, uiOffset ); 1123 #else 1124 xPredInterPrdDepthMap( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, uiRShift, uiOffset ); 1125 #endif 1126 1127 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 1128 } 1129 } 1130 else // texture 1131 { 1132 #endif 1133 if ( vspIdx != 0 && !pcCU->getSlice()->getSPS()->isDepth()) 1134 { // texture, vsp 1135 TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPicBaseTxt(); 1136 TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec(); 1137 TComPicYuv* pcBaseViewDepthPicYuv = NULL; 1138 if (vspIdx < 4) // spatial 1139 { 1140 TComPic* pRefPicBaseDepth = pcCU->getSlice()->getRefPicBaseDepth(); 1141 pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec(); 1142 } 1143 Int iBlkX = ( pcCU->getAddr() % pRefPicBaseTxt->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1144 Int iBlkY = ( pcCU->getAddr() / pRefPicBaseTxt->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartIdx ] ]; 1145 Int* pShiftLUT; 1146 Int iShiftPrec; 1147 pcCU->getSlice()->getBWVSPLUTParam(pShiftLUT, iShiftPrec); 1148 1149 //using disparity to find the depth block of the base view as the depth block estimator of the current block 1150 //using depth block estimator and base view texture to get Backward warping 1151 xPredInterLumaBlkFromDM ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX, iBlkY, iWidth, iHeight, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1152 xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, iShiftPrec, &cMv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getSPS()->isDepth(), vspIdx, rpcYuvPred ); 1153 } 1154 else 1155 { // texture, non-vsp 1156 #if LGE_ILLUCOMP_B0045 1157 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId()); 1158 1159 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag); 1160 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag ); 1161 #else 1162 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 1163 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 1164 #endif 1165 } 1166 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1167 } 1168 #endif 1169 } 1170 1171 1172 #if DEPTH_MAP_GENERATION 1173 Void TComPrediction::xPredInterBiBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ) 1174 #else 1175 Void TComPrediction::xPredInterBiSDM ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx ) 1176 #endif 1177 { 1178 TComYuv* pcMbYuv; 1179 Int iRefIdx[2] = {-1, -1}; 1180 1181 for ( Int iRefList = 0; iRefList < 2; iRefList++ ) 1182 { 1183 RefPicList eRefPicList = (iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0); 1184 iRefIdx[iRefList] = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1185 #if MERL_VSP_C0152 1186 if(!pcCU->getVSPIndex(uiPartAddr)) 1187 { 1188 if ( iRefIdx[iRefList] < 0 ) 1189 { 1190 continue; 1191 } 1192 } 1193 else 1194 { 1195 if ( iRefList== REF_PIC_LIST_1 && iRefIdx[iRefList] < 0 ) // iRefIdx[iRefList] ==NOT_VALID 1196 { 1197 continue; 1198 } 1199 } 1200 #else 1201 if ( iRefIdx[iRefList] < 0 ) 1202 { 1203 continue; 1204 } 1205 #endif 1206 assert( iRefIdx[iRefList] < pcCU->getSlice()->getNumRefIdx(eRefPicList) ); 1207 1208 pcMbYuv = &m_acYuvPred[iRefList]; 1209 if( pcCU->getCUMvField( REF_PIC_LIST_0 )->getRefIdx( uiPartAddr ) >= 0 && pcCU->getCUMvField( REF_PIC_LIST_1 )->getRefIdx( uiPartAddr ) >= 0 ) 1210 { 1211 #if DEPTH_MAP_GENERATION 1212 xPredInterUniBWVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 1213 #else 1214 xPredInterUniBWVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true ); 1215 #endif 1216 } 1217 else 1218 { 1219 if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() ) 1220 { 1221 #if DEPTH_MAP_GENERATION 1222 xPredInterUniBWVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, true ); 1223 #else 1224 xPredInterUniBWVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, true ); 1225 #endif 1226 } 1227 else 1228 { 1229 #if DEPTH_MAP_GENERATION 1230 xPredInterUniBWVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, bPrdDepthMap, uiSubSampExpX, uiSubSampExpY, false ); 1231 #else 1232 xPredInterUniBWVSP ( pcCU, uiPartAddr, uiAbsPartIdx, iWidth, iHeight, eRefPicList, pcMbYuv, iPartIdx, false ); 1233 #endif 1234 } 1235 } 1236 } 1237 1238 if ( pcCU->getSlice()->getPPS()->getWPBiPredIdc() ) 1239 { 1240 #if MERL_VSP_C0152 1241 if(pcCU->getVSPIndex(uiPartAddr)) 1242 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1243 else 1244 #endif 1245 xWeightedPredictionBi( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1246 } 1247 else 1248 { 1249 #if DEPTH_MAP_GENERATION 1250 if ( bPrdDepthMap ) 1251 { 1252 xWeightedAveragePdm( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, uiSubSampExpX, uiSubSampExpY ); 1253 } 1254 else 1255 { 1256 #if MERL_VSP_C0152 1257 if(pcCU->getVSPIndex(uiPartAddr)) 1258 m_acYuvPred[0].copyPartToPartYuv( rpcYuvPred, uiPartAddr, iWidth, iHeight ); 1259 else 1260 #endif 1261 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1262 } 1263 #else 1264 xWeightedAverage( pcCU, &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1265 #endif 1266 } 1267 } 1268 #endif 888 1269 889 1270 Void … … 1119 1500 } 1120 1501 1502 #if MERL_VSP_C0152 1503 // Input: 1504 // refPic: Ref picture. Full picture, with padding 1505 // posX, posY: PU position, texture 1506 // size_x, size_y: PU size 1507 // partAddr: z-order index 1508 // mv: disparity vector. derived from neighboring blocks 1509 // 1510 // Output: dstPic, PU predictor 64x64 1511 Void TComPrediction::xPredInterLumaBlkFromDM( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv* mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 1512 , TComYuv *&dstPic ) 1513 { 1514 Int widthLuma; 1515 Int heightLuma; 1516 1517 if (isDepth) 1518 { 1519 widthLuma = pPicBaseDepth->getWidth(); 1520 heightLuma = pPicBaseDepth->getHeight(); 1521 } 1522 else 1523 { 1524 widthLuma = refPic->getWidth(); 1525 heightLuma = refPic->getHeight(); 1526 } 1527 1528 #if MERL_VSP_BLOCKSIZE_C0152 != 1 1529 Int widthDepth = pPicBaseDepth->getWidth(); 1530 Int heightDepth = pPicBaseDepth->getHeight(); 1531 #endif 1532 1533 Int nTxtPerDepthX = widthLuma / ( pPicBaseDepth->getWidth() ); // texture pixel # per depth pixel 1534 Int nTxtPerDepthY = heightLuma / ( pPicBaseDepth->getHeight() ); 1535 1536 Int refStride = refPic->getStride(); 1537 Int dstStride = dstPic->getStride(); 1538 Int depStride = pPicBaseDepth->getStride(); 1539 1540 Int depthPosX = Clip3(0, widthLuma - size_x - 1, (posX/nTxtPerDepthX) + (mv->getHor()>>2)); 1541 Int depthPosY = Clip3(0, heightLuma- size_y - 1, (posY/nTxtPerDepthY) + (mv->getVer()>>2)); 1542 1543 Pel *ref = refPic->getLumaAddr() + posX + posY * refStride; 1544 Pel *dst = dstPic->getLumaAddr(partAddr); 1545 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; 1546 1547 #if MERL_VSP_BLOCKSIZE_C0152 != 1 1548 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1549 Int dW = size_x>>1; 1550 Int dH = size_y>>1; 1551 #endif 1552 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1553 Int dW = size_x>>2; 1554 Int dH = size_y>>2; 1555 #endif 1556 { 1557 Pel* depthi = depth; 1558 for (Int j = 0; j < dH; j++) 1559 { 1560 for (Int i = 0; i < dW; i++) 1561 { 1562 Pel* depthTmp; 1563 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1564 if (depthPosX + (i<<1) < widthDepth) 1565 depthTmp = depthi + (i << 1); 1566 else 1567 depthTmp = depthi + (widthDepth - depthPosX - 1); 1568 #endif 1569 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1570 if (depthPosX + (i<<2) < widthDepth) 1571 depthTmp = depthi + (i << 2); 1572 else 1573 depthTmp = depthi + (widthDepth - depthPosX - 1); 1574 #endif 1575 Int maxV = 0; 1576 for (Int blockj = 0; blockj < MERL_VSP_BLOCKSIZE_C0152; blockj++) 1577 { 1578 Int iX = 0; 1579 for (Int blocki = 0; blocki < MERL_VSP_BLOCKSIZE_C0152; blocki++) 1580 { 1581 if (maxV < depthTmp[iX]) 1582 maxV = depthTmp[iX]; 1583 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1584 if (depthPosX + (i<<1) + blocki < widthDepth - 1) 1585 #else // MERL_VSP_BLOCKSIZE_C0152 == 4 1586 if (depthPosX + (i<<2) + blocki < widthDepth - 1) 1587 #endif 1588 iX++; 1589 } 1590 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1591 if (depthPosY + (j<<1) + blockj < heightDepth - 1) 1592 #else // MERL_VSP_BLOCKSIZE_C0152 == 4 1593 if (depthPosY + (j<<2) + blockj < heightDepth - 1) 1594 #endif 1595 depthTmp += depStride; 1596 } 1597 m_pDepth[i+j*dW] = maxV; 1598 } // end of i < dW 1599 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1600 if (depthPosY + ((j+1)<<1) < heightDepth) 1601 depthi += (depStride << 1); 1602 else 1603 depthi = depth + (heightDepth-depthPosY-1)*depStride; 1604 #endif 1605 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1606 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 1607 depthi += (depStride << 2); 1608 else 1609 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 1610 #endif 1611 } 1612 } 1613 #endif 1614 1615 #if MERL_VSP_BLOCKSIZE_C0152 != 1 1616 Int yDepth = 0; 1617 #endif 1618 for ( Int yTxt = 0; yTxt < size_y; yTxt += nTxtPerDepthY ) 1619 { 1620 for ( Int xTxt = 0, xDepth = 0; xTxt < size_x; xTxt += nTxtPerDepthX, xDepth++ ) 1621 { 1622 Pel rep_depth = 0; // to store the depth value used for warping 1623 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1624 rep_depth = depth[xDepth]; 1625 #endif 1626 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1627 rep_depth = m_pDepth[(xTxt>>1) + (yTxt>>1)*dW]; 1628 #endif 1629 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1630 rep_depth = m_pDepth[(xTxt>>2) + (yTxt>>2)*dW]; 1631 #endif 1632 1633 assert( rep_depth >= 0 && rep_depth <= 255 ); 1634 Int disparity = pShiftLUT[ rep_depth ] << iShiftPrec; 1635 Int refOffset = xTxt + (disparity >> 2); 1636 Int xFrac = disparity & 0x3; 1637 Int absX = posX + refOffset; 1638 1639 if (xFrac == 0) 1640 absX = Clip3(0, widthLuma-1, absX); 1641 else 1642 absX = Clip3(4, widthLuma-5, absX); 1643 1644 refOffset = absX - posX; 1645 1646 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 1647 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true ); 1648 } 1649 ref += refStride*nTxtPerDepthY; 1650 dst += dstStride*nTxtPerDepthY; 1651 depth += depStride; 1652 #if MERL_VSP_BLOCKSIZE_C0152 != 1 1653 yDepth++; 1654 #endif 1655 } 1656 } 1657 1658 Void TComPrediction::xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv*mv, UInt partAddr, Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 1659 , TComYuv *&dstPic ) 1660 { 1661 Int refStride = refPic->getCStride(); 1662 Int dstStride = dstPic->getCStride(); 1663 Int depStride = pPicBaseDepth->getStride(); 1664 1665 Int widthChroma, heightChroma; 1666 if( isDepth) 1667 { 1668 widthChroma = pPicBaseDepth->getWidth()>>1; 1669 heightChroma = pPicBaseDepth->getHeight()>>1; 1670 } 1671 else 1672 { 1673 widthChroma = refPic->getWidth()>>1; 1674 heightChroma = refPic->getHeight()>>1; 1675 } 1676 1677 // Below is only for Texture chroma component 1678 1679 Int widthDepth = pPicBaseDepth->getWidth(); 1680 Int heightDepth = pPicBaseDepth->getHeight(); 1681 1682 Int nTxtPerDepthX, nTxtPerDepthY; // Number of texture samples per one depth sample 1683 Int nDepthPerTxtX, nDepthPerTxtY; // Number of depth samples per one texture sample 1684 1685 Int depthPosX; // Starting position in depth image 1686 Int depthPosY; 1687 1688 if ( widthChroma > widthDepth ) 1689 { 1690 nTxtPerDepthX = widthChroma / widthDepth; 1691 nDepthPerTxtX = 1; 1692 depthPosX = posX / nTxtPerDepthX + (mv->getHor()>>2); //mv denotes the disparity for VSP 1693 } 1694 else 1695 { 1696 nTxtPerDepthX = 1; 1697 nDepthPerTxtX = widthDepth / widthChroma; 1698 depthPosX = posX * nDepthPerTxtX + (mv->getHor()>>2); //mv denotes the disparity for VSP 1699 } 1700 depthPosX = Clip3(0, widthDepth - (size_x<<1) - 1, depthPosX); 1701 1702 if ( heightChroma > heightDepth ) 1703 { 1704 nTxtPerDepthY = heightChroma / heightDepth; 1705 nDepthPerTxtY = 1; 1706 depthPosY = posY / nTxtPerDepthY + (mv->getVer()>>2); //mv denotes the disparity for VSP 1707 } 1708 else 1709 { 1710 nTxtPerDepthY = 1; 1711 nDepthPerTxtY = heightDepth / heightChroma; 1712 depthPosY = posY * nDepthPerTxtY + (mv->getVer()>>2); //mv denotes the disparity for VSP 1713 } 1714 depthPosY = Clip3(0, heightDepth - (size_y<<1) - 1, depthPosY); 1715 1716 Pel *refCb = refPic->getCbAddr() + posX + posY * refStride; 1717 Pel *refCr = refPic->getCrAddr() + posX + posY * refStride; 1718 Pel *dstCb = dstPic->getCbAddr(partAddr); 1719 Pel *dstCr = dstPic->getCrAddr(partAddr); 1720 Pel *depth = pPicBaseDepth->getLumaAddr() + depthPosX + depthPosY * depStride; // move the pointer to the current depth pixel position 1721 1722 Int refStrideBlock = refStride * nTxtPerDepthY; 1723 Int dstStrideBlock = dstStride * nTxtPerDepthY; 1724 Int depStrideBlock = depStride * nDepthPerTxtY; 1725 1726 if (isDepth) 1727 { 1728 // DT: Since the call for this function is redundant, .. 1729 for (Int y = 0; y < size_y; y++) 1730 { 1731 for (Int x = 0; x < size_x; x++) 1732 { 1733 dstCb[x] = 128; 1734 dstCr[x] = 128; 1735 } 1736 dstCb += dstStride; 1737 dstCr += dstStride; 1738 } 1739 return; 1740 } 1741 1742 if ( widthChroma > widthDepth ) // We assume 1743 { 1744 assert( heightChroma > heightDepth ); 1745 printf("This branch should never been reached.\n"); 1746 exit(0); 1747 } 1748 else 1749 { 1750 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1751 Int dW = size_x; 1752 Int dH = size_y; 1753 Int sW = 2; // search window size 1754 Int sH = 2; 1755 #endif 1756 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1757 Int dW = size_x; 1758 Int dH = size_y; 1759 Int sW = 2; // search window size 1760 Int sH = 2; 1761 #endif 1762 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1763 Int dW = size_x>>1; 1764 Int dH = size_y>>1; 1765 Int sW = 4; // search window size 1766 Int sH = 4; 1767 #endif 1768 1769 { 1770 Pel* depthi = depth; 1771 for (Int j = 0; j < dH; j++) 1772 { 1773 for (Int i = 0; i < dW; i++) 1774 { 1775 Pel* depthTmp; 1776 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1777 depthTmp = depthi + (i << 1); 1778 #endif 1779 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1780 if (depthPosX + (i<<1) < widthDepth) 1781 depthTmp = depthi + (i << 1); 1782 else 1783 depthTmp = depthi + (widthDepth - depthPosX - 1); 1784 #endif 1785 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1786 if (depthPosX + (i<<2) < widthDepth) 1787 depthTmp = depthi + (i << 2); 1788 else 1789 depthTmp = depthi + (widthDepth - depthPosX - 1); 1790 #endif 1791 Int maxV = 0; 1792 for (Int blockj = 0; blockj < sH; blockj++) 1793 { 1794 Int iX = 0; 1795 for (Int blocki = 0; blocki < sW; blocki++) 1796 { 1797 if (maxV < depthTmp[iX]) 1798 maxV = depthTmp[iX]; 1799 if (depthPosX + i*sW + blocki < widthDepth - 1) 1800 iX++; 1801 } 1802 if (depthPosY + j*sH + blockj < heightDepth - 1) 1803 depthTmp += depStride; 1804 } 1805 m_pDepth[i+j*dW] = maxV; 1806 } // end of i < dW 1807 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1808 if (depthPosY + ((j+1)<<1) < heightDepth) 1809 depthi += (depStride << 1); 1810 else 1811 depthi = depth + (heightDepth-1)*depStride; 1812 #endif 1813 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1814 if (depthPosY + ((j+1)<<1) < heightDepth) 1815 depthi += (depStride << 1); 1816 else 1817 depthi = depth + (heightDepth-depthPosY-1)*depStride; 1818 #endif 1819 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1820 if (depthPosY + ((j+1)<<2) < heightDepth) // heightDepth-1 1821 depthi += (depStride << 2); 1822 else 1823 depthi = depth + (heightDepth-depthPosY-1)*depStride; // the last line 1824 #endif 1825 } 1826 } 1827 1828 1829 // (size_x, size_y) is Chroma block size 1830 for ( Int yTxt = 0, yDepth = 0; yTxt < size_y; yTxt += nTxtPerDepthY, yDepth += nDepthPerTxtY ) 1831 { 1832 for ( Int xTxt = 0, xDepth = 0; xTxt < size_x; xTxt += nTxtPerDepthX, xDepth += nDepthPerTxtX ) 1833 { 1834 Pel rep_depth = 0; // to store the depth value used for warping 1835 #if MERL_VSP_BLOCKSIZE_C0152 == 1 1836 rep_depth = m_pDepth[(xTxt) + (yTxt)*dW]; 1837 #endif 1838 #if MERL_VSP_BLOCKSIZE_C0152 == 2 1839 rep_depth = m_pDepth[(xTxt) + (yTxt)*dW]; 1840 #endif 1841 #if MERL_VSP_BLOCKSIZE_C0152 == 4 1842 rep_depth = m_pDepth[(xTxt>>1) + (yTxt>>1)*dW]; 1843 #endif 1844 1845 // calculate the offset in the reference picture 1846 Int disparity = pShiftLUT[ rep_depth ] << iShiftPrec; 1847 Int refOffset = xTxt + (disparity >> 3); // in integer pixel in chroma image 1848 Int xFrac = disparity & 0x7; 1849 Int absX = posX + refOffset; 1850 1851 if (xFrac == 0) 1852 absX = Clip3(0, widthChroma-1, absX); 1853 else 1854 absX = Clip3(4, widthChroma-5, absX); 1855 1856 refOffset = absX - posX; 1857 1858 assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 ); 1859 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 1860 m_if.filterHorChroma(&refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true); 1861 m_if.filterHorChroma(&refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, true); 1862 } 1863 refCb += refStrideBlock; 1864 refCr += refStrideBlock; 1865 dstCb += dstStrideBlock; 1866 dstCr += dstStrideBlock; 1867 depth += depStrideBlock; 1868 } 1869 } 1870 } 1871 1872 #endif // MERL_VSP_C0152 1873 1121 1874 #if DEPTH_MAP_GENERATION 1122 1875 Void TComPrediction::xWeightedAveragePdm( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ) -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComPrediction.h
r210 r231 78 78 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation 79 79 80 #if MERL_VSP_C0152 81 Int* m_pDepth; ///< Local variable, to store a depth block, just to prevent allocate memory every time 82 #endif 83 80 84 Void xPredIntraAng ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable, Bool bFilter ); 81 85 Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height ); … … 94 98 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx ); 95 99 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset ); 100 #endif 101 #if MERL_VSP_C0152 102 Void xPredInterUniBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX, UInt uiSubSampExpY, Bool bi=false ); 103 Void xPredInterBiBWVSP ( TComDataCU* pcCU, UInt uiPartAddr, UInt uiAbsPartIdx, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 96 104 #endif 97 105 … … 108 116 #endif 109 117 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 110 118 119 #if MERL_VSP_C0152 120 Void xPredInterLumaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 121 , TComYuv *&dstPic ); 122 Void xPredInterChromaBlkFromDM ( TComPicYuv *refPic, TComPicYuv *pPicBaseDepth, Int* pShiftLUT, Int iShiftPrec, TComMv *mv, UInt partAddr,Int posX, Int posY, Int size_x, Int size_y, Bool isDepth, Int vspIdx 123 , TComYuv *&dstPic ); 124 #endif 111 125 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 112 126 #if LGE_ILLUCOMP_B0045 … … 150 164 Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); 151 165 #endif 152 166 167 #if MERL_VSP_C0152 168 Void motionCompensationBWVSP ( TComDataCU* pcCU, TComYuv* pcYuvPred, UInt uiAbsPartIdx, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 169 #endif 170 153 171 // motion vector prediction 154 172 Void getMvPredAMVP ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComSlice.cpp
r210 r231 121 121 { 122 122 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 123 123 124 124 initEqualRef(); 125 125 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TComSlice.h
r210 r231 1265 1265 #endif 1266 1266 #if QC_IV_AS_LT_B0046 1267 Bool 1267 Bool m_bWasLongTerm[2][MAX_NUM_REF+1]; //was long-term picture 1268 1268 #endif 1269 1269 TComSPS* m_pcSPS; … … 1341 1341 1342 1342 #if SONY_COLPIC_AVAILABILITY|QC_MVHEVC_B0046 1343 Int 1343 Int m_iViewOrderIdx; 1344 1344 #endif 1345 1345 #if LGE_ILLUCOMP_B0045 1346 1346 Bool m_bApplyIC; 1347 #endif 1348 1349 #if MERL_VSP_C0152 1350 TComPic* m_apcRefPicBaseTxt; 1351 TComPic* m_apcRefPicBaseDepth; 1352 Int* m_aiShiftLUT; 1353 Int m_iShiftPrec; 1347 1354 #endif 1348 1355 … … 1655 1662 #endif 1656 1663 1664 #if MERL_VSP_C0152 1665 TComPic* getRefPicBaseTxt () { return m_apcRefPicBaseTxt; } 1666 Void setRefPicBaseTxt ( TComPic* RefPic) { m_apcRefPicBaseTxt = RefPic; } 1667 TComPic* getRefPicBaseDepth () { return m_apcRefPicBaseDepth; } 1668 Void setRefPicBaseDepth ( TComPic* RefPic) { m_apcRefPicBaseDepth = RefPic; } 1669 1670 Void setBWVSPLUTParam( Int *pShiftLUT, Int iLoG2LUTPrec) { m_aiShiftLUT = pShiftLUT; m_iShiftPrec = iLoG2LUTPrec; } 1671 Void getBWVSPLUTParam( Int*&pShiftLUT, Int&iLoG2LUTPrec) { pShiftLUT = m_aiShiftLUT; iLoG2LUTPrec = m_iShiftPrec; } 1672 #endif 1673 1657 1674 protected: 1658 1675 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, UInt uiPOC); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibCommon/TypeDef.h
r211 r231 51 51 52 52 #if !QC_MVHEVC_B0046 53 54 ///// ***** VSP MODES ********* 55 #define MERL_VSP_C0152 1 // JCT3V-C0152: 1: enable VSP-related tools; 0: disable VSP-related tools 56 57 #if MERL_VSP_C0152 58 59 /* 60 * Two macros are used to configure combinations of JCT3V-C0152 and JCT3V-C0131 61 * 62 * a) (full) A full JCT3V-C0152 implementation, including JCT3V-C0131 63 * #define MERL_VSP_COMPENSATION_C0152 1 64 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 1 65 * 66 * b) (mvp2off) For partial JCT3V-C0152 excluding overlaps from JCT3V-C0131 67 * #define MERL_VSP_COMPENSATION_C0152 1 68 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 0 69 * 70 * c) (nocand) For JCT3V-C0131 only 71 * #define MERL_VSP_COMPENSATION_C0152 0 72 * #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 1 73 */ 74 75 #define MERL_VSP_COMPENSATION_C0152 0 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add (nocand). 76 #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). 77 78 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 79 #define VSP_MERGE_POS 5 // JCT3V-C0152: fixed position of VSP candidate in merge list, supported values: 5. 80 81 #else // !MERL_VSP_C0152 82 #define MERL_VSP_COMPENSATION_C0152 0 // JCT3V-C0152: 1: add VSP merge candidate to merging candidate list; 0: not to add 83 #define MERL_MTK_VSP_DVP_REFINE_C0152_C0131 0 // JCT3V-C0152 && JCT3V-C0131: 1: refine disparity vector using a warped depth block; 0: not to refine 84 #define MERL_VSP_BLOCKSIZE_C0152 4 // JCT3V-C0152: VSP block size, supported values: 1, 2 and 4. 85 #endif 86 53 87 ///// ***** FIXES ********* 54 88 // A -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecCu.cpp
r189 r231 361 361 362 362 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 363 363 364 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 364 365 { 365 366 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 367 #if MERL_VSP_C0152 368 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 369 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 370 #endif 366 371 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_SKIP ); 367 372 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); … … 376 381 #if SIMP_MRG_PRUN 377 382 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 383 #if MERL_VSP_C0152 384 Int iVSPIndexTrue[3] = {-1, -1, -1}; 385 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 386 { 387 Int iVSPIdx = 0; 388 Int numVspIdx; 389 numVspIdx = 3; 390 for (Int i = 0; i < numVspIdx; i++) 391 { 392 if (iVSPIndexTrue[i] == uiMergeIndex) 393 { 394 iVSPIdx = i+1; 395 break; 396 } 397 } 398 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, 0, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 399 } 400 #else 378 401 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 402 #endif 379 403 #else 380 404 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); … … 467 491 468 492 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 493 469 494 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 470 495 { 471 496 const UChar uhNewDepth = max<UInt>( uiDepth, pcTextureCU->getDepth( uiAbsPartIdx + ui ) ); 497 #if MERL_VSP_C0152 498 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 499 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 500 #endif 472 501 pcCU->setPredictionMode( uiAbsPartIdx + ui, MODE_INTER ); 473 502 pcCU->setPartitionSize( uiAbsPartIdx + ui, SIZE_2Nx2N ); … … 658 687 659 688 // inter prediction 689 #if MERL_VSP_C0152 690 m_pcPrediction->motionCompensationBWVSP( pcCU, m_ppcYuvReco[uiDepth], uiAbsPartIdx ); 691 #else 660 692 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 661 693 #endif 662 694 #if HHI_MPI 663 695 if( pcCU->getTextureModeDepth( 0 ) != -1 ) … … 1047 1079 // reconstruct residual based on mask + DC residuals 1048 1080 Pel apDCResiValues[2]; 1049 Pel apDCRecoValues[2];1081 //Pel apDCRecoValues[2]; 1050 1082 for( UInt ui = 0; ui < uiNumSegments; ui++ ) 1051 1083 { … … 1054 1086 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1055 1087 1056 apDCRecoValues[ui] = pRecoValue;1088 //apDCRecoValues[ui] = pRecoValue; 1057 1089 apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; 1058 1090 } -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecCu.h
r189 r231 65 65 #endif 66 66 TComDataCU** m_ppcCU; ///< CU data array 67 67 68 68 // access channel 69 69 TComTrQuant* m_pcTrQuant; … … 85 85 /// destroy internal buffers 86 86 Void destroy (); 87 87 88 88 /// decode CU information 89 89 Void decodeCU ( TComDataCU* pcCU, UInt& ruiIsLast ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecEntropy.cpp
r189 r231 337 337 #if SIMP_MRG_PRUN 338 338 UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 339 #if MERL_VSP_C0152 340 Int iVSPIndexTrue[3] = {-1, -1, -1}; 341 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex ); 342 343 if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used 344 { 345 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 346 UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 347 for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 348 { 349 Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui); 350 pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx); 351 } 352 } 353 else // MPI not used 354 { 355 Int iVSPIdx = 0; 356 Int numVspIdx; 357 numVspIdx = 3; 358 for (Int i = 0; i < numVspIdx; i++) 359 { 360 if (iVSPIndexTrue[i] == uiMergeIndex) 361 { 362 iVSPIdx = i+1; 363 break; 364 } 365 } 366 pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth ); //Initialize the VSP, may change later in get InterMergeCandidates() 367 } 368 369 #else 339 370 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 371 #endif 340 372 #else 341 373 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecGop.cpp
r189 r231 511 511 m_vAlfCUCtrlSlices.clear(); 512 512 } 513 fflush(stdout); 513 514 } 514 515 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecTop.cpp
r210 r231 59 59 m_aaiCodedScale [ uiId ] = new Int [ MAX_VIEW_NUM ]; 60 60 } 61 62 #if MERL_VSP_C0152 63 xCreateLUTs( (UInt)MAX_VIEW_NUM, (UInt)MAX_VIEW_NUM, m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 64 m_iLog2Precision = LOG2_DISP_PREC_LUT; 65 m_uiBitDepthForLUT = 8; // fixed 66 #endif 61 67 } 62 68 … … 72 78 delete [] m_aiViewOrderIndex; 73 79 delete [] m_aiViewReceived; 80 81 #if MERL_VSP_C0152 82 xDeleteArray( m_adBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 83 xDeleteArray( m_aiBaseViewShiftLUT, MAX_VIEW_NUM, MAX_VIEW_NUM, 2 ); 84 #endif 74 85 } 75 86 … … 85 96 m_uiMaxViewId = 0; 86 97 } 98 99 #if MERL_VSP_C0152 100 Void 101 CamParsCollector::xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT) 102 { 103 //AOF( m_uiBitDepthForLUT == 8 ); 104 //AOF(radLUT == NULL && raiLUT == NULL ); 105 106 uiNumberSourceViews = Max( 1, uiNumberSourceViews ); 107 uiNumberTargetViews = Max( 1, uiNumberTargetViews ); 108 109 radLUT = new Double***[ uiNumberSourceViews ]; 110 raiLUT = new Int ***[ uiNumberSourceViews ]; 111 112 for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ ) 113 { 114 radLUT [ uiSourceView ] = new Double**[ uiNumberTargetViews ]; 115 raiLUT [ uiSourceView ] = new Int **[ uiNumberTargetViews ]; 116 117 for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ ) 118 { 119 radLUT [ uiSourceView ][ uiTargetView ] = new Double*[ 2 ]; 120 radLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ]; 121 radLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ]; 122 123 raiLUT [ uiSourceView ][ uiTargetView ] = new Int* [ 2 ]; 124 raiLUT [ uiSourceView ][ uiTargetView ][ 0 ] = new Int [ 257 ]; 125 raiLUT [ uiSourceView ][ uiTargetView ][ 1 ] = new Int [ 257 ]; 126 } 127 } 128 } 129 130 Void 131 CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT) 132 { 133 Int iLog2DivLuma = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision; AOF( iLog2DivLuma > 0 ); 134 Int iLog2DivChroma = iLog2DivLuma + 1; 135 136 iOffset <<= m_uiBitDepthForLUT; 137 138 Double dScale = (Double) iScale / (( Double ) ( 1 << iLog2DivLuma )); 139 Double dOffset = (Double) iOffset / (( Double ) ( 1 << iLog2DivLuma )); 140 141 // offsets including rounding offsets 142 Int64 iOffsetLuma = iOffset + ( ( 1 << iLog2DivLuma ) >> 1 ); 143 Int64 iOffsetChroma = iOffset + ( ( 1 << iLog2DivChroma ) >> 1 ); 144 145 146 for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ ) 147 { 148 149 // real-valued look-up tables 150 Double dShiftLuma = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision ); 151 Double dShiftChroma = dShiftLuma / 2; 152 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma; 153 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = dShiftChroma; 154 155 // integer-valued look-up tables 156 Int64 iTempScale = (Int64)uiDepthValue * iScale; 157 Int64 iShiftLuma = ( iTempScale + iOffsetLuma ) >> iLog2DivLuma; 158 Int64 iShiftChroma = ( iTempScale + iOffsetChroma ) >> iLog2DivChroma; 159 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = (Int)iShiftLuma; 160 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = (Int)iShiftChroma; 161 162 // maximum deviation 163 //dMaxDispDev = Max( dMaxDispDev, fabs( Double( (Int) iTestScale ) - dShiftLuma * Double( 1 << iLog2DivLuma ) ) / Double( 1 << iLog2DivLuma ) ); 164 //dMaxRndDispDvL = Max( dMaxRndDispDvL, fabs( Double( (Int) iShiftLuma ) - dShiftLuma ) ); 165 //dMaxRndDispDvC = Max( dMaxRndDispDvC, fabs( Double( (Int) iShiftChroma ) - dShiftChroma ) ); 166 } 167 168 radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 169 radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 170 raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ]; 171 raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ]; 172 } 173 #endif // end MERL_VSP_C0152 87 174 88 175 Void … … 167 254 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 168 255 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 256 #if MERL_VSP_C0152 257 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 258 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT); 259 #endif 169 260 } 170 261 else … … 174 265 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedScale () [ uiBaseId ]; 175 266 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getSPS()->getInvCodedOffset() [ uiBaseId ]; 267 #if MERL_VSP_C0152 268 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 269 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 270 #endif 176 271 } 177 272 } … … 188 283 m_aaiCodedScale [ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedScale () [ uiBaseId ]; 189 284 m_aaiCodedOffset[ uiViewId ][ uiBaseId ] = pcSlice->getInvCodedOffset() [ uiBaseId ]; 285 #if MERL_VSP_C0152 286 xInitLUTs( uiBaseId, uiViewId, m_aaiCodedScale[ uiBaseId ][ uiViewId ], m_aaiCodedOffset[ uiBaseId ][ uiViewId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 287 xInitLUTs( uiViewId, uiBaseId, m_aaiCodedScale[ uiViewId ][ uiBaseId ], m_aaiCodedOffset[ uiViewId ][ uiBaseId ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT ); 288 #endif 190 289 } 191 290 } … … 258 357 #endif 259 358 #if ENC_DEC_TRACE 260 g_hTrace = fopen( "TraceDec.txt", "wb" );359 if(!g_hTrace) g_hTrace = fopen( "TraceDec.txt", "wb" ); 261 360 g_bJustDoIt = g_bEncDecTraceDisable; 262 361 g_nSymbolCounter = 0; … … 277 376 { 278 377 #if ENC_DEC_TRACE 279 fclose( g_hTrace ); 378 if(g_hTrace) fclose( g_hTrace ); 379 g_hTrace=NULL; 280 380 #endif 281 381 } … … 304 404 m_cResidualGenerator.destroy(); 305 405 #endif 406 306 407 } 307 408 … … 1109 1210 initWedgeLists(); 1110 1211 } 1212 #endif 1213 1214 #if MERL_VSP_C0152 // set BW LUT 1215 if( m_pcCamParsCollector ) // Initialize the LUT elements 1216 { 1217 m_pcCamParsCollector->setSlice( pcSlice ); 1218 } 1219 if( pcSlice->getViewId() !=0 ) 1220 { 1221 TComPic* pcBaseTxtPic = m_tAppDecTop->getPicFromView( 0, pcSlice->getPOC(), false ); // get base view reconstructed texture 1222 TComPic* pcBaseDepthPic = m_tAppDecTop->getPicFromView( 0, pcSlice->getPOC(), true ); // get base view reconstructed depth 1223 pcSlice->setRefPicBaseTxt(pcBaseTxtPic); 1224 pcSlice->setRefPicBaseDepth(pcBaseDepthPic); 1225 } 1226 getTAppDecTop()->setBWVSPLUT( pcSlice, pcSlice->getViewId(), pcSlice->getPOC() ); // get the LUT for backward warping 1111 1227 #endif 1112 1228 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibDecoder/TDecTop.h
r210 r231 77 77 Bool isInitialized() const { return m_bInitialized; } 78 78 79 #if MERL_VSP_C0152 80 Int**** getBaseViewShiftLUTI() { return m_aiBaseViewShiftLUT; } 81 #endif 79 82 private: 80 83 Bool xIsComplete (); … … 97 100 Int m_iLastPOC; 98 101 UInt m_uiMaxViewId; 102 103 #if MERL_VSP_C0152 104 UInt m_uiBitDepthForLUT; 105 UInt m_iLog2Precision; 106 UInt m_uiInputBitDepth; 107 // look-up tables 108 Double**** m_adBaseViewShiftLUT; ///< Disparity LUT 109 Int**** m_aiBaseViewShiftLUT; ///< Disparity LUT 110 Void xCreateLUTs( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Double****& radLUT, Int****& raiLUT); 111 Void xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT); 112 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ); 113 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize1, UInt uiSize2 ); 114 template<class T> Void xDeleteArray ( T*& rpt, UInt uiSize ); 115 #endif 116 99 117 }; 118 119 #if MERL_VSP_C0152 120 template <class T> 121 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2, UInt uiSize3 ) 122 { 123 if( rpt ) 124 { 125 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 126 { 127 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 128 { 129 for( UInt uiM = 0; uiM < uiSize3; uiM++ ) 130 { 131 delete[] rpt[ uiK ][ uiL ][ uiM ]; 132 } 133 delete[] rpt[ uiK ][ uiL ]; 134 } 135 delete[] rpt[ uiK ]; 136 } 137 delete[] rpt; 138 } 139 rpt = NULL; 140 }; 141 142 143 template <class T> 144 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize1, UInt uiSize2 ) 145 { 146 if( rpt ) 147 { 148 for( UInt uiK = 0; uiK < uiSize1; uiK++ ) 149 { 150 for( UInt uiL = 0; uiL < uiSize2; uiL++ ) 151 { 152 delete[] rpt[ uiK ][ uiL ]; 153 } 154 delete[] rpt[ uiK ]; 155 } 156 delete[] rpt; 157 } 158 rpt = NULL; 159 }; 160 161 162 template <class T> 163 Void CamParsCollector::xDeleteArray( T*& rpt, UInt uiSize ) 164 { 165 if( rpt ) 166 { 167 for( UInt uiK = 0; uiK < uiSize; uiK++ ) 168 { 169 delete[] rpt[ uiK ]; 170 } 171 delete[] rpt; 172 } 173 rpt = NULL; 174 }; 175 176 #endif 100 177 101 178 /// decoder class … … 206 283 ParameterSetManagerDecoder* xGetParaSetDec () {return &m_parameterSetManagerDecoder;} 207 284 #endif 285 208 286 protected: 209 287 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncCu.cpp
r189 r231 1890 1890 1891 1891 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level 1892 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 1893 1892 #if MERL_VSP_C0152 1893 Int iVSPIndexTrue[3] = {-1, -1, -1}; 1894 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 1895 #else 1896 rpcTempCU->getInterMergeCandidates( 0, 0, uhDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 1897 #endif 1894 1898 #if FAST_DECISION_FOR_MRG_RD_COST 1895 1899 Bool bestIsSkip = false; … … 1933 1937 rpcTempCU->setMergeFlagSubParts( true, 0, 0, uhDepth ); // interprets depth relative to LCU level 1934 1938 rpcTempCU->setMergeIndexSubParts( uiMergeCand, 0, 0, uhDepth ); // interprets depth relative to LCU level 1939 #if MERL_VSP_C0152 1940 { 1941 Int iVSPIdx = 0; 1942 Int numVSPIdx; 1943 numVSPIdx = 3; 1944 for (Int i = 0; i < numVSPIdx; i++) 1945 { 1946 if (iVSPIndexTrue[i] == uiMergeCand) 1947 { 1948 iVSPIdx = i+1; 1949 break; 1950 } 1951 } 1952 rpcTempCU->setVSPIndexSubParts( iVSPIdx, 0, 0, uhDepth ); 1953 } 1954 #endif 1935 1955 rpcTempCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeCand], 0, 0, uhDepth ); // interprets depth relative to LCU level 1936 1956 rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level … … 1952 1972 #endif 1953 1973 { 1974 #if MERL_VSP_C0152 1975 m_pcPredSearch->motionCompensationBWVSP ( rpcTempCU, m_ppcPredYuvTemp[uhDepth], rpcTempCU->getZorderIdxInCU() ); 1976 #else 1954 1977 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 1978 #endif 1955 1979 // save pred adress 1956 1980 pcPredYuvTemp = m_ppcPredYuvTemp[uhDepth]; … … 1962 1986 if( bestIsSkip) 1963 1987 { 1988 #if MERL_VSP_C0152 1989 m_pcPredSearch->motionCompensationBWVSP ( rpcTempCU, m_ppcPredYuvTemp[uhDepth], rpcTempCU->getZorderIdxInCU() ); 1990 #else 1964 1991 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 1992 #endif 1965 1993 // save pred adress 1966 1994 pcPredYuvTemp = m_ppcPredYuvTemp[uhDepth]; … … 2065 2093 2066 2094 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); 2095 2067 2096 #if HHI_INTER_VIEW_RESIDUAL_PRED 2068 2097 rpcTempCU->setResPredAvailSubParts( bResPrdAvail, 0, 0, uhDepth ); … … 2084 2113 #if HHI_INTERVIEW_SKIP 2085 2114 #if LG_RESTRICTEDRESPRED_M24766 2086 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG 2115 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcResPredTmp[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG); 2087 2116 #else 2088 2117 m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bSkipRes, bUseMRG ); … … 2787 2816 assert( rpcTempCU->getInterDir( ui ) != 0 ); 2788 2817 assert( rpcTempCU->getPredictionMode( ui ) != MODE_NONE ); 2789 } 2818 #if MERL_VSP_C0152 2819 Int vspIdx = pcTextureCU->getVSPIndex( rpcTempCU->getZorderIdxInCU() + ui); 2820 rpcTempCU->setVSPIndex( ui , vspIdx); 2821 #endif 2822 } 2823 2790 2824 rpcTempCU->setPredModeSubParts( bSkipResidual ? MODE_SKIP : MODE_INTER, 0, uhDepth ); 2825 #if MERL_VSP_C0152 2826 m_pcPredSearch->motionCompensationBWVSP( rpcTempCU, m_ppcPredYuvTemp[uhDepth], rpcTempCU->getZorderIdxInCU() ); 2827 #else 2791 2828 m_pcPredSearch->motionCompensation( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 2792 2829 #endif 2793 2830 // get Original YUV data from picture 2794 2831 m_ppcOrigYuv[uhDepth]->copyFromPicYuv( rpcBestCU->getPic()->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncCu.h
r56 r231 81 81 TComYuv** m_ppcResPredTmp; ///< Temporary residual prediction for each depth 82 82 #endif 83 83 84 84 // Data : encoder control 85 85 Bool m_bEncodeDQP; … … 121 121 /// destroy internal buffers 122 122 Void destroy (); 123 123 124 124 /// CU analysis function 125 125 Void compressCU ( TComDataCU*& rpcCU ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncEntropy.cpp
r210 r231 1347 1347 uiAbsPartIdx = 0; 1348 1348 } 1349 1349 1350 1350 #if RWTH_SDC_DLT_B0036 1351 1351 if( pcCU->getSDCFlag(uiAbsPartIdx) ) … … 1355 1355 } 1356 1356 #endif 1357 1357 1358 1358 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 1359 1359 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncGOP.cpp
r210 r231 254 254 pcSlice->setSliceIdx(0); 255 255 pcSlice->setViewId( m_pcEncTop->getViewId() ); 256 pcSlice->setIsDepth( m_pcEncTop->getIsDepth() ); 256 pcSlice->setIsDepth( m_pcEncTop->getIsDepth() ); 257 257 258 258 m_pcEncTop->getSPS()->setDisInter4x4(m_pcEncTop->getDisInter4x4()); … … 340 340 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDV) ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 341 341 #else 342 343 Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId()) ? 1: 0;344 pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) );345 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 346 #endif 347 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();348 refPicListModification->setRefPicListModificationFlagL0( false );342 Bool bNalRAP = ((getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_CRA) || (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)) && (pcSlice->getSPS()->getViewId()) ? 1: 0; 343 pcSlice->setNumRefIdx( REF_PIC_LIST_0, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 344 pcSlice->setNumRefIdx( REF_PIC_LIST_1, min( m_pcCfg->getGOPEntry( bNalRAP ? MAX_GOP : iGOPid ).m_numRefPicsActive, (pcSlice->getRPS()->getNumberOfPictures() + pcSlice->getSPS()->getNumberOfUsableInterViewRefs()) ) ); 345 #endif 346 347 TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification(); 348 refPicListModification->setRefPicListModificationFlagL0( false ); 349 349 #if !H0137_0138_LIST_MODIFICATION 350 350 refPicListModification->setNumberOfRefPicListModificationsL0(0); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSbac.cpp
r210 r231 1277 1277 xWriteUnaryMaxSymbol( iRefFrame - 1, pCtx + 1, 1, pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_C )-2 ); 1278 1278 } 1279 #if MERL_VSP_C0152 1280 else if (iRefFrame < 0) // NOT_VALID 1281 { 1282 assert(0); 1283 } 1284 #endif 1279 1285 } 1280 1286 else … … 1288 1294 xWriteUnaryMaxSymbol( iRefFrame - 1, pCtx + 1, 1, pcCU->getSlice()->getNumRefIdx( eRefList )-2 ); 1289 1295 } 1296 #if MERL_VSP_C0152 1297 else if (iRefFrame < 0) // NOT_VALID 1298 { 1299 assert(0); 1300 } 1301 #endif 1290 1302 } 1291 1303 return; -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSearch.cpp
r210 r231 696 696 UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey, 697 697 TComMv baseRefMv, 698 Int iFrac, TComMv& rcMvFrac ) 698 Int iFrac, TComMv& rcMvFrac 699 ) 699 700 { 700 701 UInt uiDist; … … 1688 1689 // reconstruct residual based on mask + DC residuals 1689 1690 Pel apDCResiValues[2]; 1690 Pel apDCRecoValues[2];1691 //Pel apDCRecoValues[2]; 1691 1692 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 1692 1693 { … … 1695 1696 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1696 1697 1697 apDCRecoValues[uiSegment] = pRecoValue;1698 //apDCRecoValues[uiSegment] = pRecoValue; 1698 1699 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 1699 1700 } … … 2897 2898 Void TEncSearch::xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiErr, Bool bHadamard ) 2898 2899 { 2900 #if !MERL_VSP_C0152 2899 2901 motionCompensation( pcCU, &m_tmpYuvPred, REF_PIC_LIST_X, iPartIdx ); 2900 2902 #endif 2901 2903 UInt uiAbsPartIdx = 0; 2902 2904 Int iWidth = 0; 2903 2905 Int iHeight = 0; 2904 2906 pcCU->getPartIndexAndSize( iPartIdx, uiAbsPartIdx, iWidth, iHeight ); 2905 2907 #if MERL_VSP_C0152 2908 motionCompensationBWVSP( pcCU, &m_tmpYuvPred, pcCU->getZorderIdxInCU(), REF_PIC_LIST_X, iPartIdx ); 2909 #endif 2906 2910 DistParam cDistParam; 2907 2911 … … 2943 2947 #else 2944 2948 #if LG_RESTRICTEDRESPRED_M24766 2949 #if MERL_VSP_C0152 2950 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue ) 2951 #else 2945 2952 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2953 #endif 2946 2954 #else 2947 2955 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) … … 2988 2996 } 2989 2997 #else 2998 #if MERL_VSP_C0152 2999 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 3000 #else 2990 3001 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 2991 3002 #endif 3003 #endif 3004 2992 3005 2993 3006 #if HHI_INTER_VIEW_MOTION_PRED … … 3009 3022 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3010 3023 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3024 #if MERL_VSP_C0152 3025 { 3026 Int iVSPIdx = 0; 3027 Int numVSPIdx; 3028 numVSPIdx = 3; 3029 for (Int i = 0; i < numVSPIdx; i++) 3030 { 3031 if (iVSPIndexTrue[i] == uiMergeCand) 3032 { 3033 iVSPIdx = i+1; 3034 break; 3035 } 3036 } 3037 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3038 } 3039 #endif 3011 3040 #if LG_RESTRICTEDRESPRED_M24766 3012 3041 Int iAddResiShift; … … 3081 3110 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 3082 3111 #else 3083 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 3112 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG) 3084 3113 #endif 3085 3114 #else … … 3185 3214 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 3186 3215 UInt uiBitsTempL0[MAX_NUM_REF]; 3216 3187 3217 #if LG_RESTRICTEDRESPRED_M24766 3188 3218 Int iPUResiPredShift[4] = {0, 0, 0, 0}; … … 3191 3221 3192 3222 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 3193 3223 #if MERL_VSP_C0152 3224 //reset the VSP flag to be 0 3225 pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3226 #endif 3194 3227 #if AMP_MRG 3195 3228 Bool bTestNormalMC = true; … … 3206 3239 Bool bLastResiFlag = false; 3207 3240 #endif 3241 3208 3242 // Uni-directional prediction 3209 3243 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) … … 3545 3579 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3546 3580 } 3547 3581 3548 3582 if ( uiCostTemp < uiCostBi ) 3549 3583 { … … 3793 3827 TComMvField cMRGMvField[2]; 3794 3828 UInt uiMRGIndex = 0; 3795 3829 #if MERL_VSP_C0152 3830 Int iVSPIndexTrue[3] = {-1, -1, -1}; 3831 #endif 3796 3832 UInt uiMEInterDir = 0; 3797 3833 TComMvField cMEMvField[2]; … … 3844 3880 #else 3845 3881 #if LG_RESTRICTEDRESPRED_M24766 3882 #if MERL_VSP_C0152 3883 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, iVSPIndexTrue ); 3884 #else 3846 3885 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3886 #endif 3847 3887 #else 3848 3888 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); … … 3854 3894 pcCU->setMergeFlagSubParts ( true, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3855 3895 pcCU->setMergeIndexSubParts( uiMRGIndex, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3896 #if MERL_VSP_C0152 3897 { 3898 Int iVSPIdx = 0; 3899 Int numVSPIdx; 3900 numVSPIdx = 3; 3901 for (Int i = 0; i < numVSPIdx; i++) 3902 { 3903 if (iVSPIndexTrue[i] == uiMRGIndex) 3904 { 3905 iVSPIdx = i+1; 3906 break; 3907 } 3908 } 3909 pcCU->setVSPIndexSubParts( iVSPIdx, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3910 } 3911 #endif 3856 3912 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3857 3913 { … … 3873 3929 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3874 3930 pcCU->setInterDirSubParts ( uiMEInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3931 #if MERL_VSP_C0152 3932 pcCU->setVSPIndexSubParts ( 0 , uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3933 #endif 3875 3934 { 3876 3935 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMEMvField[0], ePartSize, uiPartAddr, 0, iPartIdx ); … … 3881 3940 3882 3941 // MC 3942 #if MERL_VSP_C0152 3943 motionCompensationBWVSP ( pcCU, rpcPredYuv, pcCU->getZorderIdxInCU(), REF_PIC_LIST_X, iPartIdx); 3944 #else 3883 3945 motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx ); 3884 3946 #endif 3885 3947 } // end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 3886 3948 … … 4338 4400 m_pcRdCost->setMultiviewReg( 0 ); 4339 4401 #endif 4402 4340 4403 setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList ); 4341 4404 // Do integer search … … 4351 4414 4352 4415 m_pcRdCost->getMotionCost( 1, 0 ); 4416 4353 4417 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 4354 4418 if( ! pcCU->getSlice()->getIsDepth() ) … … 4378 4442 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4379 4443 #endif 4380 4444 4381 4445 ruiBits += uiMvBits; 4382 4446 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4723 4787 rcMvQter = *pcMvInt; rcMvQter <<= 1; // for mv-cost 4724 4788 rcMvQter += rcMvHalf; rcMvQter <<= 1; 4725 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter 4789 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter); 4726 4790 } 4727 4791 … … 4758 4822 #endif 4759 4823 // No residual coding : SKIP mode 4760 if ( ePredMode == MODE_SKIP && bSkipRes)4824 if ( (ePredMode == MODE_SKIP && bSkipRes) ) 4761 4825 { 4762 4826 rpcYuvResi->clear(); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSearch.h
r210 r231 152 152 UInt xPatternRefinement( TComPattern* pcPatternKey, 153 153 TComMv baseRefMv, 154 Int iFrac, TComMv& rcMvFrac 154 Int iFrac, TComMv& rcMvFrac); 155 155 156 156 typedef struct … … 513 513 Int& numValidMergeCand 514 514 #endif 515 #if MERL_VSP_C0152 516 , Int* iVSPIndexTrue 517 #endif 515 518 ); 516 519 // ------------------------------------------------------------------------------------------------------------------- … … 579 582 TComMv& rcMvQter, 580 583 UInt& ruiCost 581 ,Bool biPred 582 ); 584 ,Bool biPred); 583 585 584 586 Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSlice.cpp
r210 r231 811 811 m_pcBufferLowLatSbacCoders[ui].load(m_pppcRDSbacCoder[0][CI_CURR_BEST]); //init. state 812 812 } 813 814 #if MERL_VSP_C0152 815 // Send Depth/Texture pointers to slice level 816 pcSlice->setBWVSPLUTParam(m_aiShiftLUT, m_iShiftPrec); 817 pcSlice->setRefPicBaseTxt(m_pPicBaseTxt); 818 pcSlice->setRefPicBaseDepth(m_pPicBaseDepth); 819 #endif 820 813 821 UInt uiWidthInLCUs = rpcPic->getPicSym()->getFrameWidthInCU(); 814 822 //UInt uiHeightInLCUs = rpcPic->getPicSym()->getFrameHeightInCU(); … … 1138 1146 1139 1147 UInt uiEncCUOrder; 1148 1140 1149 uiCUAddr = rpcPic->getPicSym()->getCUOrderMap( uiStartCUAddr /rpcPic->getNumPartInCU()); /*for tiles, uiStartCUAddr is NOT the real raster scan address, it is actually 1141 1150 an encoding order index, so we need to convert the index (uiStartCUAddr) -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSlice.h
r210 r231 101 101 102 102 UInt m_uiSliceIdx; 103 104 #if MERL_VSP_C0152 105 // Data temporarily stored, will be sent to TComSlice level where the data will be actually used 106 TComPic* m_pPicBaseTxt; 107 TComPic* m_pPicBaseDepth; 108 Int* m_aiShiftLUT; 109 Int m_iShiftPrec; 110 #endif 111 103 112 public: 104 113 TEncSlice(); … … 128 137 UInt getSliceIdx() { return m_uiSliceIdx; } 129 138 Void setSliceIdx(UInt i) { m_uiSliceIdx = i; } 139 140 #if MERL_VSP_C0152 141 Void setBWVSPLUTParam ( Int *pShiftLUT, Int iLoG2LUTPrec ) { m_aiShiftLUT = pShiftLUT; m_iShiftPrec = 2-iLoG2LUTPrec; } 142 Void setRefPicBaseTxt ( TComPic*pPicTxt ) { m_pPicBaseTxt = pPicTxt; } 143 Void setRefPicBaseDepth ( TComPic*pPicDepth ) { m_pPicBaseDepth = pPicDepth;} 144 Void getBWVSPLUTParam ( Int*& pShiftLUT, Int& iShiftPrec ) { pShiftLUT = m_aiShiftLUT; iShiftPrec = m_iShiftPrec; } 145 TComPic* getRefPicBaseTxt () { return m_pPicBaseTxt; } 146 TComPic* getRefPicBaseDepth () { return m_pPicBaseDepth; } 147 #endif 130 148 }; 131 149 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibRenderer/TRenFilter.cpp
r56 r231 1154 1154 } 1155 1155 1156 1157 1156 // Down Sampling 1158 1157 // Down sample luma … … 1224 1223 } 1225 1224 } 1226 1227 1225 1228 1226 Void TRenFilter::xInterpHorChroma( Pel* piSrc, Int iSrcStride, Int iSrcStepX, Int iSrcStepY, Int iWidth, Int iHeight, Pel* piDst, Int iDstStride, Int iDstStepX, Int iDstStepY, FpChromaIntFilt fpFilter ) -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibRenderer/TRenInterpFilter.h
r56 r231 72 72 __inline Void xCTI_FilterQuarter1Hor(Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); 73 73 __inline Void xCTI_FilterQuarter1Hor(Int* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Pel*& rpiDst); 74 74 75 75 __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst, Int iDstStridePel, Pel*& rpiDstPel ); 76 76 __inline Void xCTI_FilterHalfVer (Pel* piSrc, Int iSrcStride, Int iSrcStep, Int iWidth, Int iHeight, Int iDstStride, Int iDstStep, Int*& rpiDst ); -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibRenderer/TRenSingleModel.h
r210 r231 33 33 34 34 #if !QC_MVHEVC_B0046 35 #ifndef __TRENSINGLEMODEL__ 35 #ifndef __TRENSINGLEMODEL__ 36 36 #define __TRENSINGLEMODEL__ 37 37 -
branches/HTM-5.1-dev3-MERL/source/Lib/TLibRenderer/TRenTop.cpp
r100 r231 193 193 } 194 194 195 196 195 Void TRenTop::xConvertOutputData( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror ) 197 196 { … … 1450 1449 1451 1450 for( Int iXPos = iSourcePos + 1; iXPos < iWidth; iXPos++) 1452 1451 { 1453 1452 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1454 1453 { 1455 1454 apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos]; 1456 1455 } 1457 1456 } 1458 1457 1459 1458 // Fill Left Gap … … 1469 1468 { 1470 1469 apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos]; 1471 1472 1470 } 1471 } 1473 1472 1474 1473 // Go to next line … … 2154 2153 { 2155 2154 m_aaiSubPelShift[uiEntry] = new Int[ iNumEntries ]; 2156 2155 } 2157 2156 2158 2157 TRenFilter::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);
Note: See TracChangeset for help on using the changeset viewer.