Ignore:
Timestamp:
22 May 2013, 21:05:43 (11 years ago)
Author:
tech
Message:

Merged HTM-6.2-dev3-RWTH-Fix Rev. 415

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-6.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r427 r433  
    5050#endif
    5151
     52#if HHI_DELTADC_DLT_D0035
     53#define GetDepthValue2Idx(val)     (pcCU->getSlice()->getSPS()->depthValue2idx(val))
     54#define GetIdx2DepthValue(val)     (pcCU->getSlice()->getSPS()->idx2DepthValue(val))
     55#endif
     56
    5257#if MERL_General_Fix
    5358#if MERL_VSP_C0152
     
    555560  // Do prediction
    556561  {
     562#if QC_DC_PREDICTOR_D0183
     563    Int iMean0, iMean1;
     564    getPredDCs( pbRegion, iWidth, pSrc+srcStride+1, srcStride, iMean0, iMean1 );
     565#else
    557566    //UInt uiSum0 = 0, uiSum1 = 0;
    558567    Int iSum0 = 0, iSum1 = 0;
     
    593602    iMean0 = iSum0 / iCount0; // TODO : integer op.
    594603    iMean1 = iSum1 / iCount1;
     604#endif
    595605#if LGE_EDGE_INTRA_DELTA_DC
    596606    if( bDelta )
     
    31633173}
    31643174
     3175#if QC_DC_PREDICTOR_D0183
     3176Void TComPrediction::getPredDCs( Bool* pbPattern, Int iStride, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2 )
     3177{
     3178  Int  iDC1, iDC2;
     3179  const Int  iTR = (   iStride - 1        ) - iMaskStride;
     3180  const Int  iTM = ( ( iStride - 1 ) >> 1 ) - iMaskStride;
     3181  const Int  iLB = (   iStride - 1        ) * iMaskStride - 1;
     3182  const Int  iLM = ( ( iStride - 1 ) >> 1 ) * iMaskStride - 1;
     3183  const UInt uiBitDepth = g_uiBitDepth + g_uiBitIncrement;
     3184
     3185  Bool bL = ( pbPattern[0] != pbPattern[(iStride-1)*iStride] );
     3186  Bool bT = ( pbPattern[0] != pbPattern[(iStride-1)]         );
     3187
     3188  if( bL == bT )
     3189  {
     3190    iDC1 = bL ? ( piMask[iTR] + piMask[iLB] )>>1 : 1<<( uiBitDepth - 1 );
     3191    iDC2 =      ( piMask[ -1] + piMask[-iMaskStride] )>>1;
     3192  }
     3193  else
     3194  {
     3195    iDC1 = bL ? piMask[iLB] : piMask[iTR];
     3196    iDC2 = bL ? piMask[iTM] : piMask[iLM];
     3197  }
     3198
     3199  riPredDC1 = pbPattern[0] ? iDC1 : iDC2;
     3200  riPredDC2 = pbPattern[0] ? iDC2 : iDC1;
     3201}
     3202#else
    31653203Void TComPrediction::getWedgePredDCs( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft )
    31663204{
     
    32403278  }
    32413279}
     3280#endif
    32423281
    32433282Void TComPrediction::calcWedgeDCs( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 )
     
    36073646  Int iMaskStride = ( iWidth<<1 ) + 1;
    36083647  piMask += iMaskStride+1;
     3648#if QC_DC_PREDICTOR_D0183
     3649  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     3650#else
    36093651  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     3652#endif
    36103653
    36113654  // assign wedge pred DCs to prediction
    3612   if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
    3613   else         { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride,        iPredDC1,                   iPredDC2           ); }
     3655  if( bDelta )
     3656  {
     3657#if HHI_DELTADC_DLT_D0035
     3658    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) );
     3659#else
     3660    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) );
     3661#endif
     3662  }
     3663  else
     3664  {
     3665    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 );
     3666  }
    36143667}
    36153668
     
    36263679  Int iMaskStride = ( iWidth<<1 ) + 1;
    36273680  piMask += iMaskStride+1;
     3681#if QC_DC_PREDICTOR_D0183
     3682  getPredDCs( pcContourWedge->getPattern(), pcContourWedge->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     3683#else
    36283684  getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     3685#endif
    36293686
    36303687  // assign wedge pred DCs to prediction
    3631   if( bDelta ) { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip ( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
    3632   else         { assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride,        iPredDC1,                   iPredDC2           ); }
     3688  if( bDelta )
     3689  {
     3690#if HHI_DELTADC_DLT_D0035
     3691    assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) );
     3692#else
     3693    assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) );
     3694#endif
     3695  }
     3696  else
     3697  {
     3698    assignWedgeDCs2Pred( pcContourWedge, piPred, uiStride, iPredDC1, iPredDC2 );
     3699  }
    36333700
    36343701  pcContourWedge->destroy();
     
    38013868  Int iMaskStride = ( iWidth<<1 ) + 1;
    38023869  piMask += iMaskStride+1;
     3870#if QC_DC_PREDICTOR_D0183
     3871  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     3872#else
    38033873  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     3874#endif
    38043875
    38053876  // assign wedge pred DCs to prediction
    3806   if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
    3807   else         { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1,           iPredDC2           ); }
     3877  if( bDelta )
     3878  {
     3879#if HHI_DELTADC_DLT_D0035
     3880    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) );
     3881#else
     3882    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) );
     3883#endif
     3884  }
     3885  else
     3886  {
     3887    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 );
     3888  }
    38083889}
    38093890
     
    38363917  Int iMaskStride = ( iWidth<<1 ) + 1;
    38373918  piMask += iMaskStride+1;
     3919#if QC_DC_PREDICTOR_D0183
     3920  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     3921#else
    38383922  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     3923#endif
    38393924
    38403925  // assign wedge pred DCs to prediction
    3841   if( bDelta ) { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) ); }
    3842   else         { assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride,       iPredDC1,                   iPredDC2             ); }
     3926  if( bDelta )
     3927  {
     3928#if HHI_DELTADC_DLT_D0035
     3929    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, GetIdx2DepthValue( GetDepthValue2Idx(iPredDC1) + iDeltaDC1 ), GetIdx2DepthValue( GetDepthValue2Idx(iPredDC2) + iDeltaDC2 ) );
     3930#else
     3931    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, Clip( iPredDC1+iDeltaDC1 ), Clip( iPredDC2+iDeltaDC2 ) );
     3932#endif
     3933  }
     3934  else
     3935  {
     3936    assignWedgeDCs2Pred( pcWedgelet, piPred, uiStride, iPredDC1, iPredDC2 );
     3937  }
    38433938}
    38443939
Note: See TracChangeset for help on using the changeset viewer.