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 HHI_INTER_VIEW_MOTION_PRED |
---|
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 |
---|
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 HHI_INTER_VIEW_RESIDUAL_PRED |
---|
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 | #if HHIQC_DMMFASTSEARCH_B0039 |
---|
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 | #endif |
---|
415 | Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
416 | UInt uiAbsPtIdx, |
---|
417 | WedgeList* pacWedgeList, |
---|
418 | Pel* piRef, |
---|
419 | UInt uiRefStride, |
---|
420 | UInt uiWidth, |
---|
421 | UInt uiHeight, |
---|
422 | UInt& ruiTabIdx, |
---|
423 | Int& riWedgeDeltaEnd ); |
---|
424 | #endif |
---|
425 | #if HHI_DMM_PRED_TEX |
---|
426 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
427 | UInt uiAbsPtIdx, |
---|
428 | Pel* piOrig, |
---|
429 | Pel* piPredic, |
---|
430 | UInt uiStride, |
---|
431 | UInt uiWidth, |
---|
432 | UInt uiHeight, |
---|
433 | UInt& ruiTabIdx, |
---|
434 | Int& riDeltaDC1, |
---|
435 | Int& riDeltaDC2, |
---|
436 | Bool bAboveAvail, |
---|
437 | Bool bLeftAvail |
---|
438 | #if LGE_DMM3_SIMP_C0044 |
---|
439 | ,UInt& ruiIntraTabIdx |
---|
440 | #endif |
---|
441 | ); |
---|
442 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
443 | UInt uiAbsPtIdx, |
---|
444 | Pel* piOrig, |
---|
445 | Pel* piPredic, |
---|
446 | UInt uiStride, |
---|
447 | UInt uiWidth, |
---|
448 | UInt uiHeight, |
---|
449 | Int& riDeltaDC1, |
---|
450 | Int& riDeltaDC2, |
---|
451 | Bool bAboveAvail, |
---|
452 | Bool bLeftAvail ); |
---|
453 | #endif |
---|
454 | |
---|
455 | // ------------------------------------------------------------------------------------------------------------------- |
---|
456 | // Inter search (AMP) |
---|
457 | // ------------------------------------------------------------------------------------------------------------------- |
---|
458 | |
---|
459 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
460 | TComYuv* pcOrgYuv, |
---|
461 | UInt uiPartIdx, |
---|
462 | RefPicList eRefPicList, |
---|
463 | Int iRefIdx, |
---|
464 | TComMv& rcMvPred, |
---|
465 | Bool bFilled = false |
---|
466 | #if H0111_MVD_L1_ZERO |
---|
467 | , UInt* puiDistBiP = NULL |
---|
468 | #endif |
---|
469 | #if ZERO_MVD_EST |
---|
470 | , UInt* puiDist = NULL |
---|
471 | #endif |
---|
472 | ); |
---|
473 | |
---|
474 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
475 | RefPicList eRefPicList, |
---|
476 | TComMv cMv, |
---|
477 | TComMv& rcMvPred, |
---|
478 | Int& riMVPIdx, |
---|
479 | UInt& ruiBits, |
---|
480 | UInt& ruiCost ); |
---|
481 | |
---|
482 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
483 | UInt uiPartIdx, |
---|
484 | UInt uiPartAddr, |
---|
485 | TComYuv* pcOrgYuv, |
---|
486 | TComYuv* pcTemplateCand, |
---|
487 | TComMv cMvCand, |
---|
488 | Int iMVPIdx, |
---|
489 | Int iMVPNum, |
---|
490 | RefPicList eRefPicList, |
---|
491 | Int iRefIdx, |
---|
492 | Int iSizeX, |
---|
493 | Int iSizeY |
---|
494 | #if ZERO_MVD_EST |
---|
495 | , UInt& ruiDist |
---|
496 | #endif |
---|
497 | ); |
---|
498 | |
---|
499 | |
---|
500 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
501 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
502 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
503 | |
---|
504 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
505 | TComYuv* pcYuvOrg, |
---|
506 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
507 | TComYuv* rpcResiPredYuv, |
---|
508 | #endif |
---|
509 | Int iPartIdx, |
---|
510 | UInt& uiInterDir, |
---|
511 | TComMvField* pacMvField, |
---|
512 | UInt& uiMergeIndex, |
---|
513 | UInt& ruiCost |
---|
514 | #if CU_BASED_MRG_CAND_LIST |
---|
515 | , TComMvField* cMvFieldNeighbours, |
---|
516 | UChar* uhInterDirNeighbours, |
---|
517 | Int& numValidMergeCand |
---|
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 | |
---|
588 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
589 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
590 | |
---|
591 | // ------------------------------------------------------------------------------------------------------------------- |
---|
592 | // T & Q & Q-1 & T-1 |
---|
593 | // ------------------------------------------------------------------------------------------------------------------- |
---|
594 | |
---|
595 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
596 | #if IBDI_DISTORTION || HHI_VSO |
---|
597 | 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 ); |
---|
598 | #else |
---|
599 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
600 | #endif |
---|
601 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
602 | |
---|
603 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
604 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
605 | |
---|
606 | // ------------------------------------------------------------------------------------------------------------------- |
---|
607 | // compute symbol bits |
---|
608 | // ------------------------------------------------------------------------------------------------------------------- |
---|
609 | |
---|
610 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
611 | UInt uiQp, |
---|
612 | UInt uiTrMode, |
---|
613 | UInt& ruiBits, |
---|
614 | TComYuv*& rpcYuvRec, |
---|
615 | TComYuv* pcYuvPred, |
---|
616 | TComYuv*& rpcYuvResi ); |
---|
617 | |
---|
618 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
619 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
620 | |
---|
621 | };// END CLASS DEFINITION TEncSearch |
---|
622 | |
---|
623 | //! \} |
---|
624 | |
---|
625 | #endif // __TENCSEARCH__ |
---|