source: 3DVCSoftware/trunk/source/Lib/TLibEncoder/TEncSearch.h @ 189

Last change on this file since 189 was 189, checked in by tech, 12 years ago

Reintegrated branch 4.1-dev0 Rev. 188.

  • Property svn:eol-style set to native
File size: 29.1 KB
Line 
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-2012, 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 "TEncEntropy.h"
49#include "TEncSbac.h"
50#include "TEncCfg.h"
51
52//! \ingroup TLibEncoder
53//! \{
54
55class TEncCu;
56
57// ====================================================================================================================
58// Class definition
59// ====================================================================================================================
60
61/// encoder search class
62class TEncSearch : public TComPrediction
63{
64private:
65  TCoeff**        m_ppcQTTempCoeffY;
66  TCoeff**        m_ppcQTTempCoeffCb;
67  TCoeff**        m_ppcQTTempCoeffCr;
68  TCoeff*         m_pcQTTempCoeffY;
69  TCoeff*         m_pcQTTempCoeffCb;
70  TCoeff*         m_pcQTTempCoeffCr;
71#if ADAPTIVE_QP_SELECTION
72  Int**           m_ppcQTTempArlCoeffY;
73  Int**           m_ppcQTTempArlCoeffCb;
74  Int**           m_ppcQTTempArlCoeffCr;
75  Int*            m_pcQTTempArlCoeffY;
76  Int*            m_pcQTTempArlCoeffCb;
77  Int*            m_pcQTTempArlCoeffCr;
78#endif
79  UChar*          m_puhQTTempTrIdx;
80  UChar*          m_puhQTTempCbf[3];
81 
82  TComYuv*        m_pcQTTempTComYuv;
83  TComYuv         m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation
84protected:
85  // interface to option
86  TEncCfg*        m_pcEncCfg;
87 
88  // interface to classes
89  TComTrQuant*    m_pcTrQuant;
90  TComRdCost*     m_pcRdCost;
91  TEncEntropy*    m_pcEntropyCoder;
92 
93  // ME parameters
94  Int             m_iSearchRange;
95  Int             m_bipredSearchRange; // Search range for bi-prediction
96  Int             m_iFastSearch;
97  Int             m_aaiAdaptSR[2][33];
98  TComMv          m_cSrchRngLT;
99  TComMv          m_cSrchRngRB;
100  TComMv          m_acMvPredictors[3];
101 
102  // RD computation
103  TEncSbac***     m_pppcRDSbacCoder;
104  TEncSbac*       m_pcRDGoOnSbacCoder;
105  Bool            m_bUseSBACRD;
106  DistParam       m_cDistParam;
107 
108  // Misc.
109  Pel*            m_pTempPel;
110  UInt*           m_puiDFilter;
111  Int             m_iMaxDeltaQP;
112 
113
114#if HHI_VSO
115  TComYuv         m_cYuvRecTemp; 
116#endif
117 
118  // AMVP cost computation
119#if HHI_INTER_VIEW_MOTION_PRED
120  UInt            m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+2][AMVP_MAX_NUM_CANDS+2]; //th array bounds
121#else
122  // UInt            m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS];
123  UInt            m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds
124#endif
125 
126public:
127  TEncSearch();
128  virtual ~TEncSearch();
129 
130  Void init(  TEncCfg*      pcEncCfg,
131            TComTrQuant*  pcTrQuant,
132            Int           iSearchRange,
133            Int           bipredSearchRange,
134            Int           iFastSearch,
135            Int           iMaxDeltaQP,
136            TEncEntropy*  pcEntropyCoder,
137            TComRdCost*   pcRdCost,
138            TEncSbac***   pppcRDSbacCoder,
139            TEncSbac*     pcRDGoOnSbacCoder );
140 
141protected:
142 
143  /// sub-function for motion vector refinement used in fractional-pel accuracy
144  UInt  xPatternRefinement( TComPattern* pcPatternKey,
145                           TComMv baseRefMv,
146                           Int iFrac, TComMv& rcMvFrac );
147 
148  typedef struct
149  {
150    Pel*  piRefY;
151    Int   iYStride;
152    Int   iBestX;
153    Int   iBestY;
154    UInt  uiBestRound;
155    UInt  uiBestDistance;
156    UInt  uiBestSad;
157    UChar ucPointNr;
158  } IntTZSearchStruct;
159 
160  // sub-functions for ME
161  __inline Void xTZSearchHelp         ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance );
162  __inline Void xTZ2PointSearch       ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB );
163  __inline Void xTZ8PointSquareSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist );
164  __inline Void xTZ8PointDiamondSearch( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist );
165 
166  Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard );
167
168public:
169  Void  preestChromaPredMode    ( TComDataCU* pcCU, 
170                                  TComYuv*    pcOrgYuv, 
171                                  TComYuv*    pcPredYuv );
172  Void  estIntraPredQT          ( TComDataCU* pcCU, 
173                                  TComYuv*    pcOrgYuv, 
174                                  TComYuv*    pcPredYuv, 
175                                  TComYuv*    pcResiYuv, 
176                                  TComYuv*    pcRecoYuv,
177                                  Dist&       ruiDistC,
178                                  Bool        bLumaOnly );
179  Void  estIntraPredChromaQT    ( TComDataCU* pcCU, 
180                                  TComYuv*    pcOrgYuv, 
181                                  TComYuv*    pcPredYuv, 
182                                  TComYuv*    pcResiYuv, 
183                                  TComYuv*    pcRecoYuv,
184                                  Dist        uiPreCalcDistC );
185 
186 
187  /// encoder estimation - inter prediction (non-skip)
188  Void predInterSearch          ( TComDataCU* pcCU,
189                                  TComYuv*    pcOrgYuv,
190#if LG_RESTRICTEDRESPRED_M24766
191                                  TComYuv*    rpcResiPredYuv,
192#endif
193                                  TComYuv*&   rpcPredYuv,
194                                  TComYuv*&   rpcResiYuv,
195                                  TComYuv*&   rpcRecoYuv,
196                                  Bool        bUseRes = false
197#if AMP_MRG
198                                 ,Bool        bUseMRG = false
199#endif
200                                );
201 
202#if HHI_INTER_VIEW_RESIDUAL_PRED
203  /// encode residual and compute rd-cost for inter mode
204  Void encodeResAndCalcRdInterCU( TComDataCU* pcCU,
205                                  TComYuv*    pcYuvOrg,
206                                  TComYuv*    pcYuvPred,
207                                  TComYuv*&   rpcYuvResi,
208                                  TComYuv*&   rpcYuvResiBest,
209                                  TComYuv*&   rpcYuvRec,
210                                  TComYuv*&   rpcYuvResPrd,
211                                  Bool        bSkipRes );
212#else
213  /// encode residual and compute rd-cost for inter mode
214  Void encodeResAndCalcRdInterCU( TComDataCU* pcCU,
215                                  TComYuv*    pcYuvOrg,
216                                  TComYuv*    pcYuvPred,
217                                  TComYuv*&   rpcYuvResi,
218                                  TComYuv*&   rpcYuvResiBest,
219                                  TComYuv*&   rpcYuvRec,
220                                  Bool        bSkipRes );
221#endif
222  /// set ME search range
223  Void setAdaptiveSearchRange   ( Int iDir, Int iRefIdx, Int iSearchRange) { 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, TextType eText);
226  Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv );
227protected:
228 
229  // -------------------------------------------------------------------------------------------------------------------
230  // Intra search
231  // -------------------------------------------------------------------------------------------------------------------
232 
233  Void  xEncSubdivCbfQT           ( TComDataCU*  pcCU,
234                                    UInt         uiTrDepth,
235                                    UInt         uiAbsPartIdx,
236                                    Bool         bLuma,
237                                    Bool         bChroma );
238  Void  xEncCoeffQT               ( TComDataCU*  pcCU,
239                                    UInt         uiTrDepth,
240                                    UInt         uiAbsPartIdx,
241                                    TextType     eTextType,
242                                    Bool         bRealCoeff );
243  Void  xEncIntraHeader           ( TComDataCU*  pcCU,
244                                    UInt         uiTrDepth,
245                                    UInt         uiAbsPartIdx,
246                                    Bool         bLuma,
247                                    Bool         bChroma );
248  UInt  xGetIntraBitsQT           ( TComDataCU*  pcCU,
249                                    UInt         uiTrDepth,
250                                    UInt         uiAbsPartIdx,
251                                    Bool         bLuma,
252                                    Bool         bChroma,
253                                    Bool         bRealCoeff );
254 
255  Void  xIntraCodingLumaBlk       ( TComDataCU*  pcCU,
256                                    UInt         uiTrDepth,
257                                    UInt         uiAbsPartIdx,
258                                    TComYuv*     pcOrgYuv, 
259                                    TComYuv*     pcPredYuv, 
260                                    TComYuv*     pcResiYuv, 
261                                    Dist&        ruiDist
262#if LG_ZEROINTRADEPTHRESI_A0087
263                                   ,Bool        bZeroResi = false
264#endif
265                                   );
266  Void  xIntraCodingChromaBlk     ( TComDataCU*  pcCU,
267                                    UInt         uiTrDepth,
268                                    UInt         uiAbsPartIdx,
269                                    TComYuv*     pcOrgYuv, 
270                                    TComYuv*     pcPredYuv, 
271                                    TComYuv*     pcResiYuv, 
272                                    Dist&        ruiDist,
273                                    UInt         uiChromaId );
274  Void  xRecurIntraCodingQT       ( TComDataCU*  pcCU, 
275                                    UInt         uiTrDepth,
276                                    UInt         uiAbsPartIdx, 
277                                    Bool         bLumaOnly,
278                                    TComYuv*     pcOrgYuv, 
279                                    TComYuv*     pcPredYuv, 
280                                    TComYuv*     pcResiYuv, 
281                                    Dist&        ruiDistY,
282                                    Dist&        ruiDistC,
283#if HHI_RQT_INTRA_SPEEDUP
284                                    Bool         bCheckFirst,
285#endif
286                                    Double&      dRDCost
287#if LG_ZEROINTRADEPTHRESI_A0087
288                                   ,Bool         bZeroResi = false
289#endif
290                                  );
291 
292  Void  xSetIntraResultQT         ( TComDataCU*  pcCU,
293                                    UInt         uiTrDepth,
294                                    UInt         uiAbsPartIdx,
295                                    Bool         bLumaOnly,
296                                    TComYuv*     pcRecoYuv );
297 
298  Void  xRecurIntraChromaCodingQT ( TComDataCU*  pcCU, 
299                                    UInt         uiTrDepth,
300                                    UInt         uiAbsPartIdx, 
301                                    TComYuv*     pcOrgYuv, 
302                                    TComYuv*     pcPredYuv, 
303                                    TComYuv*     pcResiYuv, 
304                                    Dist&        ruiDist );
305  Void  xSetIntraResultChromaQT   ( TComDataCU*  pcCU,
306                                    UInt         uiTrDepth,
307                                    UInt         uiAbsPartIdx,
308                                    TComYuv*     pcRecoYuv );
309 
310#if RWTH_SDC_DLT_B0036
311  Void  xAnalyzeSegmentsSDC       ( Pel* pOrig,
312                                   UInt uiStride,
313                                   UInt uiSize,
314                                   Pel* rpSegMeans,
315                                   UInt uiNumSegments,
316                                   Bool* pMask,
317                                   UInt uiMaskStride );
318 
319  Void  xIntraCodingSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual );
320#endif
321 
322  // -------------------------------------------------------------------------------------------------------------------
323  // DMM intra search
324  // -------------------------------------------------------------------------------------------------------------------
325
326#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
327  Bool predIntraLumaDMMAvailable  ( UInt           uiMode, 
328                                    UInt           uiWidth, 
329                                    UInt           uiHeight );
330  Void xGetWedgeDeltaDCsMinDist   ( TComWedgelet*  pcWedgelet, 
331                                    TComDataCU*    pcCU, 
332                                    UInt           uiAbsPtIdx, 
333                                    Pel*           piOrig, 
334                                    Pel*           piPredic, 
335                                    UInt           uiStride, 
336                                    UInt           uiWidth, 
337                                    UInt           uiHeight, 
338                                    Int&           riDeltaDC1, 
339                                    Int&           riDeltaDC2, 
340                                    Bool           bAboveAvail, 
341                                    Bool           bLeftAvail );
342#endif
343
344#if LGE_EDGE_INTRA_A0070
345  Bool  xEdgePartition       ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 );
346  Bool  xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight );
347  Bool  xConstructChainCode  ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 );
348#if LGE_EDGE_INTRA_DELTA_DC
349  Void  xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrig, UInt uiStride, Pel* piPredic, UInt uiWidth, UInt uiHeight );
350#endif
351#endif
352
353#if HHI_DMM_WEDGE_INTRA
354  Void findWedgeFullMinDist       ( TComDataCU*    pcCU, 
355                                    UInt           uiAbsPtIdx,
356                                    Pel*           piOrig,
357                                    Pel*           piPredic,
358                                    UInt           uiStride,
359                                    UInt           uiWidth,
360                                    UInt           uiHeight,
361                                    UInt&          ruiTabIdx,
362                                    Int&           riDeltaDC1,
363                                    Int&           riDeltaDC2,
364                                    Bool           bAboveAvail,
365                                    Bool           bLeftAvail );
366  Void findWedgePredDirMinDist    ( TComDataCU*    pcCU, 
367                                    UInt           uiAbsPtIdx,
368                                    Pel*           piOrig,
369                                    Pel*           piPredic,
370                                    UInt           uiStride,
371                                    UInt           uiWidth,
372                                    UInt           uiHeight,
373                                    UInt&          ruiTabIdx,
374                                    Int&           riWedgeDeltaEnd,
375                                    Int&           riDeltaDC1,
376                                    Int&           riDeltaDC2,
377                                    Bool           bAboveAvail,
378                                    Bool           bLeftAvail );
379  Void xSearchWedgeFullMinDist    ( TComDataCU*    pcCU, 
380                                    UInt           uiAbsPtIdx, 
381                                    WedgeList*     pacWedgeList, 
382                                    Pel*           piRef, 
383                                    UInt           uiRefStride, 
384                                    UInt           uiWidth, 
385                                    UInt           uiHeight, 
386                                    UInt&          ruiTabIdx, 
387                                    Dist&          riDist );
388#if HHIQC_DMMFASTSEARCH_B0039
389  Void xSearchWedgeFullMinDistFast( TComDataCU*    pcCU, 
390                                    UInt           uiAbsPtIdx, 
391                                    WedgeNodeList* pacWedgeNodeList, 
392                                    WedgeList*     pacWedgeList, 
393                                    Pel*           piRef, 
394                                    UInt           uiRefStride, 
395                                    UInt           uiWidth, 
396                                    UInt           uiHeight, 
397                                    UInt&          ruiTabIdx, 
398                                    Dist&          riDist );
399#endif
400  Void xSearchWedgePredDirMinDist ( TComDataCU*    pcCU, 
401                                    UInt           uiAbsPtIdx, 
402                                    WedgeList*     pacWedgeList, 
403                                    Pel*           piRef, 
404                                    UInt           uiRefStride, 
405                                    UInt           uiWidth, 
406                                    UInt           uiHeight, 
407                                    UInt&          ruiTabIdx, 
408                                    Int&           riWedgeDeltaEnd );
409#endif
410#if HHI_DMM_PRED_TEX
411  Void findWedgeTexMinDist        ( TComDataCU*    pcCU, 
412                                    UInt           uiAbsPtIdx,
413                                    Pel*           piOrig,
414                                    Pel*           piPredic,
415                                    UInt           uiStride,
416                                    UInt           uiWidth,
417                                    UInt           uiHeight,
418                                    UInt&          ruiTabIdx,
419                                    Int&           riDeltaDC1,
420                                    Int&           riDeltaDC2,
421                                    Bool           bAboveAvail,
422                                    Bool           bLeftAvail );
423  Void findContourPredTex         ( TComDataCU*    pcCU, 
424                                    UInt           uiAbsPtIdx,
425                                    Pel*           piOrig,
426                                    Pel*           piPredic,
427                                    UInt           uiStride,
428                                    UInt           uiWidth,
429                                    UInt           uiHeight,
430                                    Int&           riDeltaDC1,
431                                    Int&           riDeltaDC2,
432                                    Bool           bAboveAvail,
433                                    Bool           bLeftAvail );
434#endif
435
436  // -------------------------------------------------------------------------------------------------------------------
437  // Inter search (AMP)
438  // -------------------------------------------------------------------------------------------------------------------
439 
440  Void xEstimateMvPredAMVP        ( TComDataCU* pcCU,
441                                    TComYuv*    pcOrgYuv,
442                                    UInt        uiPartIdx,
443                                    RefPicList  eRefPicList,
444                                    Int         iRefIdx,
445                                    TComMv&     rcMvPred,
446                                    Bool        bFilled = false
447                                  #if H0111_MVD_L1_ZERO
448                                  , UInt*       puiDistBiP = NULL
449                                  #endif
450                                  #if ZERO_MVD_EST
451                                  , UInt*       puiDist = NULL
452                                  #endif
453                                     );
454 
455  Void xCheckBestMVP              ( TComDataCU* pcCU,
456                                    RefPicList  eRefPicList,
457                                    TComMv      cMv,
458                                    TComMv&     rcMvPred,
459                                    Int&        riMVPIdx,
460                                    UInt&       ruiBits,
461                                    UInt&       ruiCost );
462 
463  UInt xGetTemplateCost           ( TComDataCU* pcCU,
464                                    UInt        uiPartIdx,
465                                    UInt        uiPartAddr,
466                                    TComYuv*    pcOrgYuv,
467                                    TComYuv*    pcTemplateCand,
468                                    TComMv      cMvCand,
469                                    Int         iMVPIdx,
470                                    Int         iMVPNum,
471                                    RefPicList  eRefPicList,
472                                    Int         iRefIdx,
473                                    Int         iSizeX,
474                                    Int         iSizeY
475                                  #if ZERO_MVD_EST
476                                  , UInt&       ruiDist
477                                  #endif
478                                   );
479 
480 
481  Void xCopyAMVPInfo              ( AMVPInfo*   pSrc, AMVPInfo* pDst );
482  UInt xGetMvpIdxBits             ( Int iIdx, Int iNum );
483  Void xGetBlkBits                ( PartSize  eCUMode, Bool bPSlice, Int iPartIdx,  UInt uiLastMode, UInt uiBlkBit[3]);
484 
485  Void xMergeEstimation           ( TComDataCU*     pcCU,
486                                    TComYuv*        pcYuvOrg,
487#if LG_RESTRICTEDRESPRED_M24766
488                                    TComYuv*        rpcResiPredYuv, 
489#endif
490                                    Int             iPartIdx,
491                                    UInt&           uiInterDir,
492                                    TComMvField*    pacMvField,
493                                    UInt&           uiMergeIndex,
494                                    UInt&           ruiCost
495#if CU_BASED_MRG_CAND_LIST
496                                  , TComMvField* cMvFieldNeighbours, 
497                                    UChar* uhInterDirNeighbours,
498                                    Int& numValidMergeCand
499#endif
500                                   );
501  // -------------------------------------------------------------------------------------------------------------------
502  // motion estimation
503  // -------------------------------------------------------------------------------------------------------------------
504 
505  Void xMotionEstimation          ( TComDataCU*   pcCU,
506                                    TComYuv*      pcYuvOrg,
507                                    Int           iPartIdx,
508                                    RefPicList    eRefPicList,
509                                    TComMv*       pcMvPred,
510                                    Int           iRefIdxPred,
511                                    TComMv&       rcMv,
512                                    UInt&         ruiBits,
513                                    UInt&         ruiCost,
514                                    Bool          bBi = false  );
515 
516  Void xTZSearch                  ( TComDataCU*   pcCU,
517                                    TComPattern*  pcPatternKey,
518                                    Pel*          piRefY,
519                                    Int           iRefStride,
520                                    TComMv*       pcMvSrchRngLT,
521                                    TComMv*       pcMvSrchRngRB,
522                                    TComMv&       rcMv,
523                                    UInt&         ruiSAD );
524 
525  Void xSetSearchRange            ( TComDataCU*   pcCU,
526                                    TComMv&       cMvPred,
527                                    Int           iSrchRng,
528                                    TComMv&       rcMvSrchRngLT,
529                                    TComMv&       rcMvSrchRngRB );
530 
531  Void xPatternSearchFast         ( TComDataCU*   pcCU,
532                                    TComPattern*  pcPatternKey,
533                                    Pel*          piRefY,
534                                    Int           iRefStride,
535                                    TComMv*       pcMvSrchRngLT,
536                                    TComMv*       pcMvSrchRngRB,
537                                    TComMv&       rcMv,
538                                    UInt&         ruiSAD );
539 
540  Void xPatternSearch             ( TComPattern*  pcPatternKey,
541                                    Pel*          piRefY,
542                                    Int           iRefStride,
543                                    TComMv*       pcMvSrchRngLT,
544                                    TComMv*       pcMvSrchRngRB,
545                                    TComMv&       rcMv,
546                                    UInt&         ruiSAD );
547 
548  Void xPatternSearchFracDIF      ( TComDataCU*   pcCU,
549                                    TComPattern*  pcPatternKey,
550                                    Pel*          piRefY,
551                                    Int           iRefStride,
552                                    TComMv*       pcMvInt,
553                                    TComMv&       rcMvHalf,
554                                    TComMv&       rcMvQter,
555                                    UInt&         ruiCost
556                                   ,Bool biPred
557                                   );
558 
559  Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred  );
560  Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred );
561 
562  // -------------------------------------------------------------------------------------------------------------------
563  // T & Q & Q-1 & T-1
564  // -------------------------------------------------------------------------------------------------------------------
565 
566  Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType );
567#if IBDI_DISTORTION || HHI_VSO
568  Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist );
569#else
570  Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx                                , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist );
571#endif
572  Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial );
573 
574  UInt  xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth );
575  UInt  xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList );
576 
577  // -------------------------------------------------------------------------------------------------------------------
578  // compute symbol bits
579  // -------------------------------------------------------------------------------------------------------------------
580 
581  Void xAddSymbolBitsInter        ( TComDataCU*   pcCU,
582                                   UInt          uiQp,
583                                   UInt          uiTrMode,
584                                   UInt&         ruiBits,
585                                   TComYuv*&     rpcYuvRec,
586                                   TComYuv*      pcYuvPred,
587                                   TComYuv*&     rpcYuvResi );
588 
589  Void  setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur );
590  inline  Void  setDistParamComp( UInt uiComp )  { m_cDistParam.uiComp = uiComp; }
591 
592};// END CLASS DEFINITION TEncSearch
593
594//! \}
595
596#endif // __TENCSEARCH__
Note: See TracBrowser for help on using the repository browser.