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