Changeset 189 in 3DVCSoftware for trunk/source/Lib/TLibCommon
- Timestamp:
- 18 Nov 2012, 22:11:37 (12 years ago)
- Location:
- trunk/source/Lib/TLibCommon
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/CommonDef.h
r127 r189 58 58 59 59 #define HM_VERSION "6.1" 60 #define NV_VERSION " 4.1" ///< Current software version60 #define NV_VERSION "5.0" ///< Current software version 61 61 62 62 // ==================================================================================================================== … … 139 139 #define PDM_NO_INTER_UPDATE 1 // no update for inter (but not inter-view) predicted blocks 140 140 #define PDM_MERGE_POS 0 // position of pdm in merge list (0..4) 141 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN 141 142 #if QC_MRG_CANS_B0048 143 #if OL_DISMV_POS_B0069 144 #define DMV_MERGE_POS 4 145 #else 146 #define DMV_MERGE_POS 1 147 #endif 148 #endif 149 150 #if SAIT_IMPROV_MOTION_PRED_M24829&!QC_MULTI_DIS_CAN_A0097 142 151 #define PDM_AMVP_POS 0 // position of pdm in amvp list (0..3) 143 152 #else -
trunk/source/Lib/TLibCommon/ContextTables.h
r100 r189 52 52 #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag 53 53 54 #if LGE_ILLUCOMP_B0045 55 #define NUM_IC_FLAG_CTX 3 ///< number of context models for illumination compensation flag 56 #endif 57 54 58 #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended 55 59 #if MRG_IDX_CTX_RED … … 152 156 #endif 153 157 154 #if LGE_EDGE_INTRA 158 #if LGE_EDGE_INTRA_A0070 155 159 #define NUM_EDGE_INTRA_CTX 1 156 160 #if LGE_EDGE_INTRA_DELTA_DC … … 159 163 #endif 160 164 165 #if RWTH_SDC_DLT_B0036 166 #define SDC_NUM_FLAG_CTX 3 167 #define SDC_NUM_RESIDUAL_FLAG_CTX 1 168 #define SDC_NUM_SIGN_FLAG_CTX 1 169 #define SDC_NUM_RESIDUAL_CTX 10 170 171 #define SDC_NUM_PRED_MODE_CTX 5 172 #endif 173 161 174 // ==================================================================================================================== 162 175 // Tables … … 180 193 { 197, 185, 201, }, 181 194 }; 195 196 #if LGE_ILLUCOMP_B0045 197 static const UChar 198 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] = 199 { 200 { CNU, CNU, CNU, }, 201 { 197, 185, 201, }, 202 { 197, 185, 201, }, 203 }; 204 #endif 182 205 183 206 static const UChar … … 1280 1303 }; 1281 1304 1282 #if LGE_EDGE_INTRA 1305 #if LGE_EDGE_INTRA_A0070 1283 1306 static const Short 1284 1307 INIT_EDGE_INTRA[3][NUM_EDGE_INTRA_CTX] = … … 1314 1337 #endif 1315 1338 1339 #if RWTH_SDC_DLT_B0036 1340 static const Short INIT_SDC_FLAG[3][SDC_NUM_FLAG_CTX][2] = 1341 { 1342 { 1343 { 0, 64 }, { 0, 64 }, { 0, 64 } 1344 }, 1345 { 1346 { 0, 64 }, { 0, 64 }, { 0, 64 } 1347 }, 1348 { 1349 { 0, 64 }, { 0, 64 }, { 0, 64 } 1350 } 1351 }; 1352 1353 static const Short INIT_SDC_RESIDUAL_FLAG[3][3*SDC_NUM_RESIDUAL_FLAG_CTX][2] = 1354 { 1355 { 1356 { -5, 35 }, 1357 { -0, 56 }, 1358 { -0, 56 } 1359 1360 }, 1361 { 1362 { -5, 35 }, 1363 { -0, 56 }, 1364 { -0, 56 } 1365 }, 1366 { 1367 { -5, 35 }, 1368 { -0, 56 }, 1369 { -0, 56 } 1370 } 1371 }; 1372 1373 static const Short INIT_SDC_SIGN_FLAG[3][3*SDC_NUM_SIGN_FLAG_CTX][2] = 1374 { 1375 { 1376 { -1, 56 }, 1377 { -4, 55 }, 1378 { -4, 55 } 1379 }, 1380 { 1381 { -1, 56 }, 1382 { -4, 55 }, 1383 { -4, 55 } 1384 }, 1385 { 1386 { -1, 56 }, 1387 { -4, 55 }, 1388 { -4, 55 } 1389 } 1390 }; 1391 1392 static const Short INIT_SDC_RESIDUAL[3][3*SDC_NUM_RESIDUAL_CTX][2] = 1393 { 1394 { 1395 { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, 1396 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, 1397 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } 1398 }, 1399 { 1400 { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, 1401 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, 1402 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } 1403 }, 1404 { 1405 { -1, 64 }, { 2, 64 }, { 6, 67 }, { 8, 61 }, { 7, 47 }, { 10, 33 }, { 12, 14 }, { 33, -13 }, { 12, 14 }, { 33, -13 }, 1406 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 }, 1407 { 2, 66 }, { -0, 63 }, { 1, 64 }, { 6, 65 }, { 7, 59 }, { 12, 50 }, { 14, 27 }, { -0, -17 }, { 14, 27 }, { -0, -17 } 1408 } 1409 }; 1410 1411 static const Short INIT_SDC_PRED_MODE[3][3*SDC_NUM_PRED_MODE_CTX][2] = 1412 { 1413 { 1414 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1415 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1416 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } 1417 }, 1418 { 1419 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1420 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1421 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } 1422 }, 1423 { 1424 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1425 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 }, 1426 { 9, 85 }, { -4, 60 }, { 4, 70 }, { 4, 70 }, { 4, 70 } 1427 } 1428 }; 1429 #endif 1430 1316 1431 //! \} 1317 1432 -
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r124 r189 75 75 m_phQP = NULL; 76 76 m_pbMergeFlag = NULL; 77 #if LGE_ILLUCOMP_B0045 78 m_pbICFlag = NULL; 79 #endif 77 80 m_puhMergeIndex = NULL; 78 81 m_puhLumaIntraDir = NULL; … … 90 93 m_pcTrCoeffCr = NULL; 91 94 #if ADAPTIVE_QP_SELECTION 92 #if FIX_MEM_LEAKS93 95 m_ArlCoeffIsAliasedAllocation = false; 94 96 m_pcArlCoeffY = NULL; … … 96 98 m_pcArlCoeffCr = NULL; 97 99 #endif 98 #endif99 100 100 101 m_pbIPCMFlag = NULL; … … 144 145 m_pbResPredFlag = NULL; 145 146 #endif 146 #if LGE_EDGE_INTRA 147 #if LGE_EDGE_INTRA_A0070 147 148 m_pucEdgeCode = NULL; 148 149 m_pucEdgeNumber = NULL; … … 155 156 #endif 156 157 #endif 157 #if OL_DEPTHLIMIT_A0044 158 //add a variable to store the partition information 159 //a 2D array in part_symbol, uidepth format 160 //initialize m_partInfo to OL_END_CU 161 for (Int i=0; i < OL_PART_BUF_SIZE; i++) 162 { 163 for (Int j=0; j < 2; j++) 164 { 165 m_uiPartInfo[i][j] = OL_END_CU; 166 } 167 } 158 #if RWTH_SDC_DLT_B0036 159 m_pbSDCFlag = NULL; 160 m_apSegmentDCOffset[0] = NULL; 161 m_apSegmentDCOffset[1] = NULL; 168 162 #endif 169 163 } … … 206 200 m_pePredMode = new Char[ uiNumPartition ]; 207 201 202 #if RWTH_SDC_DLT_B0036 203 m_pbSDCFlag = (Bool* )xMalloc(Bool, uiNumPartition); 204 m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition); 205 m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition); 206 #endif 207 208 208 m_puiAlfCtrlFlag = new Bool[ uiNumPartition ]; 209 209 210 210 m_pbMergeFlag = (Bool* )xMalloc(Bool, uiNumPartition); 211 #if LGE_ILLUCOMP_B0045 212 m_pbICFlag = (Bool* )xMalloc(Bool, uiNumPartition); 213 #endif 211 214 m_puhMergeIndex = (UChar* )xMalloc(UChar, uiNumPartition); 212 215 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 250 253 m_pcArlCoeffCb = m_pcGlbArlCoeffCb; 251 254 m_pcArlCoeffCr = m_pcGlbArlCoeffCr; 252 #if FIX_MEM_LEAKS253 255 m_ArlCoeffIsAliasedAllocation = true; 254 #endif255 256 } 256 257 else … … 288 289 m_piContourPredTexDeltaDC2 = (Int* )xMalloc(Int, uiNumPartition); 289 290 #endif 290 #if LGE_EDGE_INTRA 291 #if LGE_EDGE_INTRA_A0070 291 292 m_pucEdgeCode = (UChar*)xMalloc(UChar, uiNumPartition * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4); 292 293 m_pucEdgeNumber = (UChar*)xMalloc(UChar, uiNumPartition); … … 349 350 #endif 350 351 if ( m_pePredMode ) { delete[] m_pePredMode; m_pePredMode = NULL; } 352 #if RWTH_SDC_DLT_B0036 353 if ( m_pbSDCFlag ) { xFree(m_pbSDCFlag); m_pbSDCFlag = NULL; } 354 if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]); m_apSegmentDCOffset[0] = NULL; } 355 if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]); m_apSegmentDCOffset[1] = NULL; } 356 #endif 351 357 if ( m_puhCbf[0] ) { xFree(m_puhCbf[0]); m_puhCbf[0] = NULL; } 352 358 if ( m_puhCbf[1] ) { xFree(m_puhCbf[1]); m_puhCbf[1] = NULL; } … … 355 361 if ( m_puhInterDir ) { xFree(m_puhInterDir); m_puhInterDir = NULL; } 356 362 if ( m_pbMergeFlag ) { xFree(m_pbMergeFlag); m_pbMergeFlag = NULL; } 363 #if LGE_ILLUCOMP_B0045 364 if ( m_pbICFlag ) { xFree(m_pbICFlag); m_pbICFlag = NULL; } 365 #endif 357 366 if ( m_puhMergeIndex ) { xFree(m_puhMergeIndex); m_puhMergeIndex = NULL; } 358 367 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 368 377 if ( m_pcTrCoeffCr ) { xFree(m_pcTrCoeffCr); m_pcTrCoeffCr = NULL; } 369 378 #if ADAPTIVE_QP_SELECTION 370 #if FIX_MEM_LEAKS371 379 if (!m_ArlCoeffIsAliasedAllocation) 372 380 { … … 375 383 xFree(m_pcArlCoeffCr); m_pcArlCoeffCr = 0; 376 384 } 377 #endif378 385 if ( m_pcGlbArlCoeffY ) { xFree(m_pcGlbArlCoeffY); m_pcGlbArlCoeffY = NULL; } 379 386 if ( m_pcGlbArlCoeffCb ) { xFree(m_pcGlbArlCoeffCb); m_pcGlbArlCoeffCb = NULL; } … … 407 414 if ( m_piContourPredTexDeltaDC2 ) { xFree(m_piContourPredTexDeltaDC2); m_piContourPredTexDeltaDC2 = NULL; } 408 415 #endif 409 #if LGE_EDGE_INTRA 416 #if LGE_EDGE_INTRA_A0070 410 417 if ( m_pbEdgeLeftFirst ) { xFree(m_pbEdgeLeftFirst); m_pbEdgeLeftFirst = NULL; } 411 418 if ( m_pucEdgeStartPos ) { xFree(m_pucEdgeStartPos); m_pucEdgeStartPos = NULL; } … … 482 489 Void TComDataCU::initCU( TComPic* pcPic, UInt iCUAddr ) 483 490 { 484 #if OL_DEPTHLIMIT_A0044485 TComDataCU* pcCU = pcPic->getCU(iCUAddr);486 #endif487 488 491 m_pcPic = pcPic; 489 492 m_pcSlice = pcPic->getSlice(pcPic->getCurrSliceIdx()); … … 537 540 m_piTextureModeDepth[ui] = pcFrom->getTextureModeDepth(ui); 538 541 #endif 542 #if RWTH_SDC_DLT_B0036 543 m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui); 544 #endif 539 545 m_puhWidth [ui] = pcFrom->getWidth(ui); 540 546 m_puhHeight [ui] = pcFrom->getHeight(ui); … … 548 554 m_puiAlfCtrlFlag[ui]=pcFrom->m_puiAlfCtrlFlag[ui]; 549 555 m_pbMergeFlag[ui]=pcFrom->m_pbMergeFlag[ui]; 556 #if LGE_ILLUCOMP_B0045 557 m_pbICFlag[ui]=pcFrom->m_pbICFlag[ui]; 558 #endif 550 559 m_puhMergeIndex[ui]=pcFrom->m_puhMergeIndex[ui]; 551 560 m_puhLumaIntraDir[ui]=pcFrom->m_puhLumaIntraDir[ui]; … … 568 577 #if HHI_MPI 569 578 memset( m_piTextureModeDepth+ firstElement,-1, numElements * sizeof( *m_piTextureModeDepth ) ); 579 #endif 580 #if RWTH_SDC_DLT_B0036 581 memset( m_pbSDCFlag + firstElement, 0, numElements * sizeof( *m_pbSDCFlag ) ); 582 memset( m_apSegmentDCOffset[0] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[0] ) ); 583 memset( m_apSegmentDCOffset[1] + firstElement, 0, numElements * sizeof( *m_apSegmentDCOffset[1] ) ); 570 584 #endif 571 585 memset( m_puhTrIdx + firstElement, 0, numElements * sizeof( *m_puhTrIdx ) ); … … 580 594 memset( m_puiAlfCtrlFlag + firstElement, false, numElements * sizeof( *m_puiAlfCtrlFlag ) ); 581 595 memset( m_pbMergeFlag + firstElement, false, numElements * sizeof( *m_pbMergeFlag ) ); 596 #if LGE_ILLUCOMP_B0045 597 memset( m_pbICFlag + firstElement, false, numElements * sizeof( *m_pbICFlag ) ); 598 #endif 582 599 memset( m_puhMergeIndex + firstElement, 0, numElements * sizeof( *m_puhMergeIndex ) ); 583 600 memset( m_puhLumaIntraDir + firstElement, 2, numElements * sizeof( *m_puhLumaIntraDir ) ); … … 701 718 m_apcCUColocated[1] = getSlice()->getRefPic( REF_PIC_LIST_1, 0)->getCU( m_uiCUAddr ); 702 719 } 703 #if OL_DEPTHLIMIT_A0044704 setPartDumpFlag (pcCU->getPartDumpFlag());705 #endif706 720 } 707 721 … … 763 777 m_puiAlfCtrlFlag[ui]= false; 764 778 m_pbMergeFlag[ui] = 0; 779 #if LGE_ILLUCOMP_B0045 780 m_pbICFlag[ui] = false; 781 #endif 765 782 m_puhMergeIndex[ui] = 0; 766 783 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 792 809 m_piContourPredTexDeltaDC2[ui] = 0; 793 810 #endif 811 #if RWTH_SDC_DLT_B0036 812 m_pbSDCFlag[ui] = false; 813 m_apSegmentDCOffset[0][ui] = 0; 814 m_apSegmentDCOffset[1][ui] = 0; 815 #endif 794 816 } 795 817 } … … 864 886 memset( m_puiAlfCtrlFlag, 0, iSizeInBool ); 865 887 memset( m_pbMergeFlag, 0, iSizeInBool ); 888 #if LGE_ILLUCOMP_B0045 889 memset( m_pbICFlag, 0, iSizeInBool ); 890 #endif 866 891 #if HHI_INTERVIEW_SKIP 867 892 memset( m_pbRenderable, 0, iSizeInBool ); … … 901 926 memset( m_piContourPredTexDeltaDC1, 0, sizeof( Int ) * m_uiNumPartition ); 902 927 memset( m_piContourPredTexDeltaDC2, 0, sizeof( Int ) * m_uiNumPartition ); 903 #endif 928 #endif 929 #if RWTH_SDC_DLT_B0036 930 memset( m_pbSDCFlag, 0, sizeof(Bool) * m_uiNumPartition ); 931 memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition); 932 memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition); 933 #endif 904 934 905 935 UChar uhWidth = g_uiMaxCUWidth >> uiDepth; … … 939 969 m_puiAlfCtrlFlag[ui]=pcCU->m_puiAlfCtrlFlag[uiPartOffset+ui]; 940 970 m_pbMergeFlag[ui]=pcCU->m_pbMergeFlag[uiPartOffset+ui]; 971 #if LGE_ILLUCOMP_B0045 972 m_pbICFlag[ui]=pcCU->m_pbICFlag[uiPartOffset+ui]; 973 #endif 941 974 m_puhMergeIndex[ui]=pcCU->m_puhMergeIndex[uiPartOffset+ui]; 942 975 m_puhLumaIntraDir[ui]=pcCU->m_puhLumaIntraDir[uiPartOffset+ui]; … … 968 1001 m_pbResPredAvailable[ui] = pcCU->m_pbResPredAvailable[ uiPartOffset + ui ]; 969 1002 m_pbResPredFlag [ui] = pcCU->m_pbResPredFlag [ uiPartOffset + ui ]; 1003 #endif 1004 #if RWTH_SDC_DLT_B0036 1005 m_pbSDCFlag [ui] = pcCU->m_pbSDCFlag [ uiPartOffset + ui ]; 1006 m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0][ uiPartOffset + ui ]; 1007 m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1][ uiPartOffset + ui ]; 970 1008 #endif 971 1009 } … … 1033 1071 memcpy(m_uiSliceStartCU,pcCU->m_uiSliceStartCU+uiPartOffset,sizeof(UInt)*m_uiNumPartition); 1034 1072 memcpy(m_uiEntropySliceStartCU,pcCU->m_uiEntropySliceStartCU+uiPartOffset,sizeof(UInt)*m_uiNumPartition); 1035 #if OL_DEPTHLIMIT_A00441036 setPartDumpFlag (pcCU->getPartDumpFlag());1037 #endif1038 1073 } 1039 1074 … … 1078 1113 1079 1114 m_pbMergeFlag = pcCU->getMergeFlag() + uiPart; 1115 #if LGE_ILLUCOMP_B0045 1116 m_pbICFlag = pcCU->getICFlag() + uiPart; 1117 #endif 1080 1118 m_puhMergeIndex = pcCU->getMergeIndex() + uiPart; 1081 1119 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1161 1199 m_piContourPredTexDeltaDC2 = pcCU->getContourPredTexDeltaDC2() + uiPart; 1162 1200 #endif 1163 #if LGE_EDGE_INTRA 1201 #if LGE_EDGE_INTRA_A0070 1164 1202 if( pcCU->getSlice()->getSPS()->isDepth() ) 1165 1203 { … … 1175 1213 } 1176 1214 #endif 1215 #if RWTH_SDC_DLT_B0036 1216 m_pbSDCFlag = pcCU->getSDCFlag() + uiPart; 1217 m_apSegmentDCOffset[0] = pcCU->getSDCSegmentDCOffset(0) + uiPart; 1218 m_apSegmentDCOffset[1] = pcCU->getSDCSegmentDCOffset(1) + uiPart; 1219 #endif 1177 1220 } 1178 1221 … … 1210 1253 1211 1254 m_pbMergeFlag = pcCU->getMergeFlag() + uiAbsPartIdx; 1255 #if LGE_ILLUCOMP_B0045 1256 m_pbICFlag = pcCU->getICFlag() + uiAbsPartIdx; 1257 #endif 1212 1258 m_puhMergeIndex = pcCU->getMergeIndex() + uiAbsPartIdx; 1213 1259 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1256 1302 memcpy( m_puiAlfCtrlFlag + uiOffset, pcCU->getAlfCtrlFlag(), iSizeInBool ); 1257 1303 memcpy( m_pbMergeFlag + uiOffset, pcCU->getMergeFlag(), iSizeInBool ); 1304 #if LGE_ILLUCOMP_B0045 1305 memcpy( m_pbICFlag + uiOffset, pcCU->getICFlag(), iSizeInBool ); 1306 #endif 1258 1307 memcpy( m_puhMergeIndex + uiOffset, pcCU->getMergeIndex(), iSizeInUchar ); 1259 1308 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1333 1382 #endif 1334 1383 1335 #if LGE_EDGE_INTRA 1384 #if LGE_EDGE_INTRA_A0070 1336 1385 if( getSlice()->getSPS()->isDepth() ) 1337 1386 { … … 1351 1400 memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), sizeof( Int ) * uiNumPartition ); 1352 1401 #endif 1402 #if RWTH_SDC_DLT_B0036 1403 memcpy( m_pbSDCFlag + uiOffset, pcCU->getSDCFlag(), iSizeInBool ); 1404 memcpy( m_apSegmentDCOffset[0] + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition); 1405 memcpy( m_apSegmentDCOffset[1] + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition); 1406 #endif 1353 1407 } 1354 1408 … … 1382 1436 1383 1437 memcpy( rpcCU->getMergeFlag() + m_uiAbsIdxInLCU, m_pbMergeFlag, iSizeInBool ); 1438 #if LGE_ILLUCOMP_B0045 1439 memcpy( rpcCU->getICFlag() + m_uiAbsIdxInLCU, m_pbICFlag, iSizeInBool ); 1440 #endif 1384 1441 memcpy( rpcCU->getMergeIndex() + m_uiAbsIdxInLCU, m_puhMergeIndex, iSizeInUchar ); 1385 1442 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1451 1508 #endif 1452 1509 1453 #if LGE_EDGE_INTRA 1510 #if LGE_EDGE_INTRA_A0070 1454 1511 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1455 1512 { … … 1469 1526 memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, sizeof( Int ) * m_uiNumPartition ); 1470 1527 #endif 1528 #if RWTH_SDC_DLT_B0036 1529 memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag, iSizeInBool ); 1530 memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition); 1531 memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition); 1532 #endif 1471 1533 } 1472 1534 … … 1500 1562 memcpy( rpcCU->getAlfCtrlFlag() + uiPartOffset, m_puiAlfCtrlFlag, iSizeInBool ); 1501 1563 memcpy( rpcCU->getMergeFlag() + uiPartOffset, m_pbMergeFlag, iSizeInBool ); 1564 #if LGE_ILLUCOMP_B0045 1565 memcpy( rpcCU->getICFlag() + uiPartOffset, m_pbICFlag, iSizeInBool ); 1566 #endif 1502 1567 memcpy( rpcCU->getMergeIndex() + uiPartOffset, m_puhMergeIndex, iSizeInUchar ); 1503 1568 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1570 1635 #endif 1571 1636 1572 #if LGE_EDGE_INTRA 1637 #if LGE_EDGE_INTRA_A0070 1573 1638 if( rpcCU->getSlice()->getSPS()->isDepth() ) 1574 1639 { … … 1587 1652 #if HHI_MPI 1588 1653 memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, sizeof( Int ) * uiQNumPart ); 1654 #endif 1655 #if RWTH_SDC_DLT_B0036 1656 memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag, iSizeInBool ); 1657 memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart); 1658 memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart); 1589 1659 #endif 1590 1660 } … … 2321 2391 #if H0204_QP_PREDICTION 2322 2392 UInt lPartIdx, aPartIdx; 2323 #if FIX_COMP_WARNING_INIT2324 2393 lPartIdx = 0; 2325 2394 aPartIdx = 0; 2326 #endif2327 2395 TComDataCU* cULeft = getQpMinCuLeft ( lPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU ); 2328 2396 TComDataCU* cUAbove = getQpMinCuAbove( aPartIdx, m_uiAbsIdxInLCU + uiCurrAbsIdxInLCU ); … … 2466 2534 mapDMMtoIntraMode( iLeftIntraDir ); 2467 2535 #endif 2468 #if LGE_EDGE_INTRA 2536 #if LGE_EDGE_INTRA_A0070 2469 2537 mapEdgeIntratoDC( iLeftIntraDir ); 2470 2538 #endif … … 2481 2549 mapDMMtoIntraMode( iAboveIntraDir ); 2482 2550 #endif 2483 #if LGE_EDGE_INTRA 2551 #if LGE_EDGE_INTRA_A0070 2484 2552 mapEdgeIntratoDC( iAboveIntraDir ); 2485 2553 #endif … … 2567 2635 } 2568 2636 2569 #if LGE_EDGE_INTRA 2637 #if LGE_EDGE_INTRA_A0070 2570 2638 UInt TComDataCU::getCtxEdgeIntra( UInt uiAbsPartIdx ) 2571 2639 { … … 2678 2746 return uiCtx; 2679 2747 } 2748 2749 #if LGE_ILLUCOMP_B0045 2750 UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx ) 2751 { 2752 UInt uiCtx = 0; 2753 2754 return uiCtx; 2755 } 2756 #endif 2680 2757 2681 2758 UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx ) … … 2908 2985 } 2909 2986 2987 #if RWTH_SDC_DLT_B0036 2988 Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2989 { 2990 setSubPart( bSDCFlag, m_pbSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx ); 2991 } 2992 2993 UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx ) 2994 { 2995 TComDataCU* pcTempCU; 2996 UInt uiTempPartIdx; 2997 UInt uiCtx = 0; 2998 2999 // left PU 3000 pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false ); 3001 uiCtx = ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0; 3002 3003 // above PU 3004 pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false ); 3005 uiCtx += ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0; 3006 3007 return uiCtx; 3008 } 3009 3010 Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx ) 3011 { 3012 if( !getSlice()->getSPS()->isDepth() || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N ) 3013 return false; 3014 3015 UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 3016 3017 if(!isIntra(uiAbsPartIdx)) 3018 return false; 3019 3020 for(UInt ui=0; ui<RWTH_SDC_NUM_PRED_MODES; ui++) 3021 { 3022 if( g_auiSDCPredModes[ui] == uiLumaPredMode ) 3023 return true; 3024 } 3025 // else 3026 return false; 3027 } 3028 #endif 3029 2910 3030 Void TComDataCU::setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 2911 3031 { … … 2936 3056 setSubPart<UChar>( uiDir, m_puhInterDir, uiAbsPartIdx, uiDepth, uiPartIdx ); 2937 3057 } 3058 3059 #if LGE_ILLUCOMP_B0045 3060 Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 3061 { 3062 memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) ); 3063 } 3064 3065 Bool TComDataCU::isICFlagRequired(UInt uiAbsPartIdx) 3066 { 3067 UInt uiPartAddr; 3068 UInt iNumbPart; 3069 Int iWidth, iHeight; 3070 3071 UInt uiPartMode = getPartitionSize(uiAbsPartIdx); 3072 3073 iNumbPart = (uiPartMode == SIZE_2Nx2N ? 1 : (uiPartMode == SIZE_NxN ? 4 : 2) ); 3074 3075 for(UInt i = 0; i < iNumbPart; i++) 3076 { 3077 getPartIndexAndSize(i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true); 3078 uiPartAddr += uiAbsPartIdx; 3079 3080 for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++) 3081 { 3082 RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 3083 Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr); 3084 3085 if((getInterDir(uiPartAddr) & (uiRefIdx+1)) && iBestRefIdx >= 0 && getSlice()->getViewId() != getSlice()->getRefViewId(eRefList, iBestRefIdx)) 3086 { 3087 return true; 3088 } 3089 } 3090 } 3091 return false; 3092 } 3093 #endif 2938 3094 2939 3095 Void TComDataCU::setMVPIdxSubParts( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) … … 3500 3656 3501 3657 //===== add merge with predicted depth maps ===== 3658 #if QC_MRG_CANS_B0048 3659 TComMv acPdmMv [4]; 3660 Int aiPdmRefIdx [4] = {-1, -1, -1, -1}; 3661 Bool bLeftAvai = false; 3662 #if OL_DISMV_POS_B0069 3663 Int iPosLeftAbove[2] = {-1, -1}; 3664 #endif 3665 #else 3502 3666 TComMv acPdmMv [2]; 3503 3667 Int aiPdmRefIdx [2] = {-1, -1}; 3504 3505 #if LGE_DVMCP 3668 #endif 3669 3670 #if LGE_DVMCP_A0126 3671 #if QC_MRG_CANS_B0048 3672 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = acPdmMv[2].m_bDvMcp = acPdmMv[3].m_bDvMcp = false; 3673 #else 3506 3674 acPdmMv[0].m_bDvMcp = acPdmMv[1].m_bDvMcp = false; 3507 3675 #endif 3508 3509 #if QC_MULTI_DIS_CAN 3676 #endif 3677 3678 #if QC_MULTI_DIS_CAN_A0097 3510 3679 DisInfo cDisInfo; 3511 3680 cDisInfo.iN = 0; 3512 3681 if(!bNoPdmMerge) 3513 3682 { 3514 #if LGE_DVMCP 3515 getDisMvpCand2(uiPUIdx, uiAbsPartIdx, &cDisInfo, true ); 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 3691 #endif 3692 ); 3693 #endif 3516 3694 #else 3517 3695 getDisMvpCand (uiPUIdx, uiAbsPartIdx, &cDisInfo ); … … 3525 3703 cDisInfo.m_aVIdxCan[0] = 0; 3526 3704 } 3527 Int iPdmInterDir = cDisInfo.iN==0? 0:getPdmMergeCandidateDisCan ( uiPUIdx, aiPdmRefIdx, acPdmMv, &cDisInfo ); 3705 #if QC_MRG_CANS_B0048 3706 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 ); 3528 3713 #else 3529 3714 Int iPdmInterDir = getPdmMergeCandidate( uiPUIdx, aiPdmRefIdx, acPdmMv ); 3530 3715 #endif 3531 3716 #if QC_MRG_CANS_B0048 3717 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 0 ) 3718 #else 3532 3719 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 0 ) 3720 #endif 3533 3721 { 3534 3722 abCandIsInter [ iCount ] = true; 3723 #if QC_MRG_CANS_B0048 3724 puhInterDirNeighbours[ iCount ] = iPdmDir[0]; 3725 iPdmInterDir = iPdmDir[0]; 3726 #else 3535 3727 puhInterDirNeighbours[ iCount ] = iPdmInterDir; 3728 #endif 3536 3729 if( ( iPdmInterDir & 1 ) == 1 ) 3537 3730 { 3538 3731 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3539 3732 } 3733 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3734 else 3735 { 3736 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 3737 } 3738 #endif 3540 3739 if( ( iPdmInterDir & 2 ) == 2 ) 3541 3740 { 3542 3741 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3543 3742 } 3743 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3744 else 3745 { 3746 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3747 } 3748 #endif 3544 3749 #if SIMP_MRG_PRUN 3545 3750 if ( mrgCandIdx == iCount ) … … 3552 3757 #endif 3553 3758 3759 #if QC_MRG_CANS_B0048 3760 if(extraMergeCand) 3761 { 3762 if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 1) 3763 { 3764 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 3765 abCandIsInter [ iCount ] = true; 3766 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; 3767 if( ( iPdmDir[1] & 1 ) == 1 ) 3768 { 3769 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] ); 3770 } 3771 if( ( iPdmDir[1] & 2 ) == 2 ) 3772 { 3773 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] ); 3774 } 3775 #if LGE_DVMCP_A0126 3776 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3777 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 3778 #endif 3779 #if SIMP_MRG_PRUN 3780 if ( mrgCandIdx == iCount ) 3781 return; 3782 #endif 3783 iCount ++; 3784 } 3785 } 3786 #endif 3554 3787 //left 3555 3788 UInt uiLeftPartIdx = 0; … … 3583 3816 pcCULeft->getMvField( pcCULeft, uiLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3584 3817 } 3585 #if LGE_DVMCP 3818 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3819 else 3820 { 3821 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3822 } 3823 #endif 3824 #if QC_MRG_CANS_B0048 3825 Bool bRemoveSpa = false; //prunign to inter-view candidates 3826 Int iCnloop = iCount - 1; 3827 for(; iCnloop >= 0; iCnloop --) 3828 { 3829 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3830 { 3831 bRemoveSpa = true; 3832 abCandIsInter [ iCount ] = false; 3833 } 3834 } 3835 if(!bRemoveSpa) 3836 { 3837 bLeftAvai = true; 3838 #if OL_DISMV_POS_B0069 3839 iPosLeftAbove[0] = iCount; 3840 #endif 3841 #endif 3842 #if LGE_DVMCP_A0126 3586 3843 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3587 3844 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3594 3851 #endif 3595 3852 iCount ++; 3853 #if QC_MRG_CANS_B0048 3854 } 3855 #endif 3596 3856 } 3597 3857 } 3598 3858 3599 3859 #if HHI_INTER_VIEW_MOTION_PRED 3860 #if QC_MRG_CANS_B0048 3861 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3862 #else 3600 3863 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 1 ) 3864 #endif 3601 3865 { 3602 3866 abCandIsInter [ iCount ] = true; … … 3606 3870 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3607 3871 } 3872 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3873 else 3874 { 3875 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 3876 } 3877 #endif 3608 3878 if( ( iPdmInterDir & 2 ) == 2 ) 3609 3879 { 3610 3880 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3611 3881 } 3882 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3883 else 3884 { 3885 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3886 } 3887 #endif 3612 3888 #if SIMP_MRG_PRUN 3613 3889 if ( mrgCandIdx == iCount ) … … 3659 3935 pcCUAbove->getMvField( pcCUAbove, uiAbovePartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3660 3936 } 3661 #if LGE_DVMCP 3937 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3938 else 3939 { 3940 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 3941 } 3942 #endif 3943 #if QC_MRG_CANS_B0048 3944 Bool bRemoveSpa = false; //prunign to inter-view candidates 3945 Int iCnloop = bLeftAvai? (iCount-2): (iCount-1); 3946 for(; iCnloop >= 0; iCnloop --) 3947 { 3948 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 3949 { 3950 bRemoveSpa = true; 3951 abCandIsInter [ iCount ] = false; 3952 } 3953 } 3954 if(!bRemoveSpa) 3955 { 3956 #if OL_DISMV_POS_B0069 3957 iPosLeftAbove[1] = iCount; 3958 #endif 3959 #endif 3960 #if LGE_DVMCP_A0126 3662 3961 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3663 3962 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3670 3969 #endif 3671 3970 iCount ++; 3971 #if QC_MRG_CANS_B0048 3972 } 3973 #endif 3672 3974 } 3673 3975 #if !SIMP_MRG_PRUN … … 3676 3978 3677 3979 #if HHI_INTER_VIEW_MOTION_PRED 3980 #if QC_MRG_CANS_B0048 3981 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 2 ) 3982 #else 3678 3983 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 2 ) 3984 #endif 3679 3985 { 3680 3986 abCandIsInter [ iCount ] = true; … … 3684 3990 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3685 3991 } 3992 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 3993 else 3994 { 3995 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 3996 } 3997 #endif 3686 3998 if( ( iPdmInterDir & 2 ) == 2 ) 3687 3999 { 3688 4000 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3689 4001 } 4002 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4003 else 4004 { 4005 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4006 } 4007 #endif 3690 4008 #if SIMP_MRG_PRUN 3691 4009 if ( mrgCandIdx == iCount ) … … 3730 4048 pcCUAboveRight->getMvField( pcCUAboveRight, uiAboveRightPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3731 4049 } 3732 #if LGE_DVMCP 4050 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4051 else 4052 { 4053 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4054 } 4055 #endif 4056 #if LGE_DVMCP_A0126 3733 4057 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3734 4058 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3744 4068 3745 4069 #if HHI_INTER_VIEW_MOTION_PRED 4070 #if QC_MRG_CANS_B0048 4071 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 3 ) 4072 #else 3746 4073 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 3 ) 4074 #endif 3747 4075 { 3748 4076 abCandIsInter [ iCount ] = true; … … 3752 4080 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3753 4081 } 4082 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4083 else 4084 { 4085 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 4086 } 4087 #endif 3754 4088 if( ( iPdmInterDir & 2 ) == 2 ) 3755 4089 { 3756 4090 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3757 4091 } 4092 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4093 else 4094 { 4095 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4096 } 4097 #endif 3758 4098 #if SIMP_MRG_PRUN 3759 4099 if ( mrgCandIdx == iCount ) … … 3766 4106 #endif 3767 4107 4108 #if OL_DISMV_POS_B0069 4109 if(extraMergeCand) 4110 { 4111 if(!bNoPdmMerge && iPdmDir[1] && DMV_MERGE_POS == 4) 4112 { 4113 assert(iCount < MRG_MAX_NUM_CANDS_MEM); 4114 Bool bRemoveSpa = false; //prunign to A1, B1 4115 abCandIsInter [ iCount ] = true; 4116 puhInterDirNeighbours[ iCount ] = iPdmDir[1]; 4117 if( ( iPdmDir[1] & 1 ) == 1 ) 4118 { 4119 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 2 ], aiPdmRefIdx[ 2 ] ); 4120 } 4121 if( ( iPdmDir[1] & 2 ) == 2 ) 4122 { 4123 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 3 ], aiPdmRefIdx[ 3 ] ); 4124 } 4125 for(Int i = 0; i < 2; i ++) 4126 { 4127 Int iCnloop = iPosLeftAbove[i]; 4128 if(iCnloop == -1) 4129 continue; 4130 if(puhInterDirNeighbours[iCount] == puhInterDirNeighbours[iCnloop] && pcMvFieldNeighbours[iCnloop<<1]==pcMvFieldNeighbours[(iCount<<1)] && pcMvFieldNeighbours[(iCnloop<<1)+1]==pcMvFieldNeighbours[(iCount<<1)+1]) 4131 { 4132 bRemoveSpa = true; 4133 abCandIsInter [ iCount ] = false; 4134 } 4135 } 4136 if(!bRemoveSpa) 4137 { 4138 #if LGE_DVMCP_A0126 4139 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 4140 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; 4141 #endif 4142 #if SIMP_MRG_PRUN 4143 if ( mrgCandIdx == iCount ) 4144 return; 4145 #endif 4146 iCount ++; 4147 } 4148 } 4149 } 4150 #endif 3768 4151 //left bottom 3769 4152 UInt uiLeftBottomPartIdx = 0; … … 3798 4181 pcCULeftBottom->getMvField( pcCULeftBottom, uiLeftBottomPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3799 4182 } 3800 #if LGE_DVMCP 4183 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4184 else 4185 { 4186 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4187 } 4188 #endif 4189 #if LGE_DVMCP_A0126 3801 4190 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3802 4191 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3812 4201 3813 4202 #if HHI_INTER_VIEW_MOTION_PRED 4203 #if QC_MRG_CANS_B0048 4204 if( iPdmDir[0] && !bNoPdmMerge && PDM_MERGE_POS == 4 ) 4205 #else 3814 4206 if( iPdmInterDir && !bNoPdmMerge && PDM_MERGE_POS == 4 ) 4207 #endif 3815 4208 { 3816 4209 abCandIsInter [ iCount ] = true; … … 3820 4213 pcMvFieldNeighbours[ iCount<<1 ].setMvField( acPdmMv[ 0 ], aiPdmRefIdx[ 0 ] ); 3821 4214 } 4215 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4216 else 4217 { 4218 pcMvFieldNeighbours[ iCount<<1 ].setMvField( TComMv(0,0), NOT_VALID ); 4219 } 4220 #endif 3822 4221 if( ( iPdmInterDir & 2 ) == 2 ) 3823 4222 { 3824 4223 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( acPdmMv[ 1 ], aiPdmRefIdx[ 1 ] ); 3825 4224 } 4225 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4226 else 4227 { 4228 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4229 } 4230 #endif 3826 4231 #if SIMP_MRG_PRUN 3827 4232 if ( mrgCandIdx == iCount ) … … 3875 4280 pcCUAboveLeft->getMvField( pcCUAboveLeft, uiAboveLeftPartIdx, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] ); 3876 4281 } 3877 #if LGE_DVMCP 4282 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4283 else 4284 { 4285 pcMvFieldNeighbours[(iCount<<1)+1 ].setMvField( TComMv(0,0), NOT_VALID ); 4286 } 4287 #endif 4288 #if LGE_DVMCP_A0126 3878 4289 pcMvFieldNeighbours[iCount<<1 ].getMv().m_bDvMcp = false; 3879 4290 pcMvFieldNeighbours[(iCount<<1)+1].getMv().m_bDvMcp = false; … … 3889 4300 } 3890 4301 3891 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 4302 if ( getSlice()->getPPS()->getEnableTMVPFlag() 4303 #if QC_MRG_CANS_B0048 4304 && iCount < (MRG_MAX_NUM_CANDS_SIGNALED + extraMergeCand) 4305 #endif 4306 ) 3892 4307 { 3893 4308 // col [2] … … 3989 4404 { 3990 4405 puhInterDirNeighbours[uiArrayAddr] = 1; 4406 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4407 pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID ); 4408 #endif 3991 4409 } 3992 4410 } … … 3994 4412 { 3995 4413 puhInterDirNeighbours[uiArrayAddr] = 1; 3996 } 3997 #if LGE_DVMCP 4414 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4415 pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID ); 4416 #endif 4417 } 4418 #if LGE_DVMCP_A0126 3998 4419 pcMvFieldNeighbours[uiArrayAddr<<1 ].getMv().m_bDvMcp = false; 3999 4420 pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv().m_bDvMcp = false; … … 4231 4652 pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r); 4232 4653 } 4654 #if FIX_CU_BASED_MRG_CAND_LIST_B0136 4655 else 4656 { 4657 pcMvFieldNeighbours[ ( uiArrayAddr << 1 ) + 1 ].setMvField( TComMv(0,0), NOT_VALID ); 4658 } 4659 #endif 4233 4660 uiArrayAddr++; 4234 4661 } … … 4468 4895 return m_pcSlice->getSPS()->getAMVPMode(m_puhDepth[uiIdx]); 4469 4896 } 4470 #if QC_MULTI_DIS_CAN 4897 #if QC_MULTI_DIS_CAN_A0097 4471 4898 /** construct a list of disparity motion vectors from the neighbouring PUs **/ 4472 4899 Void TComDataCU::getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo ) … … 4794 5221 } 4795 5222 4796 #if LGE_DVMCP 4797 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 ) 5223 #if LGE_DVMCP_A0126 5224 #if QC_SIMPLE_NBDV_B0047 5225 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo 5226 #if LGE_IVMP_PARALLEL_MERGE_B0136 5227 , Bool bParMerge 5228 #endif 5229 #else 5230 Void TComDataCU::getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr,DisInfo* pDInfo, Bool bMerge, RefPicList eRefPicList0, Int iRefIdx0 5231 #if LGE_IVMP_PARALLEL_MERGE_B0136 5232 , Bool bParMerge 5233 #endif 5234 #endif 5235 ) 4798 5236 { 4799 5237 PartSize eCUMode = getPartitionSize( uiPartAddr ); 4800 5238 TComDataCU* pcTmpCU = NULL; 5239 #if !QC_SIMPLE_NBDV_B0047 4801 5240 TComDataCU* pcCULeft = NULL; 5241 #endif 4802 5242 pDInfo->iN = 0; 4803 5243 … … 4807 5247 UInt uiNumPartInCUWidth = m_pcPic->getNumPartInWidth(); 4808 5248 4809 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal, DV-MCP ÁÖº¯ ºí·°¿¡¼ »ç¿ëµÈ DV¸¦ ÀúÀå 5249 #if QC_SIMPLE_NBDV_B0047 5250 const Int iNumofDvMCP = 7; 5251 Int aiDvMcpDvCand[2][iNumofDvMCP] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 5252 Bool abDvMcpFlag [2][iNumofDvMCP] = {{false,},{false,}}; 5253 #else 5254 Int aiDvMcpDvCand[2][7] = {{0,}, {0,}}; // dummy, 5 spatial + 1 temporal 4810 5255 Bool abDvMcpFlag [2][7] = {{false,},{false,}}; 4811 5256 //Int aiRefPOC [2][7] = {{-1,},{-1}}; // debug 5257 #endif 4812 5258 TComMv cTmpMvPred, cMv; 4813 5259 Bool bTmpIsSkipped = false; 4814 5260 Bool bDvMcpIsFound = false; 5261 #if LGE_DVMCP_MEM_REDUCTION_B0135 5262 Int iLCUAddrDiff = 0; 5263 #endif 5264 5265 #if LGE_IVMP_PARALLEL_MERGE_B0136 5266 Int xP, yP, nPSW, nPSH; 5267 if( bParMerge) 5268 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH); 5269 #endif 4815 5270 4816 5271 deriveLeftRightTopIdxGeneral( eCUMode, uiPartAddr, uiPartIdx, uiPartIdxLT, uiPartIdxRT ); … … 4823 5278 pcTmpCU = getPULeft(uiIdx, uiPartIdxLB); 4824 5279 #endif 4825 5280 #if DV_DERIVATION_PARALLEL_B0096 5281 if ( uiPartIdx == 1 && (eCUMode == SIZE_Nx2N || eCUMode == SIZE_nLx2N || eCUMode == SIZE_nRx2N) ) 5282 { 5283 pcTmpCU = NULL; 5284 } 5285 #endif 5286 #if LGE_IVMP_PARALLEL_MERGE_B0136 5287 if (pcTmpCU && bParMerge) 5288 { 5289 if (!pcTmpCU->isDiffMER(xP -1, yP+nPSH-1, xP, yP)) 5290 { 5291 pcTmpCU = NULL; 5292 } 5293 } 5294 #endif 5295 5296 #if !QC_SIMPLE_NBDV_B0047 4826 5297 pcCULeft = pcTmpCU; 4827 5298 UInt uiLeftPartIdx = uiIdx; 5299 #endif 5300 4828 5301 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4829 5302 { … … 4863 5336 pcTmpCU = getPUAbove(uiIdx, uiPartIdxRT); 4864 5337 #endif 5338 #if DV_DERIVATION_PARALLEL_B0096 5339 if ( uiPartIdx == 1 && (eCUMode == SIZE_2NxN || eCUMode == SIZE_2NxnU || eCUMode == SIZE_2NxnD) ) 5340 { 5341 pcTmpCU = NULL; 5342 } 5343 #endif 5344 #if LGE_IVMP_PARALLEL_MERGE_B0136 5345 if (pcTmpCU && bParMerge) 5346 { 5347 if (!pcTmpCU->isDiffMER(xP+nPSW-1, yP-1, xP, yP)) 5348 { 5349 pcTmpCU = NULL; 5350 } 5351 } 5352 #endif 4865 5353 4866 5354 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4867 5355 { 5356 #if LGE_DVMCP_MEM_REDUCTION_B0135 5357 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5358 #endif 4868 5359 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4869 5360 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4882 5373 return; 4883 5374 } 5375 #if LGE_DVMCP_MEM_REDUCTION_B0135 5376 else if(iLCUAddrDiff == 0) //MCP, within same LCU 5377 #else 4884 5378 else // MCP 5379 #endif 4885 5380 { 4886 5381 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4901 5396 pcTmpCU = getPUAboveRight(uiIdx, uiPartIdxRT, true, true, true); 4902 5397 #endif 5398 #if LGE_IVMP_PARALLEL_MERGE_B0136 5399 if (pcTmpCU && bParMerge) 5400 { 5401 if (!pcTmpCU->isDiffMER(xP+nPSW, yP-1, xP, yP)) 5402 { 5403 pcTmpCU = NULL; 5404 } 5405 } 5406 #endif 5407 4903 5408 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx ) ) 4904 5409 { 5410 #if LGE_DVMCP_MEM_REDUCTION_B0135 5411 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5412 #endif 4905 5413 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4906 5414 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4919 5427 return; 4920 5428 } 5429 #if LGE_DVMCP_MEM_REDUCTION_B0135 5430 else if(iLCUAddrDiff == 0) 5431 #else 4921 5432 else // MCP 5433 #endif 4922 5434 { 4923 5435 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 4937 5449 #else 4938 5450 pcTmpCU = getPUBelowLeft(uiIdx, uiPartIdxLB); 5451 #endif 5452 #if LGE_IVMP_PARALLEL_MERGE_B0136 5453 if (pcTmpCU && bParMerge) 5454 { 5455 if (!pcTmpCU->isDiffMER(xP-1, yP+nPSH, xP, yP)) 5456 { 5457 pcTmpCU = NULL; 5458 } 5459 } 4939 5460 #endif 4940 5461 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) … … 4977 5498 pcTmpCU = getPUAboveLeft(uiIdx, uiPartIdxLT, true, true, true); 4978 5499 #endif 5500 #if LGE_IVMP_PARALLEL_MERGE_B0136 5501 if (pcTmpCU && bParMerge) 5502 { 5503 if (!pcTmpCU->isDiffMER(xP-1, yP-1, xP, yP)) 5504 { 5505 pcTmpCU = NULL; 5506 } 5507 } 5508 #endif 5509 4979 5510 if(pcTmpCU != NULL && !pcTmpCU->isIntra( uiIdx )) 4980 5511 { 5512 #if LGE_DVMCP_MEM_REDUCTION_B0135 5513 iLCUAddrDiff = getAddr() - pcTmpCU->getAddr(); 5514 #endif 4981 5515 bTmpIsSkipped = pcTmpCU->isSkipped( uiIdx ); 4982 5516 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 4995 5529 return; 4996 5530 } 5531 #if LGE_DVMCP_MEM_REDUCTION_B0135 5532 else if(iLCUAddrDiff <= 1) 5533 #else 4997 5534 else // MCP 5535 #endif 4998 5536 { 4999 5537 cTmpMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); … … 5012 5550 if ( getSlice()->getPPS()->getEnableTMVPFlag() ) 5013 5551 { 5552 #if !QC_SIMPLE_NBDV_B0047 5014 5553 UInt uiPUIdx = uiPartIdx; 5015 5554 UInt uiAbsPartAddr = uiPartAddr; … … 5169 5708 } 5170 5709 } 5710 #else 5711 TComMv cColMv; 5712 Int iTargetViewIdx = 0; 5713 Int iTStartViewIdx = 0; 5714 UInt uiPartIdxRB, uiBRIdx; 5715 Int uiViewIdxCurr= getSlice()->getViewId(); 5716 UInt uiPartIdxCenter; 5717 xDeriveCenterIdx( eCUMode, uiPartIdx, uiPartIdxCenter ); 5718 5719 Int uiLCUIdx = getAddr(); 5720 Int uiLCUnew = uiLCUIdx; 5721 eCUMode = getPartitionSize( 0 ); 5722 deriveRightBottomIdx( eCUMode, uiPartIdx, uiPartIdxRB ); 5723 uiBRIdx = uiPartIdxLT; 5724 UInt uiAbsPartIdxTmp = g_auiZscanToRaster[uiPartIdxRB]; 5725 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 5726 { 5727 if ( ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) && // is not at the last column of LCU 5728 ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) ) // is not at the last row of LCU 5729 { 5730 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + uiNumPartInCUWidth + 1 ]; 5731 } 5732 else if ( uiAbsPartIdxTmp % uiNumPartInCUWidth < uiNumPartInCUWidth - 1 ) // is not at the last column of LCU But is last row of LCU 5733 { 5734 uiBRIdx = g_auiRasterToZscan[ (uiAbsPartIdxTmp + uiNumPartInCUWidth + 1) % m_pcPic->getNumPartInCU() ]; 5735 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU(); 5736 } 5737 else if ( uiAbsPartIdxTmp / uiNumPartInCUWidth < m_pcPic->getNumPartInHeight() - 1 ) // is not at the last row of LCU But is last column of LCU 5738 { 5739 uiBRIdx = g_auiRasterToZscan[ uiAbsPartIdxTmp + 1 ]; 5740 uiLCUnew = uiLCUIdx + 1; 5741 } 5742 else //is the right bottom corner of LCU 5743 { 5744 uiBRIdx = 0; 5745 uiLCUnew = uiLCUIdx + m_pcPic->getFrameWidthInCU() + 1; 5746 } 5747 } 5748 const Int iNumofCandPic = 2; 5749 for(Int i =0; i < iNumofCandPic; i++) 5750 { 5751 Int lpRef=0; 5752 if(i == 0) 5753 { //check the col-located picture 5754 eRefPicList = RefPicList(getSlice()->isInterB() ? getSlice()->getColDir() : 0); 5755 #if COLLOCATED_REF_IDX 5756 lpRef = getSlice()->getColRefIdx(); 5757 #else 5758 Int lpRef = 0; 5759 #endif 5760 } 5761 else 5762 { 5763 if(!(getPic()->getRapbCheck())) 5764 break; 5765 eRefPicList=getPic()->getRapRefList(); 5766 lpRef=getPic()->getRapRefIdx(); 5767 } 5768 5769 if( m_pcSlice->getViewId() == getSlice()->getRefPic( eRefPicList, lpRef)->getViewId() ) 5770 { 5771 if (uiViewIdxCurr > 1) 5772 { 5773 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 5774 { 5775 clipMv(cColMv); 5776 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5777 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 5778 return ; 5779 } 5780 } 5781 5782 if(xGetColDisMV( eRefPicList, lpRef, uiLCUIdx, uiPartIdxCenter, cColMv, iTargetViewIdx, iTStartViewIdx )) 5783 { 5784 clipMv(cColMv); 5785 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5786 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 5787 return ; 5788 } 5789 if(uiViewIdxCurr == 1) 5790 { 5791 if( (uiLCUnew >= 0 && xGetColDisMV( eRefPicList, lpRef, uiLCUnew, uiBRIdx, cColMv, iTargetViewIdx, iTStartViewIdx)) ) 5792 { 5793 clipMv(cColMv); 5794 pDInfo->m_acMvCand[pDInfo->iN] = cColMv; 5795 pDInfo->m_aVIdxCan[pDInfo->iN++] = iTargetViewIdx; 5796 return ; 5797 } 5798 } 5799 } 5800 } 5801 #endif 5171 5802 } // if TMVP Flag 5172 5803 5173 5804 if( bDvMcpIsFound ) // skip dvmcp 5174 5805 { 5806 #if QC_SIMPLE_NBDV_B0047 5807 for( Int i=1 ; i<iNumofDvMCP-1 ; i++ ) // 5 spatial 5808 #else 5175 5809 for( Int i=1 ; i<7 ; i++ ) // 5 spatial + 1 temporal 5810 #endif 5176 5811 { 5177 5812 for(Int iList = 0; iList < (getSlice()->isInterB() ? 2: 1); iList ++) … … 5189 5824 } 5190 5825 } 5191 5192 5826 return; 5193 5194 } 5195 #endif 5196 5827 } 5828 #endif 5197 5829 #endif 5198 5830 … … 5204 5836 * \param pInfo 5205 5837 */ 5838 #if SHARP_INTERVIEW_DECOUPLE_B0111 5839 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo, Int iMVPIdx) 5840 { 5841 if (!m_pcSlice->getSPS()->getViewId() || !m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5842 { 5843 // HEVC 5844 fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo); 5845 } 5846 else 5847 { 5848 if (iMVPIdx!=0) 5849 { 5850 // HEVC part 5851 fillMvpCandBase(uiPartIdx, uiPartAddr, eRefPicList, iRefIdx, pInfo); 5852 if (iRefIdx < 0) 5853 { 5854 return; 5855 } 5856 for (Int j = AMVP_MAX_NUM_CANDS - 1; j >= 0; j--) 5857 { 5858 pInfo->m_acMvCand[j+1] = pInfo->m_acMvCand[j]; 5859 } 5860 pInfo->iN++; 5861 } 5862 if (iMVPIdx<=0) 5863 { 5864 // extention part 5865 DisInfo cDisInfo; 5866 cDisInfo.iN = 0; 5867 #if LGE_DVMCP_A0126 5868 #if QC_SIMPLE_NBDV_B0047 5869 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 5870 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false); 5871 #else 5872 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); 5873 #endif 5874 #else 5875 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 5876 #endif 5877 #else 5878 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); 5879 #endif 5880 if(cDisInfo.iN==0) 5881 { 5882 cDisInfo.iN = 1; 5883 cDisInfo.m_acMvCand[0].setHor(0); 5884 cDisInfo.m_acMvCand[0].setVer(0); 5885 cDisInfo.m_aVIdxCan[0] = 0; 5886 } 5887 TComMv cPdmMvPred; 5888 #if QC_MULTI_DIS_CAN_A0097 5889 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5890 #else 5891 if( getPdmMvPred( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred ) ) 5892 #endif 5893 { 5894 clipMv( cPdmMvPred ); 5895 pInfo->m_acMvCand[0] = cPdmMvPred; 5896 } 5897 else 5898 { 5899 pInfo->m_acMvCand[0].set(0,0); 5900 } 5901 } 5902 } 5903 } 5904 5905 5906 Void TComDataCU::fillMvpCandBase( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ) 5907 #else 5206 5908 Void TComDataCU::fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ) 5909 #endif 5207 5910 { 5208 5911 PartSize eCUMode = getPartitionSize( 0 ); … … 5217 5920 } 5218 5921 5219 #if QC_MULTI_DIS_CAN 5922 #if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B0111 5220 5923 DisInfo cDisInfo; 5221 5924 cDisInfo.iN = 0; 5222 5925 if(m_pcSlice->getSPS()->getViewId() && m_pcSlice->getSPS()->getMultiviewMvPredMode()) 5223 5926 { 5224 #if LGE_DVMCP 5927 #if LGE_DVMCP_A0126 5928 #if QC_SIMPLE_NBDV_B0047 5929 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 5930 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false); 5931 #else 5932 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo); 5933 #endif 5934 #else 5225 5935 getDisMvpCand2(uiPartIdx, uiPartAddr, &cDisInfo, false, eRefPicList, iRefIdx ); 5936 #endif 5226 5937 #else 5227 5938 getDisMvpCand (uiPartIdx, uiPartAddr, &cDisInfo ); … … 5236 5947 } 5237 5948 #endif 5238 #if HHI_INTER_VIEW_MOTION_PRED 5949 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5239 5950 #if ( PDM_AMVP_POS == 0 ) 5240 5951 // get inter-view mv predictor (at position 0) 5241 5952 TComMv cPdmMvPred; 5242 #if QC_MULTI_DIS_CAN 5953 #if QC_MULTI_DIS_CAN_A0097 5243 5954 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5244 5955 #else … … 5295 6006 } 5296 6007 5297 #if HHI_INTER_VIEW_MOTION_PRED 6008 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5298 6009 #if ( PDM_AMVP_POS == 1 ) 5299 6010 // get inter-view mv predictor (at position 1) 5300 6011 TComMv cPdmMvPred; 5301 #if QC_MULTI_DIS_CAN 6012 #if QC_MULTI_DIS_CAN_A0097 5302 6013 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5303 6014 #else … … 5347 6058 } 5348 6059 5349 #if HHI_INTER_VIEW_MOTION_PRED 6060 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5350 6061 #if ( PDM_AMVP_POS == 2 ) 5351 6062 // get inter-view mv predictor (at position 2) 5352 6063 TComMv cPdmMvPred; 5353 #if QC_MULTI_DIS_CAN 6064 #if QC_MULTI_DIS_CAN_A0097 5354 6065 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5355 6066 #else … … 5371 6082 } 5372 6083 } 5373 #if QC_MULTI_DIS_CAN6084 #if QC_MULTI_DIS_CAN_A0097 && !SHARP_INTERVIEW_DECOUPLE_B0111 5374 6085 if ( getSlice()->getViewId()!=0 && pInfo->iN == 3 ) 5375 6086 { … … 5445 6156 if ( uiLCUIdx >= 0 && xGetColMVP( eRefPicList, uiLCUIdx, uiAbsPartAddr, cColMv, iRefIdx_Col ) ) 5446 6157 { 6158 #if FIX_LGE_DVMCP_B0133 6159 cColMv.m_bDvMcp = false; 6160 #endif 5447 6161 pInfo->m_acMvCand[pInfo->iN++] = cColMv; 5448 6162 } … … 5454 6168 if (xGetColMVP( eRefPicList, uiCurLCUIdx, uiPartIdxCenter, cColMv, iRefIdx_Col )) 5455 6169 { 6170 #if FIX_LGE_DVMCP_B0133 6171 cColMv.m_bDvMcp = false; 6172 #endif 5456 6173 pInfo->m_acMvCand[pInfo->iN++] = cColMv; 5457 6174 } … … 5460 6177 } 5461 6178 5462 #if HHI_INTER_VIEW_MOTION_PRED 6179 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5463 6180 #if ( PDM_AMVP_POS == 3 ) 5464 6181 // get inter-view mv predictor (at position 3) 5465 6182 TComMv cPdmMvPred; 5466 #if QC_MULTI_DIS_CAN 6183 #if QC_MULTI_DIS_CAN_A0097 5467 6184 if( getPdmMvPredDisCan( uiPartIdx, eRefPicList, iRefIdx, cPdmMvPred, &cDisInfo ) ) 5468 6185 #else … … 5481 6198 #endif 5482 6199 5483 #if HHI_INTER_VIEW_MOTION_PRED 6200 #if HHI_INTER_VIEW_MOTION_PRED && !SHARP_INTERVIEW_DECOUPLE_B0111 5484 6201 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 5485 6202 if (pInfo->iN > iNumAMVPCands) … … 5654 6371 { 5655 6372 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList)->getMv(uiIdx); 5656 #if LGE_DVMCP 6373 #if LGE_DVMCP_A0126 5657 6374 cMvPred.m_bDvMcp = false; 5658 6375 #endif … … 5691 6408 { 5692 6409 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 5693 #if LGE_DVMCP 6410 #if LGE_DVMCP_A0126 5694 6411 cMvPred.m_bDvMcp = false; 5695 6412 #endif … … 5833 6550 { 5834 6551 TComMv cMvPred = pcTmpCU->getCUMvField(eRefPicList2nd)->getMv(uiIdx); 5835 #if LGE_DVMCP 6552 #if LGE_DVMCP_A0126 5836 6553 cMvPred.m_bDvMcp = false; 5837 6554 #endif … … 5863 6580 rcMv = cMvPred.scaleMv( iScale ); 5864 6581 } 5865 #if LGE_DVMCP 6582 #if LGE_DVMCP_A0126 5866 6583 rcMv.m_bDvMcp = false; 5867 6584 #endif … … 5890 6607 rcMv = cMvPred.scaleMv( iScale ); 5891 6608 } 5892 #if LGE_DVMCP 6609 #if LGE_DVMCP_A0126 5893 6610 rcMv.m_bDvMcp = false; 5894 6611 #endif … … 5900 6617 } 5901 6618 5902 #if QC_MULTI_DIS_CAN 6619 #if QC_MULTI_DIS_CAN_A0097 5903 6620 Bool TComDataCU::xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv , Int & iTargetViewIdx, Int & iStartViewIdx ) 5904 6621 { 5905 #if LGE_DVMCP 6622 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 5906 6623 Int iDvMcpDispX[2] = {-1,}; 5907 6624 Bool bDvMcpFlag [2] = { false, }; … … 5922 6639 return false; 5923 6640 } 5924 #if LGE_DVMCP 6641 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 5925 6642 Bool bColIsSkipped = pColCU->isSkipped( uiAbsPartAddr ); 5926 6643 #endif … … 5946 6663 if ( iColViewIdx == iColRefViewIdx ) // temporal vector 5947 6664 { 5948 #if LGE_DVMCP 6665 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 5949 6666 if( iColViewIdx >0 ) 5950 6667 { … … 5964 6681 { 5965 6682 rcMv = pColCU->getCUMvField(eColRefPicList)->getMv(uiAbsPartAddr); 5966 #if LGE_DVMCP 6683 #if LGE_DVMCP_A0126 5967 6684 rcMv.m_bDvMcp = false; 5968 6685 #endif … … 5973 6690 } 5974 6691 5975 #if LGE_DVMCP 6692 #if LGE_DVMCP_A0126 && !QC_SIMPLE_NBDV_B0047 5976 6693 for( Int ilist=0 ; ilist<2 ; ilist++ ) 5977 6694 { … … 7010 7727 memcpy( m_puhInterDir + uiAbsPartIdxDst, pcCU->getInterDir() + uiAbsPartIdxSrc, sizeof( m_puhInterDir[0] ) * uiNumPartition ); 7011 7728 7729 #if !MTK_UNCONSTRAINED_MVI_B0083 7012 7730 memcpy( m_apiMVPIdx[0] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition ); 7013 7731 memcpy( m_apiMVPIdx[1] + uiAbsPartIdxDst, pcCU->getMVPIdx(REF_PIC_LIST_1) + uiAbsPartIdxSrc, sizeof(*m_apiMVPIdx[0]) * uiNumPartition ); 7014 7732 memcpy( m_apiMVPNum[0] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_0) + uiAbsPartIdxSrc, sizeof(*m_apiMVPNum[0]) * uiNumPartition ); 7015 7733 memcpy( m_apiMVPNum[1] + uiAbsPartIdxDst, pcCU->getMVPNum(REF_PIC_LIST_1) + uiAbsPartIdxSrc, sizeof(*m_apiMVPNum[0]) * uiNumPartition ); 7734 #endif 7016 7735 7017 7736 pcCU->getCUMvField( REF_PIC_LIST_0 )->copyTo( &m_acCUMvField[0], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 7018 7737 pcCU->getCUMvField( REF_PIC_LIST_1 )->copyTo( &m_acCUMvField[1], -Int(uiAbsPartIdxSrc) + uiAbsPartIdxDst, uiAbsPartIdxSrc, uiNumPartition ); 7738 7739 #if MTK_UNCONSTRAINED_MVI_B0083 7740 if( pcCU->getSlice()->getSliceType() == P_SLICE) 7741 { 7742 m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 1); 7743 m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, -1, 1); 7744 } 7745 else 7746 { 7747 m_acCUMvField[0].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 3); 7748 m_acCUMvField[1].setUndefinedMv( uiAbsPartIdxDst, uiNumPartition, m_pePredMode, m_puhInterDir, 0, 3); 7749 } 7750 #endif 7751 7019 7752 7020 7753 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC … … 7029 7762 // ------------------------------------------------------------------------------------------------------------------- 7030 7763 #if HHI_INTER_VIEW_MOTION_PRED 7031 #if !QC_MULTI_DIS_CAN 7764 #if !QC_MULTI_DIS_CAN_A0097 7032 7765 Int 7033 7766 TComDataCU::getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ) … … 7048 7781 #else 7049 7782 Int 7050 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 7783 TComDataCU::getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 7784 #if QC_MRG_CANS_B0048 7785 , Int* iPdm 7786 #endif 7787 ) 7051 7788 { 7052 7789 TComDepthMapGenerator* pcDepthMapGenerator = m_pcSlice->getSPS()->getDepthMapGenerator(); 7053 7790 ROFRS( pcDepthMapGenerator, 0 ); 7054 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo ); 7791 return pcDepthMapGenerator->getPdmMergeCandidate( this, uiPartIdx, paiPdmRefIdx, pacPdmMv, pDInfo 7792 #if QC_MRG_CANS_B0048 7793 , iPdm 7794 #endif 7795 ); 7055 7796 } 7056 7797 Bool … … 7085 7826 TComResidualGenerator* pcResidualGenerator = m_pcSlice->getSPS()->getResidualGenerator(); 7086 7827 ROFRS( pcResidualGenerator, false ); 7087 #if QC_MULTI_DIS_CAN 7828 #if QC_MULTI_DIS_CAN_A0097 7088 7829 DisInfo cDisInfo; 7089 7830 cDisInfo.iN = 0; 7090 7831 PartSize m_peSaved = getPartitionSize( 0 ); 7091 7832 m_pePartSize[0] = SIZE_2Nx2N; 7092 #if LGE_DVMCP 7833 #if LGE_DVMCP_A0126 7834 #if QC_SIMPLE_NBDV_B0047 7835 #if FIX_LGE_IVMP_PARALLEL_MERGE_B0136 7836 getDisMvpCand2( 0, 0, &cDisInfo, false); 7837 #else 7838 getDisMvpCand2( 0, 0, &cDisInfo); 7839 #endif 7840 #else 7093 7841 getDisMvpCand2( 0, 0, &cDisInfo, true ); 7842 #endif 7094 7843 #else 7095 7844 getDisMvpCand ( 0, 0, &cDisInfo ); … … 7120 7869 #endif 7121 7870 7122 #if LGE_EDGE_INTRA 7871 #if LGE_EDGE_INTRA_A0070 7123 7872 Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ) 7124 7873 { -
trunk/source/Lib/TLibCommon/TComDataCU.h
r121 r189 159 159 Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) 160 160 Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) 161 #if FIX_MEM_LEAKS162 161 Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d 163 #endif164 162 165 163 static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) … … 195 193 196 194 Bool* m_pbMergeFlag; ///< array of merge flags 195 #if LGE_ILLUCOMP_B0045 196 Bool* m_pbICFlag; ///< array of IC flags 197 #endif 197 198 UChar* m_puhMergeIndex; ///< array of merge candidate indices 198 199 #if AMP_MRG … … 218 219 #endif 219 220 220 #if LGE_EDGE_INTRA 221 #if LGE_EDGE_INTRA_A0070 221 222 UChar* m_pucEdgeCode; ///< array of edge code 222 223 UChar* m_pucEdgeNumber; ///< total number of edge … … 236 237 Bool m_bDecSubCu; ///< indicates decoder-mode 237 238 Double m_dTotalCost; ///< sum of partition RD costs 239 #if FIX_RDO_NEGDIST 240 Dist m_uiTotalDistortion; ///< sum of partition distortion 241 #else 238 242 UInt m_uiTotalDistortion; ///< sum of partition distortion 243 #endif 239 244 UInt m_uiTotalBits; ///< sum of partition bits 240 245 UInt m_uiTotalBins; ///< sum of partition bins 241 246 UInt* m_uiSliceStartCU; ///< Start CU address of current slice 242 247 UInt* m_uiEntropySliceStartCU; ///< Start CU address of current slice 243 244 #if OL_DEPTHLIMIT_A0044245 //add a variable to store the partition information246 //a 2D array in uidepth, part_symbol format247 UInt m_uiPartInfo[OL_PART_BUF_SIZE][2];248 UInt m_uiPartNum;249 Bool m_dumpPartInfo;250 #endif251 248 252 249 // ------------------------------------------------------------------------------------------------------------------- … … 271 268 Int* m_piContourPredTexDeltaDC2; 272 269 #endif 270 271 #if RWTH_SDC_DLT_B0036 272 Bool* m_pbSDCFlag; 273 Pel* m_apSegmentDCOffset[2]; 274 #endif 273 275 274 276 protected: … … 280 282 Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); 281 283 Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); 282 #if QC_MULTI_DIS_CAN 284 #if QC_MULTI_DIS_CAN_A0097 283 285 Bool xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); 284 286 #endif … … 472 474 Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); 473 475 476 #if LGE_ILLUCOMP_B0045 477 Bool* getICFlag () { return m_pbICFlag; } 478 Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } 479 Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } 480 Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 481 Bool isICFlagRequired (UInt uiAbsPartIdx); 482 #endif 483 474 484 #if AMP_MRG 475 485 Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } … … 530 540 531 541 #if HHI_INTER_VIEW_MOTION_PRED 532 #if !QC_MULTI_DIS_CAN 542 #if !QC_MULTI_DIS_CAN_A0097 533 543 Int getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); 534 544 Bool getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false ); 535 545 #else 536 546 Bool getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false ); 537 Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 547 Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 548 #if QC_MRG_CANS_B0048 549 , Int* iPdm 550 #endif 551 ); 538 552 Void getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo ); 539 #if LGE_DVMCP 540 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 ); 553 #if LGE_DVMCP_A0126 554 #if QC_SIMPLE_NBDV_B0047 555 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo 556 #if LGE_IVMP_PARALLEL_MERGE_B0136 557 , Bool bParMerg = false 558 #endif 559 ); 560 #else 561 Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 562 #if LGE_IVMP_PARALLEL_MERGE_B0136 563 , Bool bParMerg = false 564 #endif 565 ); 566 #endif 541 567 #endif 542 568 … … 586 612 587 613 AMVP_MODE getAMVPMode ( UInt uiIdx ); 614 #if SHARP_INTERVIEW_DECOUPLE_B0111 615 Void fillMvpCandBase ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); 616 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1); 617 #else 588 618 Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); 619 #endif 589 620 #if PARALLEL_MERGE 590 621 Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); … … 608 639 609 640 Void compressMV (); 610 611 #if OL_DEPTHLIMIT_A0044612 Void resetPartInfo () {m_uiPartNum = 0;};613 Void incrementPartInfo () {m_uiPartNum ++;};614 Void updatePartInfo(UInt uiSymbol, UInt uiDepth) { m_uiPartInfo[m_uiPartNum][0] = uiSymbol; m_uiPartInfo[m_uiPartNum][1] = uiDepth;};615 UInt* readPartInfo() { return (UInt*)m_uiPartInfo;};616 Void setPartDumpFlag(Bool flag) { m_dumpPartInfo = flag; };617 Bool getPartDumpFlag() { return m_dumpPartInfo; };618 #endif619 641 620 642 // ------------------------------------------------------------------------------------------------------------------- … … 696 718 697 719 UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); 720 #if LGE_ILLUCOMP_B0045 721 UInt getCtxICFlag ( UInt uiAbsPartIdx ); 722 #endif 698 723 UInt getCtxInterDir ( UInt uiAbsPartIdx ); 699 724 … … 706 731 UInt& getTotalBins () { return m_uiTotalBins; } 707 732 708 #if LGE_EDGE_INTRA 733 #if LGE_EDGE_INTRA_A0070 709 734 UInt getCtxEdgeIntra ( UInt uiAbsPartIdx ); 710 735 #endif … … 715 740 716 741 Double& getTotalCost() { return m_dTotalCost; } 742 #if FIX_RDO_NEGDIST 743 Dist& getTotalDistortion() { return m_uiTotalDistortion; } 744 #else 717 745 UInt& getTotalDistortion() { return m_uiTotalDistortion; } 746 #endif 718 747 UInt& getTotalBits() { return m_uiTotalBits; } 719 748 UInt& getTotalNumPart() { return m_uiNumPartition; } … … 786 815 #endif 787 816 788 #if LGE_EDGE_INTRA 817 #if LGE_EDGE_INTRA_A0070 789 818 UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; } 790 819 UChar* getEdgeNumber( ) { return m_pucEdgeNumber; } … … 808 837 Void setEdgeDeltaDC1( UInt uiIdx, Int val ) { m_piEdgeDeltaDC1[uiIdx] = val; } 809 838 #endif 839 #endif 840 841 #if RWTH_SDC_DLT_B0036 842 Bool* getSDCFlag () { return m_pbSDCFlag; } 843 Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } 844 Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); 845 846 UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); 847 848 Bool getSDCAvailable ( UInt uiAbsPartIdx ); 849 850 Pel* getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; } 851 Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } 852 Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } 810 853 #endif 811 854 }; -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.cpp
r100 r189 78 78 m_uiSubSampExpX = uiSubSampExpX; 79 79 m_uiSubSampExpY = uiSubSampExpY; 80 #if !QC_MULTI_DIS_CAN 80 #if !QC_MULTI_DIS_CAN_A0097 81 81 m_ppcYuv = new TComYuv* [ m_uiMaxDepth ]; 82 82 m_ppcCU = new TComDataCU* [ m_uiMaxDepth ]; … … 102 102 { 103 103 m_bCreated = false; 104 #if !QC_MULTI_DIS_CAN 104 #if !QC_MULTI_DIS_CAN_A0097 105 105 for( UInt uiDepth = 0; uiDepth < m_uiMaxDepth; uiDepth++ ) 106 106 { … … 377 377 } 378 378 379 #if !QC_MULTI_DIS_CAN 379 #if !QC_MULTI_DIS_CAN_A0097 380 380 Bool 381 381 TComDepthMapGenerator::predictDepthMap( TComPic* pcPic ) … … 605 605 606 606 #if HHI_INTER_VIEW_MOTION_PRED 607 #if QC_MULTI_DIS_CAN 607 #if QC_MULTI_DIS_CAN_A0097 608 608 Int 609 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ) 609 TComDepthMapGenerator::getPdmMergeCandidate( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 610 #if QC_MRG_CANS_B0048 611 , Int* iPdm 612 #endif 613 ) 610 614 #else 611 615 Int … … 616 620 AOF ( m_bCreated && m_bInit ); 617 621 618 #if !QC_MULTI_DIS_CAN 622 #if !QC_MULTI_DIS_CAN_A0097 619 623 ROFRS( m_bPDMAvailable, 0 ); 620 624 #endif … … 626 630 ROTRS( !bPdmMerge, 0 ); 627 631 632 #if QC_MRG_CANS_B0048 633 Bool abPdmAvailable[4] = {false, false, false, false}; 634 #else 628 635 Bool abPdmAvailable[2] = {false,false}; 636 #endif 629 637 630 638 Int iValid = 0; … … 657 665 TComPicYuv* pcBaseRec = pcBasePic->getPicYuvRec (); 658 666 659 #if QC_MULTI_DIS_CAN 667 #if QC_MULTI_DIS_CAN_A0097 660 668 Int iCurrPosX, iCurrPosY; 661 669 UInt uiPartAddr; … … 711 719 paiPdmRefIdx [ uiBaseRefListId ] = iPdmRefIdx; 712 720 TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer()); 713 #if LGE_DVMCP 721 #if LGE_DVMCP_A0126 714 722 cMv.m_bDvMcp = true; 715 723 cMv.m_iDvMcpDispX = pDInfo->m_acMvCand[0].getHor(); … … 725 733 } 726 734 Int iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ); 727 735 #if QC_MRG_CANS_B0048 736 iPdm[0] = iPdmInterDir; 737 #else 728 738 if (iPdmInterDir == 0) 729 739 { 740 #endif 730 741 for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ ) 731 742 { … … 736 747 if( pcSlice->getRefPOC( eRefPicList, iPdmRefIdx ) == pcSlice->getPOC()) 737 748 { 749 #if QC_MRG_CANS_B0048 750 abPdmAvailable[ iRefListId+2 ] = true; 751 paiPdmRefIdx [ iRefListId+2 ] = iPdmRefIdx; 752 #else 738 753 abPdmAvailable[ iRefListId ] = true; 739 754 paiPdmRefIdx [ iRefListId ] = iPdmRefIdx; 740 #if QC_MULTI_DIS_CAN 755 #endif 756 #if QC_MULTI_DIS_CAN_A0097 741 757 TComMv cMv = pDInfo->m_acMvCand[0]; 742 758 cMv.setVer(0); … … 745 761 #endif 746 762 pcCU->clipMv( cMv ); 763 #if QC_MRG_CANS_B0048 764 pacPdmMv [ iRefListId + 2] = cMv; 765 #else 747 766 pacPdmMv [ iRefListId ] = cMv; 767 #endif 748 768 break; 749 769 } 750 770 } 751 771 } 772 #if QC_MRG_CANS_B0048 773 iPdmInterDir = ( abPdmAvailable[2] ? 1 : 0 ) + ( abPdmAvailable[3] ? 2 : 0 ) ; 774 iPdm[1] = iPdmInterDir; 775 #else 752 776 iPdmInterDir = ( abPdmAvailable[0] ? 1 : 0 ) + ( abPdmAvailable[1] ? 2 : 0 ) ; 753 777 } 778 #endif 754 779 755 780 return iPdmInterDir; … … 770 795 if( pcCU->getSlice()->getRefPOC( eRefPicList, iPdmRefIdx ) != pcCU->getSlice()->getPOC() ) 771 796 { 772 #if QC_MULTI_DIS_CAN 797 #if QC_MULTI_DIS_CAN_A0097 773 798 if( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 774 799 #else … … 796 821 for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ ) 797 822 { 798 #if QC_MULTI_DIS_CAN 823 #if QC_MULTI_DIS_CAN_A0097 799 824 if ( getDisCanPdmMvPred (pcCU, uiPartIdx, eRefPicList, iPdmRefIdx, cMv, pDInfo, true ) ) 800 825 #else … … 816 841 } 817 842 818 #if QC_MULTI_DIS_CAN 843 #if QC_MULTI_DIS_CAN_A0097 819 844 Bool 820 845 TComDepthMapGenerator::getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ) 821 846 { 822 #if LGE_DVMCP 847 #if LGE_DVMCP_A0126 823 848 rcMv.m_bDvMcp = false; 824 849 #endif … … 888 913 { 889 914 rcMv.set( cBaseMvField.getHor(), cBaseMvField.getVer() ); 890 #if LGE_DVMCP 915 #if LGE_DVMCP_A0126 891 916 // save disparity vector when a merge candidate for IVMP is set as DV-MCP 892 917 if( bMerge ) … … 1037 1062 1038 1063 1039 #if !QC_MULTI_DIS_CAN 1064 #if !QC_MULTI_DIS_CAN_A0097 1040 1065 /*=======================================================* 1041 1066 *===== =====* -
trunk/source/Lib/TLibCommon/TComDepthMapGenerator.h
r100 r189 136 136 137 137 Void initViewComponent ( TComPic* pcPic ); 138 #if !QC_MULTI_DIS_CAN 138 #if !QC_MULTI_DIS_CAN_A0097 139 139 Bool predictDepthMap ( TComPic* pcPic ); 140 140 Void updateDepthMap ( TComPic* pcPic ); … … 151 151 Int getDisparity ( TComPic* pcPic, Int iPosX, Int iPosY, UInt uiRefViewId ); 152 152 #if HHI_INTER_VIEW_MOTION_PRED 153 #if QC_MULTI_DIS_CAN 154 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); 153 #if QC_MULTI_DIS_CAN_A0097 154 Int getPdmMergeCandidate ( TComDataCU* pcCU, UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo 155 #if QC_MRG_CANS_B0048 156 , Int* iPdm 157 #endif 158 ); 159 155 160 Bool getPdmMvPredDisCan ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); 156 161 Bool getDisCanPdmMvPred ( TComDataCU* pcCU, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge ); … … 171 176 private: 172 177 // picture operations 173 #if !QC_MULTI_DIS_CAN 178 #if !QC_MULTI_DIS_CAN_A0097 174 179 Bool xConvertDepthMapCurr2Ref ( TComPic* pcRef, TComPic* pcCur ); 175 180 Bool xConvertDepthMapRef2Curr ( TComPic* pcCur, TComPic* pcRef ); -
trunk/source/Lib/TLibCommon/TComMotionInfo.cpp
r56 r189 374 374 } 375 375 #endif 376 377 378 379 #if MTK_UNCONSTRAINED_MVI_B0083 380 Void TComCUMvField::setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir ) 381 { 382 PredMode predMode = MODE_INTRA; 383 TComMv cMv(0,0); 384 385 for ( Int i = 0; i < iNumPart; i++ ) 386 { 387 predMode = static_cast<PredMode>( pePredMode[ iPartAddr+i ] ); 388 if( predMode==MODE_INTRA ) 389 { 390 m_pcMv[iPartAddr+i] = cMv; 391 puhInterDir[iPartAddr+i] = InterDir; 392 m_piRefIdx[iPartAddr+i] = refIdx; 393 } 394 } 395 } 396 #endif 397 376 398 //! \} -
trunk/source/Lib/TLibCommon/TComMotionInfo.h
r100 r189 59 59 60 60 // ==================================================================================================================== 61 #if QC_MULTI_DIS_CAN 61 #if QC_MULTI_DIS_CAN_A0097 62 62 typedef struct _DisCand 63 63 { … … 94 94 Int getHor () const { return m_acMv.getHor(); } 95 95 Int getVer () const { return m_acMv.getVer(); } 96 #if QC_MRG_CANS_B0048 97 Bool operator== ( const TComMvField& rcMv ) const 98 { 99 return (m_acMv.getHor()==rcMv.getHor() && m_acMv.getVer()==rcMv.getVer() && m_iRefIdx == rcMv.getRefIdx()); 100 } 101 #endif 96 102 }; 97 103 … … 169 175 Void decreaseMvAccuracy( Int iPartAddr, Int iNumPart, Int iShift ); 170 176 #endif 177 178 #if MTK_UNCONSTRAINED_MVI_B0083 179 Void setUndefinedMv( Int iPartAddr, Int iNumPart, Char* pePredMode, UChar* puhInterDir, Int refIdx, Int InterDir ); 180 #endif 171 181 }; 172 182 -
trunk/source/Lib/TLibCommon/TComMv.h
r100 r189 57 57 public: 58 58 59 #if LGE_DVMCP 59 #if LGE_DVMCP_A0126 60 60 Bool m_bDvMcp; // is dv-mcp ? 61 61 Int m_iDvMcpDispX; // disparity for dv-mcp … … 69 69 m_iHor(0), 70 70 m_iVer(0) 71 #if LGE_DVMCP 71 #if LGE_DVMCP_A0126 72 72 , m_bDvMcp(false) 73 73 , m_iDvMcpDispX(0) … … 79 79 m_iHor(iHor), 80 80 m_iVer(iVer) 81 #if LGE_DVMCP 81 #if LGE_DVMCP_A0126 82 82 , m_bDvMcp(false) 83 83 , m_iDvMcpDispX(0) -
trunk/source/Lib/TLibCommon/TComPattern.cpp
r100 r189 675 675 { 676 676 Int* piSrc; 677 #if LGE_EDGE_INTRA 677 #if LGE_EDGE_INTRA_A0070 678 678 mapEdgeIntratoDC( uiDirMode ); 679 679 #endif -
trunk/source/Lib/TLibCommon/TComPattern.h
r56 r189 111 111 TComPatternParam m_cPatternCr; 112 112 113 #if LGE_ILLUCOMP_B0045 114 Bool m_bICFlag; 115 #endif 116 113 117 #if LOGI_INTRA_NAME_3MPM 114 118 static const UChar m_aucIntraFilter[5]; … … 124 128 Int getROIYHeight() { return m_cPatternY.m_iROIHeight; } 125 129 Int getPatternLStride() { return m_cPatternY.m_iPatternStride; } 130 131 #if LGE_ILLUCOMP_B0045 132 Bool getICFlag() { return m_bICFlag; } 133 Void setICFlag(Bool bICFlag) { m_bICFlag = bICFlag; } 134 #endif 126 135 127 136 // access functions of ADI buffers -
trunk/source/Lib/TLibCommon/TComPic.cpp
r100 r189 81 81 m_aaiCodedScale = 0; 82 82 m_aaiCodedOffset = 0; 83 #if OL_QTLIMIT_PREDCODING_B0068 84 m_bReduceBitsQTL = 0; 85 #endif 86 #if QC_SIMPLE_NBDV_B0047 87 m_bRapCheck = false; 88 m_eRapRefList = REF_PIC_LIST_0; 89 m_uiRapRefIdx = 0; 90 #endif 91 83 92 } 84 93 … … 480 489 } 481 490 } 491 #if QC_SIMPLE_NBDV_B0047 492 Bool TComPic::getDisCandRefPictures(Int iColPOC) 493 { 494 UInt uiTempLayerCurr=7; 495 TComSlice* currSlice = getCurrSlice(); 496 UInt iPOCCurr=currSlice->getPOC(); 497 UInt iPOCDiff = 255; 498 Bool bRAP=false; 499 Bool bCheck = false; 500 Int MaxRef = currSlice->getNumRefIdx(RefPicList(0)); 501 RefPicList eRefPicList = REF_PIC_LIST_0 ; 502 if(currSlice->isInterB()) 503 { 504 if(currSlice->getNumRefIdx(RefPicList(0))< currSlice->getNumRefIdx(RefPicList(1))) 505 MaxRef = currSlice->getNumRefIdx(RefPicList(1)); 506 } 507 for(Int lpRef = 0; lpRef < MaxRef; lpRef++) 508 { 509 for(Int lpNr = 0; lpNr < (currSlice->isInterB() ? 2: 1); lpNr ++) 510 { 511 eRefPicList = RefPicList(0); 512 if(currSlice->isInterB()) 513 eRefPicList = RefPicList(lpNr==0 ? (currSlice->getColDir()): (1-currSlice->getColDir())); 514 if(iColPOC == currSlice->getRefPOC(eRefPicList, lpRef)) 515 continue; 516 if(lpRef >= currSlice->getNumRefIdx(eRefPicList)||(currSlice->getViewId() != currSlice->getRefPic( eRefPicList, lpRef)->getViewId())) 517 continue; 518 Int iTempPoc = currSlice->getRefPic(eRefPicList, lpRef)->getPOC(); 519 UInt uiTempLayer = currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getTLayer(); 520 Int iTempDiff = (iTempPoc > iPOCCurr) ? (iTempPoc - iPOCCurr): (iPOCCurr - iTempPoc); 521 bRAP = (currSlice->getRefPic(eRefPicList, lpRef)->getCurrSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV? 1:0); 522 if( bRAP) 523 { 524 bCheck = true; 525 this->setRapRefIdx(lpRef); 526 this->setRapRefList(eRefPicList); 527 return bCheck; 528 } 529 if(uiTempLayerCurr > uiTempLayer) 530 { 531 bCheck = true; 532 if(uiTempLayerCurr == uiTempLayer) 533 { 534 if(iPOCDiff > iTempDiff) 535 { 536 iPOCDiff=iTempDiff; 537 if(iPOCDiff < 255) 538 { 539 this->setRapRefIdx(lpRef); 540 this->setRapRefList(eRefPicList); 541 } 542 } 543 } 544 else 545 { 546 iPOCDiff=iTempDiff; 547 uiTempLayerCurr = uiTempLayer; 548 this->setRapRefIdx(lpRef); 549 this->setRapRefList(eRefPicList); 550 } 551 } 552 } 553 } 554 return bCheck; 555 } 556 #endif 482 557 483 558 #if HHI_INTERVIEW_SKIP -
trunk/source/Lib/TLibCommon/TComPic.h
r126 r189 73 73 #endif 74 74 75 #if LG_ZEROINTRADEPTHRESI_ M2603975 #if LG_ZEROINTRADEPTHRESI_A0087 76 76 Int m_uiIntraPeriod; 77 77 #endif … … 79 79 #if HHI_INTER_VIEW_MOTION_PRED 80 80 TComPicYuv* m_pcOrgDepthMap; // original depth map 81 #if QC_MULTI_DIS_CAN 81 #if QC_MULTI_DIS_CAN_A0097 82 82 Bool m_checked; 83 #endif 84 #if QC_SIMPLE_NBDV_B0047 85 UInt m_uiRapRefIdx; 86 RefPicList m_eRapRefList; 87 Bool m_bRapCheck; 83 88 #endif 84 89 #endif … … 113 118 Int** m_aaiCodedOffset; 114 119 115 #if OL_DEPTHLIMIT_A0044 116 UInt* m_texPartInfo; 117 UInt m_uiTexPartIndex; 120 #if OL_QTLIMIT_PREDCODING_B0068 121 Bool m_bReduceBitsQTL; 118 122 #endif 119 123 … … 139 143 TComVPS* getVPS() { return m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS(); } 140 144 #endif 141 #if LG_ZEROINTRADEPTHRESI_ M26039145 #if LG_ZEROINTRADEPTHRESI_A0087 142 146 Int getIntraPeriod() { return m_uiIntraPeriod; } 143 147 Void setIntraPeriod(Int uiIntraPeriod) { m_uiIntraPeriod = uiIntraPeriod; } … … 165 169 #if HHI_INTER_VIEW_MOTION_PRED 166 170 TComPicYuv* getOrgDepthMap() { return m_pcOrgDepthMap; } 167 #if QC_MULTI_DIS_CAN 171 #if QC_MULTI_DIS_CAN_A0097 168 172 Void setCandPicCheckedFlag (Bool bchecked) { m_checked = bchecked; } 169 173 Bool getCandPicCheckedFlag () { return m_checked;} … … 173 177 #if HHI_INTER_VIEW_RESIDUAL_PRED 174 178 TComPicYuv* getResidual() { return m_pcResidual; } 179 #endif 180 #if QC_SIMPLE_NBDV_B0047 181 UInt getRapRefIdx() {return m_uiRapRefIdx;} 182 RefPicList getRapRefList() {return m_eRapRefList;} 183 Void setRapRefIdx(UInt uiRapRefIdx) {m_uiRapRefIdx = uiRapRefIdx;} 184 Void setRapRefList(RefPicList eRefPicList) {m_eRapRefList = eRefPicList;} 185 Bool getRapbCheck() {return m_bRapCheck;} 186 Void setRapbCheck(Bool bCheck) {m_bRapCheck = bCheck;} 187 Bool getDisCandRefPictures(Int iColPOC); 175 188 #endif 176 189 … … 179 192 Int getViewOrderIdx() { return m_iViewOrderIdx; } 180 193 #endif 194 195 #if OL_QTLIMIT_PREDCODING_B0068 196 Bool getReduceBitsFlag () { return m_bReduceBitsQTL; } 197 Void setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag; } 198 #endif 199 181 200 Void setScaleOffset( Int** pS, Int** pO ) { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; } 182 201 Int** getCodedScale () { return m_aaiCodedScale; } … … 249 268 #endif 250 269 251 #if OL_DEPTHLIMIT_A0044252 UInt accessPartInfo ( UInt count ) { return m_texPartInfo[m_uiTexPartIndex + count]; };253 Void incrementTexPartIndex ( ) { m_uiTexPartIndex += 2; };254 UInt getTexPartIndex () { return m_uiTexPartIndex; };255 Void setTexPartIndex ( UInt idx ) { m_uiTexPartIndex = idx; };256 Void setPartInfo ( UInt* texPart) { m_texPartInfo = texPart; };257 #endif258 259 270 Bool getValidSlice (Int sliceID) {return m_pbValidSlice[sliceID];} 260 271 Int getSliceGranularityForNDBFilter () {return m_sliceGranularityForNDBFilter;} -
trunk/source/Lib/TLibCommon/TComPicSym.cpp
r121 r189 123 123 124 124 125 #if FIX_MEM_LEAKS126 125 for( i=0; i<(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ ) 127 126 { 128 127 if ( m_apcTComTile[i] ) delete m_apcTComTile[i]; 129 128 } 130 #endif131 129 132 130 delete [] m_apcTComTile; -
trunk/source/Lib/TLibCommon/TComPrediction.cpp
r100 r189 46 46 // ==================================================================================================================== 47 47 48 #if LGE_EDGE_INTRA 48 #if LGE_EDGE_INTRA_A0070 49 49 #define MAX_DISTANCE_EDGEINTRA 255 50 50 #endif … … 423 423 } 424 424 425 #if LGE_EDGE_INTRA 425 #if LGE_EDGE_INTRA_A0070 426 426 Void TComPrediction::predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta ) 427 427 { … … 628 628 if ( eRefPicList != REF_PIC_LIST_X ) 629 629 { 630 #if LGE_ILLUCOMP_B0045 631 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 632 #else 630 633 if( pcCU->getSlice()->getPPS()->getUseWP()) 634 #endif 631 635 { 632 636 #if DEPTH_MAP_GENERATION … … 644 648 #endif 645 649 } 650 #if LGE_ILLUCOMP_B0045 651 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr) ) 652 #else 646 653 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 654 #endif 647 655 { 648 656 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); … … 689 697 if ( eRefPicList != REF_PIC_LIST_X ) 690 698 { 699 #if LGE_ILLUCOMP_B0045 700 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 701 #else 691 702 if( pcCU->getSlice()->getPPS()->getUseWP()) 703 #endif 692 704 { 693 705 #if DEPTH_MAP_GENERATION … … 710 722 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx, false ); 711 723 #endif 724 #if LGE_ILLUCOMP_B0045 725 if( pcCU->getSlice()->getPPS()->getUseWP() && !pcCU->getICFlag(uiPartAddr)) 726 #else 712 727 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 728 #endif 713 729 { 714 730 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, iPartIdx ); … … 779 795 { 780 796 #endif 797 #if LGE_ILLUCOMP_B0045 798 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId()); 799 800 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag); 801 #else 781 802 xPredInterLumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 803 #endif 782 804 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 783 805 } 784 806 #endif 807 #if LGE_ILLUCOMP_B0045 808 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getRefViewId( eRefPicList, iRefIdx ) != pcCU->getSlice()->getViewId()); 809 810 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, bICFlag ); 811 #else 785 812 xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi ); 813 #endif 786 814 } 787 815 … … 926 954 * \param bi Flag indicating whether bipred is used 927 955 */ 956 #if LGE_ILLUCOMP_B0045 957 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag) 958 #else 928 959 Void TComPrediction::xPredInterLumaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 960 #endif 929 961 { 930 962 Int refStride = refPic->getStride(); … … 961 993 m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height, yFrac, false, !bi); 962 994 } 995 996 #if LGE_ILLUCOMP_B0045 997 if(bICFlag) 998 { 999 Int a, b, iShift, i, j; 1000 1001 xGetLLSICPrediction(cu, mv, refPic, a, b, iShift); 1002 1003 for (i = 0; i < height; i++) 1004 { 1005 for (j = 0; j < width; j++) 1006 { 1007 if(bi) 1008 { 1009 Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 1010 dst[j] = ( (a*dst[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS; 1011 } 1012 else 1013 dst[j] = Clip( ( (a*dst[j]) >> iShift ) + b ); 1014 } 1015 dst += dstStride; 1016 } 1017 } 1018 #endif 963 1019 } 964 1020 … … 975 1031 * \param bi Flag indicating whether bipred is used 976 1032 */ 1033 #if LGE_ILLUCOMP_B0045 1034 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag ) 1035 #else 977 1036 Void TComPrediction::xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ) 1037 #endif 978 1038 { 979 1039 Int refStride = refPic->getCStride(); … … 1018 1078 m_if.filterVerChroma(extY + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight , yFrac, false, !bi); 1019 1079 } 1080 #if LGE_ILLUCOMP_B0045 1081 if(bICFlag) 1082 { 1083 Int a, b, iShift, i, j; 1084 xGetLLSICPredictionChroma(cu, mv, refPic, a, b, iShift, 0); // Cb 1085 for (i = 0; i < cxHeight; i++) 1086 { 1087 for (j = 0; j < cxWidth; j++) 1088 { 1089 if(bi) 1090 { 1091 Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 1092 dstCb[j] = ( (a*dstCb[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS; 1093 } 1094 else 1095 dstCb[j] = Clip3(0, 255, ((a*dstCb[j])>>iShift)+b); 1096 } 1097 dstCb += dstStride; 1098 } 1099 1100 xGetLLSICPredictionChroma(cu, mv, refPic, a, b, iShift, 1); // Cr 1101 for (i = 0; i < cxHeight; i++) 1102 { 1103 for (j = 0; j < cxWidth; j++) 1104 { 1105 if(bi) 1106 { 1107 Int iIFshift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement ); 1108 dstCr[j] = ( (a*dstCr[j]+a*IF_INTERNAL_OFFS) >> iShift ) + b*(1<<iIFshift) - IF_INTERNAL_OFFS; 1109 } 1110 else 1111 dstCr[j] = Clip3(0, 255, ((a*dstCr[j])>>iShift)+b); 1112 } 1113 dstCr += dstStride; 1114 } 1115 } 1116 #endif 1020 1117 } 1021 1118 … … 1443 1540 } 1444 1541 1542 1543 #if LGE_ILLUCOMP_B0045 1544 /** Function for deriving LM illumination compensation. 1545 */ 1546 Void TComPrediction::xGetLLSICPrediction(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift) 1547 { 1548 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 1549 Pel *pRec, *pRef; 1550 UInt uiWidth, uiHeight, uiTmpPartIdx; 1551 Int iRecStride = pRecPic->getStride(), iRefStride = pRefPic->getStride(); 1552 Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset; 1553 1554 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1555 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1556 iRefX = iCUPelX + (pMv->getHor() >> 2); 1557 iRefY = iCUPelY + (pMv->getVer() >> 2); 1558 uiWidth = pcCU->getWidth(0); 1559 uiHeight = pcCU->getHeight(0); 1560 1561 Int i, j, iCountShift = 0; 1562 1563 // LLS parameters estimation --> 1564 1565 Int x = 0, y = 0, xx = 0, xy = 0; 1566 1567 if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0) 1568 { 1569 iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - iRefStride; 1570 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1571 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1572 1573 for( j = 0; j < uiWidth; j++ ) 1574 { 1575 x += pRef[j]; 1576 y += pRec[j]; 1577 xx += pRef[j] * pRef[j]; 1578 xy += pRef[j] * pRec[j]; 1579 } 1580 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1581 } 1582 1583 1584 if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0) 1585 { 1586 iRefOffset = ( pMv->getHor() >> 2 ) + ( pMv->getVer() >> 2 ) * iRefStride - 1; 1587 pRef = pRefPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1588 pRec = pRecPic->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1589 1590 for( i = 0; i < uiHeight; i++ ) 1591 { 1592 x += pRef[0]; 1593 y += pRec[0]; 1594 xx += pRef[0] * pRef[0]; 1595 xy += pRef[0] * pRec[0]; 1596 1597 pRef += iRefStride; 1598 pRec += iRecStride; 1599 } 1600 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1601 } 1602 1603 Int iTempShift = ( g_uiBitDepth + g_uiBitIncrement ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1604 1605 if(iTempShift > 0) 1606 { 1607 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1608 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1609 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1610 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1611 iCountShift -= iTempShift; 1612 } 1613 1614 iShift = 13; 1615 1616 if( iCountShift == 0 ) 1617 { 1618 a = 1; 1619 b = 0; 1620 iShift = 0; 1621 } 1622 else 1623 { 1624 Int a1 = ( xy << iCountShift ) - y * x; 1625 Int a2 = ( xx << iCountShift ) - x * x; 1626 1627 { 1628 const Int iShiftA2 = 6; 1629 const Int iShiftA1 = 15; 1630 const Int iAccuracyShift = 15; 1631 1632 Int iScaleShiftA2 = 0; 1633 Int iScaleShiftA1 = 0; 1634 Int a1s = a1; 1635 Int a2s = a2; 1636 1637 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1638 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1639 1640 if( iScaleShiftA1 < 0 ) 1641 { 1642 iScaleShiftA1 = 0; 1643 } 1644 1645 if( iScaleShiftA2 < 0 ) 1646 { 1647 iScaleShiftA2 = 0; 1648 } 1649 1650 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1651 1652 a2s = a2 >> iScaleShiftA2; 1653 1654 a1s = a1 >> iScaleShiftA1; 1655 1656 if (a2s >= 1) 1657 { 1658 a = a1s * m_uiaShift[ a2s - 1]; 1659 } 1660 else 1661 { 1662 a = 0; 1663 } 1664 1665 if( iScaleShiftA < 0 ) 1666 { 1667 a = a << -iScaleShiftA; 1668 } 1669 else 1670 { 1671 a = a >> iScaleShiftA; 1672 } 1673 1674 a = Clip3(-( 1 << 15 ), ( 1 << 15 ) - 1, a); 1675 1676 Int minA = -(1 << (6)); 1677 Int maxA = (1 << 6) - 1; 1678 if( a <= maxA && a >= minA ) 1679 { 1680 // do nothing 1681 } 1682 else 1683 { 1684 Short n = CountLeadingZerosOnes(a); 1685 a = a >> (9-n); 1686 iShift -= (9-n); 1687 } 1688 1689 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1690 } 1691 } 1692 } 1693 1694 Void TComPrediction::xGetLLSICPredictionChroma(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, Int iChromaId) 1695 { 1696 TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec(); 1697 Pel *pRec = NULL, *pRef = NULL; 1698 UInt uiWidth, uiHeight, uiTmpPartIdx; 1699 Int iRecStride = pRecPic->getCStride(), iRefStride = pRefPic->getCStride(); 1700 Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset; 1701 1702 iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1703 iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]]; 1704 iRefX = iCUPelX + (pMv->getHor() >> 3); 1705 iRefY = iCUPelY + (pMv->getVer() >> 3); 1706 uiWidth = pcCU->getWidth(0) >> 1; 1707 uiHeight = pcCU->getHeight(0) >> 1; 1708 1709 Int i, j, iCountShift = 0; 1710 1711 // LLS parameters estimation --> 1712 1713 Int x = 0, y = 0, xx = 0, xy = 0; 1714 1715 if(pcCU->getPUAbove(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelY > 0 && iRefY > 0) 1716 { 1717 iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - iRefStride; 1718 if (iChromaId == 0) // Cb 1719 { 1720 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1721 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1722 } 1723 else if (iChromaId == 1) // Cr 1724 { 1725 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1726 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - iRecStride; 1727 } 1728 1729 for( j = 0; j < uiWidth; j++ ) 1730 { 1731 x += pRef[j]; 1732 y += pRec[j]; 1733 xx += pRef[j] * pRef[j]; 1734 xy += pRef[j] * pRec[j]; 1735 } 1736 iCountShift += g_aucConvertToBit[ uiWidth ] + 2; 1737 } 1738 1739 1740 if(pcCU->getPULeft(uiTmpPartIdx, pcCU->getZorderIdxInCU()) && iCUPelX > 0 && iRefX > 0) 1741 { 1742 iRefOffset = ( pMv->getHor() >> 3 ) + ( pMv->getVer() >> 3 ) * iRefStride - 1; 1743 if (iChromaId == 0) // Cb 1744 { 1745 pRef = pRefPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1746 pRec = pRecPic->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1747 } 1748 else if (iChromaId == 1) // Cr 1749 { 1750 pRef = pRefPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) + iRefOffset; 1751 pRec = pRecPic->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() ) - 1; 1752 } 1753 1754 for( i = 0; i < uiHeight; i++ ) 1755 { 1756 x += pRef[0]; 1757 y += pRec[0]; 1758 xx += pRef[0] * pRef[0]; 1759 xy += pRef[0] * pRec[0]; 1760 1761 pRef += iRefStride; 1762 pRec += iRecStride; 1763 } 1764 iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 ); 1765 } 1766 1767 Int iTempShift = ( g_uiBitDepth + g_uiBitIncrement ) + g_aucConvertToBit[ uiWidth ] + 3 - 15; 1768 1769 if(iTempShift > 0) 1770 { 1771 x = ( x + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1772 y = ( y + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1773 xx = ( xx + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1774 xy = ( xy + ( 1 << ( iTempShift - 1 ) ) ) >> iTempShift; 1775 iCountShift -= iTempShift; 1776 } 1777 1778 iShift = 13; 1779 1780 if( iCountShift == 0 ) 1781 { 1782 a = 1; 1783 b = 0; 1784 iShift = 0; 1785 } 1786 else 1787 { 1788 Int a1 = ( xy << iCountShift ) - y * x; 1789 Int a2 = ( xx << iCountShift ) - x * x; 1790 1791 { 1792 const Int iShiftA2 = 6; 1793 const Int iShiftA1 = 15; 1794 const Int iAccuracyShift = 15; 1795 1796 Int iScaleShiftA2 = 0; 1797 Int iScaleShiftA1 = 0; 1798 Int a1s = a1; 1799 Int a2s = a2; 1800 1801 iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1; 1802 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 1803 1804 if( iScaleShiftA1 < 0 ) 1805 { 1806 iScaleShiftA1 = 0; 1807 } 1808 1809 if( iScaleShiftA2 < 0 ) 1810 { 1811 iScaleShiftA2 = 0; 1812 } 1813 1814 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 1815 1816 a2s = a2 >> iScaleShiftA2; 1817 1818 a1s = a1 >> iScaleShiftA1; 1819 1820 if (a2s >= 1) 1821 { 1822 a = a1s * m_uiaShift[ a2s - 1]; 1823 } 1824 else 1825 { 1826 a = 0; 1827 } 1828 1829 if( iScaleShiftA < 0 ) 1830 { 1831 a = a << -iScaleShiftA; 1832 } 1833 else 1834 { 1835 a = a >> iScaleShiftA; 1836 } 1837 1838 a = Clip3(-( 1 << 15 ), ( 1 << 15 ) - 1, a); 1839 1840 Int minA = -(1 << (6)); 1841 Int maxA = (1 << 6) - 1; 1842 if( a <= maxA && a >= minA ) 1843 { 1844 // do nothing 1845 } 1846 else 1847 { 1848 Short n = CountLeadingZerosOnes(a); 1849 a = a >> (9-n); 1850 iShift -= (9-n); 1851 } 1852 1853 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 1854 } 1855 } 1856 } 1857 #endif 1445 1858 /** Function for filtering intra DC predictor. 1446 1859 * \param pSrc pointer to reconstructed sample array … … 1704 2117 { 1705 2118 assert( uiWidth >= DMM_WEDGEMODEL_MIN_SIZE && uiWidth <= DMM_WEDGEMODEL_MAX_SIZE ); 1706 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])];1707 2119 1708 2120 // get copy of co-located texture luma block … … 1723 2135 UInt uiPredStride = cPredYuv.getStride(); 1724 2136 1725 // regularwedge search2137 // wedge search 1726 2138 TComWedgeDist cWedgeDist; 1727 2139 UInt uiBestDist = MAX_UINT; … … 1729 2141 Int iDC1 = 0; 1730 2142 Int iDC2 = 0; 1731 2143 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; 2144 2145 #if HHIQC_DMMFASTSEARCH_B0039 2146 TComPic* pcPicTex = pcCU->getSlice()->getTexturePic(); 2147 TComDataCU* pcColTexCU = pcPicTex->getCU(pcCU->getAddr()); 2148 UInt uiTexPartIdx = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 2149 Int uiColTexIntraDir = pcColTexCU->isIntra( uiTexPartIdx ) ? pcColTexCU->getLumaIntraDir( uiTexPartIdx ) : 255; 2150 2151 std::vector< std::vector<UInt> > pauiWdgLstSz = g_aauiWdgLstM3[g_aucConvertToBit[uiWidth]]; 2152 if( uiColTexIntraDir > DC_IDX && uiColTexIntraDir < 35 ) 2153 { 2154 std::vector<UInt>* pauiWdgLst = &pauiWdgLstSz[uiColTexIntraDir-2]; 2155 for( UInt uiIdxW = 0; uiIdxW < pauiWdgLst->size(); uiIdxW++ ) 2156 { 2157 UInt uiIdx = pauiWdgLst->at(uiIdxW); 2158 calcWedgeDCs ( &(pacWedgeList->at(uiIdx)), piRefBlkY, uiWidth, iDC1, iDC2 ); 2159 assignWedgeDCs2Pred( &(pacWedgeList->at(uiIdx)), piPred, uiPredStride, iDC1, iDC2 ); 2160 2161 UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD ); 2162 2163 if( uiActDist < uiBestDist || uiBestDist == MAX_UINT ) 2164 { 2165 uiBestDist = uiActDist; 2166 uiBestTabIdx = uiIdx; 2167 } 2168 } 2169 } 2170 else 2171 { 2172 WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 2173 UInt uiBestNodeDist = MAX_UINT; 2174 UInt uiBestNodeId = 0; 2175 for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ ) 2176 { 2177 calcWedgeDCs ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRefBlkY, uiWidth, iDC1, iDC2 ); 2178 assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred, uiPredStride, iDC1, iDC2 ); 2179 2180 UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD ); 2181 2182 if( uiActDist < uiBestNodeDist || uiBestNodeDist == MAX_UINT ) 2183 { 2184 uiBestNodeDist = uiActDist; 2185 uiBestNodeId = uiNodeId; 2186 } 2187 } 2188 2189 // refinement 2190 uiBestDist = uiBestNodeDist; 2191 uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx(); 2192 for( UInt uiRefId = 0; uiRefId < NUM_WEDGE_REFINES; uiRefId++ ) 2193 { 2194 if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != NO_IDX ) 2195 { 2196 calcWedgeDCs ( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piRefBlkY, uiWidth, iDC1, iDC2 ); 2197 assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piPred, uiPredStride, iDC1, iDC2 ); 2198 2199 UInt uiActDist = cWedgeDist.getDistPart( piPred, uiPredStride, piRefBlkY, uiWidth, uiWidth, uiHeight, WedgeDist_SAD ); 2200 2201 if( uiActDist < uiBestDist || uiBestDist == MAX_UINT ) 2202 { 2203 uiBestDist = uiActDist; 2204 uiBestTabIdx = pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ); 2205 } 2206 } 2207 } 2208 } 2209 #else 1732 2210 for( UInt uiIdx = 0; uiIdx < pacWedgeList->size(); uiIdx++ ) 1733 2211 { … … 1743 2221 } 1744 2222 } 2223 #endif 1745 2224 1746 2225 cPredYuv.destroy(); -
trunk/source/Lib/TLibCommon/TComPrediction.h
r100 r189 100 100 #endif 101 101 102 #if LGE_ILLUCOMP_B0045 103 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false ); 104 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi, Bool bICFlag = false ); 105 #else 102 106 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 107 #endif 103 108 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 104 109 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 105 110 106 111 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 107 112 #if LGE_ILLUCOMP_B0045 113 Void xGetLLSICPrediction(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift); 114 Void xGetLLSICPredictionChroma(TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, Int iChromaId); 115 #endif 108 116 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 109 117 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); … … 125 133 #endif 126 134 127 #if LGE_EDGE_INTRA 135 #if LGE_EDGE_INTRA_A0070 128 136 Pel xGetNearestNeighbor ( Int x, Int y, Int* pSrc, Int srcStride, Int iWidth, Int iHeight, Bool* bpRegion ); 129 137 Void xPredIntraEdge ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, Bool bDelta = false ); … … 175 183 Bool getWedgePatternIdx ( WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ); 176 184 #endif 177 #if LGE_EDGE_INTRA 185 #if LGE_EDGE_INTRA_A0070 178 186 Void predIntraLumaEdge ( TComDataCU* pcCU, TComPattern* pcTComPattern, UInt uiAbsPartIdx, Int iWidth, Int iHeight, Pel* piPred, UInt uiStride, Bool bDelta = false ); 179 187 #endif -
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r100 r189 543 543 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 544 544 #endif 545 #if LGE_ILLUCOMP_B0045 546 cDtParam.bUseIC = false; 547 #endif 545 548 return cDtParam.DistFunc( &cDtParam ); 546 549 } … … 565 568 566 569 #if WEIGHTED_CHROMA_DISTORTION 570 #if LGE_ILLUCOMP_B0045 571 cDtParam.bUseIC = false; 572 #endif 567 573 if (bWeighted) 568 574 { … … 598 604 cDtParam.uiComp = 255; // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed. 599 605 606 #if LGE_ILLUCOMP_B0045 607 cDtParam.bUseIC = false; 608 #endif 600 609 return cDtParam.DistFunc( &cDtParam ); 601 610 } 602 611 #endif 603 612 604 605 // ====================================================================================================================606 // Distortion functions607 // ====================================================================================================================608 609 // --------------------------------------------------------------------------------------------------------------------610 // SAD611 // --------------------------------------------------------------------------------------------------------------------612 613 613 UInt TComRdCost::xGetSAD( DistParam* pcDtParam ) 614 614 { … … 617 617 return xGetSADw( pcDtParam ); 618 618 } 619 #if LGE_ILLUCOMP_B0045 620 if(pcDtParam->bUseIC) 621 { 622 return xGetSADic( pcDtParam ); 623 } 624 #endif 619 625 Pel* piOrg = pcDtParam->pOrg; 620 626 Pel* piCur = pcDtParam->pCur; … … 623 629 Int iStrideCur = pcDtParam->iStrideCur; 624 630 Int iStrideOrg = pcDtParam->iStrideOrg; 625 626 UInt uiSum = 0; 627 631 632 UInt uiSum = 0; 633 628 634 for( ; iRows != 0; iRows-- ) 629 635 { … … 635 641 piCur += iStrideCur; 636 642 } 637 643 638 644 return ( uiSum >> g_uiBitIncrement ); 639 645 } … … 645 651 return xGetSADw( pcDtParam ); 646 652 } 653 #if LGE_ILLUCOMP_B0045 654 if(pcDtParam->bUseIC) 655 { 656 return xGetSAD4ic( pcDtParam ); 657 } 658 #endif 647 659 Pel* piOrg = pcDtParam->pOrg; 648 660 Pel* piCur = pcDtParam->pCur; … … 652 664 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 653 665 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 654 655 UInt uiSum = 0; 656 666 667 UInt uiSum = 0; 668 657 669 for( ; iRows != 0; iRows-=iSubStep ) 658 670 { … … 661 673 uiSum += abs( piOrg[2] - piCur[2] ); 662 674 uiSum += abs( piOrg[3] - piCur[3] ); 663 664 piOrg += iStrideOrg; 665 piCur += iStrideCur; 666 } 667 675 676 piOrg += iStrideOrg; 677 piCur += iStrideCur; 678 } 679 668 680 uiSum <<= iSubShift; 669 681 return ( uiSum >> g_uiBitIncrement ); … … 676 688 return xGetSADw( pcDtParam ); 677 689 } 690 #if LGE_ILLUCOMP_B0045 691 if(pcDtParam->bUseIC) 692 { 693 return xGetSAD8ic( pcDtParam ); 694 } 695 #endif 678 696 Pel* piOrg = pcDtParam->pOrg; 679 697 Pel* piCur = pcDtParam->pCur; … … 683 701 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 684 702 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 685 686 UInt uiSum = 0; 687 703 704 UInt uiSum = 0; 705 688 706 for( ; iRows != 0; iRows-=iSubStep ) 689 707 { … … 696 714 uiSum += abs( piOrg[6] - piCur[6] ); 697 715 uiSum += abs( piOrg[7] - piCur[7] ); 698 699 piOrg += iStrideOrg; 700 piCur += iStrideCur; 701 } 702 716 717 piOrg += iStrideOrg; 718 piCur += iStrideCur; 719 } 720 703 721 uiSum <<= iSubShift; 704 722 return ( uiSum >> g_uiBitIncrement ); … … 711 729 return xGetSADw( pcDtParam ); 712 730 } 731 #if LGE_ILLUCOMP_B0045 732 if(pcDtParam->bUseIC) 733 { 734 return xGetSAD16ic( pcDtParam ); 735 } 736 #endif 713 737 Pel* piOrg = pcDtParam->pOrg; 714 738 Pel* piCur = pcDtParam->pCur; … … 718 742 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 719 743 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 720 721 UInt uiSum = 0; 722 744 745 UInt uiSum = 0; 746 723 747 for( ; iRows != 0; iRows-=iSubStep ) 724 748 { … … 739 763 uiSum += abs( piOrg[14] - piCur[14] ); 740 764 uiSum += abs( piOrg[15] - piCur[15] ); 741 742 piOrg += iStrideOrg; 743 piCur += iStrideCur; 744 } 745 765 766 piOrg += iStrideOrg; 767 piCur += iStrideCur; 768 } 769 746 770 uiSum <<= iSubShift; 747 771 return ( uiSum >> g_uiBitIncrement ); … … 755 779 return xGetSADw( pcDtParam ); 756 780 } 781 #if LGE_ILLUCOMP_B0045 782 if(pcDtParam->bUseIC) 783 { 784 return xGetSAD12ic( pcDtParam ); 785 } 786 #endif 757 787 Pel* piOrg = pcDtParam->pOrg; 758 788 Pel* piCur = pcDtParam->pCur; … … 762 792 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 763 793 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 764 765 UInt uiSum = 0; 766 794 795 UInt uiSum = 0; 796 767 797 for( ; iRows != 0; iRows-=iSubStep ) 768 798 { … … 779 809 uiSum += abs( piOrg[10] - piCur[10] ); 780 810 uiSum += abs( piOrg[11] - piCur[11] ); 781 782 piOrg += iStrideOrg; 783 piCur += iStrideCur; 784 } 785 811 812 piOrg += iStrideOrg; 813 piCur += iStrideCur; 814 } 815 786 816 uiSum <<= iSubShift; 787 817 return ( uiSum >> g_uiBitIncrement ); … … 791 821 UInt TComRdCost::xGetSAD16N( DistParam* pcDtParam ) 792 822 { 823 #if LGE_ILLUCOMP_B0045 824 if(pcDtParam->bUseIC) 825 { 826 return xGetSAD16Nic( pcDtParam ); 827 } 828 #endif 793 829 Pel* piOrg = pcDtParam->pOrg; 794 830 Pel* piCur = pcDtParam->pCur; … … 799 835 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 800 836 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 801 802 UInt uiSum = 0; 803 837 838 UInt uiSum = 0; 839 804 840 for( ; iRows != 0; iRows-=iSubStep ) 805 841 { … … 826 862 piCur += iStrideCur; 827 863 } 828 864 829 865 uiSum <<= iSubShift; 830 866 return ( uiSum >> g_uiBitIncrement ); … … 837 873 return xGetSADw( pcDtParam ); 838 874 } 875 #if LGE_ILLUCOMP_B0045 876 if(pcDtParam->bUseIC) 877 { 878 return xGetSAD32ic( pcDtParam ); 879 } 880 #endif 839 881 Pel* piOrg = pcDtParam->pOrg; 840 882 Pel* piCur = pcDtParam->pCur; … … 844 886 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 845 887 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 846 847 UInt uiSum = 0; 848 888 889 UInt uiSum = 0; 890 849 891 for( ; iRows != 0; iRows-=iSubStep ) 850 892 { … … 881 923 uiSum += abs( piOrg[30] - piCur[30] ); 882 924 uiSum += abs( piOrg[31] - piCur[31] ); 883 884 piOrg += iStrideOrg; 885 piCur += iStrideCur; 886 } 887 925 926 piOrg += iStrideOrg; 927 piCur += iStrideCur; 928 } 929 888 930 uiSum <<= iSubShift; 889 931 return ( uiSum >> g_uiBitIncrement ); … … 897 939 return xGetSADw( pcDtParam ); 898 940 } 941 #if LGE_ILLUCOMP_B0045 942 if(pcDtParam->bUseIC) 943 { 944 return xGetSAD24ic( pcDtParam ); 945 } 946 #endif 899 947 Pel* piOrg = pcDtParam->pOrg; 900 948 Pel* piCur = pcDtParam->pCur; … … 904 952 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 905 953 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 906 907 UInt uiSum = 0; 908 954 955 UInt uiSum = 0; 956 909 957 for( ; iRows != 0; iRows-=iSubStep ) 910 958 { … … 933 981 uiSum += abs( piOrg[22] - piCur[22] ); 934 982 uiSum += abs( piOrg[23] - piCur[23] ); 935 936 piOrg += iStrideOrg; 937 piCur += iStrideCur; 938 } 939 983 984 piOrg += iStrideOrg; 985 piCur += iStrideCur; 986 } 987 940 988 uiSum <<= iSubShift; 941 989 return ( uiSum >> g_uiBitIncrement ); … … 950 998 return xGetSADw( pcDtParam ); 951 999 } 1000 #if LGE_ILLUCOMP_B0045 1001 if(pcDtParam->bUseIC) 1002 { 1003 return xGetSAD64ic( pcDtParam ); 1004 } 1005 #endif 952 1006 Pel* piOrg = pcDtParam->pOrg; 953 1007 Pel* piCur = pcDtParam->pCur; … … 957 1011 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 958 1012 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 959 960 UInt uiSum = 0; 961 1013 1014 UInt uiSum = 0; 1015 962 1016 for( ; iRows != 0; iRows-=iSubStep ) 963 1017 { … … 1026 1080 uiSum += abs( piOrg[62] - piCur[62] ); 1027 1081 uiSum += abs( piOrg[63] - piCur[63] ); 1028 1029 piOrg += iStrideOrg; 1030 piCur += iStrideCur; 1031 } 1032 1082 1083 piOrg += iStrideOrg; 1084 piCur += iStrideCur; 1085 } 1086 1033 1087 uiSum <<= iSubShift; 1034 1088 return ( uiSum >> g_uiBitIncrement ); … … 1042 1096 return xGetSADw( pcDtParam ); 1043 1097 } 1098 #if LGE_ILLUCOMP_B0045 1099 if(pcDtParam->bUseIC) 1100 { 1101 return xGetSAD48ic( pcDtParam ); 1102 } 1103 #endif 1044 1104 Pel* piOrg = pcDtParam->pOrg; 1045 1105 Pel* piCur = pcDtParam->pCur; … … 1049 1109 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1050 1110 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1051 1052 UInt uiSum = 0; 1053 1111 1112 UInt uiSum = 0; 1113 1054 1114 for( ; iRows != 0; iRows-=iSubStep ) 1055 1115 { … … 1102 1162 uiSum += abs( piOrg[46] - piCur[46] ); 1103 1163 uiSum += abs( piOrg[47] - piCur[47] ); 1104 1105 piOrg += iStrideOrg; 1106 piCur += iStrideCur; 1107 } 1108 1164 1165 piOrg += iStrideOrg; 1166 piCur += iStrideCur; 1167 } 1168 1109 1169 uiSum <<= iSubShift; 1110 1170 return ( uiSum >> g_uiBitIncrement ); 1111 1171 } 1172 #endif 1173 1174 // ==================================================================================================================== 1175 // Distortion functions 1176 // ==================================================================================================================== 1177 1178 // -------------------------------------------------------------------------------------------------------------------- 1179 // SAD 1180 // -------------------------------------------------------------------------------------------------------------------- 1181 #if LGE_ILLUCOMP_B0045 1182 UInt TComRdCost::xGetSADic( DistParam* pcDtParam ) 1183 { 1184 if ( pcDtParam->bApplyWeight ) 1185 { 1186 return xGetSADw( pcDtParam ); 1187 } 1188 Pel* piOrg = pcDtParam->pOrg; 1189 Pel* piCur = pcDtParam->pCur; 1190 Int iRows = pcDtParam->iRows; 1191 Int iCols = pcDtParam->iCols; 1192 Int iStrideCur = pcDtParam->iStrideCur; 1193 Int iStrideOrg = pcDtParam->iStrideOrg; 1194 1195 UInt uiSum = 0; 1196 1197 Int iOrigAvg = 0, iCurAvg = 0; 1198 Int iDeltaC; 1199 1200 for( ; iRows != 0; iRows-- ) 1201 { 1202 for (Int n = 0; n < iCols; n++ ) 1203 { 1204 iOrigAvg += piOrg[n]; 1205 iCurAvg += piCur[n]; 1206 } 1207 piOrg += iStrideOrg; 1208 piCur += iStrideCur; 1209 } 1210 1211 piOrg = pcDtParam->pOrg; 1212 piCur = pcDtParam->pCur; 1213 iRows = pcDtParam->iRows; 1214 1215 iDeltaC = (iOrigAvg - iCurAvg)/iCols/iRows; 1216 1217 for( ; iRows != 0; iRows-- ) 1218 { 1219 for (Int n = 0; n < iCols; n++ ) 1220 { 1221 uiSum += abs( piOrg[n] - piCur[n] - iDeltaC ); 1222 } 1223 piOrg += iStrideOrg; 1224 piCur += iStrideCur; 1225 } 1226 1227 return ( uiSum >> g_uiBitIncrement ); 1228 } 1229 1230 UInt TComRdCost::xGetSAD4ic( DistParam* pcDtParam ) 1231 { 1232 if ( pcDtParam->bApplyWeight ) 1233 { 1234 return xGetSADw( pcDtParam ); 1235 } 1236 Pel* piOrg = pcDtParam->pOrg; 1237 Pel* piCur = pcDtParam->pCur; 1238 Int iRows = pcDtParam->iRows; 1239 Int iSubShift = pcDtParam->iSubShift; 1240 Int iSubStep = ( 1 << iSubShift ); 1241 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1242 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1243 1244 UInt uiSum = 0; 1245 1246 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1247 Int iDeltaC; 1248 1249 for( ; iRows != 0; iRows-=iSubStep ) 1250 { 1251 iOrigAvg += piOrg[0]; 1252 iOrigAvg += piOrg[1]; 1253 iOrigAvg += piOrg[2]; 1254 iOrigAvg += piOrg[3]; 1255 1256 iCurAvg += piCur[0]; 1257 iCurAvg += piCur[1]; 1258 iCurAvg += piCur[2]; 1259 iCurAvg += piCur[3]; 1260 1261 piOrg += iStrideOrg; 1262 piCur += iStrideCur; 1263 uiRowCnt++; 1264 } 1265 1266 piOrg = pcDtParam->pOrg; 1267 piCur = pcDtParam->pCur; 1268 iRows = pcDtParam->iRows; 1269 1270 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/4) : 0; 1271 1272 for( ; iRows != 0; iRows-=iSubStep ) 1273 { 1274 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1275 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1276 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1277 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1278 1279 piOrg += iStrideOrg; 1280 piCur += iStrideCur; 1281 } 1282 1283 uiSum <<= iSubShift; 1284 return ( uiSum >> g_uiBitIncrement ); 1285 } 1286 1287 UInt TComRdCost::xGetSAD8ic( DistParam* pcDtParam ) 1288 { 1289 if ( pcDtParam->bApplyWeight ) 1290 { 1291 return xGetSADw( pcDtParam ); 1292 } 1293 Pel* piOrg = pcDtParam->pOrg; 1294 Pel* piCur = pcDtParam->pCur; 1295 Int iRows = pcDtParam->iRows; 1296 Int iSubShift = pcDtParam->iSubShift; 1297 Int iSubStep = ( 1 << iSubShift ); 1298 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1299 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1300 1301 UInt uiSum = 0; 1302 1303 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1304 Int iDeltaC; 1305 1306 for( ; iRows != 0; iRows-=iSubStep ) 1307 { 1308 iOrigAvg += piOrg[0]; 1309 iOrigAvg += piOrg[1]; 1310 iOrigAvg += piOrg[2]; 1311 iOrigAvg += piOrg[3]; 1312 iOrigAvg += piOrg[4]; 1313 iOrigAvg += piOrg[5]; 1314 iOrigAvg += piOrg[6]; 1315 iOrigAvg += piOrg[7]; 1316 1317 iCurAvg += piCur[0]; 1318 iCurAvg += piCur[1]; 1319 iCurAvg += piCur[2]; 1320 iCurAvg += piCur[3]; 1321 iCurAvg += piCur[4]; 1322 iCurAvg += piCur[5]; 1323 iCurAvg += piCur[6]; 1324 iCurAvg += piCur[7]; 1325 1326 piOrg += iStrideOrg; 1327 piCur += iStrideCur; 1328 uiRowCnt++; 1329 } 1330 1331 piOrg = pcDtParam->pOrg; 1332 piCur = pcDtParam->pCur; 1333 iRows = pcDtParam->iRows; 1334 1335 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/8) : 0; 1336 1337 for( ; iRows != 0; iRows-=iSubStep ) 1338 { 1339 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1340 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1341 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1342 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1343 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1344 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1345 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1346 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1347 1348 piOrg += iStrideOrg; 1349 piCur += iStrideCur; 1350 } 1351 1352 uiSum <<= iSubShift; 1353 return ( uiSum >> g_uiBitIncrement ); 1354 } 1355 1356 UInt TComRdCost::xGetSAD16ic( DistParam* pcDtParam ) 1357 { 1358 if ( pcDtParam->bApplyWeight ) 1359 { 1360 return xGetSADw( pcDtParam ); 1361 } 1362 Pel* piOrg = pcDtParam->pOrg; 1363 Pel* piCur = pcDtParam->pCur; 1364 Int iRows = pcDtParam->iRows; 1365 Int iSubShift = pcDtParam->iSubShift; 1366 Int iSubStep = ( 1 << iSubShift ); 1367 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1368 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1369 1370 UInt uiSum = 0; 1371 1372 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1373 Int iDeltaC; 1374 1375 for( ; iRows != 0; iRows-=iSubStep ) 1376 { 1377 iOrigAvg += piOrg[0]; 1378 iOrigAvg += piOrg[1]; 1379 iOrigAvg += piOrg[2]; 1380 iOrigAvg += piOrg[3]; 1381 iOrigAvg += piOrg[4]; 1382 iOrigAvg += piOrg[5]; 1383 iOrigAvg += piOrg[6]; 1384 iOrigAvg += piOrg[7]; 1385 iOrigAvg += piOrg[8]; 1386 iOrigAvg += piOrg[9]; 1387 iOrigAvg += piOrg[10]; 1388 iOrigAvg += piOrg[11]; 1389 iOrigAvg += piOrg[12]; 1390 iOrigAvg += piOrg[13]; 1391 iOrigAvg += piOrg[14]; 1392 iOrigAvg += piOrg[15]; 1393 1394 iCurAvg += piCur[0]; 1395 iCurAvg += piCur[1]; 1396 iCurAvg += piCur[2]; 1397 iCurAvg += piCur[3]; 1398 iCurAvg += piCur[4]; 1399 iCurAvg += piCur[5]; 1400 iCurAvg += piCur[6]; 1401 iCurAvg += piCur[7]; 1402 iCurAvg += piCur[8]; 1403 iCurAvg += piCur[9]; 1404 iCurAvg += piCur[10]; 1405 iCurAvg += piCur[11]; 1406 iCurAvg += piCur[12]; 1407 iCurAvg += piCur[13]; 1408 iCurAvg += piCur[14]; 1409 iCurAvg += piCur[15]; 1410 1411 piOrg += iStrideOrg; 1412 piCur += iStrideCur; 1413 uiRowCnt++; 1414 } 1415 1416 piOrg = pcDtParam->pOrg; 1417 piCur = pcDtParam->pCur; 1418 iRows = pcDtParam->iRows; 1419 1420 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/16) : 0; 1421 1422 for( ; iRows != 0; iRows-=iSubStep ) 1423 { 1424 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1425 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1426 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1427 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1428 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1429 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1430 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1431 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1432 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1433 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1434 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1435 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1436 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 1437 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 1438 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 1439 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 1440 1441 piOrg += iStrideOrg; 1442 piCur += iStrideCur; 1443 } 1444 1445 uiSum <<= iSubShift; 1446 return ( uiSum >> g_uiBitIncrement ); 1447 } 1448 1449 #if AMP_SAD 1450 UInt TComRdCost::xGetSAD12ic( DistParam* pcDtParam ) 1451 { 1452 if ( pcDtParam->bApplyWeight ) 1453 { 1454 return xGetSADw( pcDtParam ); 1455 } 1456 Pel* piOrg = pcDtParam->pOrg; 1457 Pel* piCur = pcDtParam->pCur; 1458 Int iRows = pcDtParam->iRows; 1459 Int iSubShift = pcDtParam->iSubShift; 1460 Int iSubStep = ( 1 << iSubShift ); 1461 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1462 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1463 1464 UInt uiSum = 0; 1465 1466 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1467 Int iDeltaC; 1468 1469 for( ; iRows != 0; iRows-=iSubStep ) 1470 { 1471 iOrigAvg += piOrg[0]; 1472 iOrigAvg += piOrg[1]; 1473 iOrigAvg += piOrg[2]; 1474 iOrigAvg += piOrg[3]; 1475 iOrigAvg += piOrg[4]; 1476 iOrigAvg += piOrg[5]; 1477 iOrigAvg += piOrg[6]; 1478 iOrigAvg += piOrg[7]; 1479 iOrigAvg += piOrg[8]; 1480 iOrigAvg += piOrg[9]; 1481 iOrigAvg += piOrg[10]; 1482 iOrigAvg += piOrg[11]; 1483 1484 iCurAvg += piCur[0]; 1485 iCurAvg += piCur[1]; 1486 iCurAvg += piCur[2]; 1487 iCurAvg += piCur[3]; 1488 iCurAvg += piCur[4]; 1489 iCurAvg += piCur[5]; 1490 iCurAvg += piCur[6]; 1491 iCurAvg += piCur[7]; 1492 iCurAvg += piCur[8]; 1493 iCurAvg += piCur[9]; 1494 iCurAvg += piCur[10]; 1495 iCurAvg += piCur[11]; 1496 1497 piOrg += iStrideOrg; 1498 piCur += iStrideCur; 1499 uiRowCnt++; 1500 } 1501 1502 piOrg = pcDtParam->pOrg; 1503 piCur = pcDtParam->pCur; 1504 iRows = pcDtParam->iRows; 1505 1506 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/12) : 0; 1507 1508 for( ; iRows != 0; iRows-=iSubStep ) 1509 { 1510 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1511 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1512 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1513 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1514 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1515 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1516 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1517 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1518 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1519 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1520 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1521 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1522 1523 piOrg += iStrideOrg; 1524 piCur += iStrideCur; 1525 } 1526 1527 uiSum <<= iSubShift; 1528 return ( uiSum >> g_uiBitIncrement ); 1529 } 1530 #endif 1531 1532 UInt TComRdCost::xGetSAD16Nic( DistParam* pcDtParam ) 1533 { 1534 Pel* piOrg = pcDtParam->pOrg; 1535 Pel* piCur = pcDtParam->pCur; 1536 Int iRows = pcDtParam->iRows; 1537 Int iCols = pcDtParam->iCols; 1538 Int iSubShift = pcDtParam->iSubShift; 1539 Int iSubStep = ( 1 << iSubShift ); 1540 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1541 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1542 1543 UInt uiSum = 0; 1544 1545 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0, uiColCnt = (iCols-1)/16 + 1; 1546 Int iDeltaC; 1547 1548 for( ; iRows != 0; iRows-=iSubStep ) 1549 { 1550 for (Int n = 0; n < iCols; n+=16 ) 1551 { 1552 iOrigAvg += piOrg[n + 0]; 1553 iOrigAvg += piOrg[n + 1]; 1554 iOrigAvg += piOrg[n + 2]; 1555 iOrigAvg += piOrg[n + 3]; 1556 iOrigAvg += piOrg[n + 4]; 1557 iOrigAvg += piOrg[n + 5]; 1558 iOrigAvg += piOrg[n + 6]; 1559 iOrigAvg += piOrg[n + 7]; 1560 iOrigAvg += piOrg[n + 8]; 1561 iOrigAvg += piOrg[n + 9]; 1562 iOrigAvg += piOrg[n + 10]; 1563 iOrigAvg += piOrg[n + 11]; 1564 iOrigAvg += piOrg[n + 12]; 1565 iOrigAvg += piOrg[n + 13]; 1566 iOrigAvg += piOrg[n + 14]; 1567 iOrigAvg += piOrg[n + 15]; 1568 1569 iCurAvg += piCur[n + 0]; 1570 iCurAvg += piCur[n + 1]; 1571 iCurAvg += piCur[n + 2]; 1572 iCurAvg += piCur[n + 3]; 1573 iCurAvg += piCur[n + 4]; 1574 iCurAvg += piCur[n + 5]; 1575 iCurAvg += piCur[n + 6]; 1576 iCurAvg += piCur[n + 7]; 1577 iCurAvg += piCur[n + 8]; 1578 iCurAvg += piCur[n + 9]; 1579 iCurAvg += piCur[n + 10]; 1580 iCurAvg += piCur[n + 11]; 1581 iCurAvg += piCur[n + 12]; 1582 iCurAvg += piCur[n + 13]; 1583 iCurAvg += piCur[n + 14]; 1584 iCurAvg += piCur[n + 15]; 1585 } 1586 piOrg += iStrideOrg; 1587 piCur += iStrideCur; 1588 uiRowCnt++; 1589 } 1590 piOrg = pcDtParam->pOrg; 1591 piCur = pcDtParam->pCur; 1592 iRows = pcDtParam->iRows; 1593 1594 iDeltaC = (uiRowCnt && uiColCnt) ? ((iOrigAvg - iCurAvg)/uiRowCnt/uiColCnt/16) : 0; 1595 1596 for( ; iRows != 0; iRows-=iSubStep ) 1597 { 1598 for (Int n = 0; n < iCols; n+=16 ) 1599 { 1600 uiSum += abs( piOrg[n+ 0] - piCur[n+ 0] - iDeltaC ); 1601 uiSum += abs( piOrg[n+ 1] - piCur[n+ 1] - iDeltaC ); 1602 uiSum += abs( piOrg[n+ 2] - piCur[n+ 2] - iDeltaC ); 1603 uiSum += abs( piOrg[n+ 3] - piCur[n+ 3] - iDeltaC ); 1604 uiSum += abs( piOrg[n+ 4] - piCur[n+ 4] - iDeltaC ); 1605 uiSum += abs( piOrg[n+ 5] - piCur[n+ 5] - iDeltaC ); 1606 uiSum += abs( piOrg[n+ 6] - piCur[n+ 6] - iDeltaC ); 1607 uiSum += abs( piOrg[n+ 7] - piCur[n+ 7] - iDeltaC ); 1608 uiSum += abs( piOrg[n+ 8] - piCur[n+ 8] - iDeltaC ); 1609 uiSum += abs( piOrg[n+ 9] - piCur[n+ 9] - iDeltaC ); 1610 uiSum += abs( piOrg[n+10] - piCur[n+10] - iDeltaC ); 1611 uiSum += abs( piOrg[n+11] - piCur[n+11] - iDeltaC ); 1612 uiSum += abs( piOrg[n+12] - piCur[n+12] - iDeltaC ); 1613 uiSum += abs( piOrg[n+13] - piCur[n+13] - iDeltaC ); 1614 uiSum += abs( piOrg[n+14] - piCur[n+14] - iDeltaC ); 1615 uiSum += abs( piOrg[n+15] - piCur[n+15] - iDeltaC ); 1616 } 1617 piOrg += iStrideOrg; 1618 piCur += iStrideCur; 1619 } 1620 1621 uiSum <<= iSubShift; 1622 return ( uiSum >> g_uiBitIncrement ); 1623 } 1624 1625 UInt TComRdCost::xGetSAD32ic( DistParam* pcDtParam ) 1626 { 1627 if ( pcDtParam->bApplyWeight ) 1628 { 1629 return xGetSADw( pcDtParam ); 1630 } 1631 Pel* piOrg = pcDtParam->pOrg; 1632 Pel* piCur = pcDtParam->pCur; 1633 Int iRows = pcDtParam->iRows; 1634 Int iSubShift = pcDtParam->iSubShift; 1635 Int iSubStep = ( 1 << iSubShift ); 1636 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1637 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1638 1639 UInt uiSum = 0; 1640 1641 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1642 Int iDeltaC; 1643 1644 for( ; iRows != 0; iRows-=iSubStep ) 1645 { 1646 iOrigAvg += piOrg[0]; 1647 iOrigAvg += piOrg[1]; 1648 iOrigAvg += piOrg[2]; 1649 iOrigAvg += piOrg[3]; 1650 iOrigAvg += piOrg[4]; 1651 iOrigAvg += piOrg[5]; 1652 iOrigAvg += piOrg[6]; 1653 iOrigAvg += piOrg[7]; 1654 iOrigAvg += piOrg[8]; 1655 iOrigAvg += piOrg[9]; 1656 iOrigAvg += piOrg[10]; 1657 iOrigAvg += piOrg[11]; 1658 iOrigAvg += piOrg[12]; 1659 iOrigAvg += piOrg[13]; 1660 iOrigAvg += piOrg[14]; 1661 iOrigAvg += piOrg[15]; 1662 iOrigAvg += piOrg[16]; 1663 iOrigAvg += piOrg[17]; 1664 iOrigAvg += piOrg[18]; 1665 iOrigAvg += piOrg[19]; 1666 iOrigAvg += piOrg[20]; 1667 iOrigAvg += piOrg[21]; 1668 iOrigAvg += piOrg[22]; 1669 iOrigAvg += piOrg[23]; 1670 iOrigAvg += piOrg[24]; 1671 iOrigAvg += piOrg[25]; 1672 iOrigAvg += piOrg[26]; 1673 iOrigAvg += piOrg[27]; 1674 iOrigAvg += piOrg[28]; 1675 iOrigAvg += piOrg[29]; 1676 iOrigAvg += piOrg[30]; 1677 iOrigAvg += piOrg[31]; 1678 1679 iCurAvg += piCur[0]; 1680 iCurAvg += piCur[1]; 1681 iCurAvg += piCur[2]; 1682 iCurAvg += piCur[3]; 1683 iCurAvg += piCur[4]; 1684 iCurAvg += piCur[5]; 1685 iCurAvg += piCur[6]; 1686 iCurAvg += piCur[7]; 1687 iCurAvg += piCur[8]; 1688 iCurAvg += piCur[9]; 1689 iCurAvg += piCur[10]; 1690 iCurAvg += piCur[11]; 1691 iCurAvg += piCur[12]; 1692 iCurAvg += piCur[13]; 1693 iCurAvg += piCur[14]; 1694 iCurAvg += piCur[15]; 1695 iCurAvg += piCur[16]; 1696 iCurAvg += piCur[17]; 1697 iCurAvg += piCur[18]; 1698 iCurAvg += piCur[19]; 1699 iCurAvg += piCur[20]; 1700 iCurAvg += piCur[21]; 1701 iCurAvg += piCur[22]; 1702 iCurAvg += piCur[23]; 1703 iCurAvg += piCur[24]; 1704 iCurAvg += piCur[25]; 1705 iCurAvg += piCur[26]; 1706 iCurAvg += piCur[27]; 1707 iCurAvg += piCur[28]; 1708 iCurAvg += piCur[29]; 1709 iCurAvg += piCur[30]; 1710 iCurAvg += piCur[31]; 1711 1712 piOrg += iStrideOrg; 1713 piCur += iStrideCur; 1714 uiRowCnt++; 1715 } 1716 1717 piOrg = pcDtParam->pOrg; 1718 piCur = pcDtParam->pCur; 1719 iRows = pcDtParam->iRows; 1720 1721 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/32) : 0; 1722 1723 for( ; iRows != 0; iRows-=iSubStep ) 1724 { 1725 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1726 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1727 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1728 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1729 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1730 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1731 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1732 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1733 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1734 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1735 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1736 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1737 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 1738 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 1739 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 1740 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 1741 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 1742 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 1743 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 1744 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 1745 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 1746 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 1747 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 1748 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 1749 uiSum += abs( piOrg[24] - piCur[24] - iDeltaC ); 1750 uiSum += abs( piOrg[25] - piCur[25] - iDeltaC ); 1751 uiSum += abs( piOrg[26] - piCur[26] - iDeltaC ); 1752 uiSum += abs( piOrg[27] - piCur[27] - iDeltaC ); 1753 uiSum += abs( piOrg[28] - piCur[28] - iDeltaC ); 1754 uiSum += abs( piOrg[29] - piCur[29] - iDeltaC ); 1755 uiSum += abs( piOrg[30] - piCur[30] - iDeltaC ); 1756 uiSum += abs( piOrg[31] - piCur[31] - iDeltaC ); 1757 1758 piOrg += iStrideOrg; 1759 piCur += iStrideCur; 1760 } 1761 1762 uiSum <<= iSubShift; 1763 return ( uiSum >> g_uiBitIncrement ); 1764 } 1765 1766 #if AMP_SAD 1767 UInt TComRdCost::xGetSAD24ic( DistParam* pcDtParam ) 1768 { 1769 if ( pcDtParam->bApplyWeight ) 1770 { 1771 return xGetSADw( pcDtParam ); 1772 } 1773 Pel* piOrg = pcDtParam->pOrg; 1774 Pel* piCur = pcDtParam->pCur; 1775 Int iRows = pcDtParam->iRows; 1776 Int iSubShift = pcDtParam->iSubShift; 1777 Int iSubStep = ( 1 << iSubShift ); 1778 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1779 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1780 1781 UInt uiSum = 0; 1782 1783 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1784 Int iDeltaC; 1785 1786 for( ; iRows != 0; iRows-=iSubStep ) 1787 { 1788 iOrigAvg += piOrg[0]; 1789 iOrigAvg += piOrg[1]; 1790 iOrigAvg += piOrg[2]; 1791 iOrigAvg += piOrg[3]; 1792 iOrigAvg += piOrg[4]; 1793 iOrigAvg += piOrg[5]; 1794 iOrigAvg += piOrg[6]; 1795 iOrigAvg += piOrg[7]; 1796 iOrigAvg += piOrg[8]; 1797 iOrigAvg += piOrg[9]; 1798 iOrigAvg += piOrg[10]; 1799 iOrigAvg += piOrg[11]; 1800 iOrigAvg += piOrg[12]; 1801 iOrigAvg += piOrg[13]; 1802 iOrigAvg += piOrg[14]; 1803 iOrigAvg += piOrg[15]; 1804 iOrigAvg += piOrg[16]; 1805 iOrigAvg += piOrg[17]; 1806 iOrigAvg += piOrg[18]; 1807 iOrigAvg += piOrg[19]; 1808 iOrigAvg += piOrg[20]; 1809 iOrigAvg += piOrg[21]; 1810 iOrigAvg += piOrg[22]; 1811 iOrigAvg += piOrg[23]; 1812 1813 iCurAvg += piCur[0]; 1814 iCurAvg += piCur[1]; 1815 iCurAvg += piCur[2]; 1816 iCurAvg += piCur[3]; 1817 iCurAvg += piCur[4]; 1818 iCurAvg += piCur[5]; 1819 iCurAvg += piCur[6]; 1820 iCurAvg += piCur[7]; 1821 iCurAvg += piCur[8]; 1822 iCurAvg += piCur[9]; 1823 iCurAvg += piCur[10]; 1824 iCurAvg += piCur[11]; 1825 iCurAvg += piCur[12]; 1826 iCurAvg += piCur[13]; 1827 iCurAvg += piCur[14]; 1828 iCurAvg += piCur[15]; 1829 iCurAvg += piCur[16]; 1830 iCurAvg += piCur[17]; 1831 iCurAvg += piCur[18]; 1832 iCurAvg += piCur[19]; 1833 iCurAvg += piCur[20]; 1834 iCurAvg += piCur[21]; 1835 iCurAvg += piCur[22]; 1836 iCurAvg += piCur[23]; 1837 1838 piOrg += iStrideOrg; 1839 piCur += iStrideCur; 1840 uiRowCnt++; 1841 } 1842 1843 piOrg = pcDtParam->pOrg; 1844 piCur = pcDtParam->pCur; 1845 iRows = pcDtParam->iRows; 1846 1847 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/24) : 0; 1848 1849 for( ; iRows != 0; iRows-=iSubStep ) 1850 { 1851 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 1852 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 1853 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 1854 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 1855 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 1856 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 1857 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 1858 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 1859 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 1860 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 1861 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 1862 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 1863 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 1864 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 1865 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 1866 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 1867 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 1868 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 1869 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 1870 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 1871 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 1872 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 1873 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 1874 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 1875 1876 piOrg += iStrideOrg; 1877 piCur += iStrideCur; 1878 } 1879 1880 uiSum <<= iSubShift; 1881 return ( uiSum >> g_uiBitIncrement ); 1882 } 1883 #endif 1884 1885 UInt TComRdCost::xGetSAD64ic( DistParam* pcDtParam ) 1886 { 1887 if ( pcDtParam->bApplyWeight ) 1888 { 1889 return xGetSADw( pcDtParam ); 1890 } 1891 Pel* piOrg = pcDtParam->pOrg; 1892 Pel* piCur = pcDtParam->pCur; 1893 Int iRows = pcDtParam->iRows; 1894 Int iSubShift = pcDtParam->iSubShift; 1895 Int iSubStep = ( 1 << iSubShift ); 1896 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 1897 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 1898 1899 UInt uiSum = 0; 1900 1901 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 1902 Int iDeltaC; 1903 1904 for( ; iRows != 0; iRows-=iSubStep ) 1905 { 1906 iOrigAvg += piOrg[0] ; 1907 iOrigAvg += piOrg[1] ; 1908 iOrigAvg += piOrg[2] ; 1909 iOrigAvg += piOrg[3] ; 1910 iOrigAvg += piOrg[4] ; 1911 iOrigAvg += piOrg[5] ; 1912 iOrigAvg += piOrg[6] ; 1913 iOrigAvg += piOrg[7] ; 1914 iOrigAvg += piOrg[8] ; 1915 iOrigAvg += piOrg[9] ; 1916 iOrigAvg += piOrg[10] ; 1917 iOrigAvg += piOrg[11] ; 1918 iOrigAvg += piOrg[12] ; 1919 iOrigAvg += piOrg[13] ; 1920 iOrigAvg += piOrg[14] ; 1921 iOrigAvg += piOrg[15] ; 1922 iOrigAvg += piOrg[16] ; 1923 iOrigAvg += piOrg[17] ; 1924 iOrigAvg += piOrg[18] ; 1925 iOrigAvg += piOrg[19] ; 1926 iOrigAvg += piOrg[20] ; 1927 iOrigAvg += piOrg[21] ; 1928 iOrigAvg += piOrg[22] ; 1929 iOrigAvg += piOrg[23] ; 1930 iOrigAvg += piOrg[24] ; 1931 iOrigAvg += piOrg[25] ; 1932 iOrigAvg += piOrg[26] ; 1933 iOrigAvg += piOrg[27] ; 1934 iOrigAvg += piOrg[28] ; 1935 iOrigAvg += piOrg[29] ; 1936 iOrigAvg += piOrg[30] ; 1937 iOrigAvg += piOrg[31] ; 1938 iOrigAvg += piOrg[32] ; 1939 iOrigAvg += piOrg[33] ; 1940 iOrigAvg += piOrg[34] ; 1941 iOrigAvg += piOrg[35] ; 1942 iOrigAvg += piOrg[36] ; 1943 iOrigAvg += piOrg[37] ; 1944 iOrigAvg += piOrg[38] ; 1945 iOrigAvg += piOrg[39] ; 1946 iOrigAvg += piOrg[40] ; 1947 iOrigAvg += piOrg[41] ; 1948 iOrigAvg += piOrg[42] ; 1949 iOrigAvg += piOrg[43] ; 1950 iOrigAvg += piOrg[44] ; 1951 iOrigAvg += piOrg[45] ; 1952 iOrigAvg += piOrg[46] ; 1953 iOrigAvg += piOrg[47] ; 1954 iOrigAvg += piOrg[48] ; 1955 iOrigAvg += piOrg[49] ; 1956 iOrigAvg += piOrg[50] ; 1957 iOrigAvg += piOrg[51] ; 1958 iOrigAvg += piOrg[52] ; 1959 iOrigAvg += piOrg[53] ; 1960 iOrigAvg += piOrg[54] ; 1961 iOrigAvg += piOrg[55] ; 1962 iOrigAvg += piOrg[56] ; 1963 iOrigAvg += piOrg[57] ; 1964 iOrigAvg += piOrg[58] ; 1965 iOrigAvg += piOrg[59] ; 1966 iOrigAvg += piOrg[60] ; 1967 iOrigAvg += piOrg[61] ; 1968 iOrigAvg += piOrg[62] ; 1969 iOrigAvg += piOrg[63] ; 1970 1971 iCurAvg += piCur[0] ; 1972 iCurAvg += piCur[1] ; 1973 iCurAvg += piCur[2] ; 1974 iCurAvg += piCur[3] ; 1975 iCurAvg += piCur[4] ; 1976 iCurAvg += piCur[5] ; 1977 iCurAvg += piCur[6] ; 1978 iCurAvg += piCur[7] ; 1979 iCurAvg += piCur[8] ; 1980 iCurAvg += piCur[9] ; 1981 iCurAvg += piCur[10] ; 1982 iCurAvg += piCur[11] ; 1983 iCurAvg += piCur[12] ; 1984 iCurAvg += piCur[13] ; 1985 iCurAvg += piCur[14] ; 1986 iCurAvg += piCur[15] ; 1987 iCurAvg += piCur[16] ; 1988 iCurAvg += piCur[17] ; 1989 iCurAvg += piCur[18] ; 1990 iCurAvg += piCur[19] ; 1991 iCurAvg += piCur[20] ; 1992 iCurAvg += piCur[21] ; 1993 iCurAvg += piCur[22] ; 1994 iCurAvg += piCur[23] ; 1995 iCurAvg += piCur[24] ; 1996 iCurAvg += piCur[25] ; 1997 iCurAvg += piCur[26] ; 1998 iCurAvg += piCur[27] ; 1999 iCurAvg += piCur[28] ; 2000 iCurAvg += piCur[29] ; 2001 iCurAvg += piCur[30] ; 2002 iCurAvg += piCur[31] ; 2003 iCurAvg += piCur[32] ; 2004 iCurAvg += piCur[33] ; 2005 iCurAvg += piCur[34] ; 2006 iCurAvg += piCur[35] ; 2007 iCurAvg += piCur[36] ; 2008 iCurAvg += piCur[37] ; 2009 iCurAvg += piCur[38] ; 2010 iCurAvg += piCur[39] ; 2011 iCurAvg += piCur[40] ; 2012 iCurAvg += piCur[41] ; 2013 iCurAvg += piCur[42] ; 2014 iCurAvg += piCur[43] ; 2015 iCurAvg += piCur[44] ; 2016 iCurAvg += piCur[45] ; 2017 iCurAvg += piCur[46] ; 2018 iCurAvg += piCur[47] ; 2019 iCurAvg += piCur[48] ; 2020 iCurAvg += piCur[49] ; 2021 iCurAvg += piCur[50] ; 2022 iCurAvg += piCur[51] ; 2023 iCurAvg += piCur[52] ; 2024 iCurAvg += piCur[53] ; 2025 iCurAvg += piCur[54] ; 2026 iCurAvg += piCur[55] ; 2027 iCurAvg += piCur[56] ; 2028 iCurAvg += piCur[57] ; 2029 iCurAvg += piCur[58] ; 2030 iCurAvg += piCur[59] ; 2031 iCurAvg += piCur[60] ; 2032 iCurAvg += piCur[61] ; 2033 iCurAvg += piCur[62] ; 2034 iCurAvg += piCur[63] ; 2035 2036 piOrg += iStrideOrg; 2037 piCur += iStrideCur; 2038 uiRowCnt++; 2039 } 2040 2041 piOrg = pcDtParam->pOrg; 2042 piCur = pcDtParam->pCur; 2043 iRows = pcDtParam->iRows; 2044 2045 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/64) : 0; 2046 2047 for( ; iRows != 0; iRows-=iSubStep ) 2048 { 2049 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 2050 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 2051 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 2052 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 2053 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 2054 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 2055 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 2056 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 2057 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 2058 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 2059 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 2060 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 2061 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 2062 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 2063 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 2064 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 2065 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 2066 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 2067 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 2068 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 2069 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 2070 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 2071 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 2072 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 2073 uiSum += abs( piOrg[24] - piCur[24] - iDeltaC ); 2074 uiSum += abs( piOrg[25] - piCur[25] - iDeltaC ); 2075 uiSum += abs( piOrg[26] - piCur[26] - iDeltaC ); 2076 uiSum += abs( piOrg[27] - piCur[27] - iDeltaC ); 2077 uiSum += abs( piOrg[28] - piCur[28] - iDeltaC ); 2078 uiSum += abs( piOrg[29] - piCur[29] - iDeltaC ); 2079 uiSum += abs( piOrg[30] - piCur[30] - iDeltaC ); 2080 uiSum += abs( piOrg[31] - piCur[31] - iDeltaC ); 2081 uiSum += abs( piOrg[32] - piCur[32] - iDeltaC ); 2082 uiSum += abs( piOrg[33] - piCur[33] - iDeltaC ); 2083 uiSum += abs( piOrg[34] - piCur[34] - iDeltaC ); 2084 uiSum += abs( piOrg[35] - piCur[35] - iDeltaC ); 2085 uiSum += abs( piOrg[36] - piCur[36] - iDeltaC ); 2086 uiSum += abs( piOrg[37] - piCur[37] - iDeltaC ); 2087 uiSum += abs( piOrg[38] - piCur[38] - iDeltaC ); 2088 uiSum += abs( piOrg[39] - piCur[39] - iDeltaC ); 2089 uiSum += abs( piOrg[40] - piCur[40] - iDeltaC ); 2090 uiSum += abs( piOrg[41] - piCur[41] - iDeltaC ); 2091 uiSum += abs( piOrg[42] - piCur[42] - iDeltaC ); 2092 uiSum += abs( piOrg[43] - piCur[43] - iDeltaC ); 2093 uiSum += abs( piOrg[44] - piCur[44] - iDeltaC ); 2094 uiSum += abs( piOrg[45] - piCur[45] - iDeltaC ); 2095 uiSum += abs( piOrg[46] - piCur[46] - iDeltaC ); 2096 uiSum += abs( piOrg[47] - piCur[47] - iDeltaC ); 2097 uiSum += abs( piOrg[48] - piCur[48] - iDeltaC ); 2098 uiSum += abs( piOrg[49] - piCur[49] - iDeltaC ); 2099 uiSum += abs( piOrg[50] - piCur[50] - iDeltaC ); 2100 uiSum += abs( piOrg[51] - piCur[51] - iDeltaC ); 2101 uiSum += abs( piOrg[52] - piCur[52] - iDeltaC ); 2102 uiSum += abs( piOrg[53] - piCur[53] - iDeltaC ); 2103 uiSum += abs( piOrg[54] - piCur[54] - iDeltaC ); 2104 uiSum += abs( piOrg[55] - piCur[55] - iDeltaC ); 2105 uiSum += abs( piOrg[56] - piCur[56] - iDeltaC ); 2106 uiSum += abs( piOrg[57] - piCur[57] - iDeltaC ); 2107 uiSum += abs( piOrg[58] - piCur[58] - iDeltaC ); 2108 uiSum += abs( piOrg[59] - piCur[59] - iDeltaC ); 2109 uiSum += abs( piOrg[60] - piCur[60] - iDeltaC ); 2110 uiSum += abs( piOrg[61] - piCur[61] - iDeltaC ); 2111 uiSum += abs( piOrg[62] - piCur[62] - iDeltaC ); 2112 uiSum += abs( piOrg[63] - piCur[63] - iDeltaC ); 2113 2114 piOrg += iStrideOrg; 2115 piCur += iStrideCur; 2116 } 2117 2118 uiSum <<= iSubShift; 2119 return ( uiSum >> g_uiBitIncrement ); 2120 } 2121 2122 #if AMP_SAD 2123 UInt TComRdCost::xGetSAD48ic( DistParam* pcDtParam ) 2124 { 2125 if ( pcDtParam->bApplyWeight ) 2126 { 2127 return xGetSADw( pcDtParam ); 2128 } 2129 Pel* piOrg = pcDtParam->pOrg; 2130 Pel* piCur = pcDtParam->pCur; 2131 Int iRows = pcDtParam->iRows; 2132 Int iSubShift = pcDtParam->iSubShift; 2133 Int iSubStep = ( 1 << iSubShift ); 2134 Int iStrideCur = pcDtParam->iStrideCur*iSubStep; 2135 Int iStrideOrg = pcDtParam->iStrideOrg*iSubStep; 2136 2137 UInt uiSum = 0; 2138 2139 Int iOrigAvg = 0, iCurAvg = 0, uiRowCnt = 0; 2140 Int iDeltaC; 2141 2142 for( ; iRows != 0; iRows-=iSubStep ) 2143 { 2144 iOrigAvg += piOrg[0] ; 2145 iOrigAvg += piOrg[1] ; 2146 iOrigAvg += piOrg[2] ; 2147 iOrigAvg += piOrg[3] ; 2148 iOrigAvg += piOrg[4] ; 2149 iOrigAvg += piOrg[5] ; 2150 iOrigAvg += piOrg[6] ; 2151 iOrigAvg += piOrg[7] ; 2152 iOrigAvg += piOrg[8] ; 2153 iOrigAvg += piOrg[9] ; 2154 iOrigAvg += piOrg[10] ; 2155 iOrigAvg += piOrg[11] ; 2156 iOrigAvg += piOrg[12] ; 2157 iOrigAvg += piOrg[13] ; 2158 iOrigAvg += piOrg[14] ; 2159 iOrigAvg += piOrg[15] ; 2160 iOrigAvg += piOrg[16] ; 2161 iOrigAvg += piOrg[17] ; 2162 iOrigAvg += piOrg[18] ; 2163 iOrigAvg += piOrg[19] ; 2164 iOrigAvg += piOrg[20] ; 2165 iOrigAvg += piOrg[21] ; 2166 iOrigAvg += piOrg[22] ; 2167 iOrigAvg += piOrg[23] ; 2168 iOrigAvg += piOrg[24] ; 2169 iOrigAvg += piOrg[25] ; 2170 iOrigAvg += piOrg[26] ; 2171 iOrigAvg += piOrg[27] ; 2172 iOrigAvg += piOrg[28] ; 2173 iOrigAvg += piOrg[29] ; 2174 iOrigAvg += piOrg[30] ; 2175 iOrigAvg += piOrg[31] ; 2176 iOrigAvg += piOrg[32] ; 2177 iOrigAvg += piOrg[33] ; 2178 iOrigAvg += piOrg[34] ; 2179 iOrigAvg += piOrg[35] ; 2180 iOrigAvg += piOrg[36] ; 2181 iOrigAvg += piOrg[37] ; 2182 iOrigAvg += piOrg[38] ; 2183 iOrigAvg += piOrg[39] ; 2184 iOrigAvg += piOrg[40] ; 2185 iOrigAvg += piOrg[41] ; 2186 iOrigAvg += piOrg[42] ; 2187 iOrigAvg += piOrg[43] ; 2188 iOrigAvg += piOrg[44] ; 2189 iOrigAvg += piOrg[45] ; 2190 iOrigAvg += piOrg[46] ; 2191 iOrigAvg += piOrg[47] ; 2192 2193 iCurAvg += piCur[0] ; 2194 iCurAvg += piCur[1] ; 2195 iCurAvg += piCur[2] ; 2196 iCurAvg += piCur[3] ; 2197 iCurAvg += piCur[4] ; 2198 iCurAvg += piCur[5] ; 2199 iCurAvg += piCur[6] ; 2200 iCurAvg += piCur[7] ; 2201 iCurAvg += piCur[8] ; 2202 iCurAvg += piCur[9] ; 2203 iCurAvg += piCur[10] ; 2204 iCurAvg += piCur[11] ; 2205 iCurAvg += piCur[12] ; 2206 iCurAvg += piCur[13] ; 2207 iCurAvg += piCur[14] ; 2208 iCurAvg += piCur[15] ; 2209 iCurAvg += piCur[16] ; 2210 iCurAvg += piCur[17] ; 2211 iCurAvg += piCur[18] ; 2212 iCurAvg += piCur[19] ; 2213 iCurAvg += piCur[20] ; 2214 iCurAvg += piCur[21] ; 2215 iCurAvg += piCur[22] ; 2216 iCurAvg += piCur[23] ; 2217 iCurAvg += piCur[24] ; 2218 iCurAvg += piCur[25] ; 2219 iCurAvg += piCur[26] ; 2220 iCurAvg += piCur[27] ; 2221 iCurAvg += piCur[28] ; 2222 iCurAvg += piCur[29] ; 2223 iCurAvg += piCur[30] ; 2224 iCurAvg += piCur[31] ; 2225 iCurAvg += piCur[32] ; 2226 iCurAvg += piCur[33] ; 2227 iCurAvg += piCur[34] ; 2228 iCurAvg += piCur[35] ; 2229 iCurAvg += piCur[36] ; 2230 iCurAvg += piCur[37] ; 2231 iCurAvg += piCur[38] ; 2232 iCurAvg += piCur[39] ; 2233 iCurAvg += piCur[40] ; 2234 iCurAvg += piCur[41] ; 2235 iCurAvg += piCur[42] ; 2236 iCurAvg += piCur[43] ; 2237 iCurAvg += piCur[44] ; 2238 iCurAvg += piCur[45] ; 2239 iCurAvg += piCur[46] ; 2240 iCurAvg += piCur[47] ; 2241 2242 piOrg += iStrideOrg; 2243 piCur += iStrideCur; 2244 uiRowCnt++; 2245 } 2246 2247 piOrg = pcDtParam->pOrg; 2248 piCur = pcDtParam->pCur; 2249 iRows = pcDtParam->iRows; 2250 2251 iDeltaC = uiRowCnt ? ((iOrigAvg - iCurAvg)/uiRowCnt/48) : 0; 2252 2253 for( ; iRows != 0; iRows-=iSubStep ) 2254 { 2255 uiSum += abs( piOrg[0] - piCur[0] - iDeltaC ); 2256 uiSum += abs( piOrg[1] - piCur[1] - iDeltaC ); 2257 uiSum += abs( piOrg[2] - piCur[2] - iDeltaC ); 2258 uiSum += abs( piOrg[3] - piCur[3] - iDeltaC ); 2259 uiSum += abs( piOrg[4] - piCur[4] - iDeltaC ); 2260 uiSum += abs( piOrg[5] - piCur[5] - iDeltaC ); 2261 uiSum += abs( piOrg[6] - piCur[6] - iDeltaC ); 2262 uiSum += abs( piOrg[7] - piCur[7] - iDeltaC ); 2263 uiSum += abs( piOrg[8] - piCur[8] - iDeltaC ); 2264 uiSum += abs( piOrg[9] - piCur[9] - iDeltaC ); 2265 uiSum += abs( piOrg[10] - piCur[10] - iDeltaC ); 2266 uiSum += abs( piOrg[11] - piCur[11] - iDeltaC ); 2267 uiSum += abs( piOrg[12] - piCur[12] - iDeltaC ); 2268 uiSum += abs( piOrg[13] - piCur[13] - iDeltaC ); 2269 uiSum += abs( piOrg[14] - piCur[14] - iDeltaC ); 2270 uiSum += abs( piOrg[15] - piCur[15] - iDeltaC ); 2271 uiSum += abs( piOrg[16] - piCur[16] - iDeltaC ); 2272 uiSum += abs( piOrg[17] - piCur[17] - iDeltaC ); 2273 uiSum += abs( piOrg[18] - piCur[18] - iDeltaC ); 2274 uiSum += abs( piOrg[19] - piCur[19] - iDeltaC ); 2275 uiSum += abs( piOrg[20] - piCur[20] - iDeltaC ); 2276 uiSum += abs( piOrg[21] - piCur[21] - iDeltaC ); 2277 uiSum += abs( piOrg[22] - piCur[22] - iDeltaC ); 2278 uiSum += abs( piOrg[23] - piCur[23] - iDeltaC ); 2279 uiSum += abs( piOrg[24] - piCur[24] - iDeltaC ); 2280 uiSum += abs( piOrg[25] - piCur[25] - iDeltaC ); 2281 uiSum += abs( piOrg[26] - piCur[26] - iDeltaC ); 2282 uiSum += abs( piOrg[27] - piCur[27] - iDeltaC ); 2283 uiSum += abs( piOrg[28] - piCur[28] - iDeltaC ); 2284 uiSum += abs( piOrg[29] - piCur[29] - iDeltaC ); 2285 uiSum += abs( piOrg[30] - piCur[30] - iDeltaC ); 2286 uiSum += abs( piOrg[31] - piCur[31] - iDeltaC ); 2287 uiSum += abs( piOrg[32] - piCur[32] - iDeltaC ); 2288 uiSum += abs( piOrg[33] - piCur[33] - iDeltaC ); 2289 uiSum += abs( piOrg[34] - piCur[34] - iDeltaC ); 2290 uiSum += abs( piOrg[35] - piCur[35] - iDeltaC ); 2291 uiSum += abs( piOrg[36] - piCur[36] - iDeltaC ); 2292 uiSum += abs( piOrg[37] - piCur[37] - iDeltaC ); 2293 uiSum += abs( piOrg[38] - piCur[38] - iDeltaC ); 2294 uiSum += abs( piOrg[39] - piCur[39] - iDeltaC ); 2295 uiSum += abs( piOrg[40] - piCur[40] - iDeltaC ); 2296 uiSum += abs( piOrg[41] - piCur[41] - iDeltaC ); 2297 uiSum += abs( piOrg[42] - piCur[42] - iDeltaC ); 2298 uiSum += abs( piOrg[43] - piCur[43] - iDeltaC ); 2299 uiSum += abs( piOrg[44] - piCur[44] - iDeltaC ); 2300 uiSum += abs( piOrg[45] - piCur[45] - iDeltaC ); 2301 uiSum += abs( piOrg[46] - piCur[46] - iDeltaC ); 2302 uiSum += abs( piOrg[47] - piCur[47] - iDeltaC ); 2303 2304 piOrg += iStrideOrg; 2305 piCur += iStrideCur; 2306 } 2307 2308 uiSum <<= iSubShift; 2309 return ( uiSum >> g_uiBitIncrement ); 2310 } 2311 #endif 1112 2312 #endif 1113 2313 … … 2826 4026 return xGetHADsw( pcDtParam ); 2827 4027 } 4028 #if LGE_ILLUCOMP_B0045 4029 if(pcDtParam->bUseIC) 4030 { 4031 return xGetHADsic( pcDtParam ); 4032 } 4033 #endif 2828 4034 Pel* piOrg = pcDtParam->pOrg; 2829 4035 Pel* piCur = pcDtParam->pCur; … … 2833 4039 Int iStrideOrg = pcDtParam->iStrideOrg; 2834 4040 Int iStep = pcDtParam->iStep; 2835 4041 2836 4042 Int x, y; 2837 2838 UInt uiSum = 0; 2839 4043 4044 UInt uiSum = 0; 4045 2840 4046 #if NS_HAD 2841 4047 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) ) … … 2890 4096 Int iOffsetOrg = iStrideOrg<<2; 2891 4097 Int iOffsetCur = iStrideCur<<2; 2892 4098 2893 4099 for ( y=0; y<iRows; y+= 4 ) 2894 4100 { … … 2919 4125 assert(false); 2920 4126 } 2921 4127 2922 4128 return ( uiSum >> g_uiBitIncrement ); 2923 4129 } 4130 4131 #if LGE_ILLUCOMP_B0045 4132 UInt TComRdCost::xGetHADsic( DistParam* pcDtParam ) 4133 { 4134 if ( pcDtParam->bApplyWeight ) 4135 { 4136 return xGetHADsw( pcDtParam ); 4137 } 4138 Pel* piOrg = pcDtParam->pOrg; 4139 Pel* piCur = pcDtParam->pCur; 4140 Int iRows = pcDtParam->iRows; 4141 Int iCols = pcDtParam->iCols; 4142 Int iStrideCur = pcDtParam->iStrideCur; 4143 Int iStrideOrg = pcDtParam->iStrideOrg; 4144 Int iStep = pcDtParam->iStep; 4145 4146 Int x, y; 4147 4148 UInt uiSum = 0; 4149 4150 Int iOrigAvg = 0, iCurAvg = 0; 4151 Int iDeltaC; 4152 4153 for ( y=0; y<iRows; y++ ) 4154 { 4155 for ( x=0; x<iCols; x++ ) 4156 { 4157 iOrigAvg += piOrg[x]; 4158 iCurAvg += piCur[x]; 4159 } 4160 piOrg += iStrideOrg; 4161 piCur += iStrideCur; 4162 } 4163 4164 piOrg = pcDtParam->pOrg; 4165 piCur = pcDtParam->pCur; 4166 4167 iDeltaC = (iOrigAvg - iCurAvg)/iRows/iCols; 4168 4169 for ( y=0; y<iRows; y++ ) 4170 { 4171 for ( x=0; x<iCols; x++ ) 4172 { 4173 piOrg[x] -= iDeltaC; 4174 } 4175 piOrg += iStrideOrg; 4176 } 4177 4178 piOrg = pcDtParam->pOrg; 4179 4180 #if NS_HAD 4181 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) ) 4182 #else 4183 if( ( iRows % 8 == 0) && (iCols % 8 == 0) ) 4184 #endif 4185 { 4186 Int iOffsetOrg = iStrideOrg<<3; 4187 Int iOffsetCur = iStrideCur<<3; 4188 for ( y=0; y<iRows; y+= 8 ) 4189 { 4190 for ( x=0; x<iCols; x+= 8 ) 4191 { 4192 uiSum += xCalcHADs8x8( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 4193 } 4194 piOrg += iOffsetOrg; 4195 piCur += iOffsetCur; 4196 } 4197 } 4198 #if NS_HAD 4199 else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD ) 4200 { 4201 Int iOffsetOrg = iStrideOrg<<2; 4202 Int iOffsetCur = iStrideCur<<2; 4203 for ( y=0; y<iRows; y+= 4 ) 4204 { 4205 for ( x=0; x<iCols; x+= 16 ) 4206 { 4207 uiSum += xCalcHADs16x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 4208 } 4209 piOrg += iOffsetOrg; 4210 piCur += iOffsetCur; 4211 } 4212 } 4213 else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD ) 4214 { 4215 Int iOffsetOrg = iStrideOrg<<4; 4216 Int iOffsetCur = iStrideCur<<4; 4217 for ( y=0; y<iRows; y+= 16 ) 4218 { 4219 for ( x=0; x<iCols; x+= 4 ) 4220 { 4221 uiSum += xCalcHADs4x16( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 4222 } 4223 piOrg += iOffsetOrg; 4224 piCur += iOffsetCur; 4225 } 4226 } 4227 #endif 4228 else if( ( iRows % 4 == 0) && (iCols % 4 == 0) ) 4229 { 4230 Int iOffsetOrg = iStrideOrg<<2; 4231 Int iOffsetCur = iStrideCur<<2; 4232 4233 for ( y=0; y<iRows; y+= 4 ) 4234 { 4235 for ( x=0; x<iCols; x+= 4 ) 4236 { 4237 uiSum += xCalcHADs4x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 4238 } 4239 piOrg += iOffsetOrg; 4240 piCur += iOffsetCur; 4241 } 4242 } 4243 else if( ( iRows % 2 == 0) && (iCols % 2 == 0) ) 4244 { 4245 Int iOffsetOrg = iStrideOrg<<1; 4246 Int iOffsetCur = iStrideCur<<1; 4247 for ( y=0; y<iRows; y+=2 ) 4248 { 4249 for ( x=0; x<iCols; x+=2 ) 4250 { 4251 uiSum += xCalcHADs2x2( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep ); 4252 } 4253 piOrg += iOffsetOrg; 4254 piCur += iOffsetCur; 4255 } 4256 } 4257 else 4258 { 4259 assert(false); 4260 } 4261 4262 piOrg = pcDtParam->pOrg; 4263 4264 for ( y=0; y<iRows; y++ ) 4265 { 4266 for ( x=0; x<iCols; x++ ) 4267 { 4268 piOrg[x] += iDeltaC; 4269 } 4270 piOrg += iStrideOrg; 4271 } 4272 4273 return ( uiSum >> g_uiBitIncrement ); 4274 } 4275 #endif 2924 4276 2925 4277 #if HHI_VSO -
trunk/source/Lib/TLibCommon/TComRdCost.h
r120 r189 88 88 Int iCols; 89 89 Int iStep; 90 #if LGE_ILLUCOMP_B0045 91 Bool bUseIC; 92 #endif 90 93 FpDistFunc DistFunc; 91 94 … … 302 305 private: 303 306 307 #if LGE_ILLUCOMP_B0045 308 static UInt xGetSADic ( DistParam* pcDtParam ); 309 static UInt xGetSAD4ic ( DistParam* pcDtParam ); 310 static UInt xGetSAD8ic ( DistParam* pcDtParam ); 311 static UInt xGetSAD16ic ( DistParam* pcDtParam ); 312 static UInt xGetSAD32ic ( DistParam* pcDtParam ); 313 static UInt xGetSAD64ic ( DistParam* pcDtParam ); 314 static UInt xGetSAD16Nic ( DistParam* pcDtParam ); 315 #endif 304 316 static UInt xGetSSE ( DistParam* pcDtParam ); 305 317 static UInt xGetSSE4 ( DistParam* pcDtParam ); … … 329 341 330 342 #if AMP_SAD 343 #if LGE_ILLUCOMP_B0045 344 static UInt xGetSAD12ic ( DistParam* pcDtParam ); 345 static UInt xGetSAD24ic ( DistParam* pcDtParam ); 346 static UInt xGetSAD48ic ( DistParam* pcDtParam ); 347 #endif 331 348 static UInt xGetSAD12 ( DistParam* pcDtParam ); 332 349 static UInt xGetSAD24 ( DistParam* pcDtParam ); 333 350 static UInt xGetSAD48 ( DistParam* pcDtParam ); 334 335 #endif 336 351 #endif 352 353 #if LGE_ILLUCOMP_B0045 354 static UInt xGetHADsic ( DistParam* pcDtParam ); 355 #endif 337 356 static UInt xGetHADs4 ( DistParam* pcDtParam ); 338 357 static UInt xGetHADs8 ( DistParam* pcDtParam ); 339 358 static UInt xGetHADs ( DistParam* pcDtParam ); 359 340 360 static UInt xCalcHADs2x2 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); 341 361 static UInt xCalcHADs4x4 ( Pel *piOrg, Pel *piCurr, Int iStrideOrg, Int iStrideCur, Int iStep ); -
trunk/source/Lib/TLibCommon/TComResidualGenerator.cpp
r100 r189 219 219 } 220 220 221 #if QC_MULTI_DIS_CAN 221 #if QC_MULTI_DIS_CAN_A0097 222 222 Bool 223 223 TComResidualGenerator::getResidualSamples( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp … … 243 243 iBlkHeight = pcCU->getHeight ( 0 ); 244 244 pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + uiPartAddr, iXPos, iYPos ); 245 #if QC_MULTI_DIS_CAN 245 #if QC_MULTI_DIS_CAN_A0097 246 246 return getResidualSamples( pcCU->getPic(), (UInt)iXPos, (UInt)iYPos, (UInt)iBlkWidth, (UInt)iBlkHeight, pcYuv, iDisp 247 247 #if QC_SIMPLIFIEDIVRP_M24938 … … 258 258 } 259 259 260 #if QC_MULTI_DIS_CAN 260 #if QC_MULTI_DIS_CAN_A0097 261 261 Bool 262 262 TComResidualGenerator::getResidualSamples( TComPic* pcPic, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp … … 283 283 UInt uiXPosInRefView = uiXPos , uiYPosInRefView = uiYPos; 284 284 #endif 285 #if QC_MULTI_DIS_CAN 285 #if QC_MULTI_DIS_CAN_A0097 286 286 xSetPredResidualBlock( pcPic, uiBaseViewId, uiXPos, uiYPos, uiBlkWidth, uiBlkHeight, pcYuv, iDisp 287 287 #if QC_SIMPLIFIEDIVRP_M24938 … … 517 517 518 518 519 #if QC_MULTI_DIS_CAN 519 #if QC_MULTI_DIS_CAN_A0097 520 520 Void 521 521 TComResidualGenerator::xSetPredResidualBlock( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp … … 548 548 549 549 //===== get disparity ===== 550 #if QC_MULTI_DIS_CAN 550 #if QC_MULTI_DIS_CAN_A0097 551 551 Int iDisparity = iDisp; 552 552 #else -
trunk/source/Lib/TLibCommon/TComResidualGenerator.h
r100 r189 69 69 Void setRecResidualPic ( TComPic* pcPic ); 70 70 71 #if QC_MULTI_DIS_CAN 71 #if QC_MULTI_DIS_CAN_A0097 72 72 Bool getResidualSamples ( TComDataCU* pcCU, UInt uiPUIdx, TComYuv* pcYuv, Int iDisp 73 73 #if QC_SIMPLIFIEDIVRP_M24938 … … 100 100 Void xClearIntViewResidual ( TComDataCU* pcCU, TComYuv* pcCUResidual, UInt uiPartIdx ); 101 101 Void xClearResidual ( TComYuv* pcCUResidual, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight ); 102 #if QC_MULTI_DIS_CAN 102 #if QC_MULTI_DIS_CAN_A0097 103 103 Void xSetPredResidualBlock ( TComPic* pcPic, UInt uiBaseViewId, UInt uiXPos, UInt uiYPos, UInt uiBlkWidth, UInt uiBlkHeight, TComYuv* pcYuv, Int iDisp 104 104 #if QC_SIMPLIFIEDIVRP_M24938 -
trunk/source/Lib/TLibCommon/TComRom.cpp
r77 r189 174 174 g_aacWedgeRefLists.clear(); 175 175 } 176 #if HHIQC_DMMFASTSEARCH_B0039 177 if ( !g_aacWedgeNodeLists.empty() ) 178 { 179 for ( UInt ui = 0; ui < g_aacWedgeNodeLists.size(); ui++ ) 180 { 181 g_aacWedgeNodeLists[ui].clear(); 182 } 183 g_aacWedgeNodeLists.clear(); 184 } 185 #endif 176 186 #endif 177 187 } … … 295 305 }; 296 306 307 #if RWTH_SDC_DLT_B0036 308 UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES] = { DC_IDX, DMM_WEDGE_FULL_IDX, DMM_WEDGE_PREDDIR_IDX, PLANAR_IDX }; 309 #endif 297 310 298 311 Int g_quantScales[6] = … … 1170 1183 std::vector< std::vector<TComWedgeRef> > g_aacWedgeRefLists; 1171 1184 1185 #if HHIQC_DMMFASTSEARCH_B0039 1186 std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3; 1187 std::vector< std::vector< TComWedgeNode> > g_aacWedgeNodeLists; 1188 #endif 1189 1172 1190 Void initWedgeLists() 1173 1191 { … … 1180 1198 g_aacWedgeLists.push_back( acWedgeList ); 1181 1199 g_aacWedgeRefLists.push_back( acWedgeRefList ); 1200 1201 #if HHIQC_DMMFASTSEARCH_B0039 1202 // create WedgeNodeList 1203 std::vector<TComWedgeNode> acWedgeNodeList; 1204 for( UInt uiPos = 0; uiPos < acWedgeList.size(); uiPos++ ) 1205 { 1206 if( acWedgeList[uiPos].getIsCoarse() ) 1207 { 1208 TComWedgeNode cWedgeNode; 1209 cWedgeNode.setPatternIdx( uiPos ); 1210 1211 // set refinement idxs 1212 UInt uiRefPos = 0; 1213 for( Int iOffS = -1; iOffS <= 1; iOffS++ ) 1214 { 1215 for( Int iOffE = -1; iOffE <= 1; iOffE++ ) 1216 { 1217 if( iOffS == 0 && iOffE == 0 ) { continue; } 1218 1219 Int iSx = (Int)acWedgeList[uiPos].getStartX(); 1220 Int iSy = (Int)acWedgeList[uiPos].getStartY(); 1221 Int iEx = (Int)acWedgeList[uiPos].getEndX(); 1222 Int iEy = (Int)acWedgeList[uiPos].getEndY(); 1223 1224 switch( acWedgeList[uiPos].getOri() ) 1225 { 1226 case( 0 ): { iSx += iOffS; iEy += iOffE; } break; 1227 case( 1 ): { iSy += iOffS; iEx -= iOffE; } break; 1228 case( 2 ): { iSx -= iOffS; iEy -= iOffE; } break; 1229 case( 3 ): { iSy -= iOffS; iEx += iOffE; } break; 1230 case( 4 ): { iSx += iOffS; iEx += iOffE; } break; 1231 case( 5 ): { iSy += iOffS; iEy += iOffE; } break; 1232 default: assert( 0 ); 1233 } 1234 1235 for( UInt k = 0; k < acWedgeRefList.size(); k++ ) 1236 { 1237 if( iSx == (Int)acWedgeRefList[k].getStartX() && 1238 iSy == (Int)acWedgeRefList[k].getStartY() && 1239 iEx == (Int)acWedgeRefList[k].getEndX() && 1240 iEy == (Int)acWedgeRefList[k].getEndY() ) 1241 { 1242 if( acWedgeRefList[k].getRefIdx() != cWedgeNode.getPatternIdx() ) 1243 { 1244 Bool bNew = true; 1245 for( UInt m = 0; m < uiRefPos; m++ ) { if( acWedgeRefList[k].getRefIdx() == cWedgeNode.getRefineIdx( m ) ) { bNew = false; break; } } 1246 1247 if( bNew ) 1248 { 1249 cWedgeNode.setRefineIdx( acWedgeRefList[k].getRefIdx(), uiRefPos ); 1250 uiRefPos++; 1251 break; 1252 } 1253 } 1254 } 1255 } 1256 } 1257 } 1258 acWedgeNodeList.push_back( cWedgeNode ); 1259 } 1260 } 1261 g_aacWedgeNodeLists.push_back( acWedgeNodeList ); 1262 #endif 1182 1263 } 1183 1264 return; … … 1217 1298 for( Int iL = 0; iL < uiBlockSize; iL++ ) 1218 1299 { 1300 #if HHIQC_DMMFASTSEARCH_B0039 1301 cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes, ((iL%2)==0 && (iK%2)==0) ); 1302 #else 1219 1303 cTempWedgelet.setWedgelet( uhStartX + (iK*iStepStartX) , uhStartY + (iK*iStepStartY), uhEndX + (iL*iStepEndX), uhEndY + (iL*iStepEndY), (UChar)uiOri, eWedgeRes ); 1304 #endif 1220 1305 addWedgeletToList( cTempWedgelet, racWedgeList, racWedgeRefList ); 1221 1306 } 1222 1307 } 1223 1308 } 1309 #if HHIQC_DMMFASTSEARCH_B0039 1310 UInt uiThrSz = DMM3_SIMPLIFY_TR; 1311 1312 std::vector< std::vector<UInt> > auiWdgListSz; 1313 for( Int idxM=2; idxM<=34 ; idxM++) 1314 { 1315 std::vector<UInt> auiWdgList; 1316 for( Int idxW=0; idxW<racWedgeList.size(); idxW++) 1317 { 1318 UInt uiAbsDiff = abs(idxM-(Int)racWedgeList[idxW].getAng()); 1319 if( uiAbsDiff <= uiThrSz ) 1320 { 1321 auiWdgList.push_back(idxW); 1322 } 1323 } 1324 auiWdgListSz.push_back(auiWdgList); 1325 } 1326 g_aauiWdgLstM3.push_back(auiWdgListSz); 1327 #endif 1224 1328 } 1225 1329 … … 1257 1361 if( bValid ) 1258 1362 { 1363 #if HHIQC_DMMFASTSEARCH_B0039 1364 cWedgelet.findClosetAngle(); 1365 #endif 1259 1366 racWedgeList.push_back( cWedgelet ); 1260 1367 TComWedgeRef cWedgeRef; -
trunk/source/Lib/TLibCommon/TComRom.h
r100 r189 193 193 extern std::vector< std::vector<TComWedgeRef> > g_aacWedgeRefLists; 194 194 195 #if HHIQC_DMMFASTSEARCH_B0039 196 extern std::vector< std::vector< std::vector<UInt> > > g_aauiWdgLstM3; 197 extern std::vector< std::vector<TComWedgeNode> > g_aacWedgeNodeLists; 198 #endif 199 200 #if RWTH_SDC_DLT_B0036 201 #define RWTH_SDC_NUM_PRED_MODES 4 202 extern UInt g_auiSDCPredModes[RWTH_SDC_NUM_PRED_MODES]; 203 #endif 204 195 205 Void initWedgeLists(); 196 206 Void createWedgeList( UInt uiWidth, UInt uiHeight, std::vector<TComWedgelet> &racWedgeList, std::vector<TComWedgeRef> &racWedgeRefList, WedgeResolution eWedgeRes ); … … 206 216 #endif 207 217 208 #if LGE_EDGE_INTRA 218 #if LGE_EDGE_INTRA_A0070 209 219 __inline Void mapEdgeIntratoDC( UChar& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } 210 220 __inline Void mapEdgeIntratoDC( UInt& curDir ) { curDir = (curDir >= EDGE_INTRA_IDX) ? DC_IDX : curDir; } -
trunk/source/Lib/TLibCommon/TComSlice.cpp
r116 r189 112 112 , m_iViewOrderIdx ( 0 ) 113 113 #endif 114 #if LGE_ILLUCOMP_B0045 115 , m_bApplyIC ( false ) 116 #endif 114 117 { 115 118 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; … … 1305 1308 } 1306 1309 1310 #if LGE_ILLUCOMP_B0045 1311 Void TComSlice::xSetApplyIC() 1312 { 1313 Int iMaxPelValue = (1<<g_uiBitDepth); 1314 Int *aiRefOrgHist; 1315 Int *aiCurrHist; 1316 aiRefOrgHist = new Int; 1317 aiCurrHist = new Int; 1318 aiRefOrgHist = (Int *)xMalloc(Int,iMaxPelValue); 1319 aiCurrHist = (Int *)xMalloc(Int,iMaxPelValue); 1320 memset(aiRefOrgHist, 0, iMaxPelValue*sizeof(Int) ); 1321 memset(aiCurrHist, 0, iMaxPelValue*sizeof(Int) ); 1322 // Reference Idx Number 1323 Int iNumRefIdx = getNumRefIdx( REF_PIC_LIST_0 ); 1324 TComPic* pcCurrPic = NULL; 1325 TComPic* pcRefPic = NULL; 1326 TComPicYuv* pcCurrPicYuv = NULL; 1327 TComPicYuv* pcRefPicYuvOrg = NULL; 1328 pcCurrPic = getPic(); 1329 pcCurrPicYuv = pcCurrPic->getPicYuvOrg(); 1330 Int iWidth = pcCurrPicYuv->getWidth(); 1331 Int iHeight = pcCurrPicYuv->getHeight(); 1332 1333 1334 // Get InterView Reference picture 1335 // !!!!! Assume only one Interview Reference Picture in L0 1336 for (Int i = 0; i < iNumRefIdx; i++) 1337 { 1338 pcRefPic = getRefPic( REF_PIC_LIST_0, i); 1339 if (pcRefPic != NULL) 1340 { 1341 // Current Picture 1342 if (pcCurrPic->getViewId() != pcRefPic->getViewId()) 1343 { 1344 pcRefPicYuvOrg = pcRefPic->getPicYuvOrg(); 1345 } 1346 } 1347 } 1348 if (pcRefPicYuvOrg != NULL) 1349 { 1350 Pel* pCurrY = pcCurrPicYuv ->getLumaAddr(); 1351 Pel* pRefOrgY = pcRefPicYuvOrg ->getLumaAddr(); 1352 Int iCurrStride = pcCurrPicYuv->getStride(); 1353 Int iRefStride = pcRefPicYuvOrg->getStride(); 1354 Int iSumOrgSAD = 0; 1355 double dThresholdOrgSAD = 0.05; 1356 // Histogram building - luminance 1357 for ( Int y = 0; y < iHeight; y++) 1358 { 1359 for ( Int x = 0; x < iWidth; x++) 1360 { 1361 aiCurrHist[pCurrY[x]]++; 1362 aiRefOrgHist[pRefOrgY[x]]++; 1363 } 1364 pCurrY += iCurrStride; 1365 pRefOrgY += iRefStride; 1366 } 1367 // Calc SAD 1368 for (Int i = 0; i < iMaxPelValue; i++) 1369 { 1370 iSumOrgSAD += abs(aiCurrHist[i] - aiRefOrgHist[i]); 1371 } 1372 // Setting 1373 if ( iSumOrgSAD > Int(dThresholdOrgSAD * iWidth * iHeight) ) 1374 { 1375 m_bApplyIC = true; 1376 } 1377 else 1378 { 1379 m_bApplyIC = false; 1380 } 1381 } 1382 xFree(aiCurrHist); 1383 xFree(aiRefOrgHist); 1384 aiCurrHist = NULL; 1385 aiRefOrgHist = NULL; 1386 } 1387 #endif 1388 1307 1389 // ------------------------------------------------------------------------------------------------ 1308 1390 // Video parameter set (VPS) … … 1441 1523 , m_bUseDMM (false) 1442 1524 #endif 1443 #if OL_ DEPTHLIMIT_A00441444 , m_b DepthPartitionLimiting(false)1525 #if OL_QTLIMIT_PREDCODING_B0068 1526 , m_bUseQTLPC (false) 1445 1527 #endif 1446 1528 { … … 1475 1557 1476 1558 ::memset( m_aiUsableInterViewRefs, 0, sizeof( m_aiUsableInterViewRefs ) ); 1559 1560 #if RWTH_SDC_DLT_B0036 1561 m_bUseDLT = false; 1562 1563 m_uiBitsPerDepthValue = g_uiBitDepth; 1564 m_uiNumDepthmapValues = 0; 1565 m_uiDepthValue2Idx = NULL; 1566 m_uiIdx2DepthValue = NULL; 1567 #endif 1477 1568 } 1478 1569 … … 1490 1581 } 1491 1582 } 1583 1584 #if RWTH_SDC_DLT_B0036 1585 Void TComSPS::setDepthLUTs(UInt* uidx2DepthValue, UInt uiNumDepthValues) 1586 { 1587 UInt uiMaxDepthValue = g_uiIBDI_MAX; 1588 1589 // allocate some memory 1590 if( m_uiNumDepthmapValues == 0 ) 1591 { 1592 m_uiNumDepthmapValues = uiMaxDepthValue+1; 1593 m_uiBitsPerDepthValue = (UInt)ceil(Log2(m_uiNumDepthmapValues)); 1594 1595 m_uiDepthValue2Idx = (UInt*) xMalloc(UInt, m_uiNumDepthmapValues); 1596 m_uiIdx2DepthValue = (UInt*) xMalloc(UInt, m_uiNumDepthmapValues); 1597 1598 //default mapping 1599 for (Int i=0; i<m_uiNumDepthmapValues; i++) 1600 { 1601 m_uiDepthValue2Idx[i] = i; 1602 m_uiIdx2DepthValue[i] = i; 1603 } 1604 } 1605 1606 if( uidx2DepthValue == NULL || uiNumDepthValues == 0 ) // default mapping only 1607 return; 1608 1609 // copy idx2DepthValue to internal array 1610 memcpy(m_uiIdx2DepthValue, uidx2DepthValue, uiNumDepthValues*sizeof(UInt)); 1611 1612 for(Int p=0; p<=uiMaxDepthValue; p++) 1613 { 1614 Int iIdxDown = 0; 1615 Int iIdxUp = uiNumDepthValues-1; 1616 Bool bFound = false; 1617 1618 // iterate over indices to find lower closest depth 1619 Int i = 1; 1620 while(!bFound && i<uiNumDepthValues) 1621 { 1622 if( m_uiIdx2DepthValue[i] > p ) 1623 { 1624 iIdxDown = i-1; 1625 bFound = true; 1626 } 1627 1628 i++; 1629 } 1630 // iterate over indices to find upper closest depth 1631 i = uiNumDepthValues-2; 1632 bFound = false; 1633 while(!bFound && i>=0) 1634 { 1635 if( m_uiIdx2DepthValue[i] < p ) 1636 { 1637 iIdxUp = i+1; 1638 bFound = true; 1639 } 1640 1641 i--; 1642 } 1643 1644 // assert monotony 1645 assert(iIdxDown<=iIdxUp); 1646 1647 // assign closer depth value/idx 1648 if( abs(p-(Int)m_uiIdx2DepthValue[iIdxDown]) < abs(p-(Int)m_uiIdx2DepthValue[iIdxUp]) ) 1649 { 1650 m_uiDepthValue2Idx[p] = iIdxDown; 1651 } 1652 else 1653 { 1654 m_uiDepthValue2Idx[p] = iIdxUp; 1655 } 1656 1657 } 1658 1659 // update globals 1660 m_uiNumDepthmapValues = uiNumDepthValues; 1661 m_uiBitsPerDepthValue = (UInt)ceil(Log2(m_uiNumDepthmapValues)); 1662 } 1663 #endif 1492 1664 1493 1665 TComPPS::TComPPS() … … 1532 1704 , m_cabacInitPresentFlag (false) 1533 1705 , m_encCABACTableIdx (0) 1534 #if POZNAN_CABAC_INIT_FLAG_FIX1706 #if FIX_POZNAN_CABAC_INIT_FLAG 1535 1707 , m_encPrevPOC (0) 1536 1708 #endif -
trunk/source/Lib/TLibCommon/TComSlice.h
r116 r189 323 323 Bool m_bUseMVI; 324 324 #endif 325 326 #if RWTH_SDC_DLT_B0036 327 Bool m_bUseDLT; 328 329 UInt m_uiBitsPerDepthValue; 330 UInt m_uiNumDepthmapValues; 331 UInt* m_uiDepthValue2Idx; 332 UInt* m_uiIdx2DepthValue; 333 #endif 325 334 326 335 Bool m_bLFCrossTileBoundaryFlag; … … 354 363 #endif 355 364 356 #if OL_ DEPTHLIMIT_A0044357 Bool m_b DepthPartitionLimiting;365 #if OL_QTLIMIT_PREDCODING_B0068 366 Bool m_bUseQTLPC; 358 367 #endif 359 368 … … 547 556 Bool getUseMVI () {return m_bUseMVI;} 548 557 #endif 558 559 #if RWTH_SDC_DLT_B0036 560 Bool getUseDLT () { return m_bUseDLT; } 561 Void setUseDLT ( Bool b ) { m_bUseDLT = b; } 562 563 UInt getBitsPerDepthValue() { return m_bUseDLT?m_uiBitsPerDepthValue:g_uiBitDepth; } 564 UInt getNumDepthValues() { return m_bUseDLT?m_uiNumDepthmapValues:g_uiIBDI_MAX; } 565 UInt depthValue2idx(Pel uiValue) { return m_bUseDLT?m_uiDepthValue2Idx[uiValue]:uiValue; } 566 Pel idx2DepthValue(UInt uiIdx) { return m_bUseDLT?m_uiIdx2DepthValue[uiIdx]:uiIdx; } 567 Void setDepthLUTs (UInt* uidx2DepthValue = NULL, UInt uiNumDepthValues = 0); 568 #endif 549 569 550 570 UInt getMaxTLayers() { return m_uiMaxTLayers; } … … 623 643 #endif 624 644 625 #if OL_ DEPTHLIMIT_A0044626 Void setUse DPL(Bool b) {m_bDepthPartitionLimiting = b;}627 Bool getUse DPL() {return m_bDepthPartitionLimiting;}645 #if OL_QTLIMIT_PREDCODING_B0068 646 Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b; } 647 Bool getUseQTLPC() { return m_bUseQTLPC; } 628 648 #endif 629 649 … … 863 883 Bool m_cabacInitPresentFlag; 864 884 UInt m_encCABACTableIdx; // Used to transmit table selection across slices 865 #if POZNAN_CABAC_INIT_FLAG_FIX885 #if FIX_POZNAN_CABAC_INIT_FLAG 866 886 UInt m_encPrevPOC; 867 887 #endif … … 998 1018 Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } 999 1019 UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } 1000 #if POZNAN_CABAC_INIT_FLAG_FIX1020 #if FIX_POZNAN_CABAC_INIT_FLAG 1001 1021 Void setEncPrevPOC(UInt uiPOC) { m_encPrevPOC = uiPOC; } 1002 1022 UInt getEncPrevPOC() { return m_encPrevPOC; } … … 1279 1299 #if SONY_COLPIC_AVAILABILITY 1280 1300 Int m_iViewOrderIdx; 1301 #endif 1302 #if LGE_ILLUCOMP_B0045 1303 Bool m_bApplyIC; 1281 1304 #endif 1282 1305 … … 1574 1597 Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } 1575 1598 1599 #if LGE_ILLUCOMP_B0045 1600 Void setApplyIC ( Bool b ) { m_bApplyIC = b; } 1601 Bool getApplyIC () { return m_bApplyIC; } 1602 Void xSetApplyIC (); 1603 #endif 1604 1576 1605 protected: 1577 1606 TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, UInt uiPOC); -
trunk/source/Lib/TLibCommon/TComWedgelet.cpp
r56 r189 52 52 m_uhOri ( 0 ), 53 53 m_eWedgeRes( FULL_PEL ) 54 #if HHIQC_DMMFASTSEARCH_B0039 55 , m_bIsCoarse( false ) 56 #endif 54 57 { 55 58 create( uiWidth, uiHeight ); … … 62 65 m_uhOri ( rcWedge.m_uhOri ), 63 66 m_eWedgeRes( rcWedge.m_eWedgeRes ), 67 #if HHIQC_DMMFASTSEARCH_B0039 68 m_bIsCoarse( rcWedge.m_bIsCoarse ), 69 m_uiAng ( rcWedge.m_uiAng ), 70 #endif 64 71 m_uiWidth ( rcWedge.m_uiWidth ), 65 72 m_uiHeight ( rcWedge.m_uiHeight ), … … 94 101 } 95 102 103 #if HHIQC_DMMFASTSEARCH_B0039 104 Void TComWedgelet::findClosetAngle() 105 { 106 UInt uiAng=0,uiOptAng=0; 107 UInt uiMinD=MAX_UINT; 108 UInt uiTmpD=0; 109 Int angTable[9] = {0, 2, 5, 9, 13, 17, 21, 26, 32}; 110 111 UChar uhXs = m_uhXs; 112 UChar uhYs = m_uhYs; 113 UChar uhXe = m_uhXe; 114 UChar uhYe = m_uhYe; 115 116 for(uiAng=2; uiAng<=34; uiAng++) 117 { 118 Int iSign = (uiAng<VER_IDX && uiAng>HOR_IDX ) ? -1 : 1; 119 Int iVer = uiAng>17 ? 32 : angTable[(uiAng>10) ? (uiAng-10) : (10-uiAng)]; 120 Int iHor = uiAng<19 ? 32 : angTable[(uiAng>26) ? (uiAng-26) : (26-uiAng)]; 121 122 uiTmpD = abs(iVer*iSign*(uhXs-uhXe) - iHor*(uhYe-uhYs)); 123 124 if( uiTmpD < uiMinD ) 125 { 126 uiMinD = uiTmpD; 127 uiOptAng = uiAng; 128 } 129 } 130 m_uiAng = uiOptAng; 131 } 132 133 Void TComWedgelet::setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse ) 134 #else 96 135 Void TComWedgelet::setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes ) 136 #endif 97 137 { 98 138 m_uhXs = uhXs; … … 102 142 m_uhOri = uhOri; 103 143 m_eWedgeRes = eWedgeRes; 144 #if HHIQC_DMMFASTSEARCH_B0039 145 m_bIsCoarse = bIsCoarse; 146 #endif 104 147 105 148 xGenerateWedgePattern(); … … 644 687 case( 2 ): { for( UInt iX = uiTempBlockSize-1; iX > uhXs; iX-- ) { UInt iY = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY--; } } } break; 645 688 case( 3 ): { for( UInt iY = uiTempBlockSize-1; iY > uhYs; iY-- ) { UInt iX = 0; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } } break; 689 #if HHIQC_DMMFASTSEARCH_B0039 690 case( 4 ): 691 { 692 if( (uhXs+uhXe) < uiTempBlockSize ) { for( UInt iY = 0; iY < uiTempBlockSize; iY++ ) { UInt iX = 0; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } } 693 else { for( UInt iY = 0; iY < uiTempBlockSize; iY++ ) { UInt iX = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX--; } } } 694 } 695 break; 696 case( 5 ): 697 { 698 if( (uhYs+uhYe) < uiTempBlockSize ) { for( UInt iX = 0; iX < uiTempBlockSize; iX++ ) { UInt iY = 0; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY++; } } } 699 else { for( UInt iX = 0; iX < uiTempBlockSize; iX++ ) { UInt iY = uiTempBlockSize-1; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY--; } } } 700 } 701 #else 646 702 case( 4 ): { for( UInt iY = 0; iY < uiTempBlockSize; iY++ ) { UInt iX = 0; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iX++; } } } break; 647 703 case( 5 ): { for( UInt iX = 0; iX < uiTempBlockSize; iX++ ) { UInt iY = 0; while( pbTempPattern[(iY * iTempStride) + iX] == false ) { pbTempPattern[(iY * iTempStride) + iX] = true; iY++; } } } break; 704 #endif 648 705 } 649 706 … … 664 721 case( 2 ): { uiOffX = 1; uiOffY = 1; } break; 665 722 case( 3 ): { uiOffX = 0; uiOffY = 1; } break; 723 #if HHIQC_DMMFASTSEARCH_B0039 724 case( 4 ): 725 { 726 if( (uhXs+uhXe) < uiTempBlockSize ) { uiOffX = 0; uiOffY = 0; } 727 else { uiOffX = 1; uiOffY = 0; } 728 } 729 break; 730 case( 5 ): 731 { 732 if( (uhYs+uhYe) < uiTempBlockSize ) { uiOffX = 0; uiOffY = 0; } 733 else { uiOffX = 0; uiOffY = 1; } 734 } 735 break; 736 #else 666 737 case( 4 ): { uiOffX = 0; uiOffY = 0; } break; 667 738 case( 5 ): { uiOffX = 0; uiOffY = 0; } break; 739 #endif 668 740 default: { uiOffX = 0; uiOffY = 0; } break; 669 741 } … … 732 804 } 733 805 } 806 807 #if HHIQC_DMMFASTSEARCH_B0039 808 TComWedgeNode::TComWedgeNode() 809 { 810 m_uiPatternIdx = NO_IDX; 811 for( UInt uiPos = 0; uiPos < NUM_WEDGE_REFINES; uiPos++ ) 812 { 813 m_uiRefineIdx[uiPos] = NO_IDX; 814 } 815 } 816 817 UInt TComWedgeNode::getPatternIdx() 818 { 819 return m_uiPatternIdx; 820 } 821 UInt TComWedgeNode::getRefineIdx( UInt uiPos ) 822 { 823 assert( uiPos < NUM_WEDGE_REFINES ); 824 return m_uiRefineIdx[uiPos]; 825 } 826 Void TComWedgeNode::setPatternIdx( UInt uiIdx ) 827 { 828 m_uiPatternIdx = uiIdx; 829 } 830 Void TComWedgeNode::setRefineIdx( UInt uiIdx, UInt uiPos ) 831 { 832 assert( uiPos < NUM_WEDGE_REFINES ); 833 m_uiRefineIdx[uiPos] = uiIdx; 834 } 835 #endif 734 836 735 837 #if HHI_DMM_PRED_TEX -
trunk/source/Lib/TLibCommon/TComWedgelet.h
r116 r189 50 50 }; 51 51 52 #if HHIQC_DMMFASTSEARCH_B0039 53 #define NUM_WEDGE_REFINES 8 54 #define NO_IDX MAX_UINT 55 #endif 56 52 57 // ==================================================================================================================== 53 58 // Class definition TComWedgelet … … 62 67 UChar m_uhOri; // orientation index 63 68 WedgeResolution m_eWedgeRes; // start/end pos resolution 69 #if HHIQC_DMMFASTSEARCH_B0039 70 Bool m_bIsCoarse; 71 UInt m_uiAng; 72 #endif 64 73 65 74 UInt m_uiWidth; … … 90 99 UChar getEndY () { return m_uhYe; } 91 100 UChar getOri () { return m_uhOri; } 92 101 #if HHIQC_DMMFASTSEARCH_B0039 102 Bool getIsCoarse() { return m_bIsCoarse; } 103 UInt getAng () { return m_uiAng; } 104 Void findClosetAngle(); 105 106 Void setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false ); 107 #else 93 108 Void setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes ); 109 #endif 94 110 95 111 Bool checkNotPlain(); … … 136 152 // type definition wedgelet reference list 137 153 typedef std::vector<TComWedgeRef> WedgeRefList; 154 155 #if HHIQC_DMMFASTSEARCH_B0039 156 // ==================================================================================================================== 157 // Class definition TComWedgeNode 158 // ==================================================================================================================== 159 class TComWedgeNode 160 { 161 private: 162 UInt m_uiPatternIdx; 163 UInt m_uiRefineIdx[NUM_WEDGE_REFINES]; 164 165 public: 166 TComWedgeNode(); 167 virtual ~TComWedgeNode() {} 168 169 UInt getPatternIdx(); 170 UInt getRefineIdx ( UInt uiPos ); 171 172 Void setPatternIdx( UInt uiIdx ); 173 Void setRefineIdx ( UInt uiIdx, UInt uiPos ); 174 }; // END CLASS DEFINITION TComWedgeNode 175 176 // type definition wedgelet node list 177 typedef std::vector<TComWedgeNode> WedgeNodeList; 178 #endif 138 179 139 180 #if HHI_DMM_PRED_TEX -
trunk/source/Lib/TLibCommon/TComYuv.cpp
r118 r189 409 409 410 410 #if LG_RESTRICTEDRESPRED_M24766 411 void411 Void 412 412 TComYuv::getPUXYOffset(PartSize uhPartitionSize, Int iWidth, Int iHeight, Int &iXOffset, Int &iYOffset) 413 413 { -
trunk/source/Lib/TLibCommon/TypeDef.h
r128 r189 42 42 //! \{ 43 43 44 #define FIXES 1 45 #define POZNAN_CABAC_INIT_FLAG_FIX 1 46 #define FIX_DECODING_WO_WRITING 1 47 #define FIX_INIT_ROM 1 48 #define FIX_VIRT_DESTRUCTOR 1 49 #define FIX_MEM_LEAKS 1 50 #define FIX_VSO_SETUP 1 51 #define FIX_COMP_WARNING_INIT 1 52 #define FIX_RDO_MACRO 1 44 ///// ***** FIXES ********* 45 // A 46 #define FIX_POZNAN_CABAC_INIT_FLAG 1 53 47 #define FIX_LG_RESTRICTEDRESPRED_M24766 1 54 #define FIX_REMOVE_TILE_DEPENDENCE 1 55 #define FIX_DBL_CONTROL_DEFAULT 1 56 57 58 #define LGE_EDGE_INTRA 1 // JCT2-A0070 59 #if LGE_EDGE_INTRA 48 49 // B 50 #define FIX_LGE_IVMP_PARALLEL_MERGE_B0136 1 51 #define FIX_RDO_NEGDIST 1 52 #define FIX_DMM_NEG_DIST 1 53 #define FIX_LGE_DVMCP_B0133 1 54 55 56 ///// ***** PATCHES ********* 57 #define TMVP_DEPTH_SWITCH 1 // JCT3V-B0092 additional encoder option only 58 59 ///// ***** DEPTH MODELING MODES ********* 60 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction) 61 #define HHI_DMM_PRED_TEX 1 // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction ) 62 #define LGE_EDGE_INTRA_A0070 1 // JCT3V-A0070 63 #define RWTH_SDC_DLT_B0036 1 // JCT3V-B0036: Simplified Depth Coding + Depth Lookup Table 64 #define HHIQC_DMMFASTSEARCH_B0039 1 // JCT3V-B0039: fast Wedgelet search for DMM modes 1 and 3 65 66 ///// ***** INTERVIEW MOTION VECTOR PREDICTION ********* 67 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction 68 #define SHARP_INTERVIEW_DECOUPLE_B0111 1 // JCT3V-B0111 decoupling inter-view candidate 69 #define QC_MRG_CANS_B0048 1 // JCT3V-B0048, B0086, B0069 70 #if QC_MRG_CANS_B0048 71 #define OL_DISMV_POS_B0069 1 // different pos for disparity MV candidate, B0069 72 #endif 73 #define MTK_INTERVIEW_MERGE_A0049 1 // JCT3V-A0049 second part 74 #if HHI_INTER_VIEW_MOTION_PRED 75 #define SAIT_IMPROV_MOTION_PRED_M24829 1 // improved inter-view motion vector prediction 76 #else 77 #define SAIT_IMPROV_MOTION_PRED_M24829 0 78 #endif 79 80 ///// ***** INTERVIEW RESIDUAL PREDICTION ********* 81 #define HHI_INTER_VIEW_RESIDUAL_PRED 1 // inter-view residual prediction 82 #if HHI_INTER_VIEW_RESIDUAL_PRED 83 #define LG_RESTRICTEDRESPRED_M24766 1 // restricted inter-view residual prediction 84 #define QC_SIMPLIFIEDIVRP_M24938 1 85 #else 86 #define LG_RESTRICTEDRESPRED_M24766 0 87 #define QC_SIMPLIFIEDIVRP_M24938 0 88 #endif 89 90 ///// ***** DISPARITY VECTOR DERIVATION ********* 91 #define QC_MULTI_DIS_CAN_A0097 1 // JCT3V-A0097 92 #define LGE_DVMCP_A0126 1 // JCT3V-A0126 93 #define LGE_DVMCP_MEM_REDUCTION_B0135 1 // JCT3V-B0135 94 #define DV_DERIVATION_PARALLEL_B0096 1 // JCT3V-B0096, enable parallel derivation of disparity vector 95 #define QC_SIMPLE_NBDV_B0047 1 // JCT3V-B0047 96 97 ///// ***** MOTION PARAMETER INHERITANCE ********* 98 #define HHI_MPI 1 // motion parameter inheritance from texture picture for depth map coding 99 #if HHI_MPI 100 #define FIX_MPI_B0065 1 // JCT3V-B0065, fix the MPI bug when RQT is off 101 #endif 102 #define MTK_UNCONSTRAINED_MVI_B0083 1 //JCT3V-B0083 103 104 ///// ***** VIEW SYNTHESIS OPTIMIZAION ********* 105 #define HHI_VSO 1 106 #define HHI_VSO_LS_TABLE_M23714 1 // m23714, enable table base Lagrange multiplier optimization 107 #define HHI_VSO_DIST_INT 1 // Allow negative synthesized view distortion change 108 #define HHI_VSO_COLOR_PLANES 1 // Compute VSO distortion on color planes 109 #define HHI_VSO_RM_ASSERTIONS 0 // Output VSO assertions 110 #define HHI_VSO_SYNTH_DIST_OUT 0 // Output of synthesized view distortion instead of depth distortion in encoder output 111 #define SAIT_VSO_EST_A0033 1 // JCT3V-A0033 modification 3 112 #define LGE_VSO_EARLY_SKIP_A0093 1 // JCT3V-A0093 modification 4 113 #define LGE_WVSO_A0119 1 // JCT3V-A0119 & JCT3V-B0131 Depth Metric with a weighted depth fidelity term 114 115 116 ///// ***** ILLUMINATION COMPENSATON ********* 117 #define LGE_ILLUCOMP_B0045 1 // JCT2-B0045 Illumination compensation for Luma and Chroma 118 #if LGE_ILLUCOMP_B0045 119 #define LGE_ILLUCOMP_B0045_ENCSIMP 1 120 #endif 121 122 ///// ***** INTERVIEW SKIP ********* 123 #define HHI_INTERVIEW_SKIP 1 124 125 ///// ***** QUADTREE LIMITATION ********* 126 #define OL_QTLIMIT_PREDCODING_B0068 1 //JCT3V-B0068 127 128 ///// ***** OTHERS ********* 129 #define LG_ZEROINTRADEPTHRESI_A0087 1 // JCT2-A0087 130 #define SONY_COLPIC_AVAILABILITY 1 131 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1 // full-pel mv accuracy for depth maps 132 #define VIDYO_VPS_INTEGRATION 1 133 134 135 136 ///// ***** DEFINED PARAMETERS ********* 137 #if QC_MULTI_DIS_CAN_A0097 138 #define DIS_CANS 1 139 #endif 140 141 #define HHI_INTERVIEW_SKIP_LAMBDA_SCALE 1 142 143 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 144 #define DMM_WEDGEMODEL_MIN_SIZE 4 145 #define DMM_WEDGEMODEL_MAX_SIZE 32 146 #define DMM_WEDGE_PREDDIR_DELTAEND_MAX 4 147 #endif 148 149 #if LGE_EDGE_INTRA_A0070 60 150 #define LGE_EDGE_INTRA_MIN_SIZE 4 61 151 #define LGE_EDGE_INTRA_MAX_SIZE 32 … … 66 156 #endif 67 157 68 #define LG_ZEROINTRADEPTHRESI_M26039 1 // JCT2-A0087 69 70 #define SONY_COLPIC_AVAILABILITY 1 71 72 #define HHI_INTER_VIEW_MOTION_PRED 1 // inter-view motion parameter prediction 73 #define HHI_INTER_VIEW_RESIDUAL_PRED 1 // inter-view residual prediction 74 #define QC_MULTI_DIS_CAN 1 // JCT2-A0097 75 #if QC_MULTI_DIS_CAN 76 #define DIS_CANS 1 77 #endif 78 79 #define MTK_INTERVIEW_MERGE_A0049 1 // JCT2-A0049 second part 80 81 #define LGE_DVMCP 1 // JCT2-A0126 82 #if LGE_DVMCP 158 159 #if LGE_DVMCP_A0126 83 160 #define DVFROM_LEFTBELOW 1 84 161 #define DVFROM_LEFT 2 … … 90 167 91 168 92 #define HHI_VSO 1 93 #define HHI_VSO_LS_TABLE 1 // m23714 94 #define HHI_VSO_DIST_INT 1 95 #define HHI_VSO_SYNTH_DIST_OUT 0 96 #define HHI_VSO_COLOR_PLANES 1 97 #define HHI_VSO_SPEEDUP_A0033 1 // JCT2-A0033 modification 1 (changes in classes directly related the renderer model 98 // to are not covered by this define, since nearly the entire class has been changed) 99 #define HHI_VSO_RM_ASSERTIONS 0 // output VSO assertions 100 #define HHI_VSO_SET_OPTIM 1 // remove unnecessary updates (works only with HHI_VSO_FIX 1 properly) 101 #define SAIT_VSO_EST_A0033 1 // JCT2-A0033 modification 3 102 #define LGE_VSO_EARLY_SKIP_A0093 1 // JCT2-A0093 modification 4 103 #define LGE_WVSO_A0119 1 // JCT2-A0119 Depth Metric with a weighted depth fidelity term 104 105 #define OL_DEPTHLIMIT_A0044 1 //JCT2-A0044 106 #if OL_DEPTHLIMIT_A0044 107 #define OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1 //Turn this on to not perform depth limiting for I-SLICES. 108 #define OL_END_CU MAX_INT //Default for initializing the partition information buffer 109 #define OL_PART_BUF_SIZE 86 //maximum number of possible partition bits in a CU 110 #endif 111 112 #define HHI_INTERVIEW_SKIP 1 113 #define HHI_INTERVIEW_SKIP_LAMBDA_SCALE 1 114 115 #define HHI_DMM_WEDGE_INTRA 1 // depth model modes independent on texture (explicit and intra-predicted Wedgelet prediction) 116 #define HHI_DMM_PRED_TEX 1 // depth model modes dependent on texture (inter-component Wedgelet and Contour prediction ) 117 118 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 119 #define DMM_WEDGEMODEL_MIN_SIZE 4 120 #define DMM_WEDGEMODEL_MAX_SIZE 32 121 #define DMM_WEDGE_PREDDIR_DELTAEND_MAX 4 122 #endif 123 124 #define HHI_MPI 1 // motion parameter inheritance from texture picture for depth map coding 169 #if HHIQC_DMMFASTSEARCH_B0039 170 #define DMM3_SIMPLIFY_TR 1 171 #endif 172 173 174 #if RWTH_SDC_DLT_B0036 175 #define Log2( n ) ( log((double)n) / log(2.0) ) 176 #endif 177 125 178 #define HHI_MPI_MERGE_POS 0 126 #define HHI_FULL_PEL_DEPTH_MAP_MV_ACC 1 // full-pel mv accuracy for depth maps 127 128 #if HHI_INTER_VIEW_MOTION_PRED 129 #define SAIT_IMPROV_MOTION_PRED_M24829 1 // improved inter-view motion vector prediction 130 #else 131 #define SAIT_IMPROV_MOTION_PRED_M24829 0 132 #endif 133 134 #if HHI_INTER_VIEW_RESIDUAL_PRED 135 #define LG_RESTRICTEDRESPRED_M24766 1 // restricted inter-view residual prediction 136 #define QC_SIMPLIFIEDIVRP_M24938 1 137 #else 138 #define LG_RESTRICTEDRESPRED_M24766 0 139 #define QC_SIMPLIFIEDIVRP_M24938 0 140 #endif 141 142 179 180 ///// ***** HM 6.1 ********* 143 181 #define SKIPFRAME_BUGFIX 1 ///< bug fix to enable skipFrame at decoder 144 182 #define START_DECODING_AT_CRA 1 ///< H0496, start decoding at clear random access point … … 151 189 152 190 #define PARALLEL_MERGE 1 //< H0082 parallel merge/skip 191 #define LGE_IVMP_PARALLEL_MERGE_B0136 1 //< B0136 support of parallel merge/skip in disparity vector derivation 153 192 #define LOG2_PARALLEL_MERGE_LEVEL_MINUS2 0 //< H0082 parallel merge level 0-> 4x4, 1-> 8x8, 2->16x16, 3->32x32, 4->64x64 193 154 194 #if PARALLEL_MERGE && LOG2_PARALLEL_MERGE_LEVEL_MINUS2 155 195 #define CU_BASED_MRG_CAND_LIST 1 //< H0240: single merge candidate list for all PUs inside a 8x8 CU conditioned on LOG2_PARALLEL_MERGE_LEVEL_MINUS2 > 0 156 #endif 196 #define FIX_CU_BASED_MRG_CAND_LIST_B0136 1 //< B0136 bug fix for CU_BASED_MRG_CAND_LIST 197 #endif 198 157 199 #define MVP_AT_ENTROPYSLICE_BOUNDARY 1 //< H0362 enable motion prediction accross entropy slice boundary 158 200 159 201 #define FAST_DECISION_FOR_MRG_RD_COST 1 ////< H0178: Fast Decision for Merge 2Nx2N RDCost 160 202 161 #define PIC_CROPPING 1 ///< Picture cropping and size constraints162 #define NAL_REF_FLAG 1 ///< Change nal_ref_idc to nal_ref_flag (JCTVC-F463)163 #define REMOVE_DIV_OPERATION 1 ///< H0238: Simplified intra horizontal and vertical filtering203 #define PIC_CROPPING 1 ///< Picture cropping and size constraints 204 #define NAL_REF_FLAG 1 ///< Change nal_ref_idc to nal_ref_flag (JCTVC-F463) 205 #define REMOVE_DIV_OPERATION 1 ///< H0238: Simplified intra horizontal and vertical filtering 164 206 #define LOGI_INTRA_NAME_3MPM 1 ///< H0407: logical Intra mode naming (sequential angular mode numbering) and 3 MPM mode coding 165 207 … … 172 214 #define MULTIBITS_DATA_HIDING 1 ///< H0481: multiple sign bit hiding 173 215 174 #define DEQUANT_CLIPPING 216 #define DEQUANT_CLIPPING 1 ///< H0312/H0541: transformed coefficients clipping before de-quantization 175 217 176 218 #define REMOVE_NON_SCALED 1 ///< H0164/H0250: Removal of non-scaled merge candidate … … 280 322 #define LOG2_SCAN_SET_SIZE 4 281 323 282 #if LGE_EDGE_INTRA 324 #if LGE_EDGE_INTRA_A0070 283 325 #if LGE_EDGE_INTRA_DELTA_DC 284 326 #define FAST_UDI_MAX_RDMODE_NUM 37 ///< maximum number of RD comparison in fast-UDI estimation loop … … 328 370 #endif 329 371 330 #if LGE_EDGE_INTRA 372 #if LGE_EDGE_INTRA_A0070 331 373 #if HHI_DMM_WEDGE_INTRA && HHI_DMM_PRED_TEX 332 374 #define EDGE_INTRA_IDX (NUM_INTRA_MODE+NUM_DMM_MODE) … … 353 395 // This is here just to perform timing tests -- OL_FLUSH_ALIGN should be 0 for WPP. 354 396 355 #define RVM_VCEGAM10_M 4397 #define RVM_VCEGAM10_M 4 356 398 357 399 #define PLANAR_IDX 0 … … 435 477 // VPS INTEGRATION 436 478 // ==================================================================================================================== 437 #define VIDYO_VPS_INTEGRATION 1 479 438 480 #if VIDYO_VPS_INTEGRATION 439 481 #define MAX_NUM_VPS 10 … … 720 762 }; 721 763 722 #if HHI_VSO_SPEEDUP_A0033723 764 724 765 enum BlenMod … … 730 771 BLEND_GEN = 3 731 772 }; 732 #endif733 773 734 774 /// supported prediction type
Note: See TracChangeset for help on using the changeset viewer.