[313] | 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-2013, 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 | |
---|
| 55 | class TEncCu; |
---|
| 56 | |
---|
| 57 | // ==================================================================================================================== |
---|
| 58 | // Class definition |
---|
| 59 | // ==================================================================================================================== |
---|
| 60 | |
---|
| 61 | /// encoder search class |
---|
| 62 | class TEncSearch : public TComPrediction |
---|
| 63 | { |
---|
| 64 | private: |
---|
| 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 |
---|
| 84 | Pel* m_pSharedPredTransformSkip[3]; |
---|
| 85 | TCoeff* m_pcQTTempTUCoeffY; |
---|
| 86 | TCoeff* m_pcQTTempTUCoeffCb; |
---|
| 87 | TCoeff* m_pcQTTempTUCoeffCr; |
---|
| 88 | UChar* m_puhQTTempTransformSkipFlag[3]; |
---|
| 89 | TComYuv m_pcQTTempTransformSkipTComYuv; |
---|
| 90 | #if ADAPTIVE_QP_SELECTION |
---|
| 91 | Int* m_ppcQTTempTUArlCoeffY; |
---|
| 92 | Int* m_ppcQTTempTUArlCoeffCb; |
---|
| 93 | Int* m_ppcQTTempTUArlCoeffCr; |
---|
| 94 | #endif |
---|
| 95 | protected: |
---|
| 96 | // interface to option |
---|
| 97 | TEncCfg* m_pcEncCfg; |
---|
| 98 | |
---|
| 99 | #if SVC_EXTENSION |
---|
| 100 | TEncTop** m_ppcTEncTop; |
---|
| 101 | #endif |
---|
| 102 | |
---|
| 103 | // interface to classes |
---|
| 104 | TComTrQuant* m_pcTrQuant; |
---|
| 105 | TComRdCost* m_pcRdCost; |
---|
| 106 | TEncEntropy* m_pcEntropyCoder; |
---|
| 107 | |
---|
| 108 | // ME parameters |
---|
| 109 | Int m_iSearchRange; |
---|
| 110 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
| 111 | Int m_iFastSearch; |
---|
| 112 | Int m_aaiAdaptSR[2][33]; |
---|
| 113 | TComMv m_cSrchRngLT; |
---|
| 114 | TComMv m_cSrchRngRB; |
---|
| 115 | TComMv m_acMvPredictors[3]; |
---|
| 116 | |
---|
| 117 | // RD computation |
---|
| 118 | TEncSbac*** m_pppcRDSbacCoder; |
---|
| 119 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
| 120 | Bool m_bUseSBACRD; |
---|
| 121 | DistParam m_cDistParam; |
---|
| 122 | |
---|
| 123 | // Misc. |
---|
| 124 | Pel* m_pTempPel; |
---|
| 125 | const UInt* m_puiDFilter; |
---|
| 126 | Int m_iMaxDeltaQP; |
---|
| 127 | |
---|
| 128 | // AMVP cost computation |
---|
| 129 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
| 130 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
| 131 | |
---|
| 132 | public: |
---|
| 133 | TEncSearch(); |
---|
| 134 | virtual ~TEncSearch(); |
---|
| 135 | |
---|
| 136 | Void init( TEncCfg* pcEncCfg, |
---|
| 137 | TComTrQuant* pcTrQuant, |
---|
| 138 | Int iSearchRange, |
---|
| 139 | Int bipredSearchRange, |
---|
| 140 | Int iFastSearch, |
---|
| 141 | Int iMaxDeltaQP, |
---|
| 142 | TEncEntropy* pcEntropyCoder, |
---|
| 143 | TComRdCost* pcRdCost, |
---|
| 144 | TEncSbac*** pppcRDSbacCoder, |
---|
| 145 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
| 146 | |
---|
| 147 | protected: |
---|
| 148 | |
---|
| 149 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
| 150 | UInt xPatternRefinement( TComPattern* pcPatternKey, |
---|
| 151 | TComMv baseRefMv, |
---|
| 152 | Int iFrac, TComMv& rcMvFrac ); |
---|
| 153 | |
---|
| 154 | typedef struct |
---|
| 155 | { |
---|
| 156 | Pel* piRefY; |
---|
| 157 | Int iYStride; |
---|
| 158 | Int iBestX; |
---|
| 159 | Int iBestY; |
---|
| 160 | UInt uiBestRound; |
---|
| 161 | UInt uiBestDistance; |
---|
| 162 | UInt 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, UInt& ruiSAD, Bool Hadamard ); |
---|
| 173 | |
---|
| 174 | public: |
---|
| 175 | Void preestChromaPredMode ( TComDataCU* pcCU, |
---|
| 176 | TComYuv* pcOrgYuv, |
---|
| 177 | TComYuv* pcPredYuv ); |
---|
| 178 | Void estIntraPredQT ( TComDataCU* pcCU, |
---|
| 179 | TComYuv* pcOrgYuv, |
---|
| 180 | TComYuv* pcPredYuv, |
---|
| 181 | TComYuv* pcResiYuv, |
---|
| 182 | TComYuv* pcRecoYuv, |
---|
| 183 | UInt& ruiDistC, |
---|
| 184 | Bool bLumaOnly ); |
---|
| 185 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
| 186 | TComYuv* pcOrgYuv, |
---|
| 187 | TComYuv* pcPredYuv, |
---|
| 188 | TComYuv* pcResiYuv, |
---|
| 189 | TComYuv* pcRecoYuv, |
---|
| 190 | UInt uiPreCalcDistC ); |
---|
| 191 | |
---|
| 192 | /// encoder estimation - inter prediction (non-skip) |
---|
| 193 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 194 | TComYuv* pcOrgYuv, |
---|
| 195 | TComYuv*& rpcPredYuv, |
---|
| 196 | TComYuv*& rpcResiYuv, |
---|
| 197 | TComYuv*& rpcRecoYuv, |
---|
| 198 | Bool bUseRes = false |
---|
| 199 | #if AMP_MRG |
---|
| 200 | ,Bool bUseMRG = false |
---|
| 201 | #endif |
---|
| 202 | ); |
---|
| 203 | |
---|
| 204 | #if (ENCODER_FAST_MODE) |
---|
| 205 | Bool predInterSearchILRUni ( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, UInt refLayerId ); |
---|
| 206 | #endif |
---|
| 207 | |
---|
| 208 | /// encode residual and compute rd-cost for inter mode |
---|
| 209 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 210 | TComYuv* pcYuvOrg, |
---|
| 211 | TComYuv* pcYuvPred, |
---|
| 212 | TComYuv*& rpcYuvResi, |
---|
| 213 | TComYuv*& rpcYuvResiBest, |
---|
| 214 | TComYuv*& rpcYuvRec, |
---|
| 215 | Bool bSkipRes ); |
---|
| 216 | |
---|
| 217 | /// set ME search range |
---|
| 218 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
| 219 | |
---|
| 220 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
| 221 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
| 222 | protected: |
---|
| 223 | |
---|
| 224 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 225 | // Intra search |
---|
| 226 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 227 | |
---|
| 228 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 229 | UInt uiTrDepth, |
---|
| 230 | UInt uiAbsPartIdx, |
---|
| 231 | Bool bLuma, |
---|
| 232 | Bool bChroma ); |
---|
| 233 | |
---|
| 234 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 235 | UInt uiTrDepth, |
---|
| 236 | UInt uiAbsPartIdx, |
---|
| 237 | TextType eTextType, |
---|
| 238 | Bool bRealCoeff ); |
---|
| 239 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 240 | UInt uiTrDepth, |
---|
| 241 | UInt uiAbsPartIdx, |
---|
| 242 | Bool bLuma, |
---|
| 243 | Bool bChroma ); |
---|
| 244 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 245 | UInt uiTrDepth, |
---|
| 246 | UInt uiAbsPartIdx, |
---|
| 247 | Bool bLuma, |
---|
| 248 | Bool bChroma, |
---|
| 249 | Bool bRealCoeff ); |
---|
| 250 | UInt xGetIntraBitsQTChroma ( TComDataCU* pcCU, |
---|
| 251 | UInt uiTrDepth, |
---|
| 252 | UInt uiAbsPartIdx, |
---|
| 253 | UInt uiChromaId, |
---|
| 254 | Bool bRealCoeff ); |
---|
| 255 | |
---|
| 256 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 257 | UInt uiTrDepth, |
---|
| 258 | UInt uiAbsPartIdx, |
---|
| 259 | TComYuv* pcOrgYuv, |
---|
| 260 | TComYuv* pcPredYuv, |
---|
| 261 | TComYuv* pcResiYuv, |
---|
| 262 | UInt& ruiDist, |
---|
| 263 | Int default0Save1Load2 = 0); |
---|
| 264 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 265 | UInt uiTrDepth, |
---|
| 266 | UInt uiAbsPartIdx, |
---|
| 267 | TComYuv* pcOrgYuv, |
---|
| 268 | TComYuv* pcPredYuv, |
---|
| 269 | TComYuv* pcResiYuv, |
---|
| 270 | UInt& ruiDist, |
---|
| 271 | UInt uiChromaId, |
---|
| 272 | Int default0Save1Load2 = 0 ); |
---|
| 273 | |
---|
| 274 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 275 | UInt uiTrDepth, |
---|
| 276 | UInt uiAbsPartIdx, |
---|
| 277 | Bool bLumaOnly, |
---|
| 278 | TComYuv* pcOrgYuv, |
---|
| 279 | TComYuv* pcPredYuv, |
---|
| 280 | TComYuv* pcResiYuv, |
---|
| 281 | UInt& ruiDistY, |
---|
| 282 | UInt& ruiDistC, |
---|
| 283 | #if HHI_RQT_INTRA_SPEEDUP |
---|
| 284 | Bool bCheckFirst, |
---|
| 285 | #endif |
---|
| 286 | Double& dRDCost ); |
---|
| 287 | |
---|
| 288 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 289 | UInt uiTrDepth, |
---|
| 290 | UInt uiAbsPartIdx, |
---|
| 291 | Bool bLumaOnly, |
---|
| 292 | TComYuv* pcRecoYuv ); |
---|
| 293 | |
---|
| 294 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 295 | UInt uiTrDepth, |
---|
| 296 | UInt uiAbsPartIdx, |
---|
| 297 | TComYuv* pcOrgYuv, |
---|
| 298 | TComYuv* pcPredYuv, |
---|
| 299 | TComYuv* pcResiYuv, |
---|
| 300 | UInt& ruiDist ); |
---|
| 301 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 302 | UInt uiTrDepth, |
---|
| 303 | UInt uiAbsPartIdx, |
---|
| 304 | TComYuv* pcRecoYuv ); |
---|
| 305 | |
---|
| 306 | Void xStoreIntraResultQT ( TComDataCU* pcCU, |
---|
| 307 | UInt uiTrDepth, |
---|
| 308 | UInt uiAbsPartIdx, |
---|
| 309 | Bool bLumaOnly ); |
---|
| 310 | Void xLoadIntraResultQT ( TComDataCU* pcCU, |
---|
| 311 | UInt uiTrDepth, |
---|
| 312 | UInt uiAbsPartIdx, |
---|
| 313 | Bool bLumaOnly ); |
---|
| 314 | Void xStoreIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 315 | UInt uiTrDepth, |
---|
| 316 | UInt uiAbsPartIdx, |
---|
| 317 | UInt stateU0V1Both2 ); |
---|
| 318 | Void xLoadIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 319 | UInt uiTrDepth, |
---|
| 320 | UInt uiAbsPartIdx, |
---|
| 321 | UInt stateU0V1Both2 ); |
---|
| 322 | |
---|
| 323 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 324 | // Inter search (AMP) |
---|
| 325 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 326 | |
---|
| 327 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 328 | TComYuv* pcOrgYuv, |
---|
| 329 | UInt uiPartIdx, |
---|
| 330 | RefPicList eRefPicList, |
---|
| 331 | Int iRefIdx, |
---|
| 332 | TComMv& rcMvPred, |
---|
| 333 | Bool bFilled = false |
---|
| 334 | , UInt* puiDistBiP = NULL |
---|
| 335 | #if ZERO_MVD_EST |
---|
| 336 | , UInt* puiDist = NULL |
---|
| 337 | #endif |
---|
| 338 | ); |
---|
| 339 | |
---|
| 340 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 341 | RefPicList eRefPicList, |
---|
| 342 | TComMv cMv, |
---|
| 343 | TComMv& rcMvPred, |
---|
| 344 | Int& riMVPIdx, |
---|
| 345 | UInt& ruiBits, |
---|
| 346 | UInt& ruiCost ); |
---|
| 347 | |
---|
| 348 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 349 | UInt uiPartIdx, |
---|
| 350 | UInt uiPartAddr, |
---|
| 351 | TComYuv* pcOrgYuv, |
---|
| 352 | TComYuv* pcTemplateCand, |
---|
| 353 | TComMv cMvCand, |
---|
| 354 | Int iMVPIdx, |
---|
| 355 | Int iMVPNum, |
---|
| 356 | RefPicList eRefPicList, |
---|
| 357 | Int iRefIdx, |
---|
| 358 | Int iSizeX, |
---|
| 359 | Int iSizeY |
---|
| 360 | #if ZERO_MVD_EST |
---|
| 361 | , UInt& ruiDist |
---|
| 362 | #endif |
---|
| 363 | ); |
---|
| 364 | |
---|
| 365 | |
---|
| 366 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 367 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 368 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 369 | |
---|
| 370 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 371 | TComYuv* pcYuvOrg, |
---|
| 372 | Int iPartIdx, |
---|
| 373 | UInt& uiInterDir, |
---|
| 374 | TComMvField* pacMvField, |
---|
| 375 | UInt& uiMergeIndex, |
---|
| 376 | UInt& ruiCost |
---|
| 377 | , TComMvField* cMvFieldNeighbours, |
---|
| 378 | UChar* uhInterDirNeighbours, |
---|
| 379 | Int& numValidMergeCand |
---|
| 380 | ); |
---|
| 381 | |
---|
| 382 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
| 383 | UInt puIdx, |
---|
| 384 | TComMvField* mvFieldNeighbours, |
---|
| 385 | UChar* interDirNeighbours, |
---|
| 386 | Int numValidMergeCand ); |
---|
| 387 | |
---|
| 388 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 389 | // motion estimation |
---|
| 390 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 391 | |
---|
| 392 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 393 | TComYuv* pcYuvOrg, |
---|
| 394 | Int iPartIdx, |
---|
| 395 | RefPicList eRefPicList, |
---|
| 396 | TComMv* pcMvPred, |
---|
| 397 | Int iRefIdxPred, |
---|
| 398 | TComMv& rcMv, |
---|
| 399 | UInt& ruiBits, |
---|
| 400 | UInt& ruiCost, |
---|
| 401 | Bool bBi = false ); |
---|
| 402 | |
---|
| 403 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 404 | TComPattern* pcPatternKey, |
---|
| 405 | Pel* piRefY, |
---|
| 406 | Int iRefStride, |
---|
| 407 | TComMv* pcMvSrchRngLT, |
---|
| 408 | TComMv* pcMvSrchRngRB, |
---|
| 409 | TComMv& rcMv, |
---|
| 410 | UInt& ruiSAD ); |
---|
| 411 | |
---|
| 412 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 413 | TComMv& cMvPred, |
---|
| 414 | Int iSrchRng, |
---|
| 415 | TComMv& rcMvSrchRngLT, |
---|
| 416 | TComMv& rcMvSrchRngRB ); |
---|
| 417 | |
---|
| 418 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 419 | TComPattern* pcPatternKey, |
---|
| 420 | Pel* piRefY, |
---|
| 421 | Int iRefStride, |
---|
| 422 | TComMv* pcMvSrchRngLT, |
---|
| 423 | TComMv* pcMvSrchRngRB, |
---|
| 424 | TComMv& rcMv, |
---|
| 425 | UInt& ruiSAD ); |
---|
| 426 | |
---|
| 427 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 428 | Pel* piRefY, |
---|
| 429 | Int iRefStride, |
---|
| 430 | TComMv* pcMvSrchRngLT, |
---|
| 431 | TComMv* pcMvSrchRngRB, |
---|
| 432 | TComMv& rcMv, |
---|
| 433 | UInt& ruiSAD ); |
---|
| 434 | |
---|
| 435 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 436 | TComPattern* pcPatternKey, |
---|
| 437 | Pel* piRefY, |
---|
| 438 | Int iRefStride, |
---|
| 439 | TComMv* pcMvInt, |
---|
| 440 | TComMv& rcMvHalf, |
---|
| 441 | TComMv& rcMvQter, |
---|
| 442 | UInt& ruiCost |
---|
| 443 | ,Bool biPred |
---|
| 444 | ); |
---|
| 445 | #if REF_IDX_ME_ZEROMV |
---|
| 446 | Void xPatternSearchFracDIFMv0 ( TComDataCU* pcCU, |
---|
| 447 | TComPattern* pcPatternKey, |
---|
| 448 | Pel* piRefY, |
---|
| 449 | Int iRefStride, |
---|
| 450 | TComMv* pcMvInt, |
---|
| 451 | TComMv& rcMvHalf, |
---|
| 452 | TComMv& rcMvQter, |
---|
| 453 | UInt& ruiCost, |
---|
| 454 | Bool biPred ); |
---|
| 455 | #endif |
---|
| 456 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
| 457 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
| 458 | |
---|
| 459 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 460 | // T & Q & Q-1 & T-1 |
---|
| 461 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 462 | |
---|
| 463 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
| 464 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, UInt &ruiDist, UInt *puiZeroDist ); |
---|
| 465 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
| 466 | |
---|
| 467 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 468 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 469 | |
---|
| 470 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 471 | // compute symbol bits |
---|
| 472 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 473 | |
---|
| 474 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 475 | UInt uiQp, |
---|
| 476 | UInt uiTrMode, |
---|
| 477 | UInt& ruiBits, |
---|
| 478 | TComYuv*& rpcYuvRec, |
---|
| 479 | TComYuv* pcYuvPred, |
---|
| 480 | TComYuv*& rpcYuvResi ); |
---|
| 481 | |
---|
| 482 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
| 483 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
| 484 | |
---|
| 485 | };// END CLASS DEFINITION TEncSearch |
---|
| 486 | |
---|
| 487 | //! \} |
---|
| 488 | |
---|
| 489 | #endif // __TENCSEARCH__ |
---|