Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 1 Nov 2012, 19:22:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
r133 r166 683 683 UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey, 684 684 TComMv baseRefMv, 685 Int iFrac, TComMv& rcMvFrac ) 685 Int iFrac, TComMv& rcMvFrac 686 #if VSP_MV_ZERO 687 ,Bool bIsVsp 688 #endif 689 ) 686 690 { 687 691 UInt uiDist; … … 699 703 TComMv* pcMvRefine = (iFrac == 2 ? s_acMvRefineH : s_acMvRefineQ); 700 704 705 #if VSP_MV_ZERO 706 UInt iAround = ( bIsVsp )? 1:9; 707 for (UInt i = 0; i < iAround; i++) 708 #else 701 709 for (UInt i = 0; i < 9; i++) 710 #endif 702 711 { 703 712 TComMv cMvTest = pcMvRefine[i]; … … 871 880 { 872 881 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 882 #if FORCE_REF_VSP==1 883 if( pcCU->getSlice()->getViewId() != 0 ) 884 #if VSP_TEXT_ONLY 885 if( !pcCU->getSlice()->getSPS()->isDepth() ) 886 #endif 887 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 888 #endif 873 889 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 874 890 } … … 2751 2767 #if AMP_MRG 2752 2768 #if LG_RESTRICTEDRESPRED_M24766 2753 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2754 #else 2755 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 2769 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 2770 #if FORCE_REF_VSP==1 2771 , Bool bForceRefVsp 2772 #endif 2773 ) 2774 #else 2775 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG 2776 #if FORCE_REF_VSP==1 2777 , Bool bForceRefVsp 2778 #endif 2779 ) 2756 2780 #endif 2757 2781 #else … … 2813 2837 #endif 2814 2838 2839 #if FORCE_REF_VSP==1 2840 if( bForceRefVsp ) 2841 { 2842 assert( ePartSize == SIZE_2Nx2N ); 2843 2844 // Clear Motion Field 2845 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 ); 2846 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( TComMvField(), ePartSize, 0, pcCU->getDepth(0), 0 ); 2847 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvd ( cMvZero, ePartSize, 0, pcCU->getDepth(0), 0 ); 2848 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd ( cMvZero, ePartSize, 0, pcCU->getDepth(0), 0 ); 2849 2850 //pcCU->getCUMvField(REF_PIC_LIST_0)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_0), ePartSize, 0, pcCU->getDepth(0), 0 ); 2851 //pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx ( pcCU->getSlice()->getRefIdxVsp(REF_PIC_LIST_1), ePartSize, 0, pcCU->getDepth(0), 0 ); 2852 2853 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0)); 2854 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, 0, 0, pcCU->getDepth(0)); 2855 pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0)); 2856 pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, 0, 0, pcCU->getDepth(0)); 2857 2858 rpcPredYuv->copyFromPicYuv( pcCU->getPic()->getPicYuvSynth(), pcCU->getAddr(), pcCU->getZorderIdxInCU() ); 2859 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 2860 2861 return; 2862 } 2863 #endif 2864 2815 2865 #if ZERO_MVD_EST 2816 2866 Int aiZeroMvdMvpIdx[2] = {-1, -1}; … … 2833 2883 #if HHI_INTER_VIEW_MOTION_PRED 2834 2884 Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 2885 #endif 2886 2887 #if VSP_MV_ZERO 2888 bool bIsVsp = false; 2889 //Bool bWholeCUCanBeSynthesized = false; 2890 //Bool bSubCUCanBeSynthesized[4]; 2891 //if( pcCU->getSlice()->getViewId() ) 2892 //{ 2893 // Bool * pbSubCUCanBeSynthesized = bSubCUCanBeSynthesized; 2894 // pcCU->getPic()->checkSynthesisAvailability(/*rpcBestCU, */pcCU->getAddr(), pcCU->getZorderIdxInCU(), pcCU->getDepth(0), pbSubCUCanBeSynthesized); //KUBA SYNTH 2895 // Int iSubCUCanBeSynthesizedCnt = 0; 2896 // for(Int i = 0; i < 4; i++) 2897 // { 2898 // if (bSubCUCanBeSynthesized[i]) 2899 // { 2900 // iSubCUCanBeSynthesizedCnt ++; 2901 // } 2902 // } 2903 // if(iSubCUCanBeSynthesizedCnt == 4) 2904 // { 2905 // bWholeCUCanBeSynthesized = true; 2906 // } 2907 //} 2835 2908 #endif 2836 2909 … … 2857 2930 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 2858 2931 UInt uiBitsTempL0[MAX_NUM_REF]; 2932 2859 2933 #if LG_RESTRICTEDRESPRED_M24766 2860 2934 Int iPUResiPredShift[4] = {0, 0, 0, 0}; … … 2885 2959 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 2886 2960 { 2961 #if VSP_MV_ZERO 2962 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP); 2963 //if( bIsVsp && !bWholeCUCanBeSynthesized ) 2964 //{ 2965 // continue; 2966 //} 2967 #endif 2887 2968 #if LG_RESTRICTEDRESPRED_M24766 2888 2969 if( pcCU->getResPredFlag( 0 )) … … 2908 2989 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 2909 2990 } 2991 #if VSP_MV_ZERO 2992 if( bIsVsp ) 2993 { 2994 aaiMvpIdx[iRefList][iRefIdxTemp] = -1; 2995 aaiMvpNum[iRefList][iRefIdxTemp] = -1; 2996 cMvPred[iRefList][iRefIdxTemp].setZero(); 2997 } 2998 else 2999 { 3000 #endif 2910 3001 #if H0111_MVD_L1_ZERO 2911 3002 #if ZERO_MVD_EST … … 2937 3028 #else 2938 3029 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdx[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3030 #endif 3031 #if VSP_MV_ZERO 3032 } // if( bIsVsp ) 2939 3033 #endif 2940 3034 #if ZERO_MVD_EST … … 2973 3067 else 2974 3068 { 3069 #if VSP_MV_ZERO 3070 if( pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP ) 3071 { 3072 cMvTemp[1][iRefIdxTemp].setZero(); 3073 uiCostTemp = 0; 3074 } 3075 else 3076 { 3077 #endif 2975 3078 cMvTemp[1][iRefIdxTemp] = cMvTemp[0][pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)]; 2976 3079 uiCostTemp = uiCostTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)]; 2977 3080 /*first subtract the bit-rate part of the cost of the other list*/ 2978 3081 uiCostTemp -= m_pcRdCost->getCost( uiBitsTempL0[pcCU->getSlice()->getRefIdxOfL0FromRefIdxOfL1(iRefIdxTemp)] ); 3082 #if VSP_MV_ZERO 3083 } 3084 #endif 2979 3085 } 2980 3086 /*correct the bit-rate part of the current ref*/ … … 2986 3092 else 2987 3093 { 3094 #if VSP_MV_ZERO 3095 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp ); 3096 #else 2988 3097 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3098 #endif 2989 3099 } 2990 3100 } … … 2998 3108 else 2999 3109 { 3110 #if VSP_MV_ZERO 3111 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp ); 3112 #else 3000 3113 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3114 #endif 3001 3115 } 3002 3116 } 3003 3117 #else 3004 3118 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPred[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp ); 3119 #endif 3120 #if VSP_MV_ZERO 3121 if( bIsVsp ) 3122 { 3123 cMvPred[iRefList][iRefIdxTemp].setZero(); 3124 } 3125 else 3126 { 3005 3127 #endif 3006 3128 xCopyAMVPInfo(pcCU->getCUMvField(eRefPicList)->getAMVPInfo(), &aacAMVPInfo[iRefList][iRefIdxTemp]); // must always be done ( also when AMVP_MODE = AM_NONE ) … … 3009 3131 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPred[iRefList][iRefIdxTemp], aaiMvpIdx[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3010 3132 } 3133 #if VSP_MV_ZERO 3134 } 3135 #endif 3011 3136 3012 3137 if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && !pcCU->getSlice()->getNoBackPredFlag()) … … 3088 3213 if(pcCU->getSlice()->getMvdL1ZeroFlag()) 3089 3214 { 3215 #if VSP_MV_ZERO 3216 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, bestBiPRefIdxL1) == NUM_VIEW_VSP); 3217 3218 if( bIsVsp ) 3219 { 3220 cMvPredBi[1][bestBiPRefIdxL1].setZero(); 3221 } 3222 else 3223 { 3224 #endif 3090 3225 xCopyAMVPInfo(&aacAMVPInfo[1][bestBiPRefIdxL1], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()); 3091 3226 pcCU->setMVPIdxSubParts( bestBiPMvpL1, REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3092 3227 aaiMvpIdxBi[1][bestBiPRefIdxL1] = bestBiPMvpL1; 3093 3228 cMvPredBi[1][bestBiPRefIdxL1] = pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()->m_acMvCand[bestBiPMvpL1]; 3229 #if VSP_MV_ZERO 3230 } 3231 #endif 3094 3232 3095 3233 cMvBi[1] = cMvPredBi[1][bestBiPRefIdxL1]; … … 3109 3247 } 3110 3248 3249 #if VSP_MV_ZERO 3250 if( !bIsVsp ) 3251 { 3252 #endif 3111 3253 #if HHI_INTER_VIEW_MOTION_PRED 3112 3254 uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][iNumAMVPCands]; 3113 3255 #else 3114 3256 uiMotBits[1] += m_auiMVPIdxCost[aaiMvpIdxBi[1][bestBiPRefIdxL1]][AMVP_MAX_NUM_CANDS]; 3257 #endif 3258 #if VSP_MV_ZERO 3259 } 3115 3260 #endif 3116 3261 … … 3168 3313 for ( Int iRefIdxTemp = iRefStart; iRefIdxTemp <= iRefEnd; iRefIdxTemp++ ) 3169 3314 { 3315 #if VSP_MV_ZERO 3316 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(eRefPicList, iRefIdxTemp) == NUM_VIEW_VSP); 3317 //if( bIsVsp && !bWholeCUCanBeSynthesized ) 3318 //{ 3319 // continue; 3320 //} 3321 #endif 3170 3322 uiBitsTemp = uiMbBits[2] + uiMotBits[1-iRefList]; 3171 3323 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 3174 3326 if ( iRefIdxTemp == pcCU->getSlice()->getNumRefIdx(eRefPicList)-1 ) uiBitsTemp--; 3175 3327 } 3328 #if VSP_MV_ZERO 3329 if( !bIsVsp ) 3330 { 3331 #endif 3176 3332 #if HHI_INTER_VIEW_MOTION_PRED 3177 3333 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][iNumAMVPCands]; 3178 3334 #else 3179 3335 uiBitsTemp += m_auiMVPIdxCost[aaiMvpIdxBi[iRefList][iRefIdxTemp]][AMVP_MAX_NUM_CANDS]; 3336 #endif 3337 #if VSP_MV_ZERO 3338 } 3180 3339 #endif 3181 3340 #if LG_RESTRICTEDRESPRED_M24766 … … 3211 3370 #endif 3212 3371 // call ME 3372 #if VSP_MV_ZERO 3373 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], bIsVsp, uiBitsTemp, uiCostTemp, true ); 3374 #else 3213 3375 xMotionEstimation ( pcCU, pcOrgYuv, iPartIdx, eRefPicList, &cMvPredBi[iRefList][iRefIdxTemp], iRefIdxTemp, cMvTemp[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp, true ); 3376 #endif 3377 #if VSP_MV_ZERO 3378 if( !bIsVsp ) 3379 { 3380 #endif 3214 3381 if ( pcCU->getAMVPMode(uiPartAddr) == AM_EXPL ) 3215 3382 { … … 3217 3384 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3218 3385 } 3219 3386 #if VSP_MV_ZERO 3387 } 3388 #endif 3389 3220 3390 if ( uiCostTemp < uiCostBi ) 3221 3391 { … … 3249 3419 if ( uiCostBi <= uiCost[0] && uiCostBi <= uiCost[1] && pcCU->getAMVPMode(uiPartAddr) == AM_EXPL ) 3250 3420 { 3421 #if VSP_MV_ZERO 3422 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP); 3423 3424 if( !bIsVsp ) 3425 { 3426 #endif 3251 3427 xCopyAMVPInfo(&aacAMVPInfo[0][iRefIdxBi[0]], pcCU->getCUMvField(REF_PIC_LIST_0)->getAMVPInfo()); 3252 3428 xCheckBestMVP(pcCU, REF_PIC_LIST_0, cMvBi[0], cMvPredBi[0][iRefIdxBi[0]], aaiMvpIdxBi[0][iRefIdxBi[0]], uiBits[2], uiCostBi); 3429 #if VSP_MV_ZERO 3430 } 3431 #endif 3253 3432 #if H0111_MVD_L1_ZERO 3254 3433 if(!pcCU->getSlice()->getMvdL1ZeroFlag()) 3255 3434 { 3256 3435 #endif 3436 #if VSP_MV_ZERO 3437 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP); 3438 3439 if( !bIsVsp ) 3440 { 3441 #endif 3257 3442 xCopyAMVPInfo(&aacAMVPInfo[1][iRefIdxBi[1]], pcCU->getCUMvField(REF_PIC_LIST_1)->getAMVPInfo()); 3258 3443 xCheckBestMVP(pcCU, REF_PIC_LIST_1, cMvBi[1], cMvPredBi[1][iRefIdxBi[1]], aaiMvpIdxBi[1][iRefIdxBi[1]], uiBits[2], uiCostBi); 3444 #if VSP_MV_ZERO 3445 } 3446 #endif 3259 3447 #if H0111_MVD_L1_ZERO 3260 3448 } … … 3417 3605 pcCU->setInterDirSubParts( 3, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3418 3606 3607 #if VSP_MV_ZERO 3608 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdxBi[0]) == NUM_VIEW_VSP); 3609 if( !bIsVsp ) 3610 { 3611 #endif 3419 3612 pcCU->setMVPIdxSubParts( aaiMvpIdxBi[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3420 3613 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdxBi[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3614 #if VSP_MV_ZERO 3615 } 3616 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdxBi[1]) == NUM_VIEW_VSP); 3617 if( !bIsVsp ) 3618 { 3619 #endif 3421 3620 pcCU->setMVPIdxSubParts( aaiMvpIdxBi[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3422 3621 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdxBi[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3622 #if VSP_MV_ZERO 3623 } 3624 #endif 3423 3625 3424 3626 uiMEBits = uiBits[2]; … … 3435 3637 pcCU->setInterDirSubParts( 1, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3436 3638 3639 #if VSP_MV_ZERO 3640 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_0, iRefIdx[0]) == NUM_VIEW_VSP); 3641 if( !bIsVsp ) 3642 { 3643 #endif 3437 3644 pcCU->setMVPIdxSubParts( aaiMvpIdx[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3438 3645 pcCU->setMVPNumSubParts( aaiMvpNum[0][iRefIdx[0]], REF_PIC_LIST_0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3646 #if VSP_MV_ZERO 3647 } 3648 #endif 3439 3649 3440 3650 uiMEBits = uiBits[0]; … … 3451 3661 pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) ); 3452 3662 3663 #if VSP_MV_ZERO 3664 bIsVsp = (pcCU->getSlice()->getViewId() && pcCU->getSlice()->getRefViewId(REF_PIC_LIST_1, iRefIdx[1]) == NUM_VIEW_VSP); 3665 if( !bIsVsp ) 3666 { 3667 #endif 3453 3668 pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3454 3669 pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr)); 3670 #if VSP_MV_ZERO 3671 } 3672 #endif 3455 3673 3456 3674 uiMEBits = uiBits[1]; … … 3888 4106 } 3889 4107 4108 #if VSP_MV_ZERO 4109 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, Bool bIsVsp, UInt& ruiBits, UInt& ruiCost, Bool bBi ) 4110 #else 3890 4111 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, UInt& ruiCost, Bool bBi ) 4112 #endif 3891 4113 { 3892 4114 UInt uiPartAddr; … … 3901 4123 m_iSearchRange = m_aaiAdaptSR[eRefPicList][iRefIdxPred]; 3902 4124 4125 #if VSP_MV_ZERO 4126 Int iSrchRng = ( bIsVsp ? 0 : ( bBi ? m_bipredSearchRange : m_iSearchRange ) ); 4127 #else 3903 4128 Int iSrchRng = ( bBi ? m_bipredSearchRange : m_iSearchRange ); 4129 #endif 3904 4130 TComPattern* pcPatternKey = pcCU->getPattern (); 3905 4131 … … 3947 4173 m_pcRdCost->setCostScale ( 2 ); 3948 4174 4175 #if VSP_MV_ZERO 4176 if( !bIsVsp ) 4177 #endif 3949 4178 #if HHI_INTER_VIEW_MOTION_PRED 3950 4179 { // init inter-view regularization … … 3965 4194 } 3966 4195 #endif 4196 #if VSP_MV_ZERO 4197 else { // bIsVsp 4198 m_pcRdCost->setMultiviewReg( 0 ); 4199 } 4200 #endif 3967 4201 3968 4202 setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList ); 3969 4203 // Do integer search 4204 #if VSP_MV_ZERO 4205 if ( !m_iFastSearch || bBi || bIsVsp ) 4206 #else 3970 4207 if ( !m_iFastSearch || bBi ) 4208 #endif 3971 4209 { 3972 4210 xPatternSearch ( pcPatternKey, piRefY, iRefStride, &cMvSrchRngLT, &cMvSrchRngRB, rcMv, ruiCost ); … … 3979 4217 3980 4218 m_pcRdCost->getMotionCost( 1, 0 ); 4219 3981 4220 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 3982 4221 if( ! pcCU->getSlice()->getIsDepth() ) … … 3988 4227 xPatternSearchFracDIF( pcCU, pcPatternKey, piRefY, iRefStride, &rcMv, cMvHalf, cMvQter, ruiCost 3989 4228 ,bBi 4229 #if VSP_MV_ZERO 4230 ,bIsVsp 4231 #endif 3990 4232 ); 3991 4233 } … … 4006 4248 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4007 4249 #endif 4008 4250 4251 #if VSP_MV_ZERO 4252 if( bIsVsp ) { 4253 uiMvBits = 0; // vector zero & not output 4254 assert( rcMv.getHor()==0 && rcMv.getVer()==0 ); 4255 } 4256 #endif 4257 4009 4258 ruiBits += uiMvBits; 4010 4259 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4304 4553 UInt& ruiCost 4305 4554 ,Bool biPred 4555 #if VSP_MV_ZERO 4556 ,Bool bIsVsp 4557 #endif 4306 4558 ) 4307 4559 { … … 4322 4574 rcMvHalf = *pcMvInt; rcMvHalf <<= 1; // for mv-cost 4323 4575 TComMv baseRefMv(0, 0); 4324 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf ); 4576 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 2, rcMvHalf 4577 #if VSP_MV_ZERO 4578 ,bIsVsp 4579 #endif 4580 ); 4325 4581 4326 4582 m_pcRdCost->setCostScale( 0 ); … … 4332 4588 rcMvQter = *pcMvInt; rcMvQter <<= 1; // for mv-cost 4333 4589 rcMvQter += rcMvHalf; rcMvQter <<= 1; 4334 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter ); 4590 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter 4591 #if VSP_MV_ZERO 4592 ,bIsVsp 4593 #endif 4594 ); 4335 4595 } 4336 4596 … … 4367 4627 #endif 4368 4628 // No residual coding : SKIP mode 4369 if ( ePredMode == MODE_SKIP && bSkipRes ) 4629 if ( (ePredMode == MODE_SKIP && bSkipRes) 4630 #if FORCE_REF_VSP==1 4631 || ePredMode == MODE_SYNTH 4632 #endif 4633 ) 4370 4634 { 4371 4635 rpcYuvResi->clear(); … … 5737 6001 m_pcEntropyCoder->resetBits(); 5738 6002 m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true); 6003 #if FORCE_REF_VSP==1 6004 if( pcCU->getSlice()->getViewId() != 0 ) 6005 #if VSP_TEXT_ONLY 6006 if( !pcCU->getSlice()->getSPS()->isDepth() ) 6007 #endif 6008 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 6009 #endif 5739 6010 m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true); 5740 6011 #if HHI_INTER_VIEW_RESIDUAL_PRED … … 5743 6014 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 5744 6015 } 6016 #if FORCE_REF_VSP==1 6017 else if( pcCU->isVspMode( 0 ) ) 6018 { 6019 m_pcEntropyCoder->resetBits(); 6020 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 6021 m_pcEntropyCoder->encodeVspFlag ( pcCU, 0, true ); 6022 ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits(); 6023 } 6024 #endif 5745 6025 else 5746 6026 {
Note: See TracChangeset for help on using the changeset viewer.