[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 ); |
---|
[28] | 187 | #if POZNAN_DBMP |
---|
| 188 | Void xGetInterPredictionError_DBMP( 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, |
---|
[41] | 212 | #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER |
---|
| 213 | UInt uiHeight, |
---|
| 214 | Bool bDMMAvailable34 ); |
---|
| 215 | #else |
---|
[5] | 216 | UInt uiHeight ); |
---|
| 217 | #endif |
---|
[41] | 218 | #endif |
---|
[5] | 219 | #if HHI_DMM_WEDGE_INTRA |
---|
[2] | 220 | Void findWedgeFullMinDist ( TComDataCU* pcCU, |
---|
| 221 | UInt uiAbsPtIdx, |
---|
| 222 | Pel* piOrig, |
---|
| 223 | Pel* piPredic, |
---|
| 224 | UInt uiStride, |
---|
| 225 | UInt uiWidth, |
---|
| 226 | UInt uiHeight, |
---|
| 227 | UInt& ruiTabIdx, |
---|
| 228 | Int& riDeltaDC1, |
---|
| 229 | Int& riDeltaDC2, |
---|
| 230 | Bool bAbove, |
---|
| 231 | Bool bLeft, |
---|
| 232 | WedgeDist eWedgeDist ); |
---|
| 233 | Void findWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
| 234 | UInt uiAbsPtIdx, |
---|
| 235 | Pel* piOrig, |
---|
| 236 | Pel* piPredic, |
---|
| 237 | UInt uiStride, |
---|
| 238 | UInt uiWidth, |
---|
| 239 | UInt uiHeight, |
---|
| 240 | UInt& ruiTabIdx, |
---|
| 241 | Int& riWedgeDeltaEnd, |
---|
| 242 | Int& riDeltaDC1, |
---|
| 243 | Int& riDeltaDC2, |
---|
| 244 | Bool bAbove, |
---|
| 245 | Bool bLeft, |
---|
| 246 | WedgeDist eWedgeDist ); |
---|
[5] | 247 | #endif |
---|
| 248 | #if HHI_DMM_PRED_TEX |
---|
[2] | 249 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
| 250 | UInt uiAbsPtIdx, |
---|
| 251 | Pel* piOrig, |
---|
| 252 | Pel* piPredic, |
---|
| 253 | UInt uiStride, |
---|
| 254 | UInt uiWidth, |
---|
| 255 | UInt uiHeight, |
---|
| 256 | UInt& ruiTabIdx, |
---|
| 257 | Int& riDeltaDC1, |
---|
| 258 | Int& riDeltaDC2, |
---|
| 259 | Bool bAbove, |
---|
| 260 | Bool bLeft, |
---|
[5] | 261 | WedgeDist eWedgeDist, |
---|
| 262 | Pel* piTextureRef = NULL ); |
---|
| 263 | |
---|
[2] | 264 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
| 265 | UInt uiAbsPtIdx, |
---|
| 266 | Pel* piOrig, |
---|
| 267 | Pel* piPredic, |
---|
| 268 | UInt uiStride, |
---|
| 269 | UInt uiWidth, |
---|
| 270 | UInt uiHeight, |
---|
| 271 | Int& riDeltaDC1, |
---|
| 272 | Int& riDeltaDC2, |
---|
| 273 | Bool bAbove, |
---|
[5] | 274 | Bool bLeft, |
---|
| 275 | Pel* piTextureRef = NULL ); |
---|
[2] | 276 | #endif |
---|
| 277 | |
---|
| 278 | /// encoder estimation - inter prediction (non-skip) |
---|
| 279 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 280 | TComYuv* pcOrgYuv, |
---|
| 281 | TComYuv*& rpcPredYuv, |
---|
| 282 | TComYuv*& rpcResiYuv, |
---|
| 283 | TComYuv*& rpcRecoYuv, |
---|
| 284 | Bool bUseRes = false ); |
---|
| 285 | |
---|
| 286 | /// encoder estimation - intra prediction (skip) |
---|
| 287 | Void predInterSkipSearch ( TComDataCU* pcCU, |
---|
| 288 | TComYuv* pcOrgYuv, |
---|
| 289 | TComYuv*& rpcPredYuv, |
---|
| 290 | TComYuv*& rpcResiYuv, |
---|
| 291 | TComYuv*& rpcRecoYuv ); |
---|
| 292 | |
---|
| 293 | /// encode residual and compute rd-cost for inter mode |
---|
| 294 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 295 | TComYuv* pcYuvOrg, |
---|
| 296 | TComYuv* pcYuvPred, |
---|
| 297 | TComYuv*& rpcYuvResi, |
---|
| 298 | TComYuv*& rpcYuvResiBest, |
---|
| 299 | TComYuv*& rpcYuvRec, |
---|
| 300 | TComYuv*& rpcYuvResPrd, |
---|
| 301 | Bool bSkipRes ); |
---|
| 302 | |
---|
| 303 | /// set ME search range |
---|
| 304 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
| 305 | |
---|
| 306 | protected: |
---|
| 307 | |
---|
| 308 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 309 | // Intra search |
---|
| 310 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 311 | |
---|
| 312 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 313 | UInt uiTrDepth, |
---|
| 314 | UInt uiAbsPartIdx, |
---|
| 315 | Bool bLuma, |
---|
| 316 | Bool bChroma ); |
---|
| 317 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 318 | UInt uiTrDepth, |
---|
| 319 | UInt uiAbsPartIdx, |
---|
| 320 | TextType eTextType, |
---|
| 321 | Bool bRealCoeff ); |
---|
| 322 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 323 | UInt uiTrDepth, |
---|
| 324 | UInt uiAbsPartIdx, |
---|
| 325 | Bool bLuma, |
---|
| 326 | Bool bChroma ); |
---|
| 327 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 328 | UInt uiTrDepth, |
---|
| 329 | UInt uiAbsPartIdx, |
---|
| 330 | Bool bLuma, |
---|
| 331 | Bool bChroma, |
---|
[5] | 332 | Bool bRealCoeff |
---|
| 333 | ); |
---|
[2] | 334 | |
---|
| 335 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 336 | UInt uiTrDepth, |
---|
| 337 | UInt uiAbsPartIdx, |
---|
| 338 | TComYuv* pcOrgYuv, |
---|
| 339 | TComYuv* pcPredYuv, |
---|
| 340 | TComYuv* pcResiYuv, |
---|
| 341 | Dist& ruiDist |
---|
| 342 | ); |
---|
| 343 | |
---|
| 344 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 345 | UInt uiTrDepth, |
---|
| 346 | UInt uiAbsPartIdx, |
---|
| 347 | TComYuv* pcOrgYuv, |
---|
| 348 | TComYuv* pcPredYuv, |
---|
| 349 | TComYuv* pcResiYuv, |
---|
| 350 | Dist& ruiDist, |
---|
| 351 | UInt uiChromaId ); |
---|
| 352 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 353 | UInt uiTrDepth, |
---|
| 354 | UInt uiAbsPartIdx, |
---|
| 355 | Bool bLumaOnly, |
---|
| 356 | TComYuv* pcOrgYuv, |
---|
| 357 | TComYuv* pcPredYuv, |
---|
| 358 | TComYuv* pcResiYuv, |
---|
| 359 | Dist& ruiDistY, |
---|
| 360 | Dist& ruiDistC, |
---|
| 361 | #if HHI_RQT_INTRA_SPEEDUP |
---|
| 362 | Bool bCheckFirst, |
---|
| 363 | #endif |
---|
| 364 | Double& dRDCost ); |
---|
| 365 | |
---|
| 366 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 367 | UInt uiTrDepth, |
---|
| 368 | UInt uiAbsPartIdx, |
---|
| 369 | Bool bLumaOnly, |
---|
| 370 | TComYuv* pcRecoYuv ); |
---|
| 371 | |
---|
| 372 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 373 | UInt uiTrDepth, |
---|
| 374 | UInt uiAbsPartIdx, |
---|
| 375 | TComYuv* pcOrgYuv, |
---|
| 376 | TComYuv* pcPredYuv, |
---|
| 377 | TComYuv* pcResiYuv, |
---|
| 378 | Dist& ruiDist ); |
---|
| 379 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 380 | UInt uiTrDepth, |
---|
| 381 | UInt uiAbsPartIdx, |
---|
| 382 | TComYuv* pcRecoYuv ); |
---|
| 383 | |
---|
| 384 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 385 | // Inter search (AMP) |
---|
| 386 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 387 | |
---|
| 388 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 389 | TComYuv* pcOrgYuv, |
---|
| 390 | UInt uiPartIdx, |
---|
| 391 | RefPicList eRefPicList, |
---|
| 392 | Int iRefIdx, |
---|
| 393 | TComMv& rcMvPred, |
---|
| 394 | Bool bFilled = false |
---|
| 395 | #if ZERO_MVD_EST |
---|
| 396 | , UInt* puiDist = NULL |
---|
| 397 | #endif |
---|
| 398 | ); |
---|
| 399 | |
---|
| 400 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 401 | RefPicList eRefPicList, |
---|
| 402 | TComMv cMv, |
---|
| 403 | TComMv& rcMvPred, |
---|
| 404 | Int& riMVPIdx, |
---|
| 405 | UInt& ruiBits, |
---|
| 406 | UInt& ruiCost ); |
---|
| 407 | |
---|
| 408 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 409 | UInt uiPartIdx, |
---|
| 410 | UInt uiPartAddr, |
---|
| 411 | TComYuv* pcOrgYuv, |
---|
| 412 | TComYuv* pcTemplateCand, |
---|
| 413 | TComMv cMvCand, |
---|
| 414 | Int iMVPIdx, |
---|
| 415 | Int iMVPNum, |
---|
| 416 | RefPicList eRefPicList, |
---|
| 417 | Int iRefIdx, |
---|
| 418 | Int iSizeX, |
---|
| 419 | Int iSizeY |
---|
| 420 | #if ZERO_MVD_EST |
---|
| 421 | , UInt& ruiDist |
---|
| 422 | #endif |
---|
| 423 | ); |
---|
| 424 | |
---|
| 425 | |
---|
| 426 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 427 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 428 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 429 | |
---|
| 430 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 431 | TComYuv* pcYuvOrg, |
---|
| 432 | Int iPartIdx, |
---|
| 433 | UInt& uiInterDir, |
---|
| 434 | TComMvField* pacMvField, |
---|
| 435 | UInt& uiMergeIndex, |
---|
| 436 | UInt& ruiCost, |
---|
| 437 | UInt& ruiBits, |
---|
| 438 | UChar* puhNeighCands, |
---|
| 439 | Bool& bValid ); |
---|
| 440 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 441 | // motion estimation |
---|
| 442 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 443 | |
---|
| 444 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 445 | TComYuv* pcYuvOrg, |
---|
| 446 | Int iPartIdx, |
---|
| 447 | RefPicList eRefPicList, |
---|
| 448 | TComMv* pcMvPred, |
---|
| 449 | Int iRefIdxPred, |
---|
| 450 | TComMv& rcMv, |
---|
| 451 | UInt& ruiBits, |
---|
| 452 | UInt& ruiCost, |
---|
| 453 | Bool bBi = false ); |
---|
| 454 | |
---|
| 455 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 456 | TComPattern* pcPatternKey, |
---|
| 457 | Pel* piRefY, |
---|
| 458 | Int iRefStride, |
---|
| 459 | TComMv* pcMvSrchRngLT, |
---|
| 460 | TComMv* pcMvSrchRngRB, |
---|
| 461 | TComMv& rcMv, |
---|
| 462 | UInt& ruiSAD ); |
---|
| 463 | |
---|
| 464 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 465 | TComMv& cMvPred, |
---|
| 466 | Int iSrchRng, |
---|
| 467 | TComMv& rcMvSrchRngLT, |
---|
| 468 | TComMv& rcMvSrchRngRB ); |
---|
| 469 | |
---|
| 470 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 471 | TComPattern* pcPatternKey, |
---|
| 472 | Pel* piRefY, |
---|
| 473 | Int iRefStride, |
---|
| 474 | TComMv* pcMvSrchRngLT, |
---|
| 475 | TComMv* pcMvSrchRngRB, |
---|
| 476 | TComMv& rcMv, |
---|
| 477 | UInt& ruiSAD ); |
---|
| 478 | |
---|
| 479 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
| 480 | Void xPatternSearch_Bi ( TComPattern* pcPatternKey, |
---|
| 481 | Pel* piRefY, |
---|
| 482 | Int iRefStride, |
---|
| 483 | TComMv* pcMvSrchRngLT, |
---|
| 484 | TComMv* pcMvSrchRngRB, |
---|
| 485 | TComMv& rcMv, |
---|
| 486 | UInt& ruiSAD, |
---|
| 487 | Pel* pcRefY2, |
---|
| 488 | Bool bRound); |
---|
| 489 | |
---|
| 490 | Void xPatternSearchFracDIF_Bi ( TComDataCU* pcCU, |
---|
| 491 | TComPattern* pcPatternKey, |
---|
| 492 | Pel* piRefY, |
---|
| 493 | Int iRefStride, |
---|
| 494 | TComMv* pcMvInt, |
---|
| 495 | TComMv& rcMvHalf, |
---|
| 496 | TComMv& rcMvQter, |
---|
| 497 | UInt& ruiCost, |
---|
| 498 | Pel* pcRefY2, |
---|
| 499 | Bool bRound); |
---|
| 500 | #endif |
---|
| 501 | |
---|
| 502 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 503 | Pel* piRefY, |
---|
| 504 | Int iRefStride, |
---|
| 505 | TComMv* pcMvSrchRngLT, |
---|
| 506 | TComMv* pcMvSrchRngRB, |
---|
| 507 | TComMv& rcMv, |
---|
| 508 | UInt& ruiSAD ); |
---|
| 509 | |
---|
| 510 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 511 | TComPattern* pcPatternKey, |
---|
| 512 | Pel* piRefY, |
---|
| 513 | Int iRefStride, |
---|
| 514 | TComMv* pcMvInt, |
---|
| 515 | TComMv& rcMvHalf, |
---|
| 516 | TComMv& rcMvQter, |
---|
| 517 | UInt& ruiCost |
---|
| 518 | ); |
---|
| 519 | |
---|
| 520 | Void xExtDIFUpSamplingH ( TComPattern* pcPattern, TComYuv* pcYuvExt ); |
---|
| 521 | |
---|
| 522 | Void xExtDIFUpSamplingQ ( TComPattern* pcPatternKey, |
---|
| 523 | Pel* piDst, |
---|
| 524 | Int iDstStride, |
---|
| 525 | Pel* piSrcPel, |
---|
| 526 | Int iSrcPelStride, |
---|
| 527 | Int* piSrc, |
---|
| 528 | Int iSrcStride, |
---|
| 529 | UInt uiFilter ); |
---|
| 530 | |
---|
| 531 | |
---|
| 532 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 533 | // T & Q & Q-1 & T-1 |
---|
| 534 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 535 | |
---|
| 536 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
| 537 | 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 ); |
---|
| 538 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
| 539 | |
---|
| 540 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 541 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 542 | |
---|
| 543 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 544 | // compute symbol bits |
---|
| 545 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 546 | |
---|
| 547 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 548 | UInt uiQp, |
---|
| 549 | UInt uiTrMode, |
---|
| 550 | UInt& ruiBits, |
---|
| 551 | TComYuv*& rpcYuvRec, |
---|
| 552 | TComYuv* pcYuvPred, |
---|
| 553 | TComYuv*& rpcYuvResi ); |
---|
| 554 | |
---|
| 555 | #ifdef WEIGHT_PRED |
---|
| 556 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx0, Int iRefIdx1 , RefPicList eRefPicList ); |
---|
| 557 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
| 558 | #endif |
---|
| 559 | };// END CLASS DEFINITION TEncSearch |
---|
| 560 | |
---|
| 561 | |
---|
| 562 | #endif // __TENCSEARCH__ |
---|
| 563 | |
---|