Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r210 r296 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 ( mrgCandIdx == iCount ) 108 { 109 return false; 110 } 111 iCount ++; 112 } 113 } 114 } 115 } 116 return true; 117 } 118 #endif 119 53 120 // ==================================================================================================================== 54 121 // Constructor / destructor / create / destroy … … 79 146 #endif 80 147 m_puhMergeIndex = NULL; 148 #if MERL_VSP_C0152 149 m_piVSPIndex = NULL; 150 #endif 81 151 m_puhLumaIntraDir = NULL; 82 152 m_puhChromaIntraDir = NULL; … … 135 205 #if HHI_DMM_PRED_TEX 136 206 m_puiWedgePredTexTabIdx = NULL; 207 #if LGE_DMM3_SIMP_C0044 208 m_puiWedgePredTexIntraTabIdx = NULL; 209 #endif 137 210 m_piWedgePredTexDeltaDC1 = NULL; 138 211 m_piWedgePredTexDeltaDC2 = NULL; … … 141 214 m_piContourPredTexDeltaDC2 = NULL; 142 215 #endif 143 #if H HI_INTER_VIEW_RESIDUAL_PRED216 #if H3D_IVRP 144 217 m_pbResPredAvailable = NULL; 145 218 m_pbResPredFlag = NULL; … … 182 255 if ( !bDecSubCu ) 183 256 { 184 #if H0736_AVC_STYLE_QP_RANGE185 257 m_phQP = (Char* )xMalloc(Char, uiNumPartition); 186 #else187 m_phQP = (UChar* )xMalloc(UChar, uiNumPartition);188 #endif189 258 m_puhDepth = (UChar* )xMalloc(UChar, uiNumPartition); 190 259 #if HHI_MPI … … 213 282 #endif 214 283 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 215 #if HHI_INTER_VIEW_RESIDUAL_PRED 284 #if MERL_VSP_C0152 285 m_piVSPIndex = (Char* )xMalloc(Char, uiNumPartition); 286 #endif 287 #if H3D_IVRP 216 288 m_pbResPredAvailable = (Bool* )xMalloc(Bool, uiNumPartition); 217 289 m_pbResPredFlag = (Bool* )xMalloc(Bool, uiNumPartition); … … 283 355 #if HHI_DMM_PRED_TEX 284 356 m_puiWedgePredTexTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 357 #if LGE_DMM3_SIMP_C0044 358 m_puiWedgePredTexIntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition); 359 #endif 285 360 m_piWedgePredTexDeltaDC1 = (Int* )xMalloc(Int, uiNumPartition); 286 361 m_piWedgePredTexDeltaDC2 = (Int* )xMalloc(Int, 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 #if H HI_INTER_VIEW_RESIDUAL_PRED445 #if H3D_IVRP 368 446 if ( m_pbResPredAvailable ) { xFree(m_pbResPredAvailable); m_pbResPredAvailable= NULL; } 369 447 if ( m_pbResPredFlag ) { xFree(m_pbResPredFlag); m_pbResPredFlag = NULL; } … … 408 486 #if HHI_DMM_PRED_TEX 409 487 if ( m_puiWedgePredTexTabIdx ) { xFree(m_puiWedgePredTexTabIdx ); m_puiWedgePredTexTabIdx = NULL; } 488 #if LGE_DMM3_SIMP_C0044 489 if ( m_puiWedgePredTexIntraTabIdx ) { xFree(m_puiWedgePredTexIntraTabIdx); m_puiWedgePredTexIntraTabIdx = NULL; } 490 #endif 410 491 if ( m_piWedgePredTexDeltaDC1 ) { xFree(m_piWedgePredTexDeltaDC1 ); m_piWedgePredTexDeltaDC1 = NULL; } 411 492 if ( m_piWedgePredTexDeltaDC2 ) { xFree(m_piWedgePredTexDeltaDC2 ); m_piWedgePredTexDeltaDC2 = NULL; } … … 463 544 this->height = src.height; 464 545 ::memcpy(this->isBorderAvailable, src.isBorderAvailable, sizeof(Bool)*((Int)NUM_SGU_BORDER)); 465 #if LCU_SYNTAX_ALF466 546 this->allBordersAvailable = src.allBordersAvailable; 467 #endif468 547 469 548 return *this; … … 500 579 m_uiTotalBins = 0; 501 580 m_uiNumPartition = pcPic->getNumPartInCU(); 502 #if BURST_IPCM503 581 m_numSucIPCM = 0; 504 582 m_lastCUSucIPCMFlag = false; 505 #endif506 583 507 584 for(int i=0; i<pcPic->getNumPartInCU(); i++) … … 558 635 #endif 559 636 m_puhMergeIndex[ui]=pcFrom->m_puhMergeIndex[ui]; 637 #if MERL_VSP_C0152 638 m_piVSPIndex[ui] = pcFrom->m_piVSPIndex[ui]; 639 #endif 560 640 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; 561 641 m_puhChromaIntraDir[ui]=pcFrom->m_puhChromaIntraDir[ui]; … … 598 678 #endif 599 679 memset( m_puhMergeIndex + firstElement, 0, numElements * sizeof( *m_puhMergeIndex ) ); 680 #if MERL_VSP_C0152 681 memset( m_piVSPIndex + firstElement, 0, numElements * sizeof( *m_piVSPIndex ) ); 682 #endif 600 683 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); 601 684 memset( m_puhChromaIntraDir + firstElement, 0, numElements * sizeof( *m_puhChromaIntraDir ) ); … … 618 701 #if HHI_DMM_PRED_TEX 619 702 memset( m_puiWedgePredTexTabIdx + firstElement, 0, sizeof( UInt ) * numElements ); 703 #if LGE_DMM3_SIMP_C0044 704 memset( m_puiWedgePredTexIntraTabIdx + firstElement, 0, sizeof( UInt ) * numElements ); 705 #endif 620 706 memset( m_piWedgePredTexDeltaDC1 + firstElement, 0, sizeof( Int ) * numElements ); 621 707 memset( m_piWedgePredTexDeltaDC2 + firstElement, 0, sizeof( Int ) * numElements ); … … 627 713 memset (m_pbRenderable + firstElement, false, sizeof( Bool ) * numElements) ; 628 714 #endif 629 #if H HI_INTER_VIEW_RESIDUAL_PRED715 #if H3D_IVRP 630 716 memset( m_pbResPredAvailable + firstElement, 0 , sizeof( Bool ) * numElements ); 631 717 memset( m_pbResPredFlag + firstElement, 0 , sizeof( Bool ) * numElements ); … … 720 806 } 721 807 722 #if H0736_AVC_STYLE_QP_RANGE723 808 /** initialize prediction data with enabling sub-LCU-level delta QP 724 809 *\param uiDepth depth of the current CU … … 729 814 */ 730 815 Void TComDataCU::initEstData( UInt uiDepth, Int qp ) 731 #else732 /** initialize prediction data with enabling sub-LCU-level delta QP733 *\param uiDepth depth of the current CU734 *\param uiQP QP for the current CU735 *- set CU width and CU height according to depth736 *- set QP value according to input QP737 *- set last-coded QP value according to input last-coded QP738 */739 Void TComDataCU::initEstData( UInt uiDepth, UInt uiQP )740 #endif741 816 { 742 817 m_dTotalCost = MAX_DOUBLE; … … 770 845 m_pePredMode[ui] = MODE_NONE; 771 846 m_pbIPCMFlag[ui] = 0; 772 #if H0736_AVC_STYLE_QP_RANGE773 847 m_phQP[ui] = qp; 774 #else775 m_phQP[ui] = uiQP;776 #endif777 848 m_puiAlfCtrlFlag[ui]= false; 778 849 m_pbMergeFlag[ui] = 0; … … 781 852 #endif 782 853 m_puhMergeIndex[ui] = 0; 783 #if HHI_INTER_VIEW_RESIDUAL_PRED 854 #if MERL_VSP_C0152 855 m_piVSPIndex[ui] = 0; 856 #endif 857 #if H3D_IVRP 784 858 m_pbResPredAvailable[ui] = 0; 785 859 m_pbResPredFlag[ui] = 0; … … 803 877 #if HHI_DMM_PRED_TEX 804 878 m_puiWedgePredTexTabIdx [ui] = 0; 879 #if LGE_DMM3_SIMP_C0044 880 m_puiWedgePredTexIntraTabIdx [ui] = 0; 881 #endif 805 882 m_piWedgePredTexDeltaDC1 [ui] = 0; 806 883 m_piWedgePredTexDeltaDC2 [ui] = 0; … … 845 922 846 923 // initialize Sub partition 847 #if H0736_AVC_STYLE_QP_RANGE848 924 Void TComDataCU::initSubCU( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ) 849 #else850 Void TComDataCU::initSubCU( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, UInt uiQP )851 #endif852 925 { 853 926 assert( uiPartUnitIdx<4 ); … … 869 942 m_uiNumPartition = pcCU->getTotalNumPart() >> 2; 870 943 871 #if BURST_IPCM872 944 m_numSucIPCM = 0; 873 945 m_lastCUSucIPCMFlag = false; 874 #endif875 946 876 947 Int iSizeInUchar = sizeof( UChar ) * m_uiNumPartition; 877 948 Int iSizeInBool = sizeof( Bool ) * m_uiNumPartition; 878 879 #if H0736_AVC_STYLE_QP_RANGE 949 #if MERL_VSP_C0152 950 Int iSizeInChar = sizeof( Char ) * m_uiNumPartition; 951 #endif 952 880 953 Int sizeInChar = sizeof( Char ) * m_uiNumPartition; 881 954 memset( m_phQP, qp, sizeInChar ); 882 #else883 memset( m_phQP, uiQP, iSizeInUchar );884 #endif885 955 886 956 memset( m_puiAlfCtrlFlag, 0, iSizeInBool ); … … 893 963 #endif 894 964 memset( m_puhMergeIndex, 0, iSizeInUchar ); 895 #if HHI_INTER_VIEW_RESIDUAL_PRED 965 #if MERL_VSP_C0152 966 memset( m_piVSPIndex, 0, iSizeInChar ); 967 #endif 968 #if H3D_IVRP 896 969 memset( m_pbResPredAvailable, 0, iSizeInBool ); 897 970 memset( m_pbResPredFlag, 0, iSizeInBool ); … … 921 994 #if HHI_DMM_PRED_TEX 922 995 memset( m_puiWedgePredTexTabIdx, 0, sizeof( UInt ) * m_uiNumPartition ); 996 #if LGE_DMM3_SIMP_C0044 997 memset( m_puiWedgePredTexIntraTabIdx, 0, sizeof( UInt ) * m_uiNumPartition ); 998 #endif 923 999 memset( m_piWedgePredTexDeltaDC1, 0, sizeof( Int ) * m_uiNumPartition ); 924 1000 memset( m_piWedgePredTexDeltaDC2, 0, sizeof( Int ) * m_uiNumPartition ); … … 973 1049 #endif 974 1050 m_puhMergeIndex[ui]=pcCU->m_puhMergeIndex[uiPartOffset+ui]; 1051 #if MERL_VSP_C0152 1052 m_piVSPIndex[ui]=pcCU->m_piVSPIndex[uiPartOffset+ui]; 1053 #endif 975 1054 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; 976 1055 m_puhChromaIntraDir[ui]=pcCU->m_puhChromaIntraDir[uiPartOffset+ui]; … … 992 1071 #if HHI_DMM_PRED_TEX 993 1072 m_puiWedgePredTexTabIdx [ui]=pcCU->getWedgePredTexTabIdx (uiPartOffset+ui); 1073 #if LGE_DMM3_SIMP_C0044 1074 m_puiWedgePredTexIntraTabIdx [ui]=pcCU->getWedgePredTexIntraTabIdx (uiPartOffset+ui); 1075 #endif 994 1076 m_piWedgePredTexDeltaDC1 [ui]=pcCU->getWedgePredTexDeltaDC1 (uiPartOffset+ui); 995 1077 m_piWedgePredTexDeltaDC2 [ui]=pcCU->getWedgePredTexDeltaDC2 (uiPartOffset+ui); … … 998 1080 m_piContourPredTexDeltaDC2[ui]=pcCU->getContourPredTexDeltaDC2(uiPartOffset+ui); 999 1081 #endif 1000 #if H HI_INTER_VIEW_RESIDUAL_PRED1082 #if H3D_IVRP 1001 1083 m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ]; 1002 1084 m_pbResPredFlag [ui] = pcCU->m_pbResPredFlag [ uiPartOffset + ui ]; … … 1117 1199 #endif 1118 1200 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 1119 #if HHI_INTER_VIEW_RESIDUAL_PRED 1201 #if MERL_VSP_C0152 1202 m_piVSPIndex = pcCU->getVSPIndex() + uiPart; 1203 #endif 1204 #if H3D_IVRP 1120 1205 m_pbResPredAvailable = pcCU->getResPredAvail() + uiPart; 1121 1206 m_pbResPredFlag = pcCU->getResPredFlag () + uiPart; … … 1193 1278 #if HHI_DMM_PRED_TEX 1194 1279 m_puiWedgePredTexTabIdx = pcCU->getWedgePredTexTabIdx() + uiPart; 1280 #if LGE_DMM3_SIMP_C0044 1281 m_puiWedgePredTexIntraTabIdx = pcCU->getWedgePredTexIntraTabIdx() + uiPart; 1282 #endif 1195 1283 m_piWedgePredTexDeltaDC1 = pcCU->getWedgePredTexDeltaDC1() + uiPart; 1196 1284 m_piWedgePredTexDeltaDC2 = pcCU->getWedgePredTexDeltaDC2() + uiPart; … … 1227 1315 m_uiCUAddr = pcCU->getAddr(); 1228 1316 m_uiAbsIdxInLCU = uiAbsPartIdx; 1229 1317 1230 1318 Int iRastPartIdx = g_auiZscanToRaster[uiAbsPartIdx]; 1231 1319 m_uiCUPelX = pcCU->getCUPelX() + m_pcPic->getMinCUWidth ()*( iRastPartIdx % m_pcPic->getNumPartInWidth() ); … … 1257 1345 #endif 1258 1346 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1259 #if HHI_INTER_VIEW_RESIDUAL_PRED 1347 #if MERL_VSP_C0152 1348 m_piVSPIndex = pcCU->getVSPIndex() + uiAbsPartIdx; 1349 #endif 1350 #if H3D_IVRP 1260 1351 m_pbResPredAvailable = pcCU->getResPredAvail() + uiAbsPartIdx; 1261 1352 m_pbResPredFlag = pcCU->getResPredFlag () + uiAbsPartIdx; … … 1288 1379 Int iSizeInUchar = sizeof( UChar ) * uiNumPartition; 1289 1380 Int iSizeInBool = sizeof( Bool ) * uiNumPartition; 1290 1291 #if H0736_AVC_STYLE_QP_RANGE 1381 #if MERL_VSP_C0152 1382 Int iSizeInChar = sizeof( Char ) * uiNumPartition; 1383 #endif 1384 1292 1385 Int sizeInChar = sizeof( Char ) * uiNumPartition; 1293 1386 memcpy( m_phQP + uiOffset, pcCU->getQP(), sizeInChar ); 1294 #else1295 memcpy( m_phQP + uiOffset, pcCU->getQP(), iSizeInUchar );1296 #endif1297 1387 memcpy( m_pePartSize + uiOffset, pcCU->getPartitionSize(), sizeof( *m_pePartSize ) * uiNumPartition ); 1298 1388 memcpy( m_pePredMode + uiOffset, pcCU->getPredictionMode(), sizeof( *m_pePredMode ) * uiNumPartition ); … … 1306 1396 #endif 1307 1397 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 1308 #if HHI_INTER_VIEW_RESIDUAL_PRED 1398 #if MERL_VSP_C0152 1399 memcpy( m_piVSPIndex + uiOffset, pcCU->getVSPIndex(), iSizeInChar ); 1400 #endif 1401 #if H3D_IVRP 1309 1402 memcpy( m_pbResPredAvailable + uiOffset, pcCU->getResPredAvail(), iSizeInBool ); 1310 1403 memcpy( m_pbResPredFlag + uiOffset, pcCU->getResPredFlag(), iSizeInBool ); … … 1375 1468 #if HHI_DMM_PRED_TEX 1376 1469 memcpy( m_puiWedgePredTexTabIdx + uiOffset, pcCU->getWedgePredTexTabIdx(), sizeof( UInt ) * uiNumPartition ); 1470 #if LGE_DMM3_SIMP_C0044 1471 memcpy( m_puiWedgePredTexIntraTabIdx + uiOffset, pcCU->getWedgePredTexIntraTabIdx(), sizeof( UInt ) * uiNumPartition ); 1472 #endif 1377 1473 memcpy( m_piWedgePredTexDeltaDC1 + uiOffset, pcCU->getWedgePredTexDeltaDC1(), sizeof( Int ) * uiNumPartition ); 1378 1474 memcpy( m_piWedgePredTexDeltaDC2 + uiOffset, pcCU->getWedgePredTexDeltaDC2(), sizeof( Int ) * uiNumPartition ); … … 1419 1515 Int iSizeInUchar = sizeof( UChar ) * m_uiNumPartition; 1420 1516 Int iSizeInBool = sizeof( Bool ) * m_uiNumPartition; 1421 1422 #if H0736_AVC_STYLE_QP_RANGE 1517 #if MERL_VSP_C0152 1518 Int iSizeInChar = sizeof( Char ) * m_uiNumPartition; 1519 #endif 1520 1423 1521 Int sizeInChar = sizeof( Char ) * m_uiNumPartition; 1424 1522 memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar ); 1425 #else1426 memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, iSizeInUchar );1427 #endif1428 1523 1429 1524 memcpy( rpcCU->getPartitionSize() + m_uiAbsIdxInLCU, m_pePartSize, sizeof( *m_pePartSize ) * m_uiNumPartition ); … … 1440 1535 #endif 1441 1536 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 1442 #if HHI_INTER_VIEW_RESIDUAL_PRED 1537 #if MERL_VSP_C0152 1538 memcpy( rpcCU->getVSPIndex() + m_uiAbsIdxInLCU, m_piVSPIndex, iSizeInChar ); 1539 #endif 1540 #if H3D_IVRP 1443 1541 memcpy( rpcCU->getResPredAvail() + m_uiAbsIdxInLCU, m_pbResPredAvailable, iSizeInBool ); 1444 1542 memcpy( rpcCU->getResPredFlag() + m_uiAbsIdxInLCU, m_pbResPredFlag, iSizeInBool ); … … 1501 1599 #if HHI_DMM_PRED_TEX 1502 1600 memcpy( rpcCU->getWedgePredTexTabIdx() + m_uiAbsIdxInLCU, m_puiWedgePredTexTabIdx, sizeof( UInt ) * m_uiNumPartition ); 1601 #if LGE_DMM3_SIMP_C0044 1602 memcpy( rpcCU->getWedgePredTexIntraTabIdx() + m_uiAbsIdxInLCU, m_puiWedgePredTexIntraTabIdx, sizeof( UInt ) * m_uiNumPartition ); 1603 #endif 1503 1604 memcpy( rpcCU->getWedgePredTexDeltaDC1() + m_uiAbsIdxInLCU, m_piWedgePredTexDeltaDC1, sizeof( Int ) * m_uiNumPartition ); 1504 1605 memcpy( rpcCU->getWedgePredTexDeltaDC2() + m_uiAbsIdxInLCU, m_piWedgePredTexDeltaDC2, sizeof( Int ) * m_uiNumPartition ); … … 1547 1648 Int iSizeInUchar = sizeof( UChar ) * uiQNumPart; 1548 1649 Int iSizeInBool = sizeof( Bool ) * uiQNumPart; 1549 1550 #if H0736_AVC_STYLE_QP_RANGE 1650 #if MERL_VSP_C0152 1651 Int iSizeInChar = sizeof( Char ) * uiQNumPart; 1652 #endif 1653 1551 1654 Int sizeInChar = sizeof( Char ) * uiQNumPart; 1552 1655 memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar ); 1553 #else1554 memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, iSizeInUchar );1555 #endif1556 1656 memcpy( rpcCU->getPartitionSize() + uiPartOffset, m_pePartSize, sizeof( *m_pePartSize ) * uiQNumPart ); 1557 1657 #if HHI_INTERVIEW_SKIP … … 1566 1666 #endif 1567 1667 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1568 #if HHI_INTER_VIEW_RESIDUAL_PRED 1668 #if MERL_VSP_C0152 1669 memcpy( rpcCU->getVSPIndex() + uiPartOffset, m_piVSPIndex, iSizeInChar ); 1670 #endif 1671 #if H3D_IVRP 1569 1672 memcpy( rpcCU->getResPredAvail() + uiPartOffset, m_pbResPredAvailable, iSizeInBool ); 1570 1673 memcpy( rpcCU->getResPredFlag() + uiPartOffset, m_pbResPredFlag, iSizeInBool ); … … 1628 1731 #if HHI_DMM_PRED_TEX 1629 1732 memcpy( rpcCU->getWedgePredTexTabIdx() + uiPartOffset, m_puiWedgePredTexTabIdx, sizeof( UInt ) * uiQNumPart ); 1733 #if LGE_DMM3_SIMP_C0044 1734 memcpy( rpcCU->getWedgePredTexIntraTabIdx() + uiPartOffset, m_puiWedgePredTexIntraTabIdx, sizeof( UInt ) * uiQNumPart ); 1735 #endif 1630 1736 memcpy( rpcCU->getWedgePredTexDeltaDC1() + uiPartOffset, m_piWedgePredTexDeltaDC1, sizeof( Int ) * uiQNumPart ); 1631 1737 memcpy( rpcCU->getWedgePredTexDeltaDC2() + uiPartOffset, m_piWedgePredTexDeltaDC2, sizeof( Int ) * uiQNumPart ); … … 1704 1810 (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || m_pcCULeft->getSCUAddr()+uiLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx))) 1705 1811 || 1706 #if !REMOVE_TILE_DEPENDENCE1707 (bEnforceTileRestriction && ( m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) ) )1708 #else1709 1812 (bEnforceTileRestriction && ( m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) ) ) 1710 #endif1711 1813 ) 1712 1814 { … … 1766 1868 (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || m_pcCUAbove->getSCUAddr()+uiAPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx))) 1767 1869 || 1768 #if !REMOVE_TILE_DEPENDENCE1769 (bEnforceTileRestriction &&(m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))))1770 #else1771 1870 (bEnforceTileRestriction &&(m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())))) 1772 #endif1773 1871 ) 1774 1872 { … … 1817 1915 if ( (bEnforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 1818 1916 m_pcCUAbove->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 1819 #if !REMOVE_TILE_DEPENDENCE1820 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1821 #else1822 1917 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1823 #endif1824 1918 ))|| 1825 1919 (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 1826 1920 m_pcCUAbove->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 1827 #if !REMOVE_TILE_DEPENDENCE1828 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1829 #else1830 1921 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1831 #endif1832 1922 )) 1833 1923 ) … … 1843 1933 if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 1844 1934 m_pcCULeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 1845 #if !REMOVE_TILE_DEPENDENCE1846 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1847 #else1848 1935 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1849 #endif1850 1936 ))|| 1851 1937 (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 1852 1938 m_pcCULeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 1853 #if !REMOVE_TILE_DEPENDENCE1854 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1855 #else1856 1939 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1857 #endif1858 1940 )) 1859 1941 ) … … 1871 1953 if ( (bEnforceSliceRestriction && (m_pcCUAboveLeft==NULL || m_pcCUAboveLeft->getSlice()==NULL || 1872 1954 m_pcCUAboveLeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 1873 #if !REMOVE_TILE_DEPENDENCE1874 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1875 #else1876 1955 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1877 #endif1878 1956 ))|| 1879 1957 (bEnforceEntropySliceRestriction && (m_pcCUAboveLeft==NULL || m_pcCUAboveLeft->getSlice()==NULL || 1880 1958 m_pcCUAboveLeft->getSCUAddr()+uiALPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 1881 #if !REMOVE_TILE_DEPENDENCE1882 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1883 #else1884 1959 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveLeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1885 #endif1886 1960 )) 1887 1961 ) … … 1943 2017 if ( (bEnforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 1944 2018 m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 1945 #if !REMOVE_TILE_DEPENDENCE1946 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1947 #else1948 2019 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1949 #endif1950 2020 ))|| 1951 2021 (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 1952 2022 m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 1953 #if !REMOVE_TILE_DEPENDENCE1954 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1955 #else1956 2023 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1957 #endif1958 2024 )) 1959 2025 ) … … 1978 2044 m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) || 1979 2045 m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 1980 #if !REMOVE_TILE_DEPENDENCE1981 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1982 #else1983 2046 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1984 #endif1985 2047 ))|| 1986 2048 (bEnforceEntropySliceRestriction && (m_pcCUAboveRight==NULL || m_pcCUAboveRight->getSlice()==NULL || 1987 2049 m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) || 1988 2050 m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 1989 #if !REMOVE_TILE_DEPENDENCE1990 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))1991 #else1992 2051 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 1993 #endif1994 2052 )) 1995 2053 ) … … 2046 2104 if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 2047 2105 m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 2048 #if !REMOVE_TILE_DEPENDENCE2049 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2050 #else2051 2106 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2052 #endif2053 2107 ))|| 2054 2108 (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 2055 2109 m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 2056 #if !REMOVE_TILE_DEPENDENCE2057 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2058 #else2059 2110 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2060 #endif2061 2111 )) 2062 2112 ) … … 2117 2167 if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 2118 2168 m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 2119 #if !REMOVE_TILE_DEPENDENCE2120 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2121 #else2122 2169 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2123 #endif2124 2170 ))|| 2125 2171 (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 2126 2172 m_pcCULeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 2127 #if !REMOVE_TILE_DEPENDENCE2128 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2129 #else2130 2173 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2131 #endif2132 2174 )) 2133 2175 ) … … 2189 2231 if ( (bEnforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 2190 2232 m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 2191 #if !REMOVE_TILE_DEPENDENCE2192 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2193 #else2194 2233 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2195 #endif2196 2234 ))|| 2197 2235 (bEnforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 2198 2236 m_pcCUAbove->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 2199 #if !REMOVE_TILE_DEPENDENCE2200 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2201 #else2202 2237 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2203 #endif2204 2238 )) 2205 2239 ) … … 2220 2254 m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) || 2221 2255 m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx)|| 2222 #if !REMOVE_TILE_DEPENDENCE2223 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2224 #else2225 2256 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2226 #endif2227 2257 ))|| 2228 2258 (bEnforceEntropySliceRestriction && (m_pcCUAboveRight==NULL || m_pcCUAboveRight->getSlice()==NULL || 2229 2259 m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUAboveRight->getAddr()) > m_pcPic->getPicSym()->getInverseCUOrderMap( getAddr()) || 2230 2260 m_pcCUAboveRight->getSCUAddr()+uiARPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx)|| 2231 #if !REMOVE_TILE_DEPENDENCE2232 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2233 #else2234 2261 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAboveRight->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2235 #endif2236 2262 )) 2237 2263 ) … … 2280 2306 if ( (bEnforceSliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 2281 2307 m_pcCULeft->getSCUAddr()+uiLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiAbsZorderQpMinCUIdx)|| 2282 #if !REMOVE_TILE_DEPENDENCE2283 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2284 #else2285 2308 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2286 #endif2287 2309 ))|| 2288 2310 (bEnforceEntropySliceRestriction && (m_pcCULeft==NULL || m_pcCULeft->getSlice()==NULL || 2289 2311 m_pcCULeft->getSCUAddr()+uiLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiAbsZorderQpMinCUIdx)|| 2290 #if !REMOVE_TILE_DEPENDENCE2291 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2292 #else2293 2312 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCULeft->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2294 #endif2295 2313 )) 2296 2314 ) … … 2299 2317 } 2300 2318 2301 #if H0204_QP_PREDICTION2302 2319 if ( m_pcCULeft && m_pcCULeft->getAddr() != getAddr() ) 2303 2320 { 2304 2321 return NULL; 2305 2322 } 2306 #endif2307 2323 2308 2324 return m_pcCULeft; 2309 2325 } 2310 2326 2311 #if H0204_QP_PREDICTION2312 2327 /** Get Above QpMinCu 2313 2328 *\param aPartUnitIdx … … 2347 2362 if ( (enforceSliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 2348 2363 m_pcCUAbove->getSCUAddr()+aPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(absZorderQpMinCUIdx)|| 2349 #if !REMOVE_TILE_DEPENDENCE2350 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2351 #else2352 2364 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2353 #endif2354 2365 ))|| 2355 2366 (enforceEntropySliceRestriction && (m_pcCUAbove==NULL || m_pcCUAbove->getSlice()==NULL || 2356 2367 m_pcCUAbove->getSCUAddr()+aPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(absZorderQpMinCUIdx)|| 2357 #if !REMOVE_TILE_DEPENDENCE2358 (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() && m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr()))2359 #else2360 2368 (m_pcPic->getPicSym()->getTileIdxMap( m_pcCUAbove->getAddr() ) != m_pcPic->getPicSym()->getTileIdxMap(getAddr())) 2361 #endif2362 2369 )) 2363 2370 ) … … 2373 2380 return m_pcCUAbove; 2374 2381 } 2375 #endif 2376 2377 #if H0736_AVC_STYLE_QP_RANGE 2382 2378 2383 /** Get reference QP from left QpMinCu or latest coded QP 2379 2384 *\param uiCurrAbsIdxInLCU … … 2381 2386 */ 2382 2387 Char TComDataCU::getRefQP( UInt uiCurrAbsIdxInLCU ) 2383 #else 2384 /** Get reference QP from left QpMinCu or latest coded QP 2385 *\param uiCurrAbsIdxInLCU 2386 *\returns UChar reference QP value 2387 */ 2388 UChar TComDataCU::getRefQP( UInt uiCurrAbsIdxInLCU ) 2389 #endif 2390 { 2391 #if H0204_QP_PREDICTION 2388 { 2392 2389 UInt lPartIdx, aPartIdx; 2393 2390 lPartIdx = 0; … … 2396 2393 TComDataCU* cUAbove = getQpMinCuAbove( aPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU ); 2397 2394 return (((cULeft? cULeft->getQP( lPartIdx ): getLastCodedQP( uiCurrAbsIdxInLCU )) + (cUAbove? cUAbove->getQP( aPartIdx ): getLastCodedQP( uiCurrAbsIdxInLCU )) + 1) >> 1); 2398 #else2399 // Left CU2400 TComDataCU* pcCULeft;2401 UInt uiLPartIdx;2402 pcCULeft = getQpMinCuLeft( uiLPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU );2403 if ( pcCULeft )2404 {2405 return pcCULeft->getQP(uiLPartIdx);2406 }2407 // Last QP2408 return getLastCodedQP( uiCurrAbsIdxInLCU );2409 #endif2410 2395 } 2411 2396 … … 2422 2407 } 2423 2408 2424 #if H0736_AVC_STYLE_QP_RANGE2425 2409 Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx ) 2426 #else2427 UChar TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )2428 #endif2429 2410 { 2430 2411 UInt uiQUPartIdxMask = ~((1<<(8-(getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))-1); … … 2463 2444 Bool TComDataCU::isLosslessCoded(UInt absPartIdx) 2464 2445 { 2465 #if H0736_AVC_STYLE_QP_RANGE2466 2446 return ( getSlice()->getSPS()->getUseLossless() && ((getQP(absPartIdx) + getSlice()->getSPS()->getQpBDOffsetY()) == 0) ); 2467 #else2468 return ( getSlice()->getSPS()->getUseLossless() && (getQP(absPartPIdx) == 0) );2469 #endif2470 2447 } 2471 2448 #endif … … 2480 2457 { 2481 2458 uiModeList[0] = PLANAR_IDX; 2482 #if LOGI_INTRA_NAME_3MPM2483 2459 uiModeList[1] = VER_IDX; 2484 2460 uiModeList[2] = HOR_IDX; 2485 #else2486 uiModeList[1] = 1;2487 uiModeList[2] = 2;2488 #endif2489 2461 uiModeList[3] = DC_IDX; 2490 2462 uiModeList[4] = LM_CHROMA_IDX; … … 2500 2472 if( uiLumaMode == uiModeList[i] ) 2501 2473 { 2502 #if LOGI_INTRA_NAME_3MPM2503 2474 uiModeList[i] = 34; // VER+8 mode 2504 #else2505 uiModeList[i] = 7; // VER+8 mode2506 #endif2507 2475 break; 2508 2476 } … … 2526 2494 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx ); 2527 2495 2528 #if DEFAULT_DC2529 2496 iLeftIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX; 2530 #else2531 iLeftIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : PLANAR_IDX ) : PLANAR_IDX;2532 #endif2533 2497 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2534 2498 mapDMMtoIntraMode( iLeftIntraDir ); … … 2541 2505 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, true, false, true ); 2542 2506 2543 #if DEFAULT_DC2544 2507 iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : DC_IDX ) : DC_IDX; 2545 #else2546 iAboveIntraDir = pcTempCU ? ( pcTempCU->isIntra( uiTempPartIdx ) ? pcTempCU->getLumaIntraDir( uiTempPartIdx ) : PLANAR_IDX ) : PLANAR_IDX;2547 #endif2548 2508 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2549 2509 mapDMMtoIntraMode( iAboveIntraDir ); … … 2553 2513 #endif 2554 2514 2555 #if LOGI_INTRA_NAME_3MPM2556 2515 uiPredNum = 3; 2557 2516 if(iLeftIntraDir == iAboveIntraDir) … … 2593 2552 } 2594 2553 } 2595 #else2596 Int iIdx = getIntraSizeIdx(uiAbsPartIdx);2597 2598 2599 if ( iLeftIntraDir >= g_aucIntraModeNumAng[iIdx] )2600 {2601 iLeftIntraDir = PLANAR_IDX;2602 }2603 2604 2605 if ( iAboveIntraDir >= g_aucIntraModeNumAng[iIdx] )2606 {2607 iAboveIntraDir = PLANAR_IDX;2608 }2609 2610 if(iLeftIntraDir == iAboveIntraDir)2611 {2612 uiPredNum = 2;2613 2614 if( piMode )2615 {2616 *piMode = iLeftIntraDir;2617 }2618 2619 iAboveIntraDir = iLeftIntraDir == PLANAR_IDX ? DC_IDX : PLANAR_IDX; // DC or Planar2620 2621 assert( iLeftIntraDir != iAboveIntraDir );2622 2623 uiIntraDirPred[0] = min(iLeftIntraDir, iAboveIntraDir);2624 uiIntraDirPred[1] = max(iLeftIntraDir, iAboveIntraDir);2625 }2626 else2627 {2628 uiPredNum = 2;2629 uiIntraDirPred[0] = min(iLeftIntraDir, iAboveIntraDir);2630 uiIntraDirPred[1] = max(iLeftIntraDir, iAboveIntraDir);2631 }2632 #endif2633 2554 2634 2555 return uiPredNum; … … 2680 2601 UInt quadtreeTUMaxDepth = getPredictionMode( absPartIdx ) == MODE_INTRA ? m_pcSlice->getSPS()->getQuadtreeTUMaxDepthIntra() : m_pcSlice->getSPS()->getQuadtreeTUMaxDepthInter(); 2681 2602 Int intraSplitFlag = ( getPredictionMode( absPartIdx ) == MODE_INTRA && partSize == SIZE_NxN ) ? 1 : 0; 2682 #if G519_TU_AMP_NSQT_HARMONIZATION2683 2603 Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize != SIZE_2Nx2N) ); 2684 #else2685 Int interSplitFlag = ((quadtreeTUMaxDepth == 1) && (getPredictionMode( absPartIdx ) == MODE_INTER) && (partSize == SIZE_Nx2N || partSize == SIZE_2NxN) );2686 #endif2687 2604 2688 2605 UInt log2MinTUSizeInCU = 0; … … 2706 2623 2707 2624 2708 #if H HI_INTER_VIEW_RESIDUAL_PRED2625 #if H3D_IVRP 2709 2626 UInt 2710 2627 TComDataCU::getCtxResPredFlag( UInt uiAbsPartIdx ) … … 2853 2770 } 2854 2771 2855 #if H0736_AVC_STYLE_QP_RANGE2856 2772 Void TComDataCU::setQPSubParts( Int qp, UInt uiAbsPartIdx, UInt uiDepth ) 2857 #else2858 Void TComDataCU::setQPSubParts( UInt uiQP, UInt uiAbsPartIdx, UInt uiDepth )2859 #endif2860 2773 { 2861 2774 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); … … 2866 2779 if( m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiSCUIdx+getZorderIdxInCU()) == pcSlice->getEntropySliceCurStartCUAddr() ) 2867 2780 { 2868 #if H0736_AVC_STYLE_QP_RANGE2869 2781 m_phQP[uiSCUIdx] = qp; 2870 #else2871 m_phQP[uiSCUIdx] = uiQP;2872 #endif2873 2782 } 2874 2783 } … … 3033 2942 } 3034 2943 3035 #if HHI_INTER_VIEW_RESIDUAL_PRED 2944 #if MERL_VSP_C0152 2945 Void TComDataCU::setVSPIndexSubParts ( Char iVSPIdx, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2946 { 2947 setSubPart<Char>( iVSPIdx, m_piVSPIndex, uiAbsPartIdx, uiDepth, uiPartIdx ); 2948 } 2949 #endif 2950 2951 #if H3D_IVRP 3036 2952 Void TComDataCU::setResPredAvailSubParts( Bool bResPredAvailable, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3037 2953 { … … 3063 2979 } 3064 2980 2981 #if LGE_ILLUCOMP_DEPTH_C0046 2982 //This modification is not needed after integrating JCT3V-C0137 2983 Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx, UInt uiDepth) 2984 { 2985 UInt uiPartAddr; 2986 UInt iNumbPart; 2987 2988 if(!getSlice()->getIsDepth()) 2989 { 2990 Int iWidth, iHeight; 2991 2992 iNumbPart = ( getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ? 1 : (getPartitionSize(uiAbsPartIdx) == SIZE_NxN ? 4 : 2) ); 2993 2994 for(UInt i = 0; i < iNumbPart; i++) 2995 { 2996 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true); 2997 uiPartAddr += uiAbsPartIdx; 2998 2999 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 3000 { 3001 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 3002 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 3003 3004 if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3005 { 3006 return true; 3007 } 3008 } 3009 } 3010 } 3011 else 3012 { 3013 iNumbPart = getPic()->getNumPartInCU() >> (uiDepth << 1); 3014 3015 for(UInt i = 0; i < iNumbPart; i++) 3016 { 3017 uiPartAddr = uiAbsPartIdx + i; 3018 3019 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 3020 { 3021 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 3022 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 3023 3024 if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3025 { 3026 return true; 3027 } 3028 } 3029 } 3030 } 3031 3032 return false; 3033 } 3034 #else 3065 3035 Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx) 3066 3036 { … … 3086 3056 { 3087 3057 return true; 3088 3089 3058 } 3059 } 3090 3060 } 3091 3061 return false; 3092 3062 } 3063 #endif 3093 3064 #endif 3094 3065 … … 3272 3243 #endif 3273 3244 3274 #if LG_RESTRICTEDRESPRED_M24766 3245 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138 3275 3246 Int TComDataCU::getResiPredMode(UInt uiPartAddr) 3276 3247 { … … 3617 3588 * \param numValidMergeCand 3618 3589 */ 3619 #if SIMP_MRG_PRUN 3590 #if MERL_VSP_C0152 3591 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* iVSPIndexTrue, Int mrgCandIdx ) 3592 #else 3620 3593 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx ) 3594 #endif 3595 { 3596 #if H3D_IVMP 3597 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 3598 const Int extraMergeCand = ( ( getSlice()->getIsDepth() || getSlice()->getSPS()->getMultiviewMvPredMode() )? 1 : 0 ); 3621 3599 #else 3622 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand )3623 #endif3624 {3625 #if HHI_INTER_VIEW_MOTION_PRED3626 3600 const Int extraMergeCand = ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 3601 #endif 3627 3602 #endif 3628 3603 3629 3604 UInt uiAbsPartAddr = m_uiAbsIdxInLCU + uiAbsPartIdx; 3630 3605 UInt uiIdx = 1; 3631 #if H HI_INTER_VIEW_MOTION_PRED3632 bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ];3606 #if H3D_IVMP 3607 Bool abCandIsInter[ MRG_MAX_NUM_CANDS_MEM ]; 3633 3608 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui ) 3634 3609 #else 3635 bool abCandIsInter[ MRG_MAX_NUM_CANDS ];3610 Bool abCandIsInter[ MRG_MAX_NUM_CANDS ]; 3636 3611 for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui ) 3637 3612 #endif … … 3640 3615 } 3641 3616 // compute the location of the current PU 3642 #if PARALLEL_MERGE3643 3617 Int xP, yP, nPSW, nPSH; 3644 3618 this->getPartPosition(uiPUIdx, xP, yP, nPSW, nPSH); 3645 #endif 3646 3619 3620 #if MERL_VSP_C0152 3621 Bool bVspMvZeroDone[3] = {false, false, false}; 3622 #endif 3623 3647 3624 Int iCount = 0; 3648 3625 … … 3652 3629 deriveLeftBottomIdxGeneral( cCurPS, uiAbsPartIdx, uiPUIdx, uiPartIdxLB ); 3653 3630 3654 #if H HI_INTER_VIEW_MOTION_PRED3631 #if H3D_IVMP 3655 3632 Bool bNoPdmMerge = ( m_pcSlice->getSPS()->getViewId() == 0 || ( m_pcSlice->getSPS()->getMultiviewMvPredMode() & PDM_USE_FOR_MERGE ) != PDM_USE_FOR_MERGE ); 3656 3633 3657 3634 //===== add merge with predicted depth maps ===== 3658 #if QC_MRG_CANS_B00483659 3635 TComMv acPdmMv [4]; 3660 3636 Int aiPdmRefIdx [4] = {-1, -1, -1, -1}; 3661 3637 Bool bLeftAvai = false; 3662 #if OL_DISMV_POS_B00693663 3638 Int iPosLeftAbove[2] = {-1, -1}; 3664 #endif 3665 #else 3666 TComMv acPdmMv [2]; 3667 Int aiPdmRefIdx [2] = {-1, -1}; 3668 #endif 3669 3670 #if LGE_DVMCP_A0126 3671 #if QC_MRG_CANS_B0048 3639 3640 #if H3D_NBDV 3672 3641 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 3673 #else 3674 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 3675 #endif 3676 #endif 3677 3678 #if QC_MULTI_DIS_CAN_A0097 3642 #endif //H3D_NBDV 3643 3644 #if MTK_MDIVRP_C0138 3645 Bool bDVAvail = true; 3646 #endif 3647 3648 #if H3D_NBDV 3679 3649 DisInfo cDisInfo; 3680 3650 cDisInfo.iN = 0; 3681 3651 if(!bNoPdmMerge) 3682 3652 { 3683 #if LGE_DVMCP_A0126 3684 #if LGE_IVMP_PARALLEL_MERGE_B0136 && !QC_SIMPLE_NBDV_B0047 3685 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true, REF_PIC_LIST_X, -1, true ); 3686 #else 3687 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo 3688 #if LGE_IVMP_PARALLEL_MERGE_B0136==QC_SIMPLE_NBDV_B0047 3689 , 3690 true 3653 getDisMvpCandNBDV(uiPUIdx, uiAbsPartIdx, &cDisInfo , true 3654 #if MERL_VSP_C0152 3655 , true 3691 3656 #endif 3692 3657 ); 3693 #endif3694 #else3695 getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo );3696 #endif3697 3658 } 3698 3659 if(cDisInfo.iN==0) … … 3702 3663 cDisInfo.m_acMvCand[0].setVer(0); 3703 3664 cDisInfo.m_aVIdxCan[0] = 0; 3704 } 3705 #if QC_MRG_CANS_B0048 3665 #if MTK_MDIVRP_C0138 3666 bDVAvail = false; 3667 #endif 3668 } 3669 3670 #if MTK_DEPTH_MERGE_TEXTURE_CANDIDATE_C0137 3671 if( m_pcSlice->getIsDepth()) 3672 { 3673 UInt uiPartIdxCenter; 3674 xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter ); 3675 TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() ); 3676 if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) ) 3677 { 3678 abCandIsInter[iCount] = true; 3679 puhInterDirNeighbours[iCount] = pcTextureCU->getInterDir( uiPartIdxCenter ); 3680 if( ( puhInterDirNeighbours[iCount] & 1 ) == 1 ) 3681 { 3682 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3683 TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv(); 3684 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 3685 cMvPred+=cAdd; 3686 cMvPred>>=2; 3687 clipMv(cMvPred); 3688 pcMvFieldNeighbours[iCount<<1].setMvField(cMvPred,pcMvFieldNeighbours[iCount<<1].getRefIdx()); 3689 } 3690 if ( getSlice()->isInterB() ) 3691 { 3692 if( ( puhInterDirNeighbours[iCount] & 2 ) == 2 ) 3693 { 3694 pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3695 TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv(); 3696 const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) ); 3697 cMvPred+=cAdd; 3698 cMvPred>>=2; 3699 clipMv(cMvPred); 3700 pcMvFieldNeighbours[(iCount<<1)+1].setMvField(cMvPred,pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()); 3701 } 3702 } 3703 #if MERL_VSP_C0152 3704 xInheritVspMode( pcTextureCU, uiPartIdxCenter, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 3705 #endif 3706 if ( mrgCandIdx == iCount ) 3707 { 3708 return; 3709 } 3710 iCount ++; 3711 } 3712 } 3713 #endif 3714 3706 3715 Int iPdmDir[2] = {0, 0}; 3707 #endif 3708 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo 3709 #if QC_MRG_CANS_B0048 3710 , iPdmDir 3711 #endif 3712 ); 3716 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051 3717 getUnifiedMvPredCan(uiPUIdx, REF_PIC_LIST_0, 0, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir, true); 3718 Int iPdmInterDir; 3713 3719 #else 3720 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo, iPdmDir ); 3721 #endif 3722 #else // H3D_NBDV 3723 Int iPdmDir[2] = {0, 0}; 3714 3724 Int iPdmInterDir = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv ); 3715 #endif 3716 #if QC_MRG_CANS_B0048 3725 iPdmDir[0] = iPdmInterDir; 3726 iPdmDir[1] = iPdmInterDir; 3727 #endif // H3D_NBDV 3728 #if MTK_MDIVRP_C0138 3729 if (m_pcSlice->getSPS()->getMultiviewResPredMode()==1 && iPdmDir[0] && !bNoPdmMerge && cCurPS == SIZE_2Nx2N && bDVAvail) 3730 { 3731 setResPredAvailSubParts(true, 0, 0, uiDepth); 3732 } 3733 #endif 3734 3717 3735 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 ) 3718 #else3719 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 )3720 #endif3721 3736 { 3722 3737 abCandIsInter [ iCount ] = true; 3723 #if QC_MRG_CANS_B00483724 3738 puhInterDirNeighbours[ iCount ] = iPdmDir[0]; 3725 3739 iPdmInterDir = iPdmDir[0]; 3726 #else 3727 puhInterDirNeighbours[ iCount ] = iPdmInterDir; 3728 #endif 3740 3729 3741 if( ( iPdmInterDir & 1 ) == 1 ) 3730 3742 { … … 3747 3759 } 3748 3760 #endif 3749 #if SIMP_MRG_PRUN3750 3761 if ( mrgCandIdx == iCount ) 3751 3762 { 3752 3763 return; 3753 3764 } 3754 #endif3755 3765 iCount ++; 3756 3766 } 3757 #endif 3758 3759 #if QC_MRG_CANS_B0048 3767 3760 3768 if(extraMergeCand) 3761 3769 { … … 3773 3781 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] ); 3774 3782 } 3775 #if LGE_DVMCP_A01263783 #if H3D_NBDV 3776 3784 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3777 3785 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3778 3786 #endif 3779 #if SIMP_MRG_PRUN3780 3787 if ( mrgCandIdx == iCount ) 3781 3788 return; 3782 #endif3783 3789 iCount ++; 3784 3790 } 3785 3791 } 3786 #endif 3792 #endif // H3D_IVMP 3793 3794 #if MERL_VSP_COMPENSATION_C0152 3795 //===== vsp 0 ===== 3796 if( iCount < 4 + extraMergeCand ) 3797 if ( !xAddVspMergeCand(0, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 3798 return; 3799 #endif 3800 3787 3801 //left 3788 3802 UInt uiLeftPartIdx = 0; 3789 3803 TComDataCU* pcCULeft = 0; 3790 #if MVP_AT_ENTROPYSLICE_BOUNDARY3791 3804 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB, true, false ); 3792 #else3793 pcCULeft = getPULeft( uiLeftPartIdx, uiPartIdxLB );3794 #endif3795 #if PARALLEL_MERGE3796 3805 if (pcCULeft) 3797 3806 { … … 3801 3810 } 3802 3811 } 3803 #endif3804 3812 PartSize partSize = getPartitionSize( uiAbsPartIdx ); 3805 3813 if (!(uiPUIdx == 1 && (partSize == SIZE_Nx2N || partSize == SIZE_nLx2N || partSize == SIZE_nRx2N))) 3806 3814 { 3807 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) ) 3815 if ( pcCULeft && !pcCULeft->isIntra( uiLeftPartIdx ) 3816 #if MERL_VSP_C0152 3817 CHECK_ADD_YET(pcCULeft, uiLeftPartIdx, 1) 3818 #endif 3819 ) 3820 { 3821 abCandIsInter[iCount] = true; 3822 // get Inter Dir 3823 puhInterDirNeighbours[iCount] = pcCULeft->getInterDir( uiLeftPartIdx ); 3824 // get Mv from Left 3825 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3826 if ( getSlice()->isInterB() ) 3827 { 3828 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3829 } 3830 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3831 else 3832 { 3833 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3834 } 3835 #endif 3836 3837 #if H3D_IVMP 3838 Bool bRemoveSpa = false; //pruning to inter-view candidates 3839 Int iCnloop = iCount - 1; 3840 for(; iCnloop >= 0; iCnloop --) 3841 { 3842 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3843 { 3844 bRemoveSpa = true; 3845 abCandIsInter [ iCount ] = false; 3846 3847 //reset to the default value for IC, MC 3848 puhInterDirNeighbours[iCount] = 0; 3849 TComMv cZeroMv; 3850 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 3851 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 3852 break; 3853 } 3854 } 3855 if(!bRemoveSpa) 3856 { 3857 bLeftAvai = true; 3858 iPosLeftAbove[0] = iCount; 3859 #endif // H3D_IVMP 3860 #if H3D_NBDV 3861 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3862 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3863 #endif 3864 #if MERL_VSP_C0152 3865 xInheritVspMode( pcCULeft, uiLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 3866 #endif 3867 if ( mrgCandIdx == iCount ) 3868 { 3869 return; 3870 } 3871 iCount ++; 3872 #if H3D_IVMP 3873 } 3874 #endif 3875 } 3876 } 3877 3878 #if H3D_IVMP 3879 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3880 { 3881 abCandIsInter [ iCount ] = true; 3882 puhInterDirNeighbours[ iCount ] = iPdmInterDir; 3883 if( ( iPdmInterDir & 1 ) == 1 ) 3884 { 3885 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3886 } 3887 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3888 else 3889 { 3890 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 3891 } 3892 #endif 3893 if( ( iPdmInterDir & 2 ) == 2 ) 3894 { 3895 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3896 } 3897 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3898 else 3899 { 3900 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3901 } 3902 #endif 3903 if ( mrgCandIdx == iCount ) 3904 { 3905 return; 3906 } 3907 iCount ++; 3908 } 3909 #endif // H3D_IVMP 3910 3911 #if MERL_VSP_COMPENSATION_C0152 3912 //===== vsp 1 ===== 3913 if( iCount < 4 + extraMergeCand ) 3914 if ( !xAddVspMergeCand(1, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 3915 return; 3916 #endif 3917 3918 // above 3919 UInt uiAbovePartIdx = 0; 3920 TComDataCU* pcCUAbove = 0; 3921 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, false, true ); 3922 if (pcCUAbove) 3923 { 3924 if (!pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 3925 { 3926 pcCUAbove = NULL; 3927 } 3928 } 3929 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 3930 #if MERL_VSP_C0152 3931 CHECK_ADD_YET(pcCUAbove, uiAbovePartIdx, 1) 3932 #endif 3933 && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD)) 3934 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 3808 3935 { 3809 3936 abCandIsInter[iCount] = true; 3810 3937 // get Inter Dir 3811 puhInterDirNeighbours[iCount] = pcCU Left->getInterDir( uiLeftPartIdx );3938 puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx ); 3812 3939 // get Mv from Left 3813 pcCU Left->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );3940 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3814 3941 if ( getSlice()->isInterB() ) 3815 3942 { 3816 pcCU Left->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );3943 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3817 3944 } 3818 3945 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 … … 3822 3949 } 3823 3950 #endif 3824 #if QC_MRG_CANS_B00483825 Bool bRemoveSpa = false; //pruni gnto inter-view candidates3826 Int iCnloop = iCount - 1;3951 #if H3D_IVMP 3952 Bool bRemoveSpa = false; //pruning to inter-view candidates 3953 Int iCnloop = bLeftAvai? (iCount-2): (iCount-1); 3827 3954 for(; iCnloop >= 0; iCnloop --) 3828 3955 { … … 3831 3958 bRemoveSpa = true; 3832 3959 abCandIsInter [ iCount ] = false; 3833 #if FIX_MISUSE_REFINDEX 3960 3834 3961 //reset to the default value for IC, MC 3835 3962 puhInterDirNeighbours[iCount] = 0; … … 3838 3965 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 3839 3966 break; 3840 #endif3841 3967 } 3842 3968 } 3843 3969 if(!bRemoveSpa) 3844 3970 { 3845 bLeftAvai = true; 3846 #if OL_DISMV_POS_B0069 3847 iPosLeftAbove[0] = iCount; 3848 #endif 3849 #endif 3850 #if LGE_DVMCP_A0126 3971 iPosLeftAbove[1] = iCount; 3972 #endif // H3D_IVMP 3973 #if H3D_NBDV 3851 3974 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3852 3975 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3853 3976 #endif 3854 #if SIMP_MRG_PRUN 3977 #if MERL_VSP_C0152 3978 xInheritVspMode( pcCUAbove, uiAbovePartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 3979 #endif 3855 3980 if ( mrgCandIdx == iCount ) 3856 3981 { 3857 3982 return; 3858 3983 } 3859 #endif3860 3984 iCount ++; 3861 #if QC_MRG_CANS_B0048 3862 } 3863 #endif 3864 } 3865 } 3866 3867 #if HHI_INTER_VIEW_MOTION_PRED 3868 #if QC_MRG_CANS_B0048 3869 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3870 #else 3871 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3872 #endif 3985 #if H3D_IVMP 3986 } 3987 #endif 3988 } 3989 3990 #if H3D_IVMP 3991 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 2 ) 3873 3992 { 3874 3993 abCandIsInter [ iCount ] = true; … … 3894 4013 } 3895 4014 #endif 3896 #if SIMP_MRG_PRUN3897 4015 if ( mrgCandIdx == iCount ) 3898 4016 { 3899 4017 return; 3900 4018 } 3901 #endif3902 4019 iCount ++; 3903 4020 } 3904 #endif 3905 3906 // above 3907 #if !SIMP_MRG_PRUN 3908 partSize = getPartitionSize( uiAbsPartIdx ); 3909 if (!(uiPUIdx == 1 && (partSize == SIZE_2NxN || partSize == SIZE_2NxnU || partSize == SIZE_2NxnD))) 3910 { 3911 #endif 3912 UInt uiAbovePartIdx = 0; 3913 TComDataCU* pcCUAbove = 0; 3914 #if MVP_AT_ENTROPYSLICE_BOUNDARY 3915 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, false, true ); 3916 #else 3917 pcCUAbove = getPUAbove( uiAbovePartIdx, uiPartIdxRT, true, true, true ); 3918 #endif 3919 #if PARALLEL_MERGE 3920 if (pcCUAbove) 3921 { 3922 if (!pcCUAbove->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 3923 { 3924 pcCUAbove = NULL; 3925 } 3926 } 3927 #endif 3928 #if SIMP_MRG_PRUN 3929 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) 3930 && !(uiPUIdx == 1 && (cCurPS == SIZE_2NxN || cCurPS == SIZE_2NxnU || cCurPS == SIZE_2NxnD)) 3931 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAbove, uiAbovePartIdx ) ) ) 3932 #else 3933 if ( pcCUAbove && !pcCUAbove->isIntra( uiAbovePartIdx ) ) 3934 #endif 3935 { 3936 abCandIsInter[iCount] = true; 3937 // get Inter Dir 3938 puhInterDirNeighbours[iCount] = pcCUAbove->getInterDir( uiAbovePartIdx ); 3939 // get Mv from Left 3940 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] ); 3941 if ( getSlice()->isInterB() ) 3942 { 3943 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3944 } 3945 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3946 else 3947 { 3948 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3949 } 3950 #endif 3951 #if QC_MRG_CANS_B0048 3952 Bool bRemoveSpa = false; //prunign to inter-view candidates 3953 Int iCnloop = bLeftAvai? (iCount-2): (iCount-1); 3954 for(; iCnloop >= 0; iCnloop --) 3955 { 3956 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3957 { 3958 bRemoveSpa = true; 3959 abCandIsInter [ iCount ] = false; 3960 #if FIX_MISUSE_REFINDEX 3961 //reset to the default value for IC, MC 3962 puhInterDirNeighbours[iCount] = 0; 3963 TComMv cZeroMv; 3964 pcMvFieldNeighbours[iCount<<1].setMvField( cZeroMv, NOT_VALID ); 3965 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 3966 break; 3967 #endif 3968 } 3969 } 3970 if(!bRemoveSpa) 3971 { 3972 #if OL_DISMV_POS_B0069 3973 iPosLeftAbove[1] = iCount; 3974 #endif 3975 #endif 3976 #if LGE_DVMCP_A0126 3977 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3978 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3979 #endif 3980 #if SIMP_MRG_PRUN 3981 if ( mrgCandIdx == iCount ) 3982 { 4021 #endif // H3D_IVMP 4022 4023 #if MERL_VSP_COMPENSATION_C0152 4024 //===== vsp 2 ===== 4025 if( iCount < 4 + extraMergeCand ) 4026 if ( !xAddVspMergeCand(2, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 3983 4027 return; 3984 }3985 #endif3986 iCount ++;3987 #if QC_MRG_CANS_B00483988 }3989 #endif3990 }3991 #if !SIMP_MRG_PRUN3992 }3993 #endif3994 3995 #if HHI_INTER_VIEW_MOTION_PRED3996 #if QC_MRG_CANS_B00483997 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 2 )3998 #else3999 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 2 )4000 #endif4001 {4002 abCandIsInter [ iCount ] = true;4003 puhInterDirNeighbours[ iCount ] = iPdmInterDir;4004 if( ( iPdmInterDir & 1 ) == 1 )4005 {4006 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] );4007 }4008 #if FIX_CU_BASED_MRG_CAND_LIST_B01364009 else4010 {4011 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID );4012 }4013 #endif4014 if( ( iPdmInterDir & 2 ) == 2 )4015 {4016 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] );4017 }4018 #if FIX_CU_BASED_MRG_CAND_LIST_B01364019 else4020 {4021 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID );4022 }4023 #endif4024 #if SIMP_MRG_PRUN4025 if ( mrgCandIdx == iCount )4026 {4027 return;4028 }4029 #endif4030 iCount ++;4031 }4032 4028 #endif 4033 4029 … … 4035 4031 UInt uiAboveRightPartIdx = 0; 4036 4032 TComDataCU* pcCUAboveRight = 0; 4037 #if MVP_AT_ENTROPYSLICE_BOUNDARY4038 4033 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT, true, false, true ); 4039 #else4040 pcCUAboveRight = getPUAboveRight( uiAboveRightPartIdx, uiPartIdxRT, true, true, true);4041 #endif4042 #if PARALLEL_MERGE4043 4034 if (pcCUAboveRight) 4044 4035 { … … 4048 4039 } 4049 4040 } 4050 #endif 4051 #if SIMP_MRG_PRUN 4052 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4053 #else 4054 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) ) 4055 #endif 4041 if ( pcCUAboveRight && !pcCUAboveRight->isIntra( uiAboveRightPartIdx ) 4042 #if MERL_VSP_C0152 4043 CHECK_ADD_YET(pcCUAboveRight, uiAboveRightPartIdx, 1) 4044 #endif 4045 && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveRight, uiAboveRightPartIdx ) ) ) 4056 4046 { 4057 4047 abCandIsInter[iCount] = true; … … 4070 4060 } 4071 4061 #endif 4072 #if LGE_DVMCP_A01264062 #if H3D_NBDV 4073 4063 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4074 4064 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4075 4065 #endif 4076 #if SIMP_MRG_PRUN 4066 #if MERL_VSP_C0152 4067 xInheritVspMode( pcCUAboveRight, uiAboveRightPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4068 #endif 4077 4069 if ( mrgCandIdx == iCount ) 4078 4070 { 4079 4071 return; 4080 4072 } 4081 #endif4082 4073 iCount ++; 4083 4074 } 4084 4075 4085 #if HHI_INTER_VIEW_MOTION_PRED 4086 #if QC_MRG_CANS_B0048 4076 #if H3D_IVMP 4087 4077 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 3 ) 4088 #else4089 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 3 )4090 #endif4091 4078 { 4092 4079 abCandIsInter [ iCount ] = true; … … 4112 4099 } 4113 4100 #endif 4114 #if SIMP_MRG_PRUN4115 4101 if ( mrgCandIdx == iCount ) 4116 4102 { 4117 4103 return; 4118 4104 } 4119 #endif4120 4105 iCount ++; 4121 4106 } 4122 #endif 4123 4124 #if OL_DISMV_POS_B0069 4107 4125 4108 if(extraMergeCand) 4126 4109 { … … 4128 4111 { 4129 4112 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 4130 Bool bRemoveSpa = false; //pruni gnto A1, B14113 Bool bRemoveSpa = false; //pruning to A1, B1 4131 4114 abCandIsInter [ iCount ] = true; 4132 4115 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; … … 4148 4131 bRemoveSpa = true; 4149 4132 abCandIsInter [ iCount ] = false; 4150 #if FIX_MISUSE_REFINDEX4151 4133 //reset to the default value for IC, MC 4152 4134 puhInterDirNeighbours[iCount] = 0; … … 4155 4137 pcMvFieldNeighbours[(iCount<<1)+1].setMvField( cZeroMv, NOT_VALID ); 4156 4138 break; 4157 #endif4158 4139 } 4159 4140 } 4160 4141 if(!bRemoveSpa) 4161 4142 { 4162 #if LGE_DVMCP_A01264143 #if H3D_NBDV 4163 4144 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4164 4145 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4165 4146 #endif 4166 #if SIMP_MRG_PRUN4167 4147 if ( mrgCandIdx == iCount ) 4168 4148 return; 4169 #endif4170 4149 iCount ++; 4171 4150 } 4172 4151 } 4173 4152 } 4174 #endif 4153 #endif // H3D_IVMP 4154 4155 #if MERL_VSP_COMPENSATION_C0152 4156 //===== vsp 3 ===== 4157 if( iCount < 4 + extraMergeCand ) 4158 if ( !xAddVspMergeCand(3, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4159 return; 4160 #endif 4161 4162 #if MERL_VSP_C0152 4163 #if VSP_MERGE_POS < 4 4164 #if H3D_IVMP 4165 if( iCount < 4 + extraMergeCand ) 4166 #else 4167 if( iCount < 4 ) 4168 #endif 4169 { 4170 #endif 4171 #endif 4172 4175 4173 //left bottom 4176 4174 UInt uiLeftBottomPartIdx = 0; 4177 4175 TComDataCU* pcCULeftBottom = 0; 4178 #if MVP_AT_ENTROPYSLICE_BOUNDARY4179 4176 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB, true, false ); 4180 #else4181 pcCULeftBottom = this->getPUBelowLeft( uiLeftBottomPartIdx, uiPartIdxLB );4182 #endif4183 #if PARALLEL_MERGE4184 4177 if (pcCULeftBottom) 4185 4178 { … … 4189 4182 } 4190 4183 } 4191 #endif 4192 #if SIMP_MRG_PRUN 4193 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4194 #else 4195 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) ) 4196 #endif 4184 if ( pcCULeftBottom && !pcCULeftBottom->isIntra( uiLeftBottomPartIdx ) 4185 #if MERL_VSP_C0152 4186 CHECK_ADD_YET(pcCULeftBottom, uiLeftBottomPartIdx, 1) 4187 #endif 4188 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCULeftBottom, uiLeftBottomPartIdx ) ) ) 4197 4189 { 4198 4190 abCandIsInter[iCount] = true; … … 4211 4203 } 4212 4204 #endif 4213 #if LGE_DVMCP_A01264205 #if H3D_NBDV 4214 4206 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4215 4207 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4216 4208 #endif 4217 #if SIMP_MRG_PRUN 4209 #if MERL_VSP_C0152 4210 xInheritVspMode( pcCULeftBottom, uiLeftBottomPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4211 #endif 4218 4212 if ( mrgCandIdx == iCount ) 4219 4213 { 4220 4214 return; 4221 4215 } 4222 #endif4223 4216 iCount ++; 4224 4217 } 4225 4226 #if HHI_INTER_VIEW_MOTION_PRED 4227 #if QC_MRG_CANS_B0048 4218 #if MERL_VSP_C0152 4219 #if VSP_MERGE_POS < 4 4220 } 4221 #endif 4222 #endif 4223 4224 #if H3D_IVMP 4228 4225 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 4 ) 4229 #else4230 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 4 )4231 #endif4232 4226 { 4233 4227 abCandIsInter [ iCount ] = true; … … 4253 4247 } 4254 4248 #endif 4255 #if SIMP_MRG_PRUN4256 4249 if ( mrgCandIdx == iCount ) 4257 4250 { 4258 4251 return; 4259 4252 } 4260 #endif4261 4253 iCount ++; 4262 4254 } 4263 #endif 4264 4265 // above left 4266 #if HHI_INTER_VIEW_MOTION_PRED 4255 #endif // H3D_IVMP 4256 4257 #if MERL_VSP_COMPENSATION_C0152 4258 //===== vsp 4 ===== 4259 if( iCount < 4 + extraMergeCand ) 4260 if ( !xAddVspMergeCand(4, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4261 return; 4262 #endif 4263 4264 // above left 4265 #if H3D_IVMP 4267 4266 if( iCount < 4 + extraMergeCand ) 4268 4267 #else … … 4272 4271 UInt uiAboveLeftPartIdx = 0; 4273 4272 TComDataCU* pcCUAboveLeft = 0; 4274 #if MVP_AT_ENTROPYSLICE_BOUNDARY4275 4273 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr, true, false, true ); 4276 #else4277 pcCUAboveLeft = getPUAboveLeft( uiAboveLeftPartIdx, uiAbsPartAddr, true, true, true );4278 #endif4279 #if PARALLEL_MERGE4280 4274 if (pcCUAboveLeft) 4281 4275 { … … 4285 4279 } 4286 4280 } 4287 #endif4288 #if SIMP_MRG_PRUN4289 4281 if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) 4282 #if MERL_VSP_C0152 4283 CHECK_ADD_YET(pcCUAboveLeft, uiAboveLeftPartIdx, 1) 4284 #endif 4290 4285 && ( !pcCULeft || pcCULeft->isIntra( uiLeftPartIdx ) || !pcCULeft->hasEqualMotion( uiLeftPartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4291 4286 && ( !pcCUAbove || pcCUAbove->isIntra( uiAbovePartIdx ) || !pcCUAbove->hasEqualMotion( uiAbovePartIdx, pcCUAboveLeft, uiAboveLeftPartIdx ) ) 4292 4287 ) 4293 #else4294 if( pcCUAboveLeft && !pcCUAboveLeft->isIntra( uiAboveLeftPartIdx ) )4295 #endif4296 4288 { 4297 4289 abCandIsInter[iCount] = true; … … 4310 4302 } 4311 4303 #endif 4312 #if LGE_DVMCP_A01264304 #if H3D_NBDV 4313 4305 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4314 4306 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4315 4307 #endif 4316 #if SIMP_MRG_PRUN 4308 #if MERL_VSP_C0152 4309 xInheritVspMode( pcCUAboveLeft, uiAboveLeftPartIdx, bVspMvZeroDone, iCount, iVSPIndexTrue, pcMvFieldNeighbours, &cDisInfo ) ; 4310 #endif 4317 4311 if ( mrgCandIdx == iCount ) 4318 4312 { 4319 4313 return; 4320 4314 } 4321 #endif4322 4315 iCount ++; 4323 4316 } 4324 4317 } 4325 4318 4319 #if MERL_VSP_COMPENSATION_C0152 4320 //===== vsp 5 ===== 4321 if( iCount < 4 + extraMergeCand ) 4322 if ( !xAddVspMergeCand(5, 1, bVspMvZeroDone, uiDepth, abCandIsInter, iCount, puhInterDirNeighbours, pcMvFieldNeighbours, iVSPIndexTrue, mrgCandIdx, &cDisInfo) ) 4323 return; 4324 #endif 4325 4326 4326 if ( getSlice()->getPPS()->getEnableTMVPFlag() 4327 #if QC_MRG_CANS_B00484327 #if H3D_IVMP 4328 4328 && iCount < (MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand) 4329 4329 #endif … … 4336 4336 { 4337 4337 RefPicList eRefPicList = ( i==1 ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 4338 #if SET_MERGE_TMVP_REFIDX4339 4338 Int iRefIdxTmp; 4340 4339 if ( uiPUIdx != 0 ) … … 4346 4345 iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList)->getRefIdx(uiLeftPartIdx) : -1; 4347 4346 } 4348 #else4349 Int iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList)->getRefIdx(uiLeftPartIdx) : -1;4350 #endif4351 4347 iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0; 4352 4348 } … … 4356 4352 Int uiLCUIdx = getAddr(); 4357 4353 PartSize eCUMode = getPartitionSize( 0 ); 4354 4355 #if MERL_VSP_C0152 // Potential bug, not related to BW_VSP 4356 if (eCUMode==SIZE_NxN) 4357 { 4358 printf("Size NxN ???"); 4359 assert(0); 4360 } 4361 #endif 4358 4362 4359 4363 deriveRightBottomIdx( eCUMode, uiPUIdx, uiPartIdxRB ); … … 4409 4413 UInt uiCurLCUIdx = getAddr(); 4410 4414 xDeriveCenterIdx( eCUMode, uiPUIdx, uiPartIdxCenter ); 4411 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx ); 4415 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_0, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx 4416 #if QC_TMVP_MRG_REFIDX_C0047 4417 , 1 4418 #endif 4419 ); 4412 4420 if( bExistMV == false ) 4413 4421 { 4414 bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx ); 4422 bExistMV = xGetColMVP( REF_PIC_LIST_0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx 4423 #if QC_TMVP_MRG_REFIDX_C0047 4424 , 1 4425 #endif 4426 ); 4415 4427 } 4416 4428 if( bExistMV ) … … 4427 4439 iRefIdx = 0; 4428 4440 #endif 4429 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx); 4441 bExistMV = uiLCUIdx >= 0 && xGetColMVP( REF_PIC_LIST_1, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx 4442 #if QC_TMVP_MRG_REFIDX_C0047 4443 , 1 4444 #endif 4445 ); 4430 4446 if( bExistMV == false ) 4431 4447 { 4432 bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx ); 4448 bExistMV = xGetColMVP( REF_PIC_LIST_1, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx 4449 #if QC_TMVP_MRG_REFIDX_C0047 4450 , 1 4451 #endif 4452 ); 4433 4453 } 4434 4454 if( bExistMV ) … … 4452 4472 #endif 4453 4473 } 4454 #if LGE_DVMCP_A01264474 #if H3D_NBDV 4455 4475 pcMvFieldNeighbours[uiArrayAddr<<1 ].getMv().m_bDvMcp = false; 4456 4476 pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false; 4457 4477 #endif 4458 #if SIMP_MRG_PRUN4459 4478 if ( mrgCandIdx == iCount ) 4460 4479 { … … 4462 4481 } 4463 4482 iCount++; 4464 #endif4465 4483 } 4466 4484 uiIdx++; … … 4468 4486 } 4469 4487 4470 #if SIMP_MRG_PRUN4471 4488 UInt uiArrayAddr = iCount; 4472 #else4473 #if HHI_INTER_VIEW_MOTION_PRED4474 for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS_MEM; uiOuter++ )4475 #else4476 for( UInt uiOuter = 0; uiOuter < MRG_MAX_NUM_CANDS; uiOuter++ )4477 #endif4478 {4479 if( abCandIsInter[ uiOuter ] )4480 {4481 #if HHI_INTER_VIEW_MOTION_PRED4482 for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS_MEM; uiIter++ )4483 #else4484 for( UInt uiIter = uiOuter + 1; uiIter < MRG_MAX_NUM_CANDS; uiIter++ )4485 #endif4486 {4487 UInt uiMvFieldNeighIdxCurr = uiOuter << 1;4488 UInt uiMvFieldNeighIdxComp = uiIter << 1;4489 if( getSlice()->isInterB() )4490 {4491 if( puhInterDirNeighbours[ uiOuter ] == 3 )4492 {4493 if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getRefIdx() && pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getRefIdx() &&4494 pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getMv() && pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getMv() &&4495 puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] )4496 {4497 abCandIsInter[ uiIter ] = false;4498 }4499 }4500 else if( puhInterDirNeighbours[ uiOuter ] == 2 )4501 {4502 if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getRefIdx() &&4503 pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr + 1 ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp + 1 ].getMv() &&4504 puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] )4505 {4506 abCandIsInter[ uiIter ] = false;4507 }4508 }4509 else4510 {4511 if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getRefIdx() &&4512 pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getMv() &&4513 puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] )4514 {4515 abCandIsInter[ uiIter ] = false;4516 }4517 }4518 }4519 else4520 {4521 if( pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getRefIdx() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getRefIdx() &&4522 pcMvFieldNeighbours[ uiMvFieldNeighIdxCurr ].getMv() == pcMvFieldNeighbours[ uiMvFieldNeighIdxComp ].getMv() )4523 {4524 assert( puhInterDirNeighbours[ uiOuter ] == puhInterDirNeighbours[ uiIter ] );4525 abCandIsInter[ uiIter ] = false;4526 }4527 }4528 }4529 }4530 }4531 4532 #if HHI_INTER_VIEW_MOTION_PRED4533 bool abCandIsInterFlag[MRG_MAX_NUM_CANDS_MEM];4534 for (int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)4535 #else4536 bool abCandIsInterFlag[MRG_MAX_NUM_CANDS];4537 for (int i=0; i<MRG_MAX_NUM_CANDS; i++)4538 #endif4539 {4540 abCandIsInterFlag[i] = abCandIsInter[ i ];4541 abCandIsInter[ i ] = false;4542 }4543 4544 UInt uiArrayAddr = 0;4545 4546 #if HHI_INTER_VIEW_MOTION_PRED4547 for (int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)4548 #else4549 for (int i=0; i<MRG_MAX_NUM_CANDS; i++)4550 #endif4551 {4552 if (abCandIsInterFlag[i])4553 {4554 abCandIsInter[uiArrayAddr] = true;4555 puhInterDirNeighbours[uiArrayAddr] = puhInterDirNeighbours[i];4556 pcMvFieldNeighbours[uiArrayAddr<<1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx());4557 pcMvFieldNeighbours[(uiArrayAddr<<1)+1].setMvField(pcMvFieldNeighbours[(i<<1)+1].getMv(), pcMvFieldNeighbours[(i<<1)+1].getRefIdx());4558 ++uiArrayAddr;4559 }4560 }4561 4562 #if HHI_INTER_VIEW_MOTION_PRED4563 for (int i=uiArrayAddr; i<MRG_MAX_NUM_CANDS_MEM; i++)4564 #else4565 for (int i=uiArrayAddr; i<MRG_MAX_NUM_CANDS; i++)4566 #endif4567 {4568 puhInterDirNeighbours[i] = (getSlice()->isInterB()) ? 3 : 1;4569 abCandIsInter[i] = false;4570 TComMv tmpMv;4571 tmpMv.set(0,0);4572 pcMvFieldNeighbours[i<<1].setMvField(tmpMv, 0);4573 if ( getSlice()->isInterB() )4574 {4575 pcMvFieldNeighbours[(i<<1)+1].setMvField(tmpMv, 0);4576 }4577 }4578 #endif4579 4489 UInt uiCutoff = uiArrayAddr; 4580 4490 4581 4491 if ( getSlice()->isInterB() ) 4582 4492 { 4583 #if H HI_INTER_VIEW_MOTION_PRED4493 #if H3D_IVMP 4584 4494 Int iCombinedCount = 0; 4585 4495 Int iMaxCombCount = ( extraMergeCand ? 6 : 5 ); … … 4598 4508 { 4599 4509 Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx]; 4600 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2)) 4510 #if MERL_VSP_C0152 4511 Bool bValid = true; 4512 if (pcMvFieldNeighbours[i<<1].getRefIdx() < 0 || pcMvFieldNeighbours[(j<<1)+1].getRefIdx() < 0) // NOT_VALID 4513 bValid = false; 4514 #endif 4515 if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2) 4516 #if MERL_VSP_C0152 4517 && bValid 4518 #endif 4519 ) 4601 4520 { 4602 4521 abCandIsInter[uiArrayAddr] = true; … … 4622 4541 } 4623 4542 } 4624 #if !REMOVE_NON_SCALED4625 Int iScaledCount = 0;4626 #if HHI_INTER_VIEW_MOTION_PRED4627 for (int i=0; i<uiCutoff && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM && iScaledCount<1; i++)4628 #else4629 for (int i=0; i<uiCutoff && uiArrayAddr!=MRG_MAX_NUM_CANDS && iScaledCount<1; i++)4630 #endif4631 {4632 #if HHI_INTER_VIEW_MOTION_PRED4633 for (int j=0; j<2 && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM && iScaledCount<1; j++)4634 #else4635 for (int j=0; j<2 && uiArrayAddr!=MRG_MAX_NUM_CANDS && iScaledCount<1; j++)4636 #endif4637 {4638 if (abCandIsInter[i] && pcMvFieldNeighbours[(i<<1)+j].getRefIdx()>=0 && pcMvFieldNeighbours[(i<<1)+j].getRefIdx() < m_pcSlice->getNumRefIdx((j==0)?REF_PIC_LIST_1:REF_PIC_LIST_0))4639 {4640 Int iCurrPOC = m_pcSlice->getPOC();4641 Int iCurrRefPOC1 = m_pcSlice->getRefPOC( (j==0)?REF_PIC_LIST_1:REF_PIC_LIST_0, pcMvFieldNeighbours[(i<<1)+j].getRefIdx() );4642 Int iCurrRefPOC2 = m_pcSlice->getRefPOC( (j==0)?REF_PIC_LIST_0:REF_PIC_LIST_1, pcMvFieldNeighbours[(i<<1)+j].getRefIdx() );4643 4644 if (iCurrRefPOC1 != iCurrRefPOC2 && abs(iCurrPOC-iCurrRefPOC1) == abs(iCurrPOC-iCurrRefPOC2))4645 {4646 abCandIsInter[uiArrayAddr] = true;4647 puhInterDirNeighbours[uiArrayAddr] = 3;4648 4649 TComMv cMvPred = pcMvFieldNeighbours[(i<<1)+j].getMv();4650 TComMv rcMv;4651 4652 rcMv.set(-1*cMvPred.getHor(), -1*cMvPred.getVer());4653 4654 if (j==0)4655 {4656 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[(i<<1)].getMv(), pcMvFieldNeighbours[(i<<1)].getRefIdx());4657 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(rcMv, pcMvFieldNeighbours[(i<<1)].getRefIdx());4658 }4659 else4660 {4661 pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(rcMv, pcMvFieldNeighbours[(i<<1)+1].getRefIdx());4662 pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(i<<1)+1].getMv(), pcMvFieldNeighbours[(i<<1)+1].getRefIdx());4663 }4664 4665 uiArrayAddr++;4666 iScaledCount++;4667 }4668 }4669 }4670 }4671 #endif4672 4543 } 4673 4544 4674 4545 Int iNumRefIdx = (getSlice()->isInterB()) ? min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0); 4675 #if H HI_INTER_VIEW_MOTION_PRED4546 #if H3D_IVMP 4676 4547 for (int r=0; r<iNumRefIdx && uiArrayAddr!=MRG_MAX_NUM_CANDS_MEM; r++) 4677 4548 #else … … 4696 4567 uiArrayAddr++; 4697 4568 } 4698 #if H HI_INTER_VIEW_MOTION_PRED4569 #if H3D_IVMP 4699 4570 if (uiArrayAddr > MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand ) 4700 4571 { … … 4770 4641 if( uiIter == 0 ) 4771 4642 { 4772 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 4643 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 4644 #if MERL_VSP_C0152 4645 && !pcCorner->getVSPIndex( uiCornerPUIdx ) 4646 #endif 4647 ) 4773 4648 { 4774 4649 rbValidCand = true; … … 4805 4680 else 4806 4681 { 4807 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) ) 4682 if( pcCorner && !pcCorner->isIntra( uiCornerPUIdx ) 4683 #if MERL_VSP_C0152 4684 && !pcCorner->getVSPIndex( uiCornerPUIdx ) 4685 #endif 4686 ) 4808 4687 { 4809 4688 rbValidCand = true; … … 4839 4718 } 4840 4719 } 4841 #if PARALLEL_MERGE4842 4720 /** Check whether the current PU and a spatial neighboring PU are in a same ME region. 4843 4721 * \param xN, xN location of the upper-left corner pixel of a neighboring PU … … 4926 4804 } 4927 4805 4928 #endif4929 4806 AMVP_MODE TComDataCU::getAMVPMode(UInt uiIdx) 4930 4807 { 4931 4808 return m_pcSlice->getSPS()->getAMVPMode(m_puhDepth[uiIdx]); 4932 4809 } 4933 #if QC_MULTI_DIS_CAN_A00974810 #if H3D_NBDV 4934 4811 /** construct a list of disparity motion vectors from the neighbouring PUs **/ 4935 4812 Void TComDataCU::getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo ) … … 4948 4825 4949 4826 UInt uiIdx = 0; 4950 #if MVP_AT_ENTROPYSLICE_BOUNDARY4951 4827 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 4952 #else4953 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB);4954 #endif4955 4828 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4829 #if MERL_VSP_C0152 4830 if(! pcTmpCU->getVSPIndex(uiIdx)) 4831 #endif 4956 4832 { 4957 4833 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4973 4849 } 4974 4850 } 4975 #if MVP_AT_ENTROPYSLICE_BOUNDARY4976 4851 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 4977 #else4978 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT);4979 #endif4980 4852 4981 4853 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4854 #if MERL_VSP_C0152 4855 if(! pcTmpCU->getVSPIndex(uiIdx)) 4856 #endif 4982 4857 { 4983 4858 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5000 4875 } 5001 4876 5002 #if MVP_AT_ENTROPYSLICE_BOUNDARY5003 4877 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 5004 #else5005 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true);5006 #endif5007 4878 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4879 #if MERL_VSP_C0152 4880 if(! pcTmpCU->getVSPIndex(uiIdx)) 4881 #endif 5008 4882 { 5009 4883 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5025 4899 } 5026 4900 } 5027 #if MVP_AT_ENTROPYSLICE_BOUNDARY5028 4901 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 5029 #else5030 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB);5031 #endif5032 4902 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4903 #if MERL_VSP_C0152 4904 if(! pcTmpCU->getVSPIndex(uiIdx)) 4905 #endif 5033 4906 { 5034 4907 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5052 4925 5053 4926 // Above predictor search 5054 #if MVP_AT_ENTROPYSLICE_BOUNDARY5055 4927 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 5056 4928 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 5057 #else5058 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true);5059 #endif5060 4929 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4930 #if MERL_VSP_C0152 4931 if(! pcTmpCU->getVSPIndex(uiIdx)) 4932 #endif 5061 4933 { 5062 4934 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5257 5129 } 5258 5130 5259 #if LGE_DVMCP_A0126 5260 #if QC_SIMPLE_NBDV_B0047 5261 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo 5262 #if LGE_IVMP_PARALLEL_MERGE_B0136 5263 , Bool bParMerge 5264 #endif 5131 #if MERL_VSP_C0152 5132 #if LGE_SIMP_DVP_REFINE_C0112 5133 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine) 5265 5134 #else 5266 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 5267 #if LGE_IVMP_PARALLEL_MERGE_B0136 5268 , Bool bParMerge 5269 #endif 5135 Pel TComDataCU::getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec) 5136 #endif 5137 { 5138 Int depStride = pcBaseViewDepthPicYuv->getStride(); 5139 5140 Int width = pcBaseViewDepthPicYuv->getWidth(); 5141 Int height = pcBaseViewDepthPicYuv->getHeight(); 5142 5143 Int depthPosX = Clip3(0, width - iWidth - 1, iBlkX + (mv->getHor()>>2)); 5144 Int depthPosY = Clip3(0, height- iHeight - 1, iBlkY + (mv->getVer()>>2)); 5145 5146 Pel *depth = pcBaseViewDepthPicYuv->getLumaAddr() + depthPosX + depthPosY * depStride; 5147 Pel maxDepth = 0; 5148 #if LGE_SIMP_DVP_REFINE_C0112 5149 if ( bSimpleDvpRefine ) 5150 { 5151 Int depthStartPosX = Clip3(0, width - iWidth - 1, iBlkX + (mv->getHor()>>2)); 5152 Int depthStartPosY = Clip3(0, height- iHeight - 1, iBlkY + (mv->getVer()>>2)); 5153 Int depthEndPosX = Clip3(0, width - iWidth - 1, iBlkX + iWidth + (mv->getHor()>>2)); 5154 Int depthEndPosY = Clip3(0, height- iHeight - 1, iBlkY + iHeight + (mv->getVer()>>2)); 5155 Int iCenterX = (depthStartPosX + depthEndPosX) >> 1; 5156 Int iCenterY = (depthStartPosY + depthEndPosY) >> 1; 5157 5158 Pel *depthTL = pcBaseViewDepthPicYuv->getLumaAddr(); 5159 Int aiDepth[5]; 5160 aiDepth[0] = depthTL[ (depthStartPosY) * depStride + depthStartPosX ]; // Left Top 5161 aiDepth[1] = depthTL[ (depthEndPosY) * depStride + depthStartPosX ]; // Left Bottom 5162 aiDepth[2] = depthTL[ (depthStartPosY) * depStride + depthEndPosX ]; // Right Top 5163 aiDepth[3] = depthTL[ (depthEndPosY) * depStride + depthEndPosX ]; // Right Bottom 5164 aiDepth[4] = depthTL[ (iCenterY) * depStride + iCenterX ]; // Center 5165 for (Int i = 0; i < 5; i++) 5166 { 5167 if (maxDepth < aiDepth[i]) 5168 maxDepth = aiDepth[i]; 5169 } 5170 } 5171 else 5172 { 5173 for (Int j = 0; j < iHeight; j++) 5174 { 5175 for (Int i = 0; i < iWidth; i++) 5176 { 5177 if (maxDepth < depth[i]) 5178 maxDepth = depth[i]; 5179 } 5180 depth += depStride; 5181 } 5182 } 5183 #else 5184 for (Int j = 0; j < iHeight; j++) 5185 { 5186 for (Int i = 0; i < iWidth; i++) 5187 { 5188 if (maxDepth < depth[i]) 5189 maxDepth = depth[i]; 5190 } 5191 depth += depStride; 5192 } 5193 #endif 5194 Int disparity = aiShiftLUT[ maxDepth ] << iShiftPrec; 5195 5196 return disparity; 5197 } 5198 #if LGE_SIMP_DVP_REFINE_C0112 5199 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine) 5200 #else 5201 Void TComDataCU::estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred) 5202 #endif 5203 { 5204 if (picDepth) 5205 { 5206 UInt uiAbsPartAddrCurrCU = m_uiAbsIdxInLCU + uiPartAddr; 5207 Int iWidth, iHeight; 5208 getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight ); // The modified value of uiPartAddr won't be used any more 5209 5210 TComPicYuv* pcBaseViewDepthPicYuv = picDepth->getPicYuvRec(); 5211 Int iBlkX = ( getAddr() % picDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5212 Int iBlkY = ( getAddr() / picDepth->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ uiAbsPartAddrCurrCU ] ]; 5213 Int* aiShiftLUT; 5214 Int iShiftPrec; 5215 getSlice()->getBWVSPLUTParam(aiShiftLUT, iShiftPrec); 5216 #if LGE_SIMP_DVP_REFINE_C0112 5217 Pel x = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec, bSimpleDvpRefine ); 5218 #else 5219 Pel x = getMcpFromDM( pcBaseViewDepthPicYuv, cMvPred, iBlkX, iBlkY, iWidth, iHeight, aiShiftLUT, iShiftPrec); 5220 #endif 5221 cMvPred->setHor(x); 5222 clipMv(*cMvPred); 5223 } 5224 } 5225 #endif 5226 5227 #if H3D_NBDV 5228 Void TComDataCU::getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo , Bool bParMerge 5229 #if MERL_VSP_C0152 5230 , Bool bDepthRefine 5270 5231 #endif 5271 5232 ) … … 5273 5234 PartSize eCUMode = getPartitionSize( uiPartAddr ); 5274 5235 TComDataCU* pcTmpCU = NULL; 5275 #if !QC_SIMPLE_NBDV_B00475276 TComDataCU* pcCULeft = NULL;5277 #endif5278 5236 pDInfo->iN = 0; 5279 5237 … … 5283 5241 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 5284 5242 5285 #if QC_SIMPLE_NBDV_B00475286 5243 const Int iNumofDvMCP = 7; 5244 #if MTK_RELEASE_DV_CONSTRAINT_C0129 5245 Int aiDvMcpDvCandX[2][iNumofDvMCP] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 5246 Int aiDvMcpDvCandY[2][iNumofDvMCP] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 5247 #else 5287 5248 Int aiDvMcpDvCand[2][iNumofDvMCP] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 5249 #endif 5288 5250 Bool abDvMcpFlag [2][iNumofDvMCP] = {{false,},{false,}}; 5289 #else5290 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal5291 Bool abDvMcpFlag [2][7] = {{false,},{false,}};5292 //Int aiRefPOC [2][7] = {{-1,},{-1}}; // debug5293 #endif5294 5251 TComMv cTmpMvPred, cMv; 5295 5252 Bool bTmpIsSkipped = false; 5296 5253 Bool bDvMcpIsFound = false; 5297 #if LGE_DVMCP_MEM_REDUCTION_B0135 5298 Int iLCUAddrDiff = 0; 5299 #endif 5300 5301 #if LGE_IVMP_PARALLEL_MERGE_B0136 5254 Int iLCUAddrDiff = 0; 5255 5302 5256 Int xP, yP, nPSW, nPSH; 5303 5257 if( bParMerge) 5304 5258 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH); 5305 #endif5306 5259 5307 5260 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); 5308 5261 deriveLeftBottomIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLB ); 5309 5262 5310 UInt uiIdx = 0; 5311 #if MVP_AT_ENTROPYSLICE_BOUNDARY 5312 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 5313 #else 5314 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 5315 #endif 5316 #if DV_DERIVATION_PARALLEL_B0096 5317 if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) ) 5318 { 5319 pcTmpCU = NULL; 5320 } 5321 #endif 5322 #if LGE_IVMP_PARALLEL_MERGE_B0136 5323 if (pcTmpCU && bParMerge) 5324 { 5325 if (!pcTmpCU->isDiffMER(xP -1, yP+nPSH-1, xP, yP)) 5326 { 5327 pcTmpCU = NULL; 5328 } 5329 } 5330 #endif 5331 5332 #if !QC_SIMPLE_NBDV_B0047 5333 pcCULeft = pcTmpCU; 5334 UInt uiLeftPartIdx = uiIdx; 5335 #endif 5336 5337 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5338 { 5339 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5340 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5341 { 5342 eRefPicList = RefPicList(iList); 5343 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5344 if( refId >= 0) 5345 { 5346 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5347 if (refViewIdx!= m_pcSlice->getViewId()) // DCP 5348 { 5349 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5350 clipMv(cMvPred); 5351 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5352 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5353 return; 5354 } 5355 else // MCP 5356 { 5357 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5358 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5359 { 5360 aiDvMcpDvCand[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX; 5361 abDvMcpFlag [iList][DVFROM_LEFT] = true; 5362 bDvMcpIsFound = true; 5363 } 5364 } 5365 } 5366 } 5367 } 5368 5369 #if MVP_AT_ENTROPYSLICE_BOUNDARY 5370 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 5371 #else 5372 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 5373 #endif 5374 #if DV_DERIVATION_PARALLEL_B0096 5375 if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) ) 5376 { 5377 pcTmpCU = NULL; 5378 } 5379 #endif 5380 #if LGE_IVMP_PARALLEL_MERGE_B0136 5381 if (pcTmpCU && bParMerge) 5382 { 5383 if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 5384 { 5385 pcTmpCU = NULL; 5386 } 5387 } 5388 #endif 5389 5390 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5391 { 5392 #if LGE_DVMCP_MEM_REDUCTION_B0135 5393 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5394 #endif 5395 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5396 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5397 { 5398 eRefPicList = RefPicList(iList); 5399 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5400 if( refId >= 0) 5401 { 5402 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5403 if (refViewIdx!= m_pcSlice->getViewId()) 5404 { 5405 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5406 clipMv(cMvPred); 5407 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5408 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5409 return; 5410 } 5411 #if LGE_DVMCP_MEM_REDUCTION_B0135 5412 else if(iLCUAddrDiff == 0) //MCP, within same LCU 5413 #else 5414 else // MCP 5415 #endif 5416 { 5417 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5418 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5419 { 5420 aiDvMcpDvCand[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX; 5421 abDvMcpFlag [iList][DVFROM_ABOVE] = true; 5422 bDvMcpIsFound = true; 5423 } 5424 } 5425 } 5426 } 5427 } 5428 5429 #if MVP_AT_ENTROPYSLICE_BOUNDARY 5430 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 5431 #else 5432 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 5433 #endif 5434 #if LGE_IVMP_PARALLEL_MERGE_B0136 5435 if (pcTmpCU && bParMerge) 5436 { 5437 if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP)) 5438 { 5439 pcTmpCU = NULL; 5440 } 5441 } 5442 #endif 5443 5444 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5445 { 5446 #if LGE_DVMCP_MEM_REDUCTION_B0135 5447 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5448 #endif 5449 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5450 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5451 { 5452 eRefPicList = RefPicList(iList); 5453 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5454 if( refId >= 0) 5455 { 5456 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5457 if (refViewIdx!= m_pcSlice->getViewId()) 5458 { 5459 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5460 clipMv(cMvPred); 5461 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5462 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5463 return; 5464 } 5465 #if LGE_DVMCP_MEM_REDUCTION_B0135 5466 else if(iLCUAddrDiff == 0) 5467 #else 5468 else // MCP 5469 #endif 5470 { 5471 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5472 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5473 { 5474 aiDvMcpDvCand[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX; 5475 abDvMcpFlag [iList][DVFROM_ABOVERIGHT] = true; 5476 bDvMcpIsFound = true; 5477 } 5478 } 5479 } 5480 } 5481 } 5482 5483 #if MVP_AT_ENTROPYSLICE_BOUNDARY 5484 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 5485 #else 5486 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 5487 #endif 5488 #if LGE_IVMP_PARALLEL_MERGE_B0136 5489 if (pcTmpCU && bParMerge) 5490 { 5491 if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP)) 5492 { 5493 pcTmpCU = NULL; 5494 } 5495 } 5496 #endif 5497 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5498 { 5499 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5500 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5501 { 5502 eRefPicList = RefPicList(iList); 5503 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5504 if( refId >= 0) 5505 { 5506 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5507 if (refViewIdx!= m_pcSlice->getViewId()) 5508 { 5509 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5510 clipMv(cMvPred); 5511 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5512 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5513 return; 5514 } 5515 else // MCP 5516 { 5517 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5518 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5519 { 5520 aiDvMcpDvCand[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX; 5521 abDvMcpFlag [iList][DVFROM_LEFTBELOW] = true; 5522 bDvMcpIsFound = true; 5523 } 5524 } 5525 } 5526 } 5527 } 5528 5529 // Above predictor search 5530 #if MVP_AT_ENTROPYSLICE_BOUNDARY 5531 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 5532 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 5533 #else 5534 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 5535 #endif 5536 #if LGE_IVMP_PARALLEL_MERGE_B0136 5537 if (pcTmpCU && bParMerge) 5538 { 5539 if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP)) 5540 { 5541 pcTmpCU = NULL; 5542 } 5543 } 5544 #endif 5545 5546 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5547 { 5548 #if LGE_DVMCP_MEM_REDUCTION_B0135 5549 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5550 #endif 5551 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5552 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5553 { 5554 eRefPicList = RefPicList(iList); 5555 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5556 if( refId >= 0) 5557 { 5558 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5559 if (refViewIdx!= m_pcSlice->getViewId()) 5560 { 5561 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5562 clipMv(cMvPred); 5563 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5564 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5565 return; 5566 } 5567 #if LGE_DVMCP_MEM_REDUCTION_B0135 5568 else if(iLCUAddrDiff <= 1) 5569 #else 5570 else // MCP 5571 #endif 5572 { 5573 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5574 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5575 { 5576 aiDvMcpDvCand[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX; 5577 abDvMcpFlag [iList][DVFROM_ABOVELEFT] = true; 5578 bDvMcpIsFound = true; 5579 } 5580 } 5581 } 5582 } 5583 } 5584 5263 #if MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097 5585 5264 // copied from getInterMergeCand() 5586 5265 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 5587 5266 { 5588 #if !QC_SIMPLE_NBDV_B00475589 UInt uiPUIdx = uiPartIdx;5590 UInt uiAbsPartAddr = uiPartAddr;5591 5592 // col [2]5593 Int iRefIdxSkip[2] = {-1, -1};5594 if( !bMerge )5595 {5596 iRefIdxSkip[ eRefPicList0 ] = iRefIdx0;5597 }5598 else5599 {5600 for (Int i=0; i<2; i++)5601 {5602 RefPicList eRefPicList1 = ( i==1 ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );5603 #if SET_MERGE_TMVP_REFIDX5604 Int iRefIdxTmp;5605 if ( uiPUIdx != 0 )5606 {5607 iRefIdxTmp = 0;5608 }5609 else5610 {5611 iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList1)->getRefIdx(uiLeftPartIdx) : -1;5612 }5613 #else5614 Int iRefIdxTmp = (pcCULeft != NULL) ? pcCULeft->getCUMvField(eRefPicList1)->getRefIdx(uiLeftPartIdx) : -1;5615 #endif5616 iRefIdxSkip[i] = (iRefIdxTmp != -1) ? iRefIdxTmp : 0;5617 }5618 }5619 5620 //>> MTK colocated-RightBottom5621 UInt uiPartIdxRB;5622 Int uiLCUIdx = getAddr();5623 eCUMode = getPartitionSize( 0 );5624 5625 deriveRightBottomIdx( eCUMode, uiPUIdx, uiPartIdxRB );5626 5627 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB];5628 //UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth();5629 5630 TComMv cColMv;5631 Int iRefIdx;5632 5633 if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) >= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) // image boundary check5634 {5635 uiLCUIdx = -1;5636 }5637 else if ( ( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) >= m_pcSlice->getSPS()->getPicHeightInLumaSamples() )5638 {5639 uiLCUIdx = -1;5640 }5641 else5642 {5643 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU5644 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU5645 {5646 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ];5647 uiLCUIdx = getAddr();5648 }5649 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU5650 {5651 uiAbsPartAddr = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ];5652 uiLCUIdx = -1 ;5653 }5654 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU5655 {5656 uiAbsPartAddr = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ];5657 uiLCUIdx = getAddr() + 1;5658 }5659 else //is the right bottom corner of LCU5660 {5661 uiAbsPartAddr = 0;5662 uiLCUIdx = -1 ;5663 }5664 }5665 5666 Bool bExistMV = false;5667 UInt uiPartIdxCenter;5668 UInt uiCurLCUIdx = getAddr();5669 xDeriveCenterIdx( eCUMode, uiPUIdx, uiPartIdxCenter );5670 5671 Int iTargetView, iStartView;5672 if( !bMerge ) // AMVP5673 {5674 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( eRefPicList0, iRefIdx0, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView );5675 if( bExistMV == false )5676 {5677 bExistMV = xGetColDisMV( eRefPicList0, iRefIdx0, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView );5678 }5679 if( bExistMV ) // DV is found5680 {5681 if( cColMv.m_bDvMcp == false ) //=> DCP, if true => DV-MCP5682 {5683 clipMv(cColMv);5684 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;5685 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView;5686 return;5687 }5688 else // DV-MCP5689 {5690 aiDvMcpDvCand[eRefPicList0][DVFROM_COL] = cColMv.getHor();5691 abDvMcpFlag [eRefPicList0][DVFROM_COL] = true;5692 bDvMcpIsFound = true;5693 }5694 }5695 }5696 else // MERGE5697 {5698 iRefIdx = iRefIdxSkip[0];5699 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( REF_PIC_LIST_0, iRefIdx, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView );5700 if( bExistMV == false )5701 {5702 bExistMV = xGetColDisMV( REF_PIC_LIST_0, iRefIdx, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView );5703 }5704 if( bExistMV )5705 {5706 if( cColMv.m_bDvMcp == false ) // DCP5707 {5708 clipMv(cColMv);5709 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;5710 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView;5711 return;5712 }5713 else { // // DV-MCP5714 aiDvMcpDvCand[0][DVFROM_COL] = cColMv.getHor();5715 abDvMcpFlag [0][DVFROM_COL] = true;5716 bDvMcpIsFound = true;5717 };5718 5719 if ( getSlice()->isInterB() )5720 {5721 iRefIdx = iRefIdxSkip[1];5722 bExistMV = uiLCUIdx >= 0 && xGetColDisMV( REF_PIC_LIST_1, iRefIdx, uiLCUIdx, uiAbsPartAddr, cColMv, iTargetView, iStartView );5723 if( bExistMV == false )5724 {5725 bExistMV = xGetColDisMV( REF_PIC_LIST_1, iRefIdx, uiCurLCUIdx, uiPartIdxCenter, cColMv, iTargetView, iStartView );5726 }5727 if( bExistMV )5728 {5729 if( cColMv.m_bDvMcp == false ) // DCP5730 {5731 clipMv(cColMv);5732 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv;5733 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetView;5734 return;5735 }5736 else // DV-MCP5737 {5738 aiDvMcpDvCand[1][DVFROM_COL] = cColMv.getHor();5739 abDvMcpFlag [1][DVFROM_COL] = true;5740 bDvMcpIsFound = true;5741 };5742 }5743 }5744 }5745 }5746 #else5747 5267 TComMv cColMv; 5748 5268 Int iTargetViewIdx = 0; 5749 5269 Int iTStartViewIdx = 0; 5750 5270 UInt uiPartIdxRB, uiBRIdx; 5271 #if !MTK_SIMPLIFY_DVTC_C0135 5751 5272 Int uiViewIdxCurr= getSlice()->getViewId(); 5273 #endif 5752 5274 UInt uiPartIdxCenter; 5753 5275 xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter ); … … 5759 5281 uiBRIdx = uiPartIdxLT; 5760 5282 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5283 #if MTK_SIMPLIFY_DVTC_C0135 5284 if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 5285 { 5286 uiLCUnew = -1; 5287 } 5288 else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 5289 { 5290 uiLCUnew = -1; 5291 } 5292 else 5293 #else 5761 5294 if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() )) // image boundary check 5295 #endif 5762 5296 { 5763 5297 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU … … 5769 5303 { 5770 5304 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 5305 #if MTK_SIMPLIFY_DVTC_C0135 5306 uiLCUnew = -1; 5307 #else 5771 5308 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU(); 5309 #endif 5772 5310 } 5773 5311 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU … … 5779 5317 { 5780 5318 uiBRIdx = 0; 5319 #if MTK_SIMPLIFY_DVTC_C0135 5320 uiLCUnew = -1; 5321 #else 5781 5322 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1; 5323 #endif 5782 5324 } 5783 5325 } … … 5805 5347 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 5806 5348 { 5349 #if !MTK_SIMPLIFY_DVTC_C0135 5807 5350 if (uiViewIdxCurr > 1) 5808 5351 { 5352 #endif 5809 5353 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 5810 5354 { 5811 5355 clipMv(cColMv); 5812 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5813 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 5356 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5357 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5358 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5359 #else 5360 { 5361 TComPic* picDepth = NULL; 5362 picDepth = getSlice()->getRefPicBaseDepth(); 5363 if (picDepth && bDepthRefine) 5364 #if LGE_SIMP_DVP_REFINE_C0112 5365 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5366 #else 5367 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 5368 #endif 5369 5370 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5371 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5372 } 5373 #endif 5814 5374 return ; 5815 5375 } 5376 #if !MTK_SIMPLIFY_DVTC_C0135 5816 5377 } 5817 5378 #endif 5818 5379 if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx )) 5819 5380 { 5820 5381 clipMv(cColMv); 5821 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5822 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 5382 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5383 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5384 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5385 #else 5386 { 5387 TComPic* picDepth = NULL; 5388 picDepth = getSlice()->getRefPicBaseDepth(); 5389 if (picDepth && bDepthRefine) 5390 #if LGE_SIMP_DVP_REFINE_C0112 5391 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5392 #else 5393 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 5394 #endif 5395 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5396 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5397 } 5398 #endif 5823 5399 return ; 5824 5400 } 5401 #if !MTK_SIMPLIFY_DVTC_C0135 5825 5402 if(uiViewIdxCurr == 1) 5826 5403 { … … 5828 5405 { 5829 5406 clipMv(cColMv); 5830 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5831 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 5407 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5408 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5409 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5410 #else 5411 { 5412 TComPic* picDepth = NULL; 5413 picDepth = getSlice()->getRefPicBaseDepth(); 5414 if (picDepth && bDepthRefine) 5415 #if LGE_SIMP_DVP_REFINE_C0112 5416 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5417 #else 5418 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 5419 #endif 5420 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5421 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5422 } 5423 #endif 5832 5424 return ; 5833 5425 } 5834 5426 } 5835 } 5836 }5837 #endif 5427 #endif 5428 } 5429 } 5838 5430 } // if TMVP Flag 5431 #endif 5432 UInt uiIdx = 0; 5433 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB, true, false); 5434 if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) ) 5435 { 5436 pcTmpCU = NULL; 5437 } 5438 5439 if (pcTmpCU && bParMerge) 5440 { 5441 if (!pcTmpCU->isDiffMER(xP -1, yP+nPSH-1, xP, yP)) 5442 { 5443 pcTmpCU = NULL; 5444 } 5445 } 5446 5447 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5448 { 5449 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5450 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5451 { 5452 eRefPicList = RefPicList(iList); 5453 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5454 if( refId >= 0) 5455 { 5456 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5457 if (refViewIdx != m_pcSlice->getViewId()) // DCP 5458 { 5459 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5460 clipMv(cMvPred); 5461 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5462 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5463 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5464 #else 5465 { 5466 TComPic* picDepth = NULL; 5467 picDepth = getSlice()->getRefPicBaseDepth(); 5468 if (picDepth && bDepthRefine) 5469 #if LGE_SIMP_DVP_REFINE_C0112 5470 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5471 #else 5472 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5473 #endif 5474 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5475 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5476 } 5477 #endif 5478 return; 5479 } 5480 else // MCP 5481 { 5482 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5483 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5484 { 5485 #if MTK_RELEASE_DV_CONSTRAINT_C0129 5486 aiDvMcpDvCandX[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX; 5487 aiDvMcpDvCandY[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispY; 5488 #else 5489 aiDvMcpDvCand[iList][DVFROM_LEFT] = cTmpMvPred.m_iDvMcpDispX; 5490 #endif 5491 abDvMcpFlag [iList][DVFROM_LEFT] = true; 5492 bDvMcpIsFound = true; 5493 } 5494 } 5495 } 5496 #if MERL_VSP_C0152 5497 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5498 { 5499 TComPic* picDepth = NULL; 5500 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5501 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5502 if (picDepth && bDepthRefine) 5503 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5504 myMv.setVer(0); 5505 5506 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5507 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5508 return; 5509 } 5510 #endif 5511 } 5512 } 5513 5514 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT, true, false, true); 5515 if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) ) 5516 { 5517 pcTmpCU = NULL; 5518 } 5519 5520 if (pcTmpCU && bParMerge) 5521 { 5522 if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 5523 { 5524 pcTmpCU = NULL; 5525 } 5526 } 5527 5528 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5529 { 5530 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5531 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5532 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5533 { 5534 eRefPicList = RefPicList(iList); 5535 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5536 if( refId >= 0) 5537 { 5538 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5539 if (refViewIdx!= m_pcSlice->getViewId()) 5540 { 5541 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5542 clipMv(cMvPred); 5543 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5544 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5545 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5546 #else 5547 { 5548 TComPic* picDepth = NULL; 5549 picDepth = getSlice()->getRefPicBaseDepth(); 5550 if (picDepth && bDepthRefine) 5551 #if LGE_SIMP_DVP_REFINE_C0112 5552 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5553 #else 5554 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5555 #endif 5556 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5557 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5558 } 5559 #endif 5560 return; 5561 } 5562 else if(iLCUAddrDiff == 0) //MCP, within same LCU 5563 { 5564 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5565 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5566 { 5567 #if MTK_RELEASE_DV_CONSTRAINT_C0129 5568 aiDvMcpDvCandX[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX; 5569 aiDvMcpDvCandY[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispY; 5570 #else 5571 aiDvMcpDvCand[iList][DVFROM_ABOVE] = cTmpMvPred.m_iDvMcpDispX; 5572 #endif 5573 abDvMcpFlag [iList][DVFROM_ABOVE] = true; 5574 bDvMcpIsFound = true; 5575 } 5576 } 5577 } 5578 #if MERL_VSP_C0152 5579 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5580 { 5581 TComPic* picDepth = NULL; 5582 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5583 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5584 if (picDepth && bDepthRefine) 5585 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5586 myMv.setVer(0); 5587 5588 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5589 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5590 return; 5591 } 5592 #endif 5593 } 5594 } 5595 5596 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, false, true); 5597 5598 if (pcTmpCU && bParMerge) 5599 { 5600 if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP)) 5601 { 5602 pcTmpCU = NULL; 5603 } 5604 } 5605 5606 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 5607 { 5608 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5609 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5610 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5611 { 5612 eRefPicList = RefPicList(iList); 5613 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5614 if( refId >= 0) 5615 { 5616 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5617 if (refViewIdx!= m_pcSlice->getViewId()) 5618 { 5619 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5620 clipMv(cMvPred); 5621 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5622 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5623 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5624 #else 5625 { 5626 TComPic* picDepth = NULL; 5627 picDepth = getSlice()->getRefPicBaseDepth(); 5628 if (picDepth && bDepthRefine) 5629 #if LGE_SIMP_DVP_REFINE_C0112 5630 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5631 #else 5632 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5633 #endif 5634 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5635 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5636 } 5637 #endif 5638 return; 5639 } 5640 else if(iLCUAddrDiff == 0) 5641 { 5642 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5643 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5644 { 5645 #if MTK_RELEASE_DV_CONSTRAINT_C0129 5646 aiDvMcpDvCandX[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX; 5647 aiDvMcpDvCandY[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispY; 5648 #else 5649 aiDvMcpDvCand[iList][DVFROM_ABOVERIGHT] = cTmpMvPred.m_iDvMcpDispX; 5650 #endif 5651 abDvMcpFlag [iList][DVFROM_ABOVERIGHT] = true; 5652 bDvMcpIsFound = true; 5653 } 5654 } 5655 } 5656 #if MERL_VSP_C0152 5657 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5658 { 5659 TComPic* picDepth = NULL; 5660 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5661 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5662 if (picDepth && bDepthRefine) 5663 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5664 myMv.setVer(0); 5665 5666 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5667 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5668 return; 5669 } 5670 #endif 5671 } 5672 } 5673 5674 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB, true, false); 5675 5676 if (pcTmpCU && bParMerge) 5677 { 5678 if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP)) 5679 { 5680 pcTmpCU = NULL; 5681 } 5682 } 5683 5684 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5685 { 5686 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5687 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5688 { 5689 eRefPicList = RefPicList(iList); 5690 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5691 if( refId >= 0) 5692 { 5693 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5694 if (refViewIdx!= m_pcSlice->getViewId()) 5695 { 5696 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5697 clipMv(cMvPred); 5698 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5699 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5700 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5701 #else 5702 { 5703 TComPic* picDepth = NULL; 5704 picDepth = getSlice()->getRefPicBaseDepth(); 5705 if (picDepth && bDepthRefine) 5706 #if LGE_SIMP_DVP_REFINE_C0112 5707 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5708 #else 5709 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5710 #endif 5711 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5712 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5713 } 5714 #endif 5715 return; 5716 } 5717 else // MCP 5718 { 5719 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5720 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5721 { 5722 #if MTK_RELEASE_DV_CONSTRAINT_C0129 5723 aiDvMcpDvCandX[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX; 5724 aiDvMcpDvCandY[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispY; 5725 #else 5726 aiDvMcpDvCand[iList][DVFROM_LEFTBELOW] = cTmpMvPred.m_iDvMcpDispX; 5727 #endif 5728 abDvMcpFlag [iList][DVFROM_LEFTBELOW] = true; 5729 bDvMcpIsFound = true; 5730 } 5731 } 5732 } 5733 #if MERL_VSP_C0152 5734 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5735 { 5736 TComPic* picDepth = NULL; 5737 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5738 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5739 if (picDepth && bDepthRefine) 5740 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5741 myMv.setVer(0); 5742 5743 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5744 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5745 return; 5746 } 5747 #endif 5748 } 5749 } 5750 5751 // Above predictor search 5752 pcTmpCU = getPUAboveLeft(uiIdx, (m_uiAbsIdxInLCU + uiPartAddr), true, false, true); 5753 assert(uiPartIdxLT == (m_uiAbsIdxInLCU + uiPartAddr)); 5754 5755 if (pcTmpCU && bParMerge) 5756 { 5757 if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP)) 5758 { 5759 pcTmpCU = NULL; 5760 } 5761 } 5762 5763 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 5764 { 5765 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5766 5767 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 5768 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) 5769 { 5770 eRefPicList = RefPicList(iList); 5771 Int refId = pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ; 5772 if( refId >= 0) 5773 { 5774 Int refViewIdx = pcTmpCU->getSlice()->getRefViewId( eRefPicList, refId); 5775 if (refViewIdx!= m_pcSlice->getViewId()) 5776 { 5777 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5778 clipMv(cMvPred); 5779 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5780 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5781 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5782 #else 5783 { 5784 TComPic* picDepth = NULL; 5785 picDepth = getSlice()->getRefPicBaseDepth(); 5786 if (picDepth && bDepthRefine) 5787 #if LGE_SIMP_DVP_REFINE_C0112 5788 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred, true); 5789 #else 5790 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cMvPred); 5791 #endif 5792 pDInfo->m_acMvCand[ pDInfo->iN] = cMvPred; 5793 pDInfo->m_aVIdxCan[ pDInfo->iN++] = refViewIdx; 5794 } 5795 #endif 5796 return; 5797 } 5798 else if(iLCUAddrDiff <= 1) 5799 { 5800 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5801 if( cTmpMvPred.m_bDvMcp && bTmpIsSkipped ) 5802 { 5803 #if MTK_RELEASE_DV_CONSTRAINT_C0129 5804 aiDvMcpDvCandX[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX; 5805 aiDvMcpDvCandY[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispY; 5806 #else 5807 aiDvMcpDvCand[iList][DVFROM_ABOVELEFT] = cTmpMvPred.m_iDvMcpDispX; 5808 #endif 5809 abDvMcpFlag [iList][DVFROM_ABOVELEFT] = true; 5810 bDvMcpIsFound = true; 5811 } 5812 } 5813 } 5814 #if MERL_VSP_C0152 5815 else if (pcTmpCU->getVSPIndex(uiIdx) != 0) // is VSP 5816 { 5817 TComPic* picDepth = NULL; 5818 TComMv myMv = pcTmpCU->getCUMvField( eRefPicList )->getMv( uiIdx ); 5819 picDepth = pcTmpCU->getSlice()->getRefPicBaseDepth(); 5820 if (picDepth && bDepthRefine) 5821 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &myMv); 5822 myMv.setVer(0); 5823 5824 pDInfo->m_acMvCand[ pDInfo->iN] = myMv; 5825 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; // refViewIdx; 5826 return; 5827 } 5828 #endif 5829 } 5830 } 5831 #if !MTK_SAIT_TEMPORAL_FIRST_ORDER_C0141_C0097 5832 // copied from getInterMergeCand() 5833 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 5834 { 5835 TComMv cColMv; 5836 Int iTargetViewIdx = 0; 5837 Int iTStartViewIdx = 0; 5838 UInt uiPartIdxRB, uiBRIdx; 5839 #if !MTK_SIMPLIFY_DVTC_C0135 5840 Int uiViewIdxCurr= getSlice()->getViewId(); 5841 #endif 5842 UInt uiPartIdxCenter; 5843 xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter ); 5844 5845 Int uiLCUIdx = getAddr(); 5846 Int uiLCUnew = uiLCUIdx; 5847 eCUMode = getPartitionSize( 0 ); 5848 deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 5849 uiBRIdx = uiPartIdxLT; 5850 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5851 #if MTK_SIMPLIFY_DVTC_C0135 5852 if (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() )>= m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) 5853 { 5854 uiLCUnew = -1; 5855 } 5856 else if(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() )>= m_pcSlice->getSPS()->getPicHeightInLumaSamples() ) 5857 { 5858 uiLCUnew = -1; 5859 } 5860 else 5861 #else 5862 if ( (( m_pcPic->getCU(m_uiCUAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxTmp] + m_pcPic->getMinCUWidth() ) < m_pcSlice->getSPS()->getPicWidthInLumaSamples() ) &&(( m_pcPic->getCU(m_uiCUAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxTmp] + m_pcPic->getMinCUHeight() ) < m_pcSlice->getSPS()->getPicHeightInLumaSamples() )) // image boundary check 5863 #endif 5864 { 5865 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5866 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 5867 { 5868 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 5869 } 5870 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 5871 { 5872 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 5873 #if MTK_SIMPLIFY_DVTC_C0135 5874 uiLCUnew = -1; 5875 #else 5876 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU(); 5877 #endif 5878 } 5879 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 5880 { 5881 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 5882 uiLCUnew = uiLCUIdx + 1; 5883 } 5884 else //is the right bottom corner of LCU 5885 { 5886 uiBRIdx = 0; 5887 #if MTK_SIMPLIFY_DVTC_C0135 5888 uiLCUnew = -1; 5889 #else 5890 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1; 5891 #endif 5892 } 5893 } 5894 const Int iNumofCandPic = 2; 5895 for(Int i =0; i < iNumofCandPic; i++) 5896 { 5897 Int lpRef=0; 5898 if(i == 0) 5899 { //check the col-located picture 5900 eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 5901 #if COLLOCATED_REF_IDX 5902 lpRef = getSlice()->getColRefIdx(); 5903 #else 5904 Int lpRef = 0; 5905 #endif 5906 } 5907 else 5908 { 5909 if(!(getPic()->getRapbCheck())) 5910 break; 5911 eRefPicList=getPic()->getRapRefList(); 5912 lpRef=getPic()->getRapRefIdx(); 5913 } 5914 5915 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 5916 { 5917 #if !MTK_SIMPLIFY_DVTC_C0135 5918 if (uiViewIdxCurr > 1) 5919 { 5920 #endif 5921 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 5922 { 5923 clipMv(cColMv); 5924 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5925 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5926 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5927 #else 5928 { 5929 TComPic* picDepth = NULL; 5930 picDepth = getSlice()->getRefPicBaseDepth(); 5931 if (picDepth && bDepthRefine) 5932 #if LGE_SIMP_DVP_REFINE_C0112 5933 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5934 #else 5935 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 5936 #endif 5937 5938 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5939 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5940 } 5941 #endif 5942 return ; 5943 } 5944 #if !MTK_SIMPLIFY_DVTC_C0135 5945 } 5946 #endif 5947 if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx )) 5948 { 5949 clipMv(cColMv); 5950 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5951 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5952 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5953 #else 5954 { 5955 TComPic* picDepth = NULL; 5956 picDepth = getSlice()->getRefPicBaseDepth(); 5957 if (picDepth && bDepthRefine) 5958 #if LGE_SIMP_DVP_REFINE_C0112 5959 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5960 #else 5961 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 5962 #endif 5963 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5964 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5965 } 5966 #endif 5967 return ; 5968 } 5969 #if !MTK_SIMPLIFY_DVTC_C0135 5970 if(uiViewIdxCurr == 1) 5971 { 5972 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 5973 { 5974 clipMv(cColMv); 5975 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 5976 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5977 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5978 #else 5979 { 5980 TComPic* picDepth = NULL; 5981 picDepth = getSlice()->getRefPicBaseDepth(); 5982 if (picDepth && bDepthRefine) 5983 #if LGE_SIMP_DVP_REFINE_C0112 5984 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv, true); 5985 #else 5986 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &cColMv); 5987 #endif 5988 pDInfo->m_acMvCand[ pDInfo->iN] = cColMv; 5989 pDInfo->m_aVIdxCan[ pDInfo->iN++] = iTargetViewIdx; 5990 } 5991 #endif 5992 return ; 5993 } 5994 } 5995 #endif 5996 } 5997 } 5998 } // if TMVP Flag 5999 #endif 5839 6000 5840 6001 if( bDvMcpIsFound ) // skip dvmcp 5841 6002 { 5842 #if QC_SIMPLE_NBDV_B00475843 6003 for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial 5844 #else5845 for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal5846 #endif5847 6004 { 5848 6005 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5850 6007 if( abDvMcpFlag[iList][i]==true ) 5851 6008 { 6009 #if MTK_RELEASE_DV_CONSTRAINT_C0129 6010 TComMv dv( aiDvMcpDvCandX[iList][ i ], aiDvMcpDvCandY[iList][ i ] ); 6011 #else 5852 6012 TComMv dv( aiDvMcpDvCand[iList][ i ], 0 ); 6013 #endif 5853 6014 clipMv( dv ); 5854 pDInfo->m_acMvCand[ pDInfo->iN ] = dv; 5855 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6015 #if !MERL_MTK_VSP_DVP_REFINE_C0152_C0131 6016 pDInfo->m_acMvCand[ pDInfo->iN] = dv; 6017 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6018 #else 6019 { 6020 TComPic* picDepth = NULL; 6021 picDepth = getSlice()->getRefPicBaseDepth(); 6022 if (picDepth && bDepthRefine) 6023 #if LGE_SIMP_DVP_REFINE_C0112 6024 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv, true); 6025 #else 6026 estimateDVFromDM(uiPartIdx, picDepth, uiPartAddr, &dv); 6027 #endif 6028 pDInfo->m_acMvCand[ pDInfo->iN] = dv; 6029 pDInfo->m_aVIdxCan[ pDInfo->iN++] = 0; 6030 } 6031 #endif 5856 6032 return; 5857 6033 } … … 5863 6039 } 5864 6040 #endif 6041 5865 6042 #endif 5866 6043 … … 5872 6049 * \param pInfo 5873 6050 */ 5874 #if SHARP_INTERVIEW_DECOUPLE_B01116051 #if H3D_IVMP 5875 6052 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 5876 6053 { … … 5898 6075 if (iMVPIdx<=0) 5899 6076 { 5900 // extention part 6077 #if H3D_NBDV 6078 // Extension part 5901 6079 DisInfo cDisInfo; 5902 6080 cDisInfo.iN = 0; 5903 #if LGE_DVMCP_A0126 5904 #if QC_SIMPLE_NBDV_B0047 5905 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 5906 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false); 5907 #else 5908 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); 5909 #endif 5910 #else 5911 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 5912 #endif 5913 #else 5914 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); 5915 #endif 6081 getDisMvpCandNBDV(uiPartIdx, uiPartAddr, &cDisInfo, false 6082 #if MERL_VSP_C0152 6083 , true 6084 #endif 6085 ); 5916 6086 if(cDisInfo.iN==0) 5917 6087 { … … 5921 6091 cDisInfo.m_aVIdxCan[0] = 0; 5922 6092 } 6093 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051 6094 Int paiPdmRefIdx[4] = {-1, -1, -1, -1}; 6095 Int iPdmDir[4] = {-1, -1, -1, -1}; 6096 #if QC_C0051_FIXED_BY_MTK 6097 TComMv cPdmMvPred[4]; 6098 #else 6099 TComMv cPdmMvPred[2]; 6100 #endif 6101 cPdmMvPred[0].m_bDvMcp = cPdmMvPred[1].m_bDvMcp = false; 6102 if(getUnifiedMvPredCan(uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, cPdmMvPred, &cDisInfo, iPdmDir, false)) 6103 #else // QC_AMVP_MRG_UNIFY_IVCAN_C0051 5923 6104 TComMv cPdmMvPred; 5924 #if QC_MULTI_DIS_CAN_A00975925 6105 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 6106 #endif // QC_AMVP_MRG_UNIFY_IVCAN_C0051 6107 #else // H3D_NBDV 6108 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 6109 #endif 6110 6111 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051 6112 { 6113 clipMv( cPdmMvPred[0] ); 6114 pInfo->m_acMvCand[0] = cPdmMvPred[0]; 6115 } 6116 else 6117 { 6118 pInfo->m_acMvCand[0].set(0,0); 6119 } 5926 6120 #else 5927 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )5928 #endif5929 6121 { 5930 6122 clipMv( cPdmMvPred ); … … 5935 6127 pInfo->m_acMvCand[0].set(0,0); 5936 6128 } 6129 #endif 5937 6130 } 5938 6131 } … … 5941 6134 5942 6135 Void TComDataCU::fillMvpCandBase( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ) 5943 #else 6136 #else // H3D_IVMP 5944 6137 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ) 5945 #endif 6138 #endif // H3D_IVMP 5946 6139 { 5947 6140 PartSize eCUMode = getPartitionSize( 0 ); … … 5955 6148 return; 5956 6149 } 5957 5958 #if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B01115959 DisInfo cDisInfo;5960 cDisInfo.iN = 0;5961 if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode())5962 {5963 #if LGE_DVMCP_A01265964 #if QC_SIMPLE_NBDV_B00475965 #if FIX_LGE_IVMP_PARALLEL_MERGE_B01365966 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false);5967 #else5968 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo);5969 #endif5970 #else5971 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx );5972 #endif5973 #else5974 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo );5975 #endif5976 }5977 if(cDisInfo.iN==0)5978 {5979 cDisInfo.iN = 1;5980 cDisInfo.m_acMvCand[0].setHor(0);5981 cDisInfo.m_acMvCand[0].setVer(0);5982 cDisInfo.m_aVIdxCan[0] = 0;5983 }5984 #endif5985 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B01115986 #if ( PDM_AMVP_POS == 0 )5987 // get inter-view mv predictor (at position 0)5988 TComMv cPdmMvPred;5989 #if QC_MULTI_DIS_CAN_A00975990 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )5991 #else5992 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )5993 #endif5994 {5995 clipMv( cPdmMvPred );5996 pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred;5997 }5998 #endif5999 #endif6000 6150 6001 6151 //-- Get Spatial MV … … 6009 6159 TComDataCU* tmpCU = NULL; 6010 6160 UInt idx; 6011 #if MVP_AT_ENTROPYSLICE_BOUNDARY6012 6161 tmpCU = getPUBelowLeft(idx, uiPartIdxLB, true, false); 6013 #else6014 tmpCU = getPUBelowLeft(idx, uiPartIdxLB);6015 #endif6016 6162 bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA); 6017 6163 6018 6164 if (!bAddedSmvp) 6019 6165 { 6020 #if MVP_AT_ENTROPYSLICE_BOUNDARY6021 6166 tmpCU = getPULeft(idx, uiPartIdxLB, true, false); 6022 #else6023 tmpCU = getPULeft(idx, uiPartIdxLB);6024 #endif6025 6167 bAddedSmvp = (tmpCU != NULL) && (tmpCU->getPredictionMode(idx) != MODE_INTRA); 6026 6168 } … … 6042 6184 } 6043 6185 6044 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B01116045 #if ( PDM_AMVP_POS == 1 )6046 // get inter-view mv predictor (at position 1)6047 TComMv cPdmMvPred;6048 #if QC_MULTI_DIS_CAN_A00976049 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) )6050 #else6051 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) )6052 #endif6053 {6054 clipMv( cPdmMvPred );6055 pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred;6056 }6057 #endif6058 #endif6059 6060 6186 // Above predictor search 6061 6187 bAdded = xAddMVPCand( pInfo, eRefPicList, iRefIdx, uiPartIdxRT, MD_ABOVE_RIGHT); … … 6094 6220 } 6095 6221 6096 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 6097 #if ( PDM_AMVP_POS == 2 ) 6098 // get inter-view mv predictor (at position 2) 6099 TComMv cPdmMvPred; 6100 #if QC_MULTI_DIS_CAN_A0097 6101 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 6102 #else 6103 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 6104 #endif 6105 { 6106 clipMv( cPdmMvPred ); 6107 pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred; 6108 } 6109 #endif 6110 #endif 6111 6112 #if AMVP_PRUNING_SIMPLIFICATION 6222 6113 6223 if ( pInfo->iN == 2 ) 6114 6224 { … … 6116 6226 { 6117 6227 pInfo->iN = 1; 6118 #if FIX_MISUSE_REFINDEX6228 #if QC_MRG_CANS_B0048 6119 6229 pInfo->m_acMvCand[ 1 ].set(0, 0); 6120 6230 #endif 6121 6231 } 6122 6232 } 6123 #if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B01116124 if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 )6125 {6126 if ( pInfo->m_acMvCand[ 1 ] == pInfo->m_acMvCand[ 2 ] )6127 {6128 pInfo->iN = 2;6129 if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] )6130 pInfo->iN = 1;6131 }6132 else6133 {6134 if( pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 1 ] )6135 {6136 pInfo->m_acMvCand[1 ] = pInfo->m_acMvCand[ 2 ];6137 pInfo->iN = 2;6138 }6139 else if (pInfo->m_acMvCand[ 0 ] == pInfo->m_acMvCand[ 2 ])6140 {6141 pInfo->iN = 2;6142 }6143 }6144 }6145 #endif6146 #endif6147 6233 6148 6234 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) … … 6195 6281 if ( uiLCUIdx >= 0 && xGetColMVP( eRefPicList, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx_Col ) ) 6196 6282 { 6197 #if FIX_LGE_DVMCP_B01336283 #if H3D_NBDV 6198 6284 cColMv.m_bDvMcp = false; 6199 6285 #endif … … 6207 6293 if (xGetColMVP( eRefPicList, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx_Col )) 6208 6294 { 6209 #if FIX_LGE_DVMCP_B01336295 #if H3D_NBDV 6210 6296 cColMv.m_bDvMcp = false; 6211 6297 #endif … … 6216 6302 } 6217 6303 6218 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 6219 #if ( PDM_AMVP_POS == 3 ) 6220 // get inter-view mv predictor (at position 3) 6221 TComMv cPdmMvPred; 6222 #if QC_MULTI_DIS_CAN_A0097 6223 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 6224 #else 6225 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 6226 #endif 6227 { 6228 clipMv( cPdmMvPred ); 6229 pInfo->m_acMvCand[ pInfo->iN++ ] = cPdmMvPred; 6230 } 6231 #endif 6232 #endif 6233 6234 #if !AMVP_PRUNING_SIMPLIFICATION 6235 // Check No MV Candidate 6236 xUniqueMVPCand( pInfo ); 6237 #endif 6238 6239 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 6240 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 6241 if (pInfo->iN > iNumAMVPCands) 6242 { 6243 pInfo->iN = iNumAMVPCands; 6244 } 6245 else if (pInfo->iN < iNumAMVPCands) 6246 #else 6304 6247 6305 if (pInfo->iN > AMVP_MAX_NUM_CANDS) 6248 6306 { … … 6250 6308 } 6251 6309 else if (pInfo->iN < AMVP_MAX_NUM_CANDS) 6252 #endif 6253 { 6254 #if !AMVP_ZERO_CHECKING_REMOVAL 6255 int j; 6256 for (j=0; j<pInfo->iN; j++) 6257 { 6258 if (pInfo->m_acMvCand[j].getHor() == 0 && pInfo->m_acMvCand[j].getVer() == 0) 6259 { 6260 break; 6261 } 6262 } 6263 if (j == pInfo->iN) 6264 { 6265 #endif 6310 { 6266 6311 pInfo->m_acMvCand[pInfo->iN].set(0,0); 6267 6312 pInfo->iN++; 6268 #if !AMVP_ZERO_CHECKING_REMOVAL6269 }6270 #endif6271 6313 } 6272 6314 return ; … … 6358 6400 case MD_LEFT: 6359 6401 { 6360 #if MVP_AT_ENTROPYSLICE_BOUNDARY6361 6402 pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx, true, false); 6362 #else6363 pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx);6364 #endif6365 6403 break; 6366 6404 } 6367 6405 case MD_ABOVE: 6368 6406 { 6369 #if MVP_AT_ENTROPYSLICE_BOUNDARY6370 6407 pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, false, true); 6371 #else6372 pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, true, true);6373 #endif6374 6408 break; 6375 6409 } 6376 6410 case MD_ABOVE_RIGHT: 6377 6411 { 6378 #if MVP_AT_ENTROPYSLICE_BOUNDARY6379 6412 pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, false, true); 6380 #else6381 pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, true, true);6382 #endif6383 6413 break; 6384 6414 } 6385 6415 case MD_BELOW_LEFT: 6386 6416 { 6387 #if MVP_AT_ENTROPYSLICE_BOUNDARY6388 6417 pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx, true, false); 6389 #else6390 pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx);6391 #endif6392 6418 break; 6393 6419 } 6394 6420 case MD_ABOVE_LEFT: 6395 6421 { 6396 #if MVP_AT_ENTROPYSLICE_BOUNDARY6397 6422 pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, false, true); 6398 #else6399 pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, true, true);6400 #endif6401 6423 break; 6402 6424 } … … 6407 6429 } 6408 6430 6431 #if MERL_VSP_C0152 6432 if(pcTmpCU != NULL && pcTmpCU->getVSPIndex(uiIdx)) 6433 { 6434 return false; 6435 } 6436 #endif 6437 6409 6438 if ( pcTmpCU != NULL && m_pcSlice->isEqualRef(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx), iRefIdx) ) 6410 6439 { 6411 6440 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 6412 #if LGE_DVMCP_A01266441 #if H3D_NBDV 6413 6442 cMvPred.m_bDvMcp = false; 6414 6443 #endif … … 6454 6483 { 6455 6484 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 6456 #if LGE_DVMCP_A01266485 #if H3D_NBDV 6457 6486 cMvPred.m_bDvMcp = false; 6458 6487 #endif … … 6464 6493 } 6465 6494 6466 #if !AMVP_PRUNING_SIMPLIFICATION6467 /**6468 * Reduce list of motion vector predictors to a set of unique predictors6469 * \param pInfo list of motion vector predictors6470 */6471 Void TComDataCU::xUniqueMVPCand(AMVPInfo* pInfo)6472 {6473 Int n = 1;6474 if ( pInfo->iN == 0 )6475 {6476 #if AMVP_ZERO_CHECKING_REMOVAL6477 return;6478 #else6479 // Add a zero candidate is none is available6480 pInfo->m_acMvCand[ 0 ].setZero();6481 #endif6482 }6483 else6484 {6485 for (Int i = 1; i < pInfo->iN; i++)6486 {6487 Int j;6488 for (j = n - 1; j >= 0; j--)6489 {6490 if ( pInfo->m_acMvCand[ i ] == pInfo->m_acMvCand[ j ] )6491 {6492 break;6493 }6494 }6495 if ( j < 0 )6496 {6497 pInfo->m_acMvCand[ n++ ] = pInfo->m_acMvCand[ i ];6498 }6499 }6500 }6501 pInfo->iN = n;6502 }6503 #endif6504 6495 6505 6496 /** … … 6515 6506 TComDataCU* pcTmpCU = NULL; 6516 6507 UInt uiIdx; 6508 6517 6509 switch( eDir ) 6518 6510 { 6519 6511 case MD_LEFT: 6520 6512 { 6521 #if MVP_AT_ENTROPYSLICE_BOUNDARY6522 6513 pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx, true, false); 6523 #else6524 pcTmpCU = getPULeft(uiIdx, uiPartUnitIdx);6525 #endif6526 6514 break; 6527 6515 } 6528 6516 case MD_ABOVE: 6529 6517 { 6530 #if MVP_AT_ENTROPYSLICE_BOUNDARY6531 6518 pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, false, true); 6532 #else6533 pcTmpCU = getPUAbove(uiIdx, uiPartUnitIdx, true, true, true);6534 #endif6535 6519 break; 6536 6520 } 6537 6521 case MD_ABOVE_RIGHT: 6538 6522 { 6539 #if MVP_AT_ENTROPYSLICE_BOUNDARY6540 6523 pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, false, true); 6541 #else6542 pcTmpCU = getPUAboveRight(uiIdx, uiPartUnitIdx, true, true, true);6543 #endif6544 6524 break; 6545 6525 } 6546 6526 case MD_BELOW_LEFT: 6547 6527 { 6548 #if MVP_AT_ENTROPYSLICE_BOUNDARY6549 6528 pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx, true, false); 6550 #else6551 pcTmpCU = getPUBelowLeft(uiIdx, uiPartUnitIdx);6552 #endif6553 6529 break; 6554 6530 } 6555 6531 case MD_ABOVE_LEFT: 6556 6532 { 6557 #if MVP_AT_ENTROPYSLICE_BOUNDARY6558 6533 pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, false, true); 6559 #else6560 pcTmpCU = getPUAboveLeft(uiIdx, uiPartUnitIdx, true, true, true);6561 #endif6562 6534 break; 6563 6535 } … … 6572 6544 return false; 6573 6545 } 6574 6546 6547 #if MERL_VSP_C0152 6548 if(pcTmpCU->getVSPIndex(uiIdx)) 6549 { 6550 return false; 6551 } 6552 #endif 6575 6553 RefPicList eRefPicList2nd = REF_PIC_LIST_0; 6576 6554 if( eRefPicList == REF_PIC_LIST_0 ) … … 6587 6565 Int iNeibPOC = iCurrPOC; 6588 6566 Int iNeibRefPOC; 6589 6567 #if INTER_VIEW_VECTOR_SCALING_C0116 6568 Int iCurrViewId = m_pcSlice->getViewOrderIdx(); // will be changed to view_id 6569 Int iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, iRefIdx)->getViewOrderIdx(); // will be changed to view_id 6570 Int iNeibViewId = iCurrViewId; 6571 Int iNeibRefViewId; 6572 #endif 6590 6573 #if QC_IV_AS_LT_B0046 6591 6574 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic( eRefPicList, iRefIdx)->getIsLongTerm(); … … 6595 6578 { 6596 6579 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ); 6580 #if INTER_VIEW_VECTOR_SCALING_C0116 6581 iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id 6582 #endif 6597 6583 #if QC_IV_AS_LT_B0046 6598 6584 bIsNeibRefLongTerm = m_pcSlice->getRefPic( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getIsLongTerm() ; 6585 #if INTER_VIEW_VECTOR_SCALING_C0116 6586 if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && ((iNeibRefPOC == iCurrRefPOC) && (iNeibRefViewId == iCurrRefViewId))) 6587 #else 6599 6588 if ( (bIsCurrRefLongTerm == bIsNeibRefLongTerm) && (iNeibRefPOC == iCurrRefPOC) ) 6589 #endif 6600 6590 #else 6601 6591 if( pcTmpCU->getSlice()->getRefViewId( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ) != m_pcSlice->getRefViewId( eRefPicList, iRefIdx ) ) … … 6605 6595 { 6606 6596 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 6607 #if LGE_DVMCP_A01266597 #if H3D_NBDV 6608 6598 cMvPred.m_bDvMcp = false; 6609 6599 #endif … … 6618 6608 { 6619 6609 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx) ); 6610 #if INTER_VIEW_VECTOR_SCALING_C0116 6611 iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList, pcTmpCU->getCUMvField(eRefPicList)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id 6612 #endif 6620 6613 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 6621 6614 TComMv rcMv; … … 6630 6623 } 6631 6624 #endif 6625 #if INTER_VIEW_VECTOR_SCALING_C0116 6626 Int iScale = 4096; 6627 if((iCurrRefPOC != iNeibRefPOC) ) // inter & inter 6628 iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6629 else if(m_pcSlice->getIVScalingFlag()) // inter-view & inter-view 6630 iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iNeibViewId, iNeibRefViewId ); 6631 #else 6632 6632 Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6633 #endif 6633 6634 if ( iScale == 4096 ) 6634 6635 { … … 6639 6640 rcMv = cMvPred.scaleMv( iScale ); 6640 6641 } 6641 #if LGE_DVMCP_A01266642 #if H3D_NBDV 6642 6643 rcMv.m_bDvMcp = false; 6643 6644 #endif … … 6652 6653 { 6653 6654 iNeibRefPOC = pcTmpCU->getSlice()->getRefPOC( eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx) ); 6655 #if INTER_VIEW_VECTOR_SCALING_C0116 6656 iNeibRefViewId = pcTmpCU->getSlice()->getRefPic(eRefPicList2nd, pcTmpCU->getCUMvField(eRefPicList2nd)->getRefIdx(uiIdx))->getViewOrderIdx(); // will be changed to view_id 6657 #endif 6654 6658 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 6655 6659 TComMv rcMv; … … 6664 6668 } 6665 6669 #endif 6670 #if INTER_VIEW_VECTOR_SCALING_C0116 6671 Int iScale = 4096; 6672 if((iCurrRefPOC != iNeibRefPOC)) // inter & inter 6673 iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6674 else if(m_pcSlice->getIVScalingFlag()) // inter-view & inter-view 6675 iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iNeibViewId, iNeibRefViewId ); 6676 #else 6666 6677 Int iScale = xGetDistScaleFactor( iCurrPOC, iCurrRefPOC, iNeibPOC, iNeibRefPOC ); 6678 #endif 6667 6679 if ( iScale == 4096 ) 6668 6680 { … … 6673 6685 rcMv = cMvPred.scaleMv( iScale ); 6674 6686 } 6675 #if LGE_DVMCP_A01266687 #if H3D_NBDV 6676 6688 rcMv.m_bDvMcp = false; 6677 6689 #endif … … 6686 6698 } 6687 6699 6688 #if QC_MULTI_DIS_CAN_A00976700 #if H3D_NBDV 6689 6701 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 6690 6702 { 6691 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B00476692 Int iDvMcpDispX[2] = {-1,};6693 Bool bDvMcpFlag [2] = { false, };6694 Int iCurrViewIdx = m_pcSlice->getViewId();6695 #endif6696 6697 6703 UInt uiAbsPartAddr = uiPartUnitIdx; 6698 6704 … … 6702 6708 TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 6703 6709 iColViewIdx = pColCU->getSlice()->getViewId(); 6704 6710 #if MERL_VSP_C0152 6711 //TComDataCU *pColCU = pColPic->getCU( uiCUAddr ); 6712 if( pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr) < 0) 6713 { 6714 return false; 6715 } 6716 #endif 6705 6717 6706 6718 if (pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE||pColCU->isIntra(uiAbsPartAddr)) … … 6708 6720 return false; 6709 6721 } 6710 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B00476711 Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr );6712 #endif6713 6722 for (Int ilist = 0; ilist < (pColCU->getSlice()->isInterB()? 2:1); ilist++) 6714 6723 { 6715 6724 if(pColCU->getSlice()->isInterB()) 6716 6725 { 6726 #if !QC_NBDV_LDB_FIX_C0055 6717 6727 if(ilist == 0 ) 6718 6728 eColRefPicList = getSlice()->getCheckLDC() ? eRefPicList : RefPicList(1-getSlice()->getColDir()); 6719 6729 else 6720 6730 eColRefPicList = getSlice()->getCheckLDC() ? (eRefPicList== REF_PIC_LIST_0? REF_PIC_LIST_1:REF_PIC_LIST_0 ): RefPicList(getSlice()->getColDir()); 6731 #else 6732 eColRefPicList = RefPicList(ilist); 6733 #endif 6721 6734 } 6722 6735 … … 6732 6745 if ( iColViewIdx == iColRefViewIdx ) // temporal vector 6733 6746 { 6734 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B00476735 if( iColViewIdx >0 )6736 {6737 TComMv tmpMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr);6738 if( tmpMv.m_bDvMcp && bColIsSkipped ) // DV-MCP SKIP6739 {6740 iDvMcpDispX[ilist] = tmpMv.m_iDvMcpDispX;6741 bDvMcpFlag [ilist] = true;6742 iTargetViewIdx = 0; //iColRefViewIdx ;6743 iStartViewIdx = 0; //iCurrViewIdx; //iColViewIdx ;6744 }6745 }6746 #endif6747 6747 continue; 6748 6748 } … … 6750 6750 { 6751 6751 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 6752 #if LGE_DVMCP_A01266753 6752 rcMv.m_bDvMcp = false; 6754 #endif6755 6753 iTargetViewIdx = iColRefViewIdx ; 6756 6754 iStartViewIdx = iColViewIdx ; … … 6758 6756 } 6759 6757 } 6760 6761 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B00476762 for( Int ilist=0 ; ilist<2 ; ilist++ )6763 {6764 if( bDvMcpFlag[ilist] )6765 {6766 rcMv.setHor( iDvMcpDispX[ilist] );6767 rcMv.setVer( 0 );6768 rcMv.m_bDvMcp = true;6769 iTargetViewIdx = 0; //iColRefViewIdx ;6770 iStartViewIdx = iCurrViewIdx; //iColViewIdx ;6771 return true;6772 }6773 }6774 #endif6775 6758 6776 6759 return false; … … 6784 6767 * \returns Bool 6785 6768 */ 6786 Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ) 6769 Bool TComDataCU::xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx 6770 #if QC_TMVP_MRG_REFIDX_C0047 6771 , 6772 Bool bMRG 6773 #endif 6774 ) 6787 6775 { 6788 6776 UInt uiAbsPartAddr = uiPartUnitIdx; … … 6790 6778 RefPicList eColRefPicList; 6791 6779 Int iColPOC, iColRefPOC, iCurrPOC, iCurrRefPOC, iScale; 6792 #if SONY_COLPIC_AVAILABILITY6793 #if QC_IV_AS_LT_B00466794 Int iColViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;6795 #else6796 Int iColViewOrderIdx, iColRefViewOrderIdx, iCurrViewOrderIdx, iCurrRefViewOrderIdx;6797 #endif6798 #endif6799 6780 TComMv cColMv; 6800 6801 #if SONY_COLPIC_AVAILABILITY 6802 iCurrViewOrderIdx = m_pcSlice->getViewOrderIdx(); 6803 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 6804 #endif 6781 #if INTER_VIEW_VECTOR_SCALING_C0115 6782 Int iColViewId, iColRefViewId, iCurrViewId, iCurrRefViewId; 6783 #endif 6784 6805 6785 // use coldir. 6806 6786 #if COLLOCATED_REF_IDX … … 6817 6797 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 6818 6798 iColPOC = pColCU->getSlice()->getPOC(); 6819 #if SONY_COLPIC_AVAILABILITY 6820 iColViewOrderIdx = pColCU->getSlice()->getViewOrderIdx(); 6799 #if INTER_VIEW_VECTOR_SCALING_C0115 6800 iCurrViewId = m_pcSlice->getViewOrderIdx(); // will be changed to view_id 6801 iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); // will be changed to view_id 6802 iColViewId = pColCU->getSlice()->getViewOrderIdx(); // will be changed to view_id 6821 6803 #endif 6822 6804 … … 6826 6808 } 6827 6809 6828 #if ! SONY_COLPIC_AVAILABILITY&!QC_IV_AS_LT_B00466810 #if !INTER_VIEW_VECTOR_SCALING_C0115&!QC_IV_AS_LT_B0046 6829 6811 if( m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewId() != m_pcSlice->getViewId() ) 6830 6812 return false; … … 6853 6835 // Scale the vector. 6854 6836 iColRefPOC = pColCU->getSlice()->getRefPOC(eColRefPicList, iColRefIdx); 6855 6837 #if INTER_VIEW_VECTOR_SCALING_C0115 6838 iColRefViewId = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); // will be changed to view_id 6839 #endif 6856 6840 #if !QC_IV_AS_LT_B0046 6857 #if SONY_COLPIC_AVAILABILITY6858 iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx();6859 #else6860 6841 if( pColCU->getSlice()->getRefViewId( eColRefPicList, iColRefIdx ) != pColCU->getSlice()->getViewId() ) 6861 6842 { 6862 6843 return false; 6863 6844 } 6864 #endif6865 6845 #else 6866 6846 Bool bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm(); … … 6868 6848 if(bIsCurrRefLongTerm != bIsColRefLongTerm) 6869 6849 { 6850 #if QC_TMVP_MRG_REFIDX_C0047 6851 cColMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 6852 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 6853 if(bMRG ) 6854 { 6855 Int iUpdRefIdx = m_pcSlice->getNewRefIdx(eRefPicList); 6856 if(iUpdRefIdx > 0 ) 6857 { 6858 riRefIdx = iUpdRefIdx; 6859 bIsCurrRefLongTerm = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getIsLongTerm(); 6860 iCurrRefPOC = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getPOC(); 6861 #if INTER_VIEW_VECTOR_SCALING_C0115 6862 iCurrRefViewId = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); // will be changed to view_id 6863 #endif 6864 } 6865 else 6866 return false; 6867 }else 6868 { 6869 #endif 6870 6870 assert( ((iColPOC == iColRefPOC)&&(iCurrPOC != iCurrRefPOC))||((iColPOC != iColRefPOC)&&(iCurrPOC == iCurrRefPOC))); 6871 6871 return false; 6872 #if QC_TMVP_MRG_REFIDX_C0047 6873 } 6874 #endif 6872 6875 } 6873 6876 #endif … … 6890 6893 } 6891 6894 }else 6892 #if QC_MVHEVC_B0046 6893 rcMv = cColMv; //inter-view 6895 #if INTER_VIEW_VECTOR_SCALING_C0115 6896 { 6897 if((iCurrPOC == iCurrRefPOC) && m_pcSlice->getIVScalingFlag()) // inter-view & inter-view 6898 iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId ); 6899 else 6900 iScale = 4096; // inter & inter 6901 if ( iScale == 4096 ) 6902 { 6903 rcMv = cColMv; 6904 } 6905 else 6906 { 6907 rcMv = cColMv.scaleMv( iScale ); 6908 } 6909 } 6894 6910 #else 6895 { 6896 #if SONY_COLPIC_AVAILABILITY 6897 Int iColRefViewOrderIdx = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewOrderIdx(); 6898 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 6899 if ( iScale == 4096 ) 6900 { 6901 rcMv = cColMv; 6902 } 6903 else 6904 { 6905 rcMv = cColMv.scaleMv( iScale ); 6906 } 6907 #else 6908 return false; 6909 #endif 6910 } 6911 #endif 6912 } 6913 #else 6914 #if SONY_COLPIC_AVAILABILITY 6915 iScale = 0; 6916 iCurrRefViewOrderIdx = m_pcSlice->getRefPic(eRefPicList, riRefIdx)->getViewOrderIdx(); 6917 if((iColPOC != iColRefPOC)&&(iCurrPOC != iCurrRefPOC)) 6918 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); 6919 else if((iColPOC == iColRefPOC)&&(iCurrPOC == iCurrRefPOC)) 6920 iScale = xGetDistScaleFactor(iCurrViewOrderIdx, iCurrRefViewOrderIdx, iColViewOrderIdx, iColRefViewOrderIdx); 6921 else 6922 return false; 6923 6924 #else 6925 iScale = xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iColPOC, iColRefPOC); 6926 #endif 6927 if ( iScale == 4096 ) 6928 { 6929 rcMv = cColMv; 6930 } 6931 else 6932 { 6933 rcMv = cColMv.scaleMv( iScale ); 6934 } 6935 #endif 6911 rcMv = cColMv; //inter-view 6912 #endif 6913 } 6914 #endif 6915 6936 6916 return true; 6937 6917 } … … 7026 7006 return false; 7027 7007 } 7028 7008 7029 7009 if( m_pcSlice->getRefPic( eRefPicList, iRefIdx )->getViewId() != m_pcSlice->getViewId() ) 7030 7010 { … … 7071 7051 } 7072 7052 } 7053 7054 #if MERL_VSP_C0152 // Preventive 7055 if (pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiPartIdxCenter) < 0) // NOT_VALID 7056 return false; 7057 #endif 7073 7058 7074 7059 // Scale the vector. … … 7107 7092 UInt TComDataCU::getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra) 7108 7093 { 7109 #if !LOGI_INTRA_NAME_3MPM7110 static const UChar aucIntraDirToScanIdx[MAX_CU_DEPTH][NUM_INTRA_MODE] =7111 {7112 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 07113 },7114 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 07115 },7116 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 07117 },7118 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 07119 },7120 {0, 1, 2, 0, 0, 1, 1, 0, 2, 2, 0, 0, 1, 1, 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 07121 },7122 {0, 1, 2, 0, 0, 1, 1, 0, 2, 2, 0, 0, 1, 1, 0, 0, 2, 2, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 07123 },7124 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 07125 },7126 };7127 #endif7128 7094 7129 7095 UInt uiCTXIdx; … … 7155 7121 #endif 7156 7122 7157 #if LOGI_INTRA_NAME_3MPM7158 7123 uiScanIdx = SCAN_ZIGZAG; 7159 7124 if (uiCTXIdx >3 && uiCTXIdx < 6) //if multiple scans supported for PU size … … 7161 7126 uiScanIdx = abs((Int) uiDirMode - VER_IDX) < 5 ? 1 : (abs((Int)uiDirMode - HOR_IDX) < 5 ? 2 : 0); 7162 7127 } 7163 #else7164 uiScanIdx = aucIntraDirToScanIdx[uiCTXIdx][uiDirMode];7165 #endif7166 7128 } 7167 7129 else … … 7180 7142 #endif 7181 7143 } 7182 #if LOGI_INTRA_NAME_3MPM7183 7144 uiScanIdx = SCAN_ZIGZAG; 7184 7145 if (uiCTXIdx >4 && uiCTXIdx < 7) //if multiple scans supported for PU size … … 7186 7147 uiScanIdx = abs((Int) uiDirMode - VER_IDX) < 5 ? 1 : (abs((Int)uiDirMode - HOR_IDX) < 5 ? 2 : 0); 7187 7148 } 7188 #else7189 uiScanIdx = aucIntraDirToScanIdx[max<Int>(uiCTXIdx-1,0)][uiDirMode];7190 #endif7191 7149 } 7192 7150 … … 7680 7638 } 7681 7639 } 7682 #if LCU_SYNTAX_ALF7683 7640 rSGU.allBordersAvailable = true; 7684 7641 for(Int b=0; b< NUM_SGU_BORDER; b++) … … 7690 7647 } 7691 7648 } 7692 #endif7693 7649 7694 7650 } … … 7786 7742 } 7787 7743 7744 #if LGE_DMM3_SIMP_C0044 7745 Void TComDataCU::setWedgePredTexIntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ) 7746 { 7747 UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1); 7748 7749 for ( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) 7750 { 7751 m_puiWedgePredTexIntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; 7752 } 7753 } 7754 #endif 7755 7788 7756 Void TComDataCU::setWedgePredTexDeltaDC1SubParts( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth ) 7789 7757 { … … 7845 7813 memcpy( m_pePredMode + uiAbsPartIdxDst, pcCU->getPredictionMode() + uiAbsPartIdxSrc, sizeof( m_pePredMode[0] ) * uiNumPartition ); 7846 7814 memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc, sizeof( m_puhInterDir[0] ) * uiNumPartition ); 7815 7816 #if MERL_VSP_C0152 && MTK_UNCONSTRAINED_MVI_B0083 7817 memcpy( m_piVSPIndex + uiAbsPartIdxDst, pcCU->getVSPIndex() + uiAbsPartIdxSrc, sizeof( m_piVSPIndex[0] ) * uiNumPartition ); 7818 #endif 7847 7819 7848 7820 #if !MTK_UNCONSTRAINED_MVI_B0083 … … 7880 7852 // public functions for Multi-view tools 7881 7853 // ------------------------------------------------------------------------------------------------------------------- 7882 #if H HI_INTER_VIEW_MOTION_PRED7883 #if ! QC_MULTI_DIS_CAN_A00977854 #if H3D_IVMP 7855 #if !H3D_NBDV 7884 7856 Int 7885 7857 TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 7898 7870 return pcDepthMapGenerator->getPdmMvPred( this, uiPartIdx, eRefPicList, iRefIdx, rcMv, bMerge ); 7899 7871 } 7872 #else //H3D_NBDV 7873 #if QC_AMVP_MRG_UNIFY_IVCAN_C0051 7874 Bool 7875 TComDataCU::getUnifiedMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge ) 7876 { 7877 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7878 ROFRS( pcDepthMapGenerator, false ); 7879 if (pDInfo->iN > 0 && pcDepthMapGenerator->getPdmCandidate(this, uiPartIdx, eRefPicList, iRefIdx, paiPdmRefIdx, pacPdmMv, pDInfo, iPdm, bMerge)) 7880 return true; 7881 return false; 7882 } 7900 7883 #else 7901 7884 Int 7902 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 7903 #if QC_MRG_CANS_B0048 7904 , Int* iPdm 7905 #endif 7906 ) 7885 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm ) 7907 7886 { 7908 7887 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7909 7888 ROFRS( pcDepthMapGenerator, 0 ); 7910 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo 7911 #if QC_MRG_CANS_B0048 7912 , iPdm 7913 #endif 7914 ); 7889 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo, iPdm ); 7915 7890 } 7916 7891 Bool … … 7924 7899 } 7925 7900 #endif 7926 7901 #endif //H3D_NBDV 7927 7902 7928 7903 Bool … … 7935 7910 #endif 7936 7911 7937 #if H HI_INTER_VIEW_RESIDUAL_PRED7912 #if H3D_IVRP 7938 7913 Bool 7939 TComDataCU::getResidualSamples( UInt uiPartIdx, 7940 #if QC_SIMPLIFIEDIVRP_M24938 7941 Bool bRecon , 7942 #endif 7943 TComYuv* pcYuv ) 7914 TComDataCU::getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv ) 7944 7915 { 7945 7916 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 7946 7917 ROFRS( pcResidualGenerator, false ); 7947 #if QC_MULTI_DIS_CAN_A00977918 #if H3D_NBDV 7948 7919 DisInfo cDisInfo; 7949 7920 cDisInfo.iN = 0; 7950 7921 PartSize m_peSaved = getPartitionSize( 0 ); 7951 7922 m_pePartSize[0] = SIZE_2Nx2N; 7952 #if LGE_DVMCP_A0126 7953 #if QC_SIMPLE_NBDV_B0047 7954 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 7955 getDisMvpCand2( 0, 0, &cDisInfo, false); 7956 #else 7957 getDisMvpCand2( 0, 0, &cDisInfo); 7958 #endif 7959 #else 7960 getDisMvpCand2( 0, 0, &cDisInfo, true ); 7961 #endif 7962 #else 7963 getDisMvpCand ( 0, 0, &cDisInfo ); 7964 #endif 7923 getDisMvpCandNBDV( 0, 0, &cDisInfo, false ); 7965 7924 if( cDisInfo.iN == 0) 7966 7925 { … … 7970 7929 else 7971 7930 { 7972 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0].getHor() 7973 #if QC_SIMPLIFIEDIVRP_M24938 7974 , bRecon 7975 #endif 7976 ); 7931 #if MTK_RELEASE_DV_CONSTRAINT_C0129 7932 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0], bRecon ); 7933 #else 7934 Bool bAvailable = pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, cDisInfo.m_acMvCand[0].getHor(), bRecon ); 7935 #endif 7977 7936 m_pePartSize[0] = m_peSaved; 7978 7937 return bAvailable; 7979 7938 } 7980 7939 #else 7981 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv 7982 #if QC_SIMPLIFIEDIVRP_M24938 7983 , bRecon 7984 #endif 7985 ); 7940 return pcResidualGenerator->getResidualSamples( this, uiPartIdx, pcYuv, bRecon ); 7986 7941 #endif 7987 7942 }
Note: See TracChangeset for help on using the changeset viewer.