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-2015, 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 "TLibCommon/TComRectangle.h" |
---|
49 | #include "TEncEntropy.h" |
---|
50 | #include "TEncSbac.h" |
---|
51 | #include "TEncCfg.h" |
---|
52 | |
---|
53 | |
---|
54 | //! \ingroup TLibEncoder |
---|
55 | //! \{ |
---|
56 | |
---|
57 | class TEncCu; |
---|
58 | |
---|
59 | // ==================================================================================================================== |
---|
60 | // Class definition |
---|
61 | // ==================================================================================================================== |
---|
62 | |
---|
63 | static const UInt MAX_NUM_REF_LIST_ADAPT_SR=2; |
---|
64 | static const UInt MAX_IDX_ADAPT_SR=33; |
---|
65 | static const UInt NUM_MV_PREDICTORS=3; |
---|
66 | |
---|
67 | /// encoder search class |
---|
68 | class TEncSearch : public TComPrediction |
---|
69 | { |
---|
70 | private: |
---|
71 | TCoeff** m_ppcQTTempCoeff[MAX_NUM_COMPONENT /* 0->Y, 1->Cb, 2->Cr*/]; |
---|
72 | #if ADAPTIVE_QP_SELECTION |
---|
73 | TCoeff** m_ppcQTTempArlCoeff[MAX_NUM_COMPONENT]; |
---|
74 | #endif |
---|
75 | UChar* m_puhQTTempTrIdx; |
---|
76 | UChar* m_puhQTTempCbf[MAX_NUM_COMPONENT]; |
---|
77 | |
---|
78 | TComYuv* m_pcQTTempTComYuv; |
---|
79 | TComYuv m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation |
---|
80 | |
---|
81 | SChar* m_phQTTempCrossComponentPredictionAlpha[MAX_NUM_COMPONENT]; |
---|
82 | Pel* m_pSharedPredTransformSkip[MAX_NUM_COMPONENT]; |
---|
83 | TCoeff* m_pcQTTempTUCoeff[MAX_NUM_COMPONENT]; |
---|
84 | UChar* m_puhQTTempTransformSkipFlag[MAX_NUM_COMPONENT]; |
---|
85 | TComYuv m_pcQTTempTransformSkipTComYuv; |
---|
86 | #if ADAPTIVE_QP_SELECTION |
---|
87 | TCoeff* m_ppcQTTempTUArlCoeff[MAX_NUM_COMPONENT]; |
---|
88 | #endif |
---|
89 | |
---|
90 | protected: |
---|
91 | // interface to option |
---|
92 | TEncCfg* m_pcEncCfg; |
---|
93 | |
---|
94 | // interface to classes |
---|
95 | TComTrQuant* m_pcTrQuant; |
---|
96 | TComRdCost* m_pcRdCost; |
---|
97 | TEncEntropy* m_pcEntropyCoder; |
---|
98 | |
---|
99 | // ME parameters |
---|
100 | Int m_iSearchRange; |
---|
101 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
102 | MESearchMethod m_motionEstimationSearchMethod; |
---|
103 | Int m_aaiAdaptSR[MAX_NUM_REF_LIST_ADAPT_SR][MAX_IDX_ADAPT_SR]; |
---|
104 | TComMv m_cSrchRngLT; |
---|
105 | TComMv m_cSrchRngRB; |
---|
106 | TComMv m_acMvPredictors[NUM_MV_PREDICTORS]; // Left, Above, AboveRight. enum MVP_DIR first NUM_MV_PREDICTORS entries are suitable for accessing. |
---|
107 | |
---|
108 | // RD computation |
---|
109 | TEncSbac*** m_pppcRDSbacCoder; |
---|
110 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
111 | DistParam m_cDistParam; |
---|
112 | |
---|
113 | // Misc. |
---|
114 | Pel* m_pTempPel; |
---|
115 | |
---|
116 | // AMVP cost computation |
---|
117 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
118 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
119 | |
---|
120 | TComMv m_integerMv2Nx2N[NUM_REF_PIC_LIST_01][MAX_NUM_REF]; |
---|
121 | |
---|
122 | Bool m_isInitialized; |
---|
123 | |
---|
124 | #if SVC_EXTENSION && N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
125 | Bool m_disableILP; |
---|
126 | #endif |
---|
127 | |
---|
128 | public: |
---|
129 | TEncSearch(); |
---|
130 | virtual ~TEncSearch(); |
---|
131 | |
---|
132 | Void init(TEncCfg* pcEncCfg, |
---|
133 | TComTrQuant* pcTrQuant, |
---|
134 | Int iSearchRange, |
---|
135 | Int bipredSearchRange, |
---|
136 | MESearchMethod motionEstimationSearchMethod, |
---|
137 | const UInt maxCUWidth, |
---|
138 | const UInt maxCUHeight, |
---|
139 | const UInt maxTotalCUDepth, |
---|
140 | TEncEntropy* pcEntropyCoder, |
---|
141 | TComRdCost* pcRdCost, |
---|
142 | TEncSbac*** pppcRDSbacCoder, |
---|
143 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
144 | |
---|
145 | Void destroy(); |
---|
146 | |
---|
147 | protected: |
---|
148 | |
---|
149 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
150 | Distortion xPatternRefinement( TComPattern* pcPatternKey, |
---|
151 | TComMv baseRefMv, |
---|
152 | Int iFrac, TComMv& rcMvFrac, Bool bAllowUseOfHadamard |
---|
153 | ); |
---|
154 | |
---|
155 | typedef struct |
---|
156 | { |
---|
157 | const Pel* piRefY; |
---|
158 | Int iYStride; |
---|
159 | Int iBestX; |
---|
160 | Int iBestY; |
---|
161 | UInt uiBestRound; |
---|
162 | UInt uiBestDistance; |
---|
163 | Distortion uiBestSad; |
---|
164 | UChar ucPointNr; |
---|
165 | } IntTZSearchStruct; |
---|
166 | |
---|
167 | // sub-functions for ME |
---|
168 | __inline Void xTZSearchHelp ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
169 | __inline Void xTZ2PointSearch ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB ); |
---|
170 | __inline Void xTZ8PointSquareSearch ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
171 | __inline Void xTZ8PointDiamondSearch( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist, const Bool bCheckCornersAtDist1 ); |
---|
172 | |
---|
173 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, Distortion& ruiSAD, Bool Hadamard ); |
---|
174 | |
---|
175 | public: |
---|
176 | Void estIntraPredLumaQT ( TComDataCU* pcCU, |
---|
177 | TComYuv* pcOrgYuv, |
---|
178 | TComYuv* pcPredYuv, |
---|
179 | TComYuv* pcResiYuv, |
---|
180 | TComYuv* pcRecoYuv, |
---|
181 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE] |
---|
182 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
183 | |
---|
184 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
185 | TComYuv* pcOrgYuv, |
---|
186 | TComYuv* pcPredYuv, |
---|
187 | TComYuv* pcResiYuv, |
---|
188 | TComYuv* pcRecoYuv, |
---|
189 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE] |
---|
190 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
191 | |
---|
192 | /// encoder estimation - inter prediction (non-skip) |
---|
193 | #if SVC_EXTENSION |
---|
194 | Bool predInterSearch ( TComDataCU* pcCU, |
---|
195 | #else |
---|
196 | Void predInterSearch ( TComDataCU* pcCU, |
---|
197 | #endif |
---|
198 | TComYuv* pcOrgYuv, |
---|
199 | TComYuv* pcPredYuv, |
---|
200 | TComYuv* pcResiYuv, |
---|
201 | TComYuv* pcRecoYuv |
---|
202 | DEBUG_STRING_FN_DECLARE(sDebug), |
---|
203 | Bool bUseRes = false |
---|
204 | #if AMP_MRG |
---|
205 | ,Bool bUseMRG = false |
---|
206 | #endif |
---|
207 | ); |
---|
208 | |
---|
209 | /// encode residual and compute rd-cost for inter mode |
---|
210 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
211 | TComYuv* pcYuvOrg, |
---|
212 | TComYuv* pcYuvPred, |
---|
213 | TComYuv* pcYuvResi, |
---|
214 | TComYuv* pcYuvResiBest, |
---|
215 | TComYuv* pcYuvRec, |
---|
216 | Bool bSkipResidual |
---|
217 | DEBUG_STRING_FN_DECLARE(sDebug) ); |
---|
218 | |
---|
219 | /// set ME search range |
---|
220 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { assert(iDir < MAX_NUM_REF_LIST_ADAPT_SR && iRefIdx<Int(MAX_IDX_ADAPT_SR)); m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
221 | |
---|
222 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, const ComponentID compID ); |
---|
223 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcPredYuv, TComYuv* rpcResiYuv, TComYuv* rpcRecoYuv ); |
---|
224 | |
---|
225 | #if SVC_EXTENSION |
---|
226 | #if ENCODER_FAST_MODE |
---|
227 | Bool predInterSearchILRUni ( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, UInt refLayerId ); |
---|
228 | #endif |
---|
229 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
230 | Void setDisableILP(Bool a) {m_disableILP = a;} |
---|
231 | #endif |
---|
232 | #endif //SVC_EXTENSION |
---|
233 | |
---|
234 | protected: |
---|
235 | |
---|
236 | // ------------------------------------------------------------------------------------------------------------------- |
---|
237 | // Intra search |
---|
238 | // ------------------------------------------------------------------------------------------------------------------- |
---|
239 | |
---|
240 | Void xEncSubdivCbfQT ( TComTU &rTu, |
---|
241 | Bool bLuma, |
---|
242 | Bool bChroma ); |
---|
243 | |
---|
244 | Void xEncCoeffQT ( TComTU &rTu, |
---|
245 | ComponentID component, |
---|
246 | Bool bRealCoeff ); |
---|
247 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
248 | UInt uiTrDepth, |
---|
249 | UInt uiAbsPartIdx, |
---|
250 | Bool bLuma, |
---|
251 | Bool bChroma ); |
---|
252 | UInt xGetIntraBitsQT ( TComTU &rTu, |
---|
253 | Bool bLuma, |
---|
254 | Bool bChroma, |
---|
255 | Bool bRealCoeff ); |
---|
256 | |
---|
257 | UInt xGetIntraBitsQTChroma ( TComTU &rTu, |
---|
258 | ComponentID compID, |
---|
259 | Bool bRealCoeff ); |
---|
260 | |
---|
261 | Void xIntraCodingTUBlock ( TComYuv* pcOrgYuv, |
---|
262 | TComYuv* pcPredYuv, |
---|
263 | TComYuv* pcResiYuv, |
---|
264 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE], |
---|
265 | const Bool checkCrossCPrediction, |
---|
266 | Distortion& ruiDist, |
---|
267 | const ComponentID compID, |
---|
268 | TComTU &rTu |
---|
269 | DEBUG_STRING_FN_DECLARE(sTest) |
---|
270 | ,Int default0Save1Load2 = 0 |
---|
271 | ); |
---|
272 | |
---|
273 | Void xRecurIntraCodingLumaQT ( TComYuv* pcOrgYuv, |
---|
274 | TComYuv* pcPredYuv, |
---|
275 | TComYuv* pcResiYuv, |
---|
276 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE], |
---|
277 | Distortion& ruiDistY, |
---|
278 | #if HHI_RQT_INTRA_SPEEDUP |
---|
279 | Bool bCheckFirst, |
---|
280 | #endif |
---|
281 | Double& dRDCost, |
---|
282 | TComTU &rTu |
---|
283 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
284 | |
---|
285 | Void xSetIntraResultLumaQT ( TComYuv* pcRecoYuv, |
---|
286 | TComTU &rTu); |
---|
287 | |
---|
288 | Void xStoreCrossComponentPredictionResult ( Pel *pResiLuma, |
---|
289 | const Pel *pBestLuma, |
---|
290 | TComTU &rTu, |
---|
291 | const Int xOffset, |
---|
292 | const Int yOffset, |
---|
293 | const Int strideResi, |
---|
294 | const Int strideBest ); |
---|
295 | |
---|
296 | SChar xCalcCrossComponentPredictionAlpha ( TComTU &rTu, |
---|
297 | const ComponentID compID, |
---|
298 | const Pel* piResiL, |
---|
299 | const Pel* piResiC, |
---|
300 | const Int width, |
---|
301 | const Int height, |
---|
302 | const Int strideL, |
---|
303 | const Int strideC ); |
---|
304 | |
---|
305 | Void xRecurIntraChromaCodingQT ( TComYuv* pcOrgYuv, |
---|
306 | TComYuv* pcPredYuv, |
---|
307 | TComYuv* pcResiYuv, |
---|
308 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE], |
---|
309 | Distortion& ruiDist, |
---|
310 | TComTU &rTu |
---|
311 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
312 | |
---|
313 | Void xSetIntraResultChromaQT ( TComYuv* pcRecoYuv, TComTU &rTu); |
---|
314 | |
---|
315 | Void xStoreIntraResultQT ( const ComponentID compID, TComTU &rTu); |
---|
316 | Void xLoadIntraResultQT ( const ComponentID compID, TComTU &rTu); |
---|
317 | |
---|
318 | |
---|
319 | // ------------------------------------------------------------------------------------------------------------------- |
---|
320 | // Inter search (AMP) |
---|
321 | // ------------------------------------------------------------------------------------------------------------------- |
---|
322 | |
---|
323 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
324 | TComYuv* pcOrgYuv, |
---|
325 | UInt uiPartIdx, |
---|
326 | RefPicList eRefPicList, |
---|
327 | Int iRefIdx, |
---|
328 | TComMv& rcMvPred, |
---|
329 | Bool bFilled = false |
---|
330 | , Distortion* puiDistBiP = NULL |
---|
331 | ); |
---|
332 | |
---|
333 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
334 | RefPicList eRefPicList, |
---|
335 | TComMv cMv, |
---|
336 | TComMv& rcMvPred, |
---|
337 | Int& riMVPIdx, |
---|
338 | UInt& ruiBits, |
---|
339 | Distortion& ruiCost ); |
---|
340 | |
---|
341 | Distortion xGetTemplateCost ( TComDataCU* pcCU, |
---|
342 | UInt uiPartAddr, |
---|
343 | TComYuv* pcOrgYuv, |
---|
344 | TComYuv* pcTemplateCand, |
---|
345 | TComMv cMvCand, |
---|
346 | Int iMVPIdx, |
---|
347 | Int iMVPNum, |
---|
348 | RefPicList eRefPicList, |
---|
349 | Int iRefIdx, |
---|
350 | Int iSizeX, |
---|
351 | Int iSizeY |
---|
352 | ); |
---|
353 | |
---|
354 | |
---|
355 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
356 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
357 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
358 | |
---|
359 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
360 | TComYuv* pcYuvOrg, |
---|
361 | Int iPartIdx, |
---|
362 | UInt& uiInterDir, |
---|
363 | TComMvField* pacMvField, |
---|
364 | UInt& uiMergeIndex, |
---|
365 | Distortion& ruiCost, |
---|
366 | TComMvField* cMvFieldNeighbours, |
---|
367 | UChar* uhInterDirNeighbours, |
---|
368 | Int& numValidMergeCand |
---|
369 | ); |
---|
370 | |
---|
371 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
372 | UInt puIdx, |
---|
373 | TComMvField* mvFieldNeighbours, |
---|
374 | UChar* interDirNeighbours, |
---|
375 | Int numValidMergeCand ); |
---|
376 | |
---|
377 | |
---|
378 | // ------------------------------------------------------------------------------------------------------------------- |
---|
379 | // motion estimation |
---|
380 | // ------------------------------------------------------------------------------------------------------------------- |
---|
381 | |
---|
382 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
383 | TComYuv* pcYuvOrg, |
---|
384 | Int iPartIdx, |
---|
385 | RefPicList eRefPicList, |
---|
386 | TComMv* pcMvPred, |
---|
387 | Int iRefIdxPred, |
---|
388 | TComMv& rcMv, |
---|
389 | UInt& ruiBits, |
---|
390 | Distortion& ruiCost, |
---|
391 | Bool bBi = false ); |
---|
392 | |
---|
393 | Void xTZSearch ( const TComDataCU* const pcCU, |
---|
394 | const TComPattern* const pcPatternKey, |
---|
395 | const Pel* const piRefY, |
---|
396 | const Int iRefStride, |
---|
397 | const TComMv* const pcMvSrchRngLT, |
---|
398 | const TComMv* const pcMvSrchRngRB, |
---|
399 | TComMv& rcMv, |
---|
400 | Distortion& ruiSAD, |
---|
401 | const TComMv* const pIntegerMv2Nx2NPred, |
---|
402 | const Bool bExtendedSettings |
---|
403 | ); |
---|
404 | |
---|
405 | Void xTZSearchSelective ( const TComDataCU* const pcCU, |
---|
406 | const TComPattern* const pcPatternKey, |
---|
407 | const Pel* const piRefY, |
---|
408 | const Int iRefStride, |
---|
409 | const TComMv* const pcMvSrchRngLT, |
---|
410 | const TComMv* const pcMvSrchRngRB, |
---|
411 | TComMv& rcMv, |
---|
412 | Distortion& ruiSAD, |
---|
413 | const TComMv* const pIntegerMv2Nx2NPred |
---|
414 | ); |
---|
415 | |
---|
416 | Void xSetSearchRange ( const TComDataCU* const pcCU, |
---|
417 | const TComMv& cMvPred, |
---|
418 | const Int iSrchRng, |
---|
419 | TComMv& rcMvSrchRngLT, |
---|
420 | TComMv& rcMvSrchRngRB ); |
---|
421 | |
---|
422 | Void xPatternSearchFast ( const TComDataCU* const pcCU, |
---|
423 | const TComPattern* const pcPatternKey, |
---|
424 | const Pel* const piRefY, |
---|
425 | const Int iRefStride, |
---|
426 | const TComMv* const pcMvSrchRngLT, |
---|
427 | const TComMv* const pcMvSrchRngRB, |
---|
428 | TComMv& rcMv, |
---|
429 | Distortion& ruiSAD, |
---|
430 | const TComMv* const pIntegerMv2Nx2NPred |
---|
431 | ); |
---|
432 | |
---|
433 | Void xPatternSearch ( const TComPattern* const pcPatternKey, |
---|
434 | const Pel* piRefY, |
---|
435 | const Int iRefStride, |
---|
436 | const TComMv* const pcMvSrchRngLT, |
---|
437 | const TComMv* const pcMvSrchRngRB, |
---|
438 | TComMv& rcMv, |
---|
439 | Distortion& ruiSAD ); |
---|
440 | |
---|
441 | Void xPatternSearchFracDIF ( |
---|
442 | Bool bIsLosslessCoded, |
---|
443 | TComPattern* pcPatternKey, |
---|
444 | Pel* piRefY, |
---|
445 | Int iRefStride, |
---|
446 | TComMv* pcMvInt, |
---|
447 | TComMv& rcMvHalf, |
---|
448 | TComMv& rcMvQter, |
---|
449 | Distortion& ruiCost |
---|
450 | ); |
---|
451 | |
---|
452 | Void xExtDIFUpSamplingH( TComPattern* pcPattern ); |
---|
453 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef ); |
---|
454 | |
---|
455 | // ------------------------------------------------------------------------------------------------------------------- |
---|
456 | // T & Q & Q-1 & T-1 |
---|
457 | // ------------------------------------------------------------------------------------------------------------------- |
---|
458 | |
---|
459 | |
---|
460 | Void xEncodeInterResidualQT( const ComponentID compID, TComTU &rTu ); |
---|
461 | Void xEstimateInterResidualQT( TComYuv* pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu DEBUG_STRING_FN_DECLARE(sDebug) ); |
---|
462 | Void xSetInterResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu ); |
---|
463 | |
---|
464 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPartOffset, UInt uiDepth, const ChannelType compID ); |
---|
465 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
466 | |
---|
467 | // ------------------------------------------------------------------------------------------------------------------- |
---|
468 | // compute symbol bits |
---|
469 | // ------------------------------------------------------------------------------------------------------------------- |
---|
470 | |
---|
471 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
472 | UInt& ruiBits); |
---|
473 | |
---|
474 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
475 | inline Void setDistParamComp( ComponentID compIdx ) { m_cDistParam.compIdx = compIdx; } |
---|
476 | |
---|
477 | #if SVC_EXTENSION && REF_IDX_ME_ZEROMV |
---|
478 | Void xPatternSearchFracDIFMv0 ( TComPattern* pcPatternKey, |
---|
479 | Pel* piRefY, |
---|
480 | Int iRefStride, |
---|
481 | TComMv* pcMvInt, |
---|
482 | TComMv& rcMvHalf, |
---|
483 | TComMv& rcMvQter, |
---|
484 | UInt& ruiCost ); |
---|
485 | #endif //SVC_EXTENSION |
---|
486 | |
---|
487 | };// END CLASS DEFINITION TEncSearch |
---|
488 | |
---|
489 | //! \} |
---|
490 | |
---|
491 | #endif // __TENCSEARCH__ |
---|