1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2011, ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | |
---|
35 | |
---|
36 | /** \file TComPrediction.h |
---|
37 | \brief prediction class (header) |
---|
38 | */ |
---|
39 | |
---|
40 | #ifndef __TCOMPREDICTION__ |
---|
41 | #define __TCOMPREDICTION__ |
---|
42 | |
---|
43 | |
---|
44 | // Include files |
---|
45 | #include "TComPic.h" |
---|
46 | #include "TComMotionInfo.h" |
---|
47 | #include "TComPattern.h" |
---|
48 | #include "TComTrQuant.h" |
---|
49 | #include "TComPredFilter.h" |
---|
50 | #ifdef WEIGHT_PRED |
---|
51 | #include "TComWeightPrediction.h" |
---|
52 | #endif |
---|
53 | |
---|
54 | #if POZNAN_MP |
---|
55 | #include "../TLibCommon/TComMP.h" |
---|
56 | #endif |
---|
57 | |
---|
58 | // ==================================================================================================================== |
---|
59 | // Class definition |
---|
60 | // ==================================================================================================================== |
---|
61 | |
---|
62 | /// prediction class |
---|
63 | class TComPrediction : public TComPredFilter |
---|
64 | #ifdef WEIGHT_PRED |
---|
65 | , public TComWeightPrediction |
---|
66 | #endif |
---|
67 | { |
---|
68 | protected: |
---|
69 | Int* m_piYuvExt; |
---|
70 | Int m_iYuvExtStride; |
---|
71 | Int m_iYuvExtHeight; |
---|
72 | |
---|
73 | TComYuv m_acYuvPred[2]; |
---|
74 | TComYuv m_cYuvPredTemp; |
---|
75 | TComYuv m_cYuvExt; |
---|
76 | |
---|
77 | #if LM_CHROMA |
---|
78 | Pel* m_pLumaRecBuffer; // array for downsampled reconstructed luma sample |
---|
79 | Int m_iLumaRecStride; |
---|
80 | UInt m_uiaShift[ 65 ]; // Table for multiplication to substitue of division operation |
---|
81 | #endif |
---|
82 | |
---|
83 | Void xPredIntraAng ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, UInt dirMode, Bool blkAboveAvailable, Bool blkLeftAvailable ); |
---|
84 | #if ADD_PLANAR_MODE |
---|
85 | #if REFERENCE_SAMPLE_PADDING |
---|
86 | Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height ); |
---|
87 | #else |
---|
88 | Void xPredIntraPlanar ( Int* pSrc, Int srcStride, Pel*& rpDst, Int dstStride, UInt width, UInt height, Bool blkAboveAvailable, Bool blkLeftAvailable ); |
---|
89 | #endif |
---|
90 | #endif |
---|
91 | |
---|
92 | // motion compensation functions |
---|
93 | #if HIGH_ACCURACY_BI |
---|
94 | #if DEPTH_MAP_GENERATION |
---|
95 | 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 ); |
---|
96 | #else |
---|
97 | Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); |
---|
98 | #endif |
---|
99 | #else |
---|
100 | #if DEPTH_MAP_GENERATION |
---|
101 | Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); |
---|
102 | #else |
---|
103 | Void xPredInterUni ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); |
---|
104 | #endif |
---|
105 | #endif |
---|
106 | #if DEPTH_MAP_GENERATION |
---|
107 | Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); |
---|
108 | Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ); |
---|
109 | #else |
---|
110 | Void xPredInterBi ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred, Int iPartIdx ); |
---|
111 | Void xPredInterPrdDepthMap ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv, UInt uiRShift ); |
---|
112 | #endif |
---|
113 | Void xPredInterLumaBlk ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); |
---|
114 | Void xPredInterChromaBlk ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); |
---|
115 | |
---|
116 | #if DEPTH_MAP_GENERATION |
---|
117 | Void xWeightedAveragePdm ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); |
---|
118 | #endif |
---|
119 | Void xWeightedAverage ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvDst ); |
---|
120 | |
---|
121 | |
---|
122 | Void xDCTIF_FilterC ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride,Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac); |
---|
123 | |
---|
124 | #if HIGH_ACCURACY_BI |
---|
125 | Void xPredInterLumaBlk_ha ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); |
---|
126 | Void xPredInterChromaBlk_ha ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iWidth, Int iHeight, TComYuv*& rpcYuv ); |
---|
127 | Void xDCTIF_FilterC_ha ( Pel* piRefC, Int iRefStride,Pel* piDstC,Int iDstStride,Int iWidth, Int iHeight,Int iMVyFrac,Int iMVxFrac); |
---|
128 | #endif |
---|
129 | |
---|
130 | #if POZNAN_DBMP |
---|
131 | #if HIGH_ACCURACY_BI |
---|
132 | #if DEPTH_MAP_GENERATION |
---|
133 | Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0, Bool bi=false ); |
---|
134 | #else |
---|
135 | Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bi=false ); |
---|
136 | #endif |
---|
137 | #else |
---|
138 | #if DEPTH_MAP_GENERATION |
---|
139 | Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); |
---|
140 | #else |
---|
141 | Void xPredInterUni_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Int iPartIdx ); |
---|
142 | #endif |
---|
143 | #endif |
---|
144 | #if DEPTH_MAP_GENERATION |
---|
145 | Void xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuvPred, Int iPartIdx, Bool bPrdDepthMap ); |
---|
146 | Void xPredInterPrdDepthMap_DBMP( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, UInt uiSubSampExpX, UInt uiSubSampExpY, TComYuv*& rpcYuv, UInt uiRShift ); |
---|
147 | #else |
---|
148 | Void xPredInterBi_DBMP ( TComDataCU* pcCU, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvPred, Int iPartIdx ); |
---|
149 | Void xPredInterPrdDepthMap_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv, UInt uiRShift ); |
---|
150 | #endif |
---|
151 | |
---|
152 | Void xPredInterLumaBlk_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); |
---|
153 | Void xPredInterChromaBlk_DBMP ( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); |
---|
154 | |
---|
155 | #if DEPTH_MAP_GENERATION |
---|
156 | Void xWeightedAveragePdm_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst, UInt uiSubSampExpX, UInt uiSubSampExpY ); |
---|
157 | #endif |
---|
158 | Void xWeightedAverage_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvSrc0, TComYuv* pcYuvSrc1, Int iRefIdx0, Int iRefIdx1, UInt uiPartAddr, Int iPosX, Int iPosY, TComYuv*& rpcYuvDst ); |
---|
159 | |
---|
160 | #if HIGH_ACCURACY_BI |
---|
161 | Void xPredInterLumaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); |
---|
162 | Void xPredInterChromaBlk_DBMP_ha( TComDataCU* pcCU, TComPicYuv* pcPicYuvRef, UInt uiPartAddr, TComMv* pcMv, Int iPosX, Int iPosY, TComYuv*& rpcYuv ); |
---|
163 | #endif |
---|
164 | #endif |
---|
165 | |
---|
166 | #if HHI_DMM_WEDGE_INTRA |
---|
167 | 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 ); |
---|
168 | |
---|
169 | 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 ); |
---|
170 | Void xGetBlockOffset ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComDataCU* pcRefCU, UInt uiRefAbsPartIdx, UInt& ruiOffsetX, UInt& ruiOffsetY ); |
---|
171 | Bool xGetWedgeIntraDirPredData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int& riSlopeX, Int& riSlopeY, UInt& ruiStartPosX, UInt& ruiStartPosY ); |
---|
172 | Void xGetWedgeIntraDirStartEnd ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiBlockSize, Int iDeltaX, Int iDeltaY, UInt uiPMSPosX, UInt uiPMSPosY, UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, Int iDeltaEnd = 0 ); |
---|
173 | #endif |
---|
174 | #if HHI_DMM_PRED_TEX |
---|
175 | Void xPredIntraWedgeTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); |
---|
176 | Void xPredIntraContourTex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder, Bool bDelta, Int iDeltaDC1 = 0, Int iDeltaDC2 = 0 ); |
---|
177 | #endif |
---|
178 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
179 | Void xDeltaDCQuantScaleUp ( TComDataCU* pcCU, Int& riDeltaDC ); |
---|
180 | #endif |
---|
181 | |
---|
182 | #if LM_CHROMA |
---|
183 | Void xGetRecPixels ( TComPattern* pcPattern, Pel* pRecSrc, Int iRecSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth0, UInt uiHeight0 ); |
---|
184 | Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 ); |
---|
185 | #endif |
---|
186 | |
---|
187 | #if MN_DC_PRED_FILTER |
---|
188 | Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight ); |
---|
189 | #endif |
---|
190 | |
---|
191 | public: |
---|
192 | TComPrediction(); |
---|
193 | virtual ~TComPrediction(); |
---|
194 | |
---|
195 | Void initTempBuff(); |
---|
196 | |
---|
197 | // inter |
---|
198 | #if DEPTH_MAP_GENERATION |
---|
199 | Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); |
---|
200 | #else |
---|
201 | Void motionCompensation ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); |
---|
202 | #endif |
---|
203 | |
---|
204 | #if POZNAN_DBMP |
---|
205 | #if DEPTH_MAP_GENERATION |
---|
206 | Void motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1, Bool bPrdDepthMap = false, UInt uiSubSampExpX = 0, UInt uiSubSampExpY = 0 ); |
---|
207 | #else |
---|
208 | Void motionCompensation_DBMP ( TComDataCU* pcCU, TComYuv* pcYuvPred, RefPicList eRefPicList = REF_PIC_LIST_X, Int iPartIdx = -1 ); |
---|
209 | #endif |
---|
210 | |
---|
211 | #endif |
---|
212 | |
---|
213 | // motion vector prediction |
---|
214 | Void getMvPredAMVP ( TComDataCU* pcCU, UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMvPred ); |
---|
215 | |
---|
216 | // Angular Intra |
---|
217 | Void predIntraLumaAng ( TComPattern* pcTComPattern, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, TComDataCU* pcCU, Bool bAbove, Bool bLeft ); |
---|
218 | Void predIntraChromaAng ( TComPattern* pcTComPattern, Int* piSrc, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, TComDataCU* pcCU, Bool bAbove, Bool bLeft ); |
---|
219 | |
---|
220 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
221 | Void predIntraLumaDMM ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bAbove, Bool bLeft, Bool bEncoder ); |
---|
222 | |
---|
223 | Void getWedgePredDCs ( TComWedgelet* pcWedgelet, Int* piMask, Int iMaskStride, Int& riPredDC1, Int& riPredDC2, Bool bAbove, Bool bLeft ); |
---|
224 | Void calcWedgeDCs ( TComWedgelet* pcWedgelet, Pel* piOrig, UInt uiStride, Int& riDC1, Int& riDC2 ); |
---|
225 | Void assignWedgeDCs2Pred ( TComWedgelet* pcWedgelet, Pel* piPred, UInt uiStride, Int iDC1, Int iDC2 ); |
---|
226 | #endif |
---|
227 | #if HHI_DMM_PRED_TEX |
---|
228 | Void getBestContourFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, TComWedgelet* pcContourWedge, Pel* piTextureBlock = NULL ); |
---|
229 | UInt getBestWedgeFromText ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, WedgeDist eWedgeDist = WedgeDist_SAD, Pel* piTextureBlock = NULL ); |
---|
230 | Void fillTexturePicTempBlock ( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piTempBlockY, UInt uiWidth, UInt uiHeight ); |
---|
231 | #endif |
---|
232 | #if HHI_DMM_WEDGE_INTRA |
---|
233 | UInt getBestContinueWedge ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Int iDeltaEnd = 0 ); |
---|
234 | Bool getWedgeListIdx ( WedgeList* pcWedgeList, WedgeRefList* pcWedgeRefList, UInt& ruiTabIdx, UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe ); |
---|
235 | #endif |
---|
236 | |
---|
237 | Pel predIntraGetPredValDC ( Int* pSrc, Int iSrcStride, UInt iWidth, UInt iHeight, Bool bAbove, Bool bLeft ); |
---|
238 | |
---|
239 | Int* getPredicBuf() { return m_piYuvExt; } |
---|
240 | Int getPredicBufWidth() { return m_iYuvExtStride; } |
---|
241 | Int getPredicBufHeight() { return m_iYuvExtHeight; } |
---|
242 | |
---|
243 | #if LM_CHROMA |
---|
244 | Void predLMIntraChroma( TComPattern* pcPattern, Int* piSrc, Pel* pPred, UInt uiPredStride, UInt uiCWidth, UInt uiCHeight, UInt uiChromaId ); |
---|
245 | #endif |
---|
246 | |
---|
247 | // simplified intra pred for "virtual" depth maps |
---|
248 | Void predIntraDepthAng ( TComPattern* pcTComPattern, UInt uiDirMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight ); |
---|
249 | Int xGetDCDepth ( Int* pSrc, Int iDelta, Int iBlkSize ); |
---|
250 | Int xGetDCValDepth ( Int iVal1, Int iVal2, Int iVal3, Int iVal4 ); |
---|
251 | Void xPredIntraAngDepth( Int* pSrc, Int srcStride, Pel* pDst, Int dstStride, UInt width, UInt height, UInt dirMode ); |
---|
252 | }; |
---|
253 | |
---|
254 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
255 | // ==================================================================================================================== |
---|
256 | // Class definition TComWedgeDist |
---|
257 | // ==================================================================================================================== |
---|
258 | class TComWedgeDist |
---|
259 | { |
---|
260 | private: |
---|
261 | // for distortion |
---|
262 | Int m_iBlkWidth; |
---|
263 | Int m_iBlkHeight; |
---|
264 | |
---|
265 | FpDistFunc m_afpDistortFunc[8]; // [eDFunc] |
---|
266 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
267 | FpDistFuncRnd m_afpDistortFuncRnd[4]; |
---|
268 | #endif |
---|
269 | |
---|
270 | public: |
---|
271 | TComWedgeDist(); |
---|
272 | virtual ~TComWedgeDist(); |
---|
273 | |
---|
274 | // Distortion Functions |
---|
275 | Void init(); |
---|
276 | |
---|
277 | Void setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, WedgeDist eWDist, DistParam& rcDistParam ); |
---|
278 | Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); |
---|
279 | Void setDistParam( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); |
---|
280 | Void setDistParam( DistParam& rcDP, Pel* p1, Int iStride1, Pel* p2, Int iStride2, Int iWidth, Int iHeight, Bool bHadamard = false ); |
---|
281 | |
---|
282 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
283 | Void setDistParam_Bi( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, DistParam& rcDistParam ); |
---|
284 | Void setDistParam_Bi( TComPattern* pcPatternKey, Pel* piRefY, Int iRefStride, Int iStep, DistParam& rcDistParam, Bool bHADME=false ); |
---|
285 | #endif |
---|
286 | |
---|
287 | private: |
---|
288 | |
---|
289 | // static UInt xGetSAD ( DistParam* pcDtParam ); |
---|
290 | static UInt xGetSAD4 ( DistParam* pcDtParam ); |
---|
291 | static UInt xGetSAD8 ( DistParam* pcDtParam ); |
---|
292 | static UInt xGetSAD16 ( DistParam* pcDtParam ); |
---|
293 | static UInt xGetSAD32 ( DistParam* pcDtParam ); |
---|
294 | // static UInt xGetSAD64 ( DistParam* pcDtParam ); |
---|
295 | |
---|
296 | static UInt xGetSSE4 ( DistParam* pcDtParam ); |
---|
297 | static UInt xGetSSE8 ( DistParam* pcDtParam ); |
---|
298 | static UInt xGetSSE16 ( DistParam* pcDtParam ); |
---|
299 | static UInt xGetSSE32 ( DistParam* pcDtParam ); |
---|
300 | |
---|
301 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
302 | // static UInt xGetSAD ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); |
---|
303 | static UInt xGetSAD4 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); |
---|
304 | static UInt xGetSAD8 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); |
---|
305 | static UInt xGetSAD16 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); |
---|
306 | static UInt xGetSAD32 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); |
---|
307 | // static UInt xGetSAD64 ( DistParam* pcDtParam, Pel* pRefY, Bool bRound ); |
---|
308 | #endif |
---|
309 | |
---|
310 | public: |
---|
311 | UInt getDistPart( Pel* piCur, Int iCurStride, Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, WedgeDist eWDist = WedgeDist_SAD ); |
---|
312 | |
---|
313 | };// END CLASS DEFINITION TComWedgeDist |
---|
314 | #endif |
---|
315 | |
---|
316 | #endif // __TCOMPREDICTION__ |
---|
317 | |
---|