Changeset 332 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 21 Apr 2013, 19:13:11 (13 years ago)
- File:
-
- 1 edited
-
trunk/source/Lib/TLibEncoder/TEncSearch.cpp (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r296 r332 2311 2311 for( UInt uiSDC=0; uiSDC<=uiUseSDC; uiSDC++ ) 2312 2312 { 2313 #if FIX_SDC_ENC_C01432314 2313 for( UInt uiRes = 0; uiRes<=uiSDC; uiRes++ ) 2315 #else2316 for( UInt uiRes = 0; uiRes<=uiUseSDC; uiRes++ )2317 #endif2318 2314 { 2319 2315 #endif … … 2909 2905 * \returns Void 2910 2906 */ 2907 2908 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, 2909 TComYuv* pcYuvOrg, 2910 Int iPUIdx, 2911 UInt& uiInterDir, 2912 TComMvField* pacMvField, 2913 UInt& uiMergeIndex, 2914 UInt& ruiCost 2911 2915 #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 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 2917 #else 2918 #if LG_RESTRICTEDRESPRED_M24766 2919 #if MERL_VSP_C0152 || MTK_MDIVRP_C0138 2920 #if !MTK_MDIVRP_C0138 2921 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue ) 2922 #endif 2923 #if !MERL_VSP_C0152 2924 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2925 #endif 2926 #if MERL_VSP_C0152 && MTK_MDIVRP_C0138 2927 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue ) 2928 #endif 2929 #else 2930 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2931 #endif 2932 #else 2933 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2934 #endif 2935 #endif 2916 , TComMvField* cMvFieldNeighbours, 2917 UChar* uhInterDirNeighbours, 2918 Int& numValidMergeCand 2919 #endif 2920 #if MERL_VSP_C0152 2921 , Int* iVSPIndexTrue 2922 #endif 2923 ) 2936 2924 { 2937 2925 #if !CU_BASED_MRG_CAND_LIST … … 2985 2973 const int maxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 2986 2974 #endif 2987 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01382988 Int iPUResiPredShift[4];2989 Int iLastAddResiShift = -1000;2990 #endif2991 2975 ruiCost = MAX_UINT; 2992 2976 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) … … 3014 2998 } 3015 2999 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3016 }3017 #endif3018 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383019 Int iAddResiShift;3020 UInt uiPartAddr;3021 Int iRoiWidth, iRoiHeight;3022 3023 pcCU->getPartIndexAndSize( iPUIdx, uiPartAddr, iRoiWidth, iRoiHeight );3024 iAddResiShift = pcCU->getResiPredMode(uiPartAddr);3025 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1 - iAddResiShift : -1);3026 3027 if( pcCU->getResPredFlag( 0 ))3028 { // subtract residual prediction from original in motion search3029 if(iLastAddResiShift != iAddResiShift)3030 {3031 //add subtracted residual last time3032 if(iLastAddResiShift >= 0)3033 {3034 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;3035 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3036 }3037 //subtract residual3038 if(iAddResiShift >= 0)3039 {3040 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift;3041 pcYuvOrg->add(iPUResiPredShift, ePartSize, rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );3042 }3043 iLastAddResiShift = iAddResiShift;3044 }3045 3000 } 3046 3001 #endif … … 3066 3021 } 3067 3022 } 3068 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383069 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)3070 {3071 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;3072 pcYuvOrg->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3073 }3074 #endif3075 3023 } 3076 3024 … … 3085 3033 */ 3086 3034 #if AMP_MRG 3087 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383088 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )3089 #else3090 3035 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG) 3091 #endif3092 3036 #else 3093 3037 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes ) … … 3188 3132 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 3189 3133 UInt uiBitsTempL0[MAX_NUM_REF]; 3190 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383191 Int iPUResiPredShift[4] = {0, 0, 0, 0};3192 #endif3193 3134 xGetBlkBits( ePartSize, pcCU->getSlice()->isInterP(), iPartIdx, uiLastMode, uiMbBits); 3194 3135 … … 3209 3150 { 3210 3151 #endif 3211 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383212 Bool bLastResiFlag = false;3213 #endif3214 3152 3215 3153 // Uni-directional prediction … … 3220 3158 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 3221 3159 { 3222 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383223 if( pcCU->getResPredFlag( 0 ))3224 {3225 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp))3226 { // subtract residual prediction from original in motion search3227 if(!bLastResiFlag)3228 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );3229 bLastResiFlag = true;3230 }3231 else3232 {3233 if(bLastResiFlag)3234 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3235 bLastResiFlag = false;3236 }3237 }3238 #endif3239 3160 uiBitsTemp = uiMbBits[iRefList]; 3240 3161 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 3394 3315 } 3395 3316 } 3396 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383397 if( pcCU->getResPredFlag( 0 ) && bLastResiFlag)3398 { // subtract residual prediction from original in motion search3399 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3400 }3401 #endif3402 3317 // Bi-directional prediction 3403 3318 if ( pcCU->getSlice()->isInterB() ) 3404 3319 { 3405 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383406 Int iLastAddResiShift = -1000;3407 #endif3408 3320 cMvBi[0] = cMv[0]; cMvBi[1] = cMv[1]; 3409 3321 iRefIdxBi[0] = iRefIdx[0]; iRefIdxBi[1] = iRefIdx[1]; … … 3499 3411 #else 3500 3412 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3501 #endif3502 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383503 Int iAddResiShift = -1, iPredFrom = 0;3504 Int iBestRefIdx = pcCU->getCUMvField(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0)->getRefIdx(uiPartAddr);3505 3506 iPredFrom = iBestRefIdx >= 0 ? 3 : 1;3507 if(iBestRefIdx >= 0 && pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList == REF_PIC_LIST_0 ? REF_PIC_LIST_1 : REF_PIC_LIST_0, iBestRefIdx))3508 iAddResiShift++;3509 if(pcCU->getSlice()->getViewId() == pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp))3510 iAddResiShift++;3511 iAddResiShift = (pcCU->getSlice()->getPPS()->getUseWP() || iPredFrom != 3) ? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);3512 3513 if( pcCU->getResPredFlag( 0 ) )3514 {3515 if(iLastAddResiShift != iAddResiShift)3516 {3517 //add substracted residual last time3518 if(iLastAddResiShift >= 0 )3519 {3520 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;3521 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3522 }3523 //substract residual3524 if(iAddResiShift >= 0)3525 {3526 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iAddResiShift;3527 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true );3528 }3529 iLastAddResiShift = iAddResiShift;3530 }3531 }3532 3413 #endif 3533 3414 // call ME … … 3581 3462 } 3582 3463 } // for loop-iter 3583 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383584 if( pcCU->getResPredFlag( 0 ) && iLastAddResiShift >= 0)3585 {3586 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = iLastAddResiShift;3587 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3588 }3589 #endif3590 3464 } // if (B_SLICE) 3591 3465 #if ZERO_MVD_EST … … 3796 3670 if (bTestNormalMC) 3797 3671 { 3798 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383799 Int iAddResiShift = pcCU->getResiPredMode(uiPartAddr);3800 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = \3801 (pcCU->getSlice()->getPPS()->getUseWP() || pcCU->getInterDir(uiPartAddr) != 3)? (iAddResiShift >= 0 ? 0 : -1) : (iAddResiShift >= 0 ? 1-iAddResiShift : -1);3802 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)3803 {3804 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ), true);3805 }3806 #endif3807 3672 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 3808 3673 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 3809 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01383810 if(pcCU->getResPredFlag(0) && iAddResiShift >= 0)3811 {3812 pcOrgYuv->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcResiPredYuv, pcCU->getWidth( 0 ), pcCU->getHeight( 0 ));3813 }3814 #endif3815 3674 } 3816 3675 #else … … 3827 3686 // find Merge result 3828 3687 UInt uiMRGCost = MAX_UINT; 3688 3689 3690 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost 3829 3691 #if CU_BASED_MRG_CAND_LIST 3830 #if LG_RESTRICTEDRESPRED_M24766 3831 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 3832 #else 3833 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand); 3834 #endif 3835 #else 3836 #if LG_RESTRICTEDRESPRED_M24766 3837 #if MERL_VSP_C0152 || MTK_MDIVRP_C0138 3838 3839 #if !MTK_MDIVRP_C0138 3840 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, iVSPIndexTrue ); 3841 #endif 3842 3843 #if !MERL_VSP_C0152 3844 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3845 #endif 3846 3847 #if MERL_VSP_C0152 && MTK_MDIVRP_C0138 3848 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, iVSPIndexTrue ); 3849 #endif 3850 3851 #else 3852 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3853 #endif 3854 3855 3856 #else 3857 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3858 #endif 3859 #endif 3692 , cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, 3693 #endif 3694 #if MERL_VSP_C0152 3695 , iVSPIndexTrue 3696 #endif 3697 ); 3698 3860 3699 if ( uiMRGCost < uiMECost ) 3861 3700 { … … 4775 4614 UInt uiWidth = pcCU->getWidth ( 0 ); 4776 4615 UInt uiHeight = pcCU->getHeight( 0 ); 4777 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01384778 Int iPUResiPredShift[4];4779 #endif4780 4616 // No residual coding : SKIP mode 4781 4617 if ( ePredMode == MODE_SKIP && bSkipRes ) … … 4785 4621 pcYuvPred->copyToPartYuv( rpcYuvRec, 0 ); 4786 4622 4787 #if MTK_MDIVRP_C01384623 #if H3D_IVRP 4788 4624 if (pcCU->getMergeFlag(0) && pcCU->getMergeIndex(0)==0 && pcCU->getResPredAvail(0)) 4789 4625 { 4790 4626 rpcYuvRec->clip( uiWidth, uiHeight ); 4791 4627 } 4792 #else4793 #if H3D_IVRP4794 // add residual prediction4795 if( pcCU->getResPredFlag( 0 ) )4796 {4797 #if LG_RESTRICTEDRESPRED_M247664798 pcCU->getPUResiPredShift(iPUResiPredShift, 0);4799 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight );4800 #else4801 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight );4802 #endif4803 rpcYuvRec->clip( uiWidth, uiHeight );4804 }4805 #endif4806 4628 #endif 4807 4629 … … 4853 4675 ); 4854 4676 #endif 4855 #if H3D_IVRP && !MTK_MDIVRP_C01384856 m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );4857 #endif4858 4677 #if HHI_MPI 4859 4678 } … … 4922 4741 else 4923 4742 { 4924 #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C01384925 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;4926 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), pcYuvOrg, pcYuvPred, 0, uiWidth );4927 #else4928 4743 rpcYuvResi->subtract( pcYuvOrg, pcYuvPred, 0, uiWidth ); 4929 #endif4930 #if H3D_IVRP && !MTK_MDIVRP_C01384931 // subtract residual prediction4932 if( pcCU->getResPredFlag( 0 ) )4933 {4934 #if LG_RESTRICTEDRESPRED_M247664935 pcCU->getPUResiPredShift(iPUResiPredShift, 0);4936 rpcYuvResi->subtract(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResi, rpcYuvResPrd, 0, uiWidth );4937 #else4938 rpcYuvResi->subtract( rpcYuvResi, rpcYuvResPrd, 0, uiWidth );4939 #endif4940 }4941 #endif4942 4744 } 4943 4745 #else … … 5134 4936 #endif 5135 4937 } 5136 #if H3D_IVRP && !MTK_MDIVRP_C01385137 // add residual prediction5138 if( pcCU->getResPredFlag( 0 ) )5139 {5140 pcYuvPred->copyToPartYuv( rpcYuvRec, 0 );5141 #if LG_RESTRICTEDRESPRED_M247665142 pcCU->getPUResiPredShift(iPUResiPredShift, 0);5143 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResPrd, uiWidth, uiHeight );5144 iPUResiPredShift[0] = iPUResiPredShift[1] = iPUResiPredShift[2] = iPUResiPredShift[3] = 0;5145 rpcYuvRec->add(iPUResiPredShift, pcCU->getPartitionSize(0), rpcYuvResiBest, uiWidth, uiHeight );5146 #else5147 rpcYuvRec->add( rpcYuvResPrd, uiWidth, uiHeight );5148 rpcYuvRec->add( rpcYuvResiBest, uiWidth, uiHeight );5149 #endif5150 rpcYuvRec->clip( uiWidth, uiHeight );5151 }5152 else5153 #endif5154 4938 rpcYuvRec->addClip ( pcYuvPred, rpcYuvResiBest, 0, uiWidth ); 5155 4939 … … 6170 5954 ); 6171 5955 #endif 6172 #if H3D_IVRP && !MTK_MDIVRP_C01386173 m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );6174 #endif6175 5956 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6176 5957 } … … 6196 5977 #endif 6197 5978 ); 6198 #endif6199 #if H3D_IVRP && !MTK_MDIVRP_C01386200 m_pcEntropyCoder->encodeResPredFlag( pcCU, 0, 0, true );6201 5979 #endif 6202 5980 #if HHI_MPI … … 6534 6312 Int iFullDeltaDC2 = riDeltaDC2; 6535 6313 6536 #if HHI_DMM_DELTADC_Q1_C00346537 #else6538 xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC1 );6539 xDeltaDCQuantScaleDown( pcCU, iFullDeltaDC2 );6540 #endif6541 6542 6314 Dist uiBestDist = RDO_DIST_MAX; 6543 6315 UInt uiBestQStepDC1 = 0; … … 6551 6323 uiDeltaDC2Max += (uiDeltaDC2Max>>1); 6552 6324 6553 #if HHI_DMM_DELTADC_Q1_C00346554 6325 // limit search range to [0, IBDI_MAX] 6555 6326 if( iFullDeltaDC1 < 0 && uiDeltaDC1Max > abs(iPredDC1) ) { uiDeltaDC1Max = abs(iPredDC1); } … … 6698 6469 } 6699 6470 } 6700 #else 6701 for( UInt uiQStepDC1 = 1; uiQStepDC1 <= uiDeltaDC1Max; uiQStepDC1++ ) 6702 { 6703 Int iLevelDeltaDC1 = (Int)(uiQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1); 6704 xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC1 ); 6705 6706 Int iTestDC1 = Clip( iPredDC1 + iLevelDeltaDC1 ); 6707 for( UInt uiQStepDC2 = 1; uiQStepDC2 <= uiDeltaDC2Max; uiQStepDC2++ ) 6708 { 6709 Int iLevelDeltaDC2 = (Int)(uiQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1); 6710 xDeltaDCQuantScaleUp( pcCU, iLevelDeltaDC2 ); 6711 6712 Int iTestDC2 = Clip( iPredDC2 + iLevelDeltaDC2 ); 6713 6714 assignWedgeDCs2Pred( pcWedgelet, piPredic, uiStride, iTestDC1, iTestDC2 ); 6715 6716 Dist uiActDist = RDO_DIST_MAX; 6717 #if SAIT_VSO_EST_A0033 6718 if ( m_pcRdCost->getUseEstimatedVSD() ) 6719 { 6720 TComPicYuv* pcVirRec = m_pcRdCost->getVideoRecPicYuv(); 6721 TComPicYuv* pcVirOrg = m_pcRdCost->getDepthPicYuv(); 6722 uiActDist = m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, pcVirRec->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirOrg->getLumaAddr(pcCU->getAddr(),pcCU->getZorderIdxInCU()), pcVirRec->getStride(), uiWidth, uiHeight ); 6723 #if LGE_WVSO_A0119 6724 if ( m_pcRdCost->getUseWVSO() ) 6725 { 6726 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 6727 Int iVSDWeight = m_pcRdCost->getVSDWeight() * m_pcRdCost->getVSDWeight(); 6728 Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD ); 6729 uiActDist = (iDWeight * iD + iVSDWeight * (Dist) uiActDist) / ( iDWeight + iVSDWeight); 6730 } 6731 #endif // LGE_WVSO_A0119 6732 } 6733 else 6734 #endif // SAIT_VSO_EST_A0033 6735 { 6736 uiActDist = m_pcRdCost->getDistVS( pcCU, 0, piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, 0 ); 6737 #if LGE_WVSO_A0119 6738 if ( m_pcRdCost->getUseWVSO() ) 6739 { 6740 Int iDWeight = m_pcRdCost->getDWeight() * m_pcRdCost->getDWeight(); 6741 Int iVSOWeight = m_pcRdCost->getVSOWeight() * m_pcRdCost->getVSOWeight(); 6742 Dist iD = (Dist) m_pcRdCost->getDistPart( piPredic, uiStride, piOrig, uiStride, uiWidth, uiHeight, false, DF_SAD ); 6743 uiActDist = (iDWeight * iD + iVSOWeight * (Dist) uiActDist) / ( iDWeight + iVSOWeight); 6744 } 6745 #endif // LGE_WVSO_A0119 6746 } 6747 6748 if( uiActDist < uiBestDist || uiBestDist == RDO_DIST_MAX ) 6749 { 6750 uiBestDist = uiActDist; 6751 uiBestQStepDC1 = uiQStepDC1; 6752 uiBestQStepDC2 = uiQStepDC2; 6753 } 6754 } 6755 } 6756 #endif 6471 6757 6472 iFullDeltaDC1 = (Int)(uiBestQStepDC1) * (Int)(( iFullDeltaDC1 < 0 ) ? -1 : 1); 6758 6473 iFullDeltaDC2 = (Int)(uiBestQStepDC2) * (Int)(( iFullDeltaDC2 < 0 ) ? -1 : 1); 6759 #if HHI_DMM_DELTADC_Q1_C0034 6760 #else 6761 xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC1 ); 6762 xDeltaDCQuantScaleUp( pcCU, iFullDeltaDC2 ); 6763 #endif 6474 6764 6475 riDeltaDC1 = iFullDeltaDC1; 6765 6476 riDeltaDC2 = iFullDeltaDC2; … … 6767 6478 #endif 6768 6479 6769 #if HHI_DMM_DELTADC_Q1_C00346770 #else6771 xDeltaDCQuantScaleDown( pcCU, riDeltaDC1 );6772 xDeltaDCQuantScaleDown( pcCU, riDeltaDC2 );6773 #endif6774 6480 } 6775 6481 #endif
Note: See TracChangeset for help on using the changeset viewer.