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 | #if HHIQC_DMMFASTSEARCH_B0039 |
---|
377 | Void xSearchWedgeFullMinDistFast( TComDataCU* pcCU, |
---|
378 | UInt uiAbsPtIdx, |
---|
379 | WedgeNodeList* pacWedgeNodeList, |
---|
380 | WedgeList* pacWedgeList, |
---|
381 | Pel* piRef, |
---|
382 | UInt uiRefStride, |
---|
383 | UInt uiWidth, |
---|
384 | UInt uiHeight, |
---|
385 | UInt& ruiTabIdx, |
---|
386 | Dist& riDist ); |
---|
387 | #endif |
---|
388 | Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
389 | UInt uiAbsPtIdx, |
---|
390 | WedgeList* pacWedgeList, |
---|
391 | Pel* piRef, |
---|
392 | UInt uiRefStride, |
---|
393 | UInt uiWidth, |
---|
394 | UInt uiHeight, |
---|
395 | UInt& ruiTabIdx, |
---|
396 | Int& riWedgeDeltaEnd ); |
---|
397 | #endif |
---|
398 | #if HHI_DMM_PRED_TEX |
---|
399 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
400 | UInt uiAbsPtIdx, |
---|
401 | Pel* piOrig, |
---|
402 | Pel* piPredic, |
---|
403 | UInt uiStride, |
---|
404 | UInt uiWidth, |
---|
405 | UInt uiHeight, |
---|
406 | UInt& ruiTabIdx, |
---|
407 | Int& riDeltaDC1, |
---|
408 | Int& riDeltaDC2, |
---|
409 | Bool bAboveAvail, |
---|
410 | Bool bLeftAvail ); |
---|
411 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
412 | UInt uiAbsPtIdx, |
---|
413 | Pel* piOrig, |
---|
414 | Pel* piPredic, |
---|
415 | UInt uiStride, |
---|
416 | UInt uiWidth, |
---|
417 | UInt uiHeight, |
---|
418 | Int& riDeltaDC1, |
---|
419 | Int& riDeltaDC2, |
---|
420 | Bool bAboveAvail, |
---|
421 | Bool bLeftAvail ); |
---|
422 | #endif |
---|
423 | |
---|
424 | // ------------------------------------------------------------------------------------------------------------------- |
---|
425 | // Inter search (AMP) |
---|
426 | // ------------------------------------------------------------------------------------------------------------------- |
---|
427 | |
---|
428 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
429 | TComYuv* pcOrgYuv, |
---|
430 | UInt uiPartIdx, |
---|
431 | RefPicList eRefPicList, |
---|
432 | Int iRefIdx, |
---|
433 | TComMv& rcMvPred, |
---|
434 | Bool bFilled = false |
---|
435 | #if H0111_MVD_L1_ZERO |
---|
436 | , UInt* puiDistBiP = NULL |
---|
437 | #endif |
---|
438 | #if ZERO_MVD_EST |
---|
439 | , UInt* puiDist = NULL |
---|
440 | #endif |
---|
441 | ); |
---|
442 | |
---|
443 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
444 | RefPicList eRefPicList, |
---|
445 | TComMv cMv, |
---|
446 | TComMv& rcMvPred, |
---|
447 | Int& riMVPIdx, |
---|
448 | UInt& ruiBits, |
---|
449 | UInt& ruiCost ); |
---|
450 | |
---|
451 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
452 | UInt uiPartIdx, |
---|
453 | UInt uiPartAddr, |
---|
454 | TComYuv* pcOrgYuv, |
---|
455 | TComYuv* pcTemplateCand, |
---|
456 | TComMv cMvCand, |
---|
457 | Int iMVPIdx, |
---|
458 | Int iMVPNum, |
---|
459 | RefPicList eRefPicList, |
---|
460 | Int iRefIdx, |
---|
461 | Int iSizeX, |
---|
462 | Int iSizeY |
---|
463 | #if ZERO_MVD_EST |
---|
464 | , UInt& ruiDist |
---|
465 | #endif |
---|
466 | ); |
---|
467 | |
---|
468 | |
---|
469 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
470 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
471 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
472 | |
---|
473 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
474 | TComYuv* pcYuvOrg, |
---|
475 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
476 | TComYuv* rpcResiPredYuv, |
---|
477 | #endif |
---|
478 | Int iPartIdx, |
---|
479 | UInt& uiInterDir, |
---|
480 | TComMvField* pacMvField, |
---|
481 | UInt& uiMergeIndex, |
---|
482 | UInt& ruiCost |
---|
483 | #if CU_BASED_MRG_CAND_LIST |
---|
484 | , TComMvField* cMvFieldNeighbours, |
---|
485 | UChar* uhInterDirNeighbours, |
---|
486 | Int& numValidMergeCand |
---|
487 | #endif |
---|
488 | ); |
---|
489 | // ------------------------------------------------------------------------------------------------------------------- |
---|
490 | // motion estimation |
---|
491 | // ------------------------------------------------------------------------------------------------------------------- |
---|
492 | |
---|
493 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
494 | TComYuv* pcYuvOrg, |
---|
495 | Int iPartIdx, |
---|
496 | RefPicList eRefPicList, |
---|
497 | TComMv* pcMvPred, |
---|
498 | Int iRefIdxPred, |
---|
499 | TComMv& rcMv, |
---|
500 | UInt& ruiBits, |
---|
501 | UInt& ruiCost, |
---|
502 | Bool bBi = false ); |
---|
503 | |
---|
504 | Void xTZSearch ( TComDataCU* pcCU, |
---|
505 | TComPattern* pcPatternKey, |
---|
506 | Pel* piRefY, |
---|
507 | Int iRefStride, |
---|
508 | TComMv* pcMvSrchRngLT, |
---|
509 | TComMv* pcMvSrchRngRB, |
---|
510 | TComMv& rcMv, |
---|
511 | UInt& ruiSAD ); |
---|
512 | |
---|
513 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
514 | TComMv& cMvPred, |
---|
515 | Int iSrchRng, |
---|
516 | TComMv& rcMvSrchRngLT, |
---|
517 | TComMv& rcMvSrchRngRB ); |
---|
518 | |
---|
519 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
520 | TComPattern* pcPatternKey, |
---|
521 | Pel* piRefY, |
---|
522 | Int iRefStride, |
---|
523 | TComMv* pcMvSrchRngLT, |
---|
524 | TComMv* pcMvSrchRngRB, |
---|
525 | TComMv& rcMv, |
---|
526 | UInt& ruiSAD ); |
---|
527 | |
---|
528 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
529 | Pel* piRefY, |
---|
530 | Int iRefStride, |
---|
531 | TComMv* pcMvSrchRngLT, |
---|
532 | TComMv* pcMvSrchRngRB, |
---|
533 | TComMv& rcMv, |
---|
534 | UInt& ruiSAD ); |
---|
535 | |
---|
536 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
537 | TComPattern* pcPatternKey, |
---|
538 | Pel* piRefY, |
---|
539 | Int iRefStride, |
---|
540 | TComMv* pcMvInt, |
---|
541 | TComMv& rcMvHalf, |
---|
542 | TComMv& rcMvQter, |
---|
543 | UInt& ruiCost |
---|
544 | ,Bool biPred |
---|
545 | ); |
---|
546 | |
---|
547 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
548 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
549 | |
---|
550 | // ------------------------------------------------------------------------------------------------------------------- |
---|
551 | // T & Q & Q-1 & T-1 |
---|
552 | // ------------------------------------------------------------------------------------------------------------------- |
---|
553 | |
---|
554 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
555 | #if IBDI_DISTORTION || HHI_VSO |
---|
556 | 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 ); |
---|
557 | #else |
---|
558 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
559 | #endif |
---|
560 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
561 | |
---|
562 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
563 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
564 | |
---|
565 | // ------------------------------------------------------------------------------------------------------------------- |
---|
566 | // compute symbol bits |
---|
567 | // ------------------------------------------------------------------------------------------------------------------- |
---|
568 | |
---|
569 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
570 | UInt uiQp, |
---|
571 | UInt uiTrMode, |
---|
572 | UInt& ruiBits, |
---|
573 | TComYuv*& rpcYuvRec, |
---|
574 | TComYuv* pcYuvPred, |
---|
575 | TComYuv*& rpcYuvResi ); |
---|
576 | |
---|
577 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
578 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
579 | |
---|
580 | };// END CLASS DEFINITION TEncSearch |
---|
581 | |
---|
582 | //! \} |
---|
583 | |
---|
584 | #endif // __TENCSEARCH__ |
---|