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