[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*/]; |
---|
[313] | 72 | #if ADAPTIVE_QP_SELECTION |
---|
[1029] | 73 | TCoeff** m_ppcQTTempArlCoeff[MAX_NUM_COMPONENT]; |
---|
[313] | 74 | #endif |
---|
| 75 | UChar* m_puhQTTempTrIdx; |
---|
[1029] | 76 | UChar* m_puhQTTempCbf[MAX_NUM_COMPONENT]; |
---|
| 77 | |
---|
[313] | 78 | TComYuv* m_pcQTTempTComYuv; |
---|
| 79 | TComYuv m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation |
---|
[1029] | 80 | |
---|
[1442] | 81 | SChar* m_phQTTempCrossComponentPredictionAlpha[MAX_NUM_COMPONENT]; |
---|
[1029] | 82 | Pel* m_pSharedPredTransformSkip[MAX_NUM_COMPONENT]; |
---|
| 83 | TCoeff* m_pcQTTempTUCoeff[MAX_NUM_COMPONENT]; |
---|
| 84 | UChar* m_puhQTTempTransformSkipFlag[MAX_NUM_COMPONENT]; |
---|
[313] | 85 | TComYuv m_pcQTTempTransformSkipTComYuv; |
---|
| 86 | #if ADAPTIVE_QP_SELECTION |
---|
[1029] | 87 | TCoeff* m_ppcQTTempTUArlCoeff[MAX_NUM_COMPONENT]; |
---|
[313] | 88 | #endif |
---|
[1029] | 89 | |
---|
[313] | 90 | protected: |
---|
| 91 | // interface to option |
---|
| 92 | TEncCfg* m_pcEncCfg; |
---|
[1029] | 93 | |
---|
[313] | 94 | // interface to classes |
---|
| 95 | TComTrQuant* m_pcTrQuant; |
---|
| 96 | TComRdCost* m_pcRdCost; |
---|
| 97 | TEncEntropy* m_pcEntropyCoder; |
---|
[1029] | 98 | |
---|
[313] | 99 | // ME parameters |
---|
| 100 | Int m_iSearchRange; |
---|
| 101 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
[1406] | 102 | MESearchMethod m_motionEstimationSearchMethod; |
---|
[1029] | 103 | Int m_aaiAdaptSR[MAX_NUM_REF_LIST_ADAPT_SR][MAX_IDX_ADAPT_SR]; |
---|
| 104 | TComMv m_acMvPredictors[NUM_MV_PREDICTORS]; // Left, Above, AboveRight. enum MVP_DIR first NUM_MV_PREDICTORS entries are suitable for accessing. |
---|
| 105 | |
---|
[313] | 106 | // RD computation |
---|
| 107 | TEncSbac*** m_pppcRDSbacCoder; |
---|
| 108 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
| 109 | DistParam m_cDistParam; |
---|
[1029] | 110 | |
---|
[313] | 111 | // Misc. |
---|
| 112 | Pel* m_pTempPel; |
---|
[1029] | 113 | |
---|
[313] | 114 | // AMVP cost computation |
---|
| 115 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
| 116 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
[494] | 117 | |
---|
[1029] | 118 | TComMv m_integerMv2Nx2N[NUM_REF_PIC_LIST_01][MAX_NUM_REF]; |
---|
| 119 | |
---|
[1372] | 120 | Bool m_isInitialized; |
---|
| 121 | |
---|
[1406] | 122 | #if SVC_EXTENSION && N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
[494] | 123 | Bool m_disableILP; |
---|
| 124 | #endif |
---|
| 125 | |
---|
[313] | 126 | public: |
---|
| 127 | TEncSearch(); |
---|
| 128 | virtual ~TEncSearch(); |
---|
[1029] | 129 | |
---|
[1406] | 130 | Void init(TEncCfg* pcEncCfg, |
---|
| 131 | TComTrQuant* pcTrQuant, |
---|
| 132 | Int iSearchRange, |
---|
| 133 | Int bipredSearchRange, |
---|
| 134 | MESearchMethod motionEstimationSearchMethod, |
---|
| 135 | const UInt maxCUWidth, |
---|
| 136 | const UInt maxCUHeight, |
---|
| 137 | const UInt maxTotalCUDepth, |
---|
| 138 | TEncEntropy* pcEntropyCoder, |
---|
| 139 | TComRdCost* pcRdCost, |
---|
| 140 | TEncSbac*** pppcRDSbacCoder, |
---|
| 141 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
[1029] | 142 | |
---|
[1372] | 143 | Void destroy(); |
---|
| 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 | { |
---|
[1403] | 155 | const Pel* piRefY; |
---|
[1029] | 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 |
---|
[1403] | 166 | __inline Void xTZSearchHelp ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
| 167 | __inline Void xTZ2PointSearch ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB ); |
---|
| 168 | __inline Void xTZ8PointSquareSearch ( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
[1407] | 169 | __inline Void xTZ8PointDiamondSearch( const TComPattern* const pcPatternKey, IntTZSearchStruct& rcStruct, const TComMv* const pcMvSrchRngLT, const TComMv* const pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist, const Bool bCheckCornersAtDist1 ); |
---|
[313] | 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 | |
---|
[1442] | 294 | SChar xCalcCrossComponentPredictionAlpha ( TComTU &rTu, |
---|
[1029] | 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 uiPartAddr, |
---|
| 341 | TComYuv* pcOrgYuv, |
---|
| 342 | TComYuv* pcTemplateCand, |
---|
| 343 | TComMv cMvCand, |
---|
| 344 | Int iMVPIdx, |
---|
| 345 | Int iMVPNum, |
---|
| 346 | RefPicList eRefPicList, |
---|
| 347 | Int iRefIdx, |
---|
| 348 | Int iSizeX, |
---|
| 349 | Int iSizeY |
---|
| 350 | ); |
---|
[1029] | 351 | |
---|
| 352 | |
---|
[313] | 353 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 354 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 355 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
[1029] | 356 | |
---|
| 357 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 358 | TComYuv* pcYuvOrg, |
---|
| 359 | Int iPartIdx, |
---|
| 360 | UInt& uiInterDir, |
---|
| 361 | TComMvField* pacMvField, |
---|
| 362 | UInt& uiMergeIndex, |
---|
| 363 | Distortion& ruiCost, |
---|
| 364 | TComMvField* cMvFieldNeighbours, |
---|
| 365 | UChar* uhInterDirNeighbours, |
---|
| 366 | Int& numValidMergeCand |
---|
[313] | 367 | ); |
---|
| 368 | |
---|
| 369 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
| 370 | UInt puIdx, |
---|
[1029] | 371 | TComMvField* mvFieldNeighbours, |
---|
| 372 | UChar* interDirNeighbours, |
---|
[313] | 373 | Int numValidMergeCand ); |
---|
| 374 | |
---|
[1029] | 375 | |
---|
[313] | 376 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 377 | // motion estimation |
---|
| 378 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 379 | |
---|
| 380 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 381 | TComYuv* pcYuvOrg, |
---|
| 382 | Int iPartIdx, |
---|
| 383 | RefPicList eRefPicList, |
---|
| 384 | TComMv* pcMvPred, |
---|
| 385 | Int iRefIdxPred, |
---|
| 386 | TComMv& rcMv, |
---|
| 387 | UInt& ruiBits, |
---|
| 388 | Distortion& ruiCost, |
---|
| 389 | Bool bBi = false ); |
---|
| 390 | |
---|
[1403] | 391 | Void xTZSearch ( const TComDataCU* const pcCU, |
---|
| 392 | const TComPattern* const pcPatternKey, |
---|
| 393 | const Pel* const piRefY, |
---|
| 394 | const Int iRefStride, |
---|
| 395 | const TComMv* const pcMvSrchRngLT, |
---|
| 396 | const TComMv* const pcMvSrchRngRB, |
---|
| 397 | TComMv& rcMv, |
---|
| 398 | Distortion& ruiSAD, |
---|
[1407] | 399 | const TComMv* const pIntegerMv2Nx2NPred, |
---|
| 400 | const Bool bExtendedSettings |
---|
[1029] | 401 | ); |
---|
| 402 | |
---|
[1403] | 403 | Void xTZSearchSelective ( const TComDataCU* const pcCU, |
---|
| 404 | const TComPattern* const pcPatternKey, |
---|
| 405 | const Pel* const piRefY, |
---|
| 406 | const Int iRefStride, |
---|
| 407 | const TComMv* const pcMvSrchRngLT, |
---|
| 408 | const TComMv* const pcMvSrchRngRB, |
---|
| 409 | TComMv& rcMv, |
---|
| 410 | Distortion& ruiSAD, |
---|
| 411 | const TComMv* const pIntegerMv2Nx2NPred |
---|
[1029] | 412 | ); |
---|
| 413 | |
---|
[1403] | 414 | Void xSetSearchRange ( const TComDataCU* const pcCU, |
---|
| 415 | const TComMv& cMvPred, |
---|
| 416 | const Int iSrchRng, |
---|
[1029] | 417 | TComMv& rcMvSrchRngLT, |
---|
| 418 | TComMv& rcMvSrchRngRB ); |
---|
| 419 | |
---|
[1403] | 420 | Void xPatternSearchFast ( const TComDataCU* const pcCU, |
---|
| 421 | const TComPattern* const pcPatternKey, |
---|
| 422 | const Pel* const piRefY, |
---|
| 423 | const Int iRefStride, |
---|
| 424 | const TComMv* const pcMvSrchRngLT, |
---|
| 425 | const TComMv* const pcMvSrchRngRB, |
---|
| 426 | TComMv& rcMv, |
---|
| 427 | Distortion& ruiSAD, |
---|
| 428 | const TComMv* const pIntegerMv2Nx2NPred |
---|
[1029] | 429 | ); |
---|
| 430 | |
---|
[1403] | 431 | Void xPatternSearch ( const TComPattern* const pcPatternKey, |
---|
| 432 | const Pel* piRefY, |
---|
| 433 | const Int iRefStride, |
---|
| 434 | const TComMv* const pcMvSrchRngLT, |
---|
| 435 | const TComMv* const pcMvSrchRngRB, |
---|
[1029] | 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, |
---|
[1307] | 447 | Distortion& ruiCost |
---|
[313] | 448 | ); |
---|
[1029] | 449 | |
---|
[1307] | 450 | Void xExtDIFUpSamplingH( TComPattern* pcPattern ); |
---|
| 451 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef ); |
---|
[1029] | 452 | |
---|
[313] | 453 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 454 | // T & Q & Q-1 & T-1 |
---|
| 455 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 456 | |
---|
| 457 | |
---|
[1249] | 458 | Void xEncodeInterResidualQT( const ComponentID compID, TComTU &rTu ); |
---|
| 459 | Void xEstimateInterResidualQT( TComYuv* pcResi, Double &rdCost, UInt &ruiBits, Distortion &ruiDist, Distortion *puiZeroDist, TComTU &rTu DEBUG_STRING_FN_DECLARE(sDebug) ); |
---|
| 460 | Void xSetInterResidualQTData( TComYuv* pcResi, Bool bSpatial, TComTU &rTu ); |
---|
[1029] | 461 | |
---|
[1307] | 462 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPartOffset, UInt uiDepth, const ChannelType compID ); |
---|
[313] | 463 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
[1029] | 464 | |
---|
[313] | 465 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 466 | // compute symbol bits |
---|
| 467 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 468 | |
---|
| 469 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 470 | UInt& ruiBits); |
---|
| 471 | |
---|
[313] | 472 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
[1029] | 473 | inline Void setDistParamComp( ComponentID compIdx ) { m_cDistParam.compIdx = compIdx; } |
---|
[595] | 474 | |
---|
[1029] | 475 | #if SVC_EXTENSION && REF_IDX_ME_ZEROMV |
---|
| 476 | Void xPatternSearchFracDIFMv0 ( TComPattern* pcPatternKey, |
---|
[595] | 477 | Pel* piRefY, |
---|
| 478 | Int iRefStride, |
---|
| 479 | TComMv* pcMvInt, |
---|
| 480 | TComMv& rcMvHalf, |
---|
| 481 | TComMv& rcMvQter, |
---|
[1487] | 482 | #if SCALABLE_REXT |
---|
| 483 | Distortion& ruiCost ); |
---|
| 484 | #else |
---|
[1029] | 485 | UInt& ruiCost ); |
---|
[1487] | 486 | #endif |
---|
[595] | 487 | #endif //SVC_EXTENSION |
---|
| 488 | |
---|
[313] | 489 | };// END CLASS DEFINITION TEncSearch |
---|
| 490 | |
---|
| 491 | //! \} |
---|
| 492 | |
---|
| 493 | #endif // __TENCSEARCH__ |
---|