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