Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComPrediction.h
- Timestamp:
- 11 May 2012, 21:20:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComPrediction.h
r21 r56 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 1,ISO/IEC6 * Copyright (c) 2010-2012, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 15 15 * this list of conditions and the following disclaimer in the documentation 16 16 * and/or other materials provided with the distribution. 17 * * Neither the name of the I SO/IEC nor the names of its contributors may17 * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may 18 18 * be used to endorse or promote products derived from this software without 19 19 * specific prior written permission. … … 32 32 */ 33 33 34 35 36 34 /** \file TComPrediction.h 37 35 \brief prediction class (header) … … 47 45 #include "TComPattern.h" 48 46 #include "TComTrQuant.h" 49 #include "TComPredFilter.h" 50 #ifdef WEIGHT_PRED 51 #include "TComWeightPrediction.h" 47 #include "TComInterpolationFilter.h" 48 #include "TComWeightPrediction.h" 49 50 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 51 #include <math.h> 52 52 #endif 53 54 //! \ingroup TLibCommon 55 //! \{ 53 56 54 57 // ==================================================================================================================== … … 57 60 58 61 /// prediction class 59 class TComPrediction : public TComPredFilter 60 #ifdef WEIGHT_PRED 61 , public TComWeightPrediction 62 #endif 62 class TComPrediction : public TComWeightPrediction 63 63 { 64 64 protected: … … 69 69 TComYuv m_acYuvPred[2]; 70 70 TComYuv m_cYuvPredTemp; 71 TComYuv m_cYuvExt; 71 TComYuv m_filteredBlock[4][4]; 72 TComYuv m_filteredBlockTmp[4]; 72 73 73 #if LM_CHROMA 74 Pel* m_pLumaRecBuffer; // array for downsampled reconstructed luma sample75 Int m_iLumaRecStride;76 UInt m_uiaShift[ 65 ]; // Table for multiplication to substitue of division operation77 #endif 74 TComInterpolationFilter m_if; 75 76 Pel* m_pLumaRecBuffer; ///< array for downsampled reconstructed luma sample 77 Int m_iLumaRecStride; ///< stride of #m_pLumaRecBuffer array 78 UInt m_uiaShift[ 63 ]; // Table for multiplication to substitue of division operation 78 79 79 Void xPredIntraAng ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable ); 80 #if ADD_PLANAR_MODE 81 #if REFERENCE_SAMPLE_PADDING 82 Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height ); 83 #else 84 Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, Bool blkAboveAvailable, Bool blkLeftAvailable ); 85 #endif 86 #endif 80 Void xPredIntraAng ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable, Bool bFilter ); 81 Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel* rpDst, Int dstStride, UInt width, UInt height ); 87 82 88 83 // motion compensation functions 89 #if HIGH_ACCURACY_BI90 84 #if DEPTH_MAP_GENERATION 91 85 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false ); 92 86 #else 93 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false );87 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); 94 88 #endif 95 #else 96 #if DEPTH_MAP_GENERATION 97 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); 98 #else 99 Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); 100 #endif 101 #endif 89 102 90 #if DEPTH_MAP_GENERATION 103 91 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); 104 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift );92 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset ); 105 93 #else 106 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx );107 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift );94 Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx ); 95 Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift, UInt uiOffset ); 108 96 #endif 109 Void xPredInterLumaBlk ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); 110 Void xPredInterChromaBlk ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); 111 97 112 98 #if DEPTH_MAP_GENERATION 113 99 Void xWeightedAveragePdm ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); 114 100 #endif 101 102 Void xPredInterLumaBlk ( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 103 Void xPredInterChromaBlk( TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *&dstPic, Bool bi ); 115 104 Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); 105 106 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 116 107 117 118 Void xDCTIF_FilterC ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride,Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac); 119 120 #if HIGH_ACCURACY_BI 121 Void xPredInterLumaBlk_ha ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); 122 Void xPredInterChromaBlk_ha ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); 123 Void xDCTIF_FilterC_ha ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride,Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac); 124 #endif 108 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 109 Bool xCheckIdenticalMotion ( TComDataCU* pcCU, UInt PartAddr); 125 110 126 111 #if HHI_DMM_WEDGE_INTRA 127 112 Void xPredIntraWedgeFull ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, UInt uiTabIdx, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); 128 129 113 Void xPredIntraWedgeDir ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iWedgeDeltaEnd, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); 130 114 Void xGetBlockOffset ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ); … … 138 122 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 139 123 Void xDeltaDCQuantScaleUp ( TComDataCU* pcCU, Int& riDeltaDC ); 140 #endif 141 142 #if LM_CHROMA 143 Void xGetRecPixels ( TComPattern* pcPattern, Pel* pRecSrc, Int iRecSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth0, UInt uiHeight0 ); 144 Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); 145 #endif 146 147 #if MN_DC_PRED_FILTER 148 Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); 124 Void xDeltaDCQuantScaleDown ( TComDataCU* pcCU, Int& riDeltaDC ); 149 125 #endif 150 126 … … 169 145 Void predIntraChromaAng ( TComPattern* pcTComPattern, Int* piSrc, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, TComDataCU* pcCU, Bool bAbove, Bool bLeft ); 170 146 171 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX172 Void predIntraLumaDMM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder );173 174 Void getWedgePredDCs ( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft );175 Void calcWedgeDCs ( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 );176 Void assignWedgeDCs2Pred ( TComWedgelet* pcWedgelet, Pel* piPred, UInt uiStride, Int iDC1, Int iDC2 );177 #endif178 #if HHI_DMM_PRED_TEX179 Void getBestContourFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge, Pel* piTextureBlock = NULL );180 UInt getBestWedgeFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, WedgeDist eWedgeDist = WedgeDist_SAD, Pel* piTextureBlock = NULL );181 Void fillTexturePicTempBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piTempBlockY, UInt uiWidth, UInt uiHeight );182 #endif183 #if HHI_DMM_WEDGE_INTRA184 UInt getBestContinueWedge ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 );185 Bool getWedgeListIdx ( WedgeList* pcWedgeList, WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe );186 #endif187 188 147 Pel predIntraGetPredValDC ( Int* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft ); 189 148 … … 192 151 Int getPredicBufHeight() { return m_iYuvExtHeight; } 193 152 194 #if LM_CHROMA195 153 Void predLMIntraChroma( TComPattern* pcPattern, Int* piSrc, Pel* pPred, UInt uiPredStride, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId ); 154 Void getLumaRecPixels ( TComPattern* pcPattern, UInt uiWidth0, UInt uiHeight0 ); 155 156 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 157 Void predIntraLumaDMM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder ); 158 159 Void getWedgePredDCs ( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ); 160 Void calcWedgeDCs ( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ); 161 Void assignWedgeDCs2Pred ( TComWedgelet* pcWedgelet, Pel* piPred, UInt uiStride, Int iDC1, Int iDC2 ); 162 #endif 163 #if HHI_DMM_PRED_TEX 164 Void getBestContourFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge ); 165 UInt getBestWedgeFromTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight ); 166 Void copyTextureLumaBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piDestBlockY, UInt uiWidth, UInt uiHeight ); 167 #endif 168 #if HHI_DMM_WEDGE_INTRA 169 UInt getBestContinueWedge ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 ); 170 Bool getWedgePatternIdx ( WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ); 196 171 #endif 197 172 … … 201 176 Int xGetDCValDepth ( Int iVal1, Int iVal2, Int iVal3, Int iVal4 ); 202 177 Void xPredIntraAngDepth( Int* pSrc, Int srcStride, Pel* pDst, Int dstStride, UInt width, UInt height, UInt dirMode ); 178 203 179 }; 204 180 205 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 206 // ==================================================================================================================== 207 // Class definition TComWedgeDist 208 // ==================================================================================================================== 209 class TComWedgeDist 210 { 211 private: 212 // for distortion 213 Int m_iBlkWidth; 214 Int m_iBlkHeight; 215 216 FpDistFunc m_afpDistortFunc[8]; // [eDFunc] 217 #ifdef ROUNDING_CONTROL_BIPRED 218 FpDistFuncRnd m_afpDistortFuncRnd[4]; 219 #endif 220 221 public: 222 TComWedgeDist(); 223 virtual ~TComWedgeDist(); 224 225 // Distortion Functions 226 Void init(); 227 228 Void setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, WedgeDist eWDist, DistParam& rcDistParam ); 229 Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); 230 Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); 231 Void setDistParam( DistParam& rcDP, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false ); 232 233 #ifdef ROUNDING_CONTROL_BIPRED 234 Void setDistParam_Bi( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); 235 Void setDistParam_Bi( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); 236 #endif 237 238 private: 239 240 // static UInt xGetSAD ( DistParam* pcDtParam ); 241 static UInt xGetSAD4 ( DistParam* pcDtParam ); 242 static UInt xGetSAD8 ( DistParam* pcDtParam ); 243 static UInt xGetSAD16 ( DistParam* pcDtParam ); 244 static UInt xGetSAD32 ( DistParam* pcDtParam ); 245 // static UInt xGetSAD64 ( DistParam* pcDtParam ); 246 247 static UInt xGetSSE4 ( DistParam* pcDtParam ); 248 static UInt xGetSSE8 ( DistParam* pcDtParam ); 249 static UInt xGetSSE16 ( DistParam* pcDtParam ); 250 static UInt xGetSSE32 ( DistParam* pcDtParam ); 251 252 #ifdef ROUNDING_CONTROL_BIPRED 253 // static UInt xGetSAD ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); 254 static UInt xGetSAD4 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); 255 static UInt xGetSAD8 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); 256 static UInt xGetSAD16 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); 257 static UInt xGetSAD32 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); 258 // static UInt xGetSAD64 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); 259 #endif 260 261 public: 262 UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, WedgeDist eWDist = WedgeDist_SAD ); 263 264 };// END CLASS DEFINITION TComWedgeDist 265 #endif 181 //! \} 266 182 267 183 #endif // __TCOMPREDICTION__ 268
Note: See TracChangeset for help on using the changeset viewer.