Changeset 189 in 3DVCSoftware for trunk/source
- Timestamp:
- 18 Nov 2012, 22:11:37 (12 years ago)
- Location:
- trunk/source
- Files:
-
- 65 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/App/TAppDecoder/TAppDecTop.cpp
r105 r189 436 436 m_useDepth = true; 437 437 438 #if FIX_DECODING_WO_WRITING439 438 if ( m_pchReconFile ) 440 439 { 441 #endif442 440 while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth) 443 441 { … … 473 471 free ( nextFilename ); 474 472 } 475 #if FIX_DECODING_WO_WRITING 476 } 477 #endif 473 } 478 474 479 475 while( m_pocLastDisplay.size() < newNumberOfViewDepth ) -
trunk/source/App/TAppEncoder/TAppEncCfg.cpp
r128 r189 74 74 { 75 75 m_aidQP = NULL; 76 #if FIXES77 76 m_aidQPdepth = NULL; 78 #endif79 77 } 80 78 … … 86 84 } 87 85 88 #if FIXES89 86 if ( m_aidQPdepth ) 90 87 { 91 88 delete[] m_aidQPdepth; m_aidQPdepth = NULL; 92 89 } 93 #endif94 90 95 91 for(Int i = 0; i< m_pchInputFileList.size(); i++ ) … … 120 116 #endif 121 117 122 #if FIX_MEM_LEAKS123 118 if ( m_pchCameraParameterFile != NULL ) 124 119 free ( m_pchCameraParameterFile ); … … 139 134 free ( m_scalingListFile ); 140 135 141 #endif142 136 143 137 } … … 326 320 ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0 ) 327 321 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) 322 #if LGE_ILLUCOMP_B0045 323 ("IlluCompEnable", m_bUseIC , true , "Use illumination compensation for inter-view prediction" ) 324 #endif 328 325 #if DBL_CONTROL 329 #if FIX_DBL_CONTROL_DEFAULT330 326 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, true) 331 #else332 ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false)333 #endif334 327 #endif 335 328 … … 346 339 ("LambdaScaleVSO", m_dLambdaScaleVSO , (Double) 1 , "Lambda Scaling for VSO") 347 340 348 #if HHI_VSO_LS_TABLE 341 #if HHI_VSO_LS_TABLE_M23714 349 342 ("VSOLSTable", m_bVSOLSTable , true , "Depth QP dependent video/depth rate allocation by Lagrange multiplier" ) 350 343 #endif … … 361 354 #endif 362 355 #if LGE_WVSO_A0119 363 ("WVSO", m_bUseWVSO , false, "Use depth fidelity term for VSO" )356 ("WVSO", m_bUseWVSO , true , "Use depth fidelity term for VSO" ) 364 357 ("VSOWeight", m_iVSOWeight , 10 , "Synthesized View Distortion Change weight" ) 365 358 ("VSDWeight", m_iVSDWeight , 1 , "View Synthesis Distortion estimate weight" ) … … 367 360 #endif 368 361 369 #if OL_ DEPTHLIMIT_A0044370 (" DPL", m_bDepthPartitionLimiting , false , "Use DepthPartitionLimiting" )362 #if OL_QTLIMIT_PREDCODING_B0068 363 ("QTLPC", m_bUseQTLPC , true , "Use depth Quadtree Limitation + Predictive Coding" ) 371 364 #endif 372 365 … … 454 447 "\t0: disable") 455 448 449 #if TMVP_DEPTH_SWITCH 450 ("TMVP", m_enableTMVP, std::vector<Bool>(1,true), "Enable TMVP" ) 451 #else 456 452 ("TMVP", m_enableTMVP, true, "Enable TMVP" ) 453 #endif 457 454 458 455 ("FEN", m_bUseFastEnc, false, "fast encoder setting") … … 473 470 #if HHI_MPI 474 471 ("MVI", m_bUseMVI, false, "use motion vector inheritance for depth map coding") 472 #endif 473 #if RWTH_SDC_DLT_B0036 474 ("DLT", m_bUseDLT, true, "use depth lookup table for depth map coding") 475 ("SDC", m_bUseSDC, true, "use simplified depth coding tree") 475 476 #endif 476 477 ; … … 684 685 xCleanUpVectors(); 685 686 687 688 #if TMVP_DEPTH_SWITCH 689 if ( m_enableTMVP.size() < 2) 690 { 691 m_enableTMVP.push_back( m_enableTMVP[0] ); 692 } 693 #endif 694 695 686 696 #if HHI_VSO 687 697 if ( m_abUseALF .size() < 2) … … 712 722 #if HHI_VSO 713 723 714 #if HHI_VSO_LS_TABLE 724 #if HHI_VSO_LS_TABLE_M23714 715 725 // Q&D 716 726 Double adLambdaScaleTable[] = … … 1620 1630 printf("VSO Negative Distortion : %d\n", m_bAllowNegDist ? 1 : 0); 1621 1631 #endif 1622 #if HHI_VSO_LS_TABLE 1632 #if HHI_VSO_LS_TABLE_M23714 1623 1633 printf("VSO LS Table : %d\n", m_bVSOLSTable ? 1 : 0); 1624 1634 #endif … … 1704 1714 printf(" ScalingList:%d ", m_useScalingListId ); 1705 1715 1716 #if !TMVP_DEPTH_SWITCH 1706 1717 printf("TMVP:%d ", m_enableTMVP ); 1718 #endif 1707 1719 1708 1720 #if ADAPTIVE_QP_SELECTION … … 1718 1730 printf("SAO:%d ", (m_abUseSAO [0] ? 1 : 0)); 1719 1731 printf("RDQ:%d ", (m_abUseRDOQ[0] ? 1 : 0) ); 1732 #if TMVP_DEPTH_SWITCH 1733 printf("TMVP:%d ", (m_enableTMVP[0] ? 1 : 0) ); 1734 #endif 1735 #if LGE_ILLUCOMP_B0045 1736 printf("IlluCompEnable: %d ", m_bUseIC); 1737 #endif 1738 1720 1739 printf("\n"); 1721 1740 … … 1724 1743 printf("SAO:%d ", (m_abUseSAO [1] ? 1 : 0)); 1725 1744 printf("RDQ:%d ", (m_abUseRDOQ[1] ? 1 : 0)); 1745 #if TMVP_DEPTH_SWITCH 1746 printf("TMVP:%d ", (m_enableTMVP[1] ? 1 : 0) ); 1747 #endif 1726 1748 #if HHI_VSO 1727 1749 printf("VSO:%d ", m_bUseVSO ); … … 1730 1752 printf("WVSO:%d ", m_bUseWVSO ); 1731 1753 #endif 1732 #if OL_ DEPTHLIMIT_A00441733 printf(" DPL:%d ", m_bDepthPartitionLimiting);1754 #if OL_QTLIMIT_PREDCODING_B0068 1755 printf("QTLPC:%d ", m_bUseQTLPC); 1734 1756 #endif 1735 1757 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 1739 1761 printf("MVI:%d ", m_bUseMVI ? 1 : 0 ); 1740 1762 #endif 1763 #if RWTH_SDC_DLT_B0036 1764 printf("SDC:%d ", m_bUseSDC ? 1 : 0 ); 1765 printf("DLT:%d ", m_bUseDLT ? 1 : 0 ); 1766 #endif 1741 1767 #if LGE_WVSO_A0119 1742 printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight ); 1768 if ( m_bUseWVSO ) 1769 printf("\nVSO : VSD : SAD weight = %d : %d : %d ", m_iVSOWeight, m_iVSDWeight, m_iDWeight ); 1743 1770 #endif 1744 1771 printf("\n\n"); -
trunk/source/App/TAppEncoder/TAppEncCfg.h
r120 r189 160 160 #endif 161 161 vector<Bool> m_abUseSAO; 162 #if LGE_ILLUCOMP_B0045 163 Bool m_bUseIC; ///< flag for using illumination compensation for inter-view prediction 164 #endif 162 165 #if SAO_UNIT_INTERLEAVING 163 166 Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture … … 258 261 UInt m_uiBiPredIdc; ///< Use of Bi-Directional Weighting Prediction (B_SLICE): explicit(1) or implicit(2) 259 262 263 #if TMVP_DEPTH_SWITCH 264 vector<Bool> m_enableTMVP; ///< Enable TMVP [0] video, [1] depth 265 #else 260 266 Bool m_enableTMVP; 267 #endif 268 261 269 #if MULTIBITS_DATA_HIDING 262 270 Int m_signHideFlag; … … 265 273 #if HHI_MPI 266 274 Bool m_bUseMVI; ///< flag for using Motion Vector Inheritance for depth map coding 275 #endif 276 #if RWTH_SDC_DLT_B0036 277 Bool m_bUseDLT; 278 Bool m_bUseSDC; 267 279 #endif 268 280 … … 280 292 Char* m_pchVSOConfig; 281 293 Bool m_bUseVSO; ///< flag for using View Synthesis Optimization 282 #if HHI_VSO_LS_TABLE 294 #if HHI_VSO_LS_TABLE_M23714 283 295 Bool m_bVSOLSTable; ///< Depth QP dependent Lagrange parameter optimization (m23714) 284 296 #endif … … 308 320 #endif 309 321 310 #if OL_ DEPTHLIMIT_A0044311 Bool m_b DepthPartitionLimiting;322 #if OL_QTLIMIT_PREDCODING_B0068 323 Bool m_bUseQTLPC; ///< flag for using depth QuadTree Limitation + Predictive Coding 312 324 #endif 313 325 -
trunk/source/App/TAppEncoder/TAppEncTop.cpp
r124 r189 300 300 m_acTEncTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 301 301 m_acTEncTopList[iViewIdx]->setUseSAO ( m_abUseSAO[0] ); 302 #if LGE_ILLUCOMP_B0045 303 m_acTEncTopList[iViewIdx]->setUseIC ( m_bUseIC ); 304 #endif 302 305 #if SAO_UNIT_INTERLEAVING 303 306 m_acTEncTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); … … 342 345 m_acTEncTopList[iViewIdx]->setWaveFrontFlush ( m_iWaveFrontFlush ); 343 346 m_acTEncTopList[iViewIdx]->setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); 347 #if TMVP_DEPTH_SWITCH 348 m_acTEncTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP[0] ); 349 #else 344 350 m_acTEncTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP ); 351 #endif 345 352 m_acTEncTopList[iViewIdx]->setUseScalingListId ( m_useScalingListId ); 346 353 m_acTEncTopList[iViewIdx]->setScalingListFile ( m_scalingListFile ); … … 364 371 m_acTEncTopList[iViewIdx]->setUseDMM ( false ); 365 372 #endif 366 #if OL_ DEPTHLIMIT_A0044367 m_acTEncTopList[iViewIdx]->setUse DPL( false );373 #if OL_QTLIMIT_PREDCODING_B0068 374 m_acTEncTopList[iViewIdx]->setUseQTLPC ( false ); 368 375 #endif 369 376 #if HHI_MPI 370 377 m_acTEncTopList[iViewIdx]->setUseMVI( false ); 378 #endif 379 #if RWTH_SDC_DLT_B0036 380 m_acTEncTopList[iViewIdx]->setUseDLT ( false ); 381 m_acTEncTopList[iViewIdx]->setUseSDC ( false ); 371 382 #endif 372 383 } … … 579 590 m_acTEncDepthTopList[iViewIdx]->setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); 580 591 m_acTEncDepthTopList[iViewIdx]->setUseSAO ( m_abUseSAO[1] ); 592 #if LGE_ILLUCOMP_B0045 593 m_acTEncDepthTopList[iViewIdx]->setUseIC ( false ); 594 #endif 581 595 #if SAO_UNIT_INTERLEAVING 582 596 m_acTEncDepthTopList[iViewIdx]->setMaxNumOffsetsPerPic (m_maxNumOffsetsPerPic); … … 621 635 m_acTEncDepthTopList[iViewIdx]->setWaveFrontFlush ( m_iWaveFrontFlush ); 622 636 m_acTEncDepthTopList[iViewIdx]->setWaveFrontSubstreams ( m_iWaveFrontSubstreams ); 637 #if TMVP_DEPTH_SWITCH 638 m_acTEncDepthTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP[1] ); 639 #else 623 640 m_acTEncDepthTopList[iViewIdx]->setEnableTMVP ( m_enableTMVP ); 641 #endif 624 642 m_acTEncDepthTopList[iViewIdx]->setUseScalingListId ( m_useScalingListId ); 625 643 m_acTEncDepthTopList[iViewIdx]->setScalingListFile ( m_scalingListFile ); … … 643 661 m_acTEncDepthTopList[iViewIdx]->setUseDMM ( m_bUseDMM ); 644 662 #endif 645 #if OL_ DEPTHLIMIT_A0044646 m_acTEncDepthTopList[iViewIdx]->setUse DPL (m_bDepthPartitionLimiting);663 #if OL_QTLIMIT_PREDCODING_B0068 664 m_acTEncDepthTopList[iViewIdx]->setUseQTLPC (m_bUseQTLPC); 647 665 #endif 648 666 #if HHI_MPI 649 667 m_acTEncDepthTopList[iViewIdx]->setUseMVI( m_bUseMVI ); 650 668 #endif 669 #if RWTH_SDC_DLT_B0036 670 m_acTEncDepthTopList[iViewIdx]->setUseDLT ( m_bUseDLT ); 671 m_acTEncDepthTopList[iViewIdx]->setUseSDC ( m_bUseSDC ); 672 #endif 651 673 } 652 674 } … … 667 689 if ( m_uiVSOMode == 4 ) 668 690 { 669 #if HHI_VSO_SPEEDUP_A0033670 691 #if LGE_VSO_EARLY_SKIP_A0093 671 692 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip ); 672 693 #else 673 694 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, g_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 ); 674 #endif675 #else676 m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_iSourceHeight, LOG2_DISP_PREC_LUT, 0 );677 695 #endif 678 696 … … 867 885 eos.push_back( false ); 868 886 depthEos.push_back( false ); 887 888 #if RWTH_SDC_DLT_B0036 889 if( m_bUsingDepthMaps && m_bUseDLT ) 890 xAnalyzeInputBaseDepth(iViewIdx, m_iIntraPeriod); 891 #endif 869 892 } 870 893 … … 1000 1023 pcDepthPicYuvOrg = NULL; 1001 1024 1002 #if FIX_MEM_LEAKS1003 1025 if ( pcPdmDepthOrg != NULL ) 1004 1026 { … … 1007 1029 pcPdmDepthOrg = NULL; 1008 1030 }; 1009 #endif1010 1031 1011 1032 … … 1266 1287 #endif 1267 1288 #if HHI_VSO 1268 #if HHI_VSO_SPEEDUP_A00331269 1289 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset ) 1270 1290 { 1271 #if FIX_VSO_SETUP1272 1291 m_cRendererModel.setupPart( iHorOffset, Min( g_uiMaxCUHeight, m_iSourceHeight - iHorOffset ) ); 1273 #else1274 m_cRendererModel.setHorOffset( iHorOffset );1275 #endif1276 #else1277 Void TAppEncTop::setupRenModel( Int iPoc, Int iEncViewIdx, Int iEncContent )1278 {1279 #endif1280 1292 Int iEncViewSIdx = m_cCameraData.getBaseId2SortedId()[ iEncViewIdx ]; 1281 1293 … … 1415 1427 return pcPic; 1416 1428 }; 1429 1430 #if RWTH_SDC_DLT_B0036 1431 Void TAppEncTop::xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames) 1432 { 1433 TComPicYuv* pcDepthPicYuvOrg = new TComPicYuv; 1434 // allocate original YUV buffer 1435 pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxCUDepth ); 1436 1437 TVideoIOYuv* depthVideoFile = new TVideoIOYuv; 1438 1439 UInt uiMaxDepthValue = g_uiIBDI_MAX; 1440 1441 Bool abValidDepths[256]; 1442 1443 depthVideoFile->open( m_pchDepthInputFileList[iViewIdx], false, m_uiInputBitDepth, m_uiInternalBitDepth ); // read mode 1444 1445 // initialize boolean array 1446 for(Int p=0; p<=uiMaxDepthValue; p++) 1447 abValidDepths[p] = false; 1448 1449 Int iHeight = pcDepthPicYuvOrg->getHeight(); 1450 Int iWidth = pcDepthPicYuvOrg->getWidth(); 1451 Int iStride = pcDepthPicYuvOrg->getStride(); 1452 1453 Pel* pInDM = pcDepthPicYuvOrg->getLumaAddr(); 1454 1455 for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ ) 1456 { 1457 depthVideoFile->read( pcDepthPicYuvOrg, m_aiPad, false ); 1458 1459 // check all pixel values 1460 for (Int i=0; i<iHeight; i++) 1461 { 1462 Int rowOffset = i*iStride; 1463 1464 for (Int j=0; j<iWidth; j++) 1465 { 1466 Pel depthValue = pInDM[rowOffset+j]; 1467 abValidDepths[depthValue] = true; 1468 } 1469 } 1470 } 1471 1472 depthVideoFile->close(); 1473 1474 pcDepthPicYuvOrg->destroy(); 1475 delete pcDepthPicYuvOrg; 1476 1477 // convert boolean array to idx2Depth LUT 1478 UInt* auiIdx2DepthValue = (UInt*) calloc(uiMaxDepthValue, sizeof(UInt)); 1479 UInt uiNumDepthValues = 0; 1480 for(UInt p=0; p<=uiMaxDepthValue; p++) 1481 { 1482 if( abValidDepths[p] == true) 1483 { 1484 auiIdx2DepthValue[uiNumDepthValues++] = p; 1485 } 1486 } 1487 1488 if( uiNumFrames == 0 || ceil(Log2(uiNumDepthValues)) == ceil(Log2(g_uiIBDI_MAX)) ) 1489 { 1490 // don't use DLT 1491 m_acTEncDepthTopList[iViewIdx]->setUseDLT(false); 1492 m_acTEncDepthTopList[iViewIdx]->getSPS()->setUseDLT(false); 1493 } 1494 1495 // assign LUT 1496 if( m_acTEncDepthTopList[iViewIdx]->getUseDLT() ) 1497 m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues); 1498 else 1499 m_acTEncDepthTopList[iViewIdx]->getSPS()->setDepthLUTs(); 1500 1501 // free temporary memory 1502 free(auiIdx2DepthValue); 1503 } 1504 #endif 1417 1505 1418 1506 //! \} -
trunk/source/App/TAppEncoder/TAppEncTop.h
r102 r189 136 136 #endif 137 137 #if HHI_VSO 138 #if HHI_VSO_SPEEDUP_A0033139 138 Void setupRenModel ( Int iPoc, Int iEncViewIdx, Int iEncContent, Int iHorOffset ); 140 #else141 Void setupRenModel ( Int iPoc, Int iEncViewIdx, Int iEncContent );142 #endif143 139 #endif 144 140 … … 161 157 Void xStoreVSORefPicsInBuffer(); ///< read in External Ref pic from file and store in buffer 162 158 #endif 159 160 #if RWTH_SDC_DLT_B0036 161 Void xAnalyzeInputBaseDepth(Int iViewIdx, UInt uiNumFrames); 162 #endif 163 163 164 164 };// END CLASS DEFINITION TAppEncTop -
trunk/source/App/TAppRenderer/TAppRendererCfg.cpp
r100 r189 120 120 121 121 /* File I/O */ 122 ("VideoInputFileBaseName ", m_pchVideoInputFileBaseName, (Char*) 0, "Basename to generate video input file names")123 ("DepthInputFileBaseName ", m_pchDepthInputFileBaseName, (Char*) 0, "Basename to generate depth input file names")124 ("SynthOutputFileBaseName ", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")122 ("VideoInputFileBaseName,v", m_pchVideoInputFileBaseName, (Char*) 0, "Basename to generate video input file names") 123 ("DepthInputFileBaseName,d", m_pchDepthInputFileBaseName, (Char*) 0, "Basename to generate depth input file names") 124 ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names") 125 125 ("ContOutputFileNumbering", m_bContOutputFileNumbering , false , "Continuous Output File Numbering") 126 126 ("Sweep" , m_bSweep , false , "Store all views in first Output File") … … 137 137 138 138 /* Camera Specification */ 139 ("CameraParameterFile, cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name")139 ("CameraParameterFile,-cpf", m_pchCameraParameterFile, (Char *) 0, "Camera Parameter File Name") 140 140 ("BaseViewCameraNumbers" , m_pchBaseViewCameraNumbers, (Char *) 0, "Numbers of base views") 141 141 ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers, (Char *) 0, "Numbers of views to synthesis") -
trunk/source/App/TAppRenderer/TAppRendererTop.cpp
r124 r189 532 532 #endif 533 533 534 #if HHI_VSO_SPEEDUP_A0033535 #if FIX_VSO_SETUP536 534 cCurModel.setupPart( 0, m_iSourceHeight ); 537 #else538 cCurModel.setHorOffset( 0 );539 #endif540 #endif541 535 542 536 for ( Int iViewIdx = 0; iViewIdx < m_iNumberOfInputViews; iViewIdx++ ) … … 713 707 714 708 AOT( m_iLog2SamplingFactor != 0 ); 715 #if HHI_VSO_SPEEDUP_A0033716 #if FIX_VSO_SETUP717 709 cCurModel.setupPart( 0, m_iSourceHeight ); 718 #else719 cCurModel.setHorOffset( 0 );720 #endif721 #endif722 710 #if LGE_VSO_EARLY_SKIP_A0093 723 711 cCurModel.create( m_iNumberOfInputViews, m_iNumberOfOutputViews, m_iSourceWidth, m_iSourceHeight, m_iShiftPrecision, m_iBlendHoleMargin, false ); -
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 -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r100 r189 1674 1674 } 1675 1675 #endif 1676 1677 READ_FLAG( uiCode, "base_view_flag" ); 1676 #if OL_QTLIMIT_PREDCODING_B0068 1677 if( bIsDepth ) 1678 { 1679 READ_FLAG( uiCode, "use_qtlpc_flag" ); 1680 pcSPS->setUseQTLPC( uiCode ); 1681 } 1682 #endif 1683 1684 #if RWTH_SDC_DLT_B0036 1685 if( bIsDepth ) 1686 { 1687 READ_FLAG( uiCode, "use_dlt_flag" ); 1688 pcSPS->setUseDLT( uiCode ); 1689 if( pcSPS->getUseDLT() ) 1690 { 1691 // decode mapping 1692 UInt uiNumDepthValues; 1693 // parse number of values in DLT 1694 xReadUvlc( uiNumDepthValues ); 1695 1696 // parse actual DLT values 1697 UInt* auiIdx2DepthValue = (UInt*) calloc(uiNumDepthValues, sizeof(UInt)); 1698 for(UInt d=0; d<uiNumDepthValues; d++) 1699 { 1700 xReadUvlc( uiCode ); 1701 auiIdx2DepthValue[d] = uiCode; 1702 } 1703 1704 pcSPS->setDepthLUTs(auiIdx2DepthValue, uiNumDepthValues); 1705 1706 // clean memory 1707 free(auiIdx2DepthValue); 1708 } 1709 else 1710 pcSPS->setDepthLUTs(); 1711 } 1712 #endif 1713 1714 READ_FLAG( uiCode, "base_view_flag" ); 1678 1715 if( uiCode ) 1679 1716 { // baseview SPS -> set standard values … … 1803 1840 UInt address; 1804 1841 UInt innerAddress = 0; 1842 1843 #if LGE_ILLUCOMP_B0045 1844 // IC flag is on only first_slice_in_pic 1845 if (uiCode) 1846 { 1847 UInt uiCodeTmp = 0; 1848 if ( rpcSlice->getSPS()->getViewId() && !rpcSlice->getSPS()->isDepth() ) 1849 { 1850 READ_FLAG (uiCodeTmp, "applying IC flag"); 1851 } 1852 rpcSlice->setApplyIC(uiCodeTmp); 1853 } 1854 #endif 1855 1805 1856 if(!uiCode) 1806 1857 { … … 2601 2652 } 2602 2653 2654 #if LGE_ILLUCOMP_B0045 2655 Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2656 { 2657 assert(0); 2658 } 2659 #endif 2660 2603 2661 #if HHI_INTER_VIEW_MOTION_PRED 2604 2662 Void TDecCavlc::parseMVPIdx( Int& riMVPIdx, Int iAMVPCands ) … … 2801 2859 Void 2802 2860 TDecCavlc::parseResPredFlag( TComDataCU* pcCU, Bool& rbResPredFlag, UInt uiAbsPartIdx, UInt uiDepth ) 2861 { 2862 assert(0); 2863 } 2864 #endif 2865 2866 #if RWTH_SDC_DLT_B0036 2867 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2868 { 2869 assert(0); 2870 } 2871 Void TDecCavlc::parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2872 { 2873 assert(0); 2874 } 2875 Void TDecCavlc::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) 2803 2876 { 2804 2877 assert(0); -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r77 r189 142 142 143 143 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 144 #if LGE_ILLUCOMP_B0045 145 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 146 #endif 144 147 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 145 148 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex, UInt uiAbsPartIdx, UInt uiDepth ); … … 175 178 Void parseDFFlag ( UInt& ruiVal, const Char *pSymbolName ); 176 179 Void parseDFSvlc ( Int& riVal, const Char *pSymbolName ); 180 #if RWTH_SDC_DLT_B0036 181 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 182 Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 183 Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 184 #endif 177 185 protected: 178 186 #if DBL_CONTROL -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r100 r189 38 38 #include "TDecCu.h" 39 39 40 #if RWTH_SDC_DLT_B0036 41 #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val)) 42 #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val)) 43 #endif 44 40 45 //! \ingroup TLibDecoder 41 46 //! \{ … … 389 394 } 390 395 } 396 #if LGE_ILLUCOMP_B0045 397 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 398 #endif 391 399 #if HHI_MPI 392 400 } … … 440 448 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 441 449 450 #if LGE_ILLUCOMP_B0045 451 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 452 #endif 453 442 454 #if HHI_INTER_VIEW_RESIDUAL_PRED 443 455 if( !pcCU->isIntra( uiAbsPartIdx ) ) … … 601 613 break; 602 614 case MODE_INTRA: 615 #if RWTH_SDC_DLT_B0036 616 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 617 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 618 else 619 #endif 603 620 xReconIntraQT( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth ); 604 621 break; … … 620 637 { 621 638 #if HHI_MPI 639 #if FIX_MPI_B0065 640 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 641 { 642 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 643 if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) 644 { 645 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 646 pcCU->setPartSizeSubParts( partSize, 0, uiDepth ); 647 } 648 else 649 { 650 pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); 651 } 652 } 653 #else 622 654 if( pcCU->getTextureModeDepth( 0 ) != -1 ) 623 655 pcCU->setPartSizeSubParts( SIZE_NxN, 0, uiDepth ); 656 #endif 624 657 #endif 625 658 … … 705 738 m_pcPrediction->getPredicBufHeight (), 706 739 bAboveAvail, bLeftAvail ); 707 #if LGE_EDGE_INTRA 740 #if LGE_EDGE_INTRA_A0070 708 741 if( uiLumaPredMode >= EDGE_INTRA_IDX ) 709 742 { … … 944 977 945 978 } 979 980 #if RWTH_SDC_DLT_B0036 981 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 982 { 983 UInt uiWidth = pcCU->getWidth ( 0 ); 984 UInt uiHeight = pcCU->getHeight ( 0 ); 985 986 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 987 TComYuv* pcPredYuv = m_ppcYuvReco[uiDepth]; 988 TComYuv* pcResiYuv = m_ppcYuvResi[uiDepth]; 989 990 UInt uiStride = pcRecoYuv->getStride (); 991 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 992 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 993 Pel* piResi = pcResiYuv->getLumaAddr( uiAbsPartIdx ); 994 995 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 996 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 997 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 998 999 UInt uiLumaPredMode = pcCU->getLumaIntraDir ( uiAbsPartIdx ); 1000 1001 AOF( uiWidth == uiHeight ); 1002 AOF( uiAbsPartIdx == 0 ); 1003 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1004 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1005 1006 //===== init availability pattern ===== 1007 Bool bAboveAvail = false; 1008 Bool bLeftAvail = false; 1009 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 1010 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail ); 1011 1012 //===== get prediction signal ===== 1013 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1014 if( uiLumaPredMode >= NUM_INTRA_MODE ) 1015 { 1016 m_pcPrediction->predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, false ); 1017 } 1018 else 1019 { 1020 #endif 1021 m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 1022 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1023 } 1024 #endif 1025 1026 // number of segments depends on prediction mode 1027 UInt uiNumSegments = 1; 1028 Bool* pbMask = NULL; 1029 UInt uiMaskStride = 0; 1030 1031 if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX ) 1032 { 1033 Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx); 1034 1035 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; 1036 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1037 1038 uiNumSegments = 2; 1039 pbMask = pcWedgelet->getPattern(); 1040 uiMaskStride = pcWedgelet->getStride(); 1041 } 1042 1043 // get DC prediction for each segment 1044 Pel apDCPredValues[2]; 1045 xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride); 1046 1047 // reconstruct residual based on mask + DC residuals 1048 Pel apDCResiValues[2]; 1049 Pel apDCRecoValues[2]; 1050 for( UInt ui = 0; ui < uiNumSegments; ui++ ) 1051 { 1052 Pel pPredIdx = GetDepthValue2Idx( apDCPredValues[ui] ); 1053 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(ui, uiAbsPartIdx); 1054 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1055 1056 apDCRecoValues[ui] = pRecoValue; 1057 apDCResiValues[ui] = pRecoValue - apDCPredValues[ui]; 1058 } 1059 1060 //===== reconstruction ===== 1061 Bool*pMask = pbMask; 1062 Pel* pPred = piPred; 1063 Pel* pResi = piResi; 1064 Pel* pReco = piReco; 1065 Pel* pRecIPred = piRecIPred; 1066 1067 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1068 { 1069 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1070 { 1071 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1072 assert( ucSegment < uiNumSegments ); 1073 1074 Pel pPredVal= apDCPredValues[ucSegment]; 1075 Pel pResiDC = apDCResiValues[ucSegment]; 1076 1077 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1078 pRecIPred[ uiX ] = pReco[ uiX ]; 1079 } 1080 pPred += uiStride; 1081 pResi += uiStride; 1082 pReco += uiStride; 1083 pRecIPred += uiRecIPredStride; 1084 pMask += uiMaskStride; 1085 } 1086 1087 // clear UV 1088 UInt uiStrideC = pcPredYuv->getCStride(); 1089 Pel *pRecCb = pcPredYuv->getCbAddr(); 1090 Pel *pRecCr = pcPredYuv->getCrAddr(); 1091 1092 for (Int y=0; y<uiHeight/2; y++) 1093 { 1094 for (Int x=0; x<uiWidth/2; x++) 1095 { 1096 pRecCb[x] = (Pel)(128<<g_uiBitIncrement); 1097 pRecCr[x] = (Pel)(128<<g_uiBitIncrement); 1098 } 1099 1100 pRecCb += uiStrideC; 1101 pRecCr += uiStrideC; 1102 } 1103 } 1104 #endif 946 1105 947 1106 /** Function for deriving recontructed PU/CU Luma sample with QTree structure … … 1209 1368 #endif 1210 1369 1370 #if RWTH_SDC_DLT_B0036 1371 Void TDecCu::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride ) 1372 { 1373 Int iSumDepth[2]; 1374 memset(iSumDepth, 0, sizeof(Int)*2); 1375 Int iSumPix[2]; 1376 memset(iSumPix, 0, sizeof(Int)*2); 1377 1378 for (Int y=0; y<uiSize; y++) 1379 { 1380 for (Int x=0; x<uiSize; x++) 1381 { 1382 UChar ucSegment = pMask?(UChar)pMask[x]:0; 1383 assert( ucSegment < uiNumSegments ); 1384 1385 iSumDepth[ucSegment] += pOrig[x]; 1386 iSumPix[ucSegment] += 1; 1387 } 1388 1389 pOrig += uiStride; 1390 pMask += uiMaskStride; 1391 } 1392 1393 // compute mean for each segment 1394 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) 1395 { 1396 if( iSumPix[ucSeg] > 0 ) 1397 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 1398 else 1399 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 1400 } 1401 } 1402 #endif 1403 1211 1404 //! \} -
trunk/source/Lib/TLibDecoder/TDecCu.h
r56 r189 121 121 Void xFillPCMBuffer (TComDataCU* pCU, UInt absPartIdx, UInt depth); 122 122 #endif 123 #if RWTH_SDC_DLT_B0036 124 Void xAnalyzeSegmentsSDC ( Pel* pOrig, 125 UInt uiStride, 126 UInt uiSize, 127 Pel* rpSegMeans, 128 UInt uiNumSegments, 129 Bool* pMask, 130 UInt uiMaskStride ); 131 132 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 133 #endif 123 134 }; 124 135 -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r100 r189 67 67 } 68 68 69 #if LGE_ILLUCOMP_B0045 70 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 71 { 72 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 73 74 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth()) 75 { 76 return; 77 } 78 79 if(!pcCU->getSlice()->getApplyIC()) 80 return; 81 82 if(pcCU->isICFlagRequired(uiAbsPartIdx)) 83 m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth ); 84 } 85 #endif 69 86 /** decode merge index 70 87 * \param pcCU … … 130 147 { 131 148 m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth ); 149 150 #if RWTH_SDC_DLT_B0036 151 // if B-Slice, code SDC flag later 152 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() ) 153 { 154 // decode SDC flag 155 decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth); 156 } 157 #endif 132 158 } 133 159 134 160 Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 135 161 { 162 #if RWTH_SDC_DLT_B0036 163 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) 164 { 165 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 166 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 167 return; 168 } 169 #endif 170 136 171 m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth ); 172 173 #if RWTH_SDC_DLT_B0036 174 if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) ) 175 { 176 // decode SDC flag 177 decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth); 178 179 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 180 { 181 // part size is also known for SDC intra 182 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 183 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 184 } 185 } 186 #endif 137 187 } 138 188 139 189 Void TDecEntropy::decodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ) 140 190 { 191 #if RWTH_SDC_DLT_B0036 192 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 193 { 194 decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth); 195 return; 196 } 197 #endif 198 141 199 PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx ); 142 200 … … 179 237 return; 180 238 } 239 240 #if RWTH_SDC_DLT_B0036 241 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 242 { 243 return; 244 } 245 #endif 181 246 182 247 m_pcEntropyDecoderIf->parseIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); … … 427 492 #endif 428 493 } 494 #if SHARP_INTERVIEW_DECOUPLE_B0111 495 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx); 496 #else 429 497 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); 498 #endif 430 499 pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); 431 500 pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); … … 895 964 #endif 896 965 966 #if RWTH_SDC_DLT_B0036 967 if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) ) 968 { 969 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 970 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 971 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 972 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 973 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 974 975 decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth); 976 return; 977 } 978 #endif 979 897 980 if( pcCU->isIntra(uiAbsPartIdx) ) 898 981 { … … 930 1013 #endif // !UNIFIED_TRANSFORM_TREE 931 1014 } 1015 1016 #if FIX_MPI_B0065 1017 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ) 1018 { 1019 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 1020 if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) 1021 { 1022 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 1023 pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth ); 1024 } 1025 else 1026 { 1027 pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth ); 1028 } 1029 } 1030 #endif 1031 932 1032 #if UNIFIED_TRANSFORM_TREE 933 1033 xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); … … 935 1035 xDecodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP ); 936 1036 #endif // UNIFIED_TRANSFORM_TREE 937 } 1037 1038 #if FIX_MPI_B0065 1039 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ) 1040 { 1041 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 1042 } 1043 #endif 1044 } 1045 1046 #if RWTH_SDC_DLT_B0036 1047 Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1048 { 1049 assert( pcCU->getSlice()->getSPS()->isDepth() ); 1050 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 1051 1052 m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth ); 1053 } 1054 1055 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1056 { 1057 assert( pcCU->getSlice()->getSPS()->isDepth() ); 1058 1059 m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth ); 1060 } 1061 1062 Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1063 { 1064 assert( pcCU->getSlice()->getSPS()->isDepth() ); 1065 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 1066 1067 // number of segments depends on prediction mode for INTRA 1068 UInt uiNumSegments = 2; 1069 UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx ); 1070 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) ) 1071 uiNumSegments = 1; 1072 1073 // decode residual data for each segment 1074 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 1075 m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg); 1076 } 1077 #endif 938 1078 939 1079 //! \} -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r77 r189 103 103 public: 104 104 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 105 #if LGE_ILLUCOMP_B0045 106 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 107 #endif 105 108 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 106 109 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; … … 138 141 virtual Void readTileMarker ( UInt& uiTileIdx, UInt uiBitsUsed ) = 0; 139 142 virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0; 143 144 #if RWTH_SDC_DLT_B0036 145 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 146 virtual Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 147 virtual Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0; 148 #endif 140 149 141 150 virtual ~TDecEntropyIf() {} … … 196 205 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 197 206 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 207 #if LGE_ILLUCOMP_B0045 208 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 209 #endif 198 210 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 199 211 Void decodeMergeIndex ( TComDataCU* pcSubCU, UInt uiPartIdx, UInt uiPartAddr, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth ); … … 250 262 Void decodeFlush() { m_pcEntropyDecoderIf->decodeFlush(); } 251 263 #endif 264 265 #if RWTH_SDC_DLT_B0036 266 Void decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 267 Void decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 268 Void decodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 269 #endif 252 270 253 271 };// END CLASS DEFINITION TDecEntropy -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r100 r189 303 303 { 304 304 m_pcDepthMapGenerator->initViewComponent( rpcPic ); 305 #if !QC_MULTI_DIS_CAN 305 #if !QC_MULTI_DIS_CAN_A0097 306 306 m_pcDepthMapGenerator->predictDepthMap ( rpcPic ); 307 307 #endif … … 312 312 #endif 313 313 314 #if QC_SIMPLE_NBDV_B0047 315 if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode()) 316 { 317 Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx()); 318 rpcPic->setRapbCheck(rpcPic->getDisCandRefPictures(iColPoc)); 319 } 320 #endif 314 321 315 322 m_pcSbacDecoders[0].load(m_pcSbacDecoder); … … 341 348 #endif 342 349 #if DEPTH_MAP_GENERATION 343 #if !QC_MULTI_DIS_CAN 350 #if !QC_MULTI_DIS_CAN_A0097 344 351 // update virtual depth map 345 352 m_pcDepthMapGenerator->updateDepthMap( rpcPic ); -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r100 r189 38 38 #include "TDecSbac.h" 39 39 40 #if RWTH_SDC_DLT_B0036 41 #define GetNumDepthValues() (pcCU->getSlice()->getSPS()->getNumDepthValues()) 42 #define GetBitsPerDepthValue() (pcCU->getSlice()->getSPS()->getBitsPerDepthValue()) 43 #endif 44 40 45 //! \ingroup TLibDecoder 41 46 //! \{ … … 52 57 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 53 58 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 59 #if LGE_ILLUCOMP_B0045 60 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 #endif 54 62 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 55 63 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 98 106 , m_cDmmDataSCModel ( 1, 1, NUM_DMM_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 99 107 #endif 100 #if LGE_EDGE_INTRA 108 #if LGE_EDGE_INTRA_A0070 101 109 , m_cEdgeIntraSCModel ( 1, 1, NUM_EDGE_INTRA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 102 110 #if LGE_EDGE_INTRA_DELTA_DC 103 111 , m_cEdgeIntraDeltaDCSCModel ( 1, 1, NUM_EDGE_INTRA_DELTA_DC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 104 112 #endif 113 #endif 114 #if RWTH_SDC_DLT_B0036 115 , m_cSDCFlagSCModel ( 1, 1, SDC_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 , m_cSDCResidualFlagSCModel ( 1, 2, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 117 , m_cSDCResidualSignFlagSCModel ( 1, 2, SDC_NUM_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 118 , m_cSDCResidualSCModel ( 1, 2, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 105 120 #endif 106 121 { … … 146 161 m_cCUSplitFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 147 162 m_cCUSkipFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SKIP_FLAG ); 163 #if LGE_ILLUCOMP_B0045 164 m_cCUICFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_IC_FLAG ); 165 #endif 148 166 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 149 167 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); … … 188 206 189 207 m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 190 #if LGE_EDGE_INTRA 208 #if LGE_EDGE_INTRA_A0070 191 209 m_cEdgeIntraSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_EDGE_INTRA ); 192 210 #if LGE_EDGE_INTRA_DELTA_DC … … 199 217 m_cDmmModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_MODE ); 200 218 m_cDmmDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_DATA ); 219 #endif 220 #if RWTH_SDC_DLT_B0036 221 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 222 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 223 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 224 m_cSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_SIGN_FLAG ); 225 m_cSDCPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_PRED_MODE ); 201 226 #endif 202 227 … … 230 255 m_cCUSplitFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG ); 231 256 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 257 #if LGE_ILLUCOMP_B0045 258 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 259 #endif 232 260 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT ); 233 261 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT ); … … 276 304 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 277 305 #endif 306 #if RWTH_SDC_DLT_B0036 307 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 308 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 309 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 310 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 311 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 312 #endif 278 313 279 314 m_pcTDecBinIf->start(); … … 578 613 } 579 614 615 #if LGE_ILLUCOMP_B0045 616 /** parse illumination compensation flag 617 * \param pcCU 618 * \param uiAbsPartIdx 619 * \param uiDepth 620 * \returns Void 621 */ 622 Void TDecSbac::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 623 { 624 UInt uiSymbol = 0; 625 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ); 626 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 627 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 628 DTRACE_CABAC_T( "\tICFlag" ); 629 DTRACE_CABAC_T( "\tuiCtxIC: "); 630 DTRACE_CABAC_V( uiCtxIC ); 631 DTRACE_CABAC_T( "\tuiSymbol: "); 632 DTRACE_CABAC_V( uiSymbol ); 633 DTRACE_CABAC_T( "\n"); 634 635 pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth ); 636 } 637 #endif 638 639 580 640 /** parse merge flag 581 641 * \param pcCU … … 693 753 694 754 UInt uiSymbol; 695 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) ); 696 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 697 DTRACE_CABAC_T( "\tSplitFlag\n" ) 755 756 #if OL_QTLIMIT_PREDCODING_B0068 757 Bool bParseSplitFlag = true; 758 759 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS(); 760 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 761 Bool bDepthMapDetect = (pcTexture != NULL); 762 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE); 763 764 if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC()) 765 { 766 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); 767 assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth); 768 bParseSplitFlag = (pcTextureCU->getDepth(uiAbsPartIdx) > uiDepth); 769 } 770 771 if(bParseSplitFlag) 772 { 773 #endif 774 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSplitFlagSCModel.get( 0, 0, pcCU->getCtxSplitFlag( uiAbsPartIdx, uiDepth ) ) ); 775 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 776 DTRACE_CABAC_T( "\tSplitFlag\n" ) 777 #if OL_QTLIMIT_PREDCODING_B0068 778 } 779 else 780 uiSymbol = 0; 781 #endif 782 698 783 pcCU->setDepthSubParts( uiDepth + uiSymbol, uiAbsPartIdx ); 699 784 … … 711 796 UInt uiSymbol, uiMode = 0; 712 797 PartSize eMode; 798 799 #if OL_QTLIMIT_PREDCODING_B0068 800 Bool bParsePartSize = true; 801 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS(); 802 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 803 Bool bDepthMapDetect = (pcTexture != NULL); 804 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE); 805 806 if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC()) 807 { 808 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); 809 assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth); 810 if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN) 811 { 812 bParsePartSize = false; 813 eMode = SIZE_2Nx2N; 814 } 815 } 816 #endif 713 817 714 818 if ( pcCU->isIntra( uiAbsPartIdx ) ) 715 819 { 716 uiSymbol = 1; 717 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 718 { 719 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 720 } 721 eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN; 820 #if OL_QTLIMIT_PREDCODING_B0068 821 if(bParsePartSize) 822 { 823 #endif 824 uiSymbol = 1; 825 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 826 { 827 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 828 } 829 eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN; 830 #if OL_QTLIMIT_PREDCODING_B0068 831 } 832 #endif 722 833 UInt uiTrLevel = 0; 723 834 UInt uiWidthInBit = g_aucConvertToBit[pcCU->getWidth(uiAbsPartIdx)]+2; … … 735 846 else 736 847 { 737 UInt uiMaxNumBits = 2; 738 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getSlice()->getSPS()->getDisInter4x4() && (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) ) 739 { 740 uiMaxNumBits ++; 741 } 742 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 743 { 744 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) ); 745 if ( uiSymbol ) 746 { 747 break; 748 } 749 uiMode++; 750 } 751 eMode = (PartSize) uiMode; 752 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 753 { 754 if (eMode == SIZE_2NxN) 755 { 848 #if OL_QTLIMIT_PREDCODING_B0068 849 if(bParsePartSize) 850 { 851 #endif 852 UInt uiMaxNumBits = 2; 853 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && !( pcCU->getSlice()->getSPS()->getDisInter4x4() && (g_uiMaxCUWidth>>uiDepth) == 8 && (g_uiMaxCUHeight>>uiDepth) == 8 ) ) 854 { 855 uiMaxNumBits ++; 856 } 857 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 858 { 859 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) ); 860 if ( uiSymbol ) 861 { 862 break; 863 } 864 uiMode++; 865 } 866 eMode = (PartSize) uiMode; 867 if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) ) 868 { 869 if (eMode == SIZE_2NxN) 870 { 871 #if AMP_CTX 872 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 873 #else 874 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 )); 875 #endif 876 if (uiSymbol == 0) 877 { 878 #if AMP_CTX 879 m_pcTDecBinIf->decodeBinEP(uiSymbol); 880 #else 881 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 )); 882 #endif 883 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 884 } 885 } 886 else if (eMode == SIZE_Nx2N) 887 { 756 888 #if AMP_CTX 757 889 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 758 890 #else 759 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));760 #endif 761 if (uiSymbol == 0)762 {891 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 )); 892 #endif 893 if (uiSymbol == 0) 894 { 763 895 #if AMP_CTX 764 m_pcTDecBinIf->decodeBinEP(uiSymbol); 765 #else 766 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 )); 767 #endif 768 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 896 m_pcTDecBinIf->decodeBinEP(uiSymbol); 897 #else 898 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 )); 899 #endif 900 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 901 } 769 902 } 770 903 } 771 else if (eMode == SIZE_Nx2N) 772 { 773 #if AMP_CTX 774 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 775 #else 776 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 )); 777 #endif 778 if (uiSymbol == 0) 779 { 780 #if AMP_CTX 781 m_pcTDecBinIf->decodeBinEP(uiSymbol); 782 #else 783 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 )); 784 #endif 785 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 786 } 787 } 788 } 904 #if OL_QTLIMIT_PREDCODING_B0068 905 } 906 #endif 789 907 } 790 908 pcCU->setPartSizeSubParts( eMode, uiAbsPartIdx, uiDepth ); … … 862 980 #endif 863 981 864 #if LGE_EDGE_INTRA 982 #if LGE_EDGE_INTRA_A0070 865 983 Bool bCodeEdgeIntra = false; 866 984 if( pcCU->getSlice()->getSPS()->isDepth() ) … … 878 996 #endif 879 997 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 880 #if LGE_EDGE_INTRA 998 #if LGE_EDGE_INTRA_A0070 881 999 UInt uiCheckBit = 0; 882 1000 #endif … … 903 1021 904 1022 m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 ); 905 #if LGE_EDGE_INTRA 1023 #if LGE_EDGE_INTRA_A0070 906 1024 if (bCodeEdgeIntra) 907 1025 { … … 939 1057 } 940 1058 #endif 941 #if LGE_EDGE_INTRA 1059 #if LGE_EDGE_INTRA_A0070 942 1060 if ( intraPredMode != EDGE_INTRA_IDX) 943 1061 { … … 947 1065 intraPredMode += ( intraPredMode >= uiPreds[i] ); 948 1066 } 949 #if LGE_EDGE_INTRA 950 } 951 #endif 952 } 953 954 #if LGE_EDGE_INTRA 1067 #if LGE_EDGE_INTRA_A0070 1068 } 1069 #endif 1070 } 1071 1072 #if LGE_EDGE_INTRA_A0070 955 1073 if( intraPredMode == EDGE_INTRA_IDX ) 956 1074 { … … 2096 2214 #endif 2097 2215 2098 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA && LGE_EDGE_INTRA_DELTA_DC)2216 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA_A0070 && LGE_EDGE_INTRA_DELTA_DC) 2099 2217 Void TDecSbac::xReadExGolombLevel( UInt& ruiSymbol, ContextModel& rcSCModel ) 2100 2218 { … … 2355 2473 #endif 2356 2474 2357 #if LGE_EDGE_INTRA 2475 #if LGE_EDGE_INTRA_A0070 2358 2476 Void TDecSbac::xParseEdgeIntraInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2359 2477 { … … 2452 2570 } 2453 2571 #endif 2572 2573 #if RWTH_SDC_DLT_B0036 2574 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2575 { 2576 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2577 2578 UInt uiSymbol = 0; 2579 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2580 m_pcTDecBinIf->decodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2581 2582 if( uiSymbol == 1 ) 2583 { 2584 pcCU->setPartSizeSubParts(SIZE_2Nx2N, uiAbsPartIdx, uiDepth); 2585 2586 pcCU->setSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth); 2587 pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth); 2588 pcCU->setCbfSubParts(1, 1, 1, uiAbsPartIdx, uiDepth); 2589 } 2590 } 2591 2592 Void TDecSbac::parseSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2593 { 2594 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2595 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 2596 2597 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 2598 2599 UInt uiCtx = 0; 2600 2601 UInt uiMPModeIdx = 0; 2602 2603 for(Int i=0; i<RWTH_SDC_NUM_PRED_MODES-1; i++) 2604 { 2605 UInt uiIsMostProb = 0; 2606 m_pcTDecBinIf->decodeBin( uiIsMostProb, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) ); 2607 2608 if ( uiIsMostProb == 1 ) 2609 break; 2610 2611 // else: get next most probable pred mode 2612 uiMPModeIdx = (uiMPModeIdx+1)%RWTH_SDC_NUM_PRED_MODES; 2613 } 2614 2615 Int intraPredMode = g_auiSDCPredModes[uiMPModeIdx]; 2616 2617 #if HHI_DMM_WEDGE_INTRA 2618 if( intraPredMode == DMM_WEDGE_FULL_IDX ) { xParseWedgeFullInfo ( pcCU, uiAbsPartIdx, uiDepth ); } 2619 if( intraPredMode == DMM_WEDGE_PREDDIR_IDX ) { xParseWedgePredDirInfo ( pcCU, uiAbsPartIdx, uiDepth ); } 2620 #endif 2621 2622 pcCU->setLumaIntraDirSubParts((UChar)intraPredMode, uiAbsPartIdx, uiDepth); 2623 } 2624 2625 Void TDecSbac::parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment ) 2626 { 2627 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2628 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 2629 assert( uiSegment < 2 ); 2630 2631 UInt uiResidual = 0; 2632 UInt uiBit = 0; 2633 UInt uiAbsIdx = 0; 2634 UInt uiSign = 0; 2635 Int iIdx = 0; 2636 2637 UInt uiMaxResidualBits = GetBitsPerDepthValue(); 2638 assert( uiMaxResidualBits <= g_uiBitDepth ); 2639 2640 m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) ); 2641 2642 if (uiResidual) 2643 { 2644 // decode residual sign bit 2645 m_pcTDecBinIf->decodeBin(uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); 2646 2647 // decode residual magnitude 2648 for (Int i=0; i<uiMaxResidualBits; i++) 2649 { 2650 m_pcTDecBinIf->decodeBin(uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) ); 2651 uiAbsIdx |= uiBit << i; 2652 } 2653 2654 uiAbsIdx += 1; 2655 iIdx =(Int)(uiSign ? -1 : 1)*uiAbsIdx; 2656 } 2657 2658 pcCU->setSDCSegmentDCOffset(iIdx, uiSegment, uiAbsPartIdx); 2659 } 2660 #endif 2454 2661 2455 2662 //! \} -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r100 r189 126 126 Void parseSaoOffset (SaoLcuParam* psSaoLcuParam); 127 127 #endif 128 129 #if RWTH_SDC_DLT_B0036 130 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 131 Void parseSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 132 Void parseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 133 #endif 128 134 private: 129 135 Void xReadUnarySymbol ( UInt& ruiSymbol, ContextModel* pcSCModel, Int iOffset ); … … 146 152 #endif 147 153 148 #if LGE_EDGE_INTRA 154 #if LGE_EDGE_INTRA_A0070 149 155 Void xParseEdgeIntraInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 150 156 #endif … … 166 172 167 173 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 174 #if LGE_ILLUCOMP_B0045 175 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 176 #endif 168 177 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 169 178 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); … … 207 216 ContextModel3DBuffer m_cCUSplitFlagSCModel; 208 217 ContextModel3DBuffer m_cCUSkipFlagSCModel; 218 #if LGE_ILLUCOMP_B0045 219 ContextModel3DBuffer m_cCUICFlagSCModel; 220 #endif 209 221 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 210 222 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; … … 257 269 ContextModel3DBuffer m_cDmmDataSCModel; 258 270 #endif 259 #if LGE_EDGE_INTRA 271 #if LGE_EDGE_INTRA_A0070 260 272 ContextModel3DBuffer m_cEdgeIntraSCModel; 261 273 #if LGE_EDGE_INTRA_DELTA_DC … … 263 275 #endif 264 276 #endif 277 278 #if RWTH_SDC_DLT_B0036 279 ContextModel3DBuffer m_cSDCFlagSCModel; 280 281 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 282 ContextModel3DBuffer m_cSDCResidualSignFlagSCModel; 283 ContextModel3DBuffer m_cSDCResidualSCModel; 284 285 ContextModel3DBuffer m_cSDCPredModeSCModel; 286 #endif 265 287 }; 266 288 -
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r100 r189 645 645 #endif 646 646 647 #if OL_QTLIMIT_PREDCODING_B0068 648 if( bIsDepth ) 649 { 650 WRITE_FLAG( pcSPS->getUseQTLPC() ? 1 : 0, "use_qtlpc_flag"); 651 } 652 #endif 653 654 #if RWTH_SDC_DLT_B0036 655 if( bIsDepth ) 656 { 657 WRITE_FLAG( pcSPS->getUseDLT() ? 1 : 0, "use_dlt_flag" ); 658 if( pcSPS->getUseDLT() ) 659 { 660 // code mapping 661 xWriteUvlc ( pcSPS->getNumDepthValues() ); 662 for(UInt i=0; i<pcSPS->getNumDepthValues(); i++) 663 { 664 xWriteUvlc( pcSPS->idx2DepthValue(i) ); 665 } 666 } 667 } 668 #endif 669 647 670 if( pcSPS->getViewId() || pcSPS->isDepth() ) 648 671 { … … 749 772 Int address = (pcSlice->getPic()->getPicSym()->getCUOrderMap(lCUAddress) << reqBitsInner) + innerAddress; 750 773 WRITE_FLAG( address==0, "first_slice_in_pic_flag" ); 774 775 #if LGE_ILLUCOMP_B0045 776 // IC flag is on only first_slice_in_pic 777 if (address==0) 778 { 779 if( pcSlice->getSPS()->getViewId() && !pcSlice->getIsDepth() ) 780 { 781 WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "applying IC flag" ); 782 } 783 } 784 #endif 785 751 786 if(address>0) 752 787 { … … 1427 1462 } 1428 1463 1464 #if LGE_ILLUCOMP_B0045 1465 Void TEncCavlc::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 1466 { 1467 assert(0); 1468 } 1469 #endif 1470 1429 1471 Void TEncCavlc::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1430 1472 { … … 2047 2089 return true; 2048 2090 } 2091 2092 #if RWTH_SDC_DLT_B0036 2093 Void TEncCavlc::codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2094 { 2095 assert(0); 2096 } 2097 2098 Void TEncCavlc::codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 2099 { 2100 assert(0); 2101 } 2102 2103 Void TEncCavlc::codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2104 { 2105 assert(0); 2106 } 2107 #endif 2049 2108 //! \} -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r77 r189 164 164 165 165 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 166 #if LGE_ILLUCOMP_B0045 167 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 168 #endif 166 169 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 167 170 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 220 223 Void codeDFFlag ( UInt uiCode, const Char *pSymbolName ); 221 224 Void codeDFSvlc ( Int iCode, const Char *pSymbolName ); 225 226 #if RWTH_SDC_DLT_B0036 227 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 228 Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 229 Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 230 #endif 222 231 223 232 }; -
trunk/source/Lib/TLibEncoder/TEncCfg.h
r121 r189 167 167 #endif 168 168 Bool m_bUseSAO; 169 #if LGE_ILLUCOMP_B0045 170 Bool m_bUseIC; 171 #endif 169 172 #if SAO_UNIT_INTERLEAVING 170 173 Int m_maxNumOffsetsPerPic; … … 246 249 #if HHI_MPI 247 250 Bool m_bUseMVI; 251 #endif 252 #if RWTH_SDC_DLT_B0036 253 Bool m_bUseDLT; 254 Bool m_bUseSDC; 248 255 #endif 249 256 … … 272 279 Int m_iColumnRowInfoPresent; 273 280 Int m_iUniformSpacingIdr; 274 #if FIX_REMOVE_TILE_DEPENDENCE275 #else276 Int m_iTileBoundaryIndependenceIdr;277 #endif278 281 Int m_iNumColumnsMinus1; 279 282 UInt* m_puiColumnWidth; … … 321 324 #endif 322 325 323 #if OL_ DEPTHLIMIT_A0044324 Bool m_b DepthPartitionLimiting;326 #if OL_QTLIMIT_PREDCODING_B0068 327 Bool m_bUseQTLPC; 325 328 #endif 326 329 … … 688 691 Void setUseMVI ( Bool bVal ) {m_bUseMVI = bVal;} 689 692 #endif 693 #if RWTH_SDC_DLT_B0036 694 Void setUseDLT ( Bool b ) { m_bUseDLT = b; } 695 Void setUseSDC ( Bool b ) { m_bUseSDC = b; } 696 #endif 690 697 Void setUseSAO ( Bool bVal ) {m_bUseSAO = bVal;} 691 698 Bool getUseSAO () {return m_bUseSAO;} 699 #if LGE_ILLUCOMP_B0045 700 Void setUseIC ( Bool bVal ) {m_bUseIC = bVal;} 701 Bool getUseIC () {return m_bUseIC;} 702 #endif 692 703 #if SAO_UNIT_INTERLEAVING 693 704 Void setMaxNumOffsetsPerPic (Int iVal) { m_maxNumOffsetsPerPic = iVal; } … … 824 835 #endif 825 836 826 #if OL_DEPTHLIMIT_A0044 827 Void setUseDPL(Bool b) {m_bDepthPartitionLimiting = b; } 828 Bool getUseDPL() {return m_bDepthPartitionLimiting;} 837 #if OL_QTLIMIT_PREDCODING_B0068 838 Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b; } 839 Bool getUseQTLPC() { return m_bUseQTLPC; } 840 #endif 841 842 #if RWTH_SDC_DLT_B0036 843 Bool getUseDLT() { return m_bUseDLT; } 844 Bool getUseSDC() { return m_bUseSDC; } 829 845 #endif 830 846 -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r126 r189 451 451 TComPic* pcPic = rpcBestCU->getPic(); 452 452 453 #if OL_DEPTHLIMIT_A0044 454 TComSPS *sps = pcPic->getSlice(0)->getSPS(); 455 TComPic *pcTexture; 456 TComDataCU * pcTextureCU; 457 Bool depthMapDetect = false; 458 UInt uiPrevTexPartIndex = 0; 459 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 460 Bool bIntraSliceDetect = false; 461 #endif 462 Bool bTry2NxN = false; 463 Bool bTryNx2N = false; 464 pcTexture = rpcBestCU->getSlice()->getTexturePic(); 465 if(pcTexture != NULL) //depth map being encoded 466 { 467 depthMapDetect = true; 468 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 469 bIntraSliceDetect = (rpcBestCU->getSlice()->getSliceType()==I_SLICE); 470 #endif 471 if(uiDepth == 0) 472 { 473 pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); 474 pcTexture->setPartInfo(pcTextureCU->readPartInfo()); 475 pcTexture->setTexPartIndex(0); 476 } 477 } 478 else 479 { 480 depthMapDetect = false; 481 } 482 #endif 453 #if OL_QTLIMIT_PREDCODING_B0068 454 TComSPS *sps = pcPic->getSlice(0)->getSPS(); 455 TComPic *pcTexture = rpcBestCU->getSlice()->getTexturePic(); 456 457 Bool depthMapDetect = (pcTexture != NULL); 458 Bool bIntraSliceDetect = (rpcBestCU->getSlice()->getSliceType() == I_SLICE); 459 460 Bool bTry2NxN = true; 461 Bool bTryNx2N = true; 462 #endif 463 483 464 // get Original YUV data from picture 484 465 m_ppcOrigYuv[uiDepth]->copyFromPicYuv( pcPic->getPicYuvOrg(), rpcBestCU->getAddr(), rpcBestCU->getZorderIdxInCU() ); … … 511 492 UInt uiTPelY = rpcBestCU->getCUPelY(); 512 493 UInt uiBPelY = uiTPelY + rpcBestCU->getHeight(0) - 1; 494 495 #if LGE_ILLUCOMP_B0045 496 Bool bICEnabled = (!rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewId()); 497 498 bICEnabled = bICEnabled && rpcTempCU->getSlice()->getApplyIC(); 499 #endif 513 500 514 501 #if HHI_INTERVIEW_SKIP … … 618 605 // variables for fast encoder decision 619 606 bEarlySkip = false; 620 bTrySplit 607 bTrySplit = true; 621 608 fRD_Skip = MAX_DOUBLE; 622 609 623 610 rpcTempCU->initEstData( uiDepth, iQP ); 624 611 625 #if OL_ DEPTHLIMIT_A0044612 #if OL_QTLIMIT_PREDCODING_B0068 626 613 //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU 627 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 628 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 629 #else 630 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 631 #endif 632 { 633 assert(uiDepth == pcTexture->accessPartInfo(1)); 634 if(pcTexture->accessPartInfo(0) == 1) //NxN modes 614 if(depthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC()) 615 { 616 TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU 617 UInt uiCUIdx = rpcBestCU->getZorderIdxInCU(); 618 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); //Depth cannot be more partitionned than the texture. 619 if (pcTextureCU->getDepth(uiCUIdx) > uiDepth || pcTextureCU->getPartitionSize(uiCUIdx) == SIZE_NxN) //Texture was split. 635 620 { 636 621 bTrySplit = true; 637 bTryNx2N = true; 638 bTry2NxN = true; 639 uiPrevTexPartIndex = pcTexture->getTexPartIndex(); 640 pcTexture->incrementTexPartIndex(); 622 bTryNx2N = true; 623 bTry2NxN = true; 641 624 } 642 else if(pcTexture->accessPartInfo(0) == 0) //2Nx2N modes 643 { 644 UInt uiTexdepth; 645 UInt temp_uiTexPartIndex; 646 bTrySplit = false; 647 648 //scan ahead till next depth 649 uiTexdepth = pcTexture->accessPartInfo(1); 650 uiPrevTexPartIndex = pcTexture->getTexPartIndex(); 651 pcTexture->incrementTexPartIndex(); 652 temp_uiTexPartIndex = pcTexture->getTexPartIndex(); //store in case to rewind 653 654 while(uiTexdepth != pcTexture->accessPartInfo(1) && uiTexdepth != 0) 655 { 656 if(pcTexture->accessPartInfo(1) < uiTexdepth) 657 { 658 break; 659 } 660 pcTexture->incrementTexPartIndex(); 661 662 if(pcTexture->accessPartInfo(1) == OL_END_CU) 663 { 664 pcTexture->setTexPartIndex(temp_uiTexPartIndex); 665 uiTexdepth++; 666 if(uiTexdepth >= g_uiMaxCUDepth) 667 { 668 break; 669 } 670 } 671 } 672 } 673 else if(pcTexture->accessPartInfo(0) == OL_END_CU) 625 else 674 626 { 675 627 bTrySplit = false; 676 bTryNx2N = false;677 bTry2NxN = false;628 bTryNx2N = false; 629 bTry2NxN = false; 678 630 } 679 else if(pcTexture->accessPartInfo(0) == 2) //2NxN case 680 { 681 bTrySplit = false; 682 bTryNx2N = false; 683 bTry2NxN = true; 684 uiPrevTexPartIndex = pcTexture->getTexPartIndex(); 685 pcTexture->incrementTexPartIndex(); ; 686 } 687 else if(pcTexture->accessPartInfo(0) == 3) //Nx2N case 688 { 689 bTrySplit = false; 690 bTryNx2N = true; 691 bTry2NxN = false; 692 uiPrevTexPartIndex = pcTexture->getTexPartIndex(); 693 pcTexture->incrementTexPartIndex(); ; 694 } 695 } 696 #endif 697 631 } 632 #endif 698 633 699 634 // do inter modes, SKIP and 2Nx2N … … 718 653 { 719 654 Bool bResPredFlag = ( uiResPrdId > 0 ); 655 #if LGE_ILLUCOMP_B0045 656 for(UInt uiICId = 0; uiICId < (bICEnabled ? 2 : 1); uiICId++) 657 { 658 Bool bICFlag = (uiICId ? true : false); 659 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 660 #endif 720 661 #endif 721 662 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 740 681 } 741 682 } 742 683 #if LGE_ILLUCOMP_B0045_ENCSIMP 684 if(bICFlag && rpcBestCU->getMergeFlag(0) && !rpcBestCU->getICFlag(0)) 685 { 686 bICEnabled = false; 687 break; 688 } 689 #endif 743 690 // 2Nx2N, NxN 744 691 if ( !bEarlySkip ) … … 759 706 } 760 707 } 708 #if LGE_ILLUCOMP_B0045 709 } 710 #endif 761 711 #if HHI_INTER_VIEW_RESIDUAL_PRED 762 712 } // uiResPrdId … … 764 714 } // != I_SLICE 765 715 766 #if OL_DEPTHLIMIT_A0044767 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 768 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 769 #else 770 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 771 #endif 716 #if LGE_ILLUCOMP_B0045_ENCSIMP 717 bICEnabled = rpcBestCU->getICFlag(0); 718 #endif 719 720 #if OL_QTLIMIT_PREDCODING_B0068 721 if(depthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC()) 772 722 { 773 723 bTrySplitDQP = bTrySplit; … … 775 725 else 776 726 { 727 #endif 777 728 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() ) 778 729 { … … 786 737 bTrySplitDQP = bTrySplit; 787 738 } 788 } 789 #else 790 791 if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() ) 792 { 793 if(iQP == iBaseQP) 794 { 795 bTrySplitDQP = bTrySplit; 796 } 797 } 798 else 799 { 800 bTrySplitDQP = bTrySplit; 801 } 802 #endif 739 #if OL_QTLIMIT_PREDCODING_B0068 740 } 741 #endif 742 803 743 #if LOSSLESS_CODING 804 744 if (isAddLowestQP && (iQP == lowestQP)) … … 841 781 { 842 782 Bool bResPredFlag = ( uiResPrdId > 0 ); 783 #if LGE_ILLUCOMP_B0045 784 for(UInt uiICId = 0; uiICId < (bICEnabled ? 2 : 1); uiICId++) 785 { 786 Bool bICFlag = (uiICId ? true : false); 787 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth); 788 #endif 843 789 #endif 844 790 // 2Nx2N, NxN … … 850 796 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth && doNotBlockPu) 851 797 { 852 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 853 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 854 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 855 #else 856 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 857 #endif 798 #if OL_QTLIMIT_PREDCODING_B0068 //try InterNxN 799 if(bTrySplit) 858 800 { 859 if (bTrySplit) 860 { 861 #endif 862 #if HHI_INTER_VIEW_RESIDUAL_PRED 863 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 864 #endif 865 #if HHI_INTERVIEW_SKIP 866 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFullyRenderedSec ); 867 #else 868 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN ); 869 #endif 870 rpcTempCU->initEstData( uiDepth, iQP ); 871 #if OL_DEPTHLIMIT_A0044 872 }//bTrySplit 873 }//depthMapDetect 874 else//do things normally 875 { 801 #endif 876 802 #if HHI_INTER_VIEW_RESIDUAL_PRED 877 803 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); … … 883 809 #endif 884 810 rpcTempCU->initEstData( uiDepth, iQP ); 811 #if OL_QTLIMIT_PREDCODING_B0068 885 812 } 886 813 #endif … … 890 817 891 818 { // 2NxN, Nx2N 892 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 893 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 894 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 895 #else 896 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 897 #endif 819 #if OL_QTLIMIT_PREDCODING_B0068 //try Nx2N 820 if(bTryNx2N) 898 821 { 899 if (bTryNx2N) 900 { 901 #endif 902 if(doNotBlockPu) 903 { 904 #if HHI_INTER_VIEW_RESIDUAL_PRED 905 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 906 #endif 907 #if HHI_INTERVIEW_SKIP 908 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFullyRenderedSec ); 909 #else 910 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N ); 911 #endif 912 rpcTempCU->initEstData( uiDepth, iQP ); 913 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_Nx2N ) 914 { 915 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 916 } 917 } 918 #if OL_DEPTHLIMIT_A0044 919 }//bTryNx2N 920 }//depthMapDetect 921 else//do things normally 922 { 822 #endif 923 823 if(doNotBlockPu) 924 824 { … … 937 837 } 938 838 } 839 #if OL_QTLIMIT_PREDCODING_B0068 939 840 } 940 841 #endif 941 842 942 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 943 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 944 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 945 #else 946 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 947 #endif 843 #if OL_QTLIMIT_PREDCODING_B0068 //try 2NxN 844 if(bTry2NxN) 948 845 { 949 if (bTry2NxN) 950 { 951 #endif 952 if(doNotBlockPu) 953 { 954 #if HHI_INTER_VIEW_RESIDUAL_PRED 955 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 956 #endif 957 #if HHI_INTERVIEW_SKIP 958 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxN, bFullyRenderedSec ); 959 #else 960 xCheckRDCostInter ( rpcBestCU, rpcTempCU, SIZE_2NxN ); 961 #endif 962 rpcTempCU->initEstData( uiDepth, iQP ); 963 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxN) 964 { 965 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 966 } 967 } 968 #if OL_DEPTHLIMIT_A0044 969 }//bTryNx2N 970 }//depthMapDetect 971 else//do things normally 972 { 846 #endif 973 847 if(doNotBlockPu) 974 848 { … … 987 861 } 988 862 } 863 #if OL_QTLIMIT_PREDCODING_B0068 989 864 } 990 865 #endif … … 1009 884 if ( bTestAMP_Hor ) 1010 885 { 1011 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 1012 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1013 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 1014 #else 1015 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 1016 #endif 886 #if OL_QTLIMIT_PREDCODING_B0068 //try 2NxnU & 2NxnD 887 if(bTry2NxN) 1017 888 { 1018 if (bTry2NxN) 1019 { 1020 #endif 1021 if(doNotBlockPu) 1022 { 1023 #if HHI_INTER_VIEW_RESIDUAL_PRED 1024 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1025 #endif 1026 #if HHI_INTERVIEW_SKIP 1027 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFullyRenderedSec ); 1028 #else 1029 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU ); 1030 #endif 1031 rpcTempCU->initEstData( uiDepth, iQP ); 1032 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU ) 1033 { 1034 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 1035 } 1036 } 1037 if(doNotBlockPu) 1038 { 1039 #if HHI_INTER_VIEW_RESIDUAL_PRED 1040 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1041 #endif 1042 #if HHI_INTERVIEW_SKIP 1043 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFullyRenderedSec ); 1044 #else 1045 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD ); 1046 #endif 1047 rpcTempCU->initEstData( uiDepth, iQP ); 1048 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD ) 1049 { 1050 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 1051 } 1052 } 1053 #if OL_DEPTHLIMIT_A0044 1054 }//bTry2NxN 1055 }//depthMapDetect 1056 else//do things normally 1057 { 889 #endif 1058 890 if(doNotBlockPu) 1059 891 { … … 1088 920 } 1089 921 } 922 #if OL_QTLIMIT_PREDCODING_B0068 1090 923 } 1091 924 #endif … … 1094 927 else if ( bTestMergeAMP_Hor ) 1095 928 { 1096 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 1097 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1098 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 1099 #else 1100 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 1101 #endif 929 #if OL_QTLIMIT_PREDCODING_B0068 //try 2NxnU & 2NxnD Merge 930 if(bTry2NxN) 1102 931 { 1103 if (bTry2NxN) 1104 { 1105 #endif 1106 if(doNotBlockPu) 1107 { 1108 #if HHI_INTER_VIEW_RESIDUAL_PRED 1109 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1110 #endif 1111 #if HHI_INTERVIEW_SKIP 1112 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFullyRenderedSec, true ); 1113 #else 1114 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, true ); 1115 #endif 1116 rpcTempCU->initEstData( uiDepth, iQP ); 1117 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnU ) 1118 { 1119 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 1120 } 1121 } 1122 if(doNotBlockPu) 1123 { 1124 #if HHI_INTER_VIEW_RESIDUAL_PRED 1125 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1126 #endif 1127 #if HHI_INTERVIEW_SKIP 1128 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFullyRenderedSec, true ); 1129 #else 1130 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, true ); 1131 #endif 1132 rpcTempCU->initEstData( uiDepth, iQP ); 1133 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_2NxnD ) 1134 { 1135 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 1136 } 1137 } 1138 #if OL_DEPTHLIMIT_A0044 1139 }//bTry2NxN 1140 }//depthMapDetect 1141 else//do things normally 1142 { 932 #endif 1143 933 if(doNotBlockPu) 1144 934 { … … 1173 963 } 1174 964 } 1175 965 #if OL_QTLIMIT_PREDCODING_B0068 1176 966 } 1177 967 #endif … … 1182 972 if ( bTestAMP_Ver ) 1183 973 { 1184 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 1185 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1186 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 1187 #else 1188 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 1189 #endif 974 #if OL_QTLIMIT_PREDCODING_B0068 //try nLx2N & nRx2N 975 if(bTryNx2N) 1190 976 { 1191 if (bTryNx2N) 1192 { 1193 #endif 1194 if(doNotBlockPu) 1195 { 1196 #if HHI_INTER_VIEW_RESIDUAL_PRED 1197 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1198 #endif 1199 #if HHI_INTERVIEW_SKIP 1200 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFullyRenderedSec ); 1201 #else 1202 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N ); 1203 #endif 1204 rpcTempCU->initEstData( uiDepth, iQP ); 1205 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N ) 1206 { 1207 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 1208 } 1209 } 1210 if(doNotBlockPu) 1211 { 1212 #if HHI_INTER_VIEW_RESIDUAL_PRED 1213 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1214 #endif 1215 #if HHI_INTERVIEW_SKIP 1216 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFullyRenderedSec ); 1217 #else 1218 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N ); 1219 #endif 1220 rpcTempCU->initEstData( uiDepth, iQP ); 1221 } 1222 #if OL_DEPTHLIMIT_A0044 1223 }//bTryNx2N 1224 }//depthMapDetect 1225 else//do things normally 1226 { 977 #endif 1227 978 if(doNotBlockPu) 1228 979 { … … 1253 1004 rpcTempCU->initEstData( uiDepth, iQP ); 1254 1005 } 1006 #if OL_QTLIMIT_PREDCODING_B0068 1255 1007 } 1256 1008 #endif … … 1259 1011 else if ( bTestMergeAMP_Ver ) 1260 1012 { 1261 #if OL_DEPTHLIMIT_A0044 //add code here to select 2NxN or Nx2N or none 1262 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1263 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 1264 #else 1265 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 1266 #endif 1013 #if OL_QTLIMIT_PREDCODING_B0068 //try nLx2N & nRx2N (Merge) 1014 if(bTryNx2N) 1267 1015 { 1268 if (bTryNx2N) 1269 { 1270 #endif 1271 if(doNotBlockPu) 1272 { 1273 #if HHI_INTER_VIEW_RESIDUAL_PRED 1274 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1275 #endif 1276 #if HHI_INTERVIEW_SKIP 1277 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFullyRenderedSec, true ); 1278 #else 1279 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, true ); 1280 #endif 1281 rpcTempCU->initEstData( uiDepth, iQP ); 1282 if(m_pcEncCfg->getUseCbfFastMode() && rpcBestCU->getPartitionSize(0) == SIZE_nLx2N ) 1283 { 1284 doNotBlockPu = rpcBestCU->getQtRootCbf( 0 ) != 0; 1285 } 1286 } 1287 if(doNotBlockPu) 1288 { 1289 #if HHI_INTER_VIEW_RESIDUAL_PRED 1290 rpcTempCU->setResPredIndicator( bResPredAvailable, bResPredFlag ); 1291 #endif 1292 #if HHI_INTERVIEW_SKIP 1293 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFullyRenderedSec, true ); 1294 #else 1295 xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, true ); 1296 #endif 1297 rpcTempCU->initEstData( uiDepth, iQP ); 1298 } 1299 #if OL_DEPTHLIMIT_A0044 1300 }//bTryNx2N 1301 }//depthMapDetect 1302 else//do things normally 1303 { 1016 #endif 1304 1017 if(doNotBlockPu) 1305 1018 { … … 1330 1043 rpcTempCU->initEstData( uiDepth, iQP ); 1331 1044 } 1045 #if OL_QTLIMIT_PREDCODING_B0068 1332 1046 } 1333 1047 #endif … … 1375 1089 #endif 1376 1090 } //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N) 1091 #endif 1092 #if LGE_ILLUCOMP_B0045 1093 } 1377 1094 #endif 1378 1095 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 1401 1118 #endif 1402 1119 { 1120 #if LGE_ILLUCOMP_B0045 1121 rpcTempCU->setICFlagSubParts(false, 0, 0, uiDepth); 1122 #endif 1403 1123 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 1404 1124 rpcTempCU->initEstData( uiDepth, iQP ); 1405 1125 if( uiDepth == g_uiMaxCUDepth - g_uiAddCUDepth ) 1406 1126 { 1407 #if OL_DEPTHLIMIT_A0044 //add code here to select or deselect NxN mode for Intra 1408 #if OL_DO_NOT_LIMIT_INTRA_SLICES_PART 1409 if(depthMapDetect && !bIntraSliceDetect && sps->getUseDPL()) 1410 #else 1411 if(depthMapDetect && sps->getUseDPL()) //depth map being encoded 1412 #endif 1127 #if OL_QTLIMIT_PREDCODING_B0068 //Try IntraNxN 1128 if(bTrySplit) 1413 1129 { 1414 if (bTrySplit) 1415 { 1416 1417 #endif 1418 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 1419 { 1420 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 1421 rpcTempCU->initEstData( uiDepth, iQP ); 1422 } 1423 #if OL_DEPTHLIMIT_A0044 1424 }//bTrySplit 1425 }//depthMapDetect 1426 else 1427 { 1130 #endif 1428 1131 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) ) 1429 1132 { 1133 #if LGE_ILLUCOMP_B0045 1134 rpcTempCU->setICFlagSubParts(false, 0, 0, uiDepth); 1135 #endif 1430 1136 xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN ); 1431 1137 rpcTempCU->initEstData( uiDepth, iQP ); 1432 1138 } 1139 #if OL_QTLIMIT_PREDCODING_B0068 1433 1140 } 1434 1141 #endif … … 1451 1158 #endif 1452 1159 { 1160 #if LGE_ILLUCOMP_B0045 1161 rpcTempCU->setICFlagSubParts(false, 0, 0, uiDepth); 1162 #endif 1453 1163 xCheckIntraPCM (rpcBestCU, rpcTempCU); 1454 1164 rpcTempCU->initEstData( uiDepth, iQP ); … … 1638 1348 1639 1349 #if HHI_VSO 1640 #if HHI_VSO_SET_OPTIM1641 #else1642 if( m_pcRdCost->getUseRenModel() ) // necessary ??1643 {1644 UInt uiWidth = m_ppcRecoYuvBest[uhNextDepth]->getWidth ( );1645 UInt uiHeight = m_ppcRecoYuvBest[uhNextDepth]->getHeight ( );1646 Pel* piSrc = m_ppcRecoYuvBest[uhNextDepth]->getLumaAddr( 0 );1647 UInt uiSrcStride = m_ppcRecoYuvBest[uhNextDepth]->getStride ( );1648 m_pcRdCost->setRenModelData( pcSubBestPartCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );1649 }1650 #endif1651 1350 #endif 1652 1351 } … … 2086 1785 if( pcCU->isSkipped( uiAbsPartIdx ) ) 2087 1786 { 2088 #if OL_DEPTHLIMIT_A00442089 if(pcCU->getPartDumpFlag())2090 {2091 pcCU->updatePartInfo(0,uiDepth);2092 pcCU->incrementPartInfo();2093 }2094 #endif2095 1787 m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 ); 1788 #if LGE_ILLUCOMP_B0045 1789 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1790 #endif 2096 1791 #if HHI_INTER_VIEW_RESIDUAL_PRED 2097 1792 m_pcEntropyCoder->encodeResPredFlag( pcCU, uiAbsPartIdx, 0 ); … … 2122 1817 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 2123 1818 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1819 #if LGE_ILLUCOMP_B0045 1820 m_pcEntropyCoder->encodeICFlag ( pcCU, uiAbsPartIdx ); 1821 #endif 2124 1822 #if HHI_INTER_VIEW_RESIDUAL_PRED 2125 1823 if( !pcCU->isIntra( uiAbsPartIdx ) ) … … 2165 1863 Bool bResPrdAvail = rpcTempCU->getResPredAvail( 0 ); 2166 1864 Bool bResPrdFlag = rpcTempCU->getResPredFlag ( 0 ); 1865 #endif 1866 #if LGE_ILLUCOMP_B0045 1867 Bool bICFlag = rpcTempCU->getICFlag(0); 2167 1868 #endif 2168 1869 … … 2240 1941 rpcTempCU->setResPredFlagSubParts ( bResPrdFlag, 0, 0, uhDepth ); 2241 1942 #endif 1943 #if LGE_ILLUCOMP_B0045 1944 rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uhDepth); 1945 #endif 2242 1946 2243 1947 // do MC 2244 1948 #if HHI_INTERVIEW_SKIP 2245 if ( (uiNoResidual == 0) || bSkipRes ){ 2246 #else 2247 if ( uiNoResidual == 0 ){ 2248 #endif 1949 if ( (uiNoResidual == 0) || bSkipRes ) 1950 #else 1951 if ( uiNoResidual == 0 ) 1952 #endif 1953 { 2249 1954 m_pcPredSearch->motionCompensation ( rpcTempCU, m_ppcPredYuvTemp[uhDepth] ); 2250 1955 // save pred adress … … 2476 2181 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2477 2182 2183 #if RWTH_SDC_DLT_B0036 2184 if( !rpcTempCU->getSDCFlag( 0 ) ) 2185 #endif 2478 2186 m_pcPredSearch ->estIntraPredChromaQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC ); 2479 2187 … … 2944 2652 assert( bRecursiveCall == ( uhDepth != uhTextureModeDepth ) ); 2945 2653 2654 #if !MTK_UNCONSTRAINED_MVI_B0083 2946 2655 if( uhDepth == uhTextureModeDepth ) 2947 2656 { … … 2954 2663 } 2955 2664 } 2665 #endif 2956 2666 2957 2667 #if HHI_VSO … … 3059 2769 rpcTempCU->setTextureModeDepthSubParts( uhTextureModeDepth, 0, uhDepth ); 3060 2770 rpcTempCU->copyTextureMotionDataFrom( pcTextureCU, uhDepth, rpcTempCU->getZorderIdxInCU() ); 2771 #if FIX_MPI_B0065 2772 UInt uiAbsPartIdx = rpcTempCU->getZorderIdxInCU(); 2773 if( rpcTempCU->getDepth(0) > pcTextureCU->getDepth(uiAbsPartIdx)) 2774 { 2775 rpcTempCU->setPartSizeSubParts( SIZE_NxN, 0, uhDepth ); 2776 } 2777 else 2778 { 2779 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 2780 rpcTempCU->setPartSizeSubParts( partSize, 0, uhDepth ); 2781 } 2782 #else 3061 2783 rpcTempCU->setPartSizeSubParts( SIZE_NxN, 0, uhDepth ); 2784 #endif 3062 2785 for( UInt ui = 0; ui < rpcTempCU->getTotalNumPart(); ui++ ) 3063 2786 { … … 3152 2875 { 3153 2876 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true ); 2877 #if LGE_ILLUCOMP_B0045 2878 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 2879 #endif 3154 2880 } 3155 2881 else … … 3159 2885 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 3160 2886 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 2887 #if LGE_ILLUCOMP_B0045 2888 m_pcEntropyCoder->encodeICFlag( pcCU, 0, true ); 2889 #endif 3161 2890 } 3162 2891 xRestoreDepthWidthHeight( pcCU ); -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r77 r189 169 169 } 170 170 171 #if LGE_ILLUCOMP_B0045 172 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 173 { 174 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth()) 175 { 176 return; 177 } 178 179 if(!pcCU->getSlice()->getApplyIC()) 180 return; 181 182 if( bRD ) 183 { 184 uiAbsPartIdx = 0; 185 } 186 187 if(pcCU->isICFlagRequired(uiAbsPartIdx)) 188 m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx ); 189 } 190 #endif 191 171 192 Void TEncEntropy::codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate) 172 193 { … … 884 905 #endif 885 906 907 #if !RWTH_SDC_DLT_B0036 886 908 if ( pcCU->getSlice()->isIntra() ) 887 909 { 888 910 return; 889 911 } 912 #endif 890 913 891 914 m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx ); 915 916 #if RWTH_SDC_DLT_B0036 917 // if B-Slice, code SDC flag later 918 if( !pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) ) 919 { 920 // encode SDC flag 921 encodeSDCFlag(pcCU, uiAbsPartIdx, bRD); 922 } 923 #endif 892 924 } 893 925 … … 934 966 } 935 967 #endif 968 #if RWTH_SDC_DLT_B0036 969 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) 970 { 971 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 972 return; 973 } 974 #endif 975 936 976 m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth ); 977 978 #if RWTH_SDC_DLT_B0036 979 // code SDC flag now! 980 if( pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() ) 981 { 982 // encode SDC flag 983 encodeSDCFlag(pcCU, uiAbsPartIdx, bRD); 984 985 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 986 { 987 // part size is also known for SDC intra 988 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 989 } 990 } 991 #endif 937 992 } 938 993 … … 951 1006 return; 952 1007 } 1008 1009 #if RWTH_SDC_DLT_B0036 1010 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 1011 { 1012 return; 1013 } 1014 #endif 953 1015 954 1016 if( bRD ) … … 1286 1348 } 1287 1349 1350 #if RWTH_SDC_DLT_B0036 1351 if( pcCU->getSDCFlag(uiAbsPartIdx) ) 1352 { 1353 encodeSDCPredMode(pcCU, uiAbsPartIdx, bRD); 1354 return; 1355 } 1356 #endif 1357 1288 1358 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 1289 1359 … … 1616 1686 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx(uiAbsPartIdx), uiLumaTrMode, uiChromaTrMode ); 1617 1687 1688 #if RWTH_SDC_DLT_B0036 1689 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 1690 { 1691 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 1692 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 1693 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 1694 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 1695 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 1696 1697 encodeSDCResidualData(pcCU, uiAbsPartIdx); 1698 return; 1699 } 1700 #endif 1701 1618 1702 if( pcCU->isIntra(uiAbsPartIdx) ) 1619 1703 { … … 1656 1740 } 1657 1741 1742 #if FIX_MPI_B0065 1743 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ) 1744 { 1745 TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() ); 1746 if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx)) 1747 { 1748 PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx); 1749 pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth ); 1750 } 1751 else 1752 { 1753 pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth ); 1754 } 1755 } 1756 #endif 1757 1658 1758 #if UNIFIED_TRANSFORM_TREE 1659 1759 UInt temp = 0; … … 1664 1764 xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP ); 1665 1765 #endif // UNIFIED_TRANSFORM_TREE 1766 1767 #if FIX_MPI_B0065 1768 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N && pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 ) 1769 { 1770 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 1771 } 1772 #endif 1666 1773 } 1667 1774 … … 1988 2095 } 1989 2096 2097 #if RWTH_SDC_DLT_B0036 2098 Void TEncEntropy::encodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 2099 { 2100 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2101 2102 if( bRD ) 2103 uiAbsPartIdx = 0; 2104 2105 m_pcEntropyCoderIf->codeSDCPredMode(pcCU, uiAbsPartIdx); 2106 } 2107 2108 Void TEncEntropy::encodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 2109 { 2110 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2111 2112 if( bRD ) 2113 uiAbsPartIdx = 0; 2114 2115 m_pcEntropyCoderIf->codeSDCFlag(pcCU, uiAbsPartIdx); 2116 } 2117 2118 Void TEncEntropy::encodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 2119 { 2120 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2121 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 ); 2122 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 ); 2123 assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 ); 2124 assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 ); 2125 2126 if( bRD ) 2127 uiAbsPartIdx = 0; 2128 2129 // number of segments depends on prediction mode for INTRA 2130 UInt uiNumSegments = 2; 2131 UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx ); 2132 if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX ) 2133 uiNumSegments = 1; 2134 2135 // encode residual data for each segment 2136 for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ ) 2137 m_pcEntropyCoderIf->codeSDCResidualData(pcCU, uiAbsPartIdx, uiSeg); 2138 } 2139 #endif 2140 1990 2141 //! \} -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r100 r189 115 115 116 116 virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 117 #if LGE_ILLUCOMP_B0045 118 virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 119 #endif 117 120 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 118 121 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 124 127 virtual Void codePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 125 128 virtual Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 129 130 #if RWTH_SDC_DLT_B0036 131 virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 132 virtual Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; 133 virtual Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 134 #endif 126 135 127 136 #if BURST_IPCM … … 250 259 251 260 Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); 261 #if LGE_ILLUCOMP_B0045 262 Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 263 #endif 252 264 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 253 265 Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); … … 296 308 Void encodeScalingList ( TComScalingList* scalingList ); 297 309 Void encodeDFParams (TComAPS* pcAPS); 310 311 #if RWTH_SDC_DLT_B0036 312 Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 313 Void encodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 314 Void encodeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 315 #endif 298 316 299 317 private: -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r120 r189 449 449 #endif 450 450 451 #if HHI_VSO_SPEEDUP_A0033452 #else453 if ( iVSOMode == 4 )454 {455 m_pcEncTop->getEncTop()->setupRenModel( pcSlice->getPOC(), pcSlice->getViewId(), m_pcEncTop->isDepthCoder() ? 1 : 0 );456 }457 else458 {459 AOT(true);460 }461 #endif462 451 463 452 #if SAIT_VSO_EST_A0033 … … 708 697 // init view component and predict virtual depth map 709 698 m_pcDepthMapGenerator->initViewComponent( pcPic ); 710 #if !QC_MULTI_DIS_CAN 699 #if !QC_MULTI_DIS_CAN_A0097 711 700 m_pcDepthMapGenerator->predictDepthMap ( pcPic ); 712 701 #endif … … 719 708 #endif 720 709 710 #if QC_SIMPLE_NBDV_B0047 711 if(pcSlice->getViewId() && pcSlice->getSPS()->getMultiviewMvPredMode()) 712 { 713 Int iColPoc = pcSlice->getRefPOC(RefPicList(pcSlice->getColDir()), pcSlice->getColRefIdx()); 714 pcPic->setRapbCheck(pcPic->getDisCandRefPictures(iColPoc)); 715 } 716 #endif 721 717 while(uiNextCUAddr<uiRealEndAddress) // determine slice boundaries 722 718 { … … 777 773 #endif 778 774 #if DEPTH_MAP_GENERATION 779 #if !QC_MULTI_DIS_CAN 775 #if !QC_MULTI_DIS_CAN_A0097 780 776 // update virtual depth map 781 777 m_pcDepthMapGenerator->updateDepthMap( pcPic ); … … 1137 1133 if (!bEntropySlice) 1138 1134 { 1139 #if OL_DEPTHLIMIT_A0044 //start dumping partition information1140 m_pcSliceEncoder->setPartDumpFlag(1);1141 #endif1142 1135 pcSlice->setTileLocationCount ( 0 ); 1143 1136 m_pcSliceEncoder->encodeSlice(pcPic, pcBitstreamRedirect, pcSubstreamsOut); // redirect is only used for CAVLC tile position info. 1144 #if OL_DEPTHLIMIT_A0044 //stop dumping partition information1145 m_pcSliceEncoder->setPartDumpFlag(0);1146 #endif1147 1137 } 1148 1138 else 1149 1139 { 1150 #if OL_DEPTHLIMIT_A0044 //start dumping partition information1151 m_pcSliceEncoder->setPartDumpFlag(1);1152 #endif1153 1140 m_pcSliceEncoder->encodeSlice(pcPic, &nalu.m_Bitstream, pcSubstreamsOut); // nalu.m_Bitstream is only used for CAVLC tile position info. 1154 #if OL_DEPTHLIMIT_A0044 //stop dumping partition information1155 m_pcSliceEncoder->setPartDumpFlag(0);1156 #endif1157 1141 } 1158 1142 -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r101 r189 137 137 138 138 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 139 #if HHI_VSO_SPEEDUP_A0033140 139 TEncTop* getEncTop() { return m_pcEncTop; } 141 #endif142 140 143 141 TEncSlice* getSliceEncoder() { return m_pcSliceEncoder; } -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r116 r189 42 42 #include <algorithm> 43 43 44 #if RWTH_SDC_DLT_B0036 45 #define GetNumDepthValues() (pcCU->getSlice()->getSPS()->getNumDepthValues()) 46 #define GetBitsPerDepthValue() (pcCU->getSlice()->getSPS()->getBitsPerDepthValue()) 47 #endif 48 44 49 //! \ingroup TLibEncoder 45 50 //! \{ … … 60 65 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 61 66 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 67 #if LGE_ILLUCOMP_B0045 68 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 69 #endif 62 70 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 71 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 106 114 , m_cDmmDataSCModel ( 1, 1, NUM_DMM_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 107 115 #endif 108 #if LGE_EDGE_INTRA 116 #if LGE_EDGE_INTRA_A0070 109 117 , m_cEdgeIntraSCModel ( 1, 1, NUM_EDGE_INTRA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 110 118 #if LGE_EDGE_INTRA_DELTA_DC … … 112 120 #endif 113 121 #endif 122 #if RWTH_SDC_DLT_B0036 123 , m_cSDCFlagSCModel ( 1, 1, SDC_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 124 , m_cSDCResidualFlagSCModel ( 1, 2, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 125 , m_cSDCResidualSignFlagSCModel ( 1, 2, SDC_NUM_SIGN_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 126 , m_cSDCResidualSCModel ( 1, 2, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 127 , m_cSDCPredModeSCModel ( 1, 3, SDC_NUM_PRED_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 128 #endif 114 129 { 115 130 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 141 156 142 157 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 158 #if LGE_ILLUCOMP_B0045 159 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 160 #endif 143 161 m_cCUAlfCtrlFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG ); 144 162 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); … … 187 205 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 188 206 #endif 189 #if LGE_EDGE_INTRA 207 #if LGE_EDGE_INTRA_A0070 190 208 m_cEdgeIntraSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_EDGE_INTRA ); 191 209 #if LGE_EDGE_INTRA_DELTA_DC 192 210 m_cEdgeIntraDeltaDCSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_EDGE_INTRA_DELTA_DC ); 193 211 #endif 212 #endif 213 #if RWTH_SDC_DLT_B0036 214 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 215 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 216 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 217 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 218 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 194 219 #endif 195 220 … … 224 249 curCost = m_cCUSplitFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 225 250 curCost += m_cCUSkipFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG ); 251 #if LGE_ILLUCOMP_B0045 252 curCost += m_cCUICFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_IC_FLAG ); 253 #endif 226 254 curCost += m_cCUAlfCtrlFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG ); 227 255 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); … … 279 307 } 280 308 281 #if CABAC_INIT_FLAG && POZNAN_CABAC_INIT_FLAG_FIX309 #if CABAC_INIT_FLAG && FIX_POZNAN_CABAC_INIT_FLAG 282 310 m_pcSlice->getPPS()->setEncPrevPOC( m_pcSlice->getPOC() ); 283 311 #endif … … 295 323 296 324 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 325 #if LGE_ILLUCOMP_B0045 326 m_cCUICFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_IC_FLAG ); 327 #endif 297 328 m_cCUAlfCtrlFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG ); 298 329 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); … … 341 372 m_cDmmDataSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_DMM_DATA ); 342 373 #endif 374 #if RWTH_SDC_DLT_B0036 375 m_cSDCFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG ); 376 m_cSDCResidualFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 377 m_cSDCResidualSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL ); 378 m_cSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_SIGN_FLAG ); 379 m_cSDCPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SDC_PRED_MODE ); 380 #endif 343 381 344 382 m_pcBinIf->start(); … … 580 618 { 581 619 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 582 #if OL_DEPTHLIMIT_A0044 583 UInt uiSymbol; 584 #endif 620 621 #if OL_QTLIMIT_PREDCODING_B0068 622 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS(); 623 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 624 Bool bDepthMapDetect = (pcTexture != NULL); 625 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE); 626 627 if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag()) 628 { 629 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); 630 UInt uiCUIdx = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU(); 631 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); 632 if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) != SIZE_NxN) 633 { 634 assert( eSize == SIZE_2Nx2N ); 635 return; 636 } 637 } 638 #endif 639 585 640 if ( pcCU->isIntra( uiAbsPartIdx ) ) 586 641 { … … 588 643 { 589 644 m_pcBinIf->encodeBin( eSize == SIZE_2Nx2N? 1 : 0, m_cCUPartSizeSCModel.get( 0, 0, 0 ) ); 590 #if OL_DEPTHLIMIT_A0044 591 if(pcCU->getPartDumpFlag()) 592 { 593 uiSymbol = (UInt)(eSize == SIZE_2Nx2N? 1 : 0); 594 pcCU->updatePartInfo(uiSymbol?0:1,uiDepth); //0 for 2Nx2N and 1 for NxN 595 pcCU->incrementPartInfo(); 596 } 597 #endif 598 } 599 #if OL_DEPTHLIMIT_A0044 600 if(pcCU->getPartDumpFlag() && uiDepth < g_uiMaxCUDepth - g_uiAddCUDepth && !pcCU->getSlice()->isIntra()) 601 { 602 pcCU->updatePartInfo(0,uiDepth); //0 for 2Nx2N and 1 for NxN 603 pcCU->incrementPartInfo(); 604 } 605 #endif 645 } 606 646 return; 607 647 } … … 612 652 { 613 653 m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 0) ); 614 #if OL_DEPTHLIMIT_A0044615 if(pcCU->getPartDumpFlag())616 {617 pcCU->updatePartInfo(0,uiDepth); //0 for 2Nx2N618 pcCU->incrementPartInfo();619 }620 #endif621 654 break; 622 655 } … … 648 681 } 649 682 } 650 #if OL_DEPTHLIMIT_A0044651 if(pcCU->getPartDumpFlag())652 {653 pcCU->updatePartInfo(2,uiDepth); //2 for 2NxN654 pcCU->incrementPartInfo();655 }656 #endif657 683 break; 658 684 } … … 688 714 } 689 715 } 690 #if OL_DEPTHLIMIT_A0044691 if(pcCU->getPartDumpFlag())692 {693 pcCU->updatePartInfo(3,uiDepth); //3 for Nx2N694 pcCU->incrementPartInfo();695 }696 #endif697 716 break; 698 717 } … … 704 723 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 1) ); 705 724 m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 2) ); 706 #if OL_DEPTHLIMIT_A0044707 if(pcCU->getPartDumpFlag())708 {709 pcCU->updatePartInfo(1,uiDepth); //2Nx2N here since we disable NxN in Inter710 pcCU->incrementPartInfo();711 }712 #endif713 }714 else715 {716 #if OL_DEPTHLIMIT_A0044717 if(pcCU->getPartDumpFlag())718 {719 pcCU->updatePartInfo(0,uiDepth); //2Nx2N here since we disable NxN in Inter720 pcCU->incrementPartInfo();721 }722 #endif723 725 } 724 726 break; … … 738 740 Void TEncSbac::codePredMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 739 741 { 742 #if RWTH_SDC_DLT_B0036 743 if ( pcCU->getSlice()->isIntra() ) 744 { 745 assert( pcCU->isIntra(uiAbsPartIdx) ); 746 return; 747 } 748 #endif 749 740 750 // get context function is here 741 751 Int iPredMode = pcCU->getPredictionMode( uiAbsPartIdx ); … … 786 796 } 787 797 798 #if LGE_ILLUCOMP_B0045 799 /** code Illumination Compensation flag 800 * \param pcCU 801 * \param uiAbsPartIdx 802 * \returns Void 803 */ 804 Void TEncSbac::codeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 805 { 806 // get context function is here 807 UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0; 808 UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx ) ; 809 m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) ); 810 DTRACE_CABAC_VL( g_nSymbolCounter++ ); 811 DTRACE_CABAC_T( "\tICFlag" ); 812 DTRACE_CABAC_T( "\tuiCtxIC: "); 813 DTRACE_CABAC_V( uiCtxIC ); 814 DTRACE_CABAC_T( "\tuiSymbol: "); 815 DTRACE_CABAC_V( uiSymbol ); 816 DTRACE_CABAC_T( "\n"); 817 } 818 #endif 819 788 820 /** code merge flag 789 821 * \param pcCU … … 883 915 884 916 assert( uiCtx < 3 ); 917 918 #if OL_QTLIMIT_PREDCODING_B0068 919 Bool bCodeSplitFlag = true; 920 921 TComSPS *sps = pcCU->getPic()->getSlice(0)->getSPS(); 922 TComPic *pcTexture = pcCU->getSlice()->getTexturePic(); 923 Bool bDepthMapDetect = (pcTexture != NULL); 924 Bool bIntraSliceDetect = (pcCU->getSlice()->getSliceType() == I_SLICE); 925 926 if(bDepthMapDetect && !bIntraSliceDetect && sps->getUseQTLPC() && pcCU->getPic()->getReduceBitsFlag()) 927 { 928 TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr()); 929 UInt uiCUIdx = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU(); 930 assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth); 931 bCodeSplitFlag = (pcTextureCU->getDepth(uiCUIdx) > uiDepth); 932 } 933 934 if(!bCodeSplitFlag) 935 { 936 assert(uiCurrSplitFlag == 0); 937 return; 938 } 939 #endif 940 885 941 m_pcBinIf->encodeBin( uiCurrSplitFlag, m_cCUSplitFlagSCModel.get( 0, 0, uiCtx ) ); 886 #if OL_DEPTHLIMIT_A0044887 if(pcCU->getPartDumpFlag())888 {889 if(pcCU->getSlice()->isIntra() || (!pcCU->getSlice()->isIntra() && uiCurrSplitFlag!=0))890 {891 pcCU->updatePartInfo(uiCurrSplitFlag,uiDepth);892 pcCU->incrementPartInfo();893 }894 }895 #endif896 942 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 897 943 DTRACE_CABAC_T( "\tSplitFlag\n" ) … … 911 957 } 912 958 913 #if LGE_EDGE_INTRA 959 #if LGE_EDGE_INTRA_A0070 914 960 Void TEncSbac::xCodeEdgeIntraInfo( TComDataCU* pcCU, UInt uiPartIdx ) 915 961 { … … 992 1038 if( pcCU->getSlice()->getSPS()->getUseDMM() && pcCU->getWidth( uiAbsPartIdx ) <= DMM_WEDGEMODEL_MAX_SIZE ) 993 1039 { 994 #if LGE_EDGE_INTRA 1040 #if LGE_EDGE_INTRA_A0070 995 1041 m_pcBinIf->encodeBin( uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX, m_cDmmFlagSCModel.get(0, 0, 0) ); 996 1042 #else … … 998 1044 #endif 999 1045 } 1000 #if LGE_EDGE_INTRA 1046 #if LGE_EDGE_INTRA_A0070 1001 1047 if( uiDir >= NUM_INTRA_MODE && uiDir < EDGE_INTRA_IDX ) 1002 1048 #else … … 1035 1081 } 1036 1082 else 1037 #if LGE_EDGE_INTRA 1083 #if LGE_EDGE_INTRA_A0070 1038 1084 if ( uiDir >= EDGE_INTRA_IDX) 1039 1085 { … … 1070 1116 Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx); 1071 1117 #endif 1072 #if LGE_EDGE_INTRA 1118 #if LGE_EDGE_INTRA_A0070 1073 1119 Bool bCodeEdgeIntra = false; 1074 1120 if( pcCU->getSlice()->getSPS()->isDepth() ) … … 1136 1182 #if LOGI_INTRA_NAME_3MPM 1137 1183 m_pcBinIf->encodeBinsEP( uiDir, 5 ); 1138 #if LGE_EDGE_INTRA 1184 #if LGE_EDGE_INTRA_A0070 1139 1185 if (bCodeEdgeIntra) 1140 1186 if (uiDir == 31) m_pcBinIf->encodeBinsEP(0,1); … … 2478 2524 } 2479 2525 2480 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA && LGE_EDGE_INTRA_DELTA_DC)2526 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA_A0070 && LGE_EDGE_INTRA_DELTA_DC) 2481 2527 Void TEncSbac::xWriteExGolombLevel( UInt uiSymbol, ContextModel& rcSCModel ) 2482 2528 { … … 2644 2690 } 2645 2691 #endif 2692 2693 #if RWTH_SDC_DLT_B0036 2694 Void TEncSbac::codeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2695 { 2696 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2697 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 2698 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 2699 2700 UInt uiPredMode = pcCU->getLumaIntraDir(uiAbsPartIdx); 2701 UInt uiCtx = 0; 2702 2703 UInt uiMPModeIdx = 0; 2704 2705 for(Int i=0; i<RWTH_SDC_NUM_PRED_MODES-1; i++) 2706 { 2707 UInt uiBit = (uiPredMode == g_auiSDCPredModes[uiMPModeIdx]) ? 1 : 0; 2708 m_pcBinIf->encodeBin( uiBit, m_cSDCPredModeSCModel.get( 0, i, uiCtx ) ); 2709 2710 // if mode is most probable mode, we are done here 2711 if ( uiBit == 1 ) 2712 break; 2713 2714 // else: get next most probable pred mode 2715 uiMPModeIdx = (uiMPModeIdx+1)%RWTH_SDC_NUM_PRED_MODES; 2716 } 2717 2718 #if HHI_DMM_WEDGE_INTRA 2719 if( uiPredMode == DMM_WEDGE_FULL_IDX ) { xCodeWedgeFullInfo ( pcCU, uiAbsPartIdx ); } 2720 if( uiPredMode == DMM_WEDGE_PREDDIR_IDX ) { xCodeWedgePredDirInfo ( pcCU, uiAbsPartIdx ); } 2721 #endif 2722 2723 AOF(uiPredMode == g_auiSDCPredModes[uiMPModeIdx]); 2724 } 2725 2726 Void TEncSbac::codeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2727 { 2728 // get context function is here 2729 UInt uiSymbol = pcCU->getSDCFlag( uiAbsPartIdx ) ? 1 : 0; 2730 UInt uiCtxSDCFlag = pcCU->getCtxSDCFlag( uiAbsPartIdx ); 2731 m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) ); 2732 2733 } 2734 2735 Void TEncSbac::codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) 2736 { 2737 assert( pcCU->getSlice()->getSPS()->isDepth() ); 2738 assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N ); 2739 assert( pcCU->getSDCFlag(uiAbsPartIdx) ); 2740 assert( uiSegment < 2 ); 2741 2742 Pel segmentDCOffset = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 2743 2744 UInt uiResidual = segmentDCOffset == 0 ? 0 : 1; 2745 UInt uiSign = segmentDCOffset < 0 ? 1 : 0; 2746 UInt uiAbsIdx = abs(segmentDCOffset); 2747 UInt uiBit = 0; 2748 2749 UInt uiMaxResidualBits = GetBitsPerDepthValue(); 2750 assert( uiMaxResidualBits <= g_uiBitDepth ); 2751 2752 // residual flag 2753 m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection 2754 2755 if (uiResidual) 2756 { 2757 // encode sign bit of residual 2758 m_pcBinIf->encodeBin( uiSign, m_cSDCResidualSignFlagSCModel.get( 0, uiSegment, 0 ) ); //TODO depthmap: more sophisticated context selection 2759 2760 assert(uiAbsIdx < GetNumDepthValues()); 2761 2762 // encode residual magnitude 2763 uiAbsIdx -= 1; 2764 for (Int i=0; i<uiMaxResidualBits; i++) 2765 { 2766 uiBit = (uiAbsIdx & (1<<i))>>i; 2767 2768 m_pcBinIf->encodeBin( uiBit, m_cSDCResidualSCModel.get( 0, uiSegment, i ) ); //TODO depthmap: more sophisticated context selection 2769 } 2770 2771 } 2772 } 2773 #endif 2646 2774 //! \} -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r100 r189 145 145 #endif 146 146 Void codeScalingList ( TComScalingList* scalingList ){ assert (0); return;}; 147 148 #if RWTH_SDC_DLT_B0036 149 Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 150 Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ); 151 Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 152 #endif 147 153 148 154 private: … … 175 181 Void xCodeContourPredTexDeltaInfo( TComDataCU* pcCU, UInt uiAbsPartIdx ); 176 182 #endif 177 #if LGE_EDGE_INTRA 183 #if LGE_EDGE_INTRA_A0070 178 184 Void xCodeEdgeIntraInfo( TComDataCU* pcCU, UInt uiPartIdx ); 179 185 #endif … … 202 208 Void codeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 203 209 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 210 #if LGE_ILLUCOMP_B0045 211 Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 212 #endif 204 213 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 205 214 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 260 269 ContextModel3DBuffer m_cCUSplitFlagSCModel; 261 270 ContextModel3DBuffer m_cCUSkipFlagSCModel; 271 #if LGE_ILLUCOMP_B0045 272 ContextModel3DBuffer m_cCUICFlagSCModel; 273 #endif 262 274 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 263 275 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; … … 310 322 ContextModel3DBuffer m_cDmmDataSCModel; 311 323 #endif 312 #if LGE_EDGE_INTRA 324 #if LGE_EDGE_INTRA_A0070 313 325 ContextModel3DBuffer m_cEdgeIntraSCModel; 314 326 #if LGE_EDGE_INTRA_DELTA_DC … … 316 328 #endif 317 329 #endif 330 331 #if RWTH_SDC_DLT_B0036 332 ContextModel3DBuffer m_cSDCFlagSCModel; 333 334 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 335 ContextModel3DBuffer m_cSDCResidualSignFlagSCModel; 336 ContextModel3DBuffer m_cSDCResidualSCModel; 337 338 ContextModel3DBuffer m_cSDCPredModeSCModel; 339 #endif 318 340 }; 319 341 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r125 r189 42 42 #include <math.h> 43 43 44 #if RWTH_SDC_DLT_B0036 45 #define GetDepthValue2Idx(val) (pcCU->getSlice()->getSPS()->depthValue2idx(val)) 46 #define GetIdx2DepthValue(val) (pcCU->getSlice()->getSPS()->idx2DepthValue(val)) 47 #endif 48 44 49 //! \ingroup TLibEncoder 45 50 //! \{ … … 195 200 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + 1; 196 201 for( Int iNum = 0; iNum < iNumAMVPCands+1; iNum++) 197 {198 202 for( Int iIdx = 0; iIdx < iNumAMVPCands; iIdx++) 199 203 #else 200 204 for( Int iNum = 0; iNum < AMVP_MAX_NUM_CANDS+1; iNum++) 201 {202 205 for( Int iIdx = 0; iIdx < AMVP_MAX_NUM_CANDS; iIdx++) 203 206 #endif … … 208 211 m_auiMVPIdxCost[iIdx][iNum] = MAX_INT; 209 212 } 210 }211 213 212 214 initTempBuff(); … … 300 302 301 303 // distortion 304 #if LGE_ILLUCOMP_B0045 305 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 306 #endif 302 307 uiSad = m_cDistParam.DistFunc( &m_cDistParam ); 303 308 … … 717 722 718 723 m_cDistParam.pCur = piRefPos; 724 #if LGE_ILLUCOMP_B0045 725 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 726 #endif 719 727 uiDist = m_cDistParam.DistFunc( &m_cDistParam ); 720 728 uiDist += m_pcRdCost->getCost( cMvTest.getHor(), cMvTest.getVer() ); … … 957 965 TComYuv* pcResiYuv, 958 966 Dist& ruiDist 959 #if LG_ZEROINTRADEPTHRESI_ M26039967 #if LG_ZEROINTRADEPTHRESI_A0087 960 968 ,Bool bZeroResi 961 969 #endif … … 992 1000 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 993 1001 994 #if LGE_EDGE_INTRA 1002 #if LGE_EDGE_INTRA_A0070 995 1003 if( uiLumaPredMode >= EDGE_INTRA_IDX ) 996 1004 { … … 1040 1048 } 1041 1049 } 1042 #if LG_ZEROINTRADEPTHRESI_ M260391050 #if LG_ZEROINTRADEPTHRESI_A0087 1043 1051 if(bZeroResi) 1044 1052 { … … 1357 1365 #endif 1358 1366 Double& dRDCost 1359 #if LG_ZEROINTRADEPTHRESI_ M260391367 #if LG_ZEROINTRADEPTHRESI_A0087 1360 1368 ,Bool bZeroResi 1361 1369 #endif … … 1379 1387 } 1380 1388 #endif 1381 #if LGE_EDGE_INTRA 1389 #if LGE_EDGE_INTRA_A0070 1382 1390 if( pcCU->getLumaIntraDir( uiAbsPartIdx ) >= EDGE_INTRA_IDX ) 1383 1391 { … … 1401 1409 //----- code luma block with given intra prediction mode and store Cbf----- 1402 1410 dSingleCost = 0.0; 1403 #if LG_ZEROINTRADEPTHRESI_ M260391411 #if LG_ZEROINTRADEPTHRESI_A0087 1404 1412 xIntraCodingLumaBlk( pcCU, uiTrDepth, uiAbsPartIdx, pcOrgYuv, pcPredYuv, pcResiYuv, uiSingleDistY, bZeroResi ); 1405 1413 #else … … 1593 1601 } 1594 1602 1603 #if RWTH_SDC_DLT_B0036 1604 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ) 1605 { 1606 UInt uiLumaPredMode = pcCU ->getLumaIntraDir( uiAbsPartIdx ); 1607 UInt uiWidth = pcCU ->getWidth ( 0 ); 1608 UInt uiHeight = pcCU ->getHeight ( 0 ); 1609 UInt uiStride = pcOrgYuv ->getStride (); 1610 Pel* piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 1611 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1612 Pel* piReco = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1613 1614 UInt uiZOrder = pcCU->getZorderIdxInCU() + uiAbsPartIdx; 1615 Pel* piRecIPred = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder ); 1616 UInt uiRecIPredStride = pcCU->getPic()->getPicYuvRec()->getStride (); 1617 1618 AOF( uiWidth == uiHeight ); 1619 AOF( uiAbsPartIdx == 0 ); 1620 AOF( pcCU->getSDCAvailable(uiAbsPartIdx) ); 1621 AOF( pcCU->getSDCFlag(uiAbsPartIdx) ); 1622 1623 //===== init availability pattern ===== 1624 Bool bAboveAvail = false; 1625 Bool bLeftAvail = false; 1626 pcCU->getPattern()->initPattern ( pcCU, 0, uiAbsPartIdx ); 1627 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1628 1629 //===== get prediction signal ===== 1630 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1631 if( uiLumaPredMode >= NUM_INTRA_MODE ) 1632 { 1633 predIntraLumaDMM( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail, true ); 1634 } 1635 else 1636 { 1637 #endif 1638 predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, pcCU, bAboveAvail, bLeftAvail ); 1639 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 1640 } 1641 #endif 1642 1643 // number of segments depends on prediction mode 1644 UInt uiNumSegments = 1; 1645 Bool* pbMask = NULL; 1646 UInt uiMaskStride = 0; 1647 1648 if( uiLumaPredMode == DMM_WEDGE_FULL_IDX || uiLumaPredMode == DMM_WEDGE_PREDDIR_IDX ) 1649 { 1650 Int uiTabIdx = (uiLumaPredMode == DMM_WEDGE_FULL_IDX)?pcCU->getWedgeFullTabIdx(uiAbsPartIdx):pcCU->getWedgePredDirTabIdx(uiAbsPartIdx); 1651 1652 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; 1653 TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx )); 1654 1655 uiNumSegments = 2; 1656 pbMask = pcWedgelet->getPattern(); 1657 uiMaskStride = pcWedgelet->getStride(); 1658 } 1659 1660 // get DC prediction for each segment 1661 Pel apDCPredValues[2]; 1662 xAnalyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride ); 1663 1664 // get original DC for each segment 1665 Pel apDCOrigValues[2]; 1666 xAnalyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride ); 1667 1668 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 1669 { 1670 // remap reconstructed value to valid depth values 1671 Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment]; 1672 1673 // get residual (idx) 1674 Pel pResidualIdx = GetDepthValue2Idx( pDCRec ) - GetDepthValue2Idx( apDCPredValues[uiSegment] ); 1675 1676 // save SDC DC offset 1677 pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx); 1678 } 1679 1680 // reconstruct residual based on mask + DC residuals 1681 Pel apDCResiValues[2]; 1682 Pel apDCRecoValues[2]; 1683 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 1684 { 1685 Pel pPredIdx = GetDepthValue2Idx( apDCPredValues[uiSegment] ); 1686 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); 1687 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1688 1689 apDCRecoValues[uiSegment] = pRecoValue; 1690 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 1691 } 1692 1693 //===== reconstruction ===== 1694 Bool* pMask = pbMask; 1695 Pel* pPred = piPred; 1696 Pel* pReco = piReco; 1697 Pel* pRecIPred = piRecIPred; 1698 1699 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1700 { 1701 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1702 { 1703 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1704 assert( ucSegment < uiNumSegments ); 1705 1706 Pel pPredVal= apDCPredValues[ucSegment]; 1707 Pel pResiDC = apDCResiValues[ucSegment]; 1708 1709 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1710 pRecIPred[ uiX ] = pReco[ uiX ]; 1711 } 1712 pPred += uiStride; 1713 pReco += uiStride; 1714 pRecIPred += uiRecIPredStride; 1715 pMask += uiMaskStride; 1716 } 1717 1718 // clear UV 1719 UInt uiStrideC = pcPredYuv->getCStride(); 1720 Pel *pRecCb = pcPredYuv->getCbAddr(); 1721 Pel *pRecCr = pcPredYuv->getCrAddr(); 1722 1723 for (Int y=0; y<uiHeight/2; y++) 1724 { 1725 for (Int x=0; x<uiWidth/2; x++) 1726 { 1727 pRecCb[x] = (Pel)(128<<g_uiBitIncrement); 1728 pRecCr[x] = (Pel)(128<<g_uiBitIncrement); 1729 } 1730 1731 pRecCb += uiStrideC; 1732 pRecCr += uiStrideC; 1733 } 1734 1735 //===== determine distortion ===== 1736 #if HHI_VSO 1737 if ( m_pcRdCost->getUseVSO() ) 1738 { 1739 ruiDist = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 ); 1740 } 1741 else 1742 #endif 1743 { 1744 ruiDist = m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 1745 } 1746 1747 //----- determine rate and r-d cost ----- 1748 m_pcEntropyCoder->resetBits(); 1749 1750 // encode reduced intra header 1751 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 1752 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 1753 1754 // encode pred direction + residual data 1755 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 1756 1757 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 1758 1759 #if HHI_VSO 1760 if ( m_pcRdCost->getUseLambdaScaleVSO()) 1761 { 1762 dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist ); 1763 } 1764 else 1765 #endif 1766 { 1767 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 1768 } 1769 } 1770 #endif 1595 1771 1596 1772 Void … … 1830 2006 UInt uiQNumParts = pcCU->getTotalNumPart() >> 2; 1831 2007 UInt uiWidthBit = pcCU->getIntraSizeIdx(0); 2008 #if FIX_RDO_NEGDIST 2009 Dist uiOverallDistY = 0; 2010 Dist uiOverallDistC = 0; 2011 #else 1832 2012 UInt uiOverallDistY = 0; 1833 2013 UInt uiOverallDistC = 0; 2014 #endif 1834 2015 UInt CandNum; 1835 2016 Double CandCostList[ FAST_UDI_MAX_RDMODE_NUM ]; … … 1867 2048 Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ]; 1868 2049 1869 #if LGE_EDGE_INTRA 2050 #if LGE_EDGE_INTRA_A0070 1870 2051 Bool bTestEdgeIntra = false; 1871 2052 if ( m_pcEncCfg->isDepthCoder() && uiWidth >= LGE_EDGE_INTRA_MIN_SIZE && uiWidth <= LGE_EDGE_INTRA_MAX_SIZE && uiWidth == uiHeight ) … … 1918 2099 if ( m_pcRdCost->getUseWVSO() ) 1919 2100 { 1920 Int iDWeight = m_pcRdCost->getDWeight() ;1921 Int iVSDWeight = m_pcRdCost->getVSDWeight() ;2101 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 2102 Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight(); 1922 2103 Dist iD = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight ); 1923 2104 uiSad = (Dist) (iDWeight * iD + iVSDWeight * uiSad) / (iDWeight + iVSDWeight); … … 1933 2114 if ( m_pcRdCost->getUseWVSO() ) 1934 2115 { 1935 Int iDWeight = m_pcRdCost->getDWeight() *m_pcRdCost->getDWeight();1936 Int iVS DWeight = m_pcRdCost->getVSOWeight()*m_pcRdCost->getVSOWeight();1937 Dist iD = (Dist) m_pcRdCost-> getDistPart( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight );1938 uiSad = (Dist) (iDWeight * iD + iVS DWeight * uiSad) / (iDWeight + iVSDWeight);2116 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 2117 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getDWeight(); 2118 Dist iD = (Dist) m_pcRdCost->calcHAD( piOrg, uiStride, piPred, uiStride, uiWidth, uiHeight ); 2119 uiSad = (Dist) (iDWeight * iD + iVSOWeight * uiSad) / (iDWeight + iVSOWeight); 1939 2120 } 1940 2121 #endif … … 1968 2149 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList ); 1969 2150 1970 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX2151 #if (HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX) && !FIX_DMM_NEG_DIST 1971 2152 if( bTestDmm ) bTestDmm = uiSad ? true : false; 1972 2153 #endif 1973 #if LGE_EDGE_INTRA 2154 #if LGE_EDGE_INTRA_A0070 1974 2155 if ( bTestEdgeIntra ) bTestEdgeIntra = uiSad ? true : false; 1975 2156 #endif … … 2081 2262 } 2082 2263 #endif 2083 #if LGE_EDGE_INTRA 2264 #if LGE_EDGE_INTRA_A0070 2084 2265 if( bTestEdgeIntra ) 2085 2266 { … … 2098 2279 2099 2280 UInt uiBestPUMode = 0; 2281 #if FIX_RDO_NEGDIST 2282 Dist uiBestPUDistY = 0; 2283 Dist uiBestPUDistC = 0; 2284 #else 2100 2285 UInt uiBestPUDistY = 0; 2101 2286 UInt uiBestPUDistC = 0; 2287 #endif 2102 2288 Double dBestPUCost = MAX_DOUBLE; 2289 #if RWTH_SDC_DLT_B0036 2290 Bool bBestUseSDC = false; 2291 Pel apBestDCOffsets[2] = {0,0}; 2292 #endif 2103 2293 for( UInt uiMode = 0; uiMode < numModesForFullRD; uiMode++ ) 2104 2294 { 2105 #if LG_ZEROINTRADEPTHRESI_ M260392295 #if LG_ZEROINTRADEPTHRESI_A0087 2106 2296 Bool bAllowZeroResi = pcCU->getSlice()->getIsDepth() && (pcCU->getSlice()->getPOC()%pcCU->getPic()->getIntraPeriod());// && (uiMode < NUM_INTRA_MODE); 2107 2297 for(UInt uiCnt = 0; uiCnt < (bAllowZeroResi ? 2 : 1); uiCnt++) … … 2114 2304 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 2115 2305 if( m_pcEncCfg->getIsDepth() && !predIntraLumaDMMAvailable( uiOrgMode, uiWidth, uiHeight ) 2116 #if LGE_EDGE_INTRA 2306 #if LGE_EDGE_INTRA_A0070 2117 2307 && uiOrgMode < EDGE_INTRA_IDX 2118 2308 #endif … … 2121 2311 continue; 2122 2312 } 2313 #endif 2314 2315 #if RWTH_SDC_DLT_B0036 2316 UInt uiUseSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getPartitionSize(uiPartOffset) == SIZE_2Nx2N )?1:0; 2317 2318 for( UInt uiSDC=0; uiSDC<=uiUseSDC; uiSDC++ ) 2319 { 2320 for( UInt uiRes = 0; uiRes<=uiUseSDC; uiRes++ ) 2321 { 2123 2322 #endif 2124 2323 … … 2144 2343 } 2145 2344 #endif 2146 2345 #if RWTH_SDC_DLT_B0036 2346 // last check: if not available for current intra prediction mode, don't try 2347 if( uiSDC == 1 && !pcCU->getSDCAvailable(uiPartOffset) ) 2348 continue; 2349 2350 pcCU->setSDCFlagSubParts( uiSDC == 1, uiPartOffset, 0, uiDepth + uiInitTrDepth ); 2351 2352 if(uiSDC == 1) 2353 { 2354 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 2355 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth); 2356 2357 // start encoding with SDC 2358 xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (uiRes==1)); 2359 } 2360 else 2361 { 2362 #endif 2147 2363 #if HHI_RQT_INTRA_SPEEDUP 2148 #if LG_ZEROINTRADEPTHRESI_ M260392364 #if LG_ZEROINTRADEPTHRESI_A0087 2149 2365 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, bZeroResi ); 2150 2366 #else … … 2153 2369 #else 2154 2370 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, dPUCost ); 2371 #endif 2372 #if RWTH_SDC_DLT_B0036 2373 } 2155 2374 #endif 2156 2375 … … 2166 2385 uiBestPUDistC = uiPUDistC; 2167 2386 dBestPUCost = dPUCost; 2387 2388 #if RWTH_SDC_DLT_B0036 2389 if( uiSDC == 1 ) 2390 { 2391 bBestUseSDC = true; 2392 2393 // copy reconstruction 2394 pcPredYuv->copyPartToPartYuv(pcRecoYuv, uiPartOffset, uiWidth, uiHeight); 2395 2396 // copy DC values 2397 apBestDCOffsets[0] = pcCU->getSDCSegmentDCOffset(0, uiPartOffset); 2398 apBestDCOffsets[1] = pcCU->getSDCSegmentDCOffset(1, uiPartOffset); 2399 } 2400 else 2401 { 2402 bBestUseSDC = false; 2403 #endif 2404 2405 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv ); 2406 2407 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 ); 2408 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 2409 ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 2410 ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 2411 ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) ); 2412 #if RWTH_SDC_DLT_B0036 2413 } 2414 #endif 2415 } 2416 #if HHI_RQT_INTRA_SPEEDUP_MOD 2417 else if( dPUCost < dSecondBestPUCost ) 2418 { 2419 uiSecondBestMode = uiOrgMode; 2420 dSecondBestPUCost = dPUCost; 2421 } 2422 #endif 2423 #if LG_ZEROINTRADEPTHRESI_A0087 2424 } 2425 #endif 2426 #if RWTH_SDC_DLT_B0036 2427 } // SDC residual loop 2428 } // SDC loop 2429 #endif 2430 } // Mode loop 2431 2432 #if HHI_RQT_INTRA_SPEEDUP 2433 #if HHI_RQT_INTRA_SPEEDUP_MOD 2434 for( UInt ui =0; ui < 2; ++ui ) 2435 #endif 2436 { 2437 #if HHI_RQT_INTRA_SPEEDUP_MOD 2438 UInt uiOrgMode = ui ? uiSecondBestMode : uiBestPUMode; 2439 if( uiOrgMode == MAX_UINT ) 2440 { 2441 break; 2442 } 2443 #else 2444 UInt uiOrgMode = uiBestPUMode; 2445 #endif 2446 2447 pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); 2448 2449 // set context models 2450 if( m_bUseSBACRD ) 2451 { 2452 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 2453 } 2454 2455 // determine residual for partition 2456 Dist uiPUDistY = 0; 2457 Dist uiPUDistC = 0; 2458 Double dPUCost = 0.0; 2459 2460 #if HHI_VSO 2461 // reset Model 2462 if( m_pcRdCost->getUseRenModel() ) 2463 { 2464 m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight ); 2465 } 2466 #endif 2467 2468 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, false, dPUCost ); 2469 2470 // check r-d cost 2471 if( dPUCost < dBestPUCost ) 2472 { 2473 uiBestPUMode = uiOrgMode; 2474 uiBestPUDistY = uiPUDistY; 2475 uiBestPUDistC = uiPUDistC; 2476 dBestPUCost = dPUCost; 2477 #if RWTH_SDC_DLT_B0036 2478 bBestUseSDC = false; 2479 #endif 2168 2480 2169 2481 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv ); … … 2176 2488 2177 2489 } 2178 #if HHI_RQT_INTRA_SPEEDUP_MOD2179 else if( dPUCost < dSecondBestPUCost )2180 {2181 uiSecondBestMode = uiOrgMode;2182 dSecondBestPUCost = dPUCost;2183 }2184 #endif2185 #if LG_ZEROINTRADEPTHRESI_M260392186 }2187 #endif2188 } // Mode loop2189 2190 #if HHI_RQT_INTRA_SPEEDUP2191 #if HHI_RQT_INTRA_SPEEDUP_MOD2192 for( UInt ui =0; ui < 2; ++ui )2193 #endif2194 {2195 #if HHI_RQT_INTRA_SPEEDUP_MOD2196 UInt uiOrgMode = ui ? uiSecondBestMode : uiBestPUMode;2197 if( uiOrgMode == MAX_UINT )2198 {2199 break;2200 }2201 #else2202 UInt uiOrgMode = uiBestPUMode;2203 #endif2204 2205 pcCU->setLumaIntraDirSubParts ( uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );2206 2207 // set context models2208 if( m_bUseSBACRD )2209 {2210 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );2211 }2212 2213 // determine residual for partition2214 Dist uiPUDistY = 0;2215 Dist uiPUDistC = 0;2216 Double dPUCost = 0.0;2217 2218 #if HHI_VSO2219 // reset Model2220 if( m_pcRdCost->getUseRenModel() )2221 {2222 m_pcRdCost->setRenModelData( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight );2223 }2224 #endif2225 2226 xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, false, dPUCost );2227 2228 // check r-d cost2229 if( dPUCost < dBestPUCost )2230 {2231 uiBestPUMode = uiOrgMode;2232 uiBestPUDistY = uiPUDistY;2233 uiBestPUDistC = uiPUDistC;2234 dBestPUCost = dPUCost;2235 2236 xSetIntraResultQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcRecoYuv );2237 2238 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> ( ( pcCU->getDepth(0) + uiInitTrDepth ) << 1 );2239 ::memcpy( m_puhQTTempTrIdx, pcCU->getTransformIdx() + uiPartOffset, uiQPartNum * sizeof( UChar ) );2240 ::memcpy( m_puhQTTempCbf[0], pcCU->getCbf( TEXT_LUMA ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );2241 ::memcpy( m_puhQTTempCbf[1], pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );2242 ::memcpy( m_puhQTTempCbf[2], pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, uiQPartNum * sizeof( UChar ) );2243 2244 }2245 2490 } // Mode loop 2246 2491 #endif … … 2249 2494 uiOverallDistY += uiBestPUDistY; 2250 2495 uiOverallDistC += uiBestPUDistC; 2496 2497 #if RWTH_SDC_DLT_B0036 2498 if( bBestUseSDC ) 2499 { 2500 pcCU->setTrIdxSubParts(0, uiPartOffset, uiDepth + uiInitTrDepth); 2501 pcCU->setCbfSubParts(1, 1, 1, uiPartOffset, uiDepth + uiInitTrDepth); 2502 2503 //=== copy best DC segment values back to CU ==== 2504 pcCU->setSDCSegmentDCOffset(apBestDCOffsets[0], 0, uiPartOffset); 2505 pcCU->setSDCSegmentDCOffset(apBestDCOffsets[1], 1, uiPartOffset); 2506 } 2507 else 2508 { 2509 #endif 2251 2510 2252 2511 //--- update transform index and cbf --- … … 2256 2515 ::memcpy( pcCU->getCbf( TEXT_CHROMA_U ) + uiPartOffset, m_puhQTTempCbf[1], uiQPartNum * sizeof( UChar ) ); 2257 2516 ::memcpy( pcCU->getCbf( TEXT_CHROMA_V ) + uiPartOffset, m_puhQTTempCbf[2], uiQPartNum * sizeof( UChar ) ); 2517 #if RWTH_SDC_DLT_B0036 2518 } 2519 #endif 2258 2520 2259 2521 //--- set reconstruction for next intra prediction blocks --- … … 2326 2588 //=== update PU data ==== 2327 2589 pcCU->setLumaIntraDirSubParts ( uiBestPUMode, uiPartOffset, uiDepth + uiInitTrDepth ); 2590 #if RWTH_SDC_DLT_B0036 2591 pcCU->setSDCFlagSubParts ( bBestUseSDC, uiPartOffset, 0, uiDepth + uiInitTrDepth ); 2592 #endif 2328 2593 pcCU->copyToPic ( uiDepth, uiPU, uiInitTrDepth ); 2329 2594 } // PU loop … … 2625 2890 iWidth, iHeight, m_pcEncCfg->getUseHADME() ); 2626 2891 #endif 2892 #if LGE_ILLUCOMP_B0045 2893 cDistParam.bUseIC = false; 2894 #endif 2627 2895 ruiErr = cDistParam.DistFunc( &cDistParam ); 2628 2896 } … … 2642 2910 */ 2643 2911 #if CU_BASED_MRG_CAND_LIST 2912 #if LG_RESTRICTEDRESPRED_M24766 2913 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand ) 2914 #else 2644 2915 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, TComMvField* cMvFieldNeighbours, UChar* uhInterDirNeighbours, Int& numValidMergeCand ) 2916 #endif 2645 2917 #else 2646 2918 #if LG_RESTRICTEDRESPRED_M24766 … … 3539 3811 UInt uiMRGCost = MAX_UINT; 3540 3812 #if CU_BASED_MRG_CAND_LIST 3813 #if LG_RESTRICTEDRESPRED_M24766 3814 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 3815 #else 3541 3816 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 3817 #endif 3542 3818 #else 3543 3819 #if LG_RESTRICTEDRESPRED_M24766 … … 3877 4153 cMvCand <<= 2; 3878 4154 #endif 4155 4156 #if LGE_ILLUCOMP_B0045 4157 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getViewId() != pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdx)); 4158 #endif 3879 4159 // prediction pattern 3880 4160 if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE ) … … 3884 4164 else 3885 4165 { 4166 #if LGE_ILLUCOMP_B0045 4167 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false, bICFlag ); 4168 #else 3886 4169 xPredInterLumaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMvCand, iSizeX, iSizeY, pcTemplateCand, false ); 4170 #endif 3887 4171 } 3888 4172 … … 3938 4222 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 3939 4223 4224 #if LGE_ILLUCOMP_B0045 4225 Bool bICFlag = pcCU->getICFlag(uiPartAddr) && (pcCU->getSlice()->getViewId() != pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxPred)); 4226 pcPatternKey->setICFlag(bICFlag); 4227 #endif 4228 3940 4229 if ( bBi ) 3941 4230 { … … 4101 4390 setDistParamComp(0); 4102 4391 4392 #if LGE_ILLUCOMP_B0045 4393 m_cDistParam.bUseIC = pcPatternKey->getICFlag(); 4394 #endif 4103 4395 uiSad = m_cDistParam.DistFunc( &m_cDistParam ); 4104 4396 … … 4457 4749 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 4458 4750 m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true ); 4751 #if LGE_ILLUCOMP_B0045 4752 m_pcEntropyCoder->encodeICFlag(pcCU, 0, true); 4753 #endif 4459 4754 #if HHI_INTER_VIEW_RESIDUAL_PRED 4460 4755 m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true ); … … 5207 5502 } 5208 5503 5504 #if FIX_RDO_NEGDIST 5505 Dist uiDistU = 0; 5506 Dist uiDistV = 0; 5507 #else 5209 5508 UInt uiDistU = 0; 5210 5509 UInt uiDistV = 0; 5510 #endif 5211 5511 if( bCodeChroma ) 5212 5512 { … … 5246 5546 #endif 5247 5547 5548 #if FIX_RDO_NEGDIST 5549 const Dist uiNonzeroDistU = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr( absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), 5550 pcResi->getCbAddr( absTUPartIdxC), pcResi->getCStride(), trWidthC, trHeightC 5551 5552 #else 5248 5553 const UInt uiNonzeroDistU = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCbAddr( absTUPartIdxC), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), 5249 5554 pcResi->getCbAddr( absTUPartIdxC), pcResi->getCStride(), trWidthC, trHeightC 5555 #endif 5250 5556 #if WEIGHTED_CHROMA_DISTORTION 5251 5557 , true … … 5332 5638 m_pcTrQuant->invtransformNxN( TEXT_CHROMA,REG_DCT, pcResiCurrV, m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), pcCoeffCurrV, trWidthC, trHeightC, scalingListType ); 5333 5639 #endif 5334 5640 #if FIX_RDO_NEGDIST 5641 const Dist uiNonzeroDistV = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr( absTUPartIdxC ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), 5642 pcResi->getCrAddr( absTUPartIdxC ), pcResi->getCStride(), trWidthC, trHeightC 5643 #else 5335 5644 const UInt uiNonzeroDistV = m_pcRdCost->getDistPart( m_pcQTTempTComYuv[uiQTTempAccessLayer].getCrAddr( absTUPartIdxC ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getCStride(), 5336 5645 pcResi->getCrAddr( absTUPartIdxC ), pcResi->getCStride(), trWidthC, trHeightC 5646 #endif 5337 5647 #if WEIGHTED_CHROMA_DISTORTION 5338 5648 , true … … 5822 6132 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 5823 6133 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true); 6134 #if LGE_ILLUCOMP_B0045 6135 m_pcEntropyCoder->encodeICFlag(pcCU, 0, true); 6136 #endif 5824 6137 #if HHI_INTER_VIEW_RESIDUAL_PRED 5825 6138 m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true ); … … 5842 6155 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 5843 6156 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 6157 #if LGE_ILLUCOMP_B0045 6158 m_pcEntropyCoder->encodeICFlag(pcCU, 0, true); 6159 #endif 5844 6160 #if HHI_INTER_VIEW_RESIDUAL_PRED 5845 6161 m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true ); … … 6197 6513 6198 6514 Dist uiActDist = RDO_DIST_MAX; 6199 #if FIX_RDO_MACRO6200 6515 #if SAIT_VSO_EST_A0033 6201 6516 if ( m_pcRdCost->getUseEstimatedVSD() ) … … 6228 6543 #endif // LGE_WVSO_A0119 6229 6544 } 6230 #else // FIX_RDO_MACRO6231 #if SAIT_VSO_EST_A00336232 if ( m_pcRdCost->getUseEstimatedVSD() )6233 {6234 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv();6235 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv();6236 uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight );6237 #if LGE_WVSO_A01196238 if ( m_pcRdCost->getUseWVSO() )6239 {6240 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();6241 Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight();6242 Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );6243 uiActDist = (iDWeight * iD + iVSDWeight * (Dist) uiActDist) / ( iDWeight + iVSDWeight);6244 }6245 #endif // LGE_WVSO_A01196246 }6247 else6248 #else // SAIT_VSO_EST_A0033 <-- wrong #else statement should be #endif6249 {6250 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, 0 );6251 #if LGE_WVSO_A01196252 if ( m_pcRdCost->getUseWVSO() )6253 {6254 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight();6255 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight();6256 Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD );6257 uiActDist = (iDWeight * iD + iVSOWeight * (Dist) uiActDist) / ( iDWeight + iVSOWeight);6258 }6259 #endif // LGE_WVSO_A01196260 }6261 #endif // SAIT_VSO_EST_A0033 <-- wrong #endif should be removed6262 #endif // FIX_RDO_MACRO6263 6545 6264 6546 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX ) … … 6302 6584 WedgeList* pacWedgeList = &g_aacWedgeLists[(g_aucConvertToBit[uiWidth])]; 6303 6585 Dist iDist = RDO_DIST_MAX; 6586 #if HHIQC_DMMFASTSEARCH_B0039 6587 WedgeNodeList* pacWedgeNodeList = &g_aacWedgeNodeLists[(g_aucConvertToBit[uiWidth])]; 6588 xSearchWedgeFullMinDistFast( pcCU, uiAbsPtIdx, pacWedgeNodeList, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist ); 6589 #else 6304 6590 xSearchWedgeFullMinDist( pcCU, uiAbsPtIdx, pacWedgeList, piOrig, uiStride, uiWidth, uiHeight, ruiTabIdx, iDist ); 6591 #endif 6305 6592 6306 6593 TComWedgelet* pcBestWedgelet = &(pacWedgeList->at(ruiTabIdx)); … … 6413 6700 } 6414 6701 6702 #if HHIQC_DMMFASTSEARCH_B0039 6703 Void TEncSearch::xSearchWedgeFullMinDistFast( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeNodeList* pacWedgeNodeList, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Dist& riDist ) 6704 { 6705 ruiTabIdx = 0; 6706 6707 // local pred buffer 6708 TComYuv cPredYuv; 6709 cPredYuv.create( uiWidth, uiHeight ); 6710 cPredYuv.clear(); 6711 6712 UInt uiPredStride = cPredYuv.getStride(); 6713 Pel* piPred = cPredYuv.getLumaAddr(); 6714 6715 Int iDC1 = 0; 6716 Int iDC2 = 0; 6717 6718 // coarse wedge search 6719 Dist uiBestDist = RDO_DIST_MAX; 6720 UInt uiBestNodeId = 0; 6721 for( UInt uiNodeId = 0; uiNodeId < pacWedgeNodeList->size(); uiNodeId++ ) 6722 { 6723 calcWedgeDCs ( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piRef, uiRefStride, iDC1, iDC2 ); 6724 assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx())), piPred, uiPredStride, iDC1, iDC2 ); 6725 6726 Dist uiActDist = RDO_DIST_MAX; 6727 #if HHI_VSO 6728 if( m_pcRdCost->getUseVSO() ) 6729 { 6730 #if SAIT_VSO_EST_A0033 6731 if ( m_pcRdCost->getUseEstimatedVSD() ) 6732 { 6733 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 6734 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 6735 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight ); 6736 #if LGE_WVSO_A0119 6737 if ( m_pcRdCost->getUseWVSO() ) 6738 { 6739 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 6740 Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight(); 6741 Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6742 uiActDist = (iDWeight * iD + iVSDWeight * (Int) uiActDist) / ( iDWeight + iVSDWeight); 6743 } 6744 #endif 6745 } 6746 else 6747 #endif 6748 { 6749 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 ); 6750 #if LGE_WVSO_A0119 6751 if ( m_pcRdCost->getUseWVSO() ) 6752 { 6753 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 6754 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight(); 6755 Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6756 uiActDist = (iDWeight * iD + iVSOWeight * (Int) uiActDist) / ( iDWeight + iVSOWeight); 6757 } 6758 #endif 6759 } 6760 } 6761 else 6762 { 6763 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6764 } 6765 #else 6766 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6767 #endif 6768 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX ) 6769 { 6770 uiBestDist = uiActDist; 6771 uiBestNodeId = uiNodeId; 6772 } 6773 } 6774 6775 // refinement 6776 Dist uiBestDistRef = uiBestDist; 6777 UInt uiBestTabIdxRef = pacWedgeNodeList->at(uiBestNodeId).getPatternIdx(); 6778 for( UInt uiRefId = 0; uiRefId < NUM_WEDGE_REFINES; uiRefId++ ) 6779 { 6780 if( pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ) != NO_IDX ) 6781 { 6782 calcWedgeDCs ( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piRef, uiRefStride, iDC1, iDC2 ); 6783 assignWedgeDCs2Pred( &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ))), piPred, uiPredStride, iDC1, iDC2 ); 6784 6785 Dist uiActDist = RDO_DIST_MAX; 6786 #if HHI_VSO 6787 if( m_pcRdCost->getUseVSO() ) 6788 { 6789 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, 0 ); 6790 #if LGE_WVSO_A0119 6791 if ( m_pcRdCost->getUseWVSO() ) 6792 { 6793 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 6794 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight(); 6795 Dist iD = (Dist) m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6796 uiActDist = (iDWeight * iD + iVSOWeight * (Int) uiActDist) / ( iDWeight + iVSOWeight); 6797 } 6798 #endif 6799 } 6800 else 6801 { 6802 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6803 } 6804 #else 6805 uiActDist = m_pcRdCost->getDistPart( piPred, uiPredStride, piRef, uiRefStride, uiWidth, uiHeight, false, DF_SAD ); 6806 #endif 6807 if( uiActDist < uiBestDistRef || uiBestDistRef == RDO_DIST_MAX ) 6808 { 6809 uiBestDistRef = uiActDist; 6810 uiBestTabIdxRef = pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId ); 6811 } 6812 } 6813 } 6814 6815 riDist = uiBestDistRef; 6816 ruiTabIdx = uiBestTabIdxRef; 6817 6818 cPredYuv.destroy(); 6819 return; 6820 } 6821 #endif 6822 6415 6823 Void TEncSearch::xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd ) 6416 6824 { … … 6549 6957 #endif 6550 6958 6551 #if LGE_EDGE_INTRA 6959 #if LGE_EDGE_INTRA_A0070 6552 6960 Bool TEncSearch::xCheckTerminatedEdge( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ) 6553 6961 { … … 7657 8065 #endif 7658 8066 #endif 8067 8068 #if RWTH_SDC_DLT_B0036 8069 Void TEncSearch::xAnalyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride ) 8070 { 8071 Int iSumDepth[2]; 8072 memset(iSumDepth, 0, sizeof(Int)*2); 8073 Int iSumPix[2]; 8074 memset(iSumPix, 0, sizeof(Int)*2); 8075 8076 for (Int y=0; y<uiSize; y++) 8077 { 8078 for (Int x=0; x<uiSize; x++) 8079 { 8080 UChar ucSegment = pMask?(UChar)pMask[x]:0; 8081 assert( ucSegment < uiNumSegments ); 8082 8083 iSumDepth[ucSegment] += pOrig[x]; 8084 iSumPix[ucSegment] += 1; 8085 } 8086 8087 pOrig += uiStride; 8088 pMask += uiMaskStride; 8089 } 8090 8091 // compute mean for each segment 8092 for( UChar ucSeg = 0; ucSeg < uiNumSegments; ucSeg++ ) 8093 { 8094 if( iSumPix[ucSeg] > 0 ) 8095 rpSegMeans[ucSeg] = iSumDepth[ucSeg] / iSumPix[ucSeg]; 8096 else 8097 rpSegMeans[ucSeg] = 0; // this happens for zero-segments 8098 } 8099 } 8100 #endif 7659 8101 7660 8102 //! \} -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r100 r189 260 260 TComYuv* pcResiYuv, 261 261 Dist& ruiDist 262 #if LG_ZEROINTRADEPTHRESI_ M26039262 #if LG_ZEROINTRADEPTHRESI_A0087 263 263 ,Bool bZeroResi = false 264 264 #endif … … 285 285 #endif 286 286 Double& dRDCost 287 #if LG_ZEROINTRADEPTHRESI_ M26039287 #if LG_ZEROINTRADEPTHRESI_A0087 288 288 ,Bool bZeroResi = false 289 289 #endif … … 307 307 UInt uiAbsPartIdx, 308 308 TComYuv* pcRecoYuv ); 309 310 #if RWTH_SDC_DLT_B0036 311 Void xAnalyzeSegmentsSDC ( Pel* pOrig, 312 UInt uiStride, 313 UInt uiSize, 314 Pel* rpSegMeans, 315 UInt uiNumSegments, 316 Bool* pMask, 317 UInt uiMaskStride ); 318 319 Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ); 320 #endif 309 321 310 322 // ------------------------------------------------------------------------------------------------------------------- … … 330 342 #endif 331 343 332 #if LGE_EDGE_INTRA 344 #if LGE_EDGE_INTRA_A0070 333 345 Bool xEdgePartition ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); 334 346 Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ); … … 374 386 UInt& ruiTabIdx, 375 387 Dist& riDist ); 388 #if HHIQC_DMMFASTSEARCH_B0039 389 Void xSearchWedgeFullMinDistFast( TComDataCU* pcCU, 390 UInt uiAbsPtIdx, 391 WedgeNodeList* pacWedgeNodeList, 392 WedgeList* pacWedgeList, 393 Pel* piRef, 394 UInt uiRefStride, 395 UInt uiWidth, 396 UInt uiHeight, 397 UInt& ruiTabIdx, 398 Dist& riDist ); 399 #endif 376 400 Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, 377 401 UInt uiAbsPtIdx, -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r120 r189 38 38 #include "TEncTop.h" 39 39 #include "TEncSlice.h" 40 #if HHI_VSO_SPEEDUP_A003341 40 #include "../../App/TAppEncoder/TAppEncTop.h" 42 #endif43 41 #include <math.h> 44 42 … … 191 189 rpcSlice->setViewOrderIdx(m_pcCfg->getViewOrderIdx()); 192 190 #endif 193 191 #if LGE_ILLUCOMP_B0045 192 rpcSlice->setApplyIC(false); 193 #endif 194 194 // set mutliview parameters 195 195 rpcSlice->initMultiviewSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() ); … … 648 648 TComSlice* pcSlice = rpcPic->getSlice(getSliceIdx()); 649 649 xDetermineStartAndBoundingCUAddr ( uiStartCUAddr, uiBoundingCUAddr, rpcPic, false ); 650 #if LG_ZEROINTRADEPTHRESI_ M26039650 #if LG_ZEROINTRADEPTHRESI_A0087 651 651 rpcPic->setIntraPeriod(this->m_pcCfg->getIntraPeriod()); 652 652 #endif … … 657 657 m_uiPicDist = 0; 658 658 659 #if CABAC_INIT_FLAG && POZNAN_CABAC_INIT_FLAG_FIX659 #if CABAC_INIT_FLAG && FIX_POZNAN_CABAC_INIT_FLAG 660 660 Bool bReset =(pcSlice->getPOC() == 0) || 661 661 (pcSlice->getPOC() % m_pcCfg->getIntraPeriod() == 0) || … … 769 769 UInt uiTilesAcross = 0; 770 770 771 #if LGE_ILLUCOMP_B0045 772 if (pcEncTop->getViewId() != 0 && !pcEncTop->isDepthCoder() && pcEncTop->getUseIC()) // DCP of ViewID 0 is not available 773 { 774 pcSlice ->xSetApplyIC(); 775 } 776 #endif 777 771 778 if( m_pcCfg->getUseSBACRD() ) 772 779 { … … 814 821 UInt uiTileLCUX = 0; 815 822 816 #if HHI_VSO_SPEEDUP_A0033817 823 Int iLastPosY = -1; 818 #endif819 824 820 825 // for every CU in slice … … 829 834 pcCU->initCU( rpcPic, uiCUAddr ); 830 835 831 #if HHI_VSO_SPEEDUP_A0033832 836 if ( m_pcRdCost->getUseRenModel() ) 833 837 { … … 843 847 } 844 848 } 845 #endif846 847 #if OL_DEPTHLIMIT_A0044 //stop dumping partition information848 m_bDumpPartInfo = 0;849 pcCU->setPartDumpFlag(m_bDumpPartInfo);850 #endif851 849 852 850 // inherit from TR if necessary, select substream to use. … … 1307 1305 } 1308 1306 1307 #if OL_QTLIMIT_PREDCODING_B0068 1308 rpcPic->setReduceBitsFlag(true); 1309 #endif 1310 1309 1311 TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr ); 1310 #if OL_DEPTHLIMIT_A00441311 pcCU->setPartDumpFlag(m_bDumpPartInfo);1312 pcCU->resetPartInfo();1313 #endif1314 1312 #if !REMOVE_TILE_DEPENDENCE 1315 1313 if( (rpcPic->getPicSym()->getTileBoundaryIndependenceIdr()==0) && (rpcPic->getPicSym()->getNumColumnsMinus1()!=0) ) … … 1399 1397 } 1400 1398 #endif 1399 1400 #if OL_QTLIMIT_PREDCODING_B0068 1401 rpcPic->setReduceBitsFlag(false); 1402 #endif 1403 1401 1404 } 1402 1405 -
trunk/source/Lib/TLibEncoder/TEncSlice.h
r116 r189 101 101 102 102 UInt m_uiSliceIdx; 103 #if OL_DEPTHLIMIT_A0044 //flag to signal to start dumping104 Bool m_bDumpPartInfo;105 #endif106 103 public: 107 104 TEncSlice(); … … 131 128 UInt getSliceIdx() { return m_uiSliceIdx; } 132 129 Void setSliceIdx(UInt i) { m_uiSliceIdx = i; } 133 #if OL_DEPTHLIMIT_A0044 //flag to signal to start dumping134 Void setPartDumpFlag(Bool flag) { m_bDumpPartInfo = flag;};135 #endif136 130 }; 137 131 -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r121 r189 91 91 { 92 92 // initialize global variables 93 #if FIX_INIT_ROM94 93 if( m_viewId == 0 && m_isDepth == false ) 95 94 { 96 #endif97 95 initROM(); 98 #if FIX_INIT_ROM 99 } 100 #endif 96 } 101 97 102 98 … … 605 601 // mark it should be extended 606 602 rpcPic->getPicYuvRec()->setBorderExtension(false); 607 #if FIXES608 603 rpcPic->getPicYuvOrg()->setBorderExtension(false); 609 #endif610 604 } 611 605 … … 648 642 #endif 649 643 644 #if RWTH_SDC_DLT_B0036 645 m_cSPS.setUseDLT ( m_bUseDLT ); 646 #endif 647 650 648 m_cSPS.setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize ); 651 649 m_cSPS.setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize ); … … 768 766 m_cSPS.setUseDMM( m_bUseDMM ); 769 767 #endif 770 #if OL_ DEPTHLIMIT_A0044771 m_cSPS.setUse DPL( m_bDepthPartitionLimiting);768 #if OL_QTLIMIT_PREDCODING_B0068 769 m_cSPS.setUseQTLPC( m_bUseQTLPC ); 772 770 #endif 773 771 #if HHI_MPI … … 1102 1100 1103 1101 // # substreams is "per tile" when tiles are independent. 1104 #if FIX_REMOVE_TILE_DEPENDENCE1105 1102 if ( m_iWaveFrontSynchro ) 1106 #else1107 if (m_iTileBoundaryIndependenceIdr && m_iWaveFrontSynchro)1108 #endif1109 1103 { 1110 1104 m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)); -
trunk/source/Lib/TLibRenderer/TRenImage.cpp
r101 r189 106 106 } 107 107 108 #if HHI_VSO_SPEEDUP_A0033109 108 template<typename T> 110 109 Void TRenImage<T>::getDataAndStrides( T** pptData, Int* piStrides ) … … 127 126 } 128 127 } 129 #endif130 128 131 129 template<typename T> -
trunk/source/Lib/TLibRenderer/TRenImage.h
r101 r189 69 69 TRenImagePlane<T>** getPlanes() const; 70 70 71 #if HHI_VSO_SPEEDUP_A003372 71 Void getDataAndStrides( T** pptData, Int* piStrides ); 73 72 Void getWidthAndHeight( Int* piWidths, Int* piHeights ); 74 #endif75 73 76 74 UInt getNumberOfPlanes() const; -
trunk/source/Lib/TLibRenderer/TRenModel.cpp
r124 r189 42 42 m_iWidth = -1; 43 43 m_iHeight = -1; 44 #if FIX_VSO_SETUP45 44 m_iUsedHeight = -1; 46 #endif47 45 m_iNumOfBaseViews = -1; 48 46 m_iSampledWidth = -1; … … 437 435 { 438 436 AOT( iViewNum < 0 || iViewNum > m_iNumOfBaseViews ); 439 #if FIX_VSO_SETUP440 437 AOF( pcPicYuvVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvVideoData->getWidth() == m_iWidth ); 441 438 AOF( pcPicYuvDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvDepthData->getWidth() == m_iWidth ); 442 #else443 AOF( pcPicYuvVideoData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvVideoData->getWidth() == m_iWidth );444 AOF( pcPicYuvDepthData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvDepthData->getWidth() == m_iWidth );445 #endif446 439 447 440 pcPicYuvVideoData->extendPicBorder(); 448 441 449 #if FIX_VSO_SETUP450 442 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth, m_iUsedHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] ); 451 443 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] ); 452 444 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] ); 453 445 TRenFilter::copy ( pcPicYuvDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(), m_iWidth, m_iUsedHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] ); 454 #else455 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvVideoData->getStride () , pcPicYuvVideoData->getStride() , m_iWidth, m_iHeight, m_aapiCurVideoPel[ iViewNum ][0], m_aaiCurVideoStrides[iViewNum][0] );456 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][1], m_aaiCurVideoStrides[iViewNum][1] );457 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvVideoData->getCStride() , pcPicYuvVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiCurVideoPel[ iViewNum ][2], m_aaiCurVideoStrides[iViewNum][2] );458 TRenFilter::copy ( pcPicYuvDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvDepthData->getStride () , pcPicYuvDepthData->getStride(), m_iWidth, m_iHeight, m_apiCurDepthPel [ iViewNum], m_aiCurDepthStrides [iViewNum] );459 #endif460 446 461 447 // Used for rendering reference pic from original video data … … 465 451 if ( m_abSetupVideoFromOrgForView[iViewNum] ) 466 452 { 467 #if FIX_VSO_SETUP468 453 AOF( pcPicYuvOrgVideoData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgVideoData->getWidth() == m_iWidth ); 469 454 pcPicYuvOrgVideoData->extendPicBorder(); … … 471 456 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] ); 472 457 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] ); 473 #else474 AOF( pcPicYuvOrgVideoData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvOrgVideoData->getWidth() == m_iWidth );475 pcPicYuvOrgVideoData->extendPicBorder();476 TRenFilter::sampleHorUp ( m_iShiftPrec, pcPicYuvOrgVideoData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgVideoData->getStride() , pcPicYuvOrgVideoData->getStride() , m_iWidth, m_iHeight, m_aapiOrgVideoPel[ iViewNum ][0], m_aaiOrgVideoStrides[iViewNum][0] );477 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCbAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][1], m_aaiOrgVideoStrides[iViewNum][1] );478 TRenFilter::sampleCUpHorUp( m_iShiftPrec, pcPicYuvOrgVideoData->getCrAddr() + (m_uiHorOff >> 1 ) * pcPicYuvOrgVideoData->getCStride(), pcPicYuvOrgVideoData->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiOrgVideoPel[ iViewNum ][2], m_aaiOrgVideoStrides[iViewNum][2] );479 #endif480 458 } 481 459 482 460 if ( m_abSetupDepthFromOrgForView[iViewNum] ) 483 461 { 484 #if FIX_VSO_SETUP485 462 AOF( pcPicYuvOrgDepthData->getHeight() >= m_iUsedHeight + m_uiHorOff && pcPicYuvOrgDepthData->getWidth() == m_iWidth ); 486 463 TRenFilter::copy ( pcPicYuvOrgDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(), m_iWidth, m_iUsedHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] ); 487 #else488 AOF( pcPicYuvOrgDepthData->getHeight() <= m_iHeight + m_uiHorOff || pcPicYuvOrgDepthData->getWidth() == m_iWidth );489 TRenFilter::copy ( pcPicYuvOrgDepthData->getLumaAddr() + m_uiHorOff * pcPicYuvOrgDepthData->getStride() , pcPicYuvOrgDepthData->getStride(), m_iWidth, m_iHeight, m_apiOrgDepthPel [ iViewNum], m_aiOrgDepthStrides [iViewNum] );490 #endif491 464 } 492 465 } … … 497 470 AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels ); 498 471 499 #if FIX_VSO_SETUP500 472 m_apcRenModels[iModelNum]->setupPart( m_uiHorOff, m_iUsedHeight ); 501 #endif502 473 503 474 // Switch model to original data for setup if given to render reference … … 520 491 } 521 492 522 #if FIX_VSO_SETUP523 493 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false ); 524 #else525 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false, m_uiHorOff );526 #endif527 494 528 495 // Setup to Org … … 545 512 546 513 // setup keeping reference rendered from original data 547 #if FIX_VSO_SETUP548 514 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true ); 549 #else550 m_apcRenModels[iModelNum]->setup ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true, m_uiHorOff);551 #endif552 515 } 553 516 } … … 579 542 580 543 581 #if FIX_VSO_SETUP582 544 Void 583 545 TRenModel::setupPart ( UInt uiHorOff, Int iUsedHeight ) … … 587 549 m_iUsedHeight = iUsedHeight; 588 550 } 589 #else590 Void591 TRenModel::setHorOffset ( UInt uiHorOff )592 {593 m_uiHorOff = uiHorOff;594 }595 #endif596 551 597 552 #if LGE_VSO_EARLY_SKIP_A0093 … … 606 561 607 562 AOT( iWidth + iStartPosX > m_iWidth ); 608 #if FIX_VSO_SETUP609 563 AOT( iHeight + iStartPosY > m_iUsedHeight ); 610 #else611 AOT( iHeight + iStartPosY > m_iHeight );612 #endif613 564 614 565 AOT( iStartPosX < 0); … … 644 595 645 596 iWidth = min(iWidth , m_iWidth - iStartPosX ); 646 #if FIX_VSO_SETUP647 597 iHeight = min(iHeight, m_iUsedHeight - iStartPosY ); 648 #else649 iHeight = min(iHeight, m_iHeight - iStartPosY );650 #endif651 598 652 599 AOT( iStartPosX < 0); … … 684 631 TRenModel::getSynthVideo( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv ) 685 632 { 686 #if FIX_VSO_SETUP687 633 m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv ); 688 #else689 m_apcRenModels[iModelNum]->getSynthVideo(iViewNum, pcPicYuv, m_uiHorOff );690 #endif691 634 } 692 635 … … 694 637 TRenModel::getSynthDepth( Int iModelNum, Int iViewNum, TComPicYuv* pcPicYuv ) 695 638 { 696 #if HHI_VSO_SPEEDUP_A0033 && !FIX_VSO_SETUP697 m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv, m_uiHorOff );698 #else699 639 m_apcRenModels[iModelNum]->getSynthDepth(iViewNum, pcPicYuv ); 700 #endif701 640 } 702 641 … … 705 644 { 706 645 TComPicYuv cPicYuvSynth; 707 #if FIX_VSO_SETUP708 646 cPicYuvSynth.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 709 #else710 cPicYuvSynth.create( m_iWidth, m_iHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth );711 #endif712 647 713 648 TComPicYuv cPicYuvTempRef; 714 #if FIX_VSO_SETUP715 649 cPicYuvTempRef.create( m_iWidth, m_iUsedHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth); 716 #else717 cPicYuvTempRef.create( m_iWidth, m_iHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth);718 #endif719 650 720 651 Int64 iSSEY = 0; … … 724 655 for (Int iCurModel = 0; iCurModel < m_iNumOfCurRenModels; iCurModel++) 725 656 { 726 #if FIX_VSO_SETUP727 657 m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth ); 728 658 m_apcCurRenModels[iCurModel]->getRefVideo ( m_aiCurPosInModels[iCurModel], &cPicYuvTempRef ); … … 731 661 iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCbAddr() , cPicYuvTempRef.getCStride()); 732 662 iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, cPicYuvTempRef.getCrAddr() , cPicYuvTempRef.getCStride()); 733 #else734 m_apcCurRenModels[iCurModel]->getSynthVideo( m_aiCurPosInModels[iCurModel], &cPicYuvSynth, 0 );735 TComPicYuv* pcPicYuvRef = &cPicYuvTempRef;736 m_apcCurRenModels[iCurModel]->getRefVideo ( m_aiCurPosInModels[iCurModel], pcPicYuvRef , 0 );737 738 iSSEY += TRenFilter::SSE( cPicYuvSynth.getLumaAddr(), cPicYuvSynth.getStride(), m_iWidth, m_iHeight , pcPicYuvRef->getLumaAddr(), pcPicYuvRef->getStride() );739 iSSEU += TRenFilter::SSE( cPicYuvSynth.getCbAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iHeight >> 1, pcPicYuvRef->getCbAddr() , pcPicYuvRef->getCStride());740 iSSEV += TRenFilter::SSE( cPicYuvSynth.getCrAddr() , cPicYuvSynth.getCStride(), m_iWidth >> 1, m_iHeight >> 1, pcPicYuvRef->getCrAddr() , pcPicYuvRef->getCStride());741 #endif742 663 } 743 664 -
trunk/source/Lib/TLibRenderer/TRenModel.h
r124 r189 62 62 63 63 // Set horizontal offset 64 #if FIX_VSO_SETUP65 64 Void setupPart ( UInt uiHorOff, Int iUsedHeight ); 66 #else67 Void setHorOffset ( UInt uiHorOff );68 #endif69 65 70 66 // Set Mode … … 104 100 Int m_iSampledWidth; 105 101 Int m_iPad; 106 #if FIX_VSO_SETUP107 102 Int m_iUsedHeight; // height currently used in buffer, whereas m_iHeight is the total height of the buffer 108 #endif109 103 110 104 111 105 Int m_iNumOfBaseViews; 112 106 113 #if HHI_VSO_SPEEDUP_A0033114 107 // Horizontal Offset in input data 115 108 UInt m_uiHorOff; 116 #endif117 109 118 110 /// Current Error Type /// -
trunk/source/Lib/TLibRenderer/TRenSingleModel.cpp
r124 r189 44 44 m_iHeight = -1; 45 45 m_iStride = -1; 46 #if FIX_VSO_SETUP47 46 m_iUsedHeight = -1; 48 47 m_iHorOffset = -1; 49 #endif50 48 m_iMode = -1; 51 49 m_iPad = PICYUV_PAD; … … 104 102 if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1]; 105 103 106 #if FIX_MEM_LEAKS107 104 if ( m_pcOutputSamples ) delete[] m_pcOutputSamples ; 108 #else 109 if ( m_pcOutputSamples ) delete m_pcOutputSamples ; 110 #endif 111 112 #if FIX_MEM_LEAKS 105 113 106 if ( m_piInvZLUTLeft ) delete[] m_piInvZLUTLeft ; 114 107 if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight; … … 117 110 if ( m_aapiRefVideoPel[1] ) delete[] ( m_aapiRefVideoPel[1] - ( m_aiRefVideoStrides[1] * m_iPad + m_iPad ) ); 118 111 if ( m_aapiRefVideoPel[2] ) delete[] ( m_aapiRefVideoPel[2] - ( m_aiRefVideoStrides[2] * m_iPad + m_iPad ) ); 119 #endif120 112 } 121 113 … … 197 189 Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0; 198 190 199 #if FIX_VSO_SETUP200 191 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 201 #else202 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )203 #endif204 192 { 205 193 if ( iViewPos == VIEWPOS_RIGHT ) … … 245 233 246 234 } 247 #if FIX_VSO_SETUP248 235 template <BlenMod iBM, Bool bBitInc> Void 249 236 TRenSingleModelC<iBM,bBitInc>::setupPart ( UInt uiHorOffset, Int iUsedHeight ) … … 254 241 m_iHorOffset = (Int) uiHorOffset; 255 242 } 256 #endif257 243 258 244 template <BlenMod iBM, Bool bBitInc> Void 259 #if FIX_VSO_SETUP260 245 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) 261 #else262 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOff )263 #endif264 246 { 265 247 AOT( !m_bUseOrgRef && pcOrgVideo ); … … 275 257 if ( pcOrgVideo && !bKeepReference ) 276 258 { 277 #if FIX_VSO_SETUP278 259 TRenFilter::copy( pcOrgVideo->getLumaAddr() + m_iHorOffset * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 279 260 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 280 261 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 281 #else282 TRenFilter::copy( pcOrgVideo->getLumaAddr() + uiHorOff * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);283 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);284 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);285 #endif286 262 xSetStructRefView(); 287 263 } … … 290 266 xResetStructError(); 291 267 xInitSampleStructs(); 292 #if FIX_VSO_SETUP293 268 switch ( m_iMode ) 294 269 { … … 320 295 AOT(true); 321 296 } 322 #else323 switch ( m_iMode )324 {325 case 0:326 #if LGE_VSO_EARLY_SKIP_A0093327 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );328 #else329 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );330 #endif331 break;332 case 1:333 #ifdef LGE_VSO_EARLY_SKIP_A0093334 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);335 #else336 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );337 #endif338 break;339 case 2:340 TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );341 #ifdef LGE_VSO_EARLY_SKIP_A0093342 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false);343 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);344 #else345 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );346 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );347 #endif348 break;349 default:350 AOT(true);351 }352 #endif353 297 354 298 // Get Rendered View as Reference … … 413 357 #endif 414 358 415 #if FIX_VSO_SETUP416 359 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 417 #else418 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )419 #endif420 360 { 421 361 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) … … 470 410 #endif 471 411 472 #if FIX_VSO_SETUP473 412 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 474 #else475 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )476 #endif477 413 { 478 414 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) … … 617 553 } 618 554 619 #if FIX_VSO_SETUP620 555 template <BlenMod iBM, Bool bBitInc> Void 621 556 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv ) … … 648 583 #endif 649 584 } 650 #else 651 template <BlenMod iBM, Bool bBitInc> Void 652 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) 653 { 654 AOT( pcPicYuv->getWidth() != m_iWidth ); 655 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset ); 656 657 #if HHI_VSO_COLOR_PLANES 658 Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL }; 659 xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]); 660 661 // Temp image for chroma down sampling 662 PelImage cTempImage( m_iWidth, m_iHeight, 3, 0); 663 664 Int aiStrides[3]; 665 Pel* apiData [3]; 666 667 cTempImage.getDataAndStrides( apiData, aiStrides ); 668 669 for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ ) 670 { 671 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight); 672 } 673 xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset ); 674 #else 675 Pel RenModelOutPels::* piY; 676 xGetSampleStrTextPtrs(iViewPos, piY); 677 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + uiHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iHeight ); 678 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 679 #endif 680 } 681 #endif 682 683 #if FIX_VSO_SETUP 585 684 586 template <BlenMod iBM, Bool bBitInc> Void 685 587 TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv ) … … 695 597 } 696 598 697 #else 698 template <BlenMod iBM, Bool bBitInc> Void 699 TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOff ) 700 { 701 AOT( iViewPos != 0 && iViewPos != 1); 702 AOT( pcPicYuv->getWidth() != m_iWidth ); 703 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOff ); 704 705 Pel RenModelOutPels::* piD = 0; 706 xGetSampleStrDepthPtrs(iViewPos, piD); 707 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * uiHorOff, pcPicYuv->getStride(), m_iWidth, m_iHeight ); 708 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 709 } 710 #endif 711 712 #if FIX_VSO_SETUP 599 713 600 template <BlenMod iBM, Bool bBitInc> Void 714 601 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv ) … … 742 629 #endif 743 630 } 744 #else745 template <BlenMod iBM, Bool bBitInc> Void746 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset )747 {748 AOT( pcPicYuv->getWidth() != m_iWidth );749 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset);750 751 #if HHI_VSO_COLOR_PLANES752 Pel RenModelOutPels::* piText[3];753 piText[0] = &RenModelOutPels::iYRef;754 piText[1] = &RenModelOutPels::iURef;755 piText[2] = &RenModelOutPels::iVRef;756 757 // Temp image for chroma down sampling758 759 PelImage cTempImage( m_iWidth, m_iHeight, 3, 0);760 Int aiStrides[3];761 Pel* apiData [3];762 763 cTempImage.getDataAndStrides( apiData, aiStrides );764 765 for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ )766 {767 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight);768 }769 770 xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset );771 #else772 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() * pcPicYuv->getStride() + uiHorOffset, pcPicYuv->getStride(), m_iWidth, m_iHeight );773 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );774 #endif775 }776 #endif777 631 778 632 template <BlenMod iBM, Bool bBitInc> RMDist … … 2018 1872 } 2019 1873 2020 #if FIX_VSO_SETUP2021 1874 template <BlenMod iBM, Bool bBitInc> Void 2022 1875 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget ) … … 2026 1879 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() ); 2027 1880 } 2028 #else2029 template <BlenMod iBM, Bool bBitInc> Void2030 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset )2031 {2032 TRenFilter::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iHeight, rpcPicYuvTarget->getLumaAddr() + uiHorOffset * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () );2033 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iHeight, rpcPicYuvTarget->getCbAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );2034 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iHeight, rpcPicYuvTarget->getCrAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );2035 }2036 #endif2037 1881 2038 1882 template class TRenSingleModelC<BLEND_NONE ,true>; -
trunk/source/Lib/TLibRenderer/TRenSingleModel.h
r124 r189 69 69 public: 70 70 71 #if FIX_VIRT_DESTRUCTOR72 71 virtual ~TRenSingleModel() { } 73 #endif74 72 #if LGE_VSO_EARLY_SKIP_A0093 75 73 virtual Void create ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0; … … 80 78 // Set Frame dependent data 81 79 virtual Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0; 82 #if FIX_VSO_SETUP83 80 virtual Void setupPart ( UInt uiHorOffset, Int iUsedHeight ) = 0; 84 81 virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) = 0; 85 #else86 virtual Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ) = 0;87 #endif88 82 89 83 // Set Data … … 103 97 virtual RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0; 104 98 105 #if FIX_VSO_SETUP106 99 virtual Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0; 107 100 virtual Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0; 108 101 virtual Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv ) = 0; 109 #else110 virtual Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0;111 virtual Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0;112 virtual Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) = 0;113 #endif114 102 }; 115 103 … … 181 169 // Set Frame dependent data 182 170 Void setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ); 183 #if FIX_VSO_SETUP184 171 Void setupPart ( UInt uiHorOffset, Int uiUsedHeight ); 185 172 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ); 186 #else187 Void setup ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset );188 #endif189 173 190 174 #if LGE_VSO_EARLY_SKIP_A0093 … … 203 187 RMDist getDistVideo ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ); 204 188 205 #if FIX_VSO_SETUP206 189 Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv ); 207 190 Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv ); 208 191 Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv ); 209 #else210 Void getSynthVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset );211 Void getSynthDepth ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset );212 Void getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset );213 #endif214 192 215 193 private: … … 293 271 Void xInitSampleStructs (); 294 272 Void xSetStructSynthViewAsRefView (); 295 #if FIX_VSO_SETUP296 273 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget ); 297 #else298 Void xCopy2PicYuv ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset );299 #endif300 274 301 275 template< typename S, typename T> 302 276 Void xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight ) 303 277 { 304 #if FIX_VSO_SETUP305 278 AOT( iWidth != m_iWidth ); 306 279 for (Int iPosY = 0; iPosY < iHeight; iPosY++) 307 #else308 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)309 #endif310 280 { 311 281 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) … … 321 291 Void xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight ) 322 292 { 323 #if FIX_VSO_SETUP324 293 AOT( iWidth != m_iWidth ); 325 294 for (Int iPosY = 0; iPosY < iHeight; iPosY++) 326 #else327 for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)328 #endif329 295 { 330 296 for (Int iPosX = 0; iPosX < m_iWidth; iPosX++) … … 344 310 Int m_iStride; 345 311 Int m_iPad; 346 #if FIX_VSO_SETUP347 312 Int m_iUsedHeight; 348 313 Int m_iHorOffset; 349 #endif350 314 351 315 Int m_iSampledWidth; 352 #if FIX_VSO_SETUP353 #else354 Int m_iSampledHeight;355 #endif356 316 Int m_iSampledStride; 357 317
Note: See TracChangeset for help on using the changeset viewer.