Changeset 1321 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSearch.cpp
- Timestamp:
- 7 Sep 2015, 18:16:33 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r1313 r1321 1530 1530 ) 1531 1531 { 1532 #if NH_MV 1532 1533 D_PRINT_INC_INDENT( g_traceModeCheck, "xRecurIntraCodingLumaQT; zeroResiFlag " + n2s(zeroResiFlag) ) 1534 #endif 1533 1535 1534 1536 TComDataCU *pcCU = rTu.getCU(); … … 1713 1715 dSingleCost = 0.0; 1714 1716 #if NH_3D_ENC_DEPTH 1715 #if NH_3D_ENC_DEPTH_FIX1716 1717 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), 0, zeroResiFlag ); 1717 #else1718 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag );1719 #endif1720 1718 #else 1721 1719 pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); … … 1841 1839 } 1842 1840 } 1841 #if NH_MV 1843 1842 D_DEC_INDENT( g_traceModeCheck ); 1843 #endif 1844 1844 return; 1845 1845 } … … 1888 1888 ruiDistY += uiSingleDistLuma; 1889 1889 dRDCost += dSingleCost; 1890 #if NH_MV 1890 1891 D_DEC_INDENT( g_traceModeCheck ); 1892 #endif 1891 1893 } 1892 1894 … … 1907 1909 TComTURecurse rTu(pcCU, 0); 1908 1910 const ChromaFormat chFmt = rTu.GetChromaFormat(); 1909 1911 DEBUG_STRING_NEW(sTemp) 1910 1912 if ( uiPredMode == 0 ) 1911 1913 { … … 2031 2033 TComTURecurse tuRecurseCU(pcCU, 0); 2032 2034 TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT); 2033 2035 DEBUG_STRING_NEW(sTemp) 2034 2036 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) ); 2035 2037 … … 2086 2088 2087 2089 //===== init pattern for luma prediction ===== 2088 2090 DEBUG_STRING_NEW(sTemp2) 2089 2091 initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) ); 2090 2092 … … 2212 2214 2213 2215 //===== determine distortion ===== 2214 #if NH_3D_INTRA_SDC_RD_FIX2215 2216 #if NH_3D_VSO 2216 2217 if( m_pcRdCost->getUseVSO() ) … … 2219 2220 } 2220 2221 else 2221 #endif2222 #else2223 #if NH_3D_VSO2224 if( m_pcRdCost->getUseVSO() )2225 {2226 if( m_pcRdCost->getUseEstimatedVSD() )2227 {2228 ruiDist = m_pcRdCost->getDistPartVSD( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );2229 }2230 else2231 {2232 ruiDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );2233 }2234 }2235 else2236 #endif2237 2222 #endif 2238 2223 { … … 2754 2739 Bool bLumaOnly ) 2755 2740 { 2741 #if NH_MV 2756 2742 D_PRINT_INC_INDENT(g_traceModeCheck, "estIntraPredDis"); 2743 #endif 2757 2744 2758 2745 UInt uiDepth = pcCU->getDepth(0); … … 2772 2759 for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ ) 2773 2760 { 2761 #if NH_MV 2774 2762 D_PRINT_INC_INDENT(g_traceModeCheck, "uiPredMode" + n2s(uiPredMode ) ); 2763 #endif 2775 2764 2776 2765 // set context models … … 2796 2785 pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight); 2797 2786 } 2787 #if NH_MV 2798 2788 D_DEC_INDENT( g_traceModeCheck ); 2789 #endif 2799 2790 } 2800 2791 … … 2807 2798 //===== set distortion (rate and r-d costs are determined later) ===== 2808 2799 pcCU->getTotalDistortion() = uiBestDist; 2800 #if NH_MV 2809 2801 D_DEC_INDENT( g_traceModeCheck ); 2802 #endif 2810 2803 } 2811 2804 #endif … … 2826 2819 ) 2827 2820 { 2821 #if NH_MV 2828 2822 D_PRINT_INC_INDENT( g_traceModeCheck, "estIntraPredLumaQT"); 2823 #endif 2829 2824 2830 2825 const UInt uiDepth = pcCU->getDepth(0); … … 2882 2877 { 2883 2878 const UInt uiPartOffset=tuRecurseWithPU.GetAbsPartIdxTU(); 2879 #if NH_MV 2884 2880 D_PRINT_INC_INDENT(g_traceModeCheck, "uiPartOffset: " + n2s(uiPartOffset ) ); 2881 #endif 2885 2882 2886 2883 // for( UInt uiPU = 0, uiPartOffset=0; uiPU < uiNumPU; uiPU++, uiPartOffset += uiQNumParts ) … … 2927 2924 m_pcRdCost->setDistParam(distParam, sps.getBitDepth(CHANNEL_TYPE_LUMA), piOrg, uiStride, piPred, uiStride, puRect.width, puRect.height, bUseHadamard); 2928 2925 2929 #if NH_3D _IC_FIX2926 #if NH_3D 2930 2927 distParam.bUseIC = false; 2931 2928 #endif … … 2940 2937 Distortion uiSad = 0; 2941 2938 #endif 2939 #if NH_MV 2942 2940 D_PRINT_INC_INDENT(g_traceModeCheck, "preTest; uiMode " + n2s(uiMode) ); 2941 #endif 2943 2942 2944 2943 const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()); … … 2993 2992 2994 2993 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList ); 2994 #if NH_MV 2995 2995 D_DEC_INDENT( g_traceModeCheck ); 2996 #endif 2996 2997 } 2997 2998 … … 3193 3194 #endif 3194 3195 3196 #if NH_MV 3195 3197 D_PRINT_INC_INDENT(g_traceModeCheck, "Test; uiOrgMode: " + n2s(uiOrgMode) ); 3198 #endif 3196 3199 3197 3200 pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); … … 3395 3398 } // SDC loop 3396 3399 #endif 3400 #if NH_MV 3397 3401 D_DEC_INDENT( g_traceModeCheck ); 3402 #endif 3398 3403 } // Mode loop 3399 3404 … … 3554 3559 pcCU->setSDCFlagSubParts ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth ); 3555 3560 #endif 3561 #if NH_MV 3556 3562 D_DEC_INDENT( g_traceModeCheck ); 3563 #endif 3557 3564 } while (tuRecurseWithPU.nextSection(tuRecurseCU)); 3558 3565 … … 3583 3590 //===== set distortion (rate and r-d costs are determined later) ===== 3584 3591 pcCU->getTotalDistortion() = uiOverallDistY; 3592 #if NH_MV 3585 3593 D_DEC_INDENT( g_traceModeCheck ); 3594 #endif 3586 3595 } 3587 3596 … … 3892 3901 ) 3893 3902 { 3903 #if NH_MV 3894 3904 D_PRINT_INC_INDENT(g_traceModeCheck, "xMergeEstimation" ); 3905 #endif 3895 3906 3896 3907 UInt uiAbsPartIdx = 0; … … 4014 4025 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 4015 4026 { 4027 #if NH_MV 4016 4028 D_PRINT_INC_INDENT(g_traceModeCheck, "uiMergeCand: " + n2s(uiMergeCand) ); 4029 #endif 4017 4030 Distortion uiCostCand = std::numeric_limits<Distortion>::max(); 4018 4031 UInt uiBitsCand = 0; … … 4092 4105 uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand ); 4093 4106 4107 #if NH_MV 4094 4108 D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: " + n2s(uiCostCand)); 4109 #endif 4095 4110 4096 4111 if ( uiCostCand < ruiCost ) … … 4102 4117 uiMergeIndex = uiMergeCand; 4103 4118 } 4119 #if NH_MV 4104 4120 D_DEC_INDENT( g_traceModeCheck ); 4105 } 4121 #endif 4122 } 4123 #if NH_MV 4106 4124 D_DEC_INDENT( g_traceModeCheck ); 4125 #endif 4107 4126 } 4108 4127 … … 4142 4161 { 4143 4162 4163 #if NH_MV 4144 4164 D_PRINT_INC_INDENT(g_traceModeCheck, "predInterSearch"); 4165 #endif 4145 4166 4146 4167 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) … … 4210 4231 for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 4211 4232 { 4233 #if NH_MV 4212 4234 D_PRINT_INC_INDENT(g_traceModeCheck, "iPartIdx: " + n2s(iPartIdx) ); 4235 #endif 4213 4236 4214 4237 Distortion uiCost[2] = { std::numeric_limits<Distortion>::max(), std::numeric_limits<Distortion>::max() }; … … 4258 4281 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) 4259 4282 { 4283 #if NH_MV 4260 4284 D_PRINT_INC_INDENT(g_traceModeCheck, "iRefList: " + n2s(iRefList) ); 4285 #endif 4261 4286 4262 4287 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); … … 4264 4289 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 4265 4290 { 4291 #if NH_MV 4266 4292 D_PRINT_INC_INDENT(g_traceModeCheck, "iRefIdxTemp: " + n2s(iRefIdxTemp) ); 4293 #endif 4267 4294 4268 4295 uiBitsTemp = uiMbBits[iRefList]; … … 4338 4365 refIdxValidList1 = iRefIdxTemp; 4339 4366 } 4367 #if NH_MV 4340 4368 D_DEC_INDENT( g_traceModeCheck ); 4341 } 4369 #endif 4370 } 4371 #if NH_MV 4342 4372 D_DEC_INDENT( g_traceModeCheck ); 4373 #endif 4343 4374 } 4344 4375 … … 4609 4640 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 4610 4641 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 4642 #if NH_MV 4611 4643 D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: " + n2s(uiMECost)); 4644 #endif 4612 4645 } 4613 4646 #else … … 4756 4789 // MC 4757 4790 motionCompensation ( pcCU, pcPredYuv, REF_PIC_LIST_X, iPartIdx ); 4791 #if NH_MV 4758 4792 D_DEC_INDENT( g_traceModeCheck ); 4793 #endif 4759 4794 } // end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 4760 4795 4761 4796 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 4762 4797 4798 #if NH_MV 4763 4799 D_DEC_INDENT( g_traceModeCheck ); 4800 #endif 4764 4801 return; 4765 4802 } … … 4769 4806 Void TEncSearch::xEstimateMvPredAMVP( TComDataCU* pcCU, TComYuv* pcOrgYuv, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred, Bool bFilled, Distortion* puiDistBiP ) 4770 4807 { 4808 #if NH_MV 4771 4809 D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateMvPredAMVP"); 4810 #endif 4772 4811 4773 4812 AMVPInfo* pcAMVPInfo = pcCU->getCUMvField(eRefPicList)->getAMVPInfo(); … … 4847 4886 if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefPicList==REF_PIC_LIST_1) 4848 4887 { 4888 #if NH_MV 4849 4889 D_PRINT_INC_INDENT(g_traceModeCheck, "Init"); 4890 #endif 4850 4891 4851 4892 (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight); 4852 4893 4894 #if NH_MV 4853 4895 D_DEC_INDENT( g_traceModeCheck ); 4896 #endif 4854 4897 } 4855 4898 return; … … 4867 4910 for ( i = 0 ; i < pcAMVPInfo->iN; i++) 4868 4911 { 4912 #if NH_MV 4869 4913 D_PRINT_INC_INDENT(g_traceModeCheck, "Cand i=" + n2s(i) + " X: " + n2s( pcAMVPInfo->m_acMvCand[i].getHor() ) + " Y: " + n2s( pcAMVPInfo->m_acMvCand[i].getVer() )); 4914 #endif 4870 4915 4871 4916 Distortion uiTmpCost; … … 4879 4924 } 4880 4925 4926 #if NH_MV 4881 4927 D_DEC_INDENT( g_traceModeCheck ); 4928 #endif 4882 4929 } 4883 4930 … … 4889 4936 pcCU->setMVPNumSubParts( pcAMVPInfo->iN, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr)); 4890 4937 4938 #if NH_MV 4891 4939 D_DEC_INDENT( g_traceModeCheck ); 4940 #endif 4892 4941 4893 4942 return; … … 5094 5143 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, Distortion& ruiCost, Bool bBi ) 5095 5144 { 5145 #if NH_MV 5096 5146 D_PRINT_INC_INDENT(g_traceModeCheck, "xMotionEstimation"); 5147 #endif 5097 5148 5098 5149 UInt uiPartAddr; … … 5227 5278 ruiCost = (Distortion)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); 5228 5279 5280 #if NH_MV 5229 5281 D_PRINT_INDENT(g_traceRDCost, "ME Cost:" + n2s(ruiCost) ); 5230 5282 D_DEC_INDENT ( g_traceModeCheck ); 5283 #endif 5231 5284 } 5232 5285 … … 5788 5841 Bool bSkipResidual DEBUG_STRING_FN_DECLARE(sDebug) ) 5789 5842 { 5843 #if NH_MV 5790 5844 D_PRINT_INC_INDENT(g_traceModeCheck, "encodeResAndCalcRdInterCU; Skip residual: " + n2s(bSkipResidual)); 5845 #endif 5791 5846 5792 5847 assert ( !pcCU->isIntra(0) ); … … 5883 5938 } 5884 5939 #endif 5940 #if NH_MV 5885 5941 D_DEC_INDENT( g_traceModeCheck ); 5942 #endif 5886 5943 5887 5944 return; … … 6049 6106 } 6050 6107 #endif 6108 #if NH_MV 6051 6109 D_DEC_INDENT( g_traceModeCheck ); 6110 #endif 6052 6111 } 6053 6112 … … 6207 6266 DEBUG_STRING_FN_DECLARE(sDebug) ) 6208 6267 { 6268 #if NH_MV 6209 6269 D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateInterResidualQT"); 6270 #endif 6210 6271 6211 6272 TComDataCU *pcCU = rTu.getCU(); … … 6260 6321 if( bCheckFull ) 6261 6322 { 6323 #if NH_MV 6262 6324 D_PRINT_INC_INDENT(g_traceModeCheck, "bCheckFull" ); 6325 #endif 6263 6326 6264 6327 Double minCost[MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/]; … … 6349 6412 for (Int transformSkipModeId = 0; transformSkipModeId < transformSkipModesToTest; transformSkipModeId++) 6350 6413 { 6414 #if NH_MV 6351 6415 D_PRINT_INC_INDENT( g_traceModeCheck && ( transformSkipModeId > 0) , "TransformSkipModeId: " + n2s(transformSkipModeId) ); 6416 #endif 6352 6417 6353 6418 pcCU->setTransformSkipPartRange(transformSkipModeId, compID, subTUAbsPartIdx, partIdxesPerSubTU); … … 6358 6423 const Bool bUseCrossCPrediction = crossCPredictionModeId != 0; 6359 6424 6425 #if NH_MV 6360 6426 D_PRINT_INC_INDENT( g_traceModeCheck, "Zero" ); 6427 #endif 6361 6428 6362 6429 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] ); … … 6511 6578 } 6512 6579 6580 6513 6581 DEBUG_STRING_NEW(sSingleStringTest) 6514 6515 D_DEC_INDENT( g_traceModeCheck );6516 6582 #if NH_MV 6583 D_DEC_INDENT( g_traceModeCheck ); 6584 #endif 6517 6585 if( currAbsSum > 0 ) //if non-zero coefficients are present, a residual needs to be derived for further prediction 6518 6586 { 6587 #if NH_MV 6519 6588 D_PRINT_INC_INDENT(g_traceModeCheck, "NonZero"); 6589 #endif 6520 6590 6521 6591 if (isFirstMode) … … 6611 6681 currCompCost = nonCoeffCost; 6612 6682 } 6683 #if NH_MV 6613 6684 D_DEC_INDENT( g_traceModeCheck ); 6685 #endif 6614 6686 6615 6687 // evaluate … … 6689 6761 } 6690 6762 } 6763 #if NH_MV 6691 6764 D_DEC_INDENT( g_traceModeCheck ); 6765 #endif 6692 6766 } 6693 6767 … … 6700 6774 } // component loop 6701 6775 6776 #if NH_MV 6702 6777 D_PRINT_INC_INDENT(g_traceModeCheck, "Final"); 6778 #endif 6703 6779 6704 6780 for(UInt ch = 0; ch < numValidComp; ch++) … … 6758 6834 dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDist ); 6759 6835 6836 #if NH_MV 6760 6837 D_DEC_INDENT( g_traceModeCheck ); 6761 6838 D_DEC_INDENT( g_traceModeCheck ); 6839 #endif 6762 6840 } // check full 6763 6841 … … 6765 6843 if( bCheckSplit ) 6766 6844 { 6845 #if NH_MV 6767 6846 D_PRINT_INC_INDENT(g_traceModeCheck, "bCheckSplit" ); 6847 #endif 6768 6848 if( bCheckFull ) 6769 6849 { … … 6935 7015 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_TEST ] ); 6936 7016 } 7017 #if NH_MV 6937 7018 D_DEC_INDENT( g_traceModeCheck ); 7019 #endif 6938 7020 } 6939 7021 else … … 6955 7037 #endif 6956 7038 } 7039 #if NH_MV 6957 7040 D_DEC_INDENT( g_traceModeCheck ); 7041 #endif 6958 7042 DEBUG_STRING_APPEND(sDebug, debug_reorder_data_inter_token[MAX_NUM_COMPONENT]) 7043 6959 7044 } 6960 7045
Note: See TracChangeset for help on using the changeset viewer.