[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 |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2011, ISO/IEC |
---|
| 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. |
---|
| 17 | * * Neither the name of the ISO/IEC nor the names of its contributors may |
---|
| 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 | |
---|
[5] | 35 | |
---|
[2] | 36 | /** \file TEncSearch.h |
---|
| 37 | \brief encoder search class (header) |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | #ifndef __TENCSEARCH__ |
---|
| 41 | #define __TENCSEARCH__ |
---|
| 42 | |
---|
| 43 | // Include files |
---|
| 44 | #include "../TLibCommon/TComYuv.h" |
---|
| 45 | #include "../TLibCommon/TComMotionInfo.h" |
---|
| 46 | #include "../TLibCommon/TComPattern.h" |
---|
| 47 | #include "../TLibCommon/TComPredFilter.h" |
---|
| 48 | #include "../TLibCommon/TComPrediction.h" |
---|
| 49 | #include "../TLibCommon/TComTrQuant.h" |
---|
| 50 | #include "../TLibCommon/TComPic.h" |
---|
| 51 | #include "../TLibCommon/TComWedgelet.h" |
---|
| 52 | #include "TEncEntropy.h" |
---|
| 53 | #include "TEncSbac.h" |
---|
| 54 | #include "TEncCfg.h" |
---|
| 55 | |
---|
| 56 | class TEncCu; |
---|
| 57 | |
---|
| 58 | // ==================================================================================================================== |
---|
| 59 | // Class definition |
---|
| 60 | // ==================================================================================================================== |
---|
| 61 | |
---|
| 62 | /// encoder search class |
---|
| 63 | class TEncSearch : public TComPrediction |
---|
| 64 | { |
---|
| 65 | private: |
---|
| 66 | TCoeff** m_ppcQTTempCoeffY; |
---|
| 67 | TCoeff** m_ppcQTTempCoeffCb; |
---|
| 68 | TCoeff** m_ppcQTTempCoeffCr; |
---|
| 69 | TCoeff* m_pcQTTempCoeffY; |
---|
| 70 | TCoeff* m_pcQTTempCoeffCb; |
---|
| 71 | TCoeff* m_pcQTTempCoeffCr; |
---|
| 72 | UChar* m_puhQTTempTrIdx; |
---|
| 73 | UChar* m_puhQTTempCbf[3]; |
---|
| 74 | |
---|
| 75 | TComYuv* m_pcQTTempTComYuv; |
---|
| 76 | protected: |
---|
| 77 | // interface to option |
---|
| 78 | TEncCfg* m_pcEncCfg; |
---|
| 79 | |
---|
| 80 | // interface to classes |
---|
| 81 | TComTrQuant* m_pcTrQuant; |
---|
| 82 | TComRdCost* m_pcRdCost; |
---|
| 83 | TEncEntropy* m_pcEntropyCoder; |
---|
| 84 | |
---|
| 85 | // ME parameters |
---|
| 86 | Int m_iSearchRange; |
---|
| 87 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
| 88 | Int m_iFastSearch; |
---|
| 89 | Int m_aaiAdaptSR[2][33]; |
---|
| 90 | TComMv m_cSrchRngLT; |
---|
| 91 | TComMv m_cSrchRngRB; |
---|
| 92 | TComMv m_acMvPredictors[3]; |
---|
| 93 | |
---|
| 94 | // RD computation |
---|
| 95 | TEncSbac*** m_pppcRDSbacCoder; |
---|
| 96 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
| 97 | Bool m_bUseSBACRD; |
---|
| 98 | DistParam m_cDistParam; |
---|
| 99 | |
---|
| 100 | // Misc. |
---|
| 101 | Pel* m_pTempPel; |
---|
| 102 | UInt* m_puiDFilter; |
---|
| 103 | Int m_iMaxDeltaQP; |
---|
| 104 | |
---|
| 105 | |
---|
[5] | 106 | #if HHI_VSO |
---|
[2] | 107 | TComYuv m_cYuvRecTemp; |
---|
[5] | 108 | #endif |
---|
[2] | 109 | |
---|
| 110 | // AMVP cost computation |
---|
| 111 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
| 112 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
| 113 | |
---|
| 114 | public: |
---|
| 115 | TEncSearch(); |
---|
| 116 | virtual ~TEncSearch(); |
---|
| 117 | |
---|
| 118 | Void init( TEncCfg* pcEncCfg, |
---|
| 119 | TComTrQuant* pcTrQuant, |
---|
| 120 | Int iSearchRange, |
---|
| 121 | Int bipredSearchRange, |
---|
| 122 | Int iFastSearch, |
---|
| 123 | Int iMaxDeltaQP, |
---|
| 124 | TEncEntropy* pcEntropyCoder, |
---|
| 125 | TComRdCost* pcRdCost, |
---|
| 126 | TEncSbac*** pppcRDSbacCoder, |
---|
| 127 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
| 128 | |
---|
| 129 | protected: |
---|
| 130 | |
---|
| 131 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
| 132 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
| 133 | UInt xPatternRefinement_Bi( TComPattern* pcPatternKey, Pel* piRef, Int iRefStride, Int iIntStep, Int iFrac, TComMv& rcMvFrac, Pel* pRefY2, Bool bRound ); |
---|
| 134 | #endif |
---|
| 135 | |
---|
| 136 | UInt xPatternRefinement( TComPattern* pcPatternKey, Pel* piRef, Int iRefStride, Int iIntStep, Int iFrac, TComMv& rcMvFrac ); |
---|
| 137 | |
---|
| 138 | #if (!REFERENCE_SAMPLE_PADDING) |
---|
[5] | 139 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[2] | 140 | Bool predIntraLumaDirAvailable( UInt uiMode, UInt uiWidthBit, Bool bAboveAvail, Bool bLeftAvail, UInt uiWidth, UInt uiHeight, TComDataCU* pcCU, UInt uiAbsPartIdx ); |
---|
| 141 | #else |
---|
| 142 | Bool predIntraLumaDirAvailable( UInt uiMode, UInt uiWidthBit, Bool bAboveAvail, Bool bLeftAvail); |
---|
| 143 | #endif |
---|
| 144 | #endif |
---|
| 145 | |
---|
[5] | 146 | #if HHI_DMM_WEDGE_INTRA |
---|
[2] | 147 | Void xSearchWedgeFullMinDist ( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx ); |
---|
| 148 | Void xSearchWedgePredDirMinDist( TComDataCU* pcCU, UInt uiAbsPtIdx, WedgeList* pacWedgeList, Pel* piRef, UInt uiRefStride, UInt uiWidth, UInt uiHeight, UInt& ruiTabIdx, Int& riWedgeDeltaEnd ); |
---|
[5] | 149 | #endif |
---|
| 150 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[2] | 151 | Void xGetWedgeDeltaDCsMinDist ( TComWedgelet* pcWedgelet, |
---|
| 152 | TComDataCU* pcCU, |
---|
| 153 | UInt uiAbsPtIdx, |
---|
| 154 | Pel* piOrig, |
---|
| 155 | Pel* piPredic, |
---|
| 156 | UInt uiStride, |
---|
| 157 | UInt uiWidth, |
---|
| 158 | UInt uiHeight, |
---|
| 159 | Int& riDeltaDC1, |
---|
| 160 | Int& riDeltaDC2, |
---|
| 161 | Bool bAbove, |
---|
| 162 | Bool bLeft ); |
---|
| 163 | |
---|
| 164 | Void xDeltaDCQuantScaleDown( TComDataCU* pcCU, Int& riDeltaDC ); |
---|
| 165 | #endif |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | typedef struct |
---|
| 169 | { |
---|
| 170 | Pel* piRefY; |
---|
| 171 | Int iYStride; |
---|
| 172 | Int iBestX; |
---|
| 173 | Int iBestY; |
---|
| 174 | UInt uiBestRound; |
---|
| 175 | UInt uiBestDistance; |
---|
| 176 | UInt uiBestSad; |
---|
| 177 | UChar ucPointNr; |
---|
| 178 | } IntTZSearchStruct; |
---|
| 179 | |
---|
| 180 | // sub-functions for ME |
---|
| 181 | __inline Void xTZSearchHelp ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStruct, const Int iSearchX, const Int iSearchY, const UChar ucPointNr, const UInt uiDistance ); |
---|
| 182 | __inline Void xTZ2PointSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB ); |
---|
| 183 | __inline Void xTZ8PointSquareSearch ( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
| 184 | __inline Void xTZ8PointDiamondSearch( TComPattern* pcPatternKey, IntTZSearchStruct& rcStrukt, TComMv* pcMvSrchRngLT, TComMv* pcMvSrchRngRB, const Int iStartX, const Int iStartY, const Int iDist ); |
---|
| 185 | |
---|
| 186 | Void xGetInterPredictionError( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard ); |
---|
[12] | 187 | #if POZNAN_EIVD |
---|
| 188 | Void xGetInterPredictionError_EIVD( TComDataCU* pcCU, TComYuv* pcYuvOrg, Int iPartIdx, UInt& ruiSAD, Bool Hadamard ); |
---|
| 189 | #endif |
---|
[2] | 190 | |
---|
| 191 | public: |
---|
| 192 | Void preestChromaPredMode ( TComDataCU* pcCU, |
---|
| 193 | TComYuv* pcOrgYuv, |
---|
| 194 | TComYuv* pcPredYuv ); |
---|
| 195 | Void estIntraPredQT ( TComDataCU* pcCU, |
---|
| 196 | TComYuv* pcOrgYuv, |
---|
| 197 | TComYuv* pcPredYuv, |
---|
| 198 | TComYuv* pcResiYuv, |
---|
| 199 | TComYuv* pcRecoYuv, |
---|
| 200 | Dist& ruiDistC, |
---|
| 201 | Bool bLumaOnly ); |
---|
| 202 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
| 203 | TComYuv* pcOrgYuv, |
---|
| 204 | TComYuv* pcPredYuv, |
---|
| 205 | TComYuv* pcResiYuv, |
---|
| 206 | TComYuv* pcRecoYuv, |
---|
| 207 | Dist uiPreCalcDistC ); |
---|
| 208 | |
---|
[5] | 209 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[2] | 210 | Bool predIntraLumaDMMAvailable( UInt uiMode, |
---|
| 211 | UInt uiWidth, |
---|
[5] | 212 | UInt uiHeight ); |
---|
| 213 | #endif |
---|
| 214 | #if HHI_DMM_WEDGE_INTRA |
---|
[2] | 215 | Void findWedgeFullMinDist ( TComDataCU* pcCU, |
---|
| 216 | UInt uiAbsPtIdx, |
---|
| 217 | Pel* piOrig, |
---|
| 218 | Pel* piPredic, |
---|
| 219 | UInt uiStride, |
---|
| 220 | UInt uiWidth, |
---|
| 221 | UInt uiHeight, |
---|
| 222 | UInt& ruiTabIdx, |
---|
| 223 | Int& riDeltaDC1, |
---|
| 224 | Int& riDeltaDC2, |
---|
| 225 | Bool bAbove, |
---|
| 226 | Bool bLeft, |
---|
| 227 | WedgeDist eWedgeDist ); |
---|
| 228 | Void findWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
| 229 | UInt uiAbsPtIdx, |
---|
| 230 | Pel* piOrig, |
---|
| 231 | Pel* piPredic, |
---|
| 232 | UInt uiStride, |
---|
| 233 | UInt uiWidth, |
---|
| 234 | UInt uiHeight, |
---|
| 235 | UInt& ruiTabIdx, |
---|
| 236 | Int& riWedgeDeltaEnd, |
---|
| 237 | Int& riDeltaDC1, |
---|
| 238 | Int& riDeltaDC2, |
---|
| 239 | Bool bAbove, |
---|
| 240 | Bool bLeft, |
---|
| 241 | WedgeDist eWedgeDist ); |
---|
[5] | 242 | #endif |
---|
| 243 | #if HHI_DMM_PRED_TEX |
---|
[2] | 244 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
| 245 | UInt uiAbsPtIdx, |
---|
| 246 | Pel* piOrig, |
---|
| 247 | Pel* piPredic, |
---|
| 248 | UInt uiStride, |
---|
| 249 | UInt uiWidth, |
---|
| 250 | UInt uiHeight, |
---|
| 251 | UInt& ruiTabIdx, |
---|
| 252 | Int& riDeltaDC1, |
---|
| 253 | Int& riDeltaDC2, |
---|
| 254 | Bool bAbove, |
---|
| 255 | Bool bLeft, |
---|
[5] | 256 | WedgeDist eWedgeDist, |
---|
| 257 | Pel* piTextureRef = NULL ); |
---|
| 258 | |
---|
[2] | 259 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
| 260 | UInt uiAbsPtIdx, |
---|
| 261 | Pel* piOrig, |
---|
| 262 | Pel* piPredic, |
---|
| 263 | UInt uiStride, |
---|
| 264 | UInt uiWidth, |
---|
| 265 | UInt uiHeight, |
---|
| 266 | Int& riDeltaDC1, |
---|
| 267 | Int& riDeltaDC2, |
---|
| 268 | Bool bAbove, |
---|
[5] | 269 | Bool bLeft, |
---|
| 270 | Pel* piTextureRef = NULL ); |
---|
[2] | 271 | #endif |
---|
| 272 | |
---|
| 273 | /// encoder estimation - inter prediction (non-skip) |
---|
| 274 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 275 | TComYuv* pcOrgYuv, |
---|
| 276 | TComYuv*& rpcPredYuv, |
---|
| 277 | TComYuv*& rpcResiYuv, |
---|
| 278 | TComYuv*& rpcRecoYuv, |
---|
| 279 | Bool bUseRes = false ); |
---|
| 280 | |
---|
| 281 | /// encoder estimation - intra prediction (skip) |
---|
| 282 | Void predInterSkipSearch ( TComDataCU* pcCU, |
---|
| 283 | TComYuv* pcOrgYuv, |
---|
| 284 | TComYuv*& rpcPredYuv, |
---|
| 285 | TComYuv*& rpcResiYuv, |
---|
| 286 | TComYuv*& rpcRecoYuv ); |
---|
| 287 | |
---|
| 288 | /// encode residual and compute rd-cost for inter mode |
---|
| 289 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 290 | TComYuv* pcYuvOrg, |
---|
| 291 | TComYuv* pcYuvPred, |
---|
| 292 | TComYuv*& rpcYuvResi, |
---|
| 293 | TComYuv*& rpcYuvResiBest, |
---|
| 294 | TComYuv*& rpcYuvRec, |
---|
| 295 | TComYuv*& rpcYuvResPrd, |
---|
| 296 | Bool bSkipRes ); |
---|
| 297 | |
---|
| 298 | /// set ME search range |
---|
| 299 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
| 300 | |
---|
| 301 | protected: |
---|
| 302 | |
---|
| 303 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 304 | // Intra search |
---|
| 305 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 306 | |
---|
| 307 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 308 | UInt uiTrDepth, |
---|
| 309 | UInt uiAbsPartIdx, |
---|
| 310 | Bool bLuma, |
---|
| 311 | Bool bChroma ); |
---|
| 312 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 313 | UInt uiTrDepth, |
---|
| 314 | UInt uiAbsPartIdx, |
---|
| 315 | TextType eTextType, |
---|
| 316 | Bool bRealCoeff ); |
---|
| 317 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 318 | UInt uiTrDepth, |
---|
| 319 | UInt uiAbsPartIdx, |
---|
| 320 | Bool bLuma, |
---|
| 321 | Bool bChroma ); |
---|
| 322 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 323 | UInt uiTrDepth, |
---|
| 324 | UInt uiAbsPartIdx, |
---|
| 325 | Bool bLuma, |
---|
| 326 | Bool bChroma, |
---|
[5] | 327 | Bool bRealCoeff |
---|
| 328 | ); |
---|
[2] | 329 | |
---|
| 330 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 331 | UInt uiTrDepth, |
---|
| 332 | UInt uiAbsPartIdx, |
---|
| 333 | TComYuv* pcOrgYuv, |
---|
| 334 | TComYuv* pcPredYuv, |
---|
| 335 | TComYuv* pcResiYuv, |
---|
| 336 | Dist& ruiDist |
---|
| 337 | ); |
---|
| 338 | |
---|
| 339 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 340 | UInt uiTrDepth, |
---|
| 341 | UInt uiAbsPartIdx, |
---|
| 342 | TComYuv* pcOrgYuv, |
---|
| 343 | TComYuv* pcPredYuv, |
---|
| 344 | TComYuv* pcResiYuv, |
---|
| 345 | Dist& ruiDist, |
---|
| 346 | UInt uiChromaId ); |
---|
| 347 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 348 | UInt uiTrDepth, |
---|
| 349 | UInt uiAbsPartIdx, |
---|
| 350 | Bool bLumaOnly, |
---|
| 351 | TComYuv* pcOrgYuv, |
---|
| 352 | TComYuv* pcPredYuv, |
---|
| 353 | TComYuv* pcResiYuv, |
---|
| 354 | Dist& ruiDistY, |
---|
| 355 | Dist& ruiDistC, |
---|
| 356 | #if HHI_RQT_INTRA_SPEEDUP |
---|
| 357 | Bool bCheckFirst, |
---|
| 358 | #endif |
---|
| 359 | Double& dRDCost ); |
---|
| 360 | |
---|
| 361 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 362 | UInt uiTrDepth, |
---|
| 363 | UInt uiAbsPartIdx, |
---|
| 364 | Bool bLumaOnly, |
---|
| 365 | TComYuv* pcRecoYuv ); |
---|
| 366 | |
---|
| 367 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 368 | UInt uiTrDepth, |
---|
| 369 | UInt uiAbsPartIdx, |
---|
| 370 | TComYuv* pcOrgYuv, |
---|
| 371 | TComYuv* pcPredYuv, |
---|
| 372 | TComYuv* pcResiYuv, |
---|
| 373 | Dist& ruiDist ); |
---|
| 374 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 375 | UInt uiTrDepth, |
---|
| 376 | UInt uiAbsPartIdx, |
---|
| 377 | TComYuv* pcRecoYuv ); |
---|
| 378 | |
---|
| 379 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 380 | // Inter search (AMP) |
---|
| 381 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 382 | |
---|
| 383 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 384 | TComYuv* pcOrgYuv, |
---|
| 385 | UInt uiPartIdx, |
---|
| 386 | RefPicList eRefPicList, |
---|
| 387 | Int iRefIdx, |
---|
| 388 | TComMv& rcMvPred, |
---|
| 389 | Bool bFilled = false |
---|
| 390 | #if ZERO_MVD_EST |
---|
| 391 | , UInt* puiDist = NULL |
---|
| 392 | #endif |
---|
| 393 | ); |
---|
| 394 | |
---|
| 395 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 396 | RefPicList eRefPicList, |
---|
| 397 | TComMv cMv, |
---|
| 398 | TComMv& rcMvPred, |
---|
| 399 | Int& riMVPIdx, |
---|
| 400 | UInt& ruiBits, |
---|
| 401 | UInt& ruiCost ); |
---|
| 402 | |
---|
| 403 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 404 | UInt uiPartIdx, |
---|
| 405 | UInt uiPartAddr, |
---|
| 406 | TComYuv* pcOrgYuv, |
---|
| 407 | TComYuv* pcTemplateCand, |
---|
| 408 | TComMv cMvCand, |
---|
| 409 | Int iMVPIdx, |
---|
| 410 | Int iMVPNum, |
---|
| 411 | RefPicList eRefPicList, |
---|
| 412 | Int iRefIdx, |
---|
| 413 | Int iSizeX, |
---|
| 414 | Int iSizeY |
---|
| 415 | #if ZERO_MVD_EST |
---|
| 416 | , UInt& ruiDist |
---|
| 417 | #endif |
---|
| 418 | ); |
---|
| 419 | |
---|
| 420 | |
---|
| 421 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 422 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 423 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 424 | |
---|
| 425 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 426 | TComYuv* pcYuvOrg, |
---|
| 427 | Int iPartIdx, |
---|
| 428 | UInt& uiInterDir, |
---|
| 429 | TComMvField* pacMvField, |
---|
| 430 | UInt& uiMergeIndex, |
---|
| 431 | UInt& ruiCost, |
---|
| 432 | UInt& ruiBits, |
---|
| 433 | UChar* puhNeighCands, |
---|
| 434 | Bool& bValid ); |
---|
| 435 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 436 | // motion estimation |
---|
| 437 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 438 | |
---|
| 439 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 440 | TComYuv* pcYuvOrg, |
---|
| 441 | Int iPartIdx, |
---|
| 442 | RefPicList eRefPicList, |
---|
| 443 | TComMv* pcMvPred, |
---|
| 444 | Int iRefIdxPred, |
---|
| 445 | TComMv& rcMv, |
---|
| 446 | UInt& ruiBits, |
---|
| 447 | UInt& ruiCost, |
---|
| 448 | Bool bBi = false ); |
---|
| 449 | |
---|
| 450 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 451 | TComPattern* pcPatternKey, |
---|
| 452 | Pel* piRefY, |
---|
| 453 | Int iRefStride, |
---|
| 454 | TComMv* pcMvSrchRngLT, |
---|
| 455 | TComMv* pcMvSrchRngRB, |
---|
| 456 | TComMv& rcMv, |
---|
| 457 | UInt& ruiSAD ); |
---|
| 458 | |
---|
| 459 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 460 | TComMv& cMvPred, |
---|
| 461 | Int iSrchRng, |
---|
| 462 | TComMv& rcMvSrchRngLT, |
---|
| 463 | TComMv& rcMvSrchRngRB ); |
---|
| 464 | |
---|
| 465 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 466 | TComPattern* pcPatternKey, |
---|
| 467 | Pel* piRefY, |
---|
| 468 | Int iRefStride, |
---|
| 469 | TComMv* pcMvSrchRngLT, |
---|
| 470 | TComMv* pcMvSrchRngRB, |
---|
| 471 | TComMv& rcMv, |
---|
| 472 | UInt& ruiSAD ); |
---|
| 473 | |
---|
| 474 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
| 475 | Void xPatternSearch_Bi ( TComPattern* pcPatternKey, |
---|
| 476 | Pel* piRefY, |
---|
| 477 | Int iRefStride, |
---|
| 478 | TComMv* pcMvSrchRngLT, |
---|
| 479 | TComMv* pcMvSrchRngRB, |
---|
| 480 | TComMv& rcMv, |
---|
| 481 | UInt& ruiSAD, |
---|
| 482 | Pel* pcRefY2, |
---|
| 483 | Bool bRound); |
---|
| 484 | |
---|
| 485 | Void xPatternSearchFracDIF_Bi ( TComDataCU* pcCU, |
---|
| 486 | TComPattern* pcPatternKey, |
---|
| 487 | Pel* piRefY, |
---|
| 488 | Int iRefStride, |
---|
| 489 | TComMv* pcMvInt, |
---|
| 490 | TComMv& rcMvHalf, |
---|
| 491 | TComMv& rcMvQter, |
---|
| 492 | UInt& ruiCost, |
---|
| 493 | Pel* pcRefY2, |
---|
| 494 | Bool bRound); |
---|
| 495 | #endif |
---|
| 496 | |
---|
| 497 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 498 | Pel* piRefY, |
---|
| 499 | Int iRefStride, |
---|
| 500 | TComMv* pcMvSrchRngLT, |
---|
| 501 | TComMv* pcMvSrchRngRB, |
---|
| 502 | TComMv& rcMv, |
---|
| 503 | UInt& ruiSAD ); |
---|
| 504 | |
---|
| 505 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 506 | TComPattern* pcPatternKey, |
---|
| 507 | Pel* piRefY, |
---|
| 508 | Int iRefStride, |
---|
| 509 | TComMv* pcMvInt, |
---|
| 510 | TComMv& rcMvHalf, |
---|
| 511 | TComMv& rcMvQter, |
---|
| 512 | UInt& ruiCost |
---|
| 513 | ); |
---|
| 514 | |
---|
| 515 | Void xExtDIFUpSamplingH ( TComPattern* pcPattern, TComYuv* pcYuvExt ); |
---|
| 516 | |
---|
| 517 | Void xExtDIFUpSamplingQ ( TComPattern* pcPatternKey, |
---|
| 518 | Pel* piDst, |
---|
| 519 | Int iDstStride, |
---|
| 520 | Pel* piSrcPel, |
---|
| 521 | Int iSrcPelStride, |
---|
| 522 | Int* piSrc, |
---|
| 523 | Int iSrcStride, |
---|
| 524 | UInt uiFilter ); |
---|
| 525 | |
---|
| 526 | |
---|
| 527 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 528 | // T & Q & Q-1 & T-1 |
---|
| 529 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 530 | |
---|
| 531 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
| 532 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
| 533 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
| 534 | |
---|
| 535 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 536 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 537 | |
---|
| 538 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 539 | // compute symbol bits |
---|
| 540 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 541 | |
---|
| 542 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 543 | UInt uiQp, |
---|
| 544 | UInt uiTrMode, |
---|
| 545 | UInt& ruiBits, |
---|
| 546 | TComYuv*& rpcYuvRec, |
---|
| 547 | TComYuv* pcYuvPred, |
---|
| 548 | TComYuv*& rpcYuvResi ); |
---|
| 549 | |
---|
| 550 | #ifdef WEIGHT_PRED |
---|
| 551 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx0, Int iRefIdx1 , RefPicList eRefPicList ); |
---|
| 552 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
| 553 | #endif |
---|
| 554 | };// END CLASS DEFINITION TEncSearch |
---|
| 555 | |
---|
| 556 | |
---|
| 557 | #endif // __TENCSEARCH__ |
---|
| 558 | |
---|