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