Changeset 443 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 26 May 2013, 15:41:34 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r332 r443 206 206 207 207 #if H3D_IVMP 208 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 209 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS; 210 #else 208 211 const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + 1; 212 #endif 209 213 for( Int iNum = 0; iNum < iNumAMVPCands+1; iNum++) 210 214 for( Int iIdx = 0; iIdx < iNumAMVPCands; iIdx++) … … 908 912 if( uiAbsPartIdx == 0 ) 909 913 { 910 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 ); 914 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 915 #if PKU_QC_DEPTH_INTRA_UNI_D0195 916 ,true 917 #endif 918 ); 911 919 } 912 920 } … … 1701 1709 UChar ucSegment = pMask?(UChar)pMask[uiX]:0; 1702 1710 assert( ucSegment < uiNumSegments ); 1711 #if MTK_SAMPLE_BASED_SDC_D0110 1712 Pel pResiDC = apDCResiValues[ucSegment]; 1703 1713 1714 pReco [ uiX ] = Clip( pPred[ uiX ] + pResiDC ); 1715 #else 1704 1716 Pel pPredVal= apDCPredValues[ucSegment]; 1705 1717 Pel pResiDC = apDCResiValues[ucSegment]; 1706 1718 1707 1719 pReco [ uiX ] = Clip( pPredVal + pResiDC ); 1720 #endif 1708 1721 pRecIPred[ uiX ] = pReco[ uiX ]; 1709 1722 } … … 1735 1748 if ( m_pcRdCost->getUseVSO() ) 1736 1749 { 1750 #if FIX_SDC_ENC_RD_WVSO_D0163 && LGE_WVSO_A0119 1751 if ( m_pcRdCost->getUseWVSO() ) 1752 { 1753 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 1754 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight(); 1755 Dist iD = (Dist) m_pcRdCost->getDistPart( piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 1756 Dist iVSO = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 ); 1757 ruiDist += (iDWeight * iD + iVSOWeight * iVSO) / ( iDWeight + iVSOWeight); 1758 } 1759 else 1760 #endif 1737 1761 ruiDist = m_pcRdCost->getDistVS ( pcCU, uiAbsPartIdx, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight, false, 0 ); 1738 1762 } … … 1751 1775 1752 1776 // encode pred direction + residual data 1753 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 1754 1777 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true 1778 #if PKU_QC_DEPTH_INTRA_UNI_D0195 1779 ,true 1780 #endif 1781 ); 1755 1782 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 1756 1783 … … 2921 2948 , Int* iVSPIndexTrue 2922 2949 #endif 2950 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2951 , Int* iVSPDirTrue 2952 #endif 2923 2953 ) 2924 2954 { … … 2962 2992 } 2963 2993 #else 2994 2964 2995 #if MERL_VSP_C0152 2965 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 2966 #else 2967 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 2968 #endif 2969 #endif 2970 2996 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue 2997 #if MERL_VSP_NBDV_RefVId_Fix_D0166 2998 , iVSPDirTrue 2999 #endif 3000 ); 3001 3002 #else 3003 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand 3004 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3005 , iVSPDirTrue 3006 #endif 3007 ); 3008 #endif 3009 3010 #endif 2971 3011 2972 3012 #if H3D_IVMP … … 2985 3025 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 2986 3026 #if MERL_VSP_C0152 3027 #if MTK_D0156 3028 if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() ) 3029 { 3030 pcCU->setVSPIndexSubParts( 0, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3031 } 3032 else 3033 #endif 2987 3034 { 2988 3035 Int iVSPIdx = 0; 3036 #if LGE_VSP_INHERIT_D0092 3037 if (iVSPIndexTrue[uiMergeCand] == 1) 3038 { 3039 iVSPIdx = 1; 3040 } 3041 #else 2989 3042 Int numVSPIdx; 2990 3043 numVSPIdx = 3; … … 2997 3050 } 2998 3051 } 3052 #endif 2999 3053 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3054 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3055 pcCU->setVSPDirSubParts(0, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3056 #endif 3057 #if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 3058 if(iVSPIdx != 0) 3059 { 3060 Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0); 3061 cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx); 3062 } 3063 #endif 3000 3064 } 3001 3065 #endif … … 3109 3173 3110 3174 #if H3D_IVMP 3175 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 3176 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS; 3177 #else 3111 3178 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 3179 #endif 3112 3180 #endif 3113 3181 … … 3138 3206 //reset the VSP flag to be 0 3139 3207 pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3208 #endif 3209 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3210 pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3140 3211 #endif 3141 3212 #if AMP_MRG … … 3377 3448 iNumIter = 1; 3378 3449 } 3379 3450 3380 3451 for ( Int iIter = 0; iIter < iNumIter; iIter++ ) 3381 3452 { … … 3657 3728 UInt uiMRGIndex = 0; 3658 3729 #if MERL_VSP_C0152 3730 #if LGE_VSP_INHERIT_D0092 3731 Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM]; 3732 for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++) 3733 { 3734 iVSPIndexTrue[i] = 0; 3735 } 3736 #else 3659 3737 Int iVSPIndexTrue[3] = {-1, -1, -1}; 3738 #endif 3739 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3740 Int iVSPDirTrue[3] = {-1, -1, -1}; 3741 #endif 3660 3742 #endif 3661 3743 UInt uiMEInterDir = 0; … … 3688 3770 3689 3771 3690 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost3772 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost 3691 3773 #if CU_BASED_MRG_CAND_LIST 3692 3774 , cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, … … 3694 3776 #if MERL_VSP_C0152 3695 3777 , iVSPIndexTrue 3778 #endif 3779 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3780 , iVSPDirTrue 3696 3781 #endif 3697 3782 ); … … 3703 3788 pcCU->setMergeIndexSubParts( uiMRGIndex, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3704 3789 #if MERL_VSP_C0152 3790 3791 #if MTK_D0156 3792 if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() ) 3793 { 3794 pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3795 } 3796 else 3797 #endif 3705 3798 { 3706 3799 Int iVSPIdx = 0; 3800 #if LGE_VSP_INHERIT_D0092 3801 if (iVSPIndexTrue[uiMRGIndex] == 1) 3802 { 3803 iVSPIdx = 1; 3804 } 3805 #else 3707 3806 Int numVSPIdx; 3708 3807 numVSPIdx = 3; … … 3715 3814 } 3716 3815 } 3816 #endif 3717 3817 pcCU->setVSPIndexSubParts( iVSPIdx, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3818 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3819 pcCU->setVSPDirSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3820 #endif 3821 #if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092 3822 if(iVSPIdx != 0) 3823 { 3824 Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0); 3825 cMRGMvField[ 0].setRefIdx(iIVCIdx); 3826 } 3827 #endif 3718 3828 } 3719 3829 #endif … … 3738 3848 pcCU->setInterDirSubParts ( uiMEInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3739 3849 #if MERL_VSP_C0152 3740 pcCU->setVSPIndexSubParts ( 0 , uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3850 pcCU->setVSPIndexSubParts ( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3851 #endif 3852 #if MERL_VSP_NBDV_RefVId_Fix_D0166 3853 pcCU->setVSPDirSubParts ( 0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3741 3854 #endif 3742 3855 { … … 3799 3912 { 3800 3913 #if H3D_IVMP 3914 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 3915 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS; 3916 #else 3801 3917 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 3918 #endif 3802 3919 #if ZERO_MVD_EST 3803 3920 (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartIdx, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, iNumAMVPCands, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight, uiDist ); … … 3834 3951 UInt uiTmpCost; 3835 3952 #if H3D_IVMP 3953 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 3954 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS; 3955 #else 3836 3956 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 3957 #endif 3837 3958 #if ZERO_MVD_EST 3838 3959 uiTmpCost = xGetTemplateCost( pcCU, uiPartIdx, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, pcAMVPInfo->m_acMvCand[i], i, iNumAMVPCands, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight, uiDist ); … … 3967 4088 3968 4089 #if H3D_IVMP 4090 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122 4091 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS; 4092 #else 3969 4093 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 4094 #endif 3970 4095 #endif 3971 4096 … … 4674 4799 #endif 4675 4800 ); 4801 #if QC_ARP_D0177 4802 m_pcEntropyCoder->encodeARPW ( pcCU , 0 , true ); 4803 #endif 4676 4804 #endif 4677 4805 #if HHI_MPI … … 5892 6020 // Reload only contexts required for coding intra mode information 5893 6021 m_pcRDGoOnSbacCoder->loadIntraDirModeLuma( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 6022 #if PKU_QC_DEPTH_INTRA_UNI_D0195 6023 m_pcRDGoOnSbacCoder->loadDepthMode( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 6024 #endif 5894 6025 } 5895 6026 … … 5897 6028 5898 6029 m_pcEntropyCoder->resetBits(); 5899 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset); 6030 m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPartOffset 6031 #if PKU_QC_DEPTH_INTRA_UNI_D0195 6032 ,true 6033 #endif 6034 ); 5900 6035 5901 6036 return m_pcEntropyCoder->getNumberOfWrittenBits(); … … 5954 6089 ); 5955 6090 #endif 6091 #if QC_ARP_D0177 6092 m_pcEntropyCoder->encodeARPW( pcCU , 0 , true ); 6093 #endif 5956 6094 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 5957 6095 } … … 5977 6115 #endif 5978 6116 ); 6117 #if QC_ARP_D0177 6118 m_pcEntropyCoder->encodeARPW( pcCU , 0 , true ); 6119 #endif 5979 6120 #endif 5980 6121 #if HHI_MPI … … 6301 6442 Int iMaskStride = ( uiWidth<<1 ) + 1; 6302 6443 piMask += iMaskStride+1; 6444 #if QC_DC_PREDICTOR_D0183 6445 getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 ); 6446 #else 6303 6447 getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAboveAvail, bLeftAvail ); 6448 #endif 6304 6449 6305 6450 riDeltaDC1 = iDC1 - iPredDC1; … … 6478 6623 #endif 6479 6624 6625 #if HHI_DELTADC_DLT_D0035 6626 riDeltaDC1 = (Int)GetDepthValue2Idx( Clip(iPredDC1 + riDeltaDC1) ) - (Int)GetDepthValue2Idx( iPredDC1 ); 6627 riDeltaDC2 = (Int)GetDepthValue2Idx( Clip(iPredDC2 + riDeltaDC2) ) - (Int)GetDepthValue2Idx( iPredDC2 ); 6628 #endif 6480 6629 } 6481 6630 #endif … … 7862 8011 7863 8012 // PredDC Calculation 8013 #if QC_DC_PREDICTOR_D0183 8014 getPredDCs( pbRegion, uiWidth, piMask+iMaskStride+1, iMaskStride, iPredDC0, iPredDC1 ); 8015 #else 7864 8016 { 7865 8017 UInt uiSum0 = 0; … … 7901 8053 iPredDC1 = uiSum1 / uiCount1; 7902 8054 } 8055 #endif 7903 8056 7904 8057 iDeltaDC0 = iDC0 - iPredDC0;
Note: See TracChangeset for help on using the changeset viewer.