Changeset 1309 in 3DVCSoftware
- Timestamp:
- 11 Aug 2015, 15:45:37 (9 years ago)
- Location:
- branches/HTM-14.1-update-dev1/source/Lib
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRdCost.cpp
r1304 r1309 133 133 } 134 134 135 D_PRINT_INDENT( g_traceRDCost, "Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost)); 135 136 return dRdCost; 136 137 } … … 3684 3685 } 3685 3686 3687 D_PRINT_INDENT( g_traceRDCost, "VSO Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost)); 3688 3686 3689 return dRdCost; 3687 3690 } -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.cpp
r1306 r1309 546 546 Bool g_disableNumbering = false; 547 547 Bool g_disableHLSTrace = false; 548 UInt64 g_stopAtCounter = 4660; 549 Bool g_traceCopyBack = false; 550 Bool g_decTraceDispDer = false; 551 Bool g_decTraceMvFromMerge = false; 552 Bool g_decTracePicOutput = false; 553 Bool g_stopAtPos = false; 554 Bool g_outputPos = false; 555 Bool g_traceCameraParameters = false; 556 Bool g_encNumberOfWrittenBits = false; 548 UInt64 g_stopAtCounter = 4660; 549 Bool g_traceCopyBack = false; 550 Bool g_decTraceDispDer = false; 551 Bool g_decTraceMvFromMerge = false; 552 Bool g_decTracePicOutput = false; 553 Bool g_startStopTrace = true; 554 Bool g_outputPos = false; 555 Bool g_traceCameraParameters = false; 556 Bool g_encNumberOfWrittenBits = false; 557 Bool g_traceEncFracBits = false; 558 Bool g_traceIntraSearchCost = false; 559 Bool g_traceRDCost = false; 560 Bool g_traceSAOCost = false; 561 Bool g_traceModeCheck = false; 562 UInt g_indent = false; 557 563 #endif 558 564 #endif … … 685 691 << std::endl; 686 692 } 687 Bool stopFlag = false; 688 if ( g_stopAtPos && poc == 0 && layerId == 2 ) 689 { 690 Bool stopAtCU = true; 691 if ( stopAtCU ) // Stop at CU with specific size 692 { 693 stopFlag = ( cuPelX == 416 ) && ( cuPelY == 632 ) && ( cuWidth == 8 ) && ( cuHeight == 8 ); 694 } 695 else 696 { // Stop at specific position 697 Int xPos = 888; 698 Int yPos = 248; 699 Int cuPelXEnd = cuPelX + cuWidth - 1; 700 Int cuPelYEnd = cuPelY + cuHeight - 1; 701 stopFlag = (cuPelX <= xPos ) && (cuPelXEnd >= xPos ) && (cuPelY <= yPos ) && (cuPelYEnd >= yPos ); 702 } 703 } 704 if ( stopFlag ) 705 { // Set breakpoint here. 706 std::cout << "Stop position. Break point here." << std::endl; 693 694 Bool startTrace = false; 695 if ( g_startStopTrace && poc == 0 && layerId == 0 ) 696 { 697 startTrace = ( cuPelX == 0 ) && ( cuPelY == 0 ) && ( cuWidth == 64 ) && ( cuHeight == 64 ); 698 } 699 if ( startTrace ) 700 { 701 g_outputPos = true; 702 g_traceEncFracBits = false; 703 g_traceIntraSearchCost = false; 704 g_encNumberOfWrittenBits = false; 705 g_traceRDCost = true; 706 g_traceModeCheck = true; 707 g_traceCopyBack = false; 708 } 709 710 Bool stopTrace = false; 711 if ( g_startStopTrace && poc == 0 && layerId == 0 ) 712 { 713 stopTrace = ( cuPelX == 128 ) && ( cuPelY == 0 ) && ( cuWidth == 64 ) && ( cuHeight == 64 ); 714 } 715 if ( stopTrace ) 716 { 717 g_outputPos = false; 718 g_traceModeCheck = false; 719 g_traceEncFracBits = false; 720 g_traceIntraSearchCost = false; 721 g_encNumberOfWrittenBits = false; 722 g_traceRDCost = false; 723 g_traceCopyBack = false; 707 724 } 708 725 } … … 738 755 } 739 756 } 757 Void printStr( std::string str ) 758 { 759 std::cout << str << std::endl; 760 } 761 Void printStrIndent( Bool b, std::string strStr ) 762 { 763 if ( b ) 764 { 765 std::cout << std::string(g_indent, ' '); 766 printStr( strStr ); 767 } 768 } 769 770 Void prinStrIncIndent( Bool b, std::string strStr ) 771 { 772 if ( b ) 773 { 774 printStrIndent( true, strStr ); 775 if (g_indent < 50) 776 { 777 g_indent++; 778 } 779 } 780 } 781 782 Void decIndent( Bool b ) 783 { 784 if (b && g_indent > 0) 785 { 786 g_indent--; 787 } 788 } 789 740 790 #endif 741 791 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.h
r1282 r1309 183 183 extern Bool g_decTraceMvFromMerge; // Trace motion vectors obtained from merge (decoder only) 184 184 extern Bool g_decTracePicOutput; // Trace output of pictures 185 extern Bool g_st opAtPos; // Stop at position185 extern Bool g_startStopTrace; // Stop at position 186 186 extern Bool g_outputPos; // Output position 187 187 extern Bool g_traceCameraParameters; // Trace camera parameters 188 188 extern Bool g_encNumberOfWrittenBits;// Trace number of written bits 189 extern Bool g_traceEncFracBits; // Trace fractional bits 190 extern Bool g_traceIntraSearchCost; // Trace intra mode cost 191 extern Bool g_traceRDCost; 192 extern Bool g_traceModeCheck; 193 extern Bool g_traceSAOCost; 194 extern UInt g_indent; 189 195 #define DTRACE_CU(x,y) writeToTraceFile( x,y, g_traceCU ); 190 196 #define DTRACE_PU(x,y) writeToTraceFile( x,y, g_tracePU ); … … 193 199 #define DTRACE_PU_S(x) writeToTraceFile( x, g_tracePU ); 194 200 #define DTRACE_TU_S(x) writeToTraceFile( x, g_traceTU ); 201 202 #define D_DEC_INDENT( b ) decIndent ( b ); 203 #define D_PRINT_INC_INDENT( b, str ) prinStrIncIndent( b, str ); 204 #define D_PRINT_INDENT( b, str ) printStrIndent ( b, str); 205 195 206 Void tracePSHeader ( const Char* psName, Int layerId ); 196 207 Void writeToTraceFile( const Char* symbolName, Int val, Bool doIt ); … … 198 209 UInt64 incSymbolCounter(); 199 210 Void stopAtPos ( Int poc, Int layerId, Int cuPelX, Int cuPelY, Int cuWidth, Int cuHeight ); 211 212 Void printStr ( std::string str ); 213 Void printStrIndent ( Bool b, std::string str ); 214 Void prinStrIncIndent ( Bool b, std::string str ); 215 Void decIndent ( Bool b ); 216 217 template <typename T> 218 std::string n2s ( T Number ) 219 { 220 std::ostringstream ss; 221 ss << Number; 222 return ss.str(); 223 }; 224 200 225 #endif 201 226 #else … … 214 239 #define DTRACE_PU_S(x) ; 215 240 #define DTRACE_TU_S(x) ; 241 242 #define D_DEC_INDENT( b ) ; 243 #define D_PRINT_INC_INDENT( b, str ); 244 #define D_PRINT_INDENT( b, str ); 245 216 246 #endif 217 247 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComYuv.cpp
r1279 r1309 125 125 ::memcpy( pDst, pSrc, sizeof(Pel)*iWidth); 126 126 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 127 if ( g_traceCopyBack && g_nSymbolCounter >= g_stopAtCounter)127 if ( g_traceCopyBack && compID == COMPONENT_Y) 128 128 { 129 std::stringstream strStr; 129 130 for ( Int x = 0; x < iWidth; x++) 130 131 { 131 st d::cout<< pSrc[ x ] << " " ;132 } 133 std::cout << std::endl;132 strStr << pSrc[ x ] << " " ; 133 } 134 printStrIndent( true, strStr.str() ); 134 135 } 135 136 #endif -
branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TypeDef.h
r1308 r1309 66 66 ///////////////////////////////////////////////////////////////////////////////////////// 67 67 #if NH_MV 68 #define NH_3D_INTRA_SDC_RD_FIX 1 // Fix in RD- decsion of intra sdc. 68 #define NH_3D_DIS_FIX 1 69 #define NH_3D_ENC_DEPTH_FIX 1 // Fix Intra TU coding. 70 #define NH_3D_INTRA_SDC_RD_FIX 1 // Fix in RD- decision of intra SDC. 69 71 #define NH_3D_DLT_FIX 1 // Fixes numbers of parsed DLTs 70 72 #define NH_3D_VER141_DEC_COMP_FLAG 0 // Makes decoding of this version compatible to HTM-14.1 by re-introducing HTM-14.1 bugs. -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncBinCoderCABAC.cpp
r1200 r1309 156 156 #if FAST_BIT_EST 157 157 m_fracBits = pcTEncBinCABAC->m_fracBits; 158 D_PRINT_INDENT(g_traceEncFracBits, "CopyState " + n2s(m_fracBits) ); 158 159 #endif 159 160 } … … 170 171 } 171 172 #if FAST_BIT_EST 173 D_PRINT_INDENT( g_traceEncFracBits, "Reset Bits Before" + n2s(m_fracBits) ); 172 174 m_fracBits &= 32767; 175 D_PRINT_INDENT( g_traceEncFracBits, "Reset Bits " + n2s(m_fracBits) ); 173 176 #endif 174 177 } -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp
r1200 r1309 59 59 m_pcTComBitIf->write(0, UInt(m_fracBits >> 15) ); 60 60 m_fracBits &= 32767; 61 D_PRINT_INDENT( g_traceEncFracBits, "Finish " + n2s(m_fracBits) ); 61 62 } 62 63 … … 80 81 m_uiBinsCoded += m_binCountIncrement; 81 82 m_fracBits += rcCtxModel.getEntropyBits( binValue ); 83 D_PRINT_INDENT( g_traceEncFracBits, "EncodeBin " + n2s(m_fracBits) ); 84 82 85 rcCtxModel.update( binValue ); 83 86 … … 110 113 m_uiBinsCoded += m_binCountIncrement; 111 114 m_fracBits += 32768; 115 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinEP " + n2s(m_fracBits) ); 112 116 } 113 117 … … 122 126 m_uiBinsCoded += numBins & -m_binCountIncrement; 123 127 m_fracBits += 32768 * numBins; 128 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinsEP " + n2s(m_fracBits) ); 124 129 } 125 130 … … 133 138 m_uiBinsCoded += m_binCountIncrement; 134 139 m_fracBits += ContextModel::getEntropyBitsTrm( binValue ); 140 D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinTrm " + n2s(m_fracBits) ); 135 141 } 136 142 … … 138 144 { 139 145 m_fracBits = (m_fracBits + 32767) & (~32767); 146 D_PRINT_INDENT( g_traceEncFracBits, "Align " + n2s(m_fracBits) ); 140 147 } 141 148 -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp
r1307 r1309 1784 1784 return; // never check merge in fast deltaqp mode 1785 1785 } 1786 1787 D_PRINT_INC_INDENT( g_traceModeCheck, "xCheckRDCostMerge2Nx2N" ); 1788 1786 1789 #if NH_3D_MLC 1787 1790 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists … … 1967 1970 for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual ) 1968 1971 { 1972 D_PRINT_INC_INDENT ( g_traceModeCheck, "uiNoResidual: " + n2s( uiNoResidual) ); 1973 1969 1974 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 1970 1975 { … … 1978 1983 } 1979 1984 #endif 1985 D_PRINT_INC_INDENT ( g_traceModeCheck, "uiMergeCand: "+ n2s(uiMergeCand) ); 1980 1986 1981 1987 if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1)) … … 2191 2197 } 2192 2198 } 2199 D_DEC_INDENT( g_traceModeCheck ); 2193 2200 } 2194 2201 … … 2222 2229 } 2223 2230 } 2231 D_DEC_INDENT( g_traceModeCheck ); 2224 2232 } 2225 2233 DEBUG_STRING_APPEND(sDebug, bestStr) … … 2231 2239 delete[] puhInterDirSP; 2232 2240 #endif 2241 D_DEC_INDENT( g_traceModeCheck ); 2233 2242 } 2234 2243 … … 2255 2264 } 2256 2265 } 2266 2267 D_PRINT_INC_INDENT(g_traceModeCheck, "xCheckRDCostInter; ePartSize:" + n2s( ePartSize) ); 2268 2257 2269 2258 2270 // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode ); … … 2342 2354 { 2343 2355 #if NH_3D_ARP 2344 if( nARPWMax ) 2345 { 2346 continue; 2347 } 2348 else 2349 #endif 2350 return; 2356 if( nARPWMax ) 2357 { 2358 continue; 2359 } 2360 else 2361 #endif 2362 { 2363 D_DEC_INDENT( g_traceModeCheck ); 2364 return; 2365 } 2351 2366 } 2352 2367 #endif … … 2464 2479 } 2465 2480 #endif 2481 D_DEC_INDENT( g_traceModeCheck ); 2466 2482 } 2467 2483 … … 2675 2691 } 2676 2692 2693 D_PRINT_INC_INDENT(g_traceModeCheck, "xCheckRDCostDIS" ); 2694 2677 2695 #if NH_3D_VSO // M5 2678 2696 if( m_pcRdCost->getUseRenModel() ) … … 2735 2753 xCheckDQP( rpcTempCU ); 2736 2754 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest) ); 2755 D_DEC_INDENT( g_traceModeCheck ); 2737 2756 } 2738 2757 #endif … … 2758 2777 } 2759 2778 } 2760 2779 D_PRINT_INC_INDENT (g_traceModeCheck, "xCheckRDCostIntra; eSize: " + n2s(eSize) ); 2780 2761 2781 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2762 2782 #if NH_3D_VSO // M5 … … 2810 2830 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2811 2831 } 2812 #if NH_3D_DIS 2832 #if NH_3D_DIS && !NH_3D_DIS_FIX 2813 2833 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2814 2834 if(!rpcTempCU->getDISFlag(0)) … … 2816 2836 #endif 2817 2837 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2838 #if NH_3D_DIS_FIX 2839 m_pcEntropyCoder->encodeDIS( rpcTempCU, 0, true ); 2840 if(!rpcTempCU->getDISFlag(0)) 2841 { 2842 #endif 2818 2843 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2819 2844 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); … … 2851 2876 2852 2877 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest)); 2853 } 2878 2879 D_DEC_INDENT( g_traceModeCheck ); 2880 } 2854 2881 2855 2882 … … 3029 3056 m_ppcRecoYuvBest[uiSrcDepth]->copyToPicYuv( rpcPic->getPicYuvRec (), uiCUAddr, uiAbsPartIdx, uiDepth - uiSrcDepth, uiPartIdx); 3030 3057 3058 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 3059 Bool oldtraceCopyBack = g_traceCopyBack; 3060 g_traceCopyBack = false; 3061 #endif 3031 3062 m_ppcPredYuvBest[uiSrcDepth]->copyToPicYuv( rpcPic->getPicYuvPred (), uiCUAddr, uiAbsPartIdx, uiDepth - uiSrcDepth, uiPartIdx); 3063 3064 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 3065 g_traceCopyBack = oldtraceCopyBack; 3066 #endif 3032 3067 } 3033 3068 -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncEntropy.cpp
r1304 r1309 795 795 Void TEncEntropy::encodeCoeffNxN( TComTU &rTu, TCoeff* pcCoef, const ComponentID compID) 796 796 { 797 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 798 Bool oldTraceFracBits = g_traceEncFracBits; 799 g_traceEncFracBits = false; 800 #endif 801 797 802 TComDataCU *pcCU = rTu.getCU(); 798 803 … … 822 827 } 823 828 } 829 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 830 g_traceEncFracBits = oldTraceFracBits; 831 #endif 824 832 } 825 833 -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncEntropy.h
r1304 r1309 139 139 Void setBitstream ( TComBitIf* p ) { m_pcEntropyCoderIf->setBitstream(p); } 140 140 Void resetBits () { m_pcEntropyCoderIf->resetBits(); } 141 UInt getNumberOfWrittenBits () 142 { 143 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 144 Bool oldJustDoIt = g_bJustDoIt; 145 g_bJustDoIt = true; 146 writeToTraceFile( "NumberOfWrittenBits", m_pcEntropyCoderIf->getNumberOfWrittenBits(), g_encNumberOfWrittenBits ); 147 g_bJustDoIt = oldJustDoIt; 148 #endif 141 UInt getNumberOfWrittenBits () { 142 D_PRINT_INDENT(g_encNumberOfWrittenBits, "NumBits: " + n2s( m_pcEntropyCoderIf->getNumberOfWrittenBits() )) 149 143 return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } 150 144 Void resetEntropy (const TComSlice *pSlice) { m_pcEntropyCoderIf->resetEntropy(pSlice); } -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp
r1200 r1309 826 826 } 827 827 828 D_PRINT_INDENT( g_traceSAOCost, "SAO mode " + n2s( mode ) + " Cost: " + n2s( modeCost) ); 829 828 830 if(modeCost < minCost) 829 831 { -
branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSearch.cpp
r1308 r1309 1530 1530 ) 1531 1531 { 1532 D_PRINT_INC_INDENT( g_traceModeCheck, "xRecurIntraCodingLumaQT; zeroResiFlag " + n2s(zeroResiFlag) ) 1533 1532 1534 TComDataCU *pcCU = rTu.getCU(); 1533 1535 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); … … 1711 1713 dSingleCost = 0.0; 1712 1714 #if NH_3D_ENC_DEPTH 1715 #if NH_3D_ENC_DEPTH_FIX 1716 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), 0, zeroResiFlag ); 1717 #else 1713 1718 xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag ); 1719 #endif 1714 1720 #else 1715 1721 pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan ); … … 1835 1841 } 1836 1842 } 1837 1843 D_DEC_INDENT( g_traceModeCheck ); 1838 1844 return; 1839 1845 } … … 1882 1888 ruiDistY += uiSingleDistLuma; 1883 1889 dRDCost += dSingleCost; 1890 D_DEC_INDENT( g_traceModeCheck ); 1884 1891 } 1885 1892 … … 2747 2754 Bool bLumaOnly ) 2748 2755 { 2756 D_PRINT_INC_INDENT(g_traceModeCheck, "estIntraPredDis"); 2757 2749 2758 UInt uiDepth = pcCU->getDepth(0); 2750 2759 UInt uiWidth = pcCU->getWidth (0); … … 2763 2772 for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ ) 2764 2773 { 2774 D_PRINT_INC_INDENT(g_traceModeCheck, "uiPredMode" + n2s(uiPredMode ) ); 2775 2765 2776 // set context models 2766 2777 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); … … 2785 2796 pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight); 2786 2797 } 2798 D_DEC_INDENT( g_traceModeCheck ); 2787 2799 } 2788 2800 … … 2795 2807 //===== set distortion (rate and r-d costs are determined later) ===== 2796 2808 pcCU->getTotalDistortion() = uiBestDist; 2809 D_DEC_INDENT( g_traceModeCheck ); 2797 2810 } 2798 2811 #endif … … 2813 2826 ) 2814 2827 { 2828 D_PRINT_INC_INDENT( g_traceModeCheck, "estIntraPredLumaQT"); 2829 2815 2830 const UInt uiDepth = pcCU->getDepth(0); 2816 2831 const UInt uiInitTrDepth = pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1; … … 2867 2882 { 2868 2883 const UInt uiPartOffset=tuRecurseWithPU.GetAbsPartIdxTU(); 2884 D_PRINT_INC_INDENT(g_traceModeCheck, "uiPartOffset: " + n2s(uiPartOffset ) ); 2885 2869 2886 // for( UInt uiPU = 0, uiPartOffset=0; uiPU < uiNumPU; uiPU++, uiPartOffset += uiQNumParts ) 2870 2887 //{ … … 2923 2940 Distortion uiSad = 0; 2924 2941 #endif 2942 D_PRINT_INC_INDENT(g_traceModeCheck, "preTest; uiMode " + n2s(uiMode) ); 2925 2943 2926 2944 const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag()); … … 2975 2993 2976 2994 CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList ); 2995 D_DEC_INDENT( g_traceModeCheck ); 2977 2996 } 2978 2997 … … 3173 3192 } 3174 3193 #endif 3194 3195 D_PRINT_INC_INDENT(g_traceModeCheck, "Test; uiOrgMode: " + n2s(uiOrgMode) ); 3175 3196 3176 3197 pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth ); … … 3374 3395 } // SDC loop 3375 3396 #endif 3376 3397 D_DEC_INDENT( g_traceModeCheck ); 3377 3398 } // Mode loop 3378 3399 … … 3533 3554 pcCU->setSDCFlagSubParts ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth ); 3534 3555 #endif 3535 3556 D_DEC_INDENT( g_traceModeCheck ); 3536 3557 } while (tuRecurseWithPU.nextSection(tuRecurseCU)); 3537 3558 … … 3562 3583 //===== set distortion (rate and r-d costs are determined later) ===== 3563 3584 pcCU->getTotalDistortion() = uiOverallDistY; 3585 D_DEC_INDENT( g_traceModeCheck ); 3564 3586 } 3565 3587 … … 3870 3892 ) 3871 3893 { 3894 D_PRINT_INC_INDENT(g_traceModeCheck, "xMergeEstimation" ); 3895 3872 3896 UInt uiAbsPartIdx = 0; 3873 3897 Int iWidth = 0; … … 3990 4014 for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand ) 3991 4015 { 4016 D_PRINT_INC_INDENT(g_traceModeCheck, "uiMergeCand: " + n2s(uiMergeCand) ); 3992 4017 Distortion uiCostCand = std::numeric_limits<Distortion>::max(); 3993 4018 UInt uiBitsCand = 0; … … 4066 4091 } 4067 4092 uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand ); 4093 4094 D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: " + n2s(uiCostCand)); 4095 4068 4096 if ( uiCostCand < ruiCost ) 4069 4097 { … … 4074 4102 uiMergeIndex = uiMergeCand; 4075 4103 } 4076 } 4104 D_DEC_INDENT( g_traceModeCheck ); 4105 } 4106 D_DEC_INDENT( g_traceModeCheck ); 4077 4107 } 4078 4108 … … 4111 4141 #endif 4112 4142 { 4143 4144 D_PRINT_INC_INDENT(g_traceModeCheck, "predInterSearch"); 4145 4113 4146 for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++) 4114 4147 { … … 4177 4210 for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 4178 4211 { 4212 D_PRINT_INC_INDENT(g_traceModeCheck, "iPartIdx: " + n2s(iPartIdx) ); 4213 4179 4214 Distortion uiCost[2] = { std::numeric_limits<Distortion>::max(), std::numeric_limits<Distortion>::max() }; 4180 4215 Distortion uiCostBi = std::numeric_limits<Distortion>::max(); … … 4223 4258 for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ ) 4224 4259 { 4260 D_PRINT_INC_INDENT(g_traceModeCheck, "iRefList: " + n2s(iRefList) ); 4261 4225 4262 RefPicList eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 ); 4226 4263 4227 4264 for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ ) 4228 4265 { 4266 D_PRINT_INC_INDENT(g_traceModeCheck, "iRefIdxTemp: " + n2s(iRefIdxTemp) ); 4267 4229 4268 uiBitsTemp = uiMbBits[iRefList]; 4230 4269 if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 ) … … 4299 4338 refIdxValidList1 = iRefIdxTemp; 4300 4339 } 4301 } 4340 D_DEC_INDENT( g_traceModeCheck ); 4341 } 4342 D_DEC_INDENT( g_traceModeCheck ); 4302 4343 } 4303 4344 … … 4568 4609 xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() ); 4569 4610 uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits ); 4611 D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: " + n2s(uiMECost)); 4570 4612 } 4571 4613 #else … … 4714 4756 // MC 4715 4757 motionCompensation ( pcCU, pcPredYuv, REF_PIC_LIST_X, iPartIdx ); 4716 4758 D_DEC_INDENT( g_traceModeCheck ); 4717 4759 } // end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ ) 4718 4760 4719 4761 setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X ); 4720 4762 4763 D_DEC_INDENT( g_traceModeCheck ); 4721 4764 return; 4722 4765 } … … 4726 4769 Void TEncSearch::xEstimateMvPredAMVP( TComDataCU* pcCU, TComYuv* pcOrgYuv, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred, Bool bFilled, Distortion* puiDistBiP ) 4727 4770 { 4771 D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateMvPredAMVP"); 4772 4728 4773 AMVPInfo* pcAMVPInfo = pcCU->getCUMvField(eRefPicList)->getAMVPInfo(); 4729 4774 … … 4802 4847 if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefPicList==REF_PIC_LIST_1) 4803 4848 { 4849 D_PRINT_INC_INDENT(g_traceModeCheck, "Init"); 4850 4804 4851 (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight); 4852 4853 D_DEC_INDENT( g_traceModeCheck ); 4805 4854 } 4806 4855 return; … … 4818 4867 for ( i = 0 ; i < pcAMVPInfo->iN; i++) 4819 4868 { 4869 D_PRINT_INC_INDENT(g_traceModeCheck, "Cand i=" + n2s(i) + " X: " + n2s( pcAMVPInfo->m_acMvCand[i].getHor() ) + " Y: " + n2s( pcAMVPInfo->m_acMvCand[i].getVer() )); 4870 4820 4871 Distortion uiTmpCost; 4821 4872 uiTmpCost = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, pcAMVPInfo->m_acMvCand[i], i, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight); … … 4827 4878 (*puiDistBiP) = uiTmpCost; 4828 4879 } 4880 4881 D_DEC_INDENT( g_traceModeCheck ); 4829 4882 } 4830 4883 … … 4835 4888 pcCU->setMVPIdxSubParts( iBestIdx, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr)); 4836 4889 pcCU->setMVPNumSubParts( pcAMVPInfo->iN, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr)); 4890 4891 D_DEC_INDENT( g_traceModeCheck ); 4892 4837 4893 return; 4838 4894 } … … 5038 5094 Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, Distortion& ruiCost, Bool bBi ) 5039 5095 { 5096 D_PRINT_INC_INDENT(g_traceModeCheck, "xMotionEstimation"); 5097 5040 5098 UInt uiPartAddr; 5041 5099 Int iRoiWidth; … … 5168 5226 ruiBits += uiMvBits; 5169 5227 ruiCost = (Distortion)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) ); 5228 5229 D_PRINT_INDENT(g_traceRDCost, "ME Cost:" + n2s(ruiCost) ); 5230 D_DEC_INDENT ( g_traceModeCheck ); 5170 5231 } 5171 5232 … … 5727 5788 Bool bSkipResidual DEBUG_STRING_FN_DECLARE(sDebug) ) 5728 5789 { 5790 D_PRINT_INC_INDENT(g_traceModeCheck, "encodeResAndCalcRdInterCU; Skip residual: " + n2s(bSkipResidual)); 5791 5729 5792 assert ( !pcCU->isIntra(0) ); 5730 5793 … … 5820 5883 } 5821 5884 #endif 5885 D_DEC_INDENT( g_traceModeCheck ); 5886 5822 5887 return; 5823 5888 } … … 5846 5911 } 5847 5912 5913 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 5914 Bool oldTraceRDCost = g_traceRDCost; 5915 g_traceRDCost = false; 5916 5917 Bool oldTraceModeCheck = g_traceModeCheck; 5918 g_traceModeCheck = false; 5919 5920 Bool oldTraceFracBits = g_traceEncFracBits; 5921 g_traceEncFracBits = false; 5922 5923 #endif 5848 5924 xEstimateInterResidualQT( pcYuvResi, pcYuvOrg, pcYuvPred, nonZeroCost, nonZeroBits, nonZeroDistortion, &zeroDistortion, tuLevel0 DEBUG_STRING_PASS_INTO(sDebug) ); 5925 5926 #if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC 5927 g_traceRDCost = oldTraceRDCost; 5928 g_traceEncFracBits = oldTraceFracBits; 5929 g_traceModeCheck = oldTraceModeCheck; 5930 #endif 5849 5931 5850 5932 if ( m_pcRdCost->getUseVSO() ) … … 5967 6049 } 5968 6050 #endif 5969 6051 D_DEC_INDENT( g_traceModeCheck ); 5970 6052 } 5971 6053 … … 6125 6207 DEBUG_STRING_FN_DECLARE(sDebug) ) 6126 6208 { 6209 D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateInterResidualQT"); 6210 6127 6211 TComDataCU *pcCU = rTu.getCU(); 6128 6212 const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU(); … … 6176 6260 if( bCheckFull ) 6177 6261 { 6262 D_PRINT_INC_INDENT(g_traceModeCheck, "bCheckFull" ); 6263 6178 6264 Double minCost[MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/]; 6179 6265 Bool checkTransformSkip[MAX_NUM_COMPONENT]; … … 6263 6349 for (Int transformSkipModeId = 0; transformSkipModeId < transformSkipModesToTest; transformSkipModeId++) 6264 6350 { 6351 D_PRINT_INC_INDENT( g_traceModeCheck && ( transformSkipModeId > 0) , "TransformSkipModeId: " + n2s(transformSkipModeId) ); 6352 6265 6353 pcCU->setTransformSkipPartRange(transformSkipModeId, compID, subTUAbsPartIdx, partIdxesPerSubTU); 6266 6354 … … 6269 6357 const Bool isFirstMode = (transformSkipModeId == 0) && (crossCPredictionModeId == 0); 6270 6358 const Bool bUseCrossCPrediction = crossCPredictionModeId != 0; 6359 6360 D_PRINT_INC_INDENT( g_traceModeCheck, "Zero" ); 6271 6361 6272 6362 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] ); … … 6423 6513 DEBUG_STRING_NEW(sSingleStringTest) 6424 6514 6515 D_DEC_INDENT( g_traceModeCheck ); 6516 6425 6517 if( currAbsSum > 0 ) //if non-zero coefficients are present, a residual needs to be derived for further prediction 6426 6518 { 6519 D_PRINT_INC_INDENT(g_traceModeCheck, "NonZero"); 6520 6427 6521 if (isFirstMode) 6428 6522 { … … 6517 6611 currCompCost = nonCoeffCost; 6518 6612 } 6613 D_DEC_INDENT( g_traceModeCheck ); 6519 6614 6520 6615 // evaluate … … 6594 6689 } 6595 6690 } 6691 D_DEC_INDENT( g_traceModeCheck ); 6596 6692 } 6597 6693 … … 6604 6700 } // component loop 6605 6701 6702 D_PRINT_INC_INDENT(g_traceModeCheck, "Final"); 6703 6606 6704 for(UInt ch = 0; ch < numValidComp; ch++) 6607 6705 { … … 6659 6757 #endif 6660 6758 dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDist ); 6759 6760 D_DEC_INDENT( g_traceModeCheck ); 6761 D_DEC_INDENT( g_traceModeCheck ); 6661 6762 } // check full 6662 6763 … … 6664 6765 if( bCheckSplit ) 6665 6766 { 6767 D_PRINT_INC_INDENT(g_traceModeCheck, "bCheckSplit" ); 6666 6768 if( bCheckFull ) 6667 6769 { … … 6833 6935 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_TEST ] ); 6834 6936 } 6937 D_DEC_INDENT( g_traceModeCheck ); 6835 6938 } 6836 6939 else … … 6852 6955 #endif 6853 6956 } 6957 D_DEC_INDENT( g_traceModeCheck ); 6854 6958 DEBUG_STRING_APPEND(sDebug, debug_reorder_data_inter_token[MAX_NUM_COMPONENT]) 6855 6959 }
Note: See TracChangeset for help on using the changeset viewer.