[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 ); |
---|
[983] | 189 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 190 | Void estIntraPredSingleDepth ( TComDataCU* pcCU, |
---|
| 191 | TComYuv* pcOrgYuv, |
---|
| 192 | TComYuv* pcPredYuv, |
---|
| 193 | TComYuv* pcResiYuv, |
---|
| 194 | TComYuv* pcRecoYuv, |
---|
| 195 | UInt& ruiDistC, |
---|
| 196 | Bool bLumaOnly ); |
---|
| 197 | #endif |
---|
[2] | 198 | |
---|
| 199 | /// encoder estimation - inter prediction (non-skip) |
---|
| 200 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 201 | TComYuv* pcOrgYuv, |
---|
| 202 | TComYuv*& rpcPredYuv, |
---|
| 203 | TComYuv*& rpcResiYuv, |
---|
| 204 | TComYuv*& rpcRecoYuv, |
---|
[655] | 205 | #if H_3D_FAST_TEXTURE_ENCODING |
---|
[608] | 206 | Bool bFMD, |
---|
| 207 | #endif |
---|
[56] | 208 | Bool bUseRes = false |
---|
| 209 | #if AMP_MRG |
---|
| 210 | ,Bool bUseMRG = false |
---|
| 211 | #endif |
---|
| 212 | ); |
---|
[2] | 213 | |
---|
| 214 | /// encode residual and compute rd-cost for inter mode |
---|
| 215 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 216 | TComYuv* pcYuvOrg, |
---|
| 217 | TComYuv* pcYuvPred, |
---|
| 218 | TComYuv*& rpcYuvResi, |
---|
| 219 | TComYuv*& rpcYuvResiBest, |
---|
| 220 | TComYuv*& rpcYuvRec, |
---|
| 221 | Bool bSkipRes ); |
---|
[655] | 222 | #if H_3D_INTER_SDC |
---|
[608] | 223 | Void encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, |
---|
| 224 | TComYuv* pcOrg, |
---|
| 225 | TComYuv* pcPred, |
---|
| 226 | TComYuv* pcResi, |
---|
| 227 | TComYuv* pcRec, |
---|
[833] | 228 | Int uiOffset, |
---|
[608] | 229 | const UInt uiDepth ); |
---|
[56] | 230 | #endif |
---|
[2] | 231 | /// set ME search range |
---|
| 232 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
| 233 | |
---|
[56] | 234 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
| 235 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
[2] | 236 | protected: |
---|
| 237 | |
---|
| 238 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 239 | // Intra search |
---|
| 240 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 241 | |
---|
| 242 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 243 | UInt uiTrDepth, |
---|
| 244 | UInt uiAbsPartIdx, |
---|
| 245 | Bool bLuma, |
---|
| 246 | Bool bChroma ); |
---|
[608] | 247 | |
---|
[2] | 248 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 249 | UInt uiTrDepth, |
---|
| 250 | UInt uiAbsPartIdx, |
---|
| 251 | TextType eTextType, |
---|
| 252 | Bool bRealCoeff ); |
---|
| 253 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 254 | UInt uiTrDepth, |
---|
| 255 | UInt uiAbsPartIdx, |
---|
| 256 | Bool bLuma, |
---|
| 257 | Bool bChroma ); |
---|
| 258 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 259 | UInt uiTrDepth, |
---|
| 260 | UInt uiAbsPartIdx, |
---|
| 261 | Bool bLuma, |
---|
| 262 | Bool bChroma, |
---|
[56] | 263 | Bool bRealCoeff ); |
---|
[608] | 264 | UInt xGetIntraBitsQTChroma ( TComDataCU* pcCU, |
---|
| 265 | UInt uiTrDepth, |
---|
| 266 | UInt uiAbsPartIdx, |
---|
| 267 | UInt uiChromaId, |
---|
| 268 | Bool bRealCoeff ); |
---|
[2] | 269 | |
---|
| 270 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 271 | UInt uiTrDepth, |
---|
| 272 | UInt uiAbsPartIdx, |
---|
| 273 | TComYuv* pcOrgYuv, |
---|
| 274 | TComYuv* pcPredYuv, |
---|
| 275 | TComYuv* pcResiYuv, |
---|
[608] | 276 | #if H_3D_VSO |
---|
| 277 | Dist& ruiDist, |
---|
| 278 | #else |
---|
| 279 | UInt& ruiDist, |
---|
[100] | 280 | #endif |
---|
[608] | 281 | Int default0Save1Load2 = 0 |
---|
| 282 | #if H_3D_DIM_ENC |
---|
| 283 | , Bool zeroResi = false |
---|
| 284 | #endif |
---|
| 285 | ); |
---|
[2] | 286 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 287 | UInt uiTrDepth, |
---|
| 288 | UInt uiAbsPartIdx, |
---|
| 289 | TComYuv* pcOrgYuv, |
---|
| 290 | TComYuv* pcPredYuv, |
---|
| 291 | TComYuv* pcResiYuv, |
---|
[608] | 292 | UInt& ruiDist, |
---|
| 293 | UInt uiChromaId, |
---|
| 294 | Int default0Save1Load2 = 0 ); |
---|
| 295 | |
---|
[2] | 296 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 297 | UInt uiTrDepth, |
---|
| 298 | UInt uiAbsPartIdx, |
---|
| 299 | Bool bLumaOnly, |
---|
| 300 | TComYuv* pcOrgYuv, |
---|
| 301 | TComYuv* pcPredYuv, |
---|
| 302 | TComYuv* pcResiYuv, |
---|
[608] | 303 | #if H_3D_VSO |
---|
[2] | 304 | Dist& ruiDistY, |
---|
[608] | 305 | #else |
---|
| 306 | UInt& ruiDistY, |
---|
| 307 | #endif |
---|
| 308 | UInt& ruiDistC, |
---|
[2] | 309 | #if HHI_RQT_INTRA_SPEEDUP |
---|
[608] | 310 | Bool bCheckFirst, |
---|
[2] | 311 | #endif |
---|
[608] | 312 | Double& dRDCost |
---|
| 313 | #if H_3D_DIM_ENC |
---|
| 314 | , Bool zeroResi = false |
---|
[100] | 315 | #endif |
---|
[608] | 316 | ); |
---|
[2] | 317 | |
---|
| 318 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 319 | UInt uiTrDepth, |
---|
| 320 | UInt uiAbsPartIdx, |
---|
| 321 | Bool bLumaOnly, |
---|
| 322 | TComYuv* pcRecoYuv ); |
---|
| 323 | |
---|
| 324 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 325 | UInt uiTrDepth, |
---|
| 326 | UInt uiAbsPartIdx, |
---|
| 327 | TComYuv* pcOrgYuv, |
---|
| 328 | TComYuv* pcPredYuv, |
---|
| 329 | TComYuv* pcResiYuv, |
---|
[608] | 330 | UInt& ruiDist ); |
---|
[2] | 331 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 332 | UInt uiTrDepth, |
---|
| 333 | UInt uiAbsPartIdx, |
---|
| 334 | TComYuv* pcRecoYuv ); |
---|
| 335 | |
---|
[608] | 336 | Void xStoreIntraResultQT ( TComDataCU* pcCU, |
---|
| 337 | UInt uiTrDepth, |
---|
| 338 | UInt uiAbsPartIdx, |
---|
| 339 | Bool bLumaOnly ); |
---|
| 340 | Void xLoadIntraResultQT ( TComDataCU* pcCU, |
---|
| 341 | UInt uiTrDepth, |
---|
| 342 | UInt uiAbsPartIdx, |
---|
| 343 | Bool bLumaOnly ); |
---|
| 344 | Void xStoreIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 345 | UInt uiTrDepth, |
---|
| 346 | UInt uiAbsPartIdx, |
---|
| 347 | UInt stateU0V1Both2 ); |
---|
| 348 | Void xLoadIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 349 | UInt uiTrDepth, |
---|
| 350 | UInt uiAbsPartIdx, |
---|
| 351 | UInt stateU0V1Both2 ); |
---|
[983] | 352 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 353 | Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor ); |
---|
| 354 | #endif |
---|
[655] | 355 | #if H_3D_DIM |
---|
[2] | 356 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 357 | // Depth intra search |
---|
[56] | 358 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 359 | Void xCalcBiSegDCs ( Pel* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& valDC1, Pel& valDC2 ); |
---|
| 360 | #if H_3D_DIM_DMM |
---|
| 361 | Void xSearchDmmDeltaDCs ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piOrig, Pel* piPredic, UInt uiStride, Bool* biSegPattern, Int patternStride, UInt uiWidth, UInt uiHeight, Pel& rDeltaDC1, Pel& rDeltaDC2 ); |
---|
| 362 | Void xSearchDmm1Wedge ( TComDataCU* pcCU, UInt uiAbsPtIdx, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); |
---|
[56] | 363 | #endif |
---|
[608] | 364 | #if H_3D_DIM_SDC |
---|
[884] | 365 | Void xIntraCodingSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ); |
---|
[100] | 366 | #endif |
---|
[296] | 367 | #endif |
---|
[56] | 368 | |
---|
| 369 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 370 | // Inter search (AMP) |
---|
| 371 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 372 | |
---|
| 373 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 374 | TComYuv* pcOrgYuv, |
---|
| 375 | UInt uiPartIdx, |
---|
| 376 | RefPicList eRefPicList, |
---|
| 377 | Int iRefIdx, |
---|
| 378 | TComMv& rcMvPred, |
---|
| 379 | Bool bFilled = false |
---|
[56] | 380 | , UInt* puiDistBiP = NULL |
---|
[2] | 381 | #if ZERO_MVD_EST |
---|
| 382 | , UInt* puiDist = NULL |
---|
| 383 | #endif |
---|
| 384 | ); |
---|
| 385 | |
---|
| 386 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 387 | RefPicList eRefPicList, |
---|
| 388 | TComMv cMv, |
---|
| 389 | TComMv& rcMvPred, |
---|
| 390 | Int& riMVPIdx, |
---|
| 391 | UInt& ruiBits, |
---|
| 392 | UInt& ruiCost ); |
---|
| 393 | |
---|
| 394 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 395 | UInt uiPartIdx, |
---|
| 396 | UInt uiPartAddr, |
---|
| 397 | TComYuv* pcOrgYuv, |
---|
| 398 | TComYuv* pcTemplateCand, |
---|
| 399 | TComMv cMvCand, |
---|
| 400 | Int iMVPIdx, |
---|
| 401 | Int iMVPNum, |
---|
| 402 | RefPicList eRefPicList, |
---|
| 403 | Int iRefIdx, |
---|
| 404 | Int iSizeX, |
---|
| 405 | Int iSizeY |
---|
| 406 | #if ZERO_MVD_EST |
---|
| 407 | , UInt& ruiDist |
---|
| 408 | #endif |
---|
| 409 | ); |
---|
| 410 | |
---|
| 411 | |
---|
| 412 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 413 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 414 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 415 | |
---|
| 416 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 417 | TComYuv* pcYuvOrg, |
---|
| 418 | Int iPartIdx, |
---|
| 419 | UInt& uiInterDir, |
---|
| 420 | TComMvField* pacMvField, |
---|
| 421 | UInt& uiMergeIndex, |
---|
[56] | 422 | UInt& ruiCost |
---|
| 423 | , TComMvField* cMvFieldNeighbours, |
---|
[608] | 424 | UChar* uhInterDirNeighbours |
---|
| 425 | #if H_3D_VSP |
---|
| 426 | , Int* vspFlag |
---|
| 427 | , InheritedVSPDisInfo* inheritedVSPDisInfo |
---|
[56] | 428 | #endif |
---|
[773] | 429 | #if H_3D_SPIVMP |
---|
[724] | 430 | , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP |
---|
| 431 | #endif |
---|
[608] | 432 | , Int& numValidMergeCand |
---|
[56] | 433 | ); |
---|
[608] | 434 | |
---|
| 435 | Void xRestrictBipredMergeCand ( TComDataCU* pcCU, |
---|
| 436 | UInt puIdx, |
---|
| 437 | TComMvField* mvFieldNeighbours, |
---|
| 438 | UChar* interDirNeighbours, |
---|
[622] | 439 | #if H_3D_VSP |
---|
[608] | 440 | Int* vspFlag, |
---|
| 441 | #endif |
---|
| 442 | Int numValidMergeCand ); |
---|
| 443 | |
---|
[2] | 444 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 445 | // motion estimation |
---|
| 446 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 447 | |
---|
| 448 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 449 | TComYuv* pcYuvOrg, |
---|
| 450 | Int iPartIdx, |
---|
| 451 | RefPicList eRefPicList, |
---|
| 452 | TComMv* pcMvPred, |
---|
| 453 | Int iRefIdxPred, |
---|
| 454 | TComMv& rcMv, |
---|
| 455 | UInt& ruiBits, |
---|
| 456 | UInt& ruiCost, |
---|
| 457 | Bool bBi = false ); |
---|
| 458 | |
---|
| 459 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 460 | TComPattern* pcPatternKey, |
---|
| 461 | Pel* piRefY, |
---|
| 462 | Int iRefStride, |
---|
| 463 | TComMv* pcMvSrchRngLT, |
---|
| 464 | TComMv* pcMvSrchRngRB, |
---|
| 465 | TComMv& rcMv, |
---|
| 466 | UInt& ruiSAD ); |
---|
| 467 | |
---|
| 468 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 469 | TComMv& cMvPred, |
---|
| 470 | Int iSrchRng, |
---|
| 471 | TComMv& rcMvSrchRngLT, |
---|
| 472 | TComMv& rcMvSrchRngRB ); |
---|
| 473 | |
---|
| 474 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 475 | TComPattern* pcPatternKey, |
---|
| 476 | Pel* piRefY, |
---|
| 477 | Int iRefStride, |
---|
| 478 | TComMv* pcMvSrchRngLT, |
---|
| 479 | TComMv* pcMvSrchRngRB, |
---|
| 480 | TComMv& rcMv, |
---|
| 481 | UInt& ruiSAD ); |
---|
| 482 | |
---|
| 483 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 484 | Pel* piRefY, |
---|
| 485 | Int iRefStride, |
---|
| 486 | TComMv* pcMvSrchRngLT, |
---|
| 487 | TComMv* pcMvSrchRngRB, |
---|
| 488 | TComMv& rcMv, |
---|
| 489 | UInt& ruiSAD ); |
---|
| 490 | |
---|
| 491 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 492 | TComPattern* pcPatternKey, |
---|
| 493 | Pel* piRefY, |
---|
| 494 | Int iRefStride, |
---|
| 495 | TComMv* pcMvInt, |
---|
| 496 | TComMv& rcMvHalf, |
---|
| 497 | TComMv& rcMvQter, |
---|
| 498 | UInt& ruiCost |
---|
[608] | 499 | ,Bool biPred |
---|
| 500 | ); |
---|
[2] | 501 | |
---|
[56] | 502 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
| 503 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
[2] | 504 | |
---|
| 505 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 506 | // T & Q & Q-1 & T-1 |
---|
| 507 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 508 | |
---|
| 509 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
[608] | 510 | #if H_3D_VSO // M26 |
---|
[56] | 511 | 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 ); |
---|
| 512 | #else |
---|
[608] | 513 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx,TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, UInt &ruiDist, UInt *puiZeroDist ); |
---|
[56] | 514 | #endif |
---|
| 515 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
[2] | 516 | |
---|
| 517 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 518 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 519 | |
---|
| 520 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 521 | // compute symbol bits |
---|
| 522 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 523 | |
---|
| 524 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 525 | UInt uiQp, |
---|
| 526 | UInt uiTrMode, |
---|
| 527 | UInt& ruiBits, |
---|
| 528 | TComYuv*& rpcYuvRec, |
---|
| 529 | TComYuv* pcYuvPred, |
---|
| 530 | TComYuv*& rpcYuvResi ); |
---|
| 531 | |
---|
[56] | 532 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
[2] | 533 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
[56] | 534 | |
---|
[2] | 535 | };// END CLASS DEFINITION TEncSearch |
---|
| 536 | |
---|
[56] | 537 | //! \} |
---|
[2] | 538 | |
---|
| 539 | #endif // __TENCSEARCH__ |
---|