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