Changeset 1309 in 3DVCSoftware


Ignore:
Timestamp:
11 Aug 2015, 15:45:37 (9 years ago)
Author:
tech
Message:

1) Further fixes in RD optimization process. Related to:

  • Depth Intra coding.
  • Intra skip.

2) Macros for debugging.

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  
    133133  }
    134134
     135  D_PRINT_INDENT( g_traceRDCost,  "Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost));
    135136  return dRdCost;
    136137}
     
    36843685  }
    36853686
     3687  D_PRINT_INDENT( g_traceRDCost, "VSO Dist: " + n2s(uiDistortion) + " Bits: " + n2s(uiBits) + " RD Cost: " + n2s(dRdCost));
     3688
    36863689  return dRdCost;
    36873690}
  • branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.cpp

    r1306 r1309  
    546546Bool g_disableNumbering = false;
    547547Bool 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;
     548UInt64 g_stopAtCounter         = 4660;
     549Bool g_traceCopyBack           = false;
     550Bool g_decTraceDispDer         = false;
     551Bool g_decTraceMvFromMerge     = false;
     552Bool g_decTracePicOutput       = false;
     553Bool g_startStopTrace          = true;
     554Bool g_outputPos               = false;   
     555Bool g_traceCameraParameters   = false;
     556Bool g_encNumberOfWrittenBits  = false;
     557Bool g_traceEncFracBits        = false;
     558Bool g_traceIntraSearchCost    = false;
     559Bool g_traceRDCost             = false;
     560Bool g_traceSAOCost            = false;
     561Bool g_traceModeCheck          = false;
     562UInt g_indent                  = false;
    557563#endif
    558564#endif
     
    685691              << std::endl;
    686692  }
    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;     
    707724  } 
    708725}
     
    738755  }
    739756}
     757Void printStr( std::string str )
     758{
     759  std::cout << str << std::endl;
     760}
     761Void printStrIndent( Bool b, std::string strStr )
     762{
     763  if ( b )
     764  { 
     765    std::cout << std::string(g_indent, ' ');
     766    printStr( strStr );
     767  }
     768}
     769
     770Void 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
     782Void decIndent( Bool b )
     783{
     784  if (b && g_indent > 0)
     785  {
     786    g_indent--; 
     787  } 
     788}
     789
    740790#endif
    741791#endif
  • branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComRom.h

    r1282 r1309  
    183183 extern Bool   g_decTraceMvFromMerge;   // Trace motion vectors obtained from merge (decoder only)
    184184 extern Bool   g_decTracePicOutput;     // Trace output of pictures
    185  extern Bool   g_stopAtPos;             // Stop at position
     185 extern Bool   g_startStopTrace;             // Stop at position
    186186 extern Bool   g_outputPos;             // Output position
    187187 extern Bool   g_traceCameraParameters; // Trace camera parameters
    188188 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;
    189195#define DTRACE_CU(x,y)             writeToTraceFile( x,y, g_traceCU );
    190196#define DTRACE_PU(x,y)             writeToTraceFile( x,y, g_tracePU );
     
    193199#define DTRACE_PU_S(x)             writeToTraceFile( x,   g_tracePU );
    194200#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
    195206 Void           tracePSHeader   ( const Char* psName, Int layerId );
    196207 Void           writeToTraceFile( const Char* symbolName, Int val, Bool doIt );
     
    198209 UInt64         incSymbolCounter();         
    199210 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
    200225#endif
    201226#else
     
    214239#define DTRACE_PU_S(x) ;           
    215240#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
    216246#endif
    217247#endif
  • branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TComYuv.cpp

    r1279 r1309  
    125125    ::memcpy( pDst, pSrc, sizeof(Pel)*iWidth);
    126126#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
    127     if ( g_traceCopyBack && g_nSymbolCounter >= g_stopAtCounter )
     127    if ( g_traceCopyBack && compID == COMPONENT_Y)
    128128    {
     129      std::stringstream strStr;
    129130      for ( Int x = 0; x < iWidth; x++)
    130131      {     
    131         std::cout << pSrc[ x ] << " " ;
    132       }
    133       std::cout << std::endl;
     132        strStr << pSrc[ x ] << " " ;
     133      }
     134      printStrIndent( true, strStr.str() );
    134135    }
    135136#endif
  • branches/HTM-14.1-update-dev1/source/Lib/TLibCommon/TypeDef.h

    r1308 r1309  
    6666/////////////////////////////////////////////////////////////////////////////////////////
    6767#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.
    6971#define NH_3D_DLT_FIX                     1 // Fixes numbers of parsed DLTs
    7072#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  
    156156#if FAST_BIT_EST
    157157  m_fracBits = pcTEncBinCABAC->m_fracBits;
     158  D_PRINT_INDENT(g_traceEncFracBits,  "CopyState " + n2s(m_fracBits) );   
    158159#endif
    159160}
     
    170171  }
    171172#if FAST_BIT_EST
     173  D_PRINT_INDENT( g_traceEncFracBits, "Reset Bits Before" + n2s(m_fracBits) );
    172174  m_fracBits &= 32767;
     175  D_PRINT_INDENT( g_traceEncFracBits, "Reset Bits " + n2s(m_fracBits) ); 
    173176#endif
    174177}
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncBinCoderCABACCounter.cpp

    r1200 r1309  
    5959  m_pcTComBitIf->write(0, UInt(m_fracBits >> 15) );
    6060  m_fracBits &= 32767;
     61  D_PRINT_INDENT( g_traceEncFracBits, "Finish " + n2s(m_fracBits) );   
    6162}
    6263
     
    8081  m_uiBinsCoded += m_binCountIncrement;
    8182  m_fracBits += rcCtxModel.getEntropyBits( binValue );
     83  D_PRINT_INDENT( g_traceEncFracBits, "EncodeBin " + n2s(m_fracBits) );   
     84
    8285  rcCtxModel.update( binValue );
    8386
     
    110113  m_uiBinsCoded += m_binCountIncrement;
    111114  m_fracBits += 32768;
     115    D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinEP " + n2s(m_fracBits) );   
    112116}
    113117
     
    122126  m_uiBinsCoded += numBins & -m_binCountIncrement;
    123127  m_fracBits += 32768 * numBins;
     128  D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinsEP " + n2s(m_fracBits) );   
    124129}
    125130
     
    133138  m_uiBinsCoded += m_binCountIncrement;
    134139  m_fracBits += ContextModel::getEntropyBitsTrm( binValue );
     140  D_PRINT_INDENT( g_traceEncFracBits , "EncodeBinTrm " + n2s(m_fracBits) );   
    135141}
    136142
     
    138144{
    139145  m_fracBits = (m_fracBits + 32767) & (~32767);
     146  D_PRINT_INDENT( g_traceEncFracBits, "Align " + n2s(m_fracBits) );   
    140147}
    141148
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncCu.cpp

    r1307 r1309  
    17841784    return;   // never check merge in fast deltaqp mode
    17851785  }
     1786
     1787  D_PRINT_INC_INDENT( g_traceModeCheck, "xCheckRDCostMerge2Nx2N" );
     1788
    17861789#if NH_3D_MLC
    17871790  TComMvField  cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
     
    19671970  for( UInt uiNoResidual = 0; uiNoResidual < iteration; ++uiNoResidual )
    19681971  {
     1972    D_PRINT_INC_INDENT ( g_traceModeCheck, "uiNoResidual: " + n2s( uiNoResidual) );
     1973
    19691974    for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    19701975    {
     
    19781983      }
    19791984#endif
     1985      D_PRINT_INC_INDENT ( g_traceModeCheck, "uiMergeCand: "+  n2s(uiMergeCand) );
    19801986
    19811987      if(!(uiNoResidual==1 && mergeCandBuffer[uiMergeCand]==1))
     
    21912197        }
    21922198      }
     2199      D_DEC_INDENT( g_traceModeCheck );
    21932200    }
    21942201
     
    22222229      }
    22232230    }
     2231    D_DEC_INDENT( g_traceModeCheck );
    22242232  }
    22252233  DEBUG_STRING_APPEND(sDebug, bestStr)
     
    22312239 delete[] puhInterDirSP;
    22322240#endif
     2241 D_DEC_INDENT( g_traceModeCheck );
    22332242}
    22342243
     
    22552264    }
    22562265  }
     2266
     2267  D_PRINT_INC_INDENT(g_traceModeCheck,   "xCheckRDCostInter; ePartSize:" + n2s( ePartSize) );
     2268
    22572269
    22582270  // prior to this, rpcTempCU will have just been reset using rpcTempCU->initEstData( uiDepth, iQP, bIsLosslessMode );
     
    23422354  {
    23432355#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    }
    23512366  }
    23522367#endif
     
    24642479  }
    24652480#endif
     2481  D_DEC_INDENT( g_traceModeCheck );
    24662482}
    24672483
     
    26752691  }
    26762692
     2693  D_PRINT_INC_INDENT(g_traceModeCheck, "xCheckRDCostDIS" );
     2694
    26772695#if NH_3D_VSO // M5
    26782696  if( m_pcRdCost->getUseRenModel() )
     
    27352753  xCheckDQP( rpcTempCU );
    27362754  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth  DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest) );
     2755  D_DEC_INDENT( g_traceModeCheck ); 
    27372756}
    27382757#endif
     
    27582777    }
    27592778  }
    2760 
     2779  D_PRINT_INC_INDENT (g_traceModeCheck, "xCheckRDCostIntra; eSize: " + n2s(eSize) );
     2780 
    27612781  UInt uiDepth = rpcTempCU->getDepth( 0 );
    27622782#if NH_3D_VSO // M5
     
    28102830    m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0,          true );
    28112831  }
    2812 #if NH_3D_DIS
     2832#if NH_3D_DIS && !NH_3D_DIS_FIX
    28132833  m_pcEntropyCoder->encodeDIS( rpcTempCU, 0,          true );
    28142834  if(!rpcTempCU->getDISFlag(0))
     
    28162836#endif
    28172837  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
    28182843  m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
    28192844  m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
     
    28512876
    28522877  xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth DEBUG_STRING_PASS_INTO(sDebug) DEBUG_STRING_PASS_INTO(sTest));
    2853 }
     2878
     2879  D_DEC_INDENT( g_traceModeCheck );
     2880  }
    28542881
    28552882
     
    30293056  m_ppcRecoYuvBest[uiSrcDepth]->copyToPicYuv( rpcPic->getPicYuvRec (), uiCUAddr, uiAbsPartIdx, uiDepth - uiSrcDepth, uiPartIdx);
    30303057
     3058#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     3059  Bool oldtraceCopyBack = g_traceCopyBack;
     3060  g_traceCopyBack = false;
     3061#endif
    30313062  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
    30323067}
    30333068
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1304 r1309  
    795795Void TEncEntropy::encodeCoeffNxN( TComTU &rTu, TCoeff* pcCoef, const ComponentID compID)
    796796{
     797#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     798  Bool oldTraceFracBits = g_traceEncFracBits;
     799  g_traceEncFracBits = false;
     800#endif
     801
    797802  TComDataCU *pcCU = rTu.getCU();
    798803
     
    822827    }
    823828  }
     829#if ENC_DEC_TRACE && H_MV_ENC_DEC_TRAC
     830  g_traceEncFracBits = oldTraceFracBits;
     831#endif
    824832}
    825833
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncEntropy.h

    r1304 r1309  
    139139  Void    setBitstream              ( TComBitIf* p )          { m_pcEntropyCoderIf->setBitstream(p);  }
    140140  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() ))
    149143 return m_pcEntropyCoderIf->getNumberOfWrittenBits(); }
    150144  Void    resetEntropy              (const TComSlice *pSlice) { m_pcEntropyCoderIf->resetEntropy(pSlice);  }
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

    r1200 r1309  
    826826      }
    827827
     828      D_PRINT_INDENT( g_traceSAOCost, "SAO mode " + n2s( mode ) + " Cost:  " + n2s( modeCost) );
     829
    828830      if(modeCost < minCost)
    829831      {
  • branches/HTM-14.1-update-dev1/source/Lib/TLibEncoder/TEncSearch.cpp

    r1308 r1309  
    15301530                                  )
    15311531{
     1532  D_PRINT_INC_INDENT( g_traceModeCheck, "xRecurIntraCodingLumaQT; zeroResiFlag " + n2s(zeroResiFlag) )
     1533
    15321534  TComDataCU   *pcCU          = rTu.getCU();
    15331535  const UInt    uiAbsPartIdx  = rTu.GetAbsPartIdxTU();
     
    17111713      dSingleCost   = 0.0;
    17121714#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
    17131718      xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag );
     1719#endif
    17141720#else
    17151721      pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
     
    18351841        }
    18361842      }
    1837 
     1843      D_DEC_INDENT( g_traceModeCheck );
    18381844      return;
    18391845    }
     
    18821888  ruiDistY += uiSingleDistLuma;
    18831889  dRDCost  += dSingleCost;
     1890  D_DEC_INDENT( g_traceModeCheck );
    18841891}
    18851892
     
    27472754                                  Bool        bLumaOnly )
    27482755{
     2756  D_PRINT_INC_INDENT(g_traceModeCheck, "estIntraPredDis");
     2757
    27492758  UInt    uiDepth        = pcCU->getDepth(0);
    27502759  UInt    uiWidth        = pcCU->getWidth (0);
     
    27632772  for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ )
    27642773  {
     2774    D_PRINT_INC_INDENT(g_traceModeCheck, "uiPredMode" +  n2s(uiPredMode ) );
     2775
    27652776    // set context models
    27662777    m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );
     
    27852796      pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
    27862797    }
     2798      D_DEC_INDENT( g_traceModeCheck ); 
    27872799  }
    27882800
     
    27952807  //===== set distortion (rate and r-d costs are determined later) =====
    27962808  pcCU->getTotalDistortion() = uiBestDist;
     2809  D_DEC_INDENT( g_traceModeCheck );
    27972810}
    27982811#endif
     
    28132826                              )
    28142827{
     2828  D_PRINT_INC_INDENT( g_traceModeCheck,  "estIntraPredLumaQT");
     2829
    28152830  const UInt         uiDepth               = pcCU->getDepth(0);
    28162831  const UInt         uiInitTrDepth         = pcCU->getPartitionSize(0) == SIZE_2Nx2N ? 0 : 1;
     
    28672882  {
    28682883    const UInt uiPartOffset=tuRecurseWithPU.GetAbsPartIdxTU();
     2884    D_PRINT_INC_INDENT(g_traceModeCheck, "uiPartOffset: " + n2s(uiPartOffset ) );
     2885
    28692886//  for( UInt uiPU = 0, uiPartOffset=0; uiPU < uiNumPU; uiPU++, uiPartOffset += uiQNumParts )
    28702887  //{
     
    29232940        Distortion uiSad  = 0;
    29242941#endif
     2942        D_PRINT_INC_INDENT(g_traceModeCheck, "preTest; uiMode " + n2s(uiMode) );
    29252943
    29262944        const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
     
    29752993
    29762994        CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList );
     2995        D_DEC_INDENT( g_traceModeCheck );
    29772996      }
    29782997
     
    31733192      }
    31743193#endif
     3194
     3195      D_PRINT_INC_INDENT(g_traceModeCheck, "Test; uiOrgMode: " + n2s(uiOrgMode) );
    31753196
    31763197      pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
     
    33743395      } // SDC loop
    33753396#endif
    3376 
     3397      D_DEC_INDENT( g_traceModeCheck );
    33773398    } // Mode loop
    33783399
     
    35333554    pcCU->setSDCFlagSubParts          ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth );
    35343555#endif
    3535 
     3556    D_DEC_INDENT( g_traceModeCheck );
    35363557  } while (tuRecurseWithPU.nextSection(tuRecurseCU));
    35373558
     
    35623583  //===== set distortion (rate and r-d costs are determined later) =====
    35633584  pcCU->getTotalDistortion() = uiOverallDistY;
     3585  D_DEC_INDENT( g_traceModeCheck );
    35643586}
    35653587
     
    38703892)
    38713893{
     3894  D_PRINT_INC_INDENT(g_traceModeCheck,  "xMergeEstimation" );
     3895
    38723896  UInt uiAbsPartIdx = 0;
    38733897  Int iWidth = 0;
     
    39904014  for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    39914015  {
     4016    D_PRINT_INC_INDENT(g_traceModeCheck,  "uiMergeCand: " + n2s(uiMergeCand) );
    39924017    Distortion uiCostCand = std::numeric_limits<Distortion>::max();
    39934018    UInt       uiBitsCand = 0;
     
    40664091    }
    40674092    uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand );
     4093
     4094    D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: "  + n2s(uiCostCand));
     4095
    40684096    if ( uiCostCand < ruiCost )
    40694097    {
     
    40744102      uiMergeIndex = uiMergeCand;
    40754103    }
    4076   }
     4104    D_DEC_INDENT( g_traceModeCheck );
     4105  }
     4106  D_DEC_INDENT( g_traceModeCheck );
    40774107}
    40784108
     
    41114141#endif
    41124142{
     4143
     4144  D_PRINT_INC_INDENT(g_traceModeCheck,  "predInterSearch");
     4145
    41134146  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
    41144147  {
     
    41774210  for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ )
    41784211  {
     4212    D_PRINT_INC_INDENT(g_traceModeCheck, "iPartIdx: " + n2s(iPartIdx) );
     4213
    41794214    Distortion   uiCost[2] = { std::numeric_limits<Distortion>::max(), std::numeric_limits<Distortion>::max() };
    41804215    Distortion   uiCostBi  =   std::numeric_limits<Distortion>::max();
     
    42234258    for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ )
    42244259    {
     4260      D_PRINT_INC_INDENT(g_traceModeCheck,  "iRefList: " + n2s(iRefList) );
     4261
    42254262      RefPicList  eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
    42264263
    42274264      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    42284265      {
     4266        D_PRINT_INC_INDENT(g_traceModeCheck,  "iRefIdxTemp: " + n2s(iRefIdxTemp) );
     4267
    42294268        uiBitsTemp = uiMbBits[iRefList];
    42304269        if ( pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1 )
     
    42994338          refIdxValidList1 = iRefIdxTemp;
    43004339        }
    4301       }
     4340        D_DEC_INDENT( g_traceModeCheck );
     4341      }
     4342      D_DEC_INDENT( g_traceModeCheck );
    43024343    }
    43034344
     
    45684609        xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() );
    45694610        uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits );
     4611        D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: "  + n2s(uiMECost));
    45704612      }
    45714613#else
     
    47144756    //  MC
    47154757    motionCompensation ( pcCU, pcPredYuv, REF_PIC_LIST_X, iPartIdx );
    4716 
     4758    D_DEC_INDENT( g_traceModeCheck );
    47174759  } //  end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ )
    47184760
    47194761  setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X );
    47204762
     4763  D_DEC_INDENT( g_traceModeCheck );
    47214764  return;
    47224765}
     
    47264769Void TEncSearch::xEstimateMvPredAMVP( TComDataCU* pcCU, TComYuv* pcOrgYuv, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred, Bool bFilled, Distortion* puiDistBiP )
    47274770{
     4771  D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateMvPredAMVP");
     4772
    47284773  AMVPInfo*  pcAMVPInfo = pcCU->getCUMvField(eRefPicList)->getAMVPInfo();
    47294774
     
    48024847    if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefPicList==REF_PIC_LIST_1)
    48034848    {
     4849      D_PRINT_INC_INDENT(g_traceModeCheck, "Init");
     4850
    48044851      (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight);
     4852
     4853      D_DEC_INDENT( g_traceModeCheck );
    48054854    }
    48064855    return;
     
    48184867  for ( i = 0 ; i < pcAMVPInfo->iN; i++)
    48194868  {
     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
    48204871    Distortion uiTmpCost;
    48214872    uiTmpCost = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, pcAMVPInfo->m_acMvCand[i], i, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight);
     
    48274878      (*puiDistBiP) = uiTmpCost;
    48284879    }
     4880
     4881    D_DEC_INDENT( g_traceModeCheck );
    48294882  }
    48304883
     
    48354888  pcCU->setMVPIdxSubParts( iBestIdx, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr));
    48364889  pcCU->setMVPNumSubParts( pcAMVPInfo->iN, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr));
     4890
     4891  D_DEC_INDENT( g_traceModeCheck );
     4892
    48374893  return;
    48384894}
     
    50385094Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, Distortion& ruiCost, Bool bBi  )
    50395095{
     5096  D_PRINT_INC_INDENT(g_traceModeCheck,  "xMotionEstimation");
     5097
    50405098  UInt          uiPartAddr;
    50415099  Int           iRoiWidth;
     
    51685226  ruiBits      += uiMvBits;
    51695227  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 );
    51705231}
    51715232
     
    57275788                                            Bool bSkipResidual DEBUG_STRING_FN_DECLARE(sDebug) )
    57285789{
     5790  D_PRINT_INC_INDENT(g_traceModeCheck, "encodeResAndCalcRdInterCU; Skip residual: " + n2s(bSkipResidual));
     5791
    57295792  assert ( !pcCU->isIntra(0) );
    57305793
     
    58205883    }
    58215884#endif
     5885    D_DEC_INDENT( g_traceModeCheck );
     5886
    58225887    return;
    58235888  }
     
    58465911  }
    58475912
     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
    58485924  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
    58495931
    58505932  if ( m_pcRdCost->getUseVSO() )
     
    59676049  }
    59686050#endif
    5969 
     6051  D_DEC_INDENT( g_traceModeCheck );
    59706052}
    59716053
     
    61256207                                           DEBUG_STRING_FN_DECLARE(sDebug) )
    61266208{
     6209  D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateInterResidualQT");
     6210
    61276211  TComDataCU *pcCU        = rTu.getCU();
    61286212  const UInt uiAbsPartIdx = rTu.GetAbsPartIdxTU();
     
    61766260  if( bCheckFull )
    61776261  {
     6262    D_PRINT_INC_INDENT(g_traceModeCheck,  "bCheckFull" );
     6263
    61786264    Double minCost[MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/];
    61796265    Bool checkTransformSkip[MAX_NUM_COMPONENT];
     
    62636349          for (Int transformSkipModeId = 0; transformSkipModeId < transformSkipModesToTest; transformSkipModeId++)
    62646350          {
     6351            D_PRINT_INC_INDENT( g_traceModeCheck && ( transformSkipModeId > 0) , "TransformSkipModeId: " + n2s(transformSkipModeId) );
     6352
    62656353            pcCU->setTransformSkipPartRange(transformSkipModeId, compID, subTUAbsPartIdx, partIdxesPerSubTU);
    62666354
     
    62696357              const Bool isFirstMode          = (transformSkipModeId == 0) && (crossCPredictionModeId == 0);
    62706358              const Bool bUseCrossCPrediction = crossCPredictionModeId != 0;
     6359
     6360              D_PRINT_INC_INDENT( g_traceModeCheck, "Zero" );             
    62716361
    62726362              m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
     
    64236513              DEBUG_STRING_NEW(sSingleStringTest)
    64246514
     6515              D_DEC_INDENT( g_traceModeCheck );
     6516
    64256517              if( currAbsSum > 0 ) //if non-zero coefficients are present, a residual needs to be derived for further prediction
    64266518              {
     6519                D_PRINT_INC_INDENT(g_traceModeCheck, "NonZero");
     6520
    64276521                if (isFirstMode)
    64286522                {
     
    65176611                currCompCost = nonCoeffCost;
    65186612              }
     6613              D_DEC_INDENT( g_traceModeCheck );
    65196614
    65206615              // evaluate
     
    65946689              }
    65956690            }
     6691            D_DEC_INDENT( g_traceModeCheck );
    65966692          }
    65976693
     
    66046700    } // component loop
    66056701
     6702    D_PRINT_INC_INDENT(g_traceModeCheck,  "Final");
     6703
    66066704    for(UInt ch = 0; ch < numValidComp; ch++)
    66076705    {
     
    66596757#endif
    66606758      dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDist );
     6759
     6760      D_DEC_INDENT( g_traceModeCheck );
     6761      D_DEC_INDENT( g_traceModeCheck );
    66616762  } // check full
    66626763
     
    66646765  if( bCheckSplit )
    66656766  {
     6767    D_PRINT_INC_INDENT(g_traceModeCheck,  "bCheckSplit" );
    66666768    if( bCheckFull )
    66676769    {
     
    68336935      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_TEST ] );
    68346936    }
     6937    D_DEC_INDENT( g_traceModeCheck );
    68356938  }
    68366939  else
     
    68526955#endif
    68536956  }
     6957  D_DEC_INDENT( g_traceModeCheck );
    68546958  DEBUG_STRING_APPEND(sDebug, debug_reorder_data_inter_token[MAX_NUM_COMPONENT])
    68556959}
Note: See TracChangeset for help on using the changeset viewer.