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