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