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