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 | Int m_iFastSearch; |
---|
97 | Int m_aaiAdaptSR[2][33]; |
---|
98 | TComMv m_cSrchRngLT; |
---|
99 | TComMv m_cSrchRngRB; |
---|
100 | TComMv m_acMvPredictors[3]; |
---|
101 | |
---|
102 | // RD computation |
---|
103 | TEncSbac*** m_pppcRDSbacCoder; |
---|
104 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
105 | Bool m_bUseSBACRD; |
---|
106 | DistParam m_cDistParam; |
---|
107 | |
---|
108 | // Misc. |
---|
109 | Pel* m_pTempPel; |
---|
110 | UInt* m_puiDFilter; |
---|
111 | Int m_iMaxDeltaQP; |
---|
112 | |
---|
113 | |
---|
114 | #if HHI_VSO |
---|
115 | TComYuv m_cYuvRecTemp; |
---|
116 | #endif |
---|
117 | |
---|
118 | // AMVP cost computation |
---|
119 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
120 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+2][AMVP_MAX_NUM_CANDS+2]; //th array bounds |
---|
121 | #else |
---|
122 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
123 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
124 | #endif |
---|
125 | |
---|
126 | public: |
---|
127 | TEncSearch(); |
---|
128 | virtual ~TEncSearch(); |
---|
129 | |
---|
130 | Void init( TEncCfg* pcEncCfg, |
---|
131 | TComTrQuant* pcTrQuant, |
---|
132 | Int iSearchRange, |
---|
133 | Int bipredSearchRange, |
---|
134 | Int iFastSearch, |
---|
135 | Int iMaxDeltaQP, |
---|
136 | TEncEntropy* pcEntropyCoder, |
---|
137 | TComRdCost* pcRdCost, |
---|
138 | TEncSbac*** pppcRDSbacCoder, |
---|
139 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
140 | |
---|
141 | protected: |
---|
142 | |
---|
143 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
144 | UInt xPatternRefinement( TComPattern* pcPatternKey, |
---|
145 | TComMv baseRefMv, |
---|
146 | Int iFrac, TComMv& rcMvFrac ); |
---|
147 | |
---|
148 | typedef struct |
---|
149 | { |
---|
150 | Pel* piRefY; |
---|
151 | Int iYStride; |
---|
152 | Int iBestX; |
---|
153 | Int iBestY; |
---|
154 | UInt uiBestRound; |
---|
155 | UInt uiBestDistance; |
---|
156 | UInt uiBestSad; |
---|
157 | UChar ucPointNr; |
---|
158 | } IntTZSearchStruct; |
---|
159 | |
---|
160 | // sub-functions for ME |
---|
161 | __inline Void xTZSearchHelp ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
162 | __inline Void xTZ2PointSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB ); |
---|
163 | __inline Void xTZ8PointSquareSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
164 | __inline Void xTZ8PointDiamondSearch( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
165 | |
---|
166 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard ); |
---|
167 | |
---|
168 | public: |
---|
169 | Void preestChromaPredMode ( TComDataCU* pcCU, |
---|
170 | TComYuv* pcOrgYuv, |
---|
171 | TComYuv* pcPredYuv ); |
---|
172 | Void estIntraPredQT ( TComDataCU* pcCU, |
---|
173 | TComYuv* pcOrgYuv, |
---|
174 | TComYuv* pcPredYuv, |
---|
175 | TComYuv* pcResiYuv, |
---|
176 | TComYuv* pcRecoYuv, |
---|
177 | Dist& ruiDistC, |
---|
178 | Bool bLumaOnly ); |
---|
179 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
180 | TComYuv* pcOrgYuv, |
---|
181 | TComYuv* pcPredYuv, |
---|
182 | TComYuv* pcResiYuv, |
---|
183 | TComYuv* pcRecoYuv, |
---|
184 | Dist uiPreCalcDistC ); |
---|
185 | |
---|
186 | |
---|
187 | /// encoder estimation - inter prediction (non-skip) |
---|
188 | Void predInterSearch ( TComDataCU* pcCU, |
---|
189 | TComYuv* pcOrgYuv, |
---|
190 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
191 | TComYuv* rpcResiPredYuv, |
---|
192 | #endif |
---|
193 | TComYuv*& rpcPredYuv, |
---|
194 | TComYuv*& rpcResiYuv, |
---|
195 | TComYuv*& rpcRecoYuv, |
---|
196 | Bool bUseRes = false |
---|
197 | #if AMP_MRG |
---|
198 | ,Bool bUseMRG = false |
---|
199 | #endif |
---|
200 | ); |
---|
201 | |
---|
202 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
203 | /// encode residual and compute rd-cost for inter mode |
---|
204 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
205 | TComYuv* pcYuvOrg, |
---|
206 | TComYuv* pcYuvPred, |
---|
207 | TComYuv*& rpcYuvResi, |
---|
208 | TComYuv*& rpcYuvResiBest, |
---|
209 | TComYuv*& rpcYuvRec, |
---|
210 | TComYuv*& rpcYuvResPrd, |
---|
211 | Bool bSkipRes ); |
---|
212 | #else |
---|
213 | /// encode residual and compute rd-cost for inter mode |
---|
214 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
215 | TComYuv* pcYuvOrg, |
---|
216 | TComYuv* pcYuvPred, |
---|
217 | TComYuv*& rpcYuvResi, |
---|
218 | TComYuv*& rpcYuvResiBest, |
---|
219 | TComYuv*& rpcYuvRec, |
---|
220 | Bool bSkipRes ); |
---|
221 | #endif |
---|
222 | /// set ME search range |
---|
223 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
224 | |
---|
225 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
226 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
227 | protected: |
---|
228 | |
---|
229 | // ------------------------------------------------------------------------------------------------------------------- |
---|
230 | // Intra search |
---|
231 | // ------------------------------------------------------------------------------------------------------------------- |
---|
232 | |
---|
233 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
234 | UInt uiTrDepth, |
---|
235 | UInt uiAbsPartIdx, |
---|
236 | Bool bLuma, |
---|
237 | Bool bChroma ); |
---|
238 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
239 | UInt uiTrDepth, |
---|
240 | UInt uiAbsPartIdx, |
---|
241 | TextType eTextType, |
---|
242 | Bool bRealCoeff ); |
---|
243 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
244 | UInt uiTrDepth, |
---|
245 | UInt uiAbsPartIdx, |
---|
246 | Bool bLuma, |
---|
247 | Bool bChroma ); |
---|
248 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
249 | UInt uiTrDepth, |
---|
250 | UInt uiAbsPartIdx, |
---|
251 | Bool bLuma, |
---|
252 | Bool bChroma, |
---|
253 | Bool bRealCoeff ); |
---|
254 | |
---|
255 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
256 | UInt uiTrDepth, |
---|
257 | UInt uiAbsPartIdx, |
---|
258 | TComYuv* pcOrgYuv, |
---|
259 | TComYuv* pcPredYuv, |
---|
260 | TComYuv* pcResiYuv, |
---|
261 | Dist& ruiDist |
---|
262 | #if LG_ZEROINTRADEPTHRESI_M26039 |
---|
263 | ,Bool bZeroResi = false |
---|
264 | #endif |
---|
265 | ); |
---|
266 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
267 | UInt uiTrDepth, |
---|
268 | UInt uiAbsPartIdx, |
---|
269 | TComYuv* pcOrgYuv, |
---|
270 | TComYuv* pcPredYuv, |
---|
271 | TComYuv* pcResiYuv, |
---|
272 | Dist& ruiDist, |
---|
273 | UInt uiChromaId ); |
---|
274 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
275 | UInt uiTrDepth, |
---|
276 | UInt uiAbsPartIdx, |
---|
277 | Bool bLumaOnly, |
---|
278 | TComYuv* pcOrgYuv, |
---|
279 | TComYuv* pcPredYuv, |
---|
280 | TComYuv* pcResiYuv, |
---|
281 | Dist& ruiDistY, |
---|
282 | Dist& ruiDistC, |
---|
283 | #if HHI_RQT_INTRA_SPEEDUP |
---|
284 | Bool bCheckFirst, |
---|
285 | #endif |
---|
286 | Double& dRDCost |
---|
287 | #if LG_ZEROINTRADEPTHRESI_M26039 |
---|
288 | ,Bool bZeroResi = false |
---|
289 | #endif |
---|
290 | ); |
---|
291 | |
---|
292 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
293 | UInt uiTrDepth, |
---|
294 | UInt uiAbsPartIdx, |
---|
295 | Bool bLumaOnly, |
---|
296 | TComYuv* pcRecoYuv ); |
---|
297 | |
---|
298 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
299 | UInt uiTrDepth, |
---|
300 | UInt uiAbsPartIdx, |
---|
301 | TComYuv* pcOrgYuv, |
---|
302 | TComYuv* pcPredYuv, |
---|
303 | TComYuv* pcResiYuv, |
---|
304 | Dist& ruiDist ); |
---|
305 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
306 | UInt uiTrDepth, |
---|
307 | UInt uiAbsPartIdx, |
---|
308 | TComYuv* pcRecoYuv ); |
---|
309 | |
---|
310 | // ------------------------------------------------------------------------------------------------------------------- |
---|
311 | // DMM intra search |
---|
312 | // ------------------------------------------------------------------------------------------------------------------- |
---|
313 | |
---|
314 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
315 | Bool predIntraLumaDMMAvailable ( UInt uiMode, |
---|
316 | UInt uiWidth, |
---|
317 | UInt uiHeight ); |
---|
318 | Void xGetWedgeDeltaDCsMinDist ( TComWedgelet* pcWedgelet, |
---|
319 | TComDataCU* pcCU, |
---|
320 | UInt uiAbsPtIdx, |
---|
321 | Pel* piOrig, |
---|
322 | Pel* piPredic, |
---|
323 | UInt uiStride, |
---|
324 | UInt uiWidth, |
---|
325 | UInt uiHeight, |
---|
326 | Int& riDeltaDC1, |
---|
327 | Int& riDeltaDC2, |
---|
328 | Bool bAboveAvail, |
---|
329 | Bool bLeftAvail ); |
---|
330 | #endif |
---|
331 | |
---|
332 | #if LGE_EDGE_INTRA |
---|
333 | Bool xEdgePartition ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
334 | Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ); |
---|
335 | Bool xConstructChainCode ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
336 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
337 | Void xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrig, UInt uiStride, Pel* piPredic, UInt uiWidth, UInt uiHeight ); |
---|
338 | #endif |
---|
339 | #endif |
---|
340 | |
---|
341 | #if HHI_DMM_WEDGE_INTRA |
---|
342 | Void findWedgeFullMinDist ( TComDataCU* pcCU, |
---|
343 | UInt uiAbsPtIdx, |
---|
344 | Pel* piOrig, |
---|
345 | Pel* piPredic, |
---|
346 | UInt uiStride, |
---|
347 | UInt uiWidth, |
---|
348 | UInt uiHeight, |
---|
349 | UInt& ruiTabIdx, |
---|
350 | Int& riDeltaDC1, |
---|
351 | Int& riDeltaDC2, |
---|
352 | Bool bAboveAvail, |
---|
353 | Bool bLeftAvail ); |
---|
354 | Void findWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
355 | UInt uiAbsPtIdx, |
---|
356 | Pel* piOrig, |
---|
357 | Pel* piPredic, |
---|
358 | UInt uiStride, |
---|
359 | UInt uiWidth, |
---|
360 | UInt uiHeight, |
---|
361 | UInt& ruiTabIdx, |
---|
362 | Int& riWedgeDeltaEnd, |
---|
363 | Int& riDeltaDC1, |
---|
364 | Int& riDeltaDC2, |
---|
365 | Bool bAboveAvail, |
---|
366 | Bool bLeftAvail ); |
---|
367 | Void xSearchWedgeFullMinDist ( TComDataCU* pcCU, |
---|
368 | UInt uiAbsPtIdx, |
---|
369 | WedgeList* pacWedgeList, |
---|
370 | Pel* piRef, |
---|
371 | UInt uiRefStride, |
---|
372 | UInt uiWidth, |
---|
373 | UInt uiHeight, |
---|
374 | UInt& ruiTabIdx, |
---|
375 | Dist& riDist ); |
---|
376 | Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
377 | UInt uiAbsPtIdx, |
---|
378 | WedgeList* pacWedgeList, |
---|
379 | Pel* piRef, |
---|
380 | UInt uiRefStride, |
---|
381 | UInt uiWidth, |
---|
382 | UInt uiHeight, |
---|
383 | UInt& ruiTabIdx, |
---|
384 | Int& riWedgeDeltaEnd ); |
---|
385 | #endif |
---|
386 | #if HHI_DMM_PRED_TEX |
---|
387 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
388 | UInt uiAbsPtIdx, |
---|
389 | Pel* piOrig, |
---|
390 | Pel* piPredic, |
---|
391 | UInt uiStride, |
---|
392 | UInt uiWidth, |
---|
393 | UInt uiHeight, |
---|
394 | UInt& ruiTabIdx, |
---|
395 | Int& riDeltaDC1, |
---|
396 | Int& riDeltaDC2, |
---|
397 | Bool bAboveAvail, |
---|
398 | Bool bLeftAvail ); |
---|
399 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
400 | UInt uiAbsPtIdx, |
---|
401 | Pel* piOrig, |
---|
402 | Pel* piPredic, |
---|
403 | UInt uiStride, |
---|
404 | UInt uiWidth, |
---|
405 | UInt uiHeight, |
---|
406 | Int& riDeltaDC1, |
---|
407 | Int& riDeltaDC2, |
---|
408 | Bool bAboveAvail, |
---|
409 | Bool bLeftAvail ); |
---|
410 | #endif |
---|
411 | |
---|
412 | // ------------------------------------------------------------------------------------------------------------------- |
---|
413 | // Inter search (AMP) |
---|
414 | // ------------------------------------------------------------------------------------------------------------------- |
---|
415 | |
---|
416 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
417 | TComYuv* pcOrgYuv, |
---|
418 | UInt uiPartIdx, |
---|
419 | RefPicList eRefPicList, |
---|
420 | Int iRefIdx, |
---|
421 | TComMv& rcMvPred, |
---|
422 | Bool bFilled = false |
---|
423 | #if H0111_MVD_L1_ZERO |
---|
424 | , UInt* puiDistBiP = NULL |
---|
425 | #endif |
---|
426 | #if ZERO_MVD_EST |
---|
427 | , UInt* puiDist = NULL |
---|
428 | #endif |
---|
429 | ); |
---|
430 | |
---|
431 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
432 | RefPicList eRefPicList, |
---|
433 | TComMv cMv, |
---|
434 | TComMv& rcMvPred, |
---|
435 | Int& riMVPIdx, |
---|
436 | UInt& ruiBits, |
---|
437 | UInt& ruiCost ); |
---|
438 | |
---|
439 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
440 | UInt uiPartIdx, |
---|
441 | UInt uiPartAddr, |
---|
442 | TComYuv* pcOrgYuv, |
---|
443 | TComYuv* pcTemplateCand, |
---|
444 | TComMv cMvCand, |
---|
445 | Int iMVPIdx, |
---|
446 | Int iMVPNum, |
---|
447 | RefPicList eRefPicList, |
---|
448 | Int iRefIdx, |
---|
449 | Int iSizeX, |
---|
450 | Int iSizeY |
---|
451 | #if ZERO_MVD_EST |
---|
452 | , UInt& ruiDist |
---|
453 | #endif |
---|
454 | ); |
---|
455 | |
---|
456 | |
---|
457 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
458 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
459 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
460 | |
---|
461 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
462 | TComYuv* pcYuvOrg, |
---|
463 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
464 | TComYuv* rpcResiPredYuv, |
---|
465 | #endif |
---|
466 | Int iPartIdx, |
---|
467 | UInt& uiInterDir, |
---|
468 | TComMvField* pacMvField, |
---|
469 | UInt& uiMergeIndex, |
---|
470 | UInt& ruiCost |
---|
471 | #if CU_BASED_MRG_CAND_LIST |
---|
472 | , TComMvField* cMvFieldNeighbours, |
---|
473 | UChar* uhInterDirNeighbours, |
---|
474 | Int& numValidMergeCand |
---|
475 | #endif |
---|
476 | ); |
---|
477 | // ------------------------------------------------------------------------------------------------------------------- |
---|
478 | // motion estimation |
---|
479 | // ------------------------------------------------------------------------------------------------------------------- |
---|
480 | |
---|
481 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
482 | TComYuv* pcYuvOrg, |
---|
483 | Int iPartIdx, |
---|
484 | RefPicList eRefPicList, |
---|
485 | TComMv* pcMvPred, |
---|
486 | Int iRefIdxPred, |
---|
487 | TComMv& rcMv, |
---|
488 | UInt& ruiBits, |
---|
489 | UInt& ruiCost, |
---|
490 | Bool bBi = false ); |
---|
491 | |
---|
492 | Void xTZSearch ( TComDataCU* pcCU, |
---|
493 | TComPattern* pcPatternKey, |
---|
494 | Pel* piRefY, |
---|
495 | Int iRefStride, |
---|
496 | TComMv* pcMvSrchRngLT, |
---|
497 | TComMv* pcMvSrchRngRB, |
---|
498 | TComMv& rcMv, |
---|
499 | UInt& ruiSAD ); |
---|
500 | |
---|
501 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
502 | TComMv& cMvPred, |
---|
503 | Int iSrchRng, |
---|
504 | TComMv& rcMvSrchRngLT, |
---|
505 | TComMv& rcMvSrchRngRB ); |
---|
506 | |
---|
507 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
508 | TComPattern* pcPatternKey, |
---|
509 | Pel* piRefY, |
---|
510 | Int iRefStride, |
---|
511 | TComMv* pcMvSrchRngLT, |
---|
512 | TComMv* pcMvSrchRngRB, |
---|
513 | TComMv& rcMv, |
---|
514 | UInt& ruiSAD ); |
---|
515 | |
---|
516 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
517 | Pel* piRefY, |
---|
518 | Int iRefStride, |
---|
519 | TComMv* pcMvSrchRngLT, |
---|
520 | TComMv* pcMvSrchRngRB, |
---|
521 | TComMv& rcMv, |
---|
522 | UInt& ruiSAD ); |
---|
523 | |
---|
524 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
525 | TComPattern* pcPatternKey, |
---|
526 | Pel* piRefY, |
---|
527 | Int iRefStride, |
---|
528 | TComMv* pcMvInt, |
---|
529 | TComMv& rcMvHalf, |
---|
530 | TComMv& rcMvQter, |
---|
531 | UInt& ruiCost |
---|
532 | ,Bool biPred |
---|
533 | ); |
---|
534 | |
---|
535 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
536 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
537 | |
---|
538 | // ------------------------------------------------------------------------------------------------------------------- |
---|
539 | // T & Q & Q-1 & T-1 |
---|
540 | // ------------------------------------------------------------------------------------------------------------------- |
---|
541 | |
---|
542 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
543 | #if IBDI_DISTORTION || HHI_VSO |
---|
544 | 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 ); |
---|
545 | #else |
---|
546 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
547 | #endif |
---|
548 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
549 | |
---|
550 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
551 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
552 | |
---|
553 | // ------------------------------------------------------------------------------------------------------------------- |
---|
554 | // compute symbol bits |
---|
555 | // ------------------------------------------------------------------------------------------------------------------- |
---|
556 | |
---|
557 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
558 | UInt uiQp, |
---|
559 | UInt uiTrMode, |
---|
560 | UInt& ruiBits, |
---|
561 | TComYuv*& rpcYuvRec, |
---|
562 | TComYuv* pcYuvPred, |
---|
563 | TComYuv*& rpcYuvResi ); |
---|
564 | |
---|
565 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
566 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
567 | |
---|
568 | };// END CLASS DEFINITION TEncSearch |
---|
569 | |
---|
570 | //! \} |
---|
571 | |
---|
572 | #endif // __TENCSEARCH__ |
---|