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 | #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138 |
---|
199 | TComYuv* rpcResiPredYuv, |
---|
200 | #endif |
---|
201 | TComYuv*& rpcPredYuv, |
---|
202 | TComYuv*& rpcResiYuv, |
---|
203 | TComYuv*& rpcRecoYuv, |
---|
204 | Bool bUseRes = false |
---|
205 | #if AMP_MRG |
---|
206 | ,Bool bUseMRG = false |
---|
207 | #endif |
---|
208 | ); |
---|
209 | |
---|
210 | #if H3D_IVRP |
---|
211 | /// encode residual and compute rd-cost for inter mode |
---|
212 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
213 | TComYuv* pcYuvOrg, |
---|
214 | TComYuv* pcYuvPred, |
---|
215 | TComYuv*& rpcYuvResi, |
---|
216 | TComYuv*& rpcYuvResiBest, |
---|
217 | TComYuv*& rpcYuvRec, |
---|
218 | TComYuv*& rpcYuvResPrd, |
---|
219 | Bool bSkipRes ); |
---|
220 | #else |
---|
221 | /// encode residual and compute rd-cost for inter mode |
---|
222 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
223 | TComYuv* pcYuvOrg, |
---|
224 | TComYuv* pcYuvPred, |
---|
225 | TComYuv*& rpcYuvResi, |
---|
226 | TComYuv*& rpcYuvResiBest, |
---|
227 | TComYuv*& rpcYuvRec, |
---|
228 | Bool bSkipRes ); |
---|
229 | #endif |
---|
230 | /// set ME search range |
---|
231 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
232 | |
---|
233 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
234 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
235 | protected: |
---|
236 | |
---|
237 | // ------------------------------------------------------------------------------------------------------------------- |
---|
238 | // Intra search |
---|
239 | // ------------------------------------------------------------------------------------------------------------------- |
---|
240 | |
---|
241 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
242 | UInt uiTrDepth, |
---|
243 | UInt uiAbsPartIdx, |
---|
244 | Bool bLuma, |
---|
245 | Bool bChroma ); |
---|
246 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
247 | UInt uiTrDepth, |
---|
248 | UInt uiAbsPartIdx, |
---|
249 | TextType eTextType, |
---|
250 | Bool bRealCoeff ); |
---|
251 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
252 | UInt uiTrDepth, |
---|
253 | UInt uiAbsPartIdx, |
---|
254 | Bool bLuma, |
---|
255 | Bool bChroma ); |
---|
256 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
257 | UInt uiTrDepth, |
---|
258 | UInt uiAbsPartIdx, |
---|
259 | Bool bLuma, |
---|
260 | Bool bChroma, |
---|
261 | Bool bRealCoeff ); |
---|
262 | |
---|
263 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
264 | UInt uiTrDepth, |
---|
265 | UInt uiAbsPartIdx, |
---|
266 | TComYuv* pcOrgYuv, |
---|
267 | TComYuv* pcPredYuv, |
---|
268 | TComYuv* pcResiYuv, |
---|
269 | Dist& ruiDist |
---|
270 | #if LG_ZEROINTRADEPTHRESI_A0087 |
---|
271 | ,Bool bZeroResi = false |
---|
272 | #endif |
---|
273 | ); |
---|
274 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
275 | UInt uiTrDepth, |
---|
276 | UInt uiAbsPartIdx, |
---|
277 | TComYuv* pcOrgYuv, |
---|
278 | TComYuv* pcPredYuv, |
---|
279 | TComYuv* pcResiYuv, |
---|
280 | Dist& ruiDist, |
---|
281 | UInt uiChromaId ); |
---|
282 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
283 | UInt uiTrDepth, |
---|
284 | UInt uiAbsPartIdx, |
---|
285 | Bool bLumaOnly, |
---|
286 | TComYuv* pcOrgYuv, |
---|
287 | TComYuv* pcPredYuv, |
---|
288 | TComYuv* pcResiYuv, |
---|
289 | Dist& ruiDistY, |
---|
290 | Dist& ruiDistC, |
---|
291 | #if HHI_RQT_INTRA_SPEEDUP |
---|
292 | Bool bCheckFirst, |
---|
293 | #endif |
---|
294 | Double& dRDCost |
---|
295 | #if LG_ZEROINTRADEPTHRESI_A0087 |
---|
296 | ,Bool bZeroResi = false |
---|
297 | #endif |
---|
298 | ); |
---|
299 | |
---|
300 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
301 | UInt uiTrDepth, |
---|
302 | UInt uiAbsPartIdx, |
---|
303 | Bool bLumaOnly, |
---|
304 | TComYuv* pcRecoYuv ); |
---|
305 | |
---|
306 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
307 | UInt uiTrDepth, |
---|
308 | UInt uiAbsPartIdx, |
---|
309 | TComYuv* pcOrgYuv, |
---|
310 | TComYuv* pcPredYuv, |
---|
311 | TComYuv* pcResiYuv, |
---|
312 | Dist& ruiDist ); |
---|
313 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
314 | UInt uiTrDepth, |
---|
315 | UInt uiAbsPartIdx, |
---|
316 | TComYuv* pcRecoYuv ); |
---|
317 | |
---|
318 | #if RWTH_SDC_DLT_B0036 |
---|
319 | Void xAnalyzeSegmentsSDC ( Pel* pOrig, |
---|
320 | UInt uiStride, |
---|
321 | UInt uiSize, |
---|
322 | Pel* rpSegMeans, |
---|
323 | UInt uiNumSegments, |
---|
324 | Bool* pMask, |
---|
325 | UInt uiMaskStride ); |
---|
326 | |
---|
327 | Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual ); |
---|
328 | #endif |
---|
329 | |
---|
330 | // ------------------------------------------------------------------------------------------------------------------- |
---|
331 | // DMM intra search |
---|
332 | // ------------------------------------------------------------------------------------------------------------------- |
---|
333 | |
---|
334 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
335 | |
---|
336 | Bool predIntraLumaDMMAvailable ( UInt uiMode, |
---|
337 | UInt uiWidth, |
---|
338 | #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER_M23723 |
---|
339 | UInt uiHeight, |
---|
340 | Bool bDMMAvailable34 ); |
---|
341 | #else |
---|
342 | UInt uiHeight ); |
---|
343 | #endif |
---|
344 | |
---|
345 | Void xGetWedgeDeltaDCsMinDist ( TComWedgelet* pcWedgelet, |
---|
346 | TComDataCU* pcCU, |
---|
347 | UInt uiAbsPtIdx, |
---|
348 | Pel* piOrig, |
---|
349 | Pel* piPredic, |
---|
350 | UInt uiStride, |
---|
351 | UInt uiWidth, |
---|
352 | UInt uiHeight, |
---|
353 | Int& riDeltaDC1, |
---|
354 | Int& riDeltaDC2, |
---|
355 | Bool bAboveAvail, |
---|
356 | Bool bLeftAvail ); |
---|
357 | #endif |
---|
358 | |
---|
359 | #if LGE_EDGE_INTRA_A0070 |
---|
360 | Bool xEdgePartition ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
361 | Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ); |
---|
362 | Bool xConstructChainCode ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
363 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
364 | Void xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrig, UInt uiStride, Pel* piPredic, UInt uiWidth, UInt uiHeight ); |
---|
365 | #endif |
---|
366 | #endif |
---|
367 | |
---|
368 | #if HHI_DMM_WEDGE_INTRA |
---|
369 | Void findWedgeFullMinDist ( TComDataCU* pcCU, |
---|
370 | UInt uiAbsPtIdx, |
---|
371 | Pel* piOrig, |
---|
372 | Pel* piPredic, |
---|
373 | UInt uiStride, |
---|
374 | UInt uiWidth, |
---|
375 | UInt uiHeight, |
---|
376 | UInt& ruiTabIdx, |
---|
377 | Int& riDeltaDC1, |
---|
378 | Int& riDeltaDC2, |
---|
379 | Bool bAboveAvail, |
---|
380 | Bool bLeftAvail ); |
---|
381 | Void findWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
382 | UInt uiAbsPtIdx, |
---|
383 | Pel* piOrig, |
---|
384 | Pel* piPredic, |
---|
385 | UInt uiStride, |
---|
386 | UInt uiWidth, |
---|
387 | UInt uiHeight, |
---|
388 | UInt& ruiTabIdx, |
---|
389 | Int& riWedgeDeltaEnd, |
---|
390 | Int& riDeltaDC1, |
---|
391 | Int& riDeltaDC2, |
---|
392 | Bool bAboveAvail, |
---|
393 | Bool bLeftAvail ); |
---|
394 | Void xSearchWedgeFullMinDist ( TComDataCU* pcCU, |
---|
395 | UInt uiAbsPtIdx, |
---|
396 | WedgeList* pacWedgeList, |
---|
397 | Pel* piRef, |
---|
398 | UInt uiRefStride, |
---|
399 | UInt uiWidth, |
---|
400 | UInt uiHeight, |
---|
401 | UInt& ruiTabIdx, |
---|
402 | Dist& riDist ); |
---|
403 | |
---|
404 | Void xSearchWedgeFullMinDistFast( TComDataCU* pcCU, |
---|
405 | UInt uiAbsPtIdx, |
---|
406 | WedgeNodeList* pacWedgeNodeList, |
---|
407 | WedgeList* pacWedgeList, |
---|
408 | Pel* piRef, |
---|
409 | UInt uiRefStride, |
---|
410 | UInt uiWidth, |
---|
411 | UInt uiHeight, |
---|
412 | UInt& ruiTabIdx, |
---|
413 | Dist& riDist ); |
---|
414 | Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
415 | UInt uiAbsPtIdx, |
---|
416 | WedgeList* pacWedgeList, |
---|
417 | Pel* piRef, |
---|
418 | UInt uiRefStride, |
---|
419 | UInt uiWidth, |
---|
420 | UInt uiHeight, |
---|
421 | UInt& ruiTabIdx, |
---|
422 | Int& riWedgeDeltaEnd ); |
---|
423 | #endif // HHI_DMM_WEDGE_INTRA |
---|
424 | #if HHI_DMM_PRED_TEX |
---|
425 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
426 | UInt uiAbsPtIdx, |
---|
427 | Pel* piOrig, |
---|
428 | Pel* piPredic, |
---|
429 | UInt uiStride, |
---|
430 | UInt uiWidth, |
---|
431 | UInt uiHeight, |
---|
432 | UInt& ruiTabIdx, |
---|
433 | Int& riDeltaDC1, |
---|
434 | Int& riDeltaDC2, |
---|
435 | Bool bAboveAvail, |
---|
436 | Bool bLeftAvail |
---|
437 | #if LGE_DMM3_SIMP_C0044 |
---|
438 | ,UInt& ruiIntraTabIdx |
---|
439 | #endif |
---|
440 | ); |
---|
441 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
442 | UInt uiAbsPtIdx, |
---|
443 | Pel* piOrig, |
---|
444 | Pel* piPredic, |
---|
445 | UInt uiStride, |
---|
446 | UInt uiWidth, |
---|
447 | UInt uiHeight, |
---|
448 | Int& riDeltaDC1, |
---|
449 | Int& riDeltaDC2, |
---|
450 | Bool bAboveAvail, |
---|
451 | Bool bLeftAvail ); |
---|
452 | #endif // HHI_DMM_PRED_TEX |
---|
453 | |
---|
454 | // ------------------------------------------------------------------------------------------------------------------- |
---|
455 | // Inter search (AMP) |
---|
456 | // ------------------------------------------------------------------------------------------------------------------- |
---|
457 | |
---|
458 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
459 | TComYuv* pcOrgYuv, |
---|
460 | UInt uiPartIdx, |
---|
461 | RefPicList eRefPicList, |
---|
462 | Int iRefIdx, |
---|
463 | TComMv& rcMvPred, |
---|
464 | Bool bFilled = false |
---|
465 | , UInt* puiDistBiP = NULL |
---|
466 | #if ZERO_MVD_EST |
---|
467 | , UInt* puiDist = NULL |
---|
468 | #endif |
---|
469 | ); |
---|
470 | |
---|
471 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
472 | RefPicList eRefPicList, |
---|
473 | TComMv cMv, |
---|
474 | TComMv& rcMvPred, |
---|
475 | Int& riMVPIdx, |
---|
476 | UInt& ruiBits, |
---|
477 | UInt& ruiCost ); |
---|
478 | |
---|
479 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
480 | UInt uiPartIdx, |
---|
481 | UInt uiPartAddr, |
---|
482 | TComYuv* pcOrgYuv, |
---|
483 | TComYuv* pcTemplateCand, |
---|
484 | TComMv cMvCand, |
---|
485 | Int iMVPIdx, |
---|
486 | Int iMVPNum, |
---|
487 | RefPicList eRefPicList, |
---|
488 | Int iRefIdx, |
---|
489 | Int iSizeX, |
---|
490 | Int iSizeY |
---|
491 | #if ZERO_MVD_EST |
---|
492 | , UInt& ruiDist |
---|
493 | #endif |
---|
494 | ); |
---|
495 | |
---|
496 | |
---|
497 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
498 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
499 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
500 | |
---|
501 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
502 | TComYuv* pcYuvOrg, |
---|
503 | #if LG_RESTRICTEDRESPRED_M24766 && !MTK_MDIVRP_C0138 |
---|
504 | TComYuv* rpcResiPredYuv, |
---|
505 | #endif |
---|
506 | Int iPartIdx, |
---|
507 | UInt& uiInterDir, |
---|
508 | TComMvField* pacMvField, |
---|
509 | UInt& uiMergeIndex, |
---|
510 | UInt& ruiCost |
---|
511 | #if CU_BASED_MRG_CAND_LIST |
---|
512 | , TComMvField* cMvFieldNeighbours, |
---|
513 | UChar* uhInterDirNeighbours, |
---|
514 | Int& numValidMergeCand |
---|
515 | #endif |
---|
516 | #if MERL_VSP_C0152 |
---|
517 | , Int* iVSPIndexTrue |
---|
518 | #endif |
---|
519 | ); |
---|
520 | // ------------------------------------------------------------------------------------------------------------------- |
---|
521 | // motion estimation |
---|
522 | // ------------------------------------------------------------------------------------------------------------------- |
---|
523 | |
---|
524 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
525 | TComYuv* pcYuvOrg, |
---|
526 | Int iPartIdx, |
---|
527 | RefPicList eRefPicList, |
---|
528 | TComMv* pcMvPred, |
---|
529 | Int iRefIdxPred, |
---|
530 | TComMv& rcMv, |
---|
531 | UInt& ruiBits, |
---|
532 | UInt& ruiCost, |
---|
533 | Bool bBi = false ); |
---|
534 | |
---|
535 | Void xTZSearch ( TComDataCU* pcCU, |
---|
536 | TComPattern* pcPatternKey, |
---|
537 | Pel* piRefY, |
---|
538 | Int iRefStride, |
---|
539 | TComMv* pcMvSrchRngLT, |
---|
540 | TComMv* pcMvSrchRngRB, |
---|
541 | TComMv& rcMv, |
---|
542 | UInt& ruiSAD ); |
---|
543 | |
---|
544 | #if DV_V_RESTRICTION_B0037 |
---|
545 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
546 | TComMv& cMvPred, |
---|
547 | Int iSrchRng, |
---|
548 | TComMv& rcMvSrchRngLT, |
---|
549 | TComMv& rcMvSrchRngRB, |
---|
550 | Bool bDispSrchRngRst, |
---|
551 | Int iDispVerSrchRng ); |
---|
552 | #else |
---|
553 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
554 | TComMv& cMvPred, |
---|
555 | Int iSrchRng, |
---|
556 | TComMv& rcMvSrchRngLT, |
---|
557 | TComMv& rcMvSrchRngRB ); |
---|
558 | #endif |
---|
559 | |
---|
560 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
561 | TComPattern* pcPatternKey, |
---|
562 | Pel* piRefY, |
---|
563 | Int iRefStride, |
---|
564 | TComMv* pcMvSrchRngLT, |
---|
565 | TComMv* pcMvSrchRngRB, |
---|
566 | TComMv& rcMv, |
---|
567 | UInt& ruiSAD ); |
---|
568 | |
---|
569 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
570 | Pel* piRefY, |
---|
571 | Int iRefStride, |
---|
572 | TComMv* pcMvSrchRngLT, |
---|
573 | TComMv* pcMvSrchRngRB, |
---|
574 | TComMv& rcMv, |
---|
575 | UInt& ruiSAD ); |
---|
576 | |
---|
577 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
578 | TComPattern* pcPatternKey, |
---|
579 | Pel* piRefY, |
---|
580 | Int iRefStride, |
---|
581 | TComMv* pcMvInt, |
---|
582 | TComMv& rcMvHalf, |
---|
583 | TComMv& rcMvQter, |
---|
584 | UInt& ruiCost |
---|
585 | ,Bool biPred); |
---|
586 | |
---|
587 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
588 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
589 | |
---|
590 | // ------------------------------------------------------------------------------------------------------------------- |
---|
591 | // T & Q & Q-1 & T-1 |
---|
592 | // ------------------------------------------------------------------------------------------------------------------- |
---|
593 | |
---|
594 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
595 | #if IBDI_DISTORTION || HHI_VSO |
---|
596 | 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 ); |
---|
597 | #else |
---|
598 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
599 | #endif |
---|
600 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
601 | |
---|
602 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
603 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
604 | |
---|
605 | // ------------------------------------------------------------------------------------------------------------------- |
---|
606 | // compute symbol bits |
---|
607 | // ------------------------------------------------------------------------------------------------------------------- |
---|
608 | |
---|
609 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
610 | UInt uiQp, |
---|
611 | UInt uiTrMode, |
---|
612 | UInt& ruiBits, |
---|
613 | TComYuv*& rpcYuvRec, |
---|
614 | TComYuv* pcYuvPred, |
---|
615 | TComYuv*& rpcYuvResi ); |
---|
616 | |
---|
617 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
618 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
619 | |
---|
620 | };// END CLASS DEFINITION TEncSearch |
---|
621 | |
---|
622 | //! \} |
---|
623 | |
---|
624 | #endif // __TENCSEARCH__ |
---|