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-2012, ITU/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 ITU/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 | /** \file TEncSearch.h |
---|
35 | \brief encoder search class (header) |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef __TENCSEARCH__ |
---|
39 | #define __TENCSEARCH__ |
---|
40 | |
---|
41 | // Include files |
---|
42 | #include "TLibCommon/TComYuv.h" |
---|
43 | #include "TLibCommon/TComMotionInfo.h" |
---|
44 | #include "TLibCommon/TComPattern.h" |
---|
45 | #include "TLibCommon/TComPrediction.h" |
---|
46 | #include "TLibCommon/TComTrQuant.h" |
---|
47 | #include "TLibCommon/TComPic.h" |
---|
48 | #include "TEncEntropy.h" |
---|
49 | #include "TEncSbac.h" |
---|
50 | #include "TEncCfg.h" |
---|
51 | |
---|
52 | //! \ingroup TLibEncoder |
---|
53 | //! \{ |
---|
54 | |
---|
55 | class TEncCu; |
---|
56 | |
---|
57 | // ==================================================================================================================== |
---|
58 | // Class definition |
---|
59 | // ==================================================================================================================== |
---|
60 | |
---|
61 | /// encoder search class |
---|
62 | class TEncSearch : public TComPrediction |
---|
63 | { |
---|
64 | private: |
---|
65 | TCoeff** m_ppcQTTempCoeffY; |
---|
66 | TCoeff** m_ppcQTTempCoeffCb; |
---|
67 | TCoeff** m_ppcQTTempCoeffCr; |
---|
68 | TCoeff* m_pcQTTempCoeffY; |
---|
69 | TCoeff* m_pcQTTempCoeffCb; |
---|
70 | TCoeff* m_pcQTTempCoeffCr; |
---|
71 | #if ADAPTIVE_QP_SELECTION |
---|
72 | Int** m_ppcQTTempArlCoeffY; |
---|
73 | Int** m_ppcQTTempArlCoeffCb; |
---|
74 | Int** m_ppcQTTempArlCoeffCr; |
---|
75 | Int* m_pcQTTempArlCoeffY; |
---|
76 | Int* m_pcQTTempArlCoeffCb; |
---|
77 | Int* m_pcQTTempArlCoeffCr; |
---|
78 | #endif |
---|
79 | UChar* m_puhQTTempTrIdx; |
---|
80 | UChar* m_puhQTTempCbf[3]; |
---|
81 | |
---|
82 | TComYuv* m_pcQTTempTComYuv; |
---|
83 | TComYuv m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation |
---|
84 | protected: |
---|
85 | // interface to option |
---|
86 | TEncCfg* m_pcEncCfg; |
---|
87 | |
---|
88 | // interface to classes |
---|
89 | TComTrQuant* m_pcTrQuant; |
---|
90 | TComRdCost* m_pcRdCost; |
---|
91 | TEncEntropy* m_pcEntropyCoder; |
---|
92 | |
---|
93 | // ME parameters |
---|
94 | Int m_iSearchRange; |
---|
95 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
96 | #if DV_V_RESTRICTION_B0037 |
---|
97 | Bool m_bUseDisparitySearchRangeRestriction; |
---|
98 | Int m_iVerticalDisparitySearchRange; |
---|
99 | #endif |
---|
100 | Int m_iFastSearch; |
---|
101 | Int m_aaiAdaptSR[2][33]; |
---|
102 | TComMv m_cSrchRngLT; |
---|
103 | TComMv m_cSrchRngRB; |
---|
104 | TComMv m_acMvPredictors[3]; |
---|
105 | |
---|
106 | // RD computation |
---|
107 | TEncSbac*** m_pppcRDSbacCoder; |
---|
108 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
109 | Bool m_bUseSBACRD; |
---|
110 | DistParam m_cDistParam; |
---|
111 | |
---|
112 | // Misc. |
---|
113 | Pel* m_pTempPel; |
---|
114 | UInt* m_puiDFilter; |
---|
115 | Int m_iMaxDeltaQP; |
---|
116 | |
---|
117 | |
---|
118 | #if HHI_VSO |
---|
119 | TComYuv m_cYuvRecTemp; |
---|
120 | #endif |
---|
121 | |
---|
122 | // AMVP cost computation |
---|
123 | #if H3D_IVMP |
---|
124 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+2][AMVP_MAX_NUM_CANDS+2]; //th array bounds |
---|
125 | #else |
---|
126 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
127 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
128 | #endif |
---|
129 | |
---|
130 | public: |
---|
131 | TEncSearch(); |
---|
132 | virtual ~TEncSearch(); |
---|
133 | |
---|
134 | Void init( TEncCfg* pcEncCfg, |
---|
135 | TComTrQuant* pcTrQuant, |
---|
136 | Int iSearchRange, |
---|
137 | Int bipredSearchRange, |
---|
138 | #if DV_V_RESTRICTION_B0037 |
---|
139 | Bool bUseDisparitySearchRangeRestriction, |
---|
140 | Int iVerticalDisparitySearchRange, |
---|
141 | #endif |
---|
142 | Int iFastSearch, |
---|
143 | Int iMaxDeltaQP, |
---|
144 | TEncEntropy* pcEntropyCoder, |
---|
145 | TComRdCost* pcRdCost, |
---|
146 | TEncSbac*** pppcRDSbacCoder, |
---|
147 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
148 | |
---|
149 | protected: |
---|
150 | |
---|
151 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
152 | UInt xPatternRefinement( TComPattern* pcPatternKey, |
---|
153 | TComMv baseRefMv, |
---|
154 | Int iFrac, TComMv& rcMvFrac); |
---|
155 | |
---|
156 | typedef struct |
---|
157 | { |
---|
158 | Pel* piRefY; |
---|
159 | Int iYStride; |
---|
160 | Int iBestX; |
---|
161 | Int iBestY; |
---|
162 | UInt uiBestRound; |
---|
163 | UInt uiBestDistance; |
---|
164 | UInt uiBestSad; |
---|
165 | UChar ucPointNr; |
---|
166 | } IntTZSearchStruct; |
---|
167 | |
---|
168 | // sub-functions for ME |
---|
169 | __inline Void xTZSearchHelp ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
170 | __inline Void xTZ2PointSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB ); |
---|
171 | __inline Void xTZ8PointSquareSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
172 | __inline Void xTZ8PointDiamondSearch( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
173 | |
---|
174 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard ); |
---|
175 | |
---|
176 | public: |
---|
177 | Void preestChromaPredMode ( TComDataCU* pcCU, |
---|
178 | TComYuv* pcOrgYuv, |
---|
179 | TComYuv* pcPredYuv ); |
---|
180 | Void estIntraPredQT ( TComDataCU* pcCU, |
---|
181 | TComYuv* pcOrgYuv, |
---|
182 | TComYuv* pcPredYuv, |
---|
183 | TComYuv* pcResiYuv, |
---|
184 | TComYuv* pcRecoYuv, |
---|
185 | Dist& ruiDistC, |
---|
186 | Bool bLumaOnly ); |
---|
187 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
188 | TComYuv* pcOrgYuv, |
---|
189 | TComYuv* pcPredYuv, |
---|
190 | TComYuv* pcResiYuv, |
---|
191 | TComYuv* pcRecoYuv, |
---|
192 | Dist uiPreCalcDistC ); |
---|
193 | |
---|
194 | |
---|
195 | /// encoder estimation - inter prediction (non-skip) |
---|
196 | Void predInterSearch ( TComDataCU* pcCU, |
---|
197 | TComYuv* pcOrgYuv, |
---|
198 | TComYuv*& rpcPredYuv, |
---|
199 | TComYuv*& rpcResiYuv, |
---|
200 | TComYuv*& rpcRecoYuv, |
---|
201 | Bool bUseRes = false |
---|
202 | #if AMP_MRG |
---|
203 | ,Bool bUseMRG = false |
---|
204 | #endif |
---|
205 | ); |
---|
206 | |
---|
207 | #if H3D_IVRP |
---|
208 | /// encode residual and compute rd-cost for inter mode |
---|
209 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
210 | TComYuv* pcYuvOrg, |
---|
211 | TComYuv* pcYuvPred, |
---|
212 | TComYuv*& rpcYuvResi, |
---|
213 | TComYuv*& rpcYuvResiBest, |
---|
214 | TComYuv*& rpcYuvRec, |
---|
215 | TComYuv*& rpcYuvResPrd, |
---|
216 | Bool bSkipRes ); |
---|
217 | #else |
---|
218 | /// encode residual and compute rd-cost for inter mode |
---|
219 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
220 | TComYuv* pcYuvOrg, |
---|
221 | TComYuv* pcYuvPred, |
---|
222 | TComYuv*& rpcYuvResi, |
---|
223 | TComYuv*& rpcYuvResiBest, |
---|
224 | TComYuv*& rpcYuvRec, |
---|
225 | Bool bSkipRes ); |
---|
226 | #endif |
---|
227 | /// set ME search range |
---|
228 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
229 | |
---|
230 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
231 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
232 | protected: |
---|
233 | |
---|
234 | // ------------------------------------------------------------------------------------------------------------------- |
---|
235 | // Intra search |
---|
236 | // ------------------------------------------------------------------------------------------------------------------- |
---|
237 | |
---|
238 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
239 | UInt uiTrDepth, |
---|
240 | UInt uiAbsPartIdx, |
---|
241 | Bool bLuma, |
---|
242 | Bool bChroma ); |
---|
243 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
244 | UInt uiTrDepth, |
---|
245 | UInt uiAbsPartIdx, |
---|
246 | TextType eTextType, |
---|
247 | Bool bRealCoeff ); |
---|
248 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
249 | UInt uiTrDepth, |
---|
250 | UInt uiAbsPartIdx, |
---|
251 | Bool bLuma, |
---|
252 | Bool bChroma ); |
---|
253 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
254 | UInt uiTrDepth, |
---|
255 | UInt uiAbsPartIdx, |
---|
256 | Bool bLuma, |
---|
257 | Bool bChroma, |
---|
258 | Bool bRealCoeff ); |
---|
259 | |
---|
260 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
261 | UInt uiTrDepth, |
---|
262 | UInt uiAbsPartIdx, |
---|
263 | TComYuv* pcOrgYuv, |
---|
264 | TComYuv* pcPredYuv, |
---|
265 | TComYuv* pcResiYuv, |
---|
266 | Dist& ruiDist |
---|
267 | #if LG_ZEROINTRADEPTHRESI_A0087 |
---|
268 | ,Bool bZeroResi = false |
---|
269 | #endif |
---|
270 | ); |
---|
271 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
272 | UInt uiTrDepth, |
---|
273 | UInt uiAbsPartIdx, |
---|
274 | TComYuv* pcOrgYuv, |
---|
275 | TComYuv* pcPredYuv, |
---|
276 | TComYuv* pcResiYuv, |
---|
277 | Dist& ruiDist, |
---|
278 | UInt uiChromaId ); |
---|
279 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
280 | UInt uiTrDepth, |
---|
281 | UInt uiAbsPartIdx, |
---|
282 | Bool bLumaOnly, |
---|
283 | TComYuv* pcOrgYuv, |
---|
284 | TComYuv* pcPredYuv, |
---|
285 | TComYuv* pcResiYuv, |
---|
286 | Dist& ruiDistY, |
---|
287 | Dist& ruiDistC, |
---|
288 | #if HHI_RQT_INTRA_SPEEDUP |
---|
289 | Bool bCheckFirst, |
---|
290 | #endif |
---|
291 | Double& dRDCost |
---|
292 | #if LG_ZEROINTRADEPTHRESI_A0087 |
---|
293 | ,Bool bZeroResi = false |
---|
294 | #endif |
---|
295 | ); |
---|
296 | |
---|
297 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
298 | UInt uiTrDepth, |
---|
299 | UInt uiAbsPartIdx, |
---|
300 | Bool bLumaOnly, |
---|
301 | TComYuv* pcRecoYuv ); |
---|
302 | |
---|
303 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
304 | UInt uiTrDepth, |
---|
305 | UInt uiAbsPartIdx, |
---|
306 | TComYuv* pcOrgYuv, |
---|
307 | TComYuv* pcPredYuv, |
---|
308 | TComYuv* pcResiYuv, |
---|
309 | Dist& ruiDist ); |
---|
310 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
311 | UInt uiTrDepth, |
---|
312 | UInt uiAbsPartIdx, |
---|
313 | TComYuv* pcRecoYuv ); |
---|
314 | |
---|
315 | #if RWTH_SDC_DLT_B0036 |
---|
316 | Void xAnalyzeSegmentsSDC ( Pel* pOrig, |
---|
317 | UInt uiStride, |
---|
318 | UInt uiSize, |
---|
319 | Pel* rpSegMeans, |
---|
320 | UInt uiNumSegments, |
---|
321 | Bool* pMask, |
---|
322 | UInt uiMaskStride ); |
---|
323 | |
---|
324 | Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ); |
---|
325 | #endif |
---|
326 | |
---|
327 | // ------------------------------------------------------------------------------------------------------------------- |
---|
328 | // DMM intra search |
---|
329 | // ------------------------------------------------------------------------------------------------------------------- |
---|
330 | |
---|
331 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
332 | |
---|
333 | Bool predIntraLumaDMMAvailable ( UInt uiMode, |
---|
334 | UInt uiWidth, |
---|
335 | #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723 |
---|
336 | UInt uiHeight, |
---|
337 | Bool bDMMAvailable34 ); |
---|
338 | #else |
---|
339 | UInt uiHeight ); |
---|
340 | #endif |
---|
341 | |
---|
342 | Void xGetWedgeDeltaDCsMinDist ( TComWedgelet* pcWedgelet, |
---|
343 | TComDataCU* pcCU, |
---|
344 | UInt uiAbsPtIdx, |
---|
345 | Pel* piOrig, |
---|
346 | Pel* piPredic, |
---|
347 | UInt uiStride, |
---|
348 | UInt uiWidth, |
---|
349 | UInt uiHeight, |
---|
350 | Int& riDeltaDC1, |
---|
351 | Int& riDeltaDC2, |
---|
352 | Bool bAboveAvail, |
---|
353 | Bool bLeftAvail ); |
---|
354 | #endif |
---|
355 | |
---|
356 | #if LGE_EDGE_INTRA_A0070 |
---|
357 | Bool xEdgePartition ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
358 | Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ); |
---|
359 | Bool xConstructChainCode ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
360 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
361 | Void xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrig, UInt uiStride, Pel* piPredic, UInt uiWidth, UInt uiHeight ); |
---|
362 | #endif |
---|
363 | #endif |
---|
364 | |
---|
365 | #if HHI_DMM_WEDGE_INTRA |
---|
366 | Void findWedgeFullMinDist ( TComDataCU* pcCU, |
---|
367 | UInt uiAbsPtIdx, |
---|
368 | Pel* piOrig, |
---|
369 | Pel* piPredic, |
---|
370 | UInt uiStride, |
---|
371 | UInt uiWidth, |
---|
372 | UInt uiHeight, |
---|
373 | UInt& ruiTabIdx, |
---|
374 | Int& riDeltaDC1, |
---|
375 | Int& riDeltaDC2, |
---|
376 | Bool bAboveAvail, |
---|
377 | Bool bLeftAvail ); |
---|
378 | Void findWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
379 | UInt uiAbsPtIdx, |
---|
380 | Pel* piOrig, |
---|
381 | Pel* piPredic, |
---|
382 | UInt uiStride, |
---|
383 | UInt uiWidth, |
---|
384 | UInt uiHeight, |
---|
385 | UInt& ruiTabIdx, |
---|
386 | Int& riWedgeDeltaEnd, |
---|
387 | Int& riDeltaDC1, |
---|
388 | Int& riDeltaDC2, |
---|
389 | Bool bAboveAvail, |
---|
390 | Bool bLeftAvail ); |
---|
391 | Void xSearchWedgeFullMinDist ( TComDataCU* pcCU, |
---|
392 | UInt uiAbsPtIdx, |
---|
393 | WedgeList* pacWedgeList, |
---|
394 | Pel* piRef, |
---|
395 | UInt uiRefStride, |
---|
396 | UInt uiWidth, |
---|
397 | UInt uiHeight, |
---|
398 | UInt& ruiTabIdx, |
---|
399 | Dist& riDist ); |
---|
400 | |
---|
401 | Void xSearchWedgeFullMinDistFast( TComDataCU* pcCU, |
---|
402 | UInt uiAbsPtIdx, |
---|
403 | WedgeNodeList* pacWedgeNodeList, |
---|
404 | WedgeList* pacWedgeList, |
---|
405 | Pel* piRef, |
---|
406 | UInt uiRefStride, |
---|
407 | UInt uiWidth, |
---|
408 | UInt uiHeight, |
---|
409 | UInt& ruiTabIdx, |
---|
410 | Dist& riDist ); |
---|
411 | Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
412 | UInt uiAbsPtIdx, |
---|
413 | WedgeList* pacWedgeList, |
---|
414 | Pel* piRef, |
---|
415 | UInt uiRefStride, |
---|
416 | UInt uiWidth, |
---|
417 | UInt uiHeight, |
---|
418 | UInt& ruiTabIdx, |
---|
419 | Int& riWedgeDeltaEnd ); |
---|
420 | #endif // HHI_DMM_WEDGE_INTRA |
---|
421 | #if HHI_DMM_PRED_TEX |
---|
422 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
423 | UInt uiAbsPtIdx, |
---|
424 | Pel* piOrig, |
---|
425 | Pel* piPredic, |
---|
426 | UInt uiStride, |
---|
427 | UInt uiWidth, |
---|
428 | UInt uiHeight, |
---|
429 | UInt& ruiTabIdx, |
---|
430 | Int& riDeltaDC1, |
---|
431 | Int& riDeltaDC2, |
---|
432 | Bool bAboveAvail, |
---|
433 | Bool bLeftAvail |
---|
434 | #if LGE_DMM3_SIMP_C0044 |
---|
435 | ,UInt& ruiIntraTabIdx |
---|
436 | #endif |
---|
437 | ); |
---|
438 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
439 | UInt uiAbsPtIdx, |
---|
440 | Pel* piOrig, |
---|
441 | Pel* piPredic, |
---|
442 | UInt uiStride, |
---|
443 | UInt uiWidth, |
---|
444 | UInt uiHeight, |
---|
445 | Int& riDeltaDC1, |
---|
446 | Int& riDeltaDC2, |
---|
447 | Bool bAboveAvail, |
---|
448 | Bool bLeftAvail ); |
---|
449 | #endif // HHI_DMM_PRED_TEX |
---|
450 | |
---|
451 | // ------------------------------------------------------------------------------------------------------------------- |
---|
452 | // Inter search (AMP) |
---|
453 | // ------------------------------------------------------------------------------------------------------------------- |
---|
454 | |
---|
455 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
456 | TComYuv* pcOrgYuv, |
---|
457 | UInt uiPartIdx, |
---|
458 | RefPicList eRefPicList, |
---|
459 | Int iRefIdx, |
---|
460 | TComMv& rcMvPred, |
---|
461 | Bool bFilled = false |
---|
462 | , UInt* puiDistBiP = NULL |
---|
463 | #if ZERO_MVD_EST |
---|
464 | , UInt* puiDist = NULL |
---|
465 | #endif |
---|
466 | ); |
---|
467 | |
---|
468 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
469 | RefPicList eRefPicList, |
---|
470 | TComMv cMv, |
---|
471 | TComMv& rcMvPred, |
---|
472 | Int& riMVPIdx, |
---|
473 | UInt& ruiBits, |
---|
474 | UInt& ruiCost ); |
---|
475 | |
---|
476 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
477 | UInt uiPartIdx, |
---|
478 | UInt uiPartAddr, |
---|
479 | TComYuv* pcOrgYuv, |
---|
480 | TComYuv* pcTemplateCand, |
---|
481 | TComMv cMvCand, |
---|
482 | Int iMVPIdx, |
---|
483 | Int iMVPNum, |
---|
484 | RefPicList eRefPicList, |
---|
485 | Int iRefIdx, |
---|
486 | Int iSizeX, |
---|
487 | Int iSizeY |
---|
488 | #if ZERO_MVD_EST |
---|
489 | , UInt& ruiDist |
---|
490 | #endif |
---|
491 | ); |
---|
492 | |
---|
493 | |
---|
494 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
495 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
496 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
497 | |
---|
498 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
499 | TComYuv* pcYuvOrg, |
---|
500 | Int iPartIdx, |
---|
501 | UInt& uiInterDir, |
---|
502 | TComMvField* pacMvField, |
---|
503 | UInt& uiMergeIndex, |
---|
504 | UInt& ruiCost |
---|
505 | #if CU_BASED_MRG_CAND_LIST |
---|
506 | , TComMvField* cMvFieldNeighbours, |
---|
507 | UChar* uhInterDirNeighbours, |
---|
508 | Int& numValidMergeCand |
---|
509 | #endif |
---|
510 | #if MERL_VSP_C0152 |
---|
511 | , Int* iVSPIndexTrue |
---|
512 | #endif |
---|
513 | #if MERL_VSP_NBDV_RefVId_Fix_D0166 |
---|
514 | , Int* iVSPDirTrue |
---|
515 | #endif |
---|
516 | ); |
---|
517 | // ------------------------------------------------------------------------------------------------------------------- |
---|
518 | // motion estimation |
---|
519 | // ------------------------------------------------------------------------------------------------------------------- |
---|
520 | |
---|
521 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
522 | TComYuv* pcYuvOrg, |
---|
523 | Int iPartIdx, |
---|
524 | RefPicList eRefPicList, |
---|
525 | TComMv* pcMvPred, |
---|
526 | Int iRefIdxPred, |
---|
527 | TComMv& rcMv, |
---|
528 | UInt& ruiBits, |
---|
529 | UInt& ruiCost, |
---|
530 | Bool bBi = false ); |
---|
531 | |
---|
532 | Void xTZSearch ( TComDataCU* pcCU, |
---|
533 | TComPattern* pcPatternKey, |
---|
534 | Pel* piRefY, |
---|
535 | Int iRefStride, |
---|
536 | TComMv* pcMvSrchRngLT, |
---|
537 | TComMv* pcMvSrchRngRB, |
---|
538 | TComMv& rcMv, |
---|
539 | UInt& ruiSAD ); |
---|
540 | |
---|
541 | #if DV_V_RESTRICTION_B0037 |
---|
542 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
543 | TComMv& cMvPred, |
---|
544 | Int iSrchRng, |
---|
545 | TComMv& rcMvSrchRngLT, |
---|
546 | TComMv& rcMvSrchRngRB, |
---|
547 | Bool bDispSrchRngRst, |
---|
548 | Int iDispVerSrchRng ); |
---|
549 | #else |
---|
550 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
551 | TComMv& cMvPred, |
---|
552 | Int iSrchRng, |
---|
553 | TComMv& rcMvSrchRngLT, |
---|
554 | TComMv& rcMvSrchRngRB ); |
---|
555 | #endif |
---|
556 | |
---|
557 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
558 | TComPattern* pcPatternKey, |
---|
559 | Pel* piRefY, |
---|
560 | Int iRefStride, |
---|
561 | TComMv* pcMvSrchRngLT, |
---|
562 | TComMv* pcMvSrchRngRB, |
---|
563 | TComMv& rcMv, |
---|
564 | UInt& ruiSAD ); |
---|
565 | |
---|
566 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
567 | Pel* piRefY, |
---|
568 | Int iRefStride, |
---|
569 | TComMv* pcMvSrchRngLT, |
---|
570 | TComMv* pcMvSrchRngRB, |
---|
571 | TComMv& rcMv, |
---|
572 | UInt& ruiSAD ); |
---|
573 | |
---|
574 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
575 | TComPattern* pcPatternKey, |
---|
576 | Pel* piRefY, |
---|
577 | Int iRefStride, |
---|
578 | TComMv* pcMvInt, |
---|
579 | TComMv& rcMvHalf, |
---|
580 | TComMv& rcMvQter, |
---|
581 | UInt& ruiCost |
---|
582 | ,Bool biPred); |
---|
583 | |
---|
584 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
585 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
586 | |
---|
587 | // ------------------------------------------------------------------------------------------------------------------- |
---|
588 | // T & Q & Q-1 & T-1 |
---|
589 | // ------------------------------------------------------------------------------------------------------------------- |
---|
590 | |
---|
591 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
592 | #if IBDI_DISTORTION || HHI_VSO |
---|
593 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
594 | #else |
---|
595 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
596 | #endif |
---|
597 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
598 | |
---|
599 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
600 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
601 | |
---|
602 | // ------------------------------------------------------------------------------------------------------------------- |
---|
603 | // compute symbol bits |
---|
604 | // ------------------------------------------------------------------------------------------------------------------- |
---|
605 | |
---|
606 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
607 | UInt uiQp, |
---|
608 | UInt uiTrMode, |
---|
609 | UInt& ruiBits, |
---|
610 | TComYuv*& rpcYuvRec, |
---|
611 | TComYuv* pcYuvPred, |
---|
612 | TComYuv*& rpcYuvResi ); |
---|
613 | |
---|
614 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
615 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
616 | |
---|
617 | };// END CLASS DEFINITION TEncSearch |
---|
618 | |
---|
619 | //! \} |
---|
620 | |
---|
621 | #endif // __TENCSEARCH__ |
---|