[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 | * |
---|
[56] | 6 | * Copyright (c) 2010-2012, 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 |
---|
[2] | 84 | protected: |
---|
| 85 | // interface to option |
---|
| 86 | TEncCfg* m_pcEncCfg; |
---|
| 87 | |
---|
| 88 | // interface to classes |
---|
| 89 | TComTrQuant* m_pcTrQuant; |
---|
| 90 | TComRdCost* m_pcRdCost; |
---|
| 91 | TEncEntropy* m_pcEntropyCoder; |
---|
| 92 | |
---|
| 93 | // ME parameters |
---|
| 94 | Int m_iSearchRange; |
---|
| 95 | Int m_bipredSearchRange; // Search range for bi-prediction |
---|
| 96 | Int m_iFastSearch; |
---|
| 97 | Int m_aaiAdaptSR[2][33]; |
---|
| 98 | TComMv m_cSrchRngLT; |
---|
| 99 | TComMv m_cSrchRngRB; |
---|
| 100 | TComMv m_acMvPredictors[3]; |
---|
| 101 | |
---|
| 102 | // RD computation |
---|
| 103 | TEncSbac*** m_pppcRDSbacCoder; |
---|
| 104 | TEncSbac* m_pcRDGoOnSbacCoder; |
---|
| 105 | Bool m_bUseSBACRD; |
---|
| 106 | DistParam m_cDistParam; |
---|
| 107 | |
---|
| 108 | // Misc. |
---|
| 109 | Pel* m_pTempPel; |
---|
| 110 | UInt* m_puiDFilter; |
---|
| 111 | Int m_iMaxDeltaQP; |
---|
| 112 | |
---|
| 113 | |
---|
[5] | 114 | #if HHI_VSO |
---|
[2] | 115 | TComYuv m_cYuvRecTemp; |
---|
[5] | 116 | #endif |
---|
[2] | 117 | |
---|
| 118 | // AMVP cost computation |
---|
[56] | 119 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
| 120 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+2][AMVP_MAX_NUM_CANDS+2]; //th array bounds |
---|
| 121 | #else |
---|
[2] | 122 | // UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS]; |
---|
| 123 | UInt m_auiMVPIdxCost[AMVP_MAX_NUM_CANDS+1][AMVP_MAX_NUM_CANDS+1]; //th array bounds |
---|
[56] | 124 | #endif |
---|
[2] | 125 | |
---|
| 126 | public: |
---|
| 127 | TEncSearch(); |
---|
| 128 | virtual ~TEncSearch(); |
---|
| 129 | |
---|
| 130 | Void init( TEncCfg* pcEncCfg, |
---|
| 131 | TComTrQuant* pcTrQuant, |
---|
| 132 | Int iSearchRange, |
---|
| 133 | Int bipredSearchRange, |
---|
| 134 | Int iFastSearch, |
---|
| 135 | Int iMaxDeltaQP, |
---|
| 136 | TEncEntropy* pcEntropyCoder, |
---|
| 137 | TComRdCost* pcRdCost, |
---|
| 138 | TEncSbac*** pppcRDSbacCoder, |
---|
| 139 | TEncSbac* pcRDGoOnSbacCoder ); |
---|
| 140 | |
---|
| 141 | protected: |
---|
| 142 | |
---|
| 143 | /// sub-function for motion vector refinement used in fractional-pel accuracy |
---|
[56] | 144 | UInt xPatternRefinement( TComPattern* pcPatternKey, |
---|
| 145 | TComMv baseRefMv, |
---|
[166] | 146 | Int iFrac, TComMv& rcMvFrac |
---|
| 147 | #if VSP_MV_ZERO |
---|
| 148 | ,Bool bIsVsp |
---|
| 149 | #endif |
---|
| 150 | ); |
---|
[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, |
---|
| 181 | Dist& ruiDistC, |
---|
| 182 | Bool bLumaOnly ); |
---|
| 183 | Void estIntraPredChromaQT ( TComDataCU* pcCU, |
---|
| 184 | TComYuv* pcOrgYuv, |
---|
| 185 | TComYuv* pcPredYuv, |
---|
| 186 | TComYuv* pcResiYuv, |
---|
| 187 | TComYuv* pcRecoYuv, |
---|
| 188 | Dist uiPreCalcDistC ); |
---|
| 189 | |
---|
| 190 | |
---|
| 191 | /// encoder estimation - inter prediction (non-skip) |
---|
| 192 | Void predInterSearch ( TComDataCU* pcCU, |
---|
| 193 | TComYuv* pcOrgYuv, |
---|
[77] | 194 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
[100] | 195 | TComYuv* rpcResiPredYuv, |
---|
[77] | 196 | #endif |
---|
[2] | 197 | TComYuv*& rpcPredYuv, |
---|
| 198 | TComYuv*& rpcResiYuv, |
---|
| 199 | TComYuv*& rpcRecoYuv, |
---|
[56] | 200 | Bool bUseRes = false |
---|
| 201 | #if AMP_MRG |
---|
| 202 | ,Bool bUseMRG = false |
---|
| 203 | #endif |
---|
[166] | 204 | #if FORCE_REF_VSP==1 |
---|
| 205 | ,Bool bForceRefVsp = false |
---|
| 206 | #endif |
---|
[56] | 207 | ); |
---|
[2] | 208 | |
---|
[56] | 209 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 210 | /// encode residual and compute rd-cost for inter mode |
---|
| 211 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 212 | TComYuv* pcYuvOrg, |
---|
| 213 | TComYuv* pcYuvPred, |
---|
| 214 | TComYuv*& rpcYuvResi, |
---|
| 215 | TComYuv*& rpcYuvResiBest, |
---|
| 216 | TComYuv*& rpcYuvRec, |
---|
| 217 | TComYuv*& rpcYuvResPrd, |
---|
| 218 | Bool bSkipRes ); |
---|
[56] | 219 | #else |
---|
| 220 | /// encode residual and compute rd-cost for inter mode |
---|
| 221 | Void encodeResAndCalcRdInterCU( TComDataCU* pcCU, |
---|
| 222 | TComYuv* pcYuvOrg, |
---|
| 223 | TComYuv* pcYuvPred, |
---|
| 224 | TComYuv*& rpcYuvResi, |
---|
| 225 | TComYuv*& rpcYuvResiBest, |
---|
| 226 | TComYuv*& rpcYuvRec, |
---|
| 227 | Bool bSkipRes ); |
---|
| 228 | #endif |
---|
[2] | 229 | /// set ME search range |
---|
| 230 | Void setAdaptiveSearchRange ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; } |
---|
| 231 | |
---|
[56] | 232 | Void xEncPCM (TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrg, Pel* piPCM, Pel* piPred, Pel* piResi, Pel* piReco, UInt uiStride, UInt uiWidth, UInt uiHeight, TextType eText); |
---|
| 233 | Void IPCMSearch (TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv ); |
---|
[2] | 234 | protected: |
---|
| 235 | |
---|
| 236 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 237 | // Intra search |
---|
| 238 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 239 | |
---|
| 240 | Void xEncSubdivCbfQT ( TComDataCU* pcCU, |
---|
| 241 | UInt uiTrDepth, |
---|
| 242 | UInt uiAbsPartIdx, |
---|
| 243 | Bool bLuma, |
---|
| 244 | Bool bChroma ); |
---|
| 245 | Void xEncCoeffQT ( TComDataCU* pcCU, |
---|
| 246 | UInt uiTrDepth, |
---|
| 247 | UInt uiAbsPartIdx, |
---|
| 248 | TextType eTextType, |
---|
| 249 | Bool bRealCoeff ); |
---|
| 250 | Void xEncIntraHeader ( TComDataCU* pcCU, |
---|
| 251 | UInt uiTrDepth, |
---|
| 252 | UInt uiAbsPartIdx, |
---|
| 253 | Bool bLuma, |
---|
| 254 | Bool bChroma ); |
---|
| 255 | UInt xGetIntraBitsQT ( TComDataCU* pcCU, |
---|
| 256 | UInt uiTrDepth, |
---|
| 257 | UInt uiAbsPartIdx, |
---|
| 258 | Bool bLuma, |
---|
| 259 | Bool bChroma, |
---|
[56] | 260 | Bool bRealCoeff ); |
---|
[2] | 261 | |
---|
| 262 | Void xIntraCodingLumaBlk ( TComDataCU* pcCU, |
---|
| 263 | UInt uiTrDepth, |
---|
| 264 | UInt uiAbsPartIdx, |
---|
| 265 | TComYuv* pcOrgYuv, |
---|
| 266 | TComYuv* pcPredYuv, |
---|
| 267 | TComYuv* pcResiYuv, |
---|
[100] | 268 | Dist& ruiDist |
---|
| 269 | #if LG_ZEROINTRADEPTHRESI_M26039 |
---|
| 270 | ,Bool bZeroResi = false |
---|
| 271 | #endif |
---|
| 272 | ); |
---|
[2] | 273 | Void xIntraCodingChromaBlk ( TComDataCU* pcCU, |
---|
| 274 | UInt uiTrDepth, |
---|
| 275 | UInt uiAbsPartIdx, |
---|
| 276 | TComYuv* pcOrgYuv, |
---|
| 277 | TComYuv* pcPredYuv, |
---|
| 278 | TComYuv* pcResiYuv, |
---|
| 279 | Dist& ruiDist, |
---|
| 280 | UInt uiChromaId ); |
---|
| 281 | Void xRecurIntraCodingQT ( TComDataCU* pcCU, |
---|
| 282 | UInt uiTrDepth, |
---|
| 283 | UInt uiAbsPartIdx, |
---|
| 284 | Bool bLumaOnly, |
---|
| 285 | TComYuv* pcOrgYuv, |
---|
| 286 | TComYuv* pcPredYuv, |
---|
| 287 | TComYuv* pcResiYuv, |
---|
| 288 | Dist& ruiDistY, |
---|
| 289 | Dist& ruiDistC, |
---|
| 290 | #if HHI_RQT_INTRA_SPEEDUP |
---|
[100] | 291 | Bool bCheckFirst, |
---|
[2] | 292 | #endif |
---|
[100] | 293 | Double& dRDCost |
---|
| 294 | #if LG_ZEROINTRADEPTHRESI_M26039 |
---|
| 295 | ,Bool bZeroResi = false |
---|
| 296 | #endif |
---|
| 297 | ); |
---|
[2] | 298 | |
---|
| 299 | Void xSetIntraResultQT ( TComDataCU* pcCU, |
---|
| 300 | UInt uiTrDepth, |
---|
| 301 | UInt uiAbsPartIdx, |
---|
| 302 | Bool bLumaOnly, |
---|
| 303 | TComYuv* pcRecoYuv ); |
---|
| 304 | |
---|
| 305 | Void xRecurIntraChromaCodingQT ( TComDataCU* pcCU, |
---|
| 306 | UInt uiTrDepth, |
---|
| 307 | UInt uiAbsPartIdx, |
---|
| 308 | TComYuv* pcOrgYuv, |
---|
| 309 | TComYuv* pcPredYuv, |
---|
| 310 | TComYuv* pcResiYuv, |
---|
| 311 | Dist& ruiDist ); |
---|
| 312 | Void xSetIntraResultChromaQT ( TComDataCU* pcCU, |
---|
| 313 | UInt uiTrDepth, |
---|
| 314 | UInt uiAbsPartIdx, |
---|
| 315 | TComYuv* pcRecoYuv ); |
---|
| 316 | |
---|
| 317 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[56] | 318 | // DMM intra search |
---|
| 319 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 320 | |
---|
| 321 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
| 322 | Bool predIntraLumaDMMAvailable ( UInt uiMode, |
---|
| 323 | UInt uiWidth, |
---|
| 324 | UInt uiHeight ); |
---|
| 325 | Void xGetWedgeDeltaDCsMinDist ( TComWedgelet* pcWedgelet, |
---|
| 326 | TComDataCU* pcCU, |
---|
| 327 | UInt uiAbsPtIdx, |
---|
| 328 | Pel* piOrig, |
---|
| 329 | Pel* piPredic, |
---|
| 330 | UInt uiStride, |
---|
| 331 | UInt uiWidth, |
---|
| 332 | UInt uiHeight, |
---|
| 333 | Int& riDeltaDC1, |
---|
| 334 | Int& riDeltaDC2, |
---|
| 335 | Bool bAboveAvail, |
---|
| 336 | Bool bLeftAvail ); |
---|
| 337 | #endif |
---|
[100] | 338 | |
---|
| 339 | #if LGE_EDGE_INTRA |
---|
| 340 | Bool xEdgePartition ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
| 341 | Bool xCheckTerminatedEdge ( Bool* pbEdge, Int iX, Int iY, Int iWidth, Int iHeight ); |
---|
| 342 | Bool xConstructChainCode ( TComDataCU* pcCU, UInt uiPartIdx, Bool bPU4x4 ); |
---|
| 343 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
| 344 | Void xAssignEdgeIntraDeltaDCs( TComDataCU* pcCU, UInt uiAbsPartIdx, Pel* piOrig, UInt uiStride, Pel* piPredic, UInt uiWidth, UInt uiHeight ); |
---|
| 345 | #endif |
---|
| 346 | #endif |
---|
| 347 | |
---|
[56] | 348 | #if HHI_DMM_WEDGE_INTRA |
---|
| 349 | Void findWedgeFullMinDist ( TComDataCU* pcCU, |
---|
| 350 | UInt uiAbsPtIdx, |
---|
| 351 | Pel* piOrig, |
---|
| 352 | Pel* piPredic, |
---|
| 353 | UInt uiStride, |
---|
| 354 | UInt uiWidth, |
---|
| 355 | UInt uiHeight, |
---|
| 356 | UInt& ruiTabIdx, |
---|
| 357 | Int& riDeltaDC1, |
---|
| 358 | Int& riDeltaDC2, |
---|
| 359 | Bool bAboveAvail, |
---|
| 360 | Bool bLeftAvail ); |
---|
| 361 | Void findWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
| 362 | UInt uiAbsPtIdx, |
---|
| 363 | Pel* piOrig, |
---|
| 364 | Pel* piPredic, |
---|
| 365 | UInt uiStride, |
---|
| 366 | UInt uiWidth, |
---|
| 367 | UInt uiHeight, |
---|
| 368 | UInt& ruiTabIdx, |
---|
| 369 | Int& riWedgeDeltaEnd, |
---|
| 370 | Int& riDeltaDC1, |
---|
| 371 | Int& riDeltaDC2, |
---|
| 372 | Bool bAboveAvail, |
---|
| 373 | Bool bLeftAvail ); |
---|
| 374 | Void xSearchWedgeFullMinDist ( TComDataCU* pcCU, |
---|
| 375 | UInt uiAbsPtIdx, |
---|
| 376 | WedgeList* pacWedgeList, |
---|
| 377 | Pel* piRef, |
---|
| 378 | UInt uiRefStride, |
---|
| 379 | UInt uiWidth, |
---|
| 380 | UInt uiHeight, |
---|
| 381 | UInt& ruiTabIdx, |
---|
| 382 | Dist& riDist ); |
---|
| 383 | Void xSearchWedgePredDirMinDist ( TComDataCU* pcCU, |
---|
| 384 | UInt uiAbsPtIdx, |
---|
| 385 | WedgeList* pacWedgeList, |
---|
| 386 | Pel* piRef, |
---|
| 387 | UInt uiRefStride, |
---|
| 388 | UInt uiWidth, |
---|
| 389 | UInt uiHeight, |
---|
| 390 | UInt& ruiTabIdx, |
---|
| 391 | Int& riWedgeDeltaEnd ); |
---|
| 392 | #endif |
---|
| 393 | #if HHI_DMM_PRED_TEX |
---|
| 394 | Void findWedgeTexMinDist ( TComDataCU* pcCU, |
---|
| 395 | UInt uiAbsPtIdx, |
---|
| 396 | Pel* piOrig, |
---|
| 397 | Pel* piPredic, |
---|
| 398 | UInt uiStride, |
---|
| 399 | UInt uiWidth, |
---|
| 400 | UInt uiHeight, |
---|
| 401 | UInt& ruiTabIdx, |
---|
| 402 | Int& riDeltaDC1, |
---|
| 403 | Int& riDeltaDC2, |
---|
| 404 | Bool bAboveAvail, |
---|
| 405 | Bool bLeftAvail ); |
---|
| 406 | Void findContourPredTex ( TComDataCU* pcCU, |
---|
| 407 | UInt uiAbsPtIdx, |
---|
| 408 | Pel* piOrig, |
---|
| 409 | Pel* piPredic, |
---|
| 410 | UInt uiStride, |
---|
| 411 | UInt uiWidth, |
---|
| 412 | UInt uiHeight, |
---|
| 413 | Int& riDeltaDC1, |
---|
| 414 | Int& riDeltaDC2, |
---|
| 415 | Bool bAboveAvail, |
---|
| 416 | Bool bLeftAvail ); |
---|
| 417 | #endif |
---|
| 418 | |
---|
| 419 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 420 | // Inter search (AMP) |
---|
| 421 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 422 | |
---|
| 423 | Void xEstimateMvPredAMVP ( TComDataCU* pcCU, |
---|
| 424 | TComYuv* pcOrgYuv, |
---|
| 425 | UInt uiPartIdx, |
---|
| 426 | RefPicList eRefPicList, |
---|
| 427 | Int iRefIdx, |
---|
| 428 | TComMv& rcMvPred, |
---|
| 429 | Bool bFilled = false |
---|
[56] | 430 | #if H0111_MVD_L1_ZERO |
---|
| 431 | , UInt* puiDistBiP = NULL |
---|
| 432 | #endif |
---|
[2] | 433 | #if ZERO_MVD_EST |
---|
| 434 | , UInt* puiDist = NULL |
---|
| 435 | #endif |
---|
| 436 | ); |
---|
| 437 | |
---|
| 438 | Void xCheckBestMVP ( TComDataCU* pcCU, |
---|
| 439 | RefPicList eRefPicList, |
---|
| 440 | TComMv cMv, |
---|
| 441 | TComMv& rcMvPred, |
---|
| 442 | Int& riMVPIdx, |
---|
| 443 | UInt& ruiBits, |
---|
| 444 | UInt& ruiCost ); |
---|
| 445 | |
---|
| 446 | UInt xGetTemplateCost ( TComDataCU* pcCU, |
---|
| 447 | UInt uiPartIdx, |
---|
| 448 | UInt uiPartAddr, |
---|
| 449 | TComYuv* pcOrgYuv, |
---|
| 450 | TComYuv* pcTemplateCand, |
---|
| 451 | TComMv cMvCand, |
---|
| 452 | Int iMVPIdx, |
---|
| 453 | Int iMVPNum, |
---|
| 454 | RefPicList eRefPicList, |
---|
| 455 | Int iRefIdx, |
---|
| 456 | Int iSizeX, |
---|
| 457 | Int iSizeY |
---|
| 458 | #if ZERO_MVD_EST |
---|
| 459 | , UInt& ruiDist |
---|
| 460 | #endif |
---|
| 461 | ); |
---|
| 462 | |
---|
| 463 | |
---|
| 464 | Void xCopyAMVPInfo ( AMVPInfo* pSrc, AMVPInfo* pDst ); |
---|
| 465 | UInt xGetMvpIdxBits ( Int iIdx, Int iNum ); |
---|
| 466 | Void xGetBlkBits ( PartSize eCUMode, Bool bPSlice, Int iPartIdx, UInt uiLastMode, UInt uiBlkBit[3]); |
---|
| 467 | |
---|
| 468 | Void xMergeEstimation ( TComDataCU* pcCU, |
---|
| 469 | TComYuv* pcYuvOrg, |
---|
[77] | 470 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
[100] | 471 | TComYuv* rpcResiPredYuv, |
---|
[77] | 472 | #endif |
---|
[2] | 473 | Int iPartIdx, |
---|
| 474 | UInt& uiInterDir, |
---|
| 475 | TComMvField* pacMvField, |
---|
| 476 | UInt& uiMergeIndex, |
---|
[56] | 477 | UInt& ruiCost |
---|
| 478 | #if CU_BASED_MRG_CAND_LIST |
---|
| 479 | , TComMvField* cMvFieldNeighbours, |
---|
| 480 | UChar* uhInterDirNeighbours, |
---|
| 481 | Int& numValidMergeCand |
---|
| 482 | #endif |
---|
| 483 | ); |
---|
[2] | 484 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 485 | // motion estimation |
---|
| 486 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 487 | |
---|
| 488 | Void xMotionEstimation ( TComDataCU* pcCU, |
---|
| 489 | TComYuv* pcYuvOrg, |
---|
| 490 | Int iPartIdx, |
---|
| 491 | RefPicList eRefPicList, |
---|
| 492 | TComMv* pcMvPred, |
---|
| 493 | Int iRefIdxPred, |
---|
| 494 | TComMv& rcMv, |
---|
[166] | 495 | #if VSP_MV_ZERO |
---|
| 496 | Bool bIsVsp, |
---|
| 497 | #endif |
---|
[2] | 498 | UInt& ruiBits, |
---|
| 499 | UInt& ruiCost, |
---|
| 500 | Bool bBi = false ); |
---|
| 501 | |
---|
| 502 | Void xTZSearch ( TComDataCU* pcCU, |
---|
| 503 | TComPattern* pcPatternKey, |
---|
| 504 | Pel* piRefY, |
---|
| 505 | Int iRefStride, |
---|
| 506 | TComMv* pcMvSrchRngLT, |
---|
| 507 | TComMv* pcMvSrchRngRB, |
---|
| 508 | TComMv& rcMv, |
---|
| 509 | UInt& ruiSAD ); |
---|
| 510 | |
---|
| 511 | Void xSetSearchRange ( TComDataCU* pcCU, |
---|
| 512 | TComMv& cMvPred, |
---|
| 513 | Int iSrchRng, |
---|
| 514 | TComMv& rcMvSrchRngLT, |
---|
| 515 | TComMv& rcMvSrchRngRB ); |
---|
| 516 | |
---|
| 517 | Void xPatternSearchFast ( TComDataCU* pcCU, |
---|
| 518 | TComPattern* pcPatternKey, |
---|
| 519 | Pel* piRefY, |
---|
| 520 | Int iRefStride, |
---|
| 521 | TComMv* pcMvSrchRngLT, |
---|
| 522 | TComMv* pcMvSrchRngRB, |
---|
| 523 | TComMv& rcMv, |
---|
| 524 | UInt& ruiSAD ); |
---|
| 525 | |
---|
| 526 | Void xPatternSearch ( TComPattern* pcPatternKey, |
---|
| 527 | Pel* piRefY, |
---|
| 528 | Int iRefStride, |
---|
| 529 | TComMv* pcMvSrchRngLT, |
---|
| 530 | TComMv* pcMvSrchRngRB, |
---|
| 531 | TComMv& rcMv, |
---|
| 532 | UInt& ruiSAD ); |
---|
| 533 | |
---|
| 534 | Void xPatternSearchFracDIF ( TComDataCU* pcCU, |
---|
| 535 | TComPattern* pcPatternKey, |
---|
| 536 | Pel* piRefY, |
---|
| 537 | Int iRefStride, |
---|
| 538 | TComMv* pcMvInt, |
---|
| 539 | TComMv& rcMvHalf, |
---|
| 540 | TComMv& rcMvQter, |
---|
| 541 | UInt& ruiCost |
---|
[56] | 542 | ,Bool biPred |
---|
[166] | 543 | #if VSP_MV_ZERO |
---|
| 544 | ,Bool bIsVsp |
---|
| 545 | #endif |
---|
[2] | 546 | ); |
---|
| 547 | |
---|
[56] | 548 | Void xExtDIFUpSamplingH( TComPattern* pcPattern, Bool biPred ); |
---|
| 549 | Void xExtDIFUpSamplingQ( TComPattern* pcPatternKey, TComMv halfPelRef, Bool biPred ); |
---|
[2] | 550 | |
---|
| 551 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 552 | // T & Q & Q-1 & T-1 |
---|
| 553 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 554 | |
---|
| 555 | Void xEncodeResidualQT( TComDataCU* pcCU, UInt uiAbsPartIdx, const UInt uiDepth, Bool bSubdivAndCbf, TextType eType ); |
---|
[56] | 556 | #if IBDI_DISTORTION || HHI_VSO |
---|
| 557 | 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 ); |
---|
| 558 | #else |
---|
| 559 | Void xEstimateResidualQT( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx, UInt absTUPartIdx , TComYuv* pcResi, const UInt uiDepth, Double &rdCost, UInt &ruiBits, Dist &ruiDist, Dist *puiZeroDist ); |
---|
| 560 | #endif |
---|
| 561 | Void xSetResidualQTData( TComDataCU* pcCU, UInt uiQuadrant, UInt uiAbsPartIdx,UInt absTUPartIdx, TComYuv* pcResi, UInt uiDepth, Bool bSpatial ); |
---|
[2] | 562 | |
---|
| 563 | UInt xModeBitsIntra ( TComDataCU* pcCU, UInt uiMode, UInt uiPU, UInt uiPartOffset, UInt uiDepth, UInt uiInitTrDepth ); |
---|
| 564 | UInt xUpdateCandList( UInt uiMode, Double uiCost, UInt uiFastCandNum, UInt * CandModeList, Double * CandCostList ); |
---|
| 565 | |
---|
| 566 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 567 | // compute symbol bits |
---|
| 568 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 569 | |
---|
| 570 | Void xAddSymbolBitsInter ( TComDataCU* pcCU, |
---|
| 571 | UInt uiQp, |
---|
| 572 | UInt uiTrMode, |
---|
| 573 | UInt& ruiBits, |
---|
| 574 | TComYuv*& rpcYuvRec, |
---|
| 575 | TComYuv* pcYuvPred, |
---|
| 576 | TComYuv*& rpcYuvResi ); |
---|
| 577 | |
---|
[56] | 578 | Void setWpScalingDistParam( TComDataCU* pcCU, Int iRefIdx, RefPicList eRefPicListCur ); |
---|
[2] | 579 | inline Void setDistParamComp( UInt uiComp ) { m_cDistParam.uiComp = uiComp; } |
---|
[56] | 580 | |
---|
[2] | 581 | };// END CLASS DEFINITION TEncSearch |
---|
| 582 | |
---|
[56] | 583 | //! \} |
---|
[2] | 584 | |
---|
| 585 | #endif // __TENCSEARCH__ |
---|