Changeset 443 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 26 May 2013, 15:41:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r332 r443 53 53 #if MERL_VSP_C0152 54 54 55 #if MTK_D0156 56 #define CHECK_ADD_YET(pcCURef,uiIdx,vspIdx) && ( (!m_pcSlice->getSPS()->getUseVSPCompensation()) || (!( (pcCURef)->getVSPIndex(uiIdx) == vspIdx && bVspMvZeroDone[vspIdx-1] ))) 57 #else 55 58 #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 #endif 60 61 inline Void TComDataCU::xInheritVspMode( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo 62 #if QC_BVSP_CleanUP_D0191 63 , UChar *puhInterDirNeighbours 64 #endif 65 #if MERL_VSP_NBDV_RefVId_Fix_D0166 66 , Int* iVSPDirTrue 67 #endif 68 ) 69 { 70 #if MTK_D0156 71 if( !m_pcSlice->getSPS()->getUseVSPCompensation() ) 72 { 73 return; 74 } 75 #endif 76 59 77 Int vspIdx = (Int) pcCURef->getVSPIndex(uiIdx); 60 78 if( vspIdx != 0 ) … … 69 87 if (vspIdx < 4) 70 88 { 89 #if QC_BVSP_CleanUP_D0191 90 puhInterDirNeighbours[ iCount] = 1; 91 #endif 92 #if MERL_VSP_NBDV_RefVId_Fix_D0166 93 if(pDInfo->iN > 0 ) 94 { // using derived disparity and store corresponding used reference list and ref idx 95 iVSPDirTrue[idx] = pDInfo->m_aListIdx[0]; 96 assert(pDInfo->m_aRefIdx[0] < 0); 97 #if MTK_VSP_USING_NBDV_D0105 98 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 99 #else 100 pcMvFieldNeighbours[iCount<<1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 101 #endif 102 if ( pcCURef->getSlice()->isInterB() ) 103 { 104 #if MTK_VSP_USING_NBDV_D0105 105 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 106 #else 107 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 108 #endif 109 } 110 } 111 else 112 { // using the original neighboring block vsp reference list 113 TComMv cMvPred = pcCURef->getCUMvField(REF_PIC_LIST_0)->getMv(uiIdx); 114 Int refId = pcCURef->getCUMvField(REF_PIC_LIST_0)->getRefIdx(uiIdx); 115 116 assert(refId < 0); 117 iVSPDirTrue[idx] = pcCURef->getVSPDir(uiIdx); 118 pcMvFieldNeighbours[iCount<<1].setMvField( cMvPred, refId ); 119 if ( pcCURef->getSlice()->isInterB() ) 120 { 121 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cMvPred, refId ); 122 } 123 } 124 125 #else // !MERL_VSP_NBDV_RefVId_Fix_D0166 126 127 #if MTK_VSP_USING_NBDV_D0105 128 pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 129 #else 71 130 pcMvFieldNeighbours[ iCount<<1].setMvField ( pDInfo->m_acMvCand[0], NOT_VALID ); 131 #endif 72 132 if ( pcCURef->getSlice()->isInterB() ) 73 133 { 134 #if MTK_VSP_USING_NBDV_D0105 135 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField ( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 136 #else 74 137 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 { 138 #endif 139 } 140 #endif 141 } 142 } 143 } 144 145 inline Bool TComDataCU::xAddVspMergeCand( 146 UChar ucVspMergePos, 147 #if !LGE_VSP_INHERIT_D0092 148 Int vspIdx, 149 Bool* bVspMvZeroDone, 150 #endif 151 UInt uiDepth, 152 Bool* abCandIsInter, 153 Int& iCount, 154 UChar* puhInterDirNeighbours, 155 TComMvField* pcMvFieldNeighbours, 156 Int* iVSPIndexTrue, 157 Int mrgCandIdx, 158 DisInfo* pDInfo 159 #if MERL_VSP_NBDV_RefVId_Fix_D0166 160 , Int* iVspDirTrue 161 #endif 162 ) 163 { 164 #if MTK_D0156 165 if( !m_pcSlice->getSPS()->getUseVSPCompensation() ) 166 { 167 return true; 168 } 169 #endif 170 171 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 172 if (getSlice()->getSPS()->isDepth()) 173 { 174 return true; 175 } 176 #endif 177 83 178 #if MERL_VSP_C0152_BugFix_ForNoDepthCase 84 179 TComPic* pRefPicBaseDepth = NULL; 85 180 pRefPicBaseDepth = getSlice()->getRefPicBaseDepth(); 86 if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) // VSP can be used only when depth is used as input181 if(ucVspMergePos == VSP_MERGE_POS && pRefPicBaseDepth) // VSP can be used only when depth is used as input 87 182 #else 88 183 if( ucVspMergePos == VSP_MERGE_POS ) … … 90 185 if( ucVspMergePos == VSP_MERGE_POS ) 91 186 { 187 #if !LGE_VSP_INHERIT_D0092 92 188 Int idx = vspIdx - 1; 93 { 189 #endif 190 { 191 #if LGE_VSP_INHERIT_D0092 192 if( getSlice()->getSPS()->getViewId() != 0 ) 193 #else 94 194 if( getSlice()->getSPS()->getViewId() != 0 && bVspMvZeroDone[idx] == false ) 195 #endif 95 196 { 96 197 { 97 198 abCandIsInter [iCount] = true; 199 #if !LGE_VSP_INHERIT_D0092 98 200 bVspMvZeroDone[idx] = true; 201 #endif 99 202 100 203 // get Inter Dir … … 102 205 (getSlice()->getNumRefIdx(REF_PIC_LIST_0) > 0 ? 1 : 2)); 103 206 puhInterDirNeighbours[iCount] = iInterDir; // The direction information does not matter 207 #if QC_BVSP_CleanUP_D0191 208 puhInterDirNeighbours[iCount] = 1; 209 #endif 210 #if LGE_VSP_INHERIT_D0092 211 #if MERL_VSP_NBDV_RefVId_Fix_D0166 212 assert(pDInfo->m_aRefIdx[0] < 0); 213 iVspDirTrue[0] = pDInfo->m_aListIdx[0]; 214 Int iRefIdxList0 = NOT_VALID; 215 Int iRefIdxList1 = NOT_VALID; 216 iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_0)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_0)); 217 if ( getSlice()->isInterB() ) 218 { 219 iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_1)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_1)); 220 } 221 222 #if MTK_VSP_USING_NBDV_D0105 223 //pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], pDInfo->m_aListIdx[0]==REF_PIC_LIST_0 ? iRefIdxList0 :NOT_VALID ); 224 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], iRefIdxList0 ); 225 #else 226 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], iRefIdxList0 ); 227 #endif 228 if ( getSlice()->isInterB() ) 229 { 230 #if MTK_VSP_USING_NBDV_D0105 231 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdxList1 ); 232 //pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdxList1); 233 #else 234 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], iRefIdxList1); 235 #endif 236 } 237 iVSPIndexTrue[iCount] = 1; 238 #else 239 240 #if !MERL_General_Fix 241 Int iRefIdxList0 = NOT_VALID; 242 Int iRefIdxList1 = NOT_VALID; 243 iRefIdxList0 = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_0)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_0)); 244 if ( getSlice()->isInterB() ) 245 { 246 iRefIdxList1 = getSlice()->getRefPic(REF_PIC_LIST_1, 0)->getPOC()==getSlice()->getPOC() ? 0 : (getSlice()->getNewRefIdx(REF_PIC_LIST_1)==-1 ? NOT_VALID : getSlice()->getNewRefIdx(REF_PIC_LIST_1)); 247 } 248 #if MTK_VSP_USING_NBDV_D0105 249 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], iRefIdxList0 ); 250 #else 251 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], iRefIdxList0 ); 252 #endif 253 if ( getSlice()->isInterB() ) 254 { 255 #if MTK_VSP_USING_NBDV_D0105 256 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdxList1 ); 257 #else 258 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], iRefIdxList1); 259 #endif 260 } 261 iVSPIndexTrue[iCount] = 1; 262 #else 263 Int iRefIdx = NOT_VALID; 264 265 #if QC_BVSP_CleanUP_D0191 266 iRefIdx = getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==getSlice()->getPOC() ? 0: getSlice()->getNewRefIdx(REF_PIC_LIST_0); 267 #endif 268 #if MTK_VSP_USING_NBDV_D0105 269 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], iRefIdx ); 270 #else 271 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], iRefIdx ); 272 #endif 273 if ( getSlice()->isInterB() ) 274 { 275 #if MTK_VSP_USING_NBDV_D0105 276 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], iRefIdx ); 277 #else 278 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], iRefIdx ); 279 #endif 280 } 281 iVSPIndexTrue[iCount] = 1; 282 #endif 283 #endif 284 #else 104 285 // get Mv using checked disparity vector 105 286 if (vspIdx < 4) // spatial 106 287 { 107 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID ); 288 #if MERL_VSP_NBDV_RefVId_Fix_D0166 289 assert(pDInfo->m_aRefIdx[0] < 0); 290 iVspDirTrue[idx] = pDInfo->m_aListIdx[0]; 291 292 #if MTK_VSP_USING_NBDV_D0105 293 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 294 #else 295 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 296 #endif 108 297 if ( getSlice()->isInterB() ) 109 298 { 299 #if MTK_VSP_USING_NBDV_D0105 300 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], pDInfo->m_aRefIdx[0] ); 301 #else 302 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], pDInfo->m_aRefIdx[0] ); 303 #endif 304 } 305 306 #else 307 308 #if MTK_VSP_USING_NBDV_D0105 309 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 310 #else 311 pcMvFieldNeighbours[iCount<<1].setMvField(pDInfo->m_acMvCand[0], NOT_VALID ); 312 #endif 313 if ( getSlice()->isInterB() ) 314 { 315 #if MTK_VSP_USING_NBDV_D0105 316 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCandNoRef[0], NOT_VALID ); 317 #else 110 318 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( pDInfo->m_acMvCand[0], NOT_VALID ); 319 #endif 111 320 } 321 #endif 112 322 } 113 323 iVSPIndexTrue[idx] = iCount; 324 #endif 114 325 if ( mrgCandIdx == iCount ) 115 326 { … … 155 366 #if MERL_VSP_C0152 156 367 m_piVSPIndex = NULL; 368 #if MERL_VSP_NBDV_RefVId_Fix_D0166 369 m_piVSPDir = NULL; 370 #endif 157 371 #endif 158 372 m_puhLumaIntraDir = NULL; … … 225 439 m_pbResPredFlag = NULL; 226 440 #endif 441 #if QC_ARP_D0177 442 m_puhARPW = NULL; 443 #endif 227 444 #if LGE_EDGE_INTRA_A0070 228 445 m_pucEdgeCode = NULL; … … 241 458 m_apSegmentDCOffset[1] = NULL; 242 459 #endif 460 #if QC_CU_NBDV_D0181 461 m_pDvInfo = NULL; 462 #endif 243 463 } 244 464 … … 288 508 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 289 509 #endif 510 #if QC_CU_NBDV_D0181 511 m_pDvInfo = (DisInfo* )xMalloc(DisInfo, uiNumPartition); 512 #endif 290 513 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 291 514 #if MERL_VSP_C0152 292 515 m_piVSPIndex = (Char* )xMalloc(Char, uiNumPartition); 516 #if MERL_VSP_NBDV_RefVId_Fix_D0166 517 m_piVSPDir = (Char* )xMalloc(Char, uiNumPartition); 518 #endif 293 519 #endif 294 520 #if H3D_IVRP 295 521 m_pbResPredAvailable = (Bool* )xMalloc(Bool, uiNumPartition); 296 522 m_pbResPredFlag = (Bool* )xMalloc(Bool, uiNumPartition); 523 #if QC_ARP_D0177 524 m_puhARPW = new UChar[ uiNumPartition]; 525 #endif 297 526 #endif 298 527 m_puhLumaIntraDir = (UChar* )xMalloc(UChar, uiNumPartition); … … 448 677 #if MERL_VSP_C0152 449 678 if ( m_piVSPIndex ) { xFree(m_piVSPIndex); m_piVSPIndex = NULL; } 679 #if MERL_VSP_NBDV_RefVId_Fix_D0166 680 if ( m_piVSPDir ) { xFree(m_piVSPDir ); m_piVSPDir = NULL; } 681 #endif 450 682 #endif 451 683 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } … … 453 685 if ( m_pbResPredAvailable ) { xFree(m_pbResPredAvailable); m_pbResPredAvailable= NULL; } 454 686 if ( m_pbResPredFlag ) { xFree(m_pbResPredFlag); m_pbResPredFlag = NULL; } 687 #endif 688 #if QC_CU_NBDV_D0181 689 if ( m_pDvInfo ) { xFree(m_pDvInfo); m_pDvInfo = NULL; } 690 #endif 691 #if QC_ARP_D0177 692 if ( m_puhARPW ) { delete[] m_puhARPW; m_puhARPW = NULL; } 455 693 #endif 456 694 if ( m_puhLumaIntraDir ) { xFree(m_puhLumaIntraDir); m_puhLumaIntraDir = NULL; } … … 627 865 m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui); 628 866 #endif 867 #if QC_ARP_D0177 868 m_puhARPW[ui] = pcFrom->getARPW( ui ); 869 #endif 629 870 m_puhWidth [ui] = pcFrom->getWidth(ui); 630 871 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 644 885 #if MERL_VSP_C0152 645 886 m_piVSPIndex[ui] = pcFrom->m_piVSPIndex[ui]; 887 #if MERL_VSP_NBDV_RefVId_Fix_D0166 888 m_piVSPDir [ui] = pcFrom->m_piVSPDir [ui]; 889 #endif 646 890 #endif 647 891 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 687 931 #if MERL_VSP_C0152 688 932 memset( m_piVSPIndex + firstElement, 0, numElements * sizeof( *m_piVSPIndex ) ); 933 #if MERL_VSP_NBDV_RefVId_Fix_D0166 934 memset( m_piVSPDir + firstElement, 0, numElements * sizeof( *m_piVSPDir ) ); 935 #endif 689 936 #endif 690 937 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 723 970 memset( m_pbResPredAvailable + firstElement, 0 , sizeof( Bool ) * numElements ); 724 971 memset( m_pbResPredFlag + firstElement, 0 , sizeof( Bool ) * numElements ); 972 #endif 973 #if QC_ARP_D0177 974 memset( m_puhARPW + firstElement, 0 , sizeof( UChar ) * numElements ); 725 975 #endif 726 976 } … … 861 1111 #if MERL_VSP_C0152 862 1112 m_piVSPIndex[ui] = 0; 1113 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1114 m_piVSPDir [ui] = 0; 1115 #endif 863 1116 #endif 864 1117 #if H3D_IVRP 865 1118 m_pbResPredAvailable[ui] = 0; 866 1119 m_pbResPredFlag[ui] = 0; 1120 #endif 1121 #if QC_ARP_D0177 1122 m_puhARPW[ui] = 0; 867 1123 #endif 868 1124 m_puhLumaIntraDir[ui] = 2; … … 972 1228 #if MERL_VSP_C0152 973 1229 memset( m_piVSPIndex, 0, iSizeInChar ); 1230 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1231 memset( m_piVSPDir , 0, iSizeInChar ); 1232 #endif 974 1233 #endif 975 1234 #if H3D_IVRP 976 1235 memset( m_pbResPredAvailable, 0, iSizeInBool ); 977 1236 memset( m_pbResPredFlag, 0, iSizeInBool ); 1237 #endif 1238 #if QC_ARP_D0177 1239 memset( m_puhARPW, 0, iSizeInUchar ); 978 1240 #endif 979 1241 memset( m_puhLumaIntraDir, 2, iSizeInUchar ); … … 1015 1277 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition); 1016 1278 #endif 1017 1279 #if QC_CU_NBDV_D0181 1280 m_pDvInfo->bDV = false; 1281 #endif 1018 1282 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; 1019 1283 UChar uhHeight = g_uiMaxCUHeight >> uiDepth; … … 1058 1322 #if MERL_VSP_C0152 1059 1323 m_piVSPIndex[ui]=pcCU->m_piVSPIndex[uiPartOffset+ui]; 1324 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1325 m_piVSPDir [ui]=pcCU->m_piVSPDir [uiPartOffset+ui]; 1326 #endif 1060 1327 #endif 1061 1328 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 1090 1357 m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ]; 1091 1358 m_pbResPredFlag [ui] = pcCU->m_pbResPredFlag [ uiPartOffset + ui ]; 1359 #endif 1360 #if QC_ARP_D0177 1361 m_puhARPW [ui] = pcCU->getARPW( uiPartOffset+ui ); 1092 1362 #endif 1093 1363 #if RWTH_SDC_DLT_B0036 … … 1208 1478 #if MERL_VSP_C0152 1209 1479 m_piVSPIndex = pcCU->getVSPIndex() + uiPart; 1480 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1481 m_piVSPDir = pcCU->getVSPDir () + uiPart; 1482 #endif 1210 1483 #endif 1211 1484 #if H3D_IVRP 1212 1485 m_pbResPredAvailable = pcCU->getResPredAvail() + uiPart; 1213 1486 m_pbResPredFlag = pcCU->getResPredFlag () + uiPart; 1487 #endif 1488 #if QC_ARP_D0177 1489 m_puhARPW = pcCU->getARPW() + uiPart; 1214 1490 #endif 1215 1491 m_puhLumaIntraDir = pcCU->getLumaIntraDir() + uiPart; … … 1313 1589 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1314 1590 #endif 1315 } 1316 1591 #if QC_CU_NBDV_D0181 1592 m_pDvInfo = pcCU->getDvInfo() + uiPart; 1593 #endif 1594 } 1595 #if QC_CU_NBDV_D0181 1596 Void TComDataCU::copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx) 1597 { 1598 m_pDvInfo = pcCU->getDvInfo() + uiAbsPartIdx; 1599 } 1600 #endif 1317 1601 // Copy inter prediction info from the biggest CU 1318 Void TComDataCU::copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList ) 1602 Void TComDataCU::copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList 1603 #if QC_CU_NBDV_D0181 1604 , Bool bNBDV 1605 #endif 1606 ) 1319 1607 { 1320 1608 m_pcPic = pcCU->getPic(); … … 1336 1624 1337 1625 m_pePartSize = pcCU->getPartitionSize () + uiAbsPartIdx; 1626 #if QC_CU_NBDV_D0181 1627 if(bNBDV == true) 1628 { 1629 m_puhWidth = pcCU->getWidth () + uiAbsPartIdx; 1630 m_puhHeight = pcCU->getHeight() + uiAbsPartIdx; 1631 m_puhDepth = pcCU->getDepth () + uiAbsPartIdx; 1632 } 1633 else 1634 { 1635 #endif 1338 1636 #if HHI_INTERVIEW_SKIP 1339 1637 m_pbRenderable = pcCU->getRenderable() + uiAbsPartIdx; … … 1354 1652 #if MERL_VSP_C0152 1355 1653 m_piVSPIndex = pcCU->getVSPIndex() + uiAbsPartIdx; 1654 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1655 m_piVSPDir = pcCU->getVSPDir () + uiAbsPartIdx; 1656 #endif 1356 1657 #endif 1357 1658 #if H3D_IVRP … … 1359 1660 m_pbResPredFlag = pcCU->getResPredFlag () + uiAbsPartIdx; 1360 1661 #endif 1662 #if QC_ARP_D0177 1663 m_puhARPW = pcCU->getARPW() + uiAbsPartIdx; 1664 #endif 1361 1665 m_apiMVPIdx[eRefPicList] = pcCU->getMVPIdx(eRefPicList) + uiAbsPartIdx; 1362 1666 m_apiMVPNum[eRefPicList] = pcCU->getMVPNum(eRefPicList) + uiAbsPartIdx; … … 1369 1673 memcpy(m_uiSliceStartCU,pcCU->m_uiSliceStartCU+uiAbsPartIdx,sizeof(UInt)*m_uiNumPartition); 1370 1674 memcpy(m_uiEntropySliceStartCU,pcCU->m_uiEntropySliceStartCU+uiAbsPartIdx,sizeof(UInt)*m_uiNumPartition); 1675 #if QC_CU_NBDV_D0181 1676 } 1677 #endif 1371 1678 } 1372 1679 1373 1680 // Copy small CU to bigger CU. 1374 1681 // One of quarter parts overwritten by predicted sub part. 1375 Void TComDataCU::copyPartFrom( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ) 1682 Void TComDataCU::copyPartFrom( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth 1683 #if QC_ARP_D0177 1684 , 1685 Bool bRP 1686 #endif 1687 ) 1376 1688 { 1377 1689 assert( uiPartUnitIdx<4 ); … … 1405 1717 #if MERL_VSP_C0152 1406 1718 memcpy( m_piVSPIndex + uiOffset, pcCU->getVSPIndex(), iSizeInChar ); 1719 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1720 memcpy( m_piVSPDir + uiOffset, pcCU->getVSPDir (), iSizeInChar ); 1721 #endif 1407 1722 #endif 1408 1723 #if H3D_IVRP 1409 1724 memcpy( m_pbResPredAvailable + uiOffset, pcCU->getResPredAvail(), iSizeInBool ); 1410 1725 memcpy( m_pbResPredFlag + uiOffset, pcCU->getResPredFlag(), iSizeInBool ); 1726 #endif 1727 #if QC_ARP_D0177 1728 memcpy( m_puhARPW + uiOffset, pcCU->getARPW(), iSizeInUchar ); 1411 1729 #endif 1412 1730 memcpy( m_puhLumaIntraDir + uiOffset, pcCU->getLumaIntraDir(), iSizeInUchar ); … … 1486 1804 1487 1805 #if LGE_EDGE_INTRA_A0070 1806 #if QC_ARP_D0177 1807 if( !bRP && pcCU->getSlice()->getSPS()->isDepth() ) 1808 #else 1488 1809 if( getSlice()->getSPS()->isDepth() ) 1810 #endif 1489 1811 { 1490 1812 memcpy( getEdgeCode( uiOffset ), pcCU->getEdgeCode(0), iSizeInUchar * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4 ); … … 1541 1863 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool ); 1542 1864 #endif 1865 #if QC_CU_NBDV_D0181 1866 memcpy( rpcCU->getDvInfo() + m_uiAbsIdxInLCU, m_pDvInfo, sizeof(* m_pDvInfo) * m_uiNumPartition ); 1867 #endif 1543 1868 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 1544 1869 #if MERL_VSP_C0152 1545 1870 memcpy( rpcCU->getVSPIndex() + m_uiAbsIdxInLCU, m_piVSPIndex, iSizeInChar ); 1871 #if MERL_VSP_NBDV_RefVId_Fix_D0166 1872 memcpy( rpcCU->getVSPDir () + m_uiAbsIdxInLCU, m_piVSPDir , iSizeInChar ); 1873 #endif 1546 1874 #endif 1547 1875 #if H3D_IVRP 1548 1876 memcpy( rpcCU->getResPredAvail() + m_uiAbsIdxInLCU, m_pbResPredAvailable, iSizeInBool ); 1549 1877 memcpy( rpcCU->getResPredFlag() + m_uiAbsIdxInLCU, m_pbResPredFlag, iSizeInBool ); 1878 #endif 1879 #if QC_ARP_D0177 1880 memcpy( rpcCU->getARPW() + m_uiAbsIdxInLCU, m_puhARPW, iSizeInUchar ); 1550 1881 #endif 1551 1882 memcpy( rpcCU->getLumaIntraDir() + m_uiAbsIdxInLCU, m_puhLumaIntraDir, iSizeInUchar ); … … 1674 2005 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1675 2006 #if MERL_VSP_C0152 1676 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 2007 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 2008 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2009 memcpy( rpcCU->getVSPDir () + uiPartOffset, m_piVSPDir , iSizeInChar ); 2010 #endif 1677 2011 #endif 1678 2012 #if H3D_IVRP 1679 2013 memcpy( rpcCU->getResPredAvail() + uiPartOffset, m_pbResPredAvailable, iSizeInBool ); 1680 2014 memcpy( rpcCU->getResPredFlag() + uiPartOffset, m_pbResPredFlag, iSizeInBool ); 2015 #endif 2016 #if QC_ARP_D0177 2017 memcpy( rpcCU->getARPW() + uiPartOffset, m_puhARPW, iSizeInUchar ); 1681 2018 #endif 1682 2019 memcpy( rpcCU->getLumaIntraDir() + uiPartOffset, m_puhLumaIntraDir, iSizeInUchar ); … … 2670 3007 return uiCtx; 2671 3008 } 2672 3009 #if QC_ARP_D0177 3010 UInt TComDataCU::getCTXARPWFlag( UInt uiAbsPartIdx ) 3011 { 3012 TComDataCU* pcTempCU; 3013 UInt uiTempPartIdx; 3014 UInt uiCtx = 0; 3015 3016 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 3017 uiCtx = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0; 3018 3019 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 3020 uiCtx += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0; 3021 3022 return uiCtx; 3023 } 3024 #endif 2673 3025 #if LGE_ILLUCOMP_B0045 2674 3026 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) … … 2907 3259 } 2908 3260 3261 #if !PKU_QC_DEPTH_INTRA_UNI_D0195 2909 3262 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2910 3263 { … … 2923 3276 return uiCtx; 2924 3277 } 3278 #endif 2925 3279 2926 3280 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx ) … … 2954 3308 setSubPart<Char>( iVSPIdx, m_piVSPIndex, uiAbsPartIdx, uiDepth, uiPartIdx ); 2955 3309 } 2956 #endif 3310 3311 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3312 Void TComDataCU::setVSPDirSubParts ( Char iVSPDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3313 { 3314 setSubPart<Char>( iVSPDir, m_piVSPDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 3315 } 3316 #endif 3317 3318 #endif // MERL_VSP_C0152 2957 3319 2958 3320 #if H3D_IVRP … … 2967 3329 } 2968 3330 #endif 2969 3331 #if QC_CU_NBDV_D0181 3332 Void TComDataCU::setDvInfoSubParts( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ) 3333 { 3334 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 3335 for (UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 3336 { 3337 m_pDvInfo[uiAbsPartIdx + ui] = cDvInfo; 3338 } 3339 } 3340 #endif 2970 3341 Void TComDataCU::setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ) 2971 3342 { … … 2993 3364 UInt iNumbPart; 2994 3365 3366 #if SHARP_ILLUCOMP_PARSE_D0060 3367 if (!(getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N)) 3368 { 3369 return false; 3370 } 3371 if (getSlice()->getIcSkipParseFlag()) 3372 { 3373 if (getMergeFlag(uiAbsPartIdx) && getMergeIndex(uiAbsPartIdx) == 0) 3374 { 3375 return false; 3376 } 3377 } 3378 if (getMergeFlag(uiAbsPartIdx)) 3379 { 3380 return true; 3381 } 3382 #endif 3383 #if !SHARP_ILLUCOMP_PARSE_D0060 2995 3384 if(!getSlice()->getIsDepth()) 2996 3385 { 3386 #endif 2997 3387 Int iWidth, iHeight; 2998 3388 … … 3015 3405 } 3016 3406 } 3407 #if !SHARP_ILLUCOMP_PARSE_D0060 3017 3408 } 3018 3409 else … … 3036 3427 } 3037 3428 } 3429 #endif 3038 3430 3039 3431 return false; … … 3046 3438 Int iWidth, iHeight; 3047 3439 3440 #if SHARP_ILLUCOMP_PARSE_D0060 3441 if (!(getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N)) 3442 { 3443 return false; 3444 } 3445 if (getSlice()->getIcSkipParseFlag()) 3446 { 3447 if (getMergeFlag(uiAbsPartIdx) && getMergeIndex(uiAbsPartIdx) == 0) 3448 { 3449 return false; 3450 } 3451 } 3452 if (getMergeFlag(uiAbsPartIdx)) 3453 { 3454 return true; 3455 } 3456 #endif 3048 3457 UInt uiPartMode = getPartitionSize(uiAbsPartIdx); 3049 3458 … … 3527 3936 */ 3528 3937 #if MERL_VSP_C0152 3529 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx ) 3938 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue 3939 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3940 , Int* iVSPDirTrue 3941 #endif 3942 , Int mrgCandIdx ) 3530 3943 #else 3531 3944 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) … … 3560 3973 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 3561 3974 3562 #if MERL_VSP_C0152 3975 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3563 3976 Bool bVspMvZeroDone[3] = {false, false, false}; 3564 3977 #endif … … 3584 3997 #endif //H3D_NBDV 3585 3998 3586 #if H3D_IVRP 3999 #if H3D_IVRP & !QC_ARP_D0177 3587 4000 Bool bDVAvail = true; 3588 4001 #endif … … 3590 4003 #if H3D_NBDV 3591 4004 DisInfo cDisInfo; 4005 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4006 cDisInfo.bDV = false; // default setting 4007 cDisInfo.iN = 0; 4008 #endif 4009 4010 #if !QC_CU_NBDV_D0181 3592 4011 cDisInfo.iN = 0; 4012 #endif 3593 4013 if(!bNoPdmMerge) 3594 4014 { … … 3596 4016 if( !getPic()->getDepthCoded() ) 3597 4017 #endif 4018 #if QC_CU_NBDV_D0181 4019 { 4020 cDisInfo.iN = getDvInfo(uiAbsPartIdx).iN; 4021 cDisInfo.bDV = getDvInfo(uiAbsPartIdx).bDV; 4022 cDisInfo.m_acMvCand[0] = getDvInfo(uiAbsPartIdx).m_acMvCand[0]; 4023 cDisInfo.m_aVIdxCan[0] = getDvInfo(uiAbsPartIdx).m_aVIdxCan[0]; 4024 #if MTK_VSP_USING_NBDV_D0105 4025 cDisInfo.m_acMvCandNoRef[0] = getDvInfo(uiAbsPartIdx).m_acMvCandNoRef[0]; 4026 #endif 4027 #if MERL_General_Fix 4028 #if MERL_VSP_C0152 4029 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4030 cDisInfo.m_aListIdx[0] = getDvInfo(uiAbsPartIdx).m_aListIdx[0]; 4031 cDisInfo.m_aRefIdx[0] = getDvInfo(uiAbsPartIdx).m_aRefIdx[0]; 4032 #endif 4033 #endif 4034 #endif 4035 } 4036 #else 3598 4037 getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true 3599 4038 #if MERL_VSP_C0152 … … 3601 4040 #endif 3602 4041 ); 3603 } 4042 #endif 4043 } 4044 3604 4045 #if FCO_DVP_REFINE_C0132_C0170 3605 4046 if(getPic()->getDepthCoded() ) … … 3618 4059 } 3619 4060 #endif 4061 #if !QC_CU_NBDV_D0181 3620 4062 if(cDisInfo.iN==0) 3621 { 4063 #else 4064 if(cDisInfo.bDV == false) 4065 #endif 4066 { 4067 #if !QC_CU_NBDV_D0181 3622 4068 cDisInfo.iN = 1; 3623 4069 cDisInfo.m_acMvCand[0].setHor(0); 3624 4070 cDisInfo.m_acMvCand[0].setVer(0); 3625 4071 cDisInfo.m_aVIdxCan[0] = 0; 3626 #if H3D_IVRP 4072 #endif 4073 #if H3D_IVRP & !QC_ARP_D0177 3627 4074 bDVAvail = false; 3628 4075 #endif 3629 4076 } 4077 4078 #if MERL_VSP_NBDV_RefVId_Fix_D0166 && !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4079 if (bNoPdmMerge && cDisInfo.bDV == false) 4080 { // purely for default setting 4081 cDisInfo.iN = 1; 4082 cDisInfo.m_acMvCand[0].setHor(0); 4083 cDisInfo.m_acMvCand[0].setVer(0); 4084 cDisInfo.m_acMvCandNoRef[0].setHor(0); 4085 cDisInfo.m_acMvCandNoRef[0].setVer(0); 4086 cDisInfo.m_aVIdxCan[0] = 0; 4087 4088 RefPicList eRefPicList = REF_PIC_LIST_0 ; 4089 Int refFrmIdx = 0; 4090 getRefListAndRefFrmIdx(0, eRefPicList, refFrmIdx); 4091 cDisInfo.m_aListIdx[0] = eRefPicList; 4092 cDisInfo.m_aRefIdx [0] = -1-refFrmIdx; 4093 } 4094 #endif 3630 4095 3631 4096 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 … … 3652 4117 clipMv(cMvPred); 3653 4118 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx()); 4119 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4120 if (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0) 4121 { 4122 assert(pcTextureCU->getVSPIndex(uiPartIdxCenter)!=0); 4123 for (Int i=0; i<getSlice()->getNumRefIdx(REF_PIC_LIST_0); i++) 4124 { 4125 if (getSlice()->getRefPOC(REF_PIC_LIST_0, i) == getSlice()->getPOC()) 4126 { 4127 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,i); 4128 break; 4129 } 4130 } 4131 } 4132 #endif 3654 4133 } 3655 4134 if ( getSlice()->isInterB() ) … … 3664 4143 clipMv(cMvPred); 3665 4144 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()); 4145 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4146 if (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0) 4147 { 4148 assert(pcTextureCU->getVSPIndex(uiPartIdxCenter)!=0); 4149 for (Int i=0; i<getSlice()->getNumRefIdx(REF_PIC_LIST_1); i++) 4150 { 4151 if (getSlice()->getRefPOC(REF_PIC_LIST_1, i) == getSlice()->getPOC()) 4152 { 4153 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,i); 4154 break; 4155 } 4156 } 4157 } 4158 #endif 3666 4159 } 3667 4160 } 3668 #if MERL_VSP_C0152 3669 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 3670 #endif 3671 if ( mrgCandIdx == iCount ) 3672 { 3673 return; 3674 } 3675 iCount ++; 4161 #if MERL_VSP_C0152 && !QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 4162 #if !MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4163 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4164 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4165 , iVSPDirTrue 4166 #endif 4167 ) ; 4168 #endif 4169 #endif 4170 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4171 if (!((pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && !getSlice()->isInterB()) 4172 || (pcMvFieldNeighbours[iCount<<1].getRefIdx()<0 && pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()<0 && getSlice()->isInterB()))) 4173 { 4174 #endif 4175 if ( mrgCandIdx == iCount ) 4176 { 4177 return; 4178 } 4179 iCount ++; 4180 #if MTK_LGE_VSP_DEPTH_OFF_D0105_D0139 4181 } 4182 else 4183 { 4184 assert(0); 4185 } 4186 #endif 3676 4187 } 3677 4188 } … … 3687 4198 iPdmDir[1] = iPdmInterDir; 3688 4199 #endif // H3D_NBDV 3689 #if H3D_IVRP 4200 #if H3D_IVRP & !QC_ARP_D0177 3690 4201 if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail) 3691 4202 { … … 3727 4238 } 3728 4239 3729 #endif // H3D_IVMP 3730 4240 #endif // H3D_IVMP 4241 4242 #if !FIX_MERGE_D 3731 4243 #if MERL_VSP_COMPENSATION_C0152 3732 4244 //===== vsp 0 ===== 3733 4245 if( iCount < 4 + extraMergeCand ) 3734 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4246 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4247 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4248 , iVSPDirTrue 4249 #endif 4250 ) 4251 ) 3735 4252 return; 4253 #endif 3736 4254 #endif 3737 4255 … … 3751 4269 { 3752 4270 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 3753 #if MERL_VSP_C0152 4271 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3754 4272 CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1) 3755 4273 #endif … … 3800 4318 #endif 3801 4319 #if MERL_VSP_C0152 3802 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4320 #if LGE_VSP_INHERIT_D0092 4321 if (pcCULeft->getVSPIndex(uiLeftPartIdx)==1) 4322 { 4323 iVSPIndexTrue[iCount] = 1; 4324 } 4325 #else 4326 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4327 #if QC_BVSP_CleanUP_D0191 4328 ,puhInterDirNeighbours 4329 #endif 4330 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4331 , iVSPDirTrue 4332 #endif 4333 ); 4334 #endif 3803 4335 #endif 3804 4336 if ( mrgCandIdx == iCount ) … … 3825 4357 } 3826 4358 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 3827 #if MERL_VSP_C0152 4359 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3828 4360 CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1) 3829 4361 #endif … … 3873 4405 #endif 3874 4406 #if MERL_VSP_C0152 3875 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4407 #if LGE_VSP_INHERIT_D0092 4408 if (pcCUAbove->getVSPIndex(uiAbovePartIdx)==1) 4409 { 4410 iVSPIndexTrue[iCount] = 1; 4411 } 4412 #else 4413 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4414 #if QC_BVSP_CleanUP_D0191 4415 ,puhInterDirNeighbours 4416 #endif 4417 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4418 , iVSPDirTrue 4419 #endif 4420 ) ; 4421 #endif 3876 4422 #endif 3877 4423 if ( mrgCandIdx == iCount ) … … 3897 4443 } 3898 4444 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) 3899 #if MERL_VSP_C0152 4445 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3900 4446 CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx, 1) 3901 4447 #endif … … 3922 4468 #endif 3923 4469 #if MERL_VSP_C0152 3924 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4470 #if LGE_VSP_INHERIT_D0092 4471 if (pcCUAboveRight->getVSPIndex(uiAboveRightPartIdx)==1) 4472 { 4473 iVSPIndexTrue[iCount] = 1; 4474 } 4475 #else 4476 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4477 #if QC_BVSP_CleanUP_D0191 4478 ,puhInterDirNeighbours 4479 #endif 4480 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4481 , iVSPDirTrue 4482 #endif 4483 ) ; 4484 #endif 3925 4485 #endif 3926 4486 if ( mrgCandIdx == iCount ) … … 3980 4540 #endif // H3D_IVMP 3981 4541 4542 #if MERL_VSP_COMPENSATION_C0152 4543 //===== vsp 3 ===== 4544 #if LGE_VSP_INHERIT_D0092 4545 if ( !xAddVspMergeCand(3, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4546 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4547 , iVSPDirTrue 4548 #endif 4549 ) ) 4550 #else 4551 if( iCount < 4 + extraMergeCand ) 4552 if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4553 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4554 , iVSPDirTrue 4555 #endif 4556 ) ) 4557 #endif 4558 return; 4559 #endif 4560 4561 #if MERL_VSP_C0152 4562 #if VSP_MERGE_POS < 4 4563 #if H3D_IVMP 4564 if( iCount < 4 + extraMergeCand ) 4565 #else 4566 if( iCount < 4 ) 4567 #endif 4568 { 4569 #endif 4570 #endif 3982 4571 3983 4572 //left bottom … … 3993 4582 } 3994 4583 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) 3995 #if MERL_VSP_C0152 4584 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 3996 4585 CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx, 1) 3997 4586 #endif … … 4018 4607 #endif 4019 4608 #if MERL_VSP_C0152 4020 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4609 #if LGE_VSP_INHERIT_D0092 4610 if (pcCULeftBottom->getVSPIndex(uiLeftBottomPartIdx)==1) 4611 { 4612 iVSPIndexTrue[iCount] = 1; 4613 } 4614 #else 4615 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4616 #if QC_BVSP_CleanUP_D0191 4617 ,puhInterDirNeighbours 4618 #endif 4619 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4620 , iVSPDirTrue 4621 #endif 4622 ) ; 4623 #endif 4021 4624 #endif 4022 4625 if ( mrgCandIdx == iCount ) … … 4026 4629 iCount ++; 4027 4630 } 4028 4029 4631 4632 #if MERL_VSP_C0152 // Is this correct here? 4633 #if VSP_MERGE_POS < 4 4634 } 4635 #endif 4636 #endif 4637 4030 4638 // above left 4031 4639 #if H3D_IVMP … … 4046 4654 } 4047 4655 if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) 4048 #if MERL_VSP_C0152 4656 #if MERL_VSP_C0152 && !LGE_VSP_INHERIT_D0092 4049 4657 CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx, 1) 4050 4658 #endif … … 4073 4681 #endif 4074 4682 #if MERL_VSP_C0152 4075 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4683 #if LGE_VSP_INHERIT_D0092 4684 if (pcCUAboveLeft->getVSPIndex(uiAboveLeftPartIdx)==1) 4685 { 4686 iVSPIndexTrue[iCount] = 1; 4687 } 4688 #else 4689 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo 4690 #if QC_BVSP_CleanUP_D0191 4691 ,puhInterDirNeighbours 4692 #endif 4693 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4694 , iVSPDirTrue 4695 #endif 4696 ) ; 4697 #endif 4076 4698 #endif 4077 4699 if ( mrgCandIdx == iCount ) … … 4086 4708 //===== vsp 5 ===== 4087 4709 if( iCount < 4 + extraMergeCand ) 4088 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4710 #if LGE_VSP_INHERIT_D0092 4711 if ( !xAddVspMergeCand(5, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4712 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4713 , iVSPDirTrue 4714 #endif 4715 )) 4716 #else 4717 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo 4718 #if MERL_VSP_NBDV_RefVId_Fix_D0166 4719 , iVSPDirTrue 4720 #endif 4721 )) 4722 #endif 4089 4723 return; 4090 4724 #endif … … 4276 4910 #if MERL_VSP_C0152 4277 4911 Bool bValid = true; 4912 #if LGE_VSP_INHERIT_D0092 4913 if (iVSPIndexTrue[i]==1 || iVSPIndexTrue[j]==1) // NOT_VALID 4914 #else 4278 4915 if (pcMvFieldNeighbours[i<<1].getRefIdx() < 0 || pcMvFieldNeighbours[(j<<1)+1].getRefIdx() < 0) // NOT_VALID 4916 #endif 4279 4917 bValid = false; 4280 4918 #endif 4919 4920 #if MTK_D0156 4921 if( !m_pcSlice->getSPS()->getUseVSPCompensation()) 4922 { 4923 bValid = true; 4924 } 4925 #endif 4926 4281 4927 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2) 4282 4928 #if MERL_VSP_C0152 … … 4447 5093 { 4448 5094 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 4449 #if MERL_VSP_C0152 5095 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4450 5096 && !pcCorner->getVSPIndex( uiCornerPUIdx ) 4451 5097 #endif … … 4593 5239 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4594 5240 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4595 #if MERL_VSP_C0152 5241 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4596 5242 if(! pcTmpCU->getVSPIndex(uiIdx)) 4597 5243 #endif … … 4618 5264 4619 5265 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4620 #if MERL_VSP_C0152 5266 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4621 5267 if(! pcTmpCU->getVSPIndex(uiIdx)) 4622 5268 #endif … … 4643 5289 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 4644 5290 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4645 #if MERL_VSP_C0152 5291 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4646 5292 if(! pcTmpCU->getVSPIndex(uiIdx)) 4647 5293 #endif … … 4667 5313 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 4668 5314 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4669 #if MERL_VSP_C0152 5315 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4670 5316 if(! pcTmpCU->getVSPIndex(uiIdx)) 4671 5317 #endif … … 4694 5340 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 4695 5341 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4696 #if MERL_VSP_C0152 5342 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 4697 5343 if(! pcTmpCU->getVSPIndex(uiIdx)) 4698 5344 #endif … … 4902 5548 Int iPictureWidth = pcBaseViewDepthPicYuv->getWidth(); 4903 5549 Int iPictureHeight = pcBaseViewDepthPicYuv->getHeight(); 4904 5550 #if !QC_BVSP_CleanUP_D0191 5551 #if LGE_ROUND_OFFSET_D0135 5552 Int depthPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2)); 5553 Int depthPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2)); 5554 #else 4905 5555 Int depthPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + (mv->getHor()>>2)); 4906 5556 Int depthPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + (mv->getVer()>>2)); 5557 #endif 4907 5558 4908 5559 Pel *pDepthPel = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride; 5560 #endif 4909 5561 Pel maxDepthVal = 0; 4910 5562 4911 5563 if ( bSimpleDvpRefine ) 4912 5564 { 5565 #if LGE_ROUND_OFFSET_D0135 5566 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + ((mv->getHor()+2)>>2)); 5567 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + ((mv->getVer()+2)>>2)); 5568 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + ((mv->getHor()+2)>>2)); 5569 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + ((mv->getVer()+2)>>2)); 5570 #else 4913 5571 Int depthStartPosX = Clip3(0, iPictureWidth - iBlkWidth, iBlkX + (mv->getHor()>>2)); 4914 5572 Int depthStartPosY = Clip3(0, iPictureHeight- iBlkHeight, iBlkY + (mv->getVer()>>2)); 4915 5573 Int depthEndPosX = Clip3(0, iPictureWidth - 1, iBlkX + iBlkWidth - 1 + (mv->getHor()>>2)); 4916 5574 Int depthEndPosY = Clip3(0, iPictureHeight - 1, iBlkY + iBlkHeight - 1 + (mv->getVer()>>2)); 5575 #endif 5576 #if !MTK_DEPTH_TO_DISP_D0138 4917 5577 Int iCenterX = (depthStartPosX + depthEndPosX) >> 1; 4918 5578 Int iCenterY = (depthStartPosY + depthEndPosY) >> 1; 5579 #endif 4919 5580 4920 5581 Pel *depthTL = pcBaseViewDepthPicYuv->getLumaAddr(); … … 4924 5585 aiDepth[2] = depthTL[ (depthStartPosY) * depStride + depthEndPosX ]; // Right Top 4925 5586 aiDepth[3] = depthTL[ (depthEndPosY) * depStride + depthEndPosX ]; // Right Bottom 5587 #if MTK_DEPTH_TO_DISP_D0138 5588 for (Int i = 0; i < 4; i++) 5589 #else 4926 5590 aiDepth[4] = depthTL[ (iCenterY) * depStride + iCenterX ]; // Center 4927 5591 for (Int i = 0; i < 5; i++) 5592 #endif 4928 5593 { 4929 5594 if (maxDepthVal < aiDepth[i]) … … 4931 5596 } 4932 5597 } 5598 #if !QC_BVSP_CleanUP_D0191 4933 5599 else 4934 5600 { … … 4943 5609 } 4944 5610 } 5611 #endif 4945 5612 4946 5613 Int iDisp = aiShiftLUT[ maxDepthVal ] << iShiftPrec; … … 4948 5615 return iDisp; 4949 5616 } 4950 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 5617 5618 Void TComDataCU::estimateDVFromDM( 5619 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5620 Int refViewIdx, 5621 #endif 5622 UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 4951 5623 { 4952 5624 if (picDepth) … … 4962 5634 Int iShiftPrec; 4963 5635 4964 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec); 5636 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec 5637 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5638 , refViewIdx 5639 #endif 5640 ); 4965 5641 4966 5642 Pel iDisp = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine ); … … 4991 5667 clipMv(cMvPred); 4992 5668 4993 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 4994 5669 TComPic* picDepth = NULL; 5670 #if MERL_General_Fix 5671 #if MERL_VSP_C0152 5672 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5673 Int refPOC = getSlice()->getRefPic(eRefPicList, refId)->getPOC(); 5674 picDepth = getSlice()->getDepthRefPic(refViewIdx, refPOC); 5675 assert(refPOC == getSlice()->getPOC()); 5676 assert(picDepth != NULL); 5677 #else 5678 picDepth = getSlice()->getRefPicBaseDepth(); 5679 #endif 5680 #endif 5681 #else 5682 picDepth = getSlice()->getRefPicBaseDepth(); 5683 #endif 5684 5685 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5686 pNbDvInfo->m_acMvCandNoRef[pNbDvInfo->iN] = cMvPred; 5687 #endif 4995 5688 if (picDepth && bDepthRefine) 4996 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 4997 5689 estimateDVFromDM( 5690 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5691 refViewIdx, 5692 #endif 5693 uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5694 5695 5696 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5697 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = eRefPicList; 5698 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refId; 5699 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0); 5700 #endif 4998 5701 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 4999 5702 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++ ] = refViewIdx; … … 5010 5713 } 5011 5714 } 5012 #if MERL_VSP_C0152 5715 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 5013 5716 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5014 5717 { 5015 TComPic* picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5718 TComPic* picDepth = NULL; 5719 5720 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5721 RefPicList privateRefPicList = (RefPicList) pcTmpCU->getVSPDir( uiIdx ); 5722 assert(privateRefPicList == REF_PIC_LIST_0 || privateRefPicList == REF_PIC_LIST_1); 5723 Int refIdx = -1-pcTmpCU->getCUMvField( privateRefPicList )->getRefIdx( uiIdx ); // a trick when storing refIdx for temporal BVSP 5724 assert(refIdx >= 0); 5725 Int refViewIdx = getSlice()->getRefViewId(privateRefPicList, refIdx); 5726 Int refPOC = getSlice()->getRefPOC(privateRefPicList, refIdx); 5727 5728 picDepth = getSlice()->getDepthRefPic(refViewIdx, refPOC); 5729 assert(refPOC == getSlice()->getPOC()); 5730 assert(picDepth != NULL); 5731 #else 5732 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5733 #endif 5734 5735 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5736 pNbDvInfo->m_acMvCandNoRef[pNbDvInfo->iN] = cMvPred; 5737 #endif 5016 5738 if (picDepth && bDepthRefine) 5017 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5739 estimateDVFromDM( 5740 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5741 refViewIdx, 5742 #endif 5743 uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5018 5744 5019 5745 cMvPred.setVer(0); 5020 5746 5747 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5748 pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] = -1-refIdx; 5749 pNbDvInfo->m_aListIdx[ pNbDvInfo->iN ] = privateRefPicList; 5750 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN ] = cMvPred; 5751 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN ] = refViewIdx; 5752 assert(pNbDvInfo->m_aRefIdx [ pNbDvInfo->iN ] < 0); 5753 pNbDvInfo->iN++; 5754 #else 5021 5755 pNbDvInfo->m_acMvCand[ pNbDvInfo->iN] = cMvPred; 5022 5756 pNbDvInfo->m_aVIdxCan[ pNbDvInfo->iN++] = 0; // refViewIdx; 5757 #endif 5023 5758 return true; 5024 5759 } … … 5075 5810 } 5076 5811 5077 5812 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5813 Bool TComDataCU::getRefListAndRefFrmIdx(Int targetRefViewIdx, RefPicList& eRefPicList, Int& refFrmIdx) 5814 { 5815 Bool isFound = false; 5816 RefPicList privateRefPicList = REF_PIC_LIST_0; 5817 5818 refFrmIdx = 0; 5819 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1) && isFound == false; iList++) 5820 { 5821 privateRefPicList = RefPicList(iList); 5822 for (Int refIdx = 0; refIdx < getSlice()->getNumRefIdx(privateRefPicList); refIdx++) 5823 { 5824 Int refViewIdx = getSlice()->getRefViewId( privateRefPicList, refIdx); 5825 if ( refViewIdx == targetRefViewIdx) 5826 { 5827 refFrmIdx = refIdx; 5828 eRefPicList = privateRefPicList; 5829 isFound = true; 5830 break; 5831 } 5832 } 5833 } 5834 5835 return isFound; 5836 } 5837 #endif 5838 5839 #if QC_CU_NBDV_D0181 5840 Bool TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerge 5841 #else 5078 5842 Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerge 5843 #endif 5079 5844 #if MERL_VSP_C0152 5080 5845 , Bool bDepthRefine … … 5099 5864 } 5100 5865 5866 #if MTK_D0156 5867 if( !m_pcSlice->getSPS()->getUseDVPRefine() ) 5868 { 5869 bDepthRefine = false; 5870 } 5871 #endif 5872 5101 5873 // Get Positions 5102 5874 PartSize eCUMode = getPartitionSize( uiPartAddr ); 5875 #if QC_CU_NBDV_D0181 5876 assert(eCUMode == SIZE_2Nx2N); 5877 #endif 5103 5878 UInt uiPartIdxLT, uiPartIdxRT, uiPartIdxLB; 5104 5879 … … 5168 5943 { 5169 5944 clipMv(cColMv); 5170 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 5945 TComPic* picDepth = NULL; 5946 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5947 Int currPoc = getSlice()->getPOC(); 5948 picDepth = getSlice()->getDepthRefPic(iTargetViewIdx, currPoc); 5949 assert(picDepth != NULL); 5950 #else 5951 picDepth = getSlice()->getRefPicBaseDepth(); 5952 #endif 5953 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 5954 pDInfo->m_acMvCandNoRef[pDInfo->iN] = cColMv; 5955 #endif 5171 5956 if (picDepth && bDepthRefine) 5957 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5958 estimateDVFromDM(iTargetViewIdx, uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5959 #else 5172 5960 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5173 5174 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5961 #endif 5962 5963 #if MERL_VSP_NBDV_RefVId_Fix_D0166 5964 Int refFrmIdx = 0; 5965 RefPicList privateRefPicList = REF_PIC_LIST_0; 5966 getRefListAndRefFrmIdx(iTargetViewIdx, privateRefPicList, refFrmIdx); 5967 5968 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 5969 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 5970 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 5971 #endif 5972 pDInfo->m_acMvCand[ pDInfo->iN ] = cColMv; 5175 5973 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5974 #if QC_CU_NBDV_D0181 5975 return true; 5976 #else 5176 5977 return ; 5978 #endif 5177 5979 } 5178 5980 } // Loop positions … … 5203 6005 bCheckMcpDv = true; 5204 6006 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFT, bDepthRefine ) ) 6007 #if !QC_CU_NBDV_D0181 5205 6008 return; 5206 6009 #else 6010 return true; 6011 #endif 5207 6012 5208 6013 //// ******* Get disparity from above block ******* ///// … … 5225 6030 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5226 6031 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVE, bDepthRefine ) ) 6032 #if !QC_CU_NBDV_D0181 5227 6033 return; 6034 #else 6035 return true; 6036 #endif 5228 6037 } 5229 6038 … … 5243 6052 bCheckMcpDv = ( ( getAddr() - pcTmpCU->getAddr() ) == 0); 5244 6053 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVERIGHT, bDepthRefine ) ) 6054 #if !QC_CU_NBDV_D0181 5245 6055 return; 6056 #else 6057 return true; 6058 #endif 5246 6059 } 5247 6060 … … 5262 6075 bCheckMcpDv = true; 5263 6076 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_LEFTBELOW, bDepthRefine ) ) 6077 #if !QC_CU_NBDV_D0181 5264 6078 return; 6079 #else 6080 return true; 6081 #endif 5265 6082 } 5266 6083 … … 5282 6099 bCheckMcpDv = (( getAddr() - pcTmpCU->getAddr() ) <= 1); 5283 6100 if ( xCheckSpatialNBDV( pcTmpCU, uiIdx, uiPartIdx, uiPartAddr, pDInfo, bCheckMcpDv, &cMvpDvInfo, DVFROM_ABOVELEFT, bDepthRefine ) ) 6101 #if !QC_CU_NBDV_D0181 5284 6102 return; 6103 #else 6104 return true; 6105 #endif 5285 6106 } 5286 6107 … … 5297 6118 clipMv( cDispVec ); 5298 6119 5299 TComPic* picDepth = getSlice()->getRefPicBaseDepth(); 6120 TComPic* picDepth = NULL; 6121 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6122 Int refPOC = getSlice()->getPOC(); 6123 picDepth = getSlice()->getDepthRefPic(0, refPOC); 6124 assert(picDepth!=NULL); 6125 #else 6126 picDepth = getSlice()->getRefPicBaseDepth(); 6127 #endif 6128 6129 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 6130 pDInfo->m_acMvCandNoRef[pDInfo->iN] = cDispVec; 6131 #endif 5300 6132 if (picDepth && bDepthRefine) 6133 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6134 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); // from base view 6135 #else 5301 6136 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cDispVec, true); 5302 5303 pDInfo->m_acMvCand[ pDInfo->iN] = cDispVec; 6137 #endif 6138 6139 #if MERL_VSP_NBDV_RefVId_Fix_D0166 //if DVMCP is used, do a local reference frame list and idx search 6140 Int refFrmIdx = 0; 6141 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 6142 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 6143 6144 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 6145 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 6146 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 6147 #endif 6148 6149 pDInfo->m_acMvCand[ pDInfo->iN ] = cDispVec; 5304 6150 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6151 #if !QC_CU_NBDV_D0181 5305 6152 return; 6153 #else 6154 return true; 6155 #endif 5306 6156 } 5307 6157 } 5308 6158 } 5309 6159 } 6160 6161 #if SEC_DEFAULT_DV_D0112 6162 { 6163 TComPic* picDepth = NULL; 6164 TComMv defaultDV(0, 0); 6165 6166 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6167 Int refPOC = getSlice()->getPOC(); 6168 picDepth = getSlice()->getDepthRefPic(0, refPOC); 6169 assert(picDepth!=NULL); 6170 #else 6171 picDepth = getSlice()->getRefPicBaseDepth(); 6172 #endif 6173 6174 #if MERL_General_Fix 6175 #if QC_CU_NBDV_D0181 && MERL_VSP_C0152 6176 pDInfo->m_acMvCandNoRef[pDInfo->iN] = defaultDV; 6177 #endif 6178 #endif 6179 6180 if (picDepth && bDepthRefine) 6181 { 6182 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6183 estimateDVFromDM(0, uiPartIdx, picDepth, uiPartAddr, &defaultDV, true); // from base view 6184 #else 6185 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &defaultDV, true); 6186 #endif 6187 } 6188 6189 #if MERL_VSP_NBDV_RefVId_Fix_D0166 6190 Int refFrmIdx = 0; 6191 RefPicList privateRefPicList = REF_PIC_LIST_0 ; 6192 getRefListAndRefFrmIdx(0, privateRefPicList, refFrmIdx); // find the reference picture from base view 6193 6194 pDInfo->m_aListIdx[ pDInfo->iN ] = privateRefPicList; 6195 pDInfo->m_aRefIdx [ pDInfo->iN ] = -1-refFrmIdx; 6196 assert(pDInfo->m_aRefIdx [ pDInfo->iN ] < 0); 6197 #endif 6198 pDInfo->m_acMvCand[pDInfo->iN] = defaultDV; 6199 pDInfo->m_aVIdxCan[pDInfo->iN] = 0; 6200 #if MERL_VSP_NBDV_RefVId_Fix_D0166 // Bug fix for Samsung code. 6201 pDInfo->iN++; 6202 #endif 6203 } 6204 #endif 6205 6206 #if QC_CU_NBDV_D0181 6207 return false; 6208 #else 5310 6209 return; 6210 #endif 5311 6211 } 5312 6212 #endif … … 5322 6222 */ 5323 6223 #if H3D_IVMP 6224 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 5324 6225 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 5325 6226 { 6227 fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo); 6228 } 6229 #else 6230 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 6231 { 6232 5326 6233 if (!m_pcSlice->getSPS()->getViewId() || !m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5327 6234 { … … 5350 6257 // Extension part 5351 6258 DisInfo cDisInfo; 6259 #if QC_CU_NBDV_D0181 6260 cDisInfo.iN = this->getDvInfo(0).iN; 6261 cDisInfo.m_acMvCand[0]=this->getDvInfo(0).m_acMvCand[0]; 6262 cDisInfo.m_aVIdxCan[0] = this->getDvInfo(0).m_aVIdxCan[0]; 6263 cDisInfo.bDV = this->getDvInfo(0).bDV; 6264 #else 5352 6265 cDisInfo.iN = 0; 5353 6266 #if FCO_DVP_REFINE_C0132_C0170 … … 5382 6295 cDisInfo.m_aVIdxCan[0] = 0; 5383 6296 } 6297 #endif 5384 6298 Int paiPdmRefIdx[4] = {-1, -1, -1, -1}; 5385 6299 Int iPdmDir[4] = {-1, -1, -1, -1}; … … 5402 6316 } 5403 6317 } 6318 #endif 5404 6319 5405 6320 … … 5700 6615 } 5701 6616 5702 #if MERL_VSP_C0152 6617 #if MERL_VSP_C0152&!QC_BVSP_CleanUP_D0191 5703 6618 if(pcTmpCU != NULL && pcTmpCU->getVSPIndex(uiIdx)) 5704 6619 { … … 5816 6731 } 5817 6732 5818 #if MERL_VSP_C0152 6733 #if MERL_VSP_C0152 &!QC_BVSP_CleanUP_D0191 5819 6734 if(pcTmpCU->getVSPIndex(uiIdx)) 5820 6735 { … … 5979 6894 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 5980 6895 iColViewIdx = pColCU->getSlice()->getViewId(); 5981 #if MERL_VSP_C0152 6896 #if MERL_VSP_C0152 & !QC_BVSP_CleanUP_D0191 5982 6897 if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0) 5983 6898 { … … 7080 7995 memcpy( m_piVSPIndex + uiAbsPartIdxDst, pcCU->getVSPIndex() + uiAbsPartIdxSrc, sizeof( m_piVSPIndex[0] ) * uiNumPartition ); 7081 7996 #endif 7997 #if MERL_VSP_NBDV_RefVId_Fix_D0166 7998 memcpy( m_piVSPDir + uiAbsPartIdxDst, pcCU->getVSPDir () + uiAbsPartIdxSrc, sizeof( m_piVSPDir [0] ) * uiNumPartition ); 7999 #endif 7082 8000 7083 8001 #if !MTK_UNCONSTRAINED_MVI_B0083 … … 7158 8076 TComDataCU::getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv ) 7159 8077 { 8078 #if !QC_ARP_D0177 7160 8079 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 7161 8080 ROFRS( pcResidualGenerator, false ); 8081 #endif 8082 7162 8083 #if H3D_NBDV 7163 8084 DisInfo cDisInfo; 8085 #if !QC_CU_NBDV_D0181 7164 8086 cDisInfo.iN = 0; 8087 #else 8088 cDisInfo.bDV = false; 8089 #endif 7165 8090 PartSize m_peSaved = getPartitionSize( 0 ); 7166 8091 m_pePartSize[0] = SIZE_2Nx2N; … … 7182 8107 else 7183 8108 #endif 7184 8109 #if !QC_CU_NBDV_D0181 7185 8110 getDisMvpCandNBDV( 0, 0, &cDisInfo, false ); 7186 7187 8111 if( cDisInfo.iN == 0) 8112 #else 8113 cDisInfo.bDV = getDvInfo(0).bDV; 8114 #if MERL_VSP_C0152 8115 cDisInfo.m_acMvCand[0] = getDvInfo(0).m_acMvCandNoRef[0]; 8116 #else 8117 cDisInfo.m_acMvCand[0] = getDvInfo(0).m_acMvCand[0]; 8118 #endif 8119 cDisInfo.m_aVIdxCan[0] = 0; 8120 cDisInfo.iN = getDvInfo(0).iN; 8121 if( cDisInfo.bDV == false) 8122 #endif 7188 8123 { 7189 8124 m_pePartSize[0] = m_peSaved; … … 7191 8126 } 7192 8127 else 8128 #if QC_ARP_D0177 8129 if(m_pcSlice->getSPS()->getUseAdvRP()) 8130 { 8131 m_pePartSize[0] = m_peSaved; 8132 return true; 8133 } 8134 else 8135 return false; 8136 #else 7193 8137 { 7194 8138 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0], bRecon ); … … 7196 8140 return bAvailable; 7197 8141 } 8142 #endif 7198 8143 #else 7199 8144 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, bRecon ); … … 7201 8146 } 7202 8147 #endif 7203 8148 #if QC_ARP_D0177 8149 Void TComDataCU::setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ) 8150 { 8151 assert( sizeof( *m_puhARPW) == 1 ); 8152 memset( m_puhARPW + uiAbsPartIdx, w, m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ) ); 8153 } 8154 #endif 7204 8155 #if LGE_EDGE_INTRA_A0070 7205 8156 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )
Note: See TracChangeset for help on using the changeset viewer.