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