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