Changeset 326 in 3DVCSoftware
- Timestamp:
- 16 Apr 2013, 15:04:31 (12 years ago)
- Location:
- branches/HTM-6.1-Cleanup/source/Lib/TLibCommon
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/CommonDef.h
r314 r326 140 140 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..4) 141 141 142 #if H3D_IVMP143 #define DMV_MERGE_POS 4144 #else145 #define DMV_MERGE_POS 1146 #endif147 148 142 #if H3D_IVMP&!H3D_NBDV 149 143 #define PDM_AMVP_POS 0 // position of pdm in amvp list (0..3) -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
r325 r326 3694 3694 #endif 3695 3695 3696 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0)3696 if( iPdmDir[0] && !bNoPdmMerge ) 3697 3697 { 3698 3698 abCandIsInter [ iCount ] = true; … … 3725 3725 } 3726 3726 iCount ++; 3727 } 3728 3729 if(extraMergeCand) 3730 { 3731 if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 1) 3732 { 3733 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 3734 abCandIsInter [ iCount ] = true; 3735 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; 3736 if( ( iPdmDir[1] & 1 ) == 1 ) 3737 { 3738 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] ); 3739 } 3740 if( ( iPdmDir[1] & 2 ) == 2 ) 3741 { 3742 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] ); 3743 } 3744 #if H3D_NBDV 3745 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3746 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3747 #endif 3748 if ( mrgCandIdx == iCount ) 3749 return; 3750 iCount ++; 3751 } 3752 } 3727 } 3728 3753 3729 #endif // H3D_IVMP 3754 3730 … … 3837 3813 } 3838 3814 3839 #if H3D_IVMP3840 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 1 )3841 {3842 abCandIsInter [ iCount ] = true;3843 puhInterDirNeighbours[ iCount ] = iPdmInterDir;3844 if( ( iPdmInterDir & 1 ) == 1 )3845 {3846 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );3847 }3848 #if FIX_CU_BASED_MRG_CAND_LIST_B01363849 else3850 {3851 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );3852 }3853 #endif3854 if( ( iPdmInterDir & 2 ) == 2 )3855 {3856 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );3857 }3858 #if FIX_CU_BASED_MRG_CAND_LIST_B01363859 else3860 {3861 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );3862 }3863 #endif3864 if ( mrgCandIdx == iCount )3865 {3866 return;3867 }3868 iCount ++;3869 }3870 #endif // H3D_IVMP3871 3872 #if MERL_VSP_COMPENSATION_C01523873 //===== vsp 1 =====3874 if( iCount < 4 + extraMergeCand )3875 if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )3876 return;3877 #endif3878 3879 3815 // above 3880 3816 UInt uiAbovePartIdx = 0; … … 3949 3885 } 3950 3886 3951 #if H3D_IVMP3952 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 2 )3953 {3954 abCandIsInter [ iCount ] = true;3955 puhInterDirNeighbours[ iCount ] = iPdmInterDir;3956 if( ( iPdmInterDir & 1 ) == 1 )3957 {3958 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );3959 }3960 #if FIX_CU_BASED_MRG_CAND_LIST_B01363961 else3962 {3963 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );3964 }3965 #endif3966 if( ( iPdmInterDir & 2 ) == 2 )3967 {3968 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );3969 }3970 #if FIX_CU_BASED_MRG_CAND_LIST_B01363971 else3972 {3973 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );3974 }3975 #endif3976 if ( mrgCandIdx == iCount )3977 {3978 return;3979 }3980 iCount ++;3981 }3982 #endif // H3D_IVMP3983 3984 #if MERL_VSP_COMPENSATION_C01523985 //===== vsp 2 =====3986 if( iCount < 4 + extraMergeCand )3987 if ( !xAddVspMergeCand(2, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )3988 return;3989 #endif3990 3991 3887 // above right 3992 3888 UInt uiAboveRightPartIdx = 0; … … 4036 3932 4037 3933 #if H3D_IVMP 4038 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 3 )4039 {4040 abCandIsInter [ iCount ] = true;4041 puhInterDirNeighbours[ iCount ] = iPdmInterDir;4042 if( ( iPdmInterDir & 1 ) == 1 )4043 {4044 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );4045 }4046 #if FIX_CU_BASED_MRG_CAND_LIST_B01364047 else4048 {4049 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );4050 }4051 #endif4052 if( ( iPdmInterDir & 2 ) == 2 )4053 {4054 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );4055 }4056 #if FIX_CU_BASED_MRG_CAND_LIST_B01364057 else4058 {4059 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );4060 }4061 #endif4062 if ( mrgCandIdx == iCount )4063 {4064 return;4065 }4066 iCount ++;4067 }4068 3934 4069 3935 if(extraMergeCand) 4070 3936 { 4071 if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 4)3937 if(!bNoPdmMerge && iPdmDir[1] ) 4072 3938 { 4073 3939 assert(iCount < MRG_MAX_NUM_CANDS_MEM); … … 4114 3980 #endif // H3D_IVMP 4115 3981 4116 #if MERL_VSP_COMPENSATION_C01524117 //===== vsp 3 =====4118 if( iCount < 4 + extraMergeCand )4119 if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) )4120 return;4121 #endif4122 4123 #if MERL_VSP_C01524124 #if VSP_MERGE_POS < 44125 #if H3D_IVMP4126 if( iCount < 4 + extraMergeCand )4127 #else4128 if( iCount < 4 )4129 #endif4130 {4131 #endif4132 #endif4133 3982 4134 3983 //left bottom … … 4177 4026 iCount ++; 4178 4027 } 4179 #if MERL_VSP_C0152 4180 #if VSP_MERGE_POS < 4 4181 } 4182 #endif 4183 #endif 4184 4185 #if H3D_IVMP 4186 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 4 ) 4187 { 4188 abCandIsInter [ iCount ] = true; 4189 puhInterDirNeighbours[ iCount ] = iPdmInterDir; 4190 if( ( iPdmInterDir & 1 ) == 1 ) 4191 { 4192 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 4193 } 4194 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4195 else 4196 { 4197 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 4198 } 4199 #endif 4200 if( ( iPdmInterDir & 2 ) == 2 ) 4201 { 4202 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 4203 } 4204 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4205 else 4206 { 4207 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4208 } 4209 #endif 4210 if ( mrgCandIdx == iCount ) 4211 { 4212 return; 4213 } 4214 iCount ++; 4215 } 4216 #endif // H3D_IVMP 4217 4218 #if MERL_VSP_COMPENSATION_C0152 4219 //===== vsp 4 ===== 4220 if( iCount < 4 + extraMergeCand ) 4221 if ( !xAddVspMergeCand(4, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4222 return; 4223 #endif 4028 4224 4029 4225 4030 // above left … … 5199 5004 } 5200 5005 else if ( bSearchForMvpDv && cMvPred.m_bDvMcp && bTmpIsSkipped ) 5201 {5006 { 5202 5007 paMvpDvInfo->m_acMvCand[iList][ uiMvpDvPos ] = cMvPred; 5203 5008 paMvpDvInfo->m_aVIdxCan[iList][ uiMvpDvPos ] = refViewIdx; … … 5212 5017 if (picDepth && bDepthRefine) 5213 5018 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5214 5019 5215 5020 cMvPred.setVer(0); 5216 5021 … … 5276 5081 #endif 5277 5082 ) 5278 5083 { 5279 5084 //// ******* Init variables ******* ///// 5280 5085 // Init disparity struct for results … … 5291 5096 cMvpDvInfo.m_aVIdxCan[iList][iCurDvMcpCand] = 0; 5292 5097 cMvpDvInfo.m_bAvailab[iList][iCurDvMcpCand] = false; 5293 5294 5295 5098 } 5099 } 5100 5296 5101 // Get Positions 5297 5102 PartSize eCUMode = getPartitionSize( uiPartAddr ); … … 5308 5113 //// ******* Get disparity from temporal neighboring blocks ******* ///// 5309 5114 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 5310 5115 { 5311 5116 TComMv cColMv; 5312 5117 Int iTargetViewIdx = 0; 5313 5118 Int iTStartViewIdx = 0; 5314 5119 5315 5120 ///*** Derive center position *** 5316 5121 UInt uiPartIdxCenter; … … 5329 5134 const Int iNumCandPics = 2; 5330 5135 for(Int curCandPic = 0; curCandPic < iNumCandPics; curCandPic++) 5331 5136 { 5332 5137 // Get candidate picture 5333 5138 RefPicList eCurRefPicList = REF_PIC_LIST_0 ; 5334 5139 Int curCandPicRefIdx = 0; 5335 5140 5336 5141 if( curCandPic == 0 ) // check the co-located picture 5337 5142 { 5338 5143 eCurRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 5339 5144 curCandPicRefIdx = getSlice()->getColRefIdx(); 5340 5145 } 5341 5146 else // check RAP 5342 5147 { … … 5346 5151 eCurRefPicList = getPic()->getRapRefList(); 5347 5152 curCandPicRefIdx = getPic()->getRapRefIdx(); 5348 5349 5350 5153 } 5154 5155 // Check BR and Center 5351 5156 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eCurRefPicList, curCandPicRefIdx)->getViewId() ) 5157 { 5158 for(Int curPosition = 0; curPosition < 2; curPosition++) 5352 5159 { 5353 for(Int curPosition = 0; curPosition < 2; curPosition++)5354 {5355 5160 Bool bCheck = false; 5356 5161 if ( curPosition == 0 && iLCUIdxRBNb >= 0 ) … … 5361 5166 5362 5167 if( bCheck ) 5363 5168 { 5364 5169 clipMv(cColMv); 5365 5170 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5366 5367 5368 5369 5370 5171 if (picDepth && bDepthRefine) 5172 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5173 5174 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5175 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5371 5176 return ; 5372 5177 } 5373 5178 } // Loop positions 5374 5179 } 5375 5180 } // Loop candidate views 5376 5181 } // if TMVP Flag … … 5379 5184 Bool bCheckMcpDv = false; 5380 5185 TComDataCU* pcTmpCU = NULL; 5381 5186 5382 5187 5383 5188 //// ******* Get disparity from left block ******* ///// … … 5398 5203 bCheckMcpDv = true; 5399 5204 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFT ) ) 5400 5205 return; 5401 5206 5402 5207 … … 5417 5222 5418 5223 if(pcTmpCU != NULL ) 5419 5224 { 5420 5225 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5421 5226 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVE ) ) 5422 5423 5424 5425 //// ******* Get disparity from above right block ******* /////5227 return; 5228 } 5229 5230 //// ******* Get disparity from above right block ******* ///// 5426 5231 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 5427 5232 … … 5435 5240 5436 5241 if(pcTmpCU != NULL ) 5437 5242 { 5438 5243 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5439 5244 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVERIGHT ) ) 5440 5441 5442 5443 5444 //// ******* Get disparity from below left block ******* /////5245 return; 5246 } 5247 5248 5249 //// ******* Get disparity from below left block ******* ///// 5445 5250 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 5446 5251 … … 5454 5259 5455 5260 if( pcTmpCU != NULL ) 5456 5261 { 5457 5262 bCheckMcpDv = true; 5458 5263 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFTBELOW ) ) 5459 return; 5460 } 5461 5462 5463 //// ******* Get disparity from above left block ******* ///// 5464 5264 return; 5265 } 5266 5267 5268 //// ******* Get disparity from above left block ******* ///// 5465 5269 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 5466 5270 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); … … 5478 5282 bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1); 5479 5283 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVELEFT ) ) 5480 5481 5284 return; 5285 } 5482 5286 5483 5287 //// ******* Search MCP blocks ******* ///// 5484 5288 if( cMvpDvInfo.m_bFound ) 5485 5289 { 5486 5290 for( Int curPos = 1 ; curPos < MCP_DIS_CANS - 1 ; curPos++ ) 5291 { 5292 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5293 { 5294 if( cMvpDvInfo.m_bAvailab[iList][curPos] ) 5487 5295 { 5488 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++)5489 {5490 if( cMvpDvInfo.m_bAvailab[iList][curPos] )5491 {5492 5296 TComMv cDispVec = cMvpDvInfo.m_acMvCand[iList][ curPos ]; 5493 5297 clipMv( cDispVec ); 5494 5298 5495 5299 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5496 5300 if (picDepth && bDepthRefine) 5497 5301 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); 5498 5302 5499 5303 pDInfo->m_acMvCand[ pDInfo->iN] = cDispVec; 5500 5304 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 5501 5305 return; 5502 5306 } -
branches/HTM-6.1-Cleanup/source/Lib/TLibCommon/TComPicYuv.cpp
r313 r326 468 468 Void TComPicYuv::setLumaTo( Pel pVal ) 469 469 { 470 xSetPels( getLumaAddr(), getStride(), getWidth(), getHeight() >> 1, pVal );470 xSetPels( getLumaAddr(), getStride(), getWidth(), getHeight(), pVal ); 471 471 } 472 472
Note: See TracChangeset for help on using the changeset viewer.