Ignore:
Timestamp:
1 Sep 2013, 22:47:26 (11 years ago)
Author:
tech
Message:

Merged DEV-2.0-dev0@604.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComRdCostWeightPrediction.cpp

    r313 r608  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2012, ITU/ISO/IEC
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    8181  wpScalingParam  *wpCur    = &(pcDtParam->wpCur[uiComp]);
    8282  Int   w0      = wpCur->w,
    83     offset  = wpCur->offset,
    84     shift   = wpCur->shift,
    85     round   = wpCur->round;
    86 
     83        offset  = wpCur->offset,
     84        shift   = wpCur->shift,
     85        round   = wpCur->round;
     86 
    8787  UInt uiSum = 0;
    88 #if HHI_INTERVIEW_SKIP
    89   if( pcDtParam->pUsed )
    90   {
    91     Pel*  piUsed      = pcDtParam->pUsed;
    92     Int   iStrideUsed = pcDtParam->iStrideUsed;
    93     for( ; iRows != 0; iRows-- )
    94     {
    95       for (Int n = 0; n < iCols; n++ )
    96       {
    97         if( piUsed[n])
    98         {
    99           pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
    100           uiSum += abs( piOrg[n] - pred );
    101         }
    102       }
    103       piOrg += iStrideOrg;
    104       piCur += iStrideCur;
    105       piUsed += iStrideUsed;
    106     }
    107 #if FIX_LGE_WP_FOR_3D_C0223
    108   }
    109   else
    110   {
    111 #endif
    112 #if FIX_LGE_WP_FOR_3D_C0223 //comment of #else
    113     //#else
    114 #endif
    115 #endif
    116     for( ; iRows != 0; iRows-- )
    117     {
    118       for (Int n = 0; n < iCols; n++ )
    119       {
    120         pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
    121         uiSum += abs( piOrg[n] - pred );
    122       }
    123       piOrg += iStrideOrg;
    124       piCur += iStrideCur;
    125     }
    126 #if FIX_LGE_WP_FOR_3D_C0223 //comment of #endif
    127     //#endif
    128 #endif
    129 #if HHI_INTERVIEW_SKIP
    130   }
    131 #endif
     88 
     89  for( ; iRows != 0; iRows-- )
     90  {
     91    for (Int n = 0; n < iCols; n++ )
     92    {
     93      pred = ( (w0*piCur[n] + round) >> shift ) + offset ;
     94     
     95      uiSum += abs( piOrg[n] - pred );
     96    }
     97    piOrg += iStrideOrg;
     98    piCur += iStrideCur;
     99  }
     100 
    132101  pcDtParam->uiComp = 255;  // reset for DEBUG (assert test)
    133102
    134   return ( uiSum >> g_uiBitIncrement );
     103  return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);
    135104}
    136105
     
    163132 
    164133  UInt uiSum = 0;
    165   UInt uiShift = g_uiBitIncrement<<1;
     134  UInt uiShift = DISTORTION_PRECISION_ADJUSTMENT((pcDtParam->bitDepth-8) << 1);
    166135 
    167136  Int iTemp;
     
    444413  {
    445414    for (i=0; i < 8; i++)
     415    {
    446416      sad += (abs(m2[j][i]));
     417    }
    447418  }
    448419 
     
    477448  }
    478449 
    479   return ( uiSum >> g_uiBitIncrement );
     450  return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);
    480451}
    481452
     
    513484  }
    514485 
    515   return ( uiSum >> g_uiBitIncrement );
     486  return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);
    516487}
    517488
     
    535506  assert(uiComp<3);
    536507  wpScalingParam  *wpCur    = &(pcDtParam->wpCur[uiComp]);
    537   Int   w0      = wpCur->w,
    538         offset  = wpCur->offset,
    539         shift   = wpCur->shift,
    540         round   = wpCur->round;
    541   xSetWPscale(w0, 0, shift, offset, round);
     508
     509  xSetWPscale(wpCur->w, 0, wpCur->shift, wpCur->offset, wpCur->round);
    542510
    543511  UInt uiSum = 0;
     
    587555  m_xSetDone  = false;
    588556
    589   return ( uiSum >> g_uiBitIncrement );
    590 }
     557  return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);
     558}
Note: See TracChangeset for help on using the changeset viewer.