Changeset 1196 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComRdCost.cpp


Ignore:
Timestamp:
4 May 2015, 17:47:40 (9 years ago)
Author:
tech
Message:

Merged 14.0-dev0@1187.

File:
1 edited

Legend:

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

    r1179 r1196  
    341341    else if( eDFunc >= DF_HADS && eDFunc <= DF_HADS16N )
    342342    {
    343 #if !RWTH_DBBP_NO_SATD_K0028
    344       rcDistParam.DistFunc = TComRdCost::xGetMaskedHADs;
    345 #else
    346343      rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD;
    347 #endif
    348344    }
    349345    else if( eDFunc >= DF_VSD && eDFunc <= DF_VSD16N )
     
    445441  if( m_bUseMask )
    446442  {
    447 #if !RWTH_DBBP_NO_SATD_K0028
    448     rcDistParam.DistFunc = (bHADME)?TComRdCost::xGetMaskedHADs:TComRdCost::xGetMaskedSAD;
    449 #else
    450443    rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD;
    451 #endif
    452444  }
    453445#endif
     
    472464  if( m_bUseMask )
    473465  {
    474 #if !RWTH_DBBP_NO_SATD_K0028
    475     rcDP.DistFunc = (bHadamard)?TComRdCost::xGetMaskedHADs:TComRdCost::xGetMaskedSAD;
    476 #else
    477466    rcDP.DistFunc = TComRdCost::xGetMaskedSAD;
    478 #endif
    479467  }
    480468#endif
     
    729717}
    730718
    731 #if !RWTH_DBBP_NO_SATD_K0028
    732 UInt TComRdCost::xGetMaskedHADs( DistParam* pcDtParam )
    733 {
    734   AOF(!pcDtParam->bApplyWeight);
    735 #if H_3D_IC
    736   AOF(!pcDtParam->bUseIC);
    737 #endif
    738   Pel* piOrg   = pcDtParam->pOrg;
    739   Pel* piCur   = pcDtParam->pCur;
    740   Int  iRows   = pcDtParam->iRows;
    741   Int  iCols   = pcDtParam->iCols;
    742   Int  iStrideCur = pcDtParam->iStrideCur;
    743   Int  iStrideOrg = pcDtParam->iStrideOrg;
    744   Int  iStep  = pcDtParam->iStep;
    745  
    746   Int  x, y;
    747  
    748   UInt uiSum = 0;
    749  
    750 #if NS_HAD
    751   if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) )
    752 #else
    753     if( ( iRows % 8 == 0) && (iCols % 8 == 0) )
    754 #endif
    755     {
    756       Int  iOffsetOrg = iStrideOrg<<3;
    757       Int  iOffsetCur = iStrideCur<<3;
    758       for ( y=0; y<iRows; y+= 8 )
    759       {
    760         for ( x=0; x<iCols; x+= 8 )
    761         {
    762           if( piOrg[x] != DBBP_INVALID_SHORT )
    763           {
    764             uiSum += xCalcHADs8x8( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
    765           }
    766         }
    767         piOrg += iOffsetOrg;
    768         piCur += iOffsetCur;
    769       }
    770     }
    771 #if NS_HAD
    772     else if ( ( iCols > 8 ) && ( iCols > iRows ) && pcDtParam->bUseNSHAD )
    773     {
    774       Int  iOffsetOrg = iStrideOrg<<2;
    775       Int  iOffsetCur = iStrideCur<<2;
    776       for ( y=0; y<iRows; y+= 4 )
    777       {
    778         for ( x=0; x<iCols; x+= 16 )
    779         {
    780           if( piOrg[x] != DBBP_INVALID_SHORT )
    781           {
    782             uiSum += xCalcHADs16x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
    783           }
    784         }
    785         piOrg += iOffsetOrg;
    786         piCur += iOffsetCur;
    787       }
    788     }
    789     else if ( ( iRows > 8 ) && ( iCols < iRows ) && pcDtParam->bUseNSHAD )
    790     {
    791       Int  iOffsetOrg = iStrideOrg<<4;
    792       Int  iOffsetCur = iStrideCur<<4;
    793       for ( y=0; y<iRows; y+= 16 )
    794       {
    795         for ( x=0; x<iCols; x+= 4 )
    796         {
    797           if( piOrg[x] != DBBP_INVALID_SHORT )
    798           {
    799             uiSum += xCalcHADs4x16( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
    800           }
    801         }
    802         piOrg += iOffsetOrg;
    803         piCur += iOffsetCur;
    804       }
    805     }
    806 #endif
    807     else if( ( iRows % 4 == 0) && (iCols % 4 == 0) )
    808     {
    809       Int  iOffsetOrg = iStrideOrg<<2;
    810       Int  iOffsetCur = iStrideCur<<2;
    811      
    812       for ( y=0; y<iRows; y+= 4 )
    813       {
    814         for ( x=0; x<iCols; x+= 4 )
    815         {
    816           if( piOrg[x] != DBBP_INVALID_SHORT )
    817           {
    818             uiSum += xCalcHADs4x4( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
    819           }
    820         }
    821         piOrg += iOffsetOrg;
    822         piCur += iOffsetCur;
    823       }
    824     }
    825     else if( ( iRows % 2 == 0) && (iCols % 2 == 0) )
    826     {
    827       Int  iOffsetOrg = iStrideOrg<<1;
    828       Int  iOffsetCur = iStrideCur<<1;
    829       for ( y=0; y<iRows; y+=2 )
    830       {
    831         for ( x=0; x<iCols; x+=2 )
    832         {
    833           if( piOrg[x] != DBBP_INVALID_SHORT )
    834           {
    835             uiSum += xCalcHADs2x2( &piOrg[x], &piCur[x*iStep], iStrideOrg, iStrideCur, iStep );
    836           }
    837         }
    838         piOrg += iOffsetOrg;
    839         piCur += iOffsetCur;
    840       }
    841     }
    842     else
    843     {
    844       assert(false);
    845     }
    846  
    847   return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);
    848 }
    849 #endif
    850719
    851720UInt TComRdCost::xGetMaskedVSD( DistParam* pcDtParam )
     
    29932862UInt TComRdCost::getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride,  Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y )
    29942863{
    2995   Double dD;
    2996   Int iTemp;
    2997 
    2998   dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff;
     2864  Double  dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff;
    29992865
    30002866  Double dDepthWeight = ( pOrg[x] >=  ( (1<<(g_bitDepthY - 3)) + (1<<(g_bitDepthY - 2)) ) ? 4 : pOrg[x] > ((1<<g_bitDepthY) >> 4) ? (Float)(pOrg[x] - ((1<<g_bitDepthY) >> 4))/(Float)((1<<g_bitDepthY) >> 3) + 1 : 1.0 );
    30012867  Double dTemp = ( 0.5 * fabs(dD) * dDepthWeight * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) );
    3002   iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5));
     2868  Int iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5));
    30032869
    30042870  return (UInt) ( (iTemp*iTemp)>>1 );
Note: See TracChangeset for help on using the changeset viewer.