Changeset 189 in 3DVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 18 Nov 2012, 22:11:37 (12 years ago)
- Location:
- trunk/source/Lib/TLibEncoder
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
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));
Note: See TracChangeset for help on using the changeset viewer.