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