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