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