Changeset 231 in 3DVCSoftware for branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 26 Jan 2013, 19:36:53 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev3-MERL/source/Lib/TLibEncoder/TEncSearch.cpp
r210 r231 696 696 UInt TEncSearch::xPatternRefinement( TComPattern* pcPatternKey, 697 697 TComMv baseRefMv, 698 Int iFrac, TComMv& rcMvFrac ) 698 Int iFrac, TComMv& rcMvFrac 699 ) 699 700 { 700 701 UInt uiDist; … … 1688 1689 // reconstruct residual based on mask + DC residuals 1689 1690 Pel apDCResiValues[2]; 1690 Pel apDCRecoValues[2];1691 //Pel apDCRecoValues[2]; 1691 1692 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 1692 1693 { … … 1695 1696 Pel pRecoValue = GetIdx2DepthValue( pPredIdx + pResiIdx ); 1696 1697 1697 apDCRecoValues[uiSegment] = pRecoValue;1698 //apDCRecoValues[uiSegment] = pRecoValue; 1698 1699 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 1699 1700 } … … 2897 2898 Void TEncSearch::xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiErr, Bool bHadamard ) 2898 2899 { 2900 #if !MERL_VSP_C0152 2899 2901 motionCompensation( pcCU, &m_tmpYuvPred, REF_PIC_LIST_X, iPartIdx ); 2900 2902 #endif 2901 2903 UInt uiAbsPartIdx = 0; 2902 2904 Int iWidth = 0; 2903 2905 Int iHeight = 0; 2904 2906 pcCU->getPartIndexAndSize( iPartIdx, uiAbsPartIdx, iWidth, iHeight ); 2905 2907 #if MERL_VSP_C0152 2908 motionCompensationBWVSP( pcCU, &m_tmpYuvPred, pcCU->getZorderIdxInCU(), REF_PIC_LIST_X, iPartIdx ); 2909 #endif 2906 2910 DistParam cDistParam; 2907 2911 … … 2943 2947 #else 2944 2948 #if LG_RESTRICTEDRESPRED_M24766 2949 #if MERL_VSP_C0152 2950 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost, Int* iVSPIndexTrue ) 2951 #else 2945 2952 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* rpcResiPredYuv, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) 2953 #endif 2946 2954 #else 2947 2955 Void TEncSearch::xMergeEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPUIdx, UInt& uiInterDir, TComMvField* pacMvField, UInt& uiMergeIndex, UInt& ruiCost ) … … 2988 2996 } 2989 2997 #else 2998 #if MERL_VSP_C0152 2999 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue ); 3000 #else 2990 3001 pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, uiDepth, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand ); 2991 3002 #endif 3003 #endif 3004 2992 3005 2993 3006 #if HHI_INTER_VIEW_MOTION_PRED … … 3009 3022 pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3010 3023 pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx ); 3024 #if MERL_VSP_C0152 3025 { 3026 Int iVSPIdx = 0; 3027 Int numVSPIdx; 3028 numVSPIdx = 3; 3029 for (Int i = 0; i < numVSPIdx; i++) 3030 { 3031 if (iVSPIndexTrue[i] == uiMergeCand) 3032 { 3033 iVSPIdx = i+1; 3034 break; 3035 } 3036 } 3037 pcCU->setVSPIndexSubParts( iVSPIdx, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) ); 3038 } 3039 #endif 3011 3040 #if LG_RESTRICTEDRESPRED_M24766 3012 3041 Int iAddResiShift; … … 3081 3110 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcResiPredYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG ) 3082 3111 #else 3083 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )3112 Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG) 3084 3113 #endif 3085 3114 #else … … 3185 3214 for (Int iNumRef=0; iNumRef < MAX_NUM_REF; iNumRef++) uiCostTempL0[iNumRef] = MAX_UINT; 3186 3215 UInt uiBitsTempL0[MAX_NUM_REF]; 3216 3187 3217 #if LG_RESTRICTEDRESPRED_M24766 3188 3218 Int iPUResiPredShift[4] = {0, 0, 0, 0}; … … 3191 3221 3192 3222 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iRoiWidth, iRoiHeight ); 3193 3223 #if MERL_VSP_C0152 3224 //reset the VSP flag to be 0 3225 pcCU->setVSPIndexSubParts( 0, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr) ); 3226 #endif 3194 3227 #if AMP_MRG 3195 3228 Bool bTestNormalMC = true; … … 3206 3239 Bool bLastResiFlag = false; 3207 3240 #endif 3241 3208 3242 // Uni-directional prediction 3209 3243 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) … … 3545 3579 xCheckBestMVP(pcCU, eRefPicList, cMvTemp[iRefList][iRefIdxTemp], cMvPredBi[iRefList][iRefIdxTemp], aaiMvpIdxBi[iRefList][iRefIdxTemp], uiBitsTemp, uiCostTemp); 3546 3580 } 3547 3581 3548 3582 if ( uiCostTemp < uiCostBi ) 3549 3583 { … … 3793 3827 TComMvField cMRGMvField[2]; 3794 3828 UInt uiMRGIndex = 0; 3795 3829 #if MERL_VSP_C0152 3830 Int iVSPIndexTrue[3] = {-1, -1, -1}; 3831 #endif 3796 3832 UInt uiMEInterDir = 0; 3797 3833 TComMvField cMEMvField[2]; … … 3844 3880 #else 3845 3881 #if LG_RESTRICTEDRESPRED_M24766 3882 #if MERL_VSP_C0152 3883 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost, iVSPIndexTrue ); 3884 #else 3846 3885 xMergeEstimation( pcCU, pcOrgYuv, rpcResiPredYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); 3886 #endif 3847 3887 #else 3848 3888 xMergeEstimation( pcCU, pcOrgYuv, iPartIdx, uiMRGInterDir, cMRGMvField, uiMRGIndex, uiMRGCost ); … … 3854 3894 pcCU->setMergeFlagSubParts ( true, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3855 3895 pcCU->setMergeIndexSubParts( uiMRGIndex, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3896 #if MERL_VSP_C0152 3897 { 3898 Int iVSPIdx = 0; 3899 Int numVSPIdx; 3900 numVSPIdx = 3; 3901 for (Int i = 0; i < numVSPIdx; i++) 3902 { 3903 if (iVSPIndexTrue[i] == uiMRGIndex) 3904 { 3905 iVSPIdx = i+1; 3906 break; 3907 } 3908 } 3909 pcCU->setVSPIndexSubParts( iVSPIdx, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3910 } 3911 #endif 3856 3912 pcCU->setInterDirSubParts ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3857 3913 { … … 3873 3929 pcCU->setMergeFlagSubParts( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3874 3930 pcCU->setInterDirSubParts ( uiMEInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3931 #if MERL_VSP_C0152 3932 pcCU->setVSPIndexSubParts ( 0 , uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 3933 #endif 3875 3934 { 3876 3935 pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMEMvField[0], ePartSize, uiPartAddr, 0, iPartIdx ); … … 3881 3940 3882 3941 // MC 3942 #if MERL_VSP_C0152 3943 motionCompensationBWVSP ( pcCU, rpcPredYuv, pcCU->getZorderIdxInCU(), REF_PIC_LIST_X, iPartIdx); 3944 #else 3883 3945 motionCompensation ( pcCU, rpcPredYuv, REF_PIC_LIST_X, iPartIdx ); 3884 3946 #endif 3885 3947 } // end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 3886 3948 … … 4338 4400 m_pcRdCost->setMultiviewReg( 0 ); 4339 4401 #endif 4402 4340 4403 setWpScalingDistParam( pcCU, iRefIdxPred, eRefPicList ); 4341 4404 // Do integer search … … 4351 4414 4352 4415 m_pcRdCost->getMotionCost( 1, 0 ); 4416 4353 4417 #if HHI_FULL_PEL_DEPTH_MAP_MV_ACC 4354 4418 if( ! pcCU->getSlice()->getIsDepth() ) … … 4378 4442 ruiCost += m_pcRdCost->getCost( uiMvBits ); 4379 4443 #endif 4380 4444 4381 4445 ruiBits += uiMvBits; 4382 4446 ruiCost = (UInt)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); … … 4723 4787 rcMvQter = *pcMvInt; rcMvQter <<= 1; // for mv-cost 4724 4788 rcMvQter += rcMvHalf; rcMvQter <<= 1; 4725 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter );4789 ruiCost = xPatternRefinement( pcPatternKey, baseRefMv, 1, rcMvQter); 4726 4790 } 4727 4791 … … 4758 4822 #endif 4759 4823 // No residual coding : SKIP mode 4760 if ( ePredMode == MODE_SKIP && bSkipRes)4824 if ( (ePredMode == MODE_SKIP && bSkipRes) ) 4761 4825 { 4762 4826 rpcYuvResi->clear();
Note: See TracChangeset for help on using the changeset viewer.