/work/vvenc/source/Lib/EncoderLib/EncCu.h
Line | Count | Source |
1 | | /* ----------------------------------------------------------------------------- |
2 | | The copyright in this software is being made available under the Clear BSD |
3 | | License, included below. No patent rights, trademark rights and/or |
4 | | other Intellectual Property Rights other than the copyrights concerning |
5 | | the Software are granted under this license. |
6 | | |
7 | | The Clear BSD License |
8 | | |
9 | | Copyright (c) 2019-2026, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors. |
10 | | All rights reserved. |
11 | | |
12 | | Redistribution and use in source and binary forms, with or without modification, |
13 | | are permitted (subject to the limitations in the disclaimer below) provided that |
14 | | the following conditions are met: |
15 | | |
16 | | * Redistributions of source code must retain the above copyright notice, |
17 | | this list of conditions and the following disclaimer. |
18 | | |
19 | | * Redistributions in binary form must reproduce the above copyright |
20 | | notice, this list of conditions and the following disclaimer in the |
21 | | documentation and/or other materials provided with the distribution. |
22 | | |
23 | | * Neither the name of the copyright holder nor the names of its |
24 | | contributors may be used to endorse or promote products derived from this |
25 | | software without specific prior written permission. |
26 | | |
27 | | NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY |
28 | | THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
29 | | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
30 | | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A |
31 | | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
32 | | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
33 | | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
34 | | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR |
35 | | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER |
36 | | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
37 | | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
38 | | POSSIBILITY OF SUCH DAMAGE. |
39 | | |
40 | | |
41 | | ------------------------------------------------------------------------------------------- */ |
42 | | /** \file EncCu.h |
43 | | \brief Coding Unit (CU) encoder class (header) |
44 | | */ |
45 | | |
46 | | #pragma once |
47 | | |
48 | | #include "vvenc/vvencCfg.h" |
49 | | #include "CABACWriter.h" |
50 | | #include "IntraSearch.h" |
51 | | #include "InterSearch.h" |
52 | | #include "EncModeCtrl.h" |
53 | | #include "RateCtrl.h" |
54 | | #include "CommonLib/CommonDef.h" |
55 | | #include "CommonLib/Unit.h" |
56 | | #include "CommonLib/UnitPartitioner.h" |
57 | | #include "CommonLib/LoopFilter.h" |
58 | | #include "DecoderLib/DecCu.h" |
59 | | |
60 | | //! \ingroup EncoderLib |
61 | | //! \{ |
62 | | |
63 | | namespace vvenc { |
64 | | |
65 | | class EncModeCtrl; |
66 | | struct EncTestMode; |
67 | | class EncPicture; |
68 | | |
69 | | // ==================================================================================================================== |
70 | | // Class definition |
71 | | // ==================================================================================================================== |
72 | | struct GeoMergeCombo |
73 | | { |
74 | | int splitDir = 0; |
75 | | int8_t mergeIdx0 = -1; |
76 | | int8_t mergeIdx1 = -1; |
77 | | uint16_t order = 0; // position in the list as built, which decides between equal costs |
78 | | double cost = 0.0; |
79 | | }; |
80 | | |
81 | | struct SmallerThanComboCost |
82 | | { |
83 | | inline bool operator()(const GeoMergeCombo &first, const GeoMergeCombo &second) |
84 | 0 | { |
85 | 0 | return first.cost < second.cost || ( first.cost == second.cost && first.order < second.order ); |
86 | 0 | } |
87 | | }; |
88 | | |
89 | | struct GeoComboCostList |
90 | | { |
91 | | std::vector<GeoMergeCombo> list; |
92 | | // Only the first entries are tried, so only those need to be in order. A list can hold 1920 combos, though most are short. |
93 | | void sortFirstByCost( const int numFirst ) |
94 | 0 | { |
95 | 0 | const auto firstEnd = list.begin() + std::min<size_t>( numFirst, list.size() ); |
96 | 0 | if( firstEnd != list.end() ) |
97 | 0 | { |
98 | 0 | std::nth_element( list.begin(), firstEnd, list.end(), SmallerThanComboCost() ); |
99 | 0 | } |
100 | 0 | std::sort( list.begin(), firstEnd, SmallerThanComboCost() ); |
101 | 0 | } |
102 | | }; |
103 | | |
104 | | class FastGeoCostList |
105 | | { |
106 | | using CostArray = double[GEO_NUM_PARTITION_MODE][2]; |
107 | | |
108 | | int m_maxNumGeoCand{ 0 }; |
109 | | CostArray *m_singleDistList{ nullptr }; |
110 | | |
111 | | public: |
112 | | |
113 | 5.72k | FastGeoCostList() {} |
114 | | ~FastGeoCostList() |
115 | 5.72k | { |
116 | 5.72k | delete[] m_singleDistList; |
117 | 5.72k | m_singleDistList = nullptr; |
118 | 5.72k | } |
119 | | |
120 | | void init( int maxNumGeoCand ) |
121 | 5.72k | { |
122 | 5.72k | if( m_maxNumGeoCand != maxNumGeoCand ) |
123 | 5.72k | { |
124 | 5.72k | delete[] m_singleDistList; |
125 | 5.72k | m_singleDistList = nullptr; |
126 | | |
127 | 5.72k | CHECK( maxNumGeoCand > MRG_MAX_NUM_CANDS, "Too many candidates" ); |
128 | 5.72k | m_singleDistList = new CostArray[maxNumGeoCand]; |
129 | 5.72k | m_maxNumGeoCand = maxNumGeoCand; |
130 | 5.72k | } |
131 | 5.72k | } |
132 | | |
133 | | void insert( int splitDir, int partIdx, int mergeIdx, double cost ) |
134 | 0 | { |
135 | 0 | CHECKD( splitDir >= GEO_NUM_PARTITION_MODE, "geoIdx is too large" ); |
136 | 0 | CHECKD( mergeIdx >= m_maxNumGeoCand, "mergeIdx is too large" ); |
137 | 0 | CHECKD( partIdx >= 2, "partIdx is too large" ); |
138 | |
|
139 | 0 | m_singleDistList[mergeIdx][splitDir][partIdx] = cost; |
140 | 0 | } |
141 | | |
142 | | double getCost( const int splitDir, const int mergeCand0, const int mergeCand1 ) |
143 | 0 | { |
144 | 0 | return m_singleDistList[mergeCand0][splitDir][0] + m_singleDistList[mergeCand1][splitDir][1]; |
145 | 0 | } |
146 | | }; |
147 | | |
148 | | |
149 | | |
150 | | class MergeItem |
151 | | { |
152 | | private: |
153 | | PelStorage m_pelStorage; |
154 | | std::vector<MotionInfo> m_mvStorage; |
155 | | |
156 | | public: |
157 | | |
158 | | enum class MergeItemType |
159 | | { |
160 | | REGULAR, |
161 | | SBTMVP, |
162 | | AFFINE, |
163 | | MMVD, |
164 | | CIIP, |
165 | | GPM, |
166 | | IBC, |
167 | | NUM, |
168 | | }; |
169 | | |
170 | | double cost; |
171 | | std::array<MvField[3], 2> |
172 | | mvField; |
173 | | int mergeIdx; |
174 | | uint8_t bcwIdx; |
175 | | uint8_t interDir; |
176 | | bool useAltHpelIf; |
177 | | int8_t affineType; |
178 | | int8_t numCiipIntra; |
179 | | |
180 | | bool noResidual; |
181 | | bool noBdofRefine; |
182 | | |
183 | | bool lumaPredReady; |
184 | | bool chromaPredReady; |
185 | | |
186 | | MergeItemType mergeItemType; |
187 | | |
188 | | MergeItem(); |
189 | | ~MergeItem(); |
190 | | |
191 | | void create (ChromaFormat chromaFormat, const Area& area); |
192 | | void init (); |
193 | | void importMergeInfo (const MergeCtx& mergeCtx, int _mergeIdx, MergeItemType _mergeItemType, CodingUnit& cu); |
194 | | void importMergeInfo (const AffineMergeCtx& mergeCtx, int _mergeIdx, MergeItemType _mergeItemType, CodingUnit& cu); |
195 | | bool exportMergeInfo (CodingUnit& cu, bool forceNoResidual, const MergeCtx& gpmMergeCtx) const; |
196 | 0 | PelUnitBuf getPredBuf (const UnitArea& unitArea) { return m_pelStorage.getCompactBuf( unitArea ); } |
197 | 0 | CMotionBuf getMvBuf (const UnitArea &unitArea) const { return CMotionBuf( m_mvStorage.data(), g_miScaling.scale( unitArea.lumaSize() ) ); } |
198 | 0 | MotionBuf getMvBuf (const UnitArea &unitArea) { return MotionBuf( m_mvStorage.data(), g_miScaling.scale( unitArea.lumaSize() ) ); } |
199 | | |
200 | | static int getGpmUnfiedIndex( int splitDir, const MergeIdxPair &geoMergeIdx ) |
201 | 0 | { |
202 | 0 | return ( splitDir << 8 ) | ( geoMergeIdx[ 0 ] << 4 ) | geoMergeIdx[ 1 ]; |
203 | 0 | } |
204 | | |
205 | | static void updateGpmIdx( int mergeIdx, uint8_t &splitDir, MergeIdxPair &geoMergeIdx ) |
206 | 0 | { |
207 | 0 | splitDir = ( mergeIdx >> 8 ) & 0xFF; |
208 | 0 | geoMergeIdx[0] = ( mergeIdx >> 4 ) & 0xF; |
209 | 0 | geoMergeIdx[1] = mergeIdx & 0xF; |
210 | 0 | } |
211 | | }; |
212 | | |
213 | | class MergeItemList |
214 | | { |
215 | | private: |
216 | | std::vector<MergeItem*> m_mergeItems; |
217 | | std::vector<MergeItem*> m_list; |
218 | | size_t m_maxTrackingNum = 0; |
219 | | size_t m_maxSize; |
220 | | size_t m_maxExtSize; |
221 | | size_t m_numExt; |
222 | | |
223 | | public: |
224 | | MergeItemList(); |
225 | | ~MergeItemList(); |
226 | | |
227 | | void init (size_t maxListSize, size_t maxExtSize, ChromaFormat chromaFormat, SizeType ctuWidth, SizeType ctuHeight); |
228 | | MergeItem* allocateNewMergeItem (); |
229 | | bool insertMergeItemToList (MergeItem* p); |
230 | | void giveBackMergeItem (MergeItem* p); |
231 | | void resetList (size_t maxTrackingNum); |
232 | | void shrinkList (size_t reduceTo); |
233 | | MergeItem* getMergeItemInList (size_t index); |
234 | 0 | size_t size () const { return m_list.size(); } |
235 | 0 | size_t capacity () const { return m_maxTrackingNum; } |
236 | | // an item enters the list only below this cost: the last item's while the list is full (insertMergeItemToList) |
237 | 0 | double costToEnter () const { return !m_list.empty() && m_list.size() == m_maxTrackingNum ? m_list.back()->cost : MAX_DOUBLE; } |
238 | | }; |
239 | | |
240 | | using MergeBufVector = static_vector<PelUnitBuf, MRG_MAX_NUM_CANDS>; |
241 | | |
242 | | /// Per-picture state of the CU encoder. The slice encoder fills it in when it starts a picture. |
243 | | /// CU encoders belong to worker threads and serve all pictures that are encoded in parallel, so a |
244 | | /// worker applies this state to its CU encoder before the first CTU it encodes from the picture. |
245 | | struct PicEncState |
246 | | { |
247 | | Picture* pic = nullptr; |
248 | | uint64_t id = 0; ///< unique for every picture start, also across slice encoders |
249 | | double lambda = 0.0; ///< picture lambda before CTU-level adaptation |
250 | | int qp = 0; ///< picture QP matching the lambda |
251 | | Ctx* syncPicCtx = nullptr; ///< WPP context storage of the slice encoder that owns the picture |
252 | | }; |
253 | | |
254 | | /// CU encoder class |
255 | | class EncCu |
256 | | : DecCu |
257 | | { |
258 | | private: |
259 | | struct CtxPair |
260 | | { |
261 | | Ctx start; |
262 | | Ctx best; |
263 | | }; |
264 | | |
265 | | std::vector<CtxPair> m_CtxBuffer; |
266 | | CtxPair* m_CurrCtx; |
267 | | bool m_startCtxPending; ///< reset the estimator to m_CurrCtx->start before its next read (see xCheckBestMode) |
268 | | CtxCache* m_CtxCache; |
269 | | |
270 | | // Data : encoder control |
271 | | |
272 | | static const int maxCuDepth = ( MAX_CU_SIZE_IDX - MIN_CU_LOG2 ) << 1; |
273 | | |
274 | | int m_cuChromaQpOffsetIdxPlus1; |
275 | | int m_tempQpDiff; |
276 | | std::vector<int>* m_globalCtuQpVector; |
277 | | XUCache m_unitCache; |
278 | | std::mutex* m_wppMutex; |
279 | | CodingStructure* m_pTempCS[maxCuDepth]; |
280 | | CodingStructure* m_pBestCS[maxCuDepth]; |
281 | | CodingStructure* m_pTempCS2; |
282 | | CodingStructure* m_pBestCS2; |
283 | | PelStorage m_pOrgBuffer[maxCuDepth]; |
284 | | |
285 | | int m_lumaLevelToDeltaQPLUT[LUMA_LEVEL_TO_DQP_LUT_MAXSIZE]; |
286 | | |
287 | | // Access channel |
288 | | const VVEncCfg* m_pcEncCfg; |
289 | | IntraSearch m_cIntraSearch; |
290 | | InterSearch m_cInterSearch; |
291 | | RdCost m_cRdCost; |
292 | | LoopFilter m_cLoopFilter; |
293 | | |
294 | | CABACWriter* m_CABACEstimator; |
295 | | EncModeCtrl m_modeCtrl; |
296 | | TrQuant m_cTrQuant; ///< transform & quantization |
297 | | RateCtrl* m_pcRateCtrl; |
298 | | |
299 | | PelStorage m_aTmpStorageLCU [MAX_TMP_BUFS]; ///< used with CIIP, EDO, GEO |
300 | | PelStorage m_acMergeTmpBuffer[MRG_MAX_NUM_CANDS]; |
301 | | std::vector<uint32_t> m_geoRowPrefix; ///< GEO: the row prefix sums of |org - pred| of all candidates, see PelBufferOps::geoPrefixSums |
302 | | |
303 | | SortedPelUnitBufs<SORTED_BUFS> |
304 | | m_SortedPelUnitBufs; |
305 | | FastGeoCostList m_GeoCostList; |
306 | | static const MergeIdxPair |
307 | | m_GeoModeTest[GEO_MAX_NUM_CANDS]; |
308 | | double m_mergeBestSATDCost; |
309 | | |
310 | | MotionInfo m_subPuMiBuf[(MAX_CU_SIZE * MAX_CU_SIZE) >> (MIN_CU_LOG2 << 1)]; |
311 | | |
312 | | Mv m_refinedMvdL0[MRG_MAX_NUM_CANDS][MAX_NUM_SUBCU_DMVR]; |
313 | | |
314 | | double m_sbtCostSave[2]; |
315 | | // thread stuff |
316 | | Ctx* m_syncPicCtx; ///< context storage for state of contexts at the wavefront/WPP/entropy-coding-sync second CTU of tile-row used for estimation |
317 | | uint64_t m_boundPicId; ///< PicEncState::id of the picture whose state is applied |
318 | | PelStorage m_dbBuffer; |
319 | | |
320 | | Partitioner m_partitioner; |
321 | | |
322 | | int m_bestBcwIdx[2]; |
323 | | double m_bestBcwCost[2]; |
324 | | |
325 | | int m_MergeSimpleFlag; |
326 | | int m_tileIdx; |
327 | | int m_EDO; |
328 | | |
329 | | GeoComboCostList m_comboList; |
330 | | MergeItemList m_mergeItemList; |
331 | | std::array<Mv, MAX_NUM_SUBCU_DMVR> |
332 | | m_subPuMvOffset[MRG_MAX_NUM_CANDS]; |
333 | | Distortion m_uiSadBestForQPA; |
334 | | |
335 | | static const double coefSquareCUsFasterFastMedium[2][5][2][2][2]; |
336 | | static const double coefSquareCUsSlowSlower[2][5][2][5][2][2][2]; |
337 | | |
338 | | public: |
339 | | EncCu(); |
340 | | virtual ~EncCu(); |
341 | | |
342 | | // When otherTrQuant is given, the quantizer is created from that one's quantizer and shares its read-only |
343 | | // tables, such as the dependent quantization scan tables (see DepQuant::DepQuant). |
344 | | void init ( const VVEncCfg& encCfg, const SPS& sps, std::vector<int>* const globalCtuQpVector, RateCtrl* pRateCtrl, TrQuant* otherTrQuant ); |
345 | 1.43k | TrQuant& getTrQuant () { return m_cTrQuant; } |
346 | | void setCtuEncRsrc ( CABACWriter* cabacEstimator, CtxCache* ctxCache, ReuseUniMv* pReuseUniMv, BlkUniMvInfoBuffer* pBlkUniMvInfoBuffer, AffineProfList* pAffineProfList, IbcBvCand* pCachedBvs ); |
347 | | void destroy (); |
348 | | |
349 | | // Applies the per-picture state unless this CU encoder already works on that picture. |
350 | | void bindToPicture ( const PicEncState& picState ); |
351 | | |
352 | | // Derives the lambda of every component and the chroma distortion weights for a QP. The RD cost |
353 | | // has a single lambda, so the chroma weights account for the chroma QP mapping and offsets. |
354 | | static void deriveComponentLambdas( const VVEncCfg& encCfg, const Slice& slice, const double lambda, const int qp, |
355 | | double lambdas[MAX_NUM_COMP], double weights[MAX_NUM_COMP] ); |
356 | | |
357 | | void encodeCtu ( Picture* pic, int (&prevQP)[MAX_NUM_CH], uint32_t ctuXPosInCtus, uint32_t ctuYPosInCtus ); |
358 | | |
359 | | private: |
360 | | void initPic ( Picture* pic ); |
361 | | void initSlice ( const Slice* slice ); |
362 | | void setUpLambda ( Slice& slice, const double dLambda, const int iQP, const bool setSliceLambda, const bool saveUnadjusted); |
363 | | void updateLambda ( const Slice& slice, const double ctuLambda, const int ctuQP, const int newQP, const bool saveUnadjusted); |
364 | | |
365 | | void xCompressCtu ( CodingStructure& cs, const UnitArea& area, const unsigned ctuRsAddr, const int prevQP[] ); |
366 | | |
367 | | void xCalDebCost ( CodingStructure& cs, Partitioner& partitioner ); |
368 | | Distortion xGetDistortionDb ( CodingStructure& cs, CPelBuf& org, CPelBuf& reco, const CompArea& compArea, bool beforeDb ); |
369 | | |
370 | | void xCompressCU ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm ); |
371 | | bool xCheckBestMode ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestmode, const bool useEDO = false ); |
372 | | void xRestoreStartCtx (); |
373 | | void xSetStartCtx (); |
374 | | |
375 | | void xCheckRDCostIntra ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode ); |
376 | | void xCheckRDCostInter ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode ); |
377 | | void xCheckRDCostInterIMV ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode ); |
378 | | void xCheckRDCostUnifiedMerge |
379 | | ( CodingStructure *&tempCS, CodingStructure *&bestCS, Partitioner &pm, EncTestMode& encTestMode ); |
380 | | void xCheckModeSplit ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode ); |
381 | | void xCheckModeSplitInternal( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode, const ModeType modeTypeParent, bool& skipInterPass ); |
382 | | void xReuseCachedResult ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm ); |
383 | | |
384 | | void xCheckDQP ( CodingStructure& cs, Partitioner& partitioner, bool bKeepCtx = false); |
385 | | void xEncodeDontSplit ( CodingStructure& cs, Partitioner& partitioner); |
386 | | |
387 | | void xEncodeInterResidual ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode, |
388 | | int residualPass = 0, bool* bestHasNonResi = NULL, double* equBcwCost = NULL ); |
389 | | |
390 | | void xInitLumaDeltaQpLUT (); |
391 | | |
392 | | bool xIsBcwSkip( const CodingUnit& cu ) |
393 | 0 | { |
394 | 0 | if( cu.slice->sliceType != VVENC_B_SLICE ) |
395 | 0 | { |
396 | 0 | return true; |
397 | 0 | } |
398 | 0 | return( (m_pcEncCfg->m_QP > 32) && ((cu.slice->TLayer >= 4) |
399 | 0 | || ((cu.refIdx[0] >= 0 && cu.refIdx[1] >= 0) |
400 | 0 | && ( abs(cu.slice->poc - cu.slice->getRefPOC(REF_PIC_LIST_0, cu.refIdx[0])) == 1 |
401 | 0 | || abs(cu.slice->poc - cu.slice->getRefPOC(REF_PIC_LIST_1, cu.refIdx[1])) == 1 |
402 | 0 | ) ) )); |
403 | 0 | } |
404 | | |
405 | | uint64_t xCalcPuMeBits ( const CodingUnit& cu); |
406 | | double xCalcDistortion ( CodingStructure *&cur_CS, ChannelType chType, int BitDepth, int imv); |
407 | | int xCheckMMVDCand ( MmvdIdx& mmvdMergeCand, int& bestDir, int tempNum, double& bestCostOffset, double& bestCostMerge, double bestCostList ); |
408 | | void xCheckRDCostIBCMode ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& pm, const EncTestMode& encTestMode ); |
409 | | void xCheckRDCostIBCModeMerge2Nx2N ( CodingStructure*& tempCS, CodingStructure*& bestCS, Partitioner& partitioner, const EncTestMode& encTestMode ); |
410 | | |
411 | | |
412 | | CodingUnit* getCuForInterPrediction ( CodingStructure* cs, const EncTestMode& encTestMode ); |
413 | | unsigned int updateRdCheckingNum ( MergeItemList&, double threshold, unsigned int numMergeSatdCand ); |
414 | | |
415 | | void generateGeoCandChroma ( CodingStructure* tempCS, Partitioner& partitioner, const EncTestMode& encTestMode, const MergeCtx& gpmMergeCtx, int mergeCand, PelUnitBuf& geoBuffer ); |
416 | | void generateMergePrediction ( const UnitArea& unitArea, MergeItem* mergeItem, CodingUnit& cu, bool luma, bool chroma, |
417 | | PelUnitBuf& dstBuf, bool finalRd, bool forceNoResidual, PelUnitBuf* predBuf1, PelUnitBuf* predBuf2 ); |
418 | | double calcLumaCost4MergePrediction( const TempCtx& ctxStart, const PelUnitBuf& predBuf, double lambda, CodingUnit& pu, DistParam& distParam, uint64_t* knownFracBits = nullptr, |
419 | | double dropCost = MAX_DOUBLE, DistParam* stopDistParam = nullptr ); |
420 | | void addRegularCandsToPruningList( const MergeCtx& mergeCtx, const UnitArea& localUnitArea, double sqrtLambdaForFirstPassIntra, |
421 | | const TempCtx& ctxStart, DistParam& distParam, CodingUnit& cu, bool* sameMv, MergeBufVector& regularPred ); |
422 | | void addCiipCandsToPruningList ( const MergeCtx& mergeCtx, const UnitArea& localUnitArea, double sqrtLambdaForFirstPassIntra, |
423 | | const TempCtx& ctxStart, DistParam& distParam, CodingUnit& cu, bool* sameMv ); |
424 | | void addMmvdCandsToPruningList ( const MergeCtx& mergeCtx, const UnitArea& localUnitArea, double sqrtLambdaForFirstPassIntra, |
425 | | const TempCtx& ctxStart, DistParam& distParam, DistParam* stopDistParam, CodingUnit& cu ); |
426 | | void addAffineCandsToPruningList ( AffineMergeCtx& affineMergeCtx, const UnitArea& localUnitArea, double sqrtLambdaForFirstPass, |
427 | | const TempCtx& ctxStart, DistParam& distParam, CodingUnit& cu ); |
428 | | void addGpmCandsToPruningList ( const MergeCtx& mergeCtx, const UnitArea& localUnitArea, double sqrtLambdaForFirstPass, |
429 | | const TempCtx& ctxStart, const GeoComboCostList& comboList, MergeBufVector& geoBuffer, DistParam& distParam, CodingUnit& cu ); |
430 | | |
431 | | bool prepareGpmComboList ( const MergeCtx& mergeCtx, const UnitArea& localUnitArea, double sqrtLambdaForFirstPass, |
432 | | GeoComboCostList& comboList, MergeBufVector& geoBuffer, CodingUnit& cu ); |
433 | | // TODO: for now skip that |
434 | | //void checkEarlySkip ( const CodingStructure* bestCS, const Partitioner &partitioner ); |
435 | | }; |
436 | | |
437 | | } // namespace vvenc |
438 | | |
439 | | //! \} |
440 | | |