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