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