Ignore:
Timestamp:
6 May 2013, 05:34:34 (11 years ago)
Author:
zhang
Message:

JCT3V-D0183 (DC predictor)

File:
1 edited

Legend:

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

    r342 r379  
    540540  // Do prediction
    541541  {
     542#if QC_DC_PREDICTOR_D0183
     543    Int iMean0, iMean1;
     544    getPredDCs( pbRegion, iWidth, pSrc+srcStride+1, srcStride, iMean0, iMean1 );
     545#else
    542546    //UInt uiSum0 = 0, uiSum1 = 0;
    543547    Int iSum0 = 0, iSum1 = 0;
     
    578582    iMean0 = iSum0 / iCount0; // TODO : integer op.
    579583    iMean1 = iSum1 / iCount1;
     584#endif
    580585#if LGE_EDGE_INTRA_DELTA_DC
    581586    if( bDelta )
     
    24312436}
    24322437
     2438#if QC_DC_PREDICTOR_D0183
     2439Void TComPrediction::getPredDCs( Bool* pbPattern, Int iStride, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2 )
     2440{
     2441  Int  iDC1, iDC2;
     2442  const Int  iTR = (   iStride - 1        ) - iMaskStride;
     2443  const Int  iTM = ( ( iStride - 1 ) >> 1 ) - iMaskStride;
     2444  const Int  iLB = (   iStride - 1        ) * iMaskStride - 1;
     2445  const Int  iLM = ( ( iStride - 1 ) >> 1 ) * iMaskStride - 1;
     2446  const UInt uiBitDepth = g_uiBitDepth + g_uiBitIncrement;
     2447
     2448  Bool bL = ( pbPattern[0] != pbPattern[(iStride-1)*iStride] );
     2449  Bool bT = ( pbPattern[0] != pbPattern[(iStride-1)]         );
     2450
     2451  if( bL == bT )
     2452  {
     2453    iDC1 = bL ? ( piMask[iTR] + piMask[iLB] )>>1 : 1<<( uiBitDepth - 1 );
     2454    iDC2 =      ( piMask[ -1] + piMask[-iMaskStride] )>>1;
     2455  }
     2456  else
     2457  {
     2458    iDC1 = bL ? piMask[iLB] : piMask[iTR];
     2459    iDC2 = bL ? piMask[iTM] : piMask[iLM];
     2460  }
     2461
     2462  riPredDC1 = pbPattern[0] ? iDC1 : iDC2;
     2463  riPredDC2 = pbPattern[0] ? iDC2 : iDC1;
     2464}
     2465#else
    24332466Void TComPrediction::getWedgePredDCs( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft )
    24342467{
     
    25082541  }
    25092542}
     2543#endif
    25102544
    25112545Void TComPrediction::calcWedgeDCs( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 )
     
    28752909  Int iMaskStride = ( iWidth<<1 ) + 1;
    28762910  piMask += iMaskStride+1;
     2911#if QC_DC_PREDICTOR_D0183
     2912  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     2913#else
    28772914  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     2915#endif
    28782916
    28792917  // assign wedge pred DCs to prediction
     
    29042942  Int iMaskStride = ( iWidth<<1 ) + 1;
    29052943  piMask += iMaskStride+1;
     2944#if QC_DC_PREDICTOR_D0183
     2945  getPredDCs( pcContourWedge->getPattern(), pcContourWedge->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     2946#else
    29062947  getWedgePredDCs( pcContourWedge, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     2948#endif
    29072949
    29082950  // assign wedge pred DCs to prediction
     
    30893131  Int iMaskStride = ( iWidth<<1 ) + 1;
    30903132  piMask += iMaskStride+1;
     3133#if QC_DC_PREDICTOR_D0183
     3134  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     3135#else
    30913136  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     3137#endif
    30923138
    30933139  // assign wedge pred DCs to prediction
     
    31343180  Int iMaskStride = ( iWidth<<1 ) + 1;
    31353181  piMask += iMaskStride+1;
     3182#if QC_DC_PREDICTOR_D0183
     3183  getPredDCs( pcWedgelet->getPattern(), pcWedgelet->getStride(), piMask, iMaskStride, iPredDC1, iPredDC2 );
     3184#else
    31363185  getWedgePredDCs( pcWedgelet, piMask, iMaskStride, iPredDC1, iPredDC2, bAbove, bLeft );
     3186#endif
    31373187
    31383188  // assign wedge pred DCs to prediction
Note: See TracChangeset for help on using the changeset viewer.