[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 |
---|
[1029] | 4 | * granted under this license. |
---|
[313] | 5 | * |
---|
[1259] | 6 | * Copyright (c) 2010-2015, 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" |
---|
[1029] | 48 | #include "TLibCommon/TComRectangle.h" |
---|
[313] | 49 | #include "TEncEntropy.h" |
---|
| 50 | #include "TEncSbac.h" |
---|
| 51 | #include "TEncCfg.h" |
---|
| 52 | |
---|
[1029] | 53 | |
---|
[313] | 54 | //! \ingroup TLibEncoder |
---|
| 55 | //! \{ |
---|
| 56 | |
---|
| 57 | class TEncCu; |
---|
| 58 | |
---|
| 59 | // ==================================================================================================================== |
---|
| 60 | // Class definition |
---|
| 61 | // ==================================================================================================================== |
---|
| 62 | |
---|
[1029] | 63 | static const UInt MAX_NUM_REF_LIST_ADAPT_SR=2; |
---|
| 64 | static const UInt MAX_IDX_ADAPT_SR=33; |
---|
| 65 | static const UInt NUM_MV_PREDICTORS=3; |
---|
| 66 | |
---|
[313] | 67 | /// encoder search class |
---|
| 68 | class TEncSearch : public TComPrediction |
---|
| 69 | { |
---|
| 70 | private: |
---|
[1029] | 71 | TCoeff** m_ppcQTTempCoeff[MAX_NUM_COMPONENT /* 0->Y, 1->Cb, 2->Cr*/]; |
---|
| 72 | TCoeff* m_pcQTTempCoeff[MAX_NUM_COMPONENT]; |
---|
[313] | 73 | #if ADAPTIVE_QP_SELECTION |
---|
[1029] | 74 | TCoeff** m_ppcQTTempArlCoeff[MAX_NUM_COMPONENT]; |
---|
| 75 | TCoeff* m_pcQTTempArlCoeff[MAX_NUM_COMPONENT]; |
---|
[313] | 76 | #endif |
---|
| 77 | UChar* m_puhQTTempTrIdx; |
---|
[1029] | 78 | UChar* m_puhQTTempCbf[MAX_NUM_COMPONENT]; |
---|
| 79 | |
---|
[313] | 80 | TComYuv* m_pcQTTempTComYuv; |
---|
| 81 | TComYuv m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation |
---|
[1029] | 82 | |
---|
| 83 | Char* m_phQTTempCrossComponentPredictionAlpha[MAX_NUM_COMPONENT]; |
---|
| 84 | Pel* m_pSharedPredTransformSkip[MAX_NUM_COMPONENT]; |
---|
| 85 | TCoeff* m_pcQTTempTUCoeff[MAX_NUM_COMPONENT]; |
---|
| 86 | UChar* m_puhQTTempTransformSkipFlag[MAX_NUM_COMPONENT]; |
---|
[313] | 87 | TComYuv m_pcQTTempTransformSkipTComYuv; |
---|
| 88 | #if ADAPTIVE_QP_SELECTION |
---|
[1029] | 89 | TCoeff* m_ppcQTTempTUArlCoeff[MAX_NUM_COMPONENT]; |
---|
[313] | 90 | #endif |
---|
[1029] | 91 | |
---|
[313] | 92 | protected: |
---|
| 93 | // interface to option |
---|
| 94 | TEncCfg* m_pcEncCfg; |
---|
[1029] | 95 | |
---|
[313] | 96 | // interface to classes |
---|
| 97 | TComTrQuant* m_pcTrQuant; |
---|
| 98 | TComRdCost* m_pcRdCost; |
---|
| 99 | TEncEntropy* m_pcEntropyCoder; |
---|
[1029] | 100 | |
---|
[313] | 101 | // ME parameters |
---|
| 102 | Int m_iSearchRange; |
---|
| 103 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
| 104 | Int m_iFastSearch; |
---|
[1029] | 105 | Int m_aaiAdaptSR[MAX_NUM_REF_LIST_ADAPT_SR][MAX_IDX_ADAPT_SR]; |
---|
[313] | 106 | TComMv m_cSrchRngLT; |
---|
| 107 | TComMv m_cSrchRngRB; |
---|
[1029] | 108 | TComMv m_acMvPredictors[NUM_MV_PREDICTORS]; // Left, Above, AboveRight. enum MVP_DIR first NUM_MV_PREDICTORS entries are suitable for accessing. |
---|
| 109 | |
---|
[313] | 110 | // RD computation |
---|
| 111 | TEncSbac*** m_pppcRDSbacCoder; |
---|
| 112 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
| 113 | DistParam m_cDistParam; |
---|
[1029] | 114 | |
---|
[313] | 115 | // Misc. |
---|
| 116 | Pel* m_pTempPel; |
---|
| 117 | const UInt* m_puiDFilter; |
---|
[1029] | 118 | |
---|
[313] | 119 | // AMVP cost computation |
---|
| 120 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
| 121 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
[494] | 122 | |
---|
[1029] | 123 | TComMv m_integerMv2Nx2N[NUM_REF_PIC_LIST_01][MAX_NUM_REF]; |
---|
| 124 | |
---|
[595] | 125 | #if SVC_EXTENSION |
---|
[494] | 126 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 127 | Bool m_disableILP; |
---|
| 128 | #endif |
---|
[815] | 129 | #endif //SVC_EXTENSION |
---|
[494] | 130 | |
---|
[313] | 131 | public: |
---|
| 132 | TEncSearch(); |
---|
| 133 | virtual ~TEncSearch(); |
---|
[1029] | 134 | |
---|
[313] | 135 | Void init( TEncCfg* pcEncCfg, |
---|
| 136 | TComTrQuant* pcTrQuant, |
---|
| 137 | Int iSearchRange, |
---|
| 138 | Int bipredSearchRange, |
---|
| 139 | Int iFastSearch, |
---|
[1289] | 140 | const UInt maxCUWidth, |
---|
| 141 | const UInt maxCUHeight, |
---|
[1290] | 142 | const UInt maxTotalCUDepth, |
---|
[313] | 143 | TEncEntropy* pcEntropyCoder, |
---|
| 144 | TComRdCost* pcRdCost, |
---|
| 145 | TEncSbac*** pppcRDSbacCoder, |
---|
| 146 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
[1029] | 147 | |
---|
[313] | 148 | protected: |
---|
[1029] | 149 | |
---|
[313] | 150 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
[1029] | 151 | Distortion xPatternRefinement( TComPattern* pcPatternKey, |
---|
| 152 | TComMv baseRefMv, |
---|
| 153 | Int iFrac, TComMv& rcMvFrac, Bool bAllowUseOfHadamard |
---|
| 154 | ); |
---|
| 155 | |
---|
[313] | 156 | typedef struct |
---|
| 157 | { |
---|
[1029] | 158 | Pel* piRefY; |
---|
| 159 | Int iYStride; |
---|
| 160 | Int iBestX; |
---|
| 161 | Int iBestY; |
---|
| 162 | UInt uiBestRound; |
---|
| 163 | UInt uiBestDistance; |
---|
| 164 | Distortion uiBestSad; |
---|
| 165 | UChar ucPointNr; |
---|
[313] | 166 | } IntTZSearchStruct; |
---|
[1029] | 167 | |
---|
[313] | 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 | |
---|
[1029] | 174 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, Distortion& ruiSAD, Bool Hadamard ); |
---|
| 175 | |
---|
[313] | 176 | public: |
---|
[1243] | 177 | Void estIntraPredLumaQT ( TComDataCU* pcCU, |
---|
[1029] | 178 | TComYuv* pcOrgYuv, |
---|
| 179 | TComYuv* pcPredYuv, |
---|
| 180 | TComYuv* pcResiYuv, |
---|
[313] | 181 | TComYuv* pcRecoYuv, |
---|
[1243] | 182 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE] |
---|
[1029] | 183 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
| 184 | |
---|
| 185 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
| 186 | TComYuv* pcOrgYuv, |
---|
| 187 | TComYuv* pcPredYuv, |
---|
| 188 | TComYuv* pcResiYuv, |
---|
[313] | 189 | TComYuv* pcRecoYuv, |
---|
[1243] | 190 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE] |
---|
[1029] | 191 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
| 192 | |
---|
[313] | 193 | /// encoder estimation - inter prediction (non-skip) |
---|
[815] | 194 | #if SVC_EXTENSION |
---|
| 195 | Bool predInterSearch ( TComDataCU* pcCU, |
---|
| 196 | #else |
---|
[313] | 197 | Void predInterSearch ( TComDataCU* pcCU, |
---|
[815] | 198 | #endif |
---|
[313] | 199 | TComYuv* pcOrgYuv, |
---|
[1029] | 200 | TComYuv* pcPredYuv, |
---|
| 201 | TComYuv* pcResiYuv, |
---|
| 202 | TComYuv* pcRecoYuv |
---|
| 203 | DEBUG_STRING_FN_DECLARE(sDebug), |
---|
[313] | 204 | Bool bUseRes = false |
---|
| 205 | #if AMP_MRG |
---|
| 206 | ,Bool bUseMRG = false |
---|
| 207 | #endif |
---|
| 208 | ); |
---|
[1029] | 209 | |
---|
[313] | 210 | /// encode residual and compute rd-cost for inter mode |
---|
| 211 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 212 | TComYuv* pcYuvOrg, |
---|
| 213 | TComYuv* pcYuvPred, |
---|
[1029] | 214 | TComYuv* pcYuvResi, |
---|
| 215 | TComYuv* pcYuvResiBest, |
---|
| 216 | TComYuv* pcYuvRec, |
---|
[1249] | 217 | Bool bSkipResidual |
---|
[1029] | 218 | DEBUG_STRING_FN_DECLARE(sDebug) ); |
---|
| 219 | |
---|
[313] | 220 | /// set ME search range |
---|
[1029] | 221 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { assert(iDir < MAX_NUM_REF_LIST_ADAPT_SR && iRefIdx<Int(MAX_IDX_ADAPT_SR)); m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
[494] | 222 | |
---|
[1029] | 223 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, const ComponentID compID ); |
---|
| 224 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv* rpcPredYuv, TComYuv* rpcResiYuv, TComYuv* rpcRecoYuv ); |
---|
| 225 | |
---|
[595] | 226 | #if SVC_EXTENSION |
---|
[1029] | 227 | #if ENCODER_FAST_MODE |
---|
[595] | 228 | Bool predInterSearchILRUni ( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, UInt refLayerId ); |
---|
| 229 | #endif |
---|
[494] | 230 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 231 | Void setDisableILP(Bool a) {m_disableILP = a;} |
---|
| 232 | #endif |
---|
[595] | 233 | #endif //SVC_EXTENSION |
---|
[494] | 234 | |
---|
[313] | 235 | protected: |
---|
[1029] | 236 | |
---|
[313] | 237 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 238 | // Intra search |
---|
| 239 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 240 | |
---|
| 241 | Void xEncSubdivCbfQT ( TComTU &rTu, |
---|
[313] | 242 | Bool bLuma, |
---|
| 243 | Bool bChroma ); |
---|
| 244 | |
---|
[1029] | 245 | Void xEncCoeffQT ( TComTU &rTu, |
---|
| 246 | ComponentID component, |
---|
[313] | 247 | Bool bRealCoeff ); |
---|
| 248 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 249 | UInt uiTrDepth, |
---|
| 250 | UInt uiAbsPartIdx, |
---|
| 251 | Bool bLuma, |
---|
| 252 | Bool bChroma ); |
---|
[1029] | 253 | UInt xGetIntraBitsQT ( TComTU &rTu, |
---|
[313] | 254 | Bool bLuma, |
---|
| 255 | Bool bChroma, |
---|
| 256 | Bool bRealCoeff ); |
---|
[1029] | 257 | |
---|
| 258 | UInt xGetIntraBitsQTChroma ( TComTU &rTu, |
---|
| 259 | ComponentID compID, |
---|
[313] | 260 | Bool bRealCoeff ); |
---|
| 261 | |
---|
[1029] | 262 | Void xIntraCodingTUBlock ( TComYuv* pcOrgYuv, |
---|
| 263 | TComYuv* pcPredYuv, |
---|
| 264 | TComYuv* pcResiYuv, |
---|
| 265 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE], |
---|
| 266 | const Bool checkCrossCPrediction, |
---|
| 267 | Distortion& ruiDist, |
---|
| 268 | const ComponentID compID, |
---|
| 269 | TComTU &rTu |
---|
| 270 | DEBUG_STRING_FN_DECLARE(sTest) |
---|
| 271 | ,Int default0Save1Load2 = 0 |
---|
| 272 | ); |
---|
| 273 | |
---|
[1243] | 274 | Void xRecurIntraCodingLumaQT ( TComYuv* pcOrgYuv, |
---|
[1029] | 275 | TComYuv* pcPredYuv, |
---|
| 276 | TComYuv* pcResiYuv, |
---|
| 277 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE], |
---|
| 278 | Distortion& ruiDistY, |
---|
[313] | 279 | #if HHI_RQT_INTRA_SPEEDUP |
---|
[1243] | 280 | Bool bCheckFirst, |
---|
[313] | 281 | #endif |
---|
[1243] | 282 | Double& dRDCost, |
---|
| 283 | TComTU &rTu |
---|
| 284 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
[313] | 285 | |
---|
[1243] | 286 | Void xSetIntraResultLumaQT ( TComYuv* pcRecoYuv, |
---|
[1029] | 287 | TComTU &rTu); |
---|
| 288 | |
---|
| 289 | Void xStoreCrossComponentPredictionResult ( Pel *pResiLuma, |
---|
| 290 | const Pel *pBestLuma, |
---|
| 291 | TComTU &rTu, |
---|
| 292 | const Int xOffset, |
---|
| 293 | const Int yOffset, |
---|
| 294 | const Int strideResi, |
---|
| 295 | const Int strideBest ); |
---|
| 296 | |
---|
| 297 | Char xCalcCrossComponentPredictionAlpha ( TComTU &rTu, |
---|
| 298 | const ComponentID compID, |
---|
| 299 | const Pel* piResiL, |
---|
| 300 | const Pel* piResiC, |
---|
| 301 | const Int width, |
---|
| 302 | const Int height, |
---|
| 303 | const Int strideL, |
---|
| 304 | const Int strideC ); |
---|
| 305 | |
---|
| 306 | Void xRecurIntraChromaCodingQT ( TComYuv* pcOrgYuv, |
---|
| 307 | TComYuv* pcPredYuv, |
---|
| 308 | TComYuv* pcResiYuv, |
---|
| 309 | Pel resiLuma[NUMBER_OF_STORED_RESIDUAL_TYPES][MAX_CU_SIZE * MAX_CU_SIZE], |
---|
| 310 | Distortion& ruiDist, |
---|
| 311 | TComTU &rTu |
---|
| 312 | DEBUG_STRING_FN_DECLARE(sDebug)); |
---|
| 313 | |
---|
| 314 | Void xSetIntraResultChromaQT ( TComYuv* pcRecoYuv, TComTU &rTu); |
---|
| 315 | |
---|
[1243] | 316 | Void xStoreIntraResultQT ( const ComponentID compID, TComTU &rTu); |
---|
| 317 | Void xLoadIntraResultQT ( const ComponentID compID, TComTU &rTu); |
---|
[1029] | 318 | |
---|
| 319 | |
---|
[313] | 320 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 321 | // Inter search (AMP) |
---|
| 322 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 323 | |
---|
[313] | 324 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 325 | TComYuv* pcOrgYuv, |
---|
| 326 | UInt uiPartIdx, |
---|
| 327 | RefPicList eRefPicList, |
---|
| 328 | Int iRefIdx, |
---|
| 329 | TComMv& rcMvPred, |
---|
| 330 | Bool bFilled = false |
---|
[1029] | 331 | , Distortion* puiDistBiP = NULL |
---|
[313] | 332 | ); |
---|
[1029] | 333 | |
---|
[313] | 334 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 335 | RefPicList eRefPicList, |
---|
| 336 | TComMv cMv, |
---|
| 337 | TComMv& rcMvPred, |
---|
| 338 | Int& riMVPIdx, |
---|
| 339 | UInt& ruiBits, |
---|
[1029] | 340 | Distortion& ruiCost ); |
---|
| 341 | |
---|
| 342 | Distortion xGetTemplateCost ( TComDataCU* pcCU, |
---|
[313] | 343 | UInt uiPartAddr, |
---|
| 344 | TComYuv* pcOrgYuv, |
---|
| 345 | TComYuv* pcTemplateCand, |
---|
| 346 | TComMv cMvCand, |
---|
| 347 | Int iMVPIdx, |
---|
| 348 | Int iMVPNum, |
---|
| 349 | RefPicList eRefPicList, |
---|
| 350 | Int iRefIdx, |
---|
| 351 | Int iSizeX, |
---|
| 352 | Int iSizeY |
---|
| 353 | ); |
---|
[1029] | 354 | |
---|
| 355 | |
---|
[313] | 356 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 357 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 358 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
[1029] | 359 | |
---|
| 360 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 361 | TComYuv* pcYuvOrg, |
---|
| 362 | Int iPartIdx, |
---|
| 363 | UInt& uiInterDir, |
---|
| 364 | TComMvField* pacMvField, |
---|
| 365 | UInt& uiMergeIndex, |
---|
| 366 | Distortion& ruiCost, |
---|
| 367 | TComMvField* cMvFieldNeighbours, |
---|
| 368 | UChar* uhInterDirNeighbours, |
---|
| 369 | Int& numValidMergeCand |
---|
[313] | 370 | ); |
---|
| 371 | |
---|
| 372 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
| 373 | UInt puIdx, |
---|
[1029] | 374 | TComMvField* mvFieldNeighbours, |
---|
| 375 | UChar* interDirNeighbours, |
---|
[313] | 376 | Int numValidMergeCand ); |
---|
| 377 | |
---|
[1029] | 378 | |
---|
[313] | 379 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 380 | // motion estimation |
---|
| 381 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 382 | |
---|
| 383 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 384 | TComYuv* pcYuvOrg, |
---|
| 385 | Int iPartIdx, |
---|
| 386 | RefPicList eRefPicList, |
---|
| 387 | TComMv* pcMvPred, |
---|
| 388 | Int iRefIdxPred, |
---|
| 389 | TComMv& rcMv, |
---|
| 390 | UInt& ruiBits, |
---|
| 391 | Distortion& ruiCost, |
---|
| 392 | Bool bBi = false ); |
---|
| 393 | |
---|
| 394 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 395 | TComPattern* pcPatternKey, |
---|
| 396 | Pel* piRefY, |
---|
| 397 | Int iRefStride, |
---|
| 398 | TComMv* pcMvSrchRngLT, |
---|
| 399 | TComMv* pcMvSrchRngRB, |
---|
| 400 | TComMv& rcMv, |
---|
| 401 | Distortion& ruiSAD, |
---|
| 402 | const TComMv *pIntegerMv2Nx2NPred |
---|
| 403 | ); |
---|
| 404 | |
---|
| 405 | Void xTZSearchSelective ( TComDataCU* pcCU, |
---|
| 406 | TComPattern* pcPatternKey, |
---|
| 407 | Pel* piRefY, |
---|
| 408 | Int iRefStride, |
---|
| 409 | TComMv* pcMvSrchRngLT, |
---|
| 410 | TComMv* pcMvSrchRngRB, |
---|
| 411 | TComMv& rcMv, |
---|
| 412 | Distortion& ruiSAD, |
---|
| 413 | const TComMv *pIntegerMv2Nx2NPred |
---|
| 414 | ); |
---|
| 415 | |
---|
| 416 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 417 | TComMv& cMvPred, |
---|
| 418 | Int iSrchRng, |
---|
| 419 | TComMv& rcMvSrchRngLT, |
---|
| 420 | TComMv& rcMvSrchRngRB ); |
---|
| 421 | |
---|
| 422 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 423 | TComPattern* pcPatternKey, |
---|
| 424 | Pel* piRefY, |
---|
| 425 | Int iRefStride, |
---|
| 426 | TComMv* pcMvSrchRngLT, |
---|
| 427 | TComMv* pcMvSrchRngRB, |
---|
| 428 | TComMv& rcMv, |
---|
| 429 | Distortion& ruiSAD, |
---|
| 430 | const TComMv* pIntegerMv2Nx2NPred |
---|
| 431 | ); |
---|
| 432 | |
---|
| 433 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 434 | Pel* piRefY, |
---|
| 435 | Int iRefStride, |
---|
| 436 | TComMv* pcMvSrchRngLT, |
---|
| 437 | TComMv* pcMvSrchRngRB, |
---|
| 438 | TComMv& rcMv, |
---|
| 439 | Distortion& ruiSAD ); |
---|
| 440 | |
---|
| 441 | Void xPatternSearchFracDIF ( |
---|
| 442 | Bool bIsLosslessCoded, |
---|
| 443 | TComPattern* pcPatternKey, |
---|
| 444 | Pel* piRefY, |
---|
| 445 | Int iRefStride, |
---|
| 446 | TComMv* pcMvInt, |
---|
| 447 | TComMv& rcMvHalf, |
---|
| 448 | TComMv& rcMvQter, |
---|
[1307] | 449 | Distortion& ruiCost |
---|
[313] | 450 | ); |
---|
[1029] | 451 | |
---|
[1307] | 452 | Void xExtDIFUpSamplingH( TComPattern* pcPattern ); |
---|
| 453 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef ); |
---|
[1029] | 454 | |
---|
[313] | 455 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 456 | // T & Q & Q-1 & T-1 |
---|
| 457 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 458 | |
---|
| 459 | |
---|
[1249] | 460 | Void xEncodeInterResidualQT( const ComponentID compID, TComTU &rTu ); |
---|
| 461 | Void xEstimateInterResidualQT( TComYuv* pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu DEBUG_STRING_FN_DECLARE(sDebug) ); |
---|
| 462 | Void xSetInterResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu ); |
---|
[1029] | 463 | |
---|
[1307] | 464 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPartOffset, UInt uiDepth, const ChannelType compID ); |
---|
[313] | 465 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
[1029] | 466 | |
---|
[313] | 467 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 468 | // compute symbol bits |
---|
| 469 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 470 | |
---|
| 471 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 472 | UInt& ruiBits); |
---|
| 473 | |
---|
[313] | 474 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
[1029] | 475 | inline Void setDistParamComp( ComponentID compIdx ) { m_cDistParam.compIdx = compIdx; } |
---|
[595] | 476 | |
---|
[1029] | 477 | #if SVC_EXTENSION && REF_IDX_ME_ZEROMV |
---|
| 478 | Void xPatternSearchFracDIFMv0 ( TComPattern* pcPatternKey, |
---|
[595] | 479 | Pel* piRefY, |
---|
| 480 | Int iRefStride, |
---|
| 481 | TComMv* pcMvInt, |
---|
| 482 | TComMv& rcMvHalf, |
---|
| 483 | TComMv& rcMvQter, |
---|
[1029] | 484 | UInt& ruiCost ); |
---|
[595] | 485 | #endif //SVC_EXTENSION |
---|
| 486 | |
---|
[313] | 487 | };// END CLASS DEFINITION TEncSearch |
---|
| 488 | |
---|
| 489 | //! \} |
---|
| 490 | |
---|
| 491 | #endif // __TENCSEARCH__ |
---|