Changeset 1196 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComRdCost.cpp
- Timestamp:
- 4 May 2015, 17:47:40 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComRdCost.cpp
r1179 r1196 341 341 else if( eDFunc >= DF_HADS && eDFunc <= DF_HADS16N ) 342 342 { 343 #if !RWTH_DBBP_NO_SATD_K0028344 rcDistParam.DistFunc = TComRdCost::xGetMaskedHADs;345 #else346 343 rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD; 347 #endif348 344 } 349 345 else if( eDFunc >= DF_VSD && eDFunc <= DF_VSD16N ) … … 445 441 if( m_bUseMask ) 446 442 { 447 #if !RWTH_DBBP_NO_SATD_K0028448 rcDistParam.DistFunc = (bHADME)?TComRdCost::xGetMaskedHADs:TComRdCost::xGetMaskedSAD;449 #else450 443 rcDistParam.DistFunc = TComRdCost::xGetMaskedSAD; 451 #endif452 444 } 453 445 #endif … … 472 464 if( m_bUseMask ) 473 465 { 474 #if !RWTH_DBBP_NO_SATD_K0028475 rcDP.DistFunc = (bHadamard)?TComRdCost::xGetMaskedHADs:TComRdCost::xGetMaskedSAD;476 #else477 466 rcDP.DistFunc = TComRdCost::xGetMaskedSAD; 478 #endif479 467 } 480 468 #endif … … 729 717 } 730 718 731 #if !RWTH_DBBP_NO_SATD_K0028732 UInt TComRdCost::xGetMaskedHADs( DistParam* pcDtParam )733 {734 AOF(!pcDtParam->bApplyWeight);735 #if H_3D_IC736 AOF(!pcDtParam->bUseIC);737 #endif738 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_HAD751 if( ( ( iRows % 8 == 0) && (iCols % 8 == 0) && ( iRows == iCols ) ) || ( ( iRows % 8 == 0 ) && (iCols % 8 == 0) && !pcDtParam->bUseNSHAD ) )752 #else753 if( ( iRows % 8 == 0) && (iCols % 8 == 0) )754 #endif755 {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_HAD772 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 #endif807 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 else843 {844 assert(false);845 }846 847 return uiSum >> DISTORTION_PRECISION_ADJUSTMENT(pcDtParam->bitDepth-8);848 }849 #endif850 719 851 720 UInt TComRdCost::xGetMaskedVSD( DistParam* pcDtParam ) … … 2993 2862 UInt TComRdCost::getVSDEstimate( Int dDM, Pel* pOrg, Int iOrgStride, Pel* pVirRec, Pel* pVirOrg, Int iVirStride, Int x, Int y ) 2994 2863 { 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; 2999 2865 3000 2866 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 ); 3001 2867 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)); 3003 2869 3004 2870 return (UInt) ( (iTemp*iTemp)>>1 );
Note: See TracChangeset for help on using the changeset viewer.