Changeset 125 in SHVCSoftware for trunk/source/Lib/TLibCommon/TComWeightPrediction.h
- Timestamp:
- 16 Apr 2013, 06:39:31 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComWeightPrediction.h
r2 r125 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 2, ITU/ISO/IEC6 * Copyright (c) 2010-2013, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 54 54 { 55 55 wpScalingParam m_wp0[3], m_wp1[3]; 56 Int m_ibdi;57 56 58 57 public: 59 58 TComWeightPrediction(); 60 59 61 Void getWpScaling( TComDataCU* pcCU, Int iRefIdx0, Int iRefIdx1, wpScalingParam *&wp0 , wpScalingParam *&wp1 , Int ibdi=(g_uiBitDepth+g_uiBitIncrement));60 Void getWpScaling( TComDataCU* pcCU, Int iRefIdx0, Int iRefIdx1, wpScalingParam *&wp0 , wpScalingParam *&wp1); 62 61 63 62 Void addWeightBi( TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, wpScalingParam *wp0, wpScalingParam *wp1, TComYuv* rpcYuvDst, Bool bRound=true ); 64 63 Void addWeightUni( TComYuv* pcYuvSrc0, UInt iPartUnitIdx, UInt iWidth, UInt iHeight, wpScalingParam *wp0, TComYuv* rpcYuvDst ); 65 64 66 Void xWeightedPredictionUni( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int i PartIdx, Int iRefIdx=-1 );65 Void xWeightedPredictionUni( TComDataCU* pcCU, TComYuv* pcYuvSrc, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iRefIdx=-1 ); 67 66 Void xWeightedPredictionBi( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartIdx, Int iWidth, Int iHeight, TComYuv* rpcYuvDst ); 68 69 __inline Pel xClip ( Int x );70 __inline Pel weightBidir( Int w0, Pel P0, Int w1, Pel P1, Int round, Int shift, Int offset);71 __inline Pel weightUnidir( Int w0, Pel P0, Int round, Int shift, Int offset);72 73 67 }; 74 68 75 inline Pel TComWeightPrediction::xClip( Int x )76 {77 Int max = (Int)g_uiIBDI_MAX;78 Pel pel = (Pel)( (x < 0) ? 0 : (x > max) ? max : x );79 return( pel );80 }81 82 inline Pel TComWeightPrediction::weightBidir( Int w0, Pel P0, Int w1, Pel P1, Int round, Int shift, Int offset)83 {84 return xClip( ( (w0*(P0 + IF_INTERNAL_OFFS) + w1*(P1 + IF_INTERNAL_OFFS) + round + (offset << (shift-1))) >> shift ) );85 }86 inline Pel TComWeightPrediction::weightUnidir( Int w0, Pel P0, Int round, Int shift, Int offset)87 {88 return xClip( ( (w0*(P0 + IF_INTERNAL_OFFS) + round) >> shift ) + offset );89 }90 91 69 #endif
Note: See TracChangeset for help on using the changeset viewer.