[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 |
---|
[494] | 131 | |
---|
| 132 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 133 | Bool m_disableILP; |
---|
| 134 | #endif |
---|
| 135 | |
---|
[313] | 136 | public: |
---|
| 137 | TEncSearch(); |
---|
| 138 | virtual ~TEncSearch(); |
---|
| 139 | |
---|
| 140 | Void init( TEncCfg* pcEncCfg, |
---|
| 141 | TComTrQuant* pcTrQuant, |
---|
| 142 | Int iSearchRange, |
---|
| 143 | Int bipredSearchRange, |
---|
| 144 | Int iFastSearch, |
---|
| 145 | Int iMaxDeltaQP, |
---|
| 146 | TEncEntropy* pcEntropyCoder, |
---|
| 147 | TComRdCost* pcRdCost, |
---|
| 148 | TEncSbac*** pppcRDSbacCoder, |
---|
| 149 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
| 150 | |
---|
| 151 | protected: |
---|
| 152 | |
---|
| 153 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
| 154 | UInt xPatternRefinement( TComPattern* pcPatternKey, |
---|
| 155 | TComMv baseRefMv, |
---|
| 156 | Int iFrac, TComMv& rcMvFrac ); |
---|
| 157 | |
---|
| 158 | typedef struct |
---|
| 159 | { |
---|
| 160 | Pel* piRefY; |
---|
| 161 | Int iYStride; |
---|
| 162 | Int iBestX; |
---|
| 163 | Int iBestY; |
---|
| 164 | UInt uiBestRound; |
---|
| 165 | UInt uiBestDistance; |
---|
| 166 | UInt uiBestSad; |
---|
| 167 | UChar ucPointNr; |
---|
| 168 | } IntTZSearchStruct; |
---|
| 169 | |
---|
| 170 | // sub-functions for ME |
---|
| 171 | __inline Void xTZSearchHelp ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
| 172 | __inline Void xTZ2PointSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB ); |
---|
| 173 | __inline Void xTZ8PointSquareSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
| 174 | __inline Void xTZ8PointDiamondSearch( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
| 175 | |
---|
| 176 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard ); |
---|
| 177 | |
---|
| 178 | public: |
---|
| 179 | Void preestChromaPredMode ( TComDataCU* pcCU, |
---|
| 180 | TComYuv* pcOrgYuv, |
---|
| 181 | TComYuv* pcPredYuv ); |
---|
| 182 | Void estIntraPredQT ( TComDataCU* pcCU, |
---|
| 183 | TComYuv* pcOrgYuv, |
---|
| 184 | TComYuv* pcPredYuv, |
---|
| 185 | TComYuv* pcResiYuv, |
---|
| 186 | TComYuv* pcRecoYuv, |
---|
| 187 | UInt& ruiDistC, |
---|
| 188 | Bool bLumaOnly ); |
---|
| 189 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
| 190 | TComYuv* pcOrgYuv, |
---|
| 191 | TComYuv* pcPredYuv, |
---|
| 192 | TComYuv* pcResiYuv, |
---|
| 193 | TComYuv* pcRecoYuv, |
---|
| 194 | UInt uiPreCalcDistC ); |
---|
| 195 | |
---|
[532] | 196 | |
---|
[313] | 197 | /// encoder estimation - inter prediction (non-skip) |
---|
| 198 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 199 | TComYuv* pcOrgYuv, |
---|
| 200 | TComYuv*& rpcPredYuv, |
---|
| 201 | TComYuv*& rpcResiYuv, |
---|
| 202 | TComYuv*& rpcRecoYuv, |
---|
| 203 | Bool bUseRes = false |
---|
| 204 | #if AMP_MRG |
---|
| 205 | ,Bool bUseMRG = false |
---|
| 206 | #endif |
---|
| 207 | ); |
---|
| 208 | |
---|
| 209 | #if (ENCODER_FAST_MODE) |
---|
| 210 | Bool predInterSearchILRUni ( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, UInt refLayerId ); |
---|
| 211 | #endif |
---|
| 212 | |
---|
| 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 | |
---|
| 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 ); |
---|
[494] | 227 | |
---|
| 228 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 229 | Void setDisableILP(Bool a) {m_disableILP = a;} |
---|
| 230 | #endif |
---|
| 231 | |
---|
[313] | 232 | protected: |
---|
| 233 | |
---|
| 234 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 235 | // Intra search |
---|
| 236 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 237 | |
---|
| 238 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 239 | UInt uiTrDepth, |
---|
| 240 | UInt uiAbsPartIdx, |
---|
| 241 | Bool bLuma, |
---|
| 242 | Bool bChroma ); |
---|
| 243 | |
---|
| 244 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 245 | UInt uiTrDepth, |
---|
| 246 | UInt uiAbsPartIdx, |
---|
| 247 | TextType eTextType, |
---|
| 248 | Bool bRealCoeff ); |
---|
| 249 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 250 | UInt uiTrDepth, |
---|
| 251 | UInt uiAbsPartIdx, |
---|
| 252 | Bool bLuma, |
---|
| 253 | Bool bChroma ); |
---|
| 254 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 255 | UInt uiTrDepth, |
---|
| 256 | UInt uiAbsPartIdx, |
---|
| 257 | Bool bLuma, |
---|
| 258 | Bool bChroma, |
---|
| 259 | Bool bRealCoeff ); |
---|
| 260 | UInt xGetIntraBitsQTChroma ( TComDataCU* pcCU, |
---|
| 261 | UInt uiTrDepth, |
---|
| 262 | UInt uiAbsPartIdx, |
---|
| 263 | UInt uiChromaId, |
---|
| 264 | Bool bRealCoeff ); |
---|
| 265 | |
---|
| 266 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 267 | UInt uiTrDepth, |
---|
| 268 | UInt uiAbsPartIdx, |
---|
| 269 | TComYuv* pcOrgYuv, |
---|
| 270 | TComYuv* pcPredYuv, |
---|
| 271 | TComYuv* pcResiYuv, |
---|
| 272 | UInt& ruiDist, |
---|
| 273 | Int default0Save1Load2 = 0); |
---|
| 274 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 275 | UInt uiTrDepth, |
---|
| 276 | UInt uiAbsPartIdx, |
---|
| 277 | TComYuv* pcOrgYuv, |
---|
| 278 | TComYuv* pcPredYuv, |
---|
| 279 | TComYuv* pcResiYuv, |
---|
| 280 | UInt& ruiDist, |
---|
| 281 | UInt uiChromaId, |
---|
| 282 | Int default0Save1Load2 = 0 ); |
---|
| 283 | |
---|
| 284 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 285 | UInt uiTrDepth, |
---|
| 286 | UInt uiAbsPartIdx, |
---|
| 287 | Bool bLumaOnly, |
---|
| 288 | TComYuv* pcOrgYuv, |
---|
| 289 | TComYuv* pcPredYuv, |
---|
| 290 | TComYuv* pcResiYuv, |
---|
| 291 | UInt& ruiDistY, |
---|
| 292 | UInt& ruiDistC, |
---|
| 293 | #if HHI_RQT_INTRA_SPEEDUP |
---|
| 294 | Bool bCheckFirst, |
---|
| 295 | #endif |
---|
| 296 | Double& dRDCost ); |
---|
| 297 | |
---|
| 298 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 299 | UInt uiTrDepth, |
---|
| 300 | UInt uiAbsPartIdx, |
---|
| 301 | Bool bLumaOnly, |
---|
| 302 | TComYuv* pcRecoYuv ); |
---|
| 303 | |
---|
| 304 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 305 | UInt uiTrDepth, |
---|
| 306 | UInt uiAbsPartIdx, |
---|
| 307 | TComYuv* pcOrgYuv, |
---|
| 308 | TComYuv* pcPredYuv, |
---|
| 309 | TComYuv* pcResiYuv, |
---|
| 310 | UInt& ruiDist ); |
---|
| 311 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 312 | UInt uiTrDepth, |
---|
| 313 | UInt uiAbsPartIdx, |
---|
| 314 | TComYuv* pcRecoYuv ); |
---|
| 315 | |
---|
| 316 | Void xStoreIntraResultQT ( TComDataCU* pcCU, |
---|
| 317 | UInt uiTrDepth, |
---|
| 318 | UInt uiAbsPartIdx, |
---|
| 319 | Bool bLumaOnly ); |
---|
| 320 | Void xLoadIntraResultQT ( TComDataCU* pcCU, |
---|
| 321 | UInt uiTrDepth, |
---|
| 322 | UInt uiAbsPartIdx, |
---|
| 323 | Bool bLumaOnly ); |
---|
| 324 | Void xStoreIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 325 | UInt uiTrDepth, |
---|
| 326 | UInt uiAbsPartIdx, |
---|
| 327 | UInt stateU0V1Both2 ); |
---|
| 328 | Void xLoadIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 329 | UInt uiTrDepth, |
---|
| 330 | UInt uiAbsPartIdx, |
---|
| 331 | UInt stateU0V1Both2 ); |
---|
| 332 | |
---|
| 333 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 334 | // Inter search (AMP) |
---|
| 335 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 336 | |
---|
| 337 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 338 | TComYuv* pcOrgYuv, |
---|
| 339 | UInt uiPartIdx, |
---|
| 340 | RefPicList eRefPicList, |
---|
| 341 | Int iRefIdx, |
---|
| 342 | TComMv& rcMvPred, |
---|
| 343 | Bool bFilled = false |
---|
| 344 | , UInt* puiDistBiP = NULL |
---|
| 345 | #if ZERO_MVD_EST |
---|
| 346 | , UInt* puiDist = NULL |
---|
| 347 | #endif |
---|
| 348 | ); |
---|
| 349 | |
---|
| 350 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 351 | RefPicList eRefPicList, |
---|
| 352 | TComMv cMv, |
---|
| 353 | TComMv& rcMvPred, |
---|
| 354 | Int& riMVPIdx, |
---|
| 355 | UInt& ruiBits, |
---|
| 356 | UInt& ruiCost ); |
---|
| 357 | |
---|
| 358 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 359 | UInt uiPartIdx, |
---|
| 360 | UInt uiPartAddr, |
---|
| 361 | TComYuv* pcOrgYuv, |
---|
| 362 | TComYuv* pcTemplateCand, |
---|
| 363 | TComMv cMvCand, |
---|
| 364 | Int iMVPIdx, |
---|
| 365 | Int iMVPNum, |
---|
| 366 | RefPicList eRefPicList, |
---|
| 367 | Int iRefIdx, |
---|
| 368 | Int iSizeX, |
---|
| 369 | Int iSizeY |
---|
| 370 | #if ZERO_MVD_EST |
---|
| 371 | , UInt& ruiDist |
---|
| 372 | #endif |
---|
| 373 | ); |
---|
| 374 | |
---|
| 375 | |
---|
| 376 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 377 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 378 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 379 | |
---|
| 380 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 381 | TComYuv* pcYuvOrg, |
---|
| 382 | Int iPartIdx, |
---|
| 383 | UInt& uiInterDir, |
---|
| 384 | TComMvField* pacMvField, |
---|
| 385 | UInt& uiMergeIndex, |
---|
| 386 | UInt& ruiCost |
---|
| 387 | , TComMvField* cMvFieldNeighbours, |
---|
| 388 | UChar* uhInterDirNeighbours, |
---|
| 389 | Int& numValidMergeCand |
---|
| 390 | ); |
---|
| 391 | |
---|
| 392 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
| 393 | UInt puIdx, |
---|
| 394 | TComMvField* mvFieldNeighbours, |
---|
| 395 | UChar* interDirNeighbours, |
---|
| 396 | Int numValidMergeCand ); |
---|
| 397 | |
---|
| 398 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 399 | // motion estimation |
---|
| 400 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 401 | |
---|
| 402 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 403 | TComYuv* pcYuvOrg, |
---|
| 404 | Int iPartIdx, |
---|
| 405 | RefPicList eRefPicList, |
---|
| 406 | TComMv* pcMvPred, |
---|
| 407 | Int iRefIdxPred, |
---|
| 408 | TComMv& rcMv, |
---|
| 409 | UInt& ruiBits, |
---|
| 410 | UInt& ruiCost, |
---|
| 411 | Bool bBi = false ); |
---|
| 412 | |
---|
| 413 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 414 | TComPattern* pcPatternKey, |
---|
| 415 | Pel* piRefY, |
---|
| 416 | Int iRefStride, |
---|
| 417 | TComMv* pcMvSrchRngLT, |
---|
| 418 | TComMv* pcMvSrchRngRB, |
---|
| 419 | TComMv& rcMv, |
---|
| 420 | UInt& ruiSAD ); |
---|
| 421 | |
---|
| 422 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 423 | TComMv& cMvPred, |
---|
| 424 | Int iSrchRng, |
---|
| 425 | TComMv& rcMvSrchRngLT, |
---|
| 426 | TComMv& rcMvSrchRngRB ); |
---|
| 427 | |
---|
| 428 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 429 | TComPattern* pcPatternKey, |
---|
| 430 | Pel* piRefY, |
---|
| 431 | Int iRefStride, |
---|
| 432 | TComMv* pcMvSrchRngLT, |
---|
| 433 | TComMv* pcMvSrchRngRB, |
---|
| 434 | TComMv& rcMv, |
---|
| 435 | UInt& ruiSAD ); |
---|
| 436 | |
---|
| 437 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 438 | Pel* piRefY, |
---|
| 439 | Int iRefStride, |
---|
| 440 | TComMv* pcMvSrchRngLT, |
---|
| 441 | TComMv* pcMvSrchRngRB, |
---|
| 442 | TComMv& rcMv, |
---|
| 443 | UInt& ruiSAD ); |
---|
| 444 | |
---|
| 445 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 446 | TComPattern* pcPatternKey, |
---|
| 447 | Pel* piRefY, |
---|
| 448 | Int iRefStride, |
---|
| 449 | TComMv* pcMvInt, |
---|
| 450 | TComMv& rcMvHalf, |
---|
| 451 | TComMv& rcMvQter, |
---|
| 452 | UInt& ruiCost |
---|
| 453 | ,Bool biPred |
---|
| 454 | ); |
---|
| 455 | #if REF_IDX_ME_ZEROMV |
---|
| 456 | Void xPatternSearchFracDIFMv0 ( TComDataCU* pcCU, |
---|
| 457 | TComPattern* pcPatternKey, |
---|
| 458 | Pel* piRefY, |
---|
| 459 | Int iRefStride, |
---|
| 460 | TComMv* pcMvInt, |
---|
| 461 | TComMv& rcMvHalf, |
---|
| 462 | TComMv& rcMvQter, |
---|
| 463 | UInt& ruiCost, |
---|
| 464 | Bool biPred ); |
---|
| 465 | #endif |
---|
| 466 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
| 467 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
| 468 | |
---|
| 469 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 470 | // T & Q & Q-1 & T-1 |
---|
| 471 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 472 | |
---|
| 473 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
| 474 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, UInt &ruiDist, UInt *puiZeroDist ); |
---|
| 475 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
| 476 | |
---|
| 477 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 478 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 479 | |
---|
| 480 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 481 | // compute symbol bits |
---|
| 482 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 483 | |
---|
| 484 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 485 | UInt uiQp, |
---|
| 486 | UInt uiTrMode, |
---|
| 487 | UInt& ruiBits, |
---|
| 488 | TComYuv*& rpcYuvRec, |
---|
| 489 | TComYuv* pcYuvPred, |
---|
| 490 | TComYuv*& rpcYuvResi ); |
---|
| 491 | |
---|
| 492 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
| 493 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
| 494 | |
---|
| 495 | };// END CLASS DEFINITION TEncSearch |
---|
| 496 | |
---|
| 497 | //! \} |
---|
| 498 | |
---|
| 499 | #endif // __TENCSEARCH__ |
---|