[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 |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[872] | 6 | * Copyright (c) 2010-2014, 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 | |
---|
| 38 | #ifndef __TENCSEARCH__ |
---|
| 39 | #define __TENCSEARCH__ |
---|
| 40 | |
---|
| 41 | // Include files |
---|
[56] | 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" |
---|
[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 | |
---|
| 61 | /// encoder search class |
---|
| 62 | class TEncSearch : public TComPrediction |
---|
| 63 | { |
---|
| 64 | private: |
---|
| 65 | TCoeff** m_ppcQTTempCoeffY; |
---|
| 66 | TCoeff** m_ppcQTTempCoeffCb; |
---|
| 67 | TCoeff** m_ppcQTTempCoeffCr; |
---|
| 68 | TCoeff* m_pcQTTempCoeffY; |
---|
| 69 | TCoeff* m_pcQTTempCoeffCb; |
---|
| 70 | TCoeff* m_pcQTTempCoeffCr; |
---|
[56] | 71 | #if ADAPTIVE_QP_SELECTION |
---|
| 72 | Int** m_ppcQTTempArlCoeffY; |
---|
| 73 | Int** m_ppcQTTempArlCoeffCb; |
---|
| 74 | Int** m_ppcQTTempArlCoeffCr; |
---|
| 75 | Int* m_pcQTTempArlCoeffY; |
---|
| 76 | Int* m_pcQTTempArlCoeffCb; |
---|
| 77 | Int* m_pcQTTempArlCoeffCr; |
---|
| 78 | #endif |
---|
[2] | 79 | UChar* m_puhQTTempTrIdx; |
---|
| 80 | UChar* m_puhQTTempCbf[3]; |
---|
| 81 | |
---|
| 82 | TComYuv* m_pcQTTempTComYuv; |
---|
[56] | 83 | TComYuv m_tmpYuvPred; // To be used in xGetInterPredictionError() to avoid constant memory allocation/deallocation |
---|
[608] | 84 | Pel* m_pSharedPredTransformSkip[3]; |
---|
| 85 | TCoeff* m_pcQTTempTUCoeffY; |
---|
| 86 | TCoeff* m_pcQTTempTUCoeffCb; |
---|
| 87 | TCoeff* m_pcQTTempTUCoeffCr; |
---|
| 88 | UChar* m_puhQTTempTransformSkipFlag[3]; |
---|
| 89 | TComYuv m_pcQTTempTransformSkipTComYuv; |
---|
| 90 | #if ADAPTIVE_QP_SELECTION |
---|
| 91 | Int* m_ppcQTTempTUArlCoeffY; |
---|
| 92 | Int* m_ppcQTTempTUArlCoeffCb; |
---|
| 93 | Int* m_ppcQTTempTUArlCoeffCr; |
---|
| 94 | #endif |
---|
[2] | 95 | protected: |
---|
| 96 | // interface to option |
---|
| 97 | TEncCfg* m_pcEncCfg; |
---|
| 98 | |
---|
| 99 | // interface to classes |
---|
| 100 | TComTrQuant* m_pcTrQuant; |
---|
| 101 | TComRdCost* m_pcRdCost; |
---|
| 102 | TEncEntropy* m_pcEntropyCoder; |
---|
| 103 | |
---|
| 104 | // ME parameters |
---|
| 105 | Int m_iSearchRange; |
---|
| 106 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
| 107 | Int m_iFastSearch; |
---|
| 108 | Int m_aaiAdaptSR[2][33]; |
---|
| 109 | TComMv m_cSrchRngLT; |
---|
| 110 | TComMv m_cSrchRngRB; |
---|
| 111 | TComMv m_acMvPredictors[3]; |
---|
| 112 | |
---|
| 113 | // RD computation |
---|
| 114 | TEncSbac*** m_pppcRDSbacCoder; |
---|
| 115 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
| 116 | DistParam m_cDistParam; |
---|
| 117 | |
---|
| 118 | // Misc. |
---|
| 119 | Pel* m_pTempPel; |
---|
[608] | 120 | const UInt* m_puiDFilter; |
---|
[2] | 121 | Int m_iMaxDeltaQP; |
---|
| 122 | |
---|
[608] | 123 | #if H_3D_VSO // M17 |
---|
[2] | 124 | TComYuv m_cYuvRecTemp; |
---|
[5] | 125 | #endif |
---|
[2] | 126 | // AMVP cost computation |
---|
| 127 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
| 128 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
| 129 | |
---|
| 130 | public: |
---|
| 131 | TEncSearch(); |
---|
| 132 | virtual ~TEncSearch(); |
---|
| 133 | |
---|
| 134 | Void init( TEncCfg* pcEncCfg, |
---|
| 135 | TComTrQuant* pcTrQuant, |
---|
| 136 | Int iSearchRange, |
---|
| 137 | Int bipredSearchRange, |
---|
| 138 | Int iFastSearch, |
---|
| 139 | Int iMaxDeltaQP, |
---|
| 140 | TEncEntropy* pcEntropyCoder, |
---|
| 141 | TComRdCost* pcRdCost, |
---|
| 142 | TEncSbac*** pppcRDSbacCoder, |
---|
| 143 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
| 144 | |
---|
| 145 | protected: |
---|
| 146 | |
---|
| 147 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
[56] | 148 | UInt xPatternRefinement( TComPattern* pcPatternKey, |
---|
| 149 | TComMv baseRefMv, |
---|
[608] | 150 | Int iFrac, TComMv& rcMvFrac ); |
---|
[2] | 151 | |
---|
| 152 | typedef struct |
---|
| 153 | { |
---|
| 154 | Pel* piRefY; |
---|
| 155 | Int iYStride; |
---|
| 156 | Int iBestX; |
---|
| 157 | Int iBestY; |
---|
| 158 | UInt uiBestRound; |
---|
| 159 | UInt uiBestDistance; |
---|
| 160 | UInt uiBestSad; |
---|
| 161 | UChar ucPointNr; |
---|
| 162 | } IntTZSearchStruct; |
---|
| 163 | |
---|
| 164 | // sub-functions for ME |
---|
| 165 | __inline Void xTZSearchHelp ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
| 166 | __inline Void xTZ2PointSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB ); |
---|
| 167 | __inline Void xTZ8PointSquareSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
| 168 | __inline Void xTZ8PointDiamondSearch( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
| 169 | |
---|
| 170 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard ); |
---|
| 171 | |
---|
| 172 | public: |
---|
| 173 | Void preestChromaPredMode ( TComDataCU* pcCU, |
---|
| 174 | TComYuv* pcOrgYuv, |
---|
| 175 | TComYuv* pcPredYuv ); |
---|
| 176 | Void estIntraPredQT ( TComDataCU* pcCU, |
---|
| 177 | TComYuv* pcOrgYuv, |
---|
| 178 | TComYuv* pcPredYuv, |
---|
| 179 | TComYuv* pcResiYuv, |
---|
| 180 | TComYuv* pcRecoYuv, |
---|
[608] | 181 | UInt& ruiDistC, |
---|
[2] | 182 | Bool bLumaOnly ); |
---|
| 183 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
| 184 | TComYuv* pcOrgYuv, |
---|
| 185 | TComYuv* pcPredYuv, |
---|
| 186 | TComYuv* pcResiYuv, |
---|
| 187 | TComYuv* pcRecoYuv, |
---|
[608] | 188 | UInt uiPreCalcDistC ); |
---|
[2] | 189 | |
---|
| 190 | |
---|
| 191 | /// encoder estimation - inter prediction (non-skip) |
---|
| 192 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 193 | TComYuv* pcOrgYuv, |
---|
| 194 | TComYuv*& rpcPredYuv, |
---|
| 195 | TComYuv*& rpcResiYuv, |
---|
| 196 | TComYuv*& rpcRecoYuv, |
---|
[655] | 197 | #if H_3D_FAST_TEXTURE_ENCODING |
---|
[608] | 198 | Bool bFMD, |
---|
| 199 | #endif |
---|
[56] | 200 | Bool bUseRes = false |
---|
| 201 | #if AMP_MRG |
---|
| 202 | ,Bool bUseMRG = false |
---|
| 203 | #endif |
---|
| 204 | ); |
---|
[2] | 205 | |
---|
| 206 | /// encode residual and compute rd-cost for inter mode |
---|
| 207 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 208 | TComYuv* pcYuvOrg, |
---|
| 209 | TComYuv* pcYuvPred, |
---|
| 210 | TComYuv*& rpcYuvResi, |
---|
| 211 | TComYuv*& rpcYuvResiBest, |
---|
| 212 | TComYuv*& rpcYuvRec, |
---|
| 213 | Bool bSkipRes ); |
---|
[655] | 214 | #if H_3D_INTER_SDC |
---|
[608] | 215 | Void encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, |
---|
| 216 | TComYuv* pcOrg, |
---|
| 217 | TComYuv* pcPred, |
---|
| 218 | TComYuv* pcResi, |
---|
| 219 | TComYuv* pcRec, |
---|
[833] | 220 | Int uiOffset, |
---|
[608] | 221 | const UInt uiDepth ); |
---|
[56] | 222 | #endif |
---|
[2] | 223 | /// set ME search range |
---|
| 224 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
| 225 | |
---|
[56] | 226 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
| 227 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
[2] | 228 | protected: |
---|
| 229 | |
---|
| 230 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 231 | // Intra search |
---|
| 232 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 233 | |
---|
| 234 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 235 | UInt uiTrDepth, |
---|
| 236 | UInt uiAbsPartIdx, |
---|
| 237 | Bool bLuma, |
---|
| 238 | Bool bChroma ); |
---|
[608] | 239 | |
---|
[2] | 240 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 241 | UInt uiTrDepth, |
---|
| 242 | UInt uiAbsPartIdx, |
---|
| 243 | TextType eTextType, |
---|
| 244 | Bool bRealCoeff ); |
---|
| 245 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 246 | UInt uiTrDepth, |
---|
| 247 | UInt uiAbsPartIdx, |
---|
| 248 | Bool bLuma, |
---|
| 249 | Bool bChroma ); |
---|
| 250 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 251 | UInt uiTrDepth, |
---|
| 252 | UInt uiAbsPartIdx, |
---|
| 253 | Bool bLuma, |
---|
| 254 | Bool bChroma, |
---|
[56] | 255 | Bool bRealCoeff ); |
---|
[608] | 256 | UInt xGetIntraBitsQTChroma ( TComDataCU* pcCU, |
---|
| 257 | UInt uiTrDepth, |
---|
| 258 | UInt uiAbsPartIdx, |
---|
| 259 | UInt uiChromaId, |
---|
| 260 | Bool bRealCoeff ); |
---|
[2] | 261 | |
---|
| 262 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 263 | UInt uiTrDepth, |
---|
| 264 | UInt uiAbsPartIdx, |
---|
| 265 | TComYuv* pcOrgYuv, |
---|
| 266 | TComYuv* pcPredYuv, |
---|
| 267 | TComYuv* pcResiYuv, |
---|
[608] | 268 | #if H_3D_VSO |
---|
| 269 | Dist& ruiDist, |
---|
| 270 | #else |
---|
| 271 | UInt& ruiDist, |
---|
[100] | 272 | #endif |
---|
[608] | 273 | Int default0Save1Load2 = 0 |
---|
| 274 | #if H_3D_DIM_ENC |
---|
| 275 | , Bool zeroResi = false |
---|
| 276 | #endif |
---|
| 277 | ); |
---|
[2] | 278 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 279 | UInt uiTrDepth, |
---|
| 280 | UInt uiAbsPartIdx, |
---|
| 281 | TComYuv* pcOrgYuv, |
---|
| 282 | TComYuv* pcPredYuv, |
---|
| 283 | TComYuv* pcResiYuv, |
---|
[608] | 284 | UInt& ruiDist, |
---|
| 285 | UInt uiChromaId, |
---|
| 286 | Int default0Save1Load2 = 0 ); |
---|
| 287 | |
---|
[2] | 288 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 289 | UInt uiTrDepth, |
---|
| 290 | UInt uiAbsPartIdx, |
---|
| 291 | Bool bLumaOnly, |
---|
| 292 | TComYuv* pcOrgYuv, |
---|
| 293 | TComYuv* pcPredYuv, |
---|
| 294 | TComYuv* pcResiYuv, |
---|
[608] | 295 | #if H_3D_VSO |
---|
[2] | 296 | Dist& ruiDistY, |
---|
[608] | 297 | #else |
---|
| 298 | UInt& ruiDistY, |
---|
| 299 | #endif |
---|
| 300 | UInt& ruiDistC, |
---|
[2] | 301 | #if HHI_RQT_INTRA_SPEEDUP |
---|
[608] | 302 | Bool bCheckFirst, |
---|
[2] | 303 | #endif |
---|
[608] | 304 | Double& dRDCost |
---|
| 305 | #if H_3D_DIM_ENC |
---|
| 306 | , Bool zeroResi = false |
---|
[100] | 307 | #endif |
---|
[608] | 308 | ); |
---|
[2] | 309 | |
---|
| 310 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 311 | UInt uiTrDepth, |
---|
| 312 | UInt uiAbsPartIdx, |
---|
| 313 | Bool bLumaOnly, |
---|
| 314 | TComYuv* pcRecoYuv ); |
---|
| 315 | |
---|
| 316 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 317 | UInt uiTrDepth, |
---|
| 318 | UInt uiAbsPartIdx, |
---|
| 319 | TComYuv* pcOrgYuv, |
---|
| 320 | TComYuv* pcPredYuv, |
---|
| 321 | TComYuv* pcResiYuv, |
---|
[608] | 322 | UInt& ruiDist ); |
---|
[2] | 323 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 324 | UInt uiTrDepth, |
---|
| 325 | UInt uiAbsPartIdx, |
---|
| 326 | TComYuv* pcRecoYuv ); |
---|
| 327 | |
---|
[608] | 328 | Void xStoreIntraResultQT ( TComDataCU* pcCU, |
---|
| 329 | UInt uiTrDepth, |
---|
| 330 | UInt uiAbsPartIdx, |
---|
| 331 | Bool bLumaOnly ); |
---|
| 332 | Void xLoadIntraResultQT ( TComDataCU* pcCU, |
---|
| 333 | UInt uiTrDepth, |
---|
| 334 | UInt uiAbsPartIdx, |
---|
| 335 | Bool bLumaOnly ); |
---|
| 336 | Void xStoreIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 337 | UInt uiTrDepth, |
---|
| 338 | UInt uiAbsPartIdx, |
---|
| 339 | UInt stateU0V1Both2 ); |
---|
| 340 | Void xLoadIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 341 | UInt uiTrDepth, |
---|
| 342 | UInt uiAbsPartIdx, |
---|
| 343 | UInt stateU0V1Both2 ); |
---|
| 344 | |
---|
[655] | 345 | #if H_3D_DIM |
---|
[2] | 346 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 347 | // Depth intra search |
---|
[56] | 348 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 349 | Void xCalcBiSegDCs ( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2 ); |
---|
| 350 | #if H_3D_DIM_DMM |
---|
| 351 | Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); |
---|
| 352 | Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); |
---|
[56] | 353 | #endif |
---|
[608] | 354 | #if H_3D_DIM_SDC |
---|
[884] | 355 | Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); |
---|
[100] | 356 | #endif |
---|
[296] | 357 | #endif |
---|
[56] | 358 | |
---|
| 359 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 360 | // Inter search (AMP) |
---|
| 361 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 362 | |
---|
| 363 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 364 | TComYuv* pcOrgYuv, |
---|
| 365 | UInt uiPartIdx, |
---|
| 366 | RefPicList eRefPicList, |
---|
| 367 | Int iRefIdx, |
---|
| 368 | TComMv& rcMvPred, |
---|
| 369 | Bool bFilled = false |
---|
[56] | 370 | , UInt* puiDistBiP = NULL |
---|
[2] | 371 | #if ZERO_MVD_EST |
---|
| 372 | , UInt* puiDist = NULL |
---|
| 373 | #endif |
---|
| 374 | ); |
---|
| 375 | |
---|
| 376 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 377 | RefPicList eRefPicList, |
---|
| 378 | TComMv cMv, |
---|
| 379 | TComMv& rcMvPred, |
---|
| 380 | Int& riMVPIdx, |
---|
| 381 | UInt& ruiBits, |
---|
| 382 | UInt& ruiCost ); |
---|
| 383 | |
---|
| 384 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 385 | UInt uiPartIdx, |
---|
| 386 | UInt uiPartAddr, |
---|
| 387 | TComYuv* pcOrgYuv, |
---|
| 388 | TComYuv* pcTemplateCand, |
---|
| 389 | TComMv cMvCand, |
---|
| 390 | Int iMVPIdx, |
---|
| 391 | Int iMVPNum, |
---|
| 392 | RefPicList eRefPicList, |
---|
| 393 | Int iRefIdx, |
---|
| 394 | Int iSizeX, |
---|
| 395 | Int iSizeY |
---|
| 396 | #if ZERO_MVD_EST |
---|
| 397 | , UInt& ruiDist |
---|
| 398 | #endif |
---|
| 399 | ); |
---|
| 400 | |
---|
| 401 | |
---|
| 402 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 403 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 404 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 405 | |
---|
| 406 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 407 | TComYuv* pcYuvOrg, |
---|
| 408 | Int iPartIdx, |
---|
| 409 | UInt& uiInterDir, |
---|
| 410 | TComMvField* pacMvField, |
---|
| 411 | UInt& uiMergeIndex, |
---|
[56] | 412 | UInt& ruiCost |
---|
| 413 | , TComMvField* cMvFieldNeighbours, |
---|
[608] | 414 | UChar* uhInterDirNeighbours |
---|
| 415 | #if H_3D_VSP |
---|
| 416 | , Int* vspFlag |
---|
| 417 | , InheritedVSPDisInfo* inheritedVSPDisInfo |
---|
[56] | 418 | #endif |
---|
[773] | 419 | #if H_3D_SPIVMP |
---|
[724] | 420 | , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP |
---|
| 421 | #endif |
---|
[608] | 422 | , Int& numValidMergeCand |
---|
[56] | 423 | ); |
---|
[608] | 424 | |
---|
| 425 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
| 426 | UInt puIdx, |
---|
| 427 | TComMvField* mvFieldNeighbours, |
---|
| 428 | UChar* interDirNeighbours, |
---|
[622] | 429 | #if H_3D_VSP |
---|
[608] | 430 | Int* vspFlag, |
---|
| 431 | #endif |
---|
| 432 | Int numValidMergeCand ); |
---|
| 433 | |
---|
[2] | 434 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 435 | // motion estimation |
---|
| 436 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 437 | |
---|
| 438 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 439 | TComYuv* pcYuvOrg, |
---|
| 440 | Int iPartIdx, |
---|
| 441 | RefPicList eRefPicList, |
---|
| 442 | TComMv* pcMvPred, |
---|
| 443 | Int iRefIdxPred, |
---|
| 444 | TComMv& rcMv, |
---|
| 445 | UInt& ruiBits, |
---|
| 446 | UInt& ruiCost, |
---|
| 447 | Bool bBi = false ); |
---|
| 448 | |
---|
| 449 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 450 | TComPattern* pcPatternKey, |
---|
| 451 | Pel* piRefY, |
---|
| 452 | Int iRefStride, |
---|
| 453 | TComMv* pcMvSrchRngLT, |
---|
| 454 | TComMv* pcMvSrchRngRB, |
---|
| 455 | TComMv& rcMv, |
---|
| 456 | UInt& ruiSAD ); |
---|
| 457 | |
---|
| 458 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 459 | TComMv& cMvPred, |
---|
| 460 | Int iSrchRng, |
---|
| 461 | TComMv& rcMvSrchRngLT, |
---|
| 462 | TComMv& rcMvSrchRngRB ); |
---|
| 463 | |
---|
| 464 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 465 | TComPattern* pcPatternKey, |
---|
| 466 | Pel* piRefY, |
---|
| 467 | Int iRefStride, |
---|
| 468 | TComMv* pcMvSrchRngLT, |
---|
| 469 | TComMv* pcMvSrchRngRB, |
---|
| 470 | TComMv& rcMv, |
---|
| 471 | UInt& ruiSAD ); |
---|
| 472 | |
---|
| 473 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 474 | Pel* piRefY, |
---|
| 475 | Int iRefStride, |
---|
| 476 | TComMv* pcMvSrchRngLT, |
---|
| 477 | TComMv* pcMvSrchRngRB, |
---|
| 478 | TComMv& rcMv, |
---|
| 479 | UInt& ruiSAD ); |
---|
| 480 | |
---|
| 481 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 482 | TComPattern* pcPatternKey, |
---|
| 483 | Pel* piRefY, |
---|
| 484 | Int iRefStride, |
---|
| 485 | TComMv* pcMvInt, |
---|
| 486 | TComMv& rcMvHalf, |
---|
| 487 | TComMv& rcMvQter, |
---|
| 488 | UInt& ruiCost |
---|
[608] | 489 | ,Bool biPred |
---|
| 490 | ); |
---|
[2] | 491 | |
---|
[56] | 492 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
| 493 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
[2] | 494 | |
---|
| 495 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 496 | // T & Q & Q-1 & T-1 |
---|
| 497 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 498 | |
---|
| 499 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
[608] | 500 | #if H_3D_VSO // M26 |
---|
[56] | 501 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
| 502 | #else |
---|
[608] | 503 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, UInt &ruiDist, UInt *puiZeroDist ); |
---|
[56] | 504 | #endif |
---|
| 505 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
[2] | 506 | |
---|
| 507 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 508 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 509 | |
---|
| 510 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 511 | // compute symbol bits |
---|
| 512 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 513 | |
---|
| 514 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 515 | UInt uiQp, |
---|
| 516 | UInt uiTrMode, |
---|
| 517 | UInt& ruiBits, |
---|
| 518 | TComYuv*& rpcYuvRec, |
---|
| 519 | TComYuv* pcYuvPred, |
---|
| 520 | TComYuv*& rpcYuvResi ); |
---|
| 521 | |
---|
[56] | 522 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
[2] | 523 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
[56] | 524 | |
---|
[2] | 525 | };// END CLASS DEFINITION TEncSearch |
---|
| 526 | |
---|
[56] | 527 | //! \} |
---|
[2] | 528 | |
---|
| 529 | #endif // __TENCSEARCH__ |
---|