HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TEncSearch.h
Go to the documentation of this file.
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 
38 #ifndef __TENCSEARCH__
39 #define __TENCSEARCH__
40 
41 // Include files
42 #include "TLibCommon/TComYuv.h"
44 #include "TLibCommon/TComPattern.h"
46 #include "TLibCommon/TComTrQuant.h"
47 #include "TLibCommon/TComPic.h"
49 #include "TEncEntropy.h"
50 #include "TEncSbac.h"
51 #include "TEncCfg.h"
52 
53 
56 
57 class TEncCu;
58 
59 // ====================================================================================================================
60 // Class definition
61 // ====================================================================================================================
62 
64 static const UInt MAX_IDX_ADAPT_SR=33;
65 static const UInt NUM_MV_PREDICTORS=3;
66 
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
74 #endif
77 
79  TComYuv m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation
80 
86 #if ADAPTIVE_QP_SELECTION
88 #endif
89 
90 protected:
91  // interface to option
93 
94  // interface to classes
98 
99  // ME parameters
101  Int m_bipredSearchRange; // Search range for bi-prediction
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
110 
111  // Misc.
113 
114  // AMVP cost computation
115  // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS];
117 
119 
121 public:
122  TEncSearch();
123  virtual ~TEncSearch();
124 
125  Void init(TEncCfg* pcEncCfg,
126  TComTrQuant* pcTrQuant,
127  Int iSearchRange,
128  Int bipredSearchRange,
129  MESearchMethod motionEstimationSearchMethod,
130  const UInt maxCUWidth,
131  const UInt maxCUHeight,
132  const UInt maxTotalCUDepth,
133  TEncEntropy* pcEntropyCoder,
134  TComRdCost* pcRdCost,
135  TEncSbac*** pppcRDSbacCoder,
136  TEncSbac* pcRDGoOnSbacCoder );
137 
138  Void destroy();
139 
140 protected:
141 
144  TComMv baseRefMv,
145  Int iFrac, TComMv& rcMvFrac, Bool bAllowUseOfHadamard
146  );
147 
148  typedef struct
149  {
150  const Pel* piRefY;
159 
160  // sub-functions for ME
161  __inline Void xTZSearchHelp ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance );
162  __inline Void xTZ2PointSearch ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB );
163  __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 );
164  __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 );
165 
166  Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, Distortion& ruiSAD, Bool Hadamard );
167 
168 public:
170  TComYuv* pcOrgYuv,
171  TComYuv* pcPredYuv,
172  TComYuv* pcResiYuv,
173  TComYuv* pcRecoYuv,
175  DEBUG_STRING_FN_DECLARE(sDebug));
176 
178  TComYuv* pcOrgYuv,
179  TComYuv* pcPredYuv,
180  TComYuv* pcResiYuv,
181  TComYuv* pcRecoYuv,
183  DEBUG_STRING_FN_DECLARE(sDebug));
184 
187  TComYuv* pcOrgYuv,
188  TComYuv* pcPredYuv,
189  TComYuv* pcResiYuv,
190  TComYuv* pcRecoYuv
191  DEBUG_STRING_FN_DECLARE(sDebug),
192  Bool bUseRes = false
193 #if AMP_MRG
194  ,Bool bUseMRG = false
195 #endif
196  );
197 
200  TComYuv* pcYuvOrg,
201  TComYuv* pcYuvPred,
202  TComYuv* pcYuvResi,
203  TComYuv* pcYuvResiBest,
204  TComYuv* pcYuvRec,
205  Bool bSkipResidual
206  DEBUG_STRING_FN_DECLARE(sDebug) );
207 
209  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; }
210 
211  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 );
212  Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcPredYuv, TComYuv* rpcResiYuv, TComYuv* rpcRecoYuv );
213 protected:
214 
215  // -------------------------------------------------------------------------------------------------------------------
216  // Intra search
217  // -------------------------------------------------------------------------------------------------------------------
218 
219  Void xEncSubdivCbfQT ( TComTU &rTu,
220  Bool bLuma,
221  Bool bChroma );
222 
223  Void xEncCoeffQT ( TComTU &rTu,
224  ComponentID component,
225  Bool bRealCoeff );
227  UInt uiTrDepth,
228  UInt uiAbsPartIdx,
229  Bool bLuma,
230  Bool bChroma );
231  UInt xGetIntraBitsQT ( TComTU &rTu,
232  Bool bLuma,
233  Bool bChroma,
234  Bool bRealCoeff );
235 
237  ComponentID compID,
238  Bool bRealCoeff );
239 
240  Void xIntraCodingTUBlock ( TComYuv* pcOrgYuv,
241  TComYuv* pcPredYuv,
242  TComYuv* pcResiYuv,
244  const Bool checkCrossCPrediction,
245  Distortion& ruiDist,
246  const ComponentID compID,
247  TComTU &rTu
249  ,Int default0Save1Load2 = 0
250  );
251 
253  TComYuv* pcPredYuv,
254  TComYuv* pcResiYuv,
255  Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE],
256  Distortion& ruiDistY,
258  Bool bCheckFirst,
259 #endif
260  Double& dRDCost,
261  TComTU &rTu
262  DEBUG_STRING_FN_DECLARE(sDebug));
263 
264  Void xSetIntraResultLumaQT ( TComYuv* pcRecoYuv,
265  TComTU &rTu);
266 
268  const Pel *pBestLuma,
269  TComTU &rTu,
270  const Int xOffset,
271  const Int yOffset,
272  const Int strideResi,
273  const Int strideBest );
274 
276  const ComponentID compID,
277  const Pel* piResiL,
278  const Pel* piResiC,
279  const Int width,
280  const Int height,
281  const Int strideL,
282  const Int strideC );
283 
285  TComYuv* pcPredYuv,
286  TComYuv* pcResiYuv,
287  Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE],
288  Distortion& ruiDist,
289  TComTU &rTu
290  DEBUG_STRING_FN_DECLARE(sDebug));
291 
292  Void xSetIntraResultChromaQT ( TComYuv* pcRecoYuv, TComTU &rTu);
293 
294  Void xStoreIntraResultQT ( const ComponentID compID, TComTU &rTu);
295  Void xLoadIntraResultQT ( const ComponentID compID, TComTU &rTu);
296 
297 
298  // -------------------------------------------------------------------------------------------------------------------
299  // Inter search (AMP)
300  // -------------------------------------------------------------------------------------------------------------------
301 
303  TComYuv* pcOrgYuv,
304  UInt uiPartIdx,
305  RefPicList eRefPicList,
306  Int iRefIdx,
307  TComMv& rcMvPred,
308  Bool bFilled = false
309  , Distortion* puiDistBiP = NULL
310  );
311 
312  Void xCheckBestMVP ( TComDataCU* pcCU,
313  RefPicList eRefPicList,
314  TComMv cMv,
315  TComMv& rcMvPred,
316  Int& riMVPIdx,
317  UInt& ruiBits,
318  Distortion& ruiCost );
319 
321  UInt uiPartAddr,
322  TComYuv* pcOrgYuv,
323  TComYuv* pcTemplateCand,
324  TComMv cMvCand,
325  Int iMVPIdx,
326  Int iMVPNum,
327  RefPicList eRefPicList,
328  Int iRefIdx,
329  Int iSizeX,
330  Int iSizeY
331  );
332 
333 
334  Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst );
335  UInt xGetMvpIdxBits ( Int iIdx, Int iNum );
336  Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]);
337 
339  TComYuv* pcYuvOrg,
340  Int iPartIdx,
341  UInt& uiInterDir,
342  TComMvField* pacMvField,
343  UInt& uiMergeIndex,
344  Distortion& ruiCost,
345  TComMvField* cMvFieldNeighbours,
346  UChar* uhInterDirNeighbours,
347  Int& numValidMergeCand
348  );
349 
351  UInt puIdx,
352  TComMvField* mvFieldNeighbours,
353  UChar* interDirNeighbours,
354  Int numValidMergeCand );
355 
356 
357  // -------------------------------------------------------------------------------------------------------------------
358  // motion estimation
359  // -------------------------------------------------------------------------------------------------------------------
360 
362  TComYuv* pcYuvOrg,
363  Int iPartIdx,
364  RefPicList eRefPicList,
365  TComMv* pcMvPred,
366  Int iRefIdxPred,
367  TComMv& rcMv,
368  UInt& ruiBits,
369  Distortion& ruiCost,
370  Bool bBi = false );
371 
372  Void xTZSearch ( const TComDataCU* const pcCU,
373  const TComPattern* const pcPatternKey,
374  const Pel* const piRefY,
375  const Int iRefStride,
376  const TComMv* const pcMvSrchRngLT,
377  const TComMv* const pcMvSrchRngRB,
378  TComMv& rcMv,
379  Distortion& ruiSAD,
380  const TComMv* const pIntegerMv2Nx2NPred,
381  const Bool bExtendedSettings
382  );
383 
384  Void xTZSearchSelective ( const TComDataCU* const pcCU,
385  const TComPattern* const pcPatternKey,
386  const Pel* const piRefY,
387  const Int iRefStride,
388  const TComMv* const pcMvSrchRngLT,
389  const TComMv* const pcMvSrchRngRB,
390  TComMv& rcMv,
391  Distortion& ruiSAD,
392  const TComMv* const pIntegerMv2Nx2NPred
393  );
394 
395  Void xSetSearchRange ( const TComDataCU* const pcCU,
396  const TComMv& cMvPred,
397  const Int iSrchRng,
398  TComMv& rcMvSrchRngLT,
399 #if !MCTS_ENC_CHECK
400  TComMv& rcMvSrchRngRB );
401 #else
402  TComMv& rcMvSrchRngRB,
403  const TComPattern* const pcPatternKey );
404 #endif
405 
406 #if MCTS_ENC_CHECK
407  Void xInitTileBorders(const TComDataCU* const pcCU, TComPattern* pcPatternKey);
408 #endif
409 
410  Void xPatternSearchFast ( const TComDataCU* const pcCU,
411  const TComPattern* const pcPatternKey,
412  const Pel* const piRefY,
413  const Int iRefStride,
414  const TComMv* const pcMvSrchRngLT,
415  const TComMv* const pcMvSrchRngRB,
416  TComMv& rcMv,
417  Distortion& ruiSAD,
418  const TComMv* const pIntegerMv2Nx2NPred
419  );
420 
421  Void xPatternSearch ( const TComPattern* const pcPatternKey,
422  const Pel* piRefY,
423  const Int iRefStride,
424  const TComMv* const pcMvSrchRngLT,
425  const TComMv* const pcMvSrchRngRB,
426  TComMv& rcMv,
427  Distortion& ruiSAD );
428 
430  Bool bIsLosslessCoded,
431  TComPattern* pcPatternKey,
432  Pel* piRefY,
433  Int iRefStride,
434  TComMv* pcMvInt,
435  TComMv& rcMvHalf,
436  TComMv& rcMvQter,
437  Distortion& ruiCost
438  );
439 
440  Void xExtDIFUpSamplingH( TComPattern* pcPattern );
441  Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef );
442 
443  // -------------------------------------------------------------------------------------------------------------------
444  // T & Q & Q-1 & T-1
445  // -------------------------------------------------------------------------------------------------------------------
446 
447 
448  Void xEncodeInterResidualQT( const ComponentID compID, TComTU &rTu );
449  Void xEstimateInterResidualQT( TComYuv* pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu DEBUG_STRING_FN_DECLARE(sDebug) );
450  Void xSetInterResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu );
451 
452  UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPartOffset, UInt uiDepth, const ChannelType compID );
453  UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList );
454 
455  // -------------------------------------------------------------------------------------------------------------------
456  // compute symbol bits
457  // -------------------------------------------------------------------------------------------------------------------
458 
460  UInt& ruiBits);
461 
462  Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur );
463  inline Void setDistParamComp( ComponentID compIdx ) { m_cDistParam.compIdx = compIdx; }
464 
465 };// END CLASS DEFINITION TEncSearch
466 
468 
469 #endif // __TENCSEARCH__
Void xRestrictBipredMergeCand(TComDataCU *pcCU, UInt puIdx, TComMvField *mvFieldNeighbours, UChar *interDirNeighbours, Int numValidMergeCand)
Int m_iSearchRange
Definition: TEncSearch.h:100
entropy encoder class (header)
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)
SChar * m_phQTTempCrossComponentPredictionAlpha[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:81
CU data structure class.
Definition: TComDataCU.h:64
static const UInt MAX_IDX_ADAPT_SR
Definition: TEncSearch.h:64
ChannelType
Definition: TypeDef.h:301
TCoeff * m_ppcQTTempTUArlCoeff[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:87
prediction class (header)
Void destroy()
Definition: TEncSearch.cpp:151
UInt Distortion
distortion measurement
Definition: TypeDef.h:260
void Void
Definition: TypeDef.h:203
MESearchMethod
supported ME search methods
Definition: TypeDef.h:463
Void xTZSearchSelective(const TComDataCU *const pcCU, const TComPattern *const pcPatternKey, const Pel *const piRefY, const Int iRefStride, const TComMv *const pcMvSrchRngLT, const TComMv *const pcMvSrchRngRB, TComMv &rcMv, Distortion &ruiSAD, const TComMv *const pIntegerMv2Nx2NPred)
TCoeff ** m_ppcQTTempArlCoeff[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:73
__inline Void xTZSearchHelp(const TComPattern *const pcPatternKey, IntTZSearchStruct &rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance)
Definition: TEncSearch.cpp:311
Pel * m_pTempPel
Definition: TEncSearch.h:112
Void xEncIntraHeader(TComDataCU *pcCU, UInt uiTrDepth, UInt uiAbsPartIdx, Bool bLuma, Bool bChroma)
Void xEncSubdivCbfQT(TComTU &rTu, Bool bLuma, Bool bChroma)
Definition: TEncSearch.cpp:907
TComRdCost * m_pcRdCost
Definition: TEncSearch.h:96
#define NULL
Definition: CommonDef.h:107
general YUV buffer class (header)
class for motion vector with reference index
static const UInt MAX_NUM_REF_LIST_ADAPT_SR
Definition: TEncSearch.h:63
neighbouring pixel access class for all components
Definition: TComPattern.h:55
Void xPatternSearchFast(const TComDataCU *const pcCU, const TComPattern *const pcPatternKey, const Pel *const piRefY, const Int iRefStride, const TComMv *const pcMvSrchRngLT, const TComMv *const pcMvSrchRngRB, TComMv &rcMv, Distortion &ruiSAD, const TComMv *const pIntegerMv2Nx2NPred)
Void xMotionEstimation(TComDataCU *pcCU, TComYuv *pcYuvOrg, Int iPartIdx, RefPicList eRefPicList, TComMv *pcMvPred, Int iRefIdxPred, TComMv &rcMv, UInt &ruiBits, Distortion &ruiCost, Bool bBi=false)
unsigned int UInt
Definition: TypeDef.h:212
Distortion xPatternRefinement(TComPattern *pcPatternKey, TComMv baseRefMv, Int iFrac, TComMv &rcMvFrac, Bool bAllowUseOfHadamard)
sub-function for motion vector refinement used in fractional-pel accuracy
Definition: TEncSearch.cpp:823
Void setDistParamComp(ComponentID compIdx)
Definition: TEncSearch.h:463
Void xEncCoeffQT(TComTU &rTu, ComponentID component, Bool bRealCoeff)
Definition: TEncSearch.cpp:978
Short Pel
pixel type
Definition: TypeDef.h:249
Void xTZSearch(const TComDataCU *const pcCU, const TComPattern *const pcPatternKey, const Pel *const piRefY, const Int iRefStride, const TComMv *const pcMvSrchRngLT, const TComMv *const pcMvSrchRngRB, TComMv &rcMv, Distortion &ruiSAD, const TComMv *const pIntegerMv2Nx2NPred, const Bool bExtendedSettings)
Void xSetIntraResultLumaQT(TComYuv *pcRecoYuv, TComTU &rTu)
encoder search class
Definition: TEncSearch.h:68
UInt xGetMvpIdxBits(Int iIdx, Int iNum)
TComYuv m_pcQTTempTransformSkipTComYuv
Definition: TEncSearch.h:85
picture class (header)
Void setWpScalingDistParam(TComDataCU *pcCU, Int iRefIdx, RefPicList eRefPicListCur)
set wp tables
__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)
Definition: TEncSearch.cpp:555
Void xAddSymbolBitsInter(TComDataCU *pcCU, UInt &ruiBits)
Int m_aaiAdaptSR[MAX_NUM_REF_LIST_ADAPT_SR][MAX_IDX_ADAPT_SR]
Definition: TEncSearch.h:103
static const Int MAX_NUM_REF
max. number of entries in picture reference list
Definition: CommonDef.h:125
Bool m_isInitialized
Definition: TEncSearch.h:120
UInt xUpdateCandList(UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt *CandModeList, Double *CandCostList)
Void xCopyAMVPInfo(AMVPInfo *pSrc, AMVPInfo *pDst)
UChar * m_puhQTTempTransformSkipFlag[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:84
Void xIntraCodingTUBlock(TComYuv *pcOrgYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE *MAX_CU_SIZE], const Bool checkCrossCPrediction, Distortion &ruiDist, const ComponentID compID, TComTU &rTu, Int default0Save1Load2=0)
Distortion xGetTemplateCost(TComDataCU *pcCU, UInt uiPartAddr, TComYuv *pcOrgYuv, TComYuv *pcTemplateCand, TComMv cMvCand, Int iMVPIdx, Int iMVPNum, RefPicList eRefPicList, Int iRefIdx, Int iSizeX, Int iSizeY)
Void xRecurIntraChromaCodingQT(TComYuv *pcOrgYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE *MAX_CU_SIZE], Distortion &ruiDist, TComTU &rTu)
Void setAdaptiveSearchRange(Int iDir, Int iRefIdx, Int iSearchRange)
set ME search range
Definition: TEncSearch.h:209
Void xInitTileBorders(const TComDataCU *const pcCU, TComPattern *pcPatternKey)
UInt xModeBitsIntra(TComDataCU *pcCU, UInt uiMode, UInt uiPartOffset, UInt uiDepth, const ChannelType compID)
TCoeff ** m_ppcQTTempCoeff[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:71
PartSize
supported partition shape
Definition: TypeDef.h:348
UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]
Definition: TEncSearch.h:116
encoder configuration class (header)
Void xPatternSearch(const TComPattern *const pcPatternKey, const Pel *piRefY, const Int iRefStride, const TComMv *const pcMvSrchRngLT, const TComMv *const pcMvSrchRngRB, TComMv &rcMv, Distortion &ruiSAD)
Void xEstimateInterResidualQT(TComYuv *pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu)
TEncSbac * m_pcRDGoOnSbacCoder
Definition: TEncSearch.h:108
general YUV buffer class
Definition: TComYuv.h:54
static const UInt NUM_MV_PREDICTORS
Definition: TEncSearch.h:65
signed char SChar
Definition: TypeDef.h:207
bool Bool
Definition: TypeDef.h:204
Void xSetSearchRange(const TComDataCU *const pcCU, const TComMv &cMvPred, const Int iSrchRng, TComMv &rcMvSrchRngLT, TComMv &rcMvSrchRngRB, const TComPattern *const pcPatternKey)
DistParam m_cDistParam
Definition: TEncSearch.h:109
distortion parameter class
Definition: TComRdCost.h:67
Void xExtDIFUpSamplingH(TComPattern *pcPattern)
Generate half-sample interpolated block.
static const Int AMVP_MAX_NUM_CANDS
AMVP: advanced motion vector prediction - max number of final candidates.
Definition: CommonDef.h:129
RD cost computation class.
Definition: TComRdCost.h:111
#define HHI_RQT_INTRA_SPEEDUP
tests one best mode with full rqt
Definition: TypeDef.h:121
UInt xGetIntraBitsQT(TComTU &rTu, Bool bLuma, Bool bChroma, Bool bRealCoeff)
motion information handling classes (header)
parameters for AMVP
virtual ~TEncSearch()
Definition: TEncSearch.cpp:205
entropy encoder class
Definition: TEncEntropy.h:116
TComMv m_acMvPredictors[NUM_MV_PREDICTORS]
Definition: TEncSearch.h:104
Int TCoeff
transform coefficient
Definition: TypeDef.h:250
RefPicList
reference list index
Definition: TypeDef.h:370
Void xMergeEstimation(TComDataCU *pcCU, TComYuv *pcYuvOrg, Int iPartIdx, UInt &uiInterDir, TComMvField *pacMvField, UInt &uiMergeIndex, Distortion &ruiCost, TComMvField *cMvFieldNeighbours, UChar *uhInterDirNeighbours, Int &numValidMergeCand)
estimation of best merge coding
ComponentID compIdx
Definition: TComRdCost.h:84
Void init(TEncCfg *pcEncCfg, TComTrQuant *pcTrQuant, Int iSearchRange, Int bipredSearchRange, MESearchMethod motionEstimationSearchMethod, const UInt maxCUWidth, const UInt maxCUHeight, const UInt maxTotalCUDepth, TEncEntropy *pcEntropyCoder, TComRdCost *pcRdCost, TEncSbac ***pppcRDSbacCoder, TEncSbac *pcRDGoOnSbacCoder)
Definition: TEncSearch.cpp:216
unsigned char UChar
Definition: TypeDef.h:208
TEncSbac *** m_pppcRDSbacCoder
Definition: TEncSearch.h:107
TEncEntropy * m_pcEntropyCoder
Definition: TEncSearch.h:97
#define AMP_MRG
encoder only force merge for AMP partition (no motion search for AMP)
Definition: TypeDef.h:116
Void xExtDIFUpSamplingQ(TComPattern *pcPatternKey, TComMv halfPelRef)
Generate quarter-sample interpolated blocks.
UChar * m_puhQTTempCbf[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:76
Int m_bipredSearchRange
Definition: TEncSearch.h:101
Void xStoreIntraResultQT(const ComponentID compID, TComTU &rTu)
MESearchMethod m_motionEstimationSearchMethod
Definition: TEncSearch.h:102
Void xGetBlkBits(PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3])
Void IPCMSearch(TComDataCU *pcCU, TComYuv *pcOrgYuv, TComYuv *rpcPredYuv, TComYuv *rpcResiYuv, TComYuv *rpcRecoYuv)
Function for PCM mode estimation.
Context-adaptive entropy encoder class (header)
Pel * m_pSharedPredTransformSkip[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:82
Void estIntraPredLumaQT(TComDataCU *pcCU, TComYuv *pcOrgYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, TComYuv *pcRecoYuv, Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE *MAX_CU_SIZE])
Void xEstimateMvPredAMVP(TComDataCU *pcCU, TComYuv *pcOrgYuv, UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv &rcMvPred, Bool bFilled=false, Distortion *puiDistBiP=0)
#define DEBUG_STRING_FN_DECLARE(name)
Definition: TypeDef.h:182
Definition: TComTU.h:48
TComTrQuant * m_pcTrQuant
Definition: TEncSearch.h:95
neighbouring pixel access classes (header)
TComYuv * m_pcQTTempTComYuv
Definition: TEncSearch.h:78
Void predInterSearch(TComDataCU *pcCU, TComYuv *pcOrgYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, TComYuv *pcRecoYuv, Bool bUseRes=false, Bool bUseMRG=false)
encoder estimation - inter prediction (non-skip)
static const Int MAX_CU_SIZE
= 1&lt;&lt;(MAX_CU_DEPTH)
Definition: CommonDef.h:221
UInt xGetIntraBitsQTChroma(TComTU &rTu, ComponentID compID, Bool bRealCoeff)
__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)
Definition: TEncSearch.cpp:613
transform and quantization class
Definition: TComTrQuant.h:98
TCoeff * m_pcQTTempTUCoeff[MAX_NUM_COMPONENT]
Definition: TEncSearch.h:83
Void xSetIntraResultChromaQT(TComYuv *pcRecoYuv, TComTU &rTu)
Void xEncodeInterResidualQT(const ComponentID compID, TComTU &rTu)
TComYuv m_tmpYuvPred
Definition: TEncSearch.h:79
UChar * m_puhQTTempTrIdx
Definition: TEncSearch.h:75
#define MCTS_ENC_CHECK
Temporal MCTS encoder constraint and decoder checks. Also requires SEITMCTSTileConstraint to be enabl...
Definition: TypeDef.h:97
Void xGetInterPredictionError(TComDataCU *pcCU, TComYuv *pcYuvOrg, Int iPartIdx, Distortion &ruiSAD, Bool Hadamard)
int Int
Definition: TypeDef.h:211
basic motion vector class
Definition: TComMv.h:51
ComponentID
Definition: TypeDef.h:308
Void xSetInterResidualQTData(TComYuv *pcResi, Bool bSpatial, TComTU &rTu)
Void xRecurIntraCodingLumaQT(TComYuv *pcOrgYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE *MAX_CU_SIZE], Distortion &ruiDistY, Bool bCheckFirst, Double &dRDCost, TComTU &rTu)
transform and quantization class (header)
CU encoder class.
Definition: TEncCu.h:65
Void xStoreCrossComponentPredictionResult(Pel *pResiLuma, const Pel *pBestLuma, TComTU &rTu, const Int xOffset, const Int yOffset, const Int strideResi, const Int strideBest)
__inline Void xTZ2PointSearch(const TComPattern *const pcPatternKey, IntTZSearchStruct &rcStruct, const TComMv *const pcMvSrchRngLT, const TComMv *const pcMvSrchRngRB)
Definition: TEncSearch.cpp:422
encoder configuration class
Definition: TEncCfg.h:111
Void xPatternSearchFracDIF(Bool bIsLosslessCoded, TComPattern *pcPatternKey, Pel *piRefY, Int iRefStride, TComMv *pcMvInt, TComMv &rcMvHalf, TComMv &rcMvQter, Distortion &ruiCost)
SBAC encoder class.
Definition: TEncSbac.h:66
double Double
Definition: TypeDef.h:213
Void xLoadIntraResultQT(const ComponentID compID, TComTU &rTu)
SChar xCalcCrossComponentPredictionAlpha(TComTU &rTu, const ComponentID compID, const Pel *piResiL, const Pel *piResiC, const Int width, const Int height, const Int strideL, const Int strideC)
Void encodeResAndCalcRdInterCU(TComDataCU *pcCU, TComYuv *pcYuvOrg, TComYuv *pcYuvPred, TComYuv *pcYuvResi, TComYuv *pcYuvResiBest, TComYuv *pcYuvRec, Bool bSkipResidual)
encode residual and compute rd-cost for inter mode
Void xCheckBestMVP(TComDataCU *pcCU, RefPicList eRefPicList, TComMv cMv, TComMv &rcMvPred, Int &riMVPIdx, UInt &ruiBits, Distortion &ruiCost)
TEncCfg * m_pcEncCfg
Definition: TEncSearch.h:92
TComMv m_integerMv2Nx2N[NUM_REF_PIC_LIST_01][MAX_NUM_REF]
Definition: TEncSearch.h:118
Void estIntraPredChromaQT(TComDataCU *pcCU, TComYuv *pcOrgYuv, TComYuv *pcPredYuv, TComYuv *pcResiYuv, TComYuv *pcRecoYuv, Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE *MAX_CU_SIZE])