Ignore:
Timestamp:
4 Sep 2015, 21:28:58 (9 years ago)
Author:
tech
Message:

Clean-ups. HLS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r1313 r1317  
    15301530                                  )
    15311531{
     1532#if NH_MV
    15321533  D_PRINT_INC_INDENT( g_traceModeCheck, "xRecurIntraCodingLumaQT; zeroResiFlag " + n2s(zeroResiFlag) )
     1534#endif
    15331535
    15341536  TComDataCU   *pcCU          = rTu.getCU();
     
    17131715      dSingleCost   = 0.0;
    17141716#if NH_3D_ENC_DEPTH
    1715 #if NH_3D_ENC_DEPTH_FIX
    17161717      xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), 0, zeroResiFlag );
    1717 #else
    1718       xIntraCodingTUBlock( pcOrgYuv, pcPredYuv, pcResiYuv, resiLumaSingle, false, uiSingleDistLuma, COMPONENT_Y, rTu DEBUG_STRING_PASS_INTO(sDebug), zeroResiFlag );
    1719 #endif
    17201718#else
    17211719      pcCU ->setTransformSkipSubParts ( 0, COMPONENT_Y, uiAbsPartIdx, totalAdjustedDepthChan );
     
    18411839        }
    18421840      }
     1841#if NH_MV
    18431842      D_DEC_INDENT( g_traceModeCheck );
     1843#endif
    18441844      return;
    18451845    }
     
    18881888  ruiDistY += uiSingleDistLuma;
    18891889  dRDCost  += dSingleCost;
     1890#if NH_MV
    18901891  D_DEC_INDENT( g_traceModeCheck );
     1892#endif
    18911893}
    18921894
     
    19071909  TComTURecurse rTu(pcCU, 0);
    19081910  const ChromaFormat chFmt     = rTu.GetChromaFormat();
    1909 
     1911  DEBUG_STRING_NEW(sTemp)
    19101912  if ( uiPredMode == 0 )
    19111913  {
     
    20312033    TComTURecurse tuRecurseCU(pcCU, 0);
    20322034    TComTURecurse tuRecurseWithPU(tuRecurseCU, false, TComTU::DONT_SPLIT);
    2033 
     2035    DEBUG_STRING_NEW(sTemp)
    20342036    initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, false DEBUG_STRING_PASS_INTO(sTemp) );
    20352037
     
    20862088     
    20872089      //===== init pattern for luma prediction =====
    2088      
     2090      DEBUG_STRING_NEW(sTemp2)
    20892091      initIntraPatternChType( tuRecurseWithPU, COMPONENT_Y, bUseFilter DEBUG_STRING_PASS_INTO(sTemp2) );
    20902092     
     
    22122214
    22132215  //===== determine distortion ===== 
    2214 #if NH_3D_INTRA_SDC_RD_FIX
    22152216#if NH_3D_VSO 
    22162217  if( m_pcRdCost->getUseVSO() )
     
    22192220  }
    22202221  else
    2221 #endif
    2222 #else
    2223 #if NH_3D_VSO 
    2224   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     else
    2231     {
    2232       ruiDist = m_pcRdCost->getDistPartVSO( pcCU, uiAbsPartIdx, bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false );
    2233     }
    2234   }
    2235   else
    2236 #endif
    22372222#endif
    22382223  {
     
    27542739                                  Bool        bLumaOnly )
    27552740{
     2741#if NH_MV
    27562742  D_PRINT_INC_INDENT(g_traceModeCheck, "estIntraPredDis");
     2743#endif
    27572744
    27582745  UInt    uiDepth        = pcCU->getDepth(0);
     
    27722759  for( UInt uiPredMode = 0; uiPredMode < 4 ; uiPredMode++ )
    27732760  {
     2761#if NH_MV
    27742762    D_PRINT_INC_INDENT(g_traceModeCheck, "uiPredMode" +  n2s(uiPredMode ) );
     2763#endif
    27752764
    27762765    // set context models
     
    27962785      pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight);
    27972786    }
     2787#if NH_MV
    27982788      D_DEC_INDENT( g_traceModeCheck ); 
     2789#endif
    27992790  }
    28002791
     
    28072798  //===== set distortion (rate and r-d costs are determined later) =====
    28082799  pcCU->getTotalDistortion() = uiBestDist;
     2800#if NH_MV
    28092801  D_DEC_INDENT( g_traceModeCheck );
     2802#endif
    28102803}
    28112804#endif
     
    28262819                              )
    28272820{
     2821#if NH_MV
    28282822  D_PRINT_INC_INDENT( g_traceModeCheck,  "estIntraPredLumaQT");
     2823#endif
    28292824
    28302825  const UInt         uiDepth               = pcCU->getDepth(0);
     
    28822877  {
    28832878    const UInt uiPartOffset=tuRecurseWithPU.GetAbsPartIdxTU();
     2879#if NH_MV
    28842880    D_PRINT_INC_INDENT(g_traceModeCheck, "uiPartOffset: " + n2s(uiPartOffset ) );
     2881#endif
    28852882
    28862883//  for( UInt uiPU = 0, uiPartOffset=0; uiPU < uiNumPU; uiPU++, uiPartOffset += uiQNumParts )
     
    29272924      m_pcRdCost->setDistParam(distParam, sps.getBitDepth(CHANNEL_TYPE_LUMA), piOrg, uiStride, piPred, uiStride, puRect.width, puRect.height, bUseHadamard);
    29282925
    2929 #if NH_3D_IC_FIX
     2926#if NH_3D
    29302927      distParam.bUseIC = false;
    29312928#endif
     
    29402937        Distortion uiSad  = 0;
    29412938#endif
     2939#if NH_MV
    29422940        D_PRINT_INC_INDENT(g_traceModeCheck, "preTest; uiMode " + n2s(uiMode) );
     2941#endif
    29432942
    29442943        const Bool bUseFilter=TComPrediction::filteringIntraReferenceSamples(COMPONENT_Y, uiMode, puRect.width, puRect.height, chFmt, sps.getSpsRangeExtension().getIntraSmoothingDisabledFlag());
     
    29932992
    29942993        CandNum += xUpdateCandList( uiMode, cost, numModesForFullRD, uiRdModeList, CandCostList );
     2994#if NH_MV
    29952995        D_DEC_INDENT( g_traceModeCheck );
     2996#endif
    29962997      }
    29972998
     
    31933194#endif
    31943195
     3196#if NH_MV
    31953197      D_PRINT_INC_INDENT(g_traceModeCheck, "Test; uiOrgMode: " + n2s(uiOrgMode) );
     3198#endif
    31963199
    31973200      pcCU->setIntraDirSubParts ( CHANNEL_TYPE_LUMA, uiOrgMode, uiPartOffset, uiDepth + uiInitTrDepth );
     
    33953398      } // SDC loop
    33963399#endif
     3400#if NH_MV
    33973401      D_DEC_INDENT( g_traceModeCheck );
     3402#endif
    33983403    } // Mode loop
    33993404
     
    35543559    pcCU->setSDCFlagSubParts          ( bBestUseSDC, uiPartOffset, uiDepth + uiInitTrDepth );
    35553560#endif
     3561#if NH_MV
    35563562    D_DEC_INDENT( g_traceModeCheck );
     3563#endif
    35573564  } while (tuRecurseWithPU.nextSection(tuRecurseCU));
    35583565
     
    35833590  //===== set distortion (rate and r-d costs are determined later) =====
    35843591  pcCU->getTotalDistortion() = uiOverallDistY;
     3592#if NH_MV
    35853593  D_DEC_INDENT( g_traceModeCheck );
     3594#endif
    35863595}
    35873596
     
    38923901)
    38933902{
     3903#if NH_MV
    38943904  D_PRINT_INC_INDENT(g_traceModeCheck,  "xMergeEstimation" );
     3905#endif
    38953906
    38963907  UInt uiAbsPartIdx = 0;
     
    40144025  for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
    40154026  {
     4027#if NH_MV
    40164028    D_PRINT_INC_INDENT(g_traceModeCheck,  "uiMergeCand: " + n2s(uiMergeCand) );
     4029#endif
    40174030    Distortion uiCostCand = std::numeric_limits<Distortion>::max();
    40184031    UInt       uiBitsCand = 0;
     
    40924105    uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand );
    40934106
     4107#if NH_MV
    40944108    D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: "  + n2s(uiCostCand));
     4109#endif
    40954110
    40964111    if ( uiCostCand < ruiCost )
     
    41024117      uiMergeIndex = uiMergeCand;
    41034118    }
     4119#if NH_MV
    41044120    D_DEC_INDENT( g_traceModeCheck );
    4105   }
     4121#endif
     4122  }
     4123#if NH_MV
    41064124  D_DEC_INDENT( g_traceModeCheck );
     4125#endif
    41074126}
    41084127
     
    41424161{
    41434162
     4163#if NH_MV
    41444164  D_PRINT_INC_INDENT(g_traceModeCheck,  "predInterSearch");
     4165#endif
    41454166
    41464167  for(UInt i=0; i<NUM_REF_PIC_LIST_01; i++)
     
    42104231  for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ )
    42114232  {
     4233#if NH_MV
    42124234    D_PRINT_INC_INDENT(g_traceModeCheck, "iPartIdx: " + n2s(iPartIdx) );
     4235#endif
    42134236
    42144237    Distortion   uiCost[2] = { std::numeric_limits<Distortion>::max(), std::numeric_limits<Distortion>::max() };
     
    42584281    for ( Int iRefList = 0; iRefList < iNumPredDir; iRefList++ )
    42594282    {
     4283#if NH_MV
    42604284      D_PRINT_INC_INDENT(g_traceModeCheck,  "iRefList: " + n2s(iRefList) );
     4285#endif
    42614286
    42624287      RefPicList  eRefPicList = ( iRefList ? REF_PIC_LIST_1 : REF_PIC_LIST_0 );
     
    42644289      for ( Int iRefIdxTemp = 0; iRefIdxTemp < pcCU->getSlice()->getNumRefIdx(eRefPicList); iRefIdxTemp++ )
    42654290      {
     4291#if NH_MV
    42664292        D_PRINT_INC_INDENT(g_traceModeCheck,  "iRefIdxTemp: " + n2s(iRefIdxTemp) );
     4293#endif
    42674294
    42684295        uiBitsTemp = uiMbBits[iRefList];
     
    43384365          refIdxValidList1 = iRefIdxTemp;
    43394366        }
     4367#if NH_MV
    43404368        D_DEC_INDENT( g_traceModeCheck );
    4341       }
     4369#endif
     4370      }
     4371#if NH_MV
    43424372      D_DEC_INDENT( g_traceModeCheck );
     4373#endif
    43434374    }
    43444375
     
    46094640        xGetInterPredictionError( pcCU, pcOrgYuv, iPartIdx, uiMEError, m_pcEncCfg->getUseHADME() );
    46104641        uiMECost = uiMEError + m_pcRdCost->getCost( uiMEBits );
     4642#if NH_MV
    46114643        D_PRINT_INDENT( g_traceRDCost, "IP RD Cost: "  + n2s(uiMECost));
     4644#endif
    46124645      }
    46134646#else
     
    47564789    //  MC
    47574790    motionCompensation ( pcCU, pcPredYuv, REF_PIC_LIST_X, iPartIdx );
     4791#if NH_MV
    47584792    D_DEC_INDENT( g_traceModeCheck );
     4793#endif
    47594794  } //  end of for ( Int iPartIdx = 0; iPartIdx < iNumPart; iPartIdx++ )
    47604795
    47614796  setWpScalingDistParam( pcCU, -1, REF_PIC_LIST_X );
    47624797
     4798#if NH_MV
    47634799  D_DEC_INDENT( g_traceModeCheck );
     4800#endif
    47644801  return;
    47654802}
     
    47694806Void TEncSearch::xEstimateMvPredAMVP( TComDataCU* pcCU, TComYuv* pcOrgYuv, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred, Bool bFilled, Distortion* puiDistBiP )
    47704807{
     4808#if NH_MV
    47714809  D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateMvPredAMVP");
     4810#endif
    47724811
    47734812  AMVPInfo*  pcAMVPInfo = pcCU->getCUMvField(eRefPicList)->getAMVPInfo();
     
    48474886    if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefPicList==REF_PIC_LIST_1)
    48484887    {
     4888#if NH_MV
    48494889      D_PRINT_INC_INDENT(g_traceModeCheck, "Init");
     4890#endif
    48504891
    48514892      (*puiDistBiP) = xGetTemplateCost( pcCU, uiPartAddr, pcOrgYuv, &m_cYuvPredTemp, rcMvPred, 0, AMVP_MAX_NUM_CANDS, eRefPicList, iRefIdx, iRoiWidth, iRoiHeight);
    48524893
     4894#if NH_MV
    48534895      D_DEC_INDENT( g_traceModeCheck );
     4896#endif
    48544897    }
    48554898    return;
     
    48674910  for ( i = 0 ; i < pcAMVPInfo->iN; i++)
    48684911  {
     4912#if NH_MV
    48694913    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
    48704915
    48714916    Distortion uiTmpCost;
     
    48794924    }
    48804925
     4926#if NH_MV
    48814927    D_DEC_INDENT( g_traceModeCheck );
     4928#endif
    48824929  }
    48834930
     
    48894936  pcCU->setMVPNumSubParts( pcAMVPInfo->iN, eRefPicList, uiPartAddr, uiPartIdx, pcCU->getDepth(uiPartAddr));
    48904937
     4938#if NH_MV
    48914939  D_DEC_INDENT( g_traceModeCheck );
     4940#endif
    48924941
    48934942  return;
     
    50945143Void TEncSearch::xMotionEstimation( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv* pcMvPred, Int iRefIdxPred, TComMv& rcMv, UInt& ruiBits, Distortion& ruiCost, Bool bBi  )
    50955144{
     5145#if NH_MV
    50965146  D_PRINT_INC_INDENT(g_traceModeCheck,  "xMotionEstimation");
     5147#endif
    50975148
    50985149  UInt          uiPartAddr;
     
    52275278  ruiCost       = (Distortion)( floor( fWeight * ( (Double)ruiCost - (Double)m_pcRdCost->getCost( uiMvBits ) ) ) + (Double)m_pcRdCost->getCost( ruiBits ) );
    52285279 
     5280#if NH_MV
    52295281  D_PRINT_INDENT(g_traceRDCost, "ME Cost:" + n2s(ruiCost)  );
    52305282  D_DEC_INDENT  ( g_traceModeCheck );
     5283#endif
    52315284}
    52325285
     
    57885841                                            Bool bSkipResidual DEBUG_STRING_FN_DECLARE(sDebug) )
    57895842{
     5843#if NH_MV
    57905844  D_PRINT_INC_INDENT(g_traceModeCheck, "encodeResAndCalcRdInterCU; Skip residual: " + n2s(bSkipResidual));
     5845#endif
    57915846
    57925847  assert ( !pcCU->isIntra(0) );
     
    58835938    }
    58845939#endif
     5940#if NH_MV
    58855941    D_DEC_INDENT( g_traceModeCheck );
     5942#endif
    58865943
    58875944    return;
     
    60496106  }
    60506107#endif
     6108#if NH_MV
    60516109  D_DEC_INDENT( g_traceModeCheck );
     6110#endif
    60526111}
    60536112
     
    62076266                                           DEBUG_STRING_FN_DECLARE(sDebug) )
    62086267{
     6268#if NH_MV
    62096269  D_PRINT_INC_INDENT(g_traceModeCheck, "xEstimateInterResidualQT");
     6270#endif
    62106271
    62116272  TComDataCU *pcCU        = rTu.getCU();
     
    62606321  if( bCheckFull )
    62616322  {
     6323#if NH_MV
    62626324    D_PRINT_INC_INDENT(g_traceModeCheck,  "bCheckFull" );
     6325#endif
    62636326
    62646327    Double minCost[MAX_NUM_COMPONENT][2/*0 = top (or whole TU for non-4:2:2) sub-TU, 1 = bottom sub-TU*/];
     
    63496412          for (Int transformSkipModeId = 0; transformSkipModeId < transformSkipModesToTest; transformSkipModeId++)
    63506413          {
     6414#if NH_MV
    63516415            D_PRINT_INC_INDENT( g_traceModeCheck && ( transformSkipModeId > 0) , "TransformSkipModeId: " + n2s(transformSkipModeId) );
     6416#endif
    63526417
    63536418            pcCU->setTransformSkipPartRange(transformSkipModeId, compID, subTUAbsPartIdx, partIdxesPerSubTU);
     
    63586423              const Bool bUseCrossCPrediction = crossCPredictionModeId != 0;
    63596424
     6425#if NH_MV
    63606426              D_PRINT_INC_INDENT( g_traceModeCheck, "Zero" );             
     6427#endif
    63616428
    63626429              m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
     
    65116578              }
    65126579
     6580
    65136581              DEBUG_STRING_NEW(sSingleStringTest)
    6514 
    6515               D_DEC_INDENT( g_traceModeCheck );
    6516 
     6582#if NH_MV
     6583                D_DEC_INDENT( g_traceModeCheck );
     6584#endif
    65176585              if( currAbsSum > 0 ) //if non-zero coefficients are present, a residual needs to be derived for further prediction
    65186586              {
     6587#if NH_MV
    65196588                D_PRINT_INC_INDENT(g_traceModeCheck, "NonZero");
     6589#endif
    65206590
    65216591                if (isFirstMode)
     
    66116681                currCompCost = nonCoeffCost;
    66126682              }
     6683#if NH_MV
    66136684              D_DEC_INDENT( g_traceModeCheck );
     6685#endif
    66146686
    66156687              // evaluate
     
    66896761              }
    66906762            }
     6763#if NH_MV
    66916764            D_DEC_INDENT( g_traceModeCheck );
     6765#endif
    66926766          }
    66936767
     
    67006774    } // component loop
    67016775
     6776#if NH_MV
    67026777    D_PRINT_INC_INDENT(g_traceModeCheck,  "Final");
     6778#endif
    67036779
    67046780    for(UInt ch = 0; ch < numValidComp; ch++)
     
    67586834      dSingleCost = m_pcRdCost->calcRdCost( uiSingleBits, uiSingleDist );
    67596835
     6836#if NH_MV
    67606837      D_DEC_INDENT( g_traceModeCheck );
    67616838      D_DEC_INDENT( g_traceModeCheck );
     6839#endif
    67626840  } // check full
    67636841
     
    67656843  if( bCheckSplit )
    67666844  {
     6845#if NH_MV
    67676846    D_PRINT_INC_INDENT(g_traceModeCheck,  "bCheckSplit" );
     6847#endif
    67686848    if( bCheckFull )
    67696849    {
     
    69357015      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_TEST ] );
    69367016    }
     7017#if NH_MV
    69377018    D_DEC_INDENT( g_traceModeCheck );
     7019#endif
    69387020  }
    69397021  else
     
    69557037#endif
    69567038  }
     7039#if NH_MV
    69577040  D_DEC_INDENT( g_traceModeCheck );
     7041#endif
    69587042  DEBUG_STRING_APPEND(sDebug, debug_reorder_data_inter_token[MAX_NUM_COMPONENT])
     7043
    69597044}
    69607045
Note: See TracChangeset for help on using the changeset viewer.