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