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-2012, ITU/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 ITU/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 | */ |
---|
33 | |
---|
34 | /** \file TComDataCU.h |
---|
35 | \brief CU data structure (header) |
---|
36 | \todo not all entities are documented |
---|
37 | */ |
---|
38 | |
---|
39 | #ifndef _TCOMDATACU_ |
---|
40 | #define _TCOMDATACU_ |
---|
41 | |
---|
42 | #include <assert.h> |
---|
43 | |
---|
44 | // Include files |
---|
45 | #include "CommonDef.h" |
---|
46 | #include "TComMotionInfo.h" |
---|
47 | #include "TComSlice.h" |
---|
48 | #include "TComRdCost.h" |
---|
49 | #include "TComPattern.h" |
---|
50 | |
---|
51 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
52 | #include "TComYuv.h" |
---|
53 | #endif |
---|
54 | |
---|
55 | #include <algorithm> |
---|
56 | #include <vector> |
---|
57 | |
---|
58 | //! \ingroup TLibCommon |
---|
59 | //! \{ |
---|
60 | |
---|
61 | // ==================================================================================================================== |
---|
62 | // Non-deblocking in-loop filter processing block data structure |
---|
63 | // ==================================================================================================================== |
---|
64 | |
---|
65 | /// Non-deblocking filter processing block border tag |
---|
66 | enum NDBFBlockBorderTag |
---|
67 | { |
---|
68 | SGU_L = 0, |
---|
69 | SGU_R, |
---|
70 | SGU_T, |
---|
71 | SGU_B, |
---|
72 | SGU_TL, |
---|
73 | SGU_TR, |
---|
74 | SGU_BL, |
---|
75 | SGU_BR, |
---|
76 | NUM_SGU_BORDER |
---|
77 | }; |
---|
78 | |
---|
79 | /// Non-deblocking filter processing block information |
---|
80 | struct NDBFBlockInfo |
---|
81 | { |
---|
82 | Int tileID; //!< tile ID |
---|
83 | Int sliceID; //!< slice ID |
---|
84 | UInt startSU; //!< starting SU z-scan address in LCU |
---|
85 | UInt endSU; //!< ending SU z-scan address in LCU |
---|
86 | UInt widthSU; //!< number of SUs in width |
---|
87 | UInt heightSU; //!< number of SUs in height |
---|
88 | UInt posX; //!< top-left X coordinate in picture |
---|
89 | UInt posY; //!< top-left Y coordinate in picture |
---|
90 | UInt width; //!< number of pixels in width |
---|
91 | UInt height; //!< number of pixels in height |
---|
92 | Bool isBorderAvailable[NUM_SGU_BORDER]; //!< the border availabilities |
---|
93 | #if LCU_SYNTAX_ALF |
---|
94 | Bool allBordersAvailable; |
---|
95 | #endif |
---|
96 | |
---|
97 | NDBFBlockInfo():tileID(0), sliceID(0), startSU(0), endSU(0) {} //!< constructor |
---|
98 | const NDBFBlockInfo& operator= (const NDBFBlockInfo& src); //!< "=" operator |
---|
99 | }; |
---|
100 | |
---|
101 | |
---|
102 | // ==================================================================================================================== |
---|
103 | // Class definition |
---|
104 | // ==================================================================================================================== |
---|
105 | |
---|
106 | /// CU data structure class |
---|
107 | class TComDataCU |
---|
108 | { |
---|
109 | private: |
---|
110 | |
---|
111 | // ------------------------------------------------------------------------------------------------------------------- |
---|
112 | // class pointers |
---|
113 | // ------------------------------------------------------------------------------------------------------------------- |
---|
114 | |
---|
115 | TComPic* m_pcPic; ///< picture class pointer |
---|
116 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
117 | TComPattern* m_pcPattern; ///< neighbour access class pointer |
---|
118 | |
---|
119 | // ------------------------------------------------------------------------------------------------------------------- |
---|
120 | // CU description |
---|
121 | // ------------------------------------------------------------------------------------------------------------------- |
---|
122 | |
---|
123 | UInt m_uiCUAddr; ///< CU address in a slice |
---|
124 | UInt m_uiAbsIdxInLCU; ///< absolute address in a CU. It's Z scan order |
---|
125 | UInt m_uiCUPelX; ///< CU position in a pixel (X) |
---|
126 | UInt m_uiCUPelY; ///< CU position in a pixel (Y) |
---|
127 | UInt m_uiNumPartition; ///< total number of minimum partitions in a CU |
---|
128 | UChar* m_puhWidth; ///< array of widths |
---|
129 | UChar* m_puhHeight; ///< array of heights |
---|
130 | UChar* m_puhDepth; ///< array of depths |
---|
131 | Int m_unitSize; ///< size of a "minimum partition" |
---|
132 | #if HHI_MPI |
---|
133 | Int* m_piTextureModeDepth; ///< at which depth are prediction data inherited from texture picture ( -1 : none ) |
---|
134 | #endif |
---|
135 | |
---|
136 | // ------------------------------------------------------------------------------------------------------------------- |
---|
137 | // CU data |
---|
138 | // ------------------------------------------------------------------------------------------------------------------- |
---|
139 | |
---|
140 | Char* m_pePartSize; ///< array of partition sizes |
---|
141 | #if HHI_INTERVIEW_SKIP |
---|
142 | Bool* m_pbRenderable; ///< array of merge flags |
---|
143 | #endif |
---|
144 | Char* m_pePredMode; ///< array of prediction modes |
---|
145 | #if H0736_AVC_STYLE_QP_RANGE |
---|
146 | Char* m_phQP; ///< array of QP values |
---|
147 | #else |
---|
148 | UChar* m_phQP; ///< array of QP values |
---|
149 | #endif |
---|
150 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
151 | UChar* m_nsqtPartIdx; ///< array of absPartIdx mapping table, map zigzag to NSQT |
---|
152 | UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) |
---|
153 | TComCUMvField m_acCUMvField[2]; ///< array of motion vectors |
---|
154 | TCoeff* m_pcTrCoeffY; ///< transformed coefficient buffer (Y) |
---|
155 | TCoeff* m_pcTrCoeffCb; ///< transformed coefficient buffer (Cb) |
---|
156 | TCoeff* m_pcTrCoeffCr; ///< transformed coefficient buffer (Cr) |
---|
157 | #if ADAPTIVE_QP_SELECTION |
---|
158 | Int* m_pcArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
159 | Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
160 | Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
161 | |
---|
162 | static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
163 | static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
164 | static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
165 | #endif |
---|
166 | |
---|
167 | Pel* m_pcIPCMSampleY; ///< PCM sample buffer (Y) |
---|
168 | Pel* m_pcIPCMSampleCb; ///< PCM sample buffer (Cb) |
---|
169 | Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) |
---|
170 | |
---|
171 | Int* m_piSliceSUMap; ///< pointer of slice ID map |
---|
172 | std::vector<NDBFBlockInfo> m_vNDFBlock; |
---|
173 | |
---|
174 | // ------------------------------------------------------------------------------------------------------------------- |
---|
175 | // neighbour access variables |
---|
176 | // ------------------------------------------------------------------------------------------------------------------- |
---|
177 | |
---|
178 | TComDataCU* m_pcCUAboveLeft; ///< pointer of above-left CU |
---|
179 | TComDataCU* m_pcCUAboveRight; ///< pointer of above-right CU |
---|
180 | TComDataCU* m_pcCUAbove; ///< pointer of above CU |
---|
181 | TComDataCU* m_pcCULeft; ///< pointer of left CU |
---|
182 | TComDataCU* m_apcCUColocated[2]; ///< pointer of temporally colocated CU's for both directions |
---|
183 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
184 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
185 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
186 | TComMv m_cMvPred; ///< motion vector predictor |
---|
187 | |
---|
188 | // ------------------------------------------------------------------------------------------------------------------- |
---|
189 | // coding tool information |
---|
190 | // ------------------------------------------------------------------------------------------------------------------- |
---|
191 | |
---|
192 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
193 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
194 | #if AMP_MRG |
---|
195 | Bool m_bIsMergeAMP; |
---|
196 | #endif |
---|
197 | UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) |
---|
198 | UChar* m_puhChromaIntraDir; ///< array of intra directions (chroma) |
---|
199 | UChar* m_puhInterDir; ///< array of inter directions |
---|
200 | Char* m_apiMVPIdx[2]; ///< array of motion vector predictor candidates |
---|
201 | Char* m_apiMVPNum[2]; ///< array of number of possible motion vectors predictors |
---|
202 | Bool* m_puiAlfCtrlFlag; ///< array of ALF flags |
---|
203 | Bool* m_puiTmpAlfCtrlFlag; ///< temporal array of ALF flags |
---|
204 | |
---|
205 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
206 | |
---|
207 | #if BURST_IPCM |
---|
208 | Int m_numSucIPCM; ///< the number of succesive IPCM blocks associated with the current log2CUSize |
---|
209 | Bool m_lastCUSucIPCMFlag; ///< True indicates that the last CU is IPCM and shares the same root as the current CU. |
---|
210 | #endif |
---|
211 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
212 | Bool* m_pbResPredAvailable; ///< array of residual prediction available flags |
---|
213 | Bool* m_pbResPredFlag; ///< array of residual prediction flags |
---|
214 | #endif |
---|
215 | |
---|
216 | #if LGE_EDGE_INTRA |
---|
217 | UChar* m_pucEdgeCode; ///< array of edge code |
---|
218 | UChar* m_pucEdgeNumber; ///< total number of edge |
---|
219 | UChar* m_pucEdgeStartPos; ///< starting point position |
---|
220 | Bool* m_pbEdgeLeftFirst; ///< true if edge should be checked in left boundary first |
---|
221 | Bool* m_pbEdgePartition; ///< true if it belongs to region 1, otherwise, region 0 |
---|
222 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
223 | Int* m_piEdgeDeltaDC0; |
---|
224 | Int* m_piEdgeDeltaDC1; |
---|
225 | #endif |
---|
226 | #endif |
---|
227 | |
---|
228 | // ------------------------------------------------------------------------------------------------------------------- |
---|
229 | // misc. variables |
---|
230 | // ------------------------------------------------------------------------------------------------------------------- |
---|
231 | |
---|
232 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
233 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
234 | UInt m_uiTotalDistortion; ///< sum of partition distortion |
---|
235 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
236 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
237 | UInt* m_uiSliceStartCU; ///< Start CU address of current slice |
---|
238 | UInt* m_uiEntropySliceStartCU; ///< Start CU address of current slice |
---|
239 | |
---|
240 | #if OL_DEPTHLIMIT |
---|
241 | //add a variable to store the partition information |
---|
242 | //a 2D array in uidepth,part_symbol format |
---|
243 | UInt m_uiPartInfo[OL_PART_BUF_SIZE][2]; |
---|
244 | UInt m_uiPartNum; |
---|
245 | Bool b_dumpPartInfo; |
---|
246 | #endif |
---|
247 | |
---|
248 | // ------------------------------------------------------------------------------------------------------------------- |
---|
249 | // depth model mode data |
---|
250 | // ------------------------------------------------------------------------------------------------------------------- |
---|
251 | #if HHI_DMM_WEDGE_INTRA |
---|
252 | UInt* m_puiWedgeFullTabIdx; |
---|
253 | Int* m_piWedgeFullDeltaDC1; |
---|
254 | Int* m_piWedgeFullDeltaDC2; |
---|
255 | |
---|
256 | UInt* m_puiWedgePredDirTabIdx; |
---|
257 | Int* m_piWedgePredDirDeltaDC1; |
---|
258 | Int* m_piWedgePredDirDeltaDC2; |
---|
259 | Int* m_piWedgePredDirDeltaEnd; |
---|
260 | #endif |
---|
261 | #if HHI_DMM_PRED_TEX |
---|
262 | UInt* m_puiWedgePredTexTabIdx; |
---|
263 | Int* m_piWedgePredTexDeltaDC1; |
---|
264 | Int* m_piWedgePredTexDeltaDC2; |
---|
265 | |
---|
266 | Int* m_piContourPredTexDeltaDC1; |
---|
267 | Int* m_piContourPredTexDeltaDC2; |
---|
268 | #endif |
---|
269 | |
---|
270 | protected: |
---|
271 | |
---|
272 | /// add possible motion vector predictor candidates |
---|
273 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
274 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
275 | |
---|
276 | Void deriveRightBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
277 | Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); |
---|
278 | #if QC_MULTI_DIS_CAN |
---|
279 | Bool xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); |
---|
280 | #endif |
---|
281 | |
---|
282 | #if !AMVP_PRUNING_SIMPLIFICATION |
---|
283 | /// remove redundant candidates |
---|
284 | Void xUniqueMVPCand ( AMVPInfo* pInfo ); |
---|
285 | #endif |
---|
286 | |
---|
287 | Void xCheckCornerCand( TComDataCU* pcCorner, UInt uiCornerIdx, UInt uiIter, Bool& rbValidCand ); |
---|
288 | /// compute required bits to encode MVD (used in AMVP) |
---|
289 | UInt xGetMvdBits ( TComMv cMvd ); |
---|
290 | UInt xGetComponentBits ( Int iVal ); |
---|
291 | |
---|
292 | /// compute scaling factor from POC difference |
---|
293 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
294 | |
---|
295 | Void xDeriveCenterIdx( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
296 | Bool xGetCenterCol( UInt uiPartIdx, RefPicList eRefPicList, int iRefIdx, TComMv *pcMv ); |
---|
297 | |
---|
298 | Void xCheckDuplicateCand(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, bool* pbCandIsInter, UInt& ruiArrayAddr); |
---|
299 | |
---|
300 | #if !BURST_IPCM |
---|
301 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
302 | #endif |
---|
303 | |
---|
304 | public: |
---|
305 | TComDataCU(); |
---|
306 | virtual ~TComDataCU(); |
---|
307 | |
---|
308 | // ------------------------------------------------------------------------------------------------------------------- |
---|
309 | // create / destroy / initialize / copy |
---|
310 | // ------------------------------------------------------------------------------------------------------------------- |
---|
311 | |
---|
312 | Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
313 | #if ADAPTIVE_QP_SELECTION |
---|
314 | , Bool bGlobalRMARLBuffer = false |
---|
315 | #endif |
---|
316 | ); |
---|
317 | Void destroy (); |
---|
318 | |
---|
319 | Void initCU ( TComPic* pcPic, UInt uiCUAddr ); |
---|
320 | #if H0736_AVC_STYLE_QP_RANGE |
---|
321 | Void initEstData ( UInt uiDepth, Int qp ); |
---|
322 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
323 | #else |
---|
324 | Void initEstData ( UInt uiDepth, UInt uiQP ); |
---|
325 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, UInt uiQP ); |
---|
326 | #endif |
---|
327 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
328 | |
---|
329 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
330 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList ); |
---|
331 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
332 | |
---|
333 | Void copyToPic ( UChar uiDepth ); |
---|
334 | Void copyToPic ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth ); |
---|
335 | |
---|
336 | // ------------------------------------------------------------------------------------------------------------------- |
---|
337 | // member functions for CU description |
---|
338 | // ------------------------------------------------------------------------------------------------------------------- |
---|
339 | |
---|
340 | TComPic* getPic () { return m_pcPic; } |
---|
341 | TComSlice* getSlice () { return m_pcSlice; } |
---|
342 | UInt& getAddr () { return m_uiCUAddr; } |
---|
343 | UInt& getZorderIdxInCU () { return m_uiAbsIdxInLCU; } |
---|
344 | UInt getSCUAddr (); |
---|
345 | UInt getCUPelX () { return m_uiCUPelX; } |
---|
346 | UInt getCUPelY () { return m_uiCUPelY; } |
---|
347 | TComPattern* getPattern () { return m_pcPattern; } |
---|
348 | |
---|
349 | UChar* getDepth () { return m_puhDepth; } |
---|
350 | UChar getDepth ( UInt uiIdx ) { return m_puhDepth[uiIdx]; } |
---|
351 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
352 | |
---|
353 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
354 | Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ); |
---|
355 | #if HHI_MPI |
---|
356 | Int* getTextureModeDepth () { return m_piTextureModeDepth; } |
---|
357 | Int getTextureModeDepth ( UInt uiIdx ) { return m_piTextureModeDepth[uiIdx]; } |
---|
358 | Void setTextureModeDepth ( UInt uiIdx, Int iTextureModeDepth ){ m_piTextureModeDepth[uiIdx] = iTextureModeDepth; } |
---|
359 | Void setTextureModeDepthSubParts( Int iTextureModeDepth, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
360 | Void copyTextureMotionDataFrom( TComDataCU* pcCU, UInt uiDepth, UInt uiAbsPartIdxSrc, UInt uiAbsPartIdxDst = 0 ); |
---|
361 | #endif |
---|
362 | |
---|
363 | // ------------------------------------------------------------------------------------------------------------------- |
---|
364 | // member functions for CU data |
---|
365 | // ------------------------------------------------------------------------------------------------------------------- |
---|
366 | |
---|
367 | Char* getPartitionSize () { return m_pePartSize; } |
---|
368 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
369 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
370 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
371 | |
---|
372 | #if HHI_INTERVIEW_SKIP |
---|
373 | Bool* getRenderable () { return m_pbRenderable; } |
---|
374 | Bool getRenderable ( UInt uiIdx ) { return m_pbRenderable[uiIdx]; } |
---|
375 | Void setRenderable ( UInt uiIdx, Bool b ) { m_pbRenderable[uiIdx] = b; } |
---|
376 | Void setRenderableSubParts ( Bool bRenderable, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
377 | #endif |
---|
378 | |
---|
379 | Char* getPredictionMode () { return m_pePredMode; } |
---|
380 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
381 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
382 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
383 | |
---|
384 | UChar* getWidth () { return m_puhWidth; } |
---|
385 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
386 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
387 | |
---|
388 | UChar* getHeight () { return m_puhHeight; } |
---|
389 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
390 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
391 | |
---|
392 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
393 | |
---|
394 | #if H0736_AVC_STYLE_QP_RANGE |
---|
395 | Char* getQP () { return m_phQP; } |
---|
396 | Char getQP ( UInt uiIdx ) { return m_phQP[uiIdx]; } |
---|
397 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
398 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
399 | #if BURST_IPCM |
---|
400 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
401 | #endif |
---|
402 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
403 | #else |
---|
404 | UChar* getQP () { return m_phQP; } |
---|
405 | UChar getQP ( UInt uiIdx ) { return m_phQP[uiIdx]; } |
---|
406 | Void setQP ( UInt uiIdx, UChar uh ) { m_phQP[uiIdx] = uh; } |
---|
407 | Void setQPSubParts ( UInt uiQP, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
408 | #if BURST_IPCM |
---|
409 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
410 | #endif |
---|
411 | UChar getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
412 | #endif |
---|
413 | |
---|
414 | #if LOSSLESS_CODING |
---|
415 | Bool isLosslessCoded(UInt absPartIdx); |
---|
416 | #endif |
---|
417 | UChar* getNSQTPartIdx () { return m_nsqtPartIdx; } |
---|
418 | UChar getNSQTPartIdx ( UInt idx ) { return m_nsqtPartIdx[idx]; } |
---|
419 | Void setNSQTIdxSubParts ( UInt absPartIdx, UInt depth ); |
---|
420 | Void setNSQTIdxSubParts ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt trMode ); |
---|
421 | |
---|
422 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
423 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
424 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
425 | |
---|
426 | UInt getQuadtreeTULog2MinSizeInCU( UInt absPartIdx ); |
---|
427 | |
---|
428 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
429 | |
---|
430 | TCoeff*& getCoeffY () { return m_pcTrCoeffY; } |
---|
431 | TCoeff*& getCoeffCb () { return m_pcTrCoeffCb; } |
---|
432 | TCoeff*& getCoeffCr () { return m_pcTrCoeffCr; } |
---|
433 | #if ADAPTIVE_QP_SELECTION |
---|
434 | Int*& getArlCoeffY () { return m_pcArlCoeffY; } |
---|
435 | Int*& getArlCoeffCb () { return m_pcArlCoeffCb; } |
---|
436 | Int*& getArlCoeffCr () { return m_pcArlCoeffCr; } |
---|
437 | #endif |
---|
438 | |
---|
439 | Pel*& getPCMSampleY () { return m_pcIPCMSampleY; } |
---|
440 | Pel*& getPCMSampleCb () { return m_pcIPCMSampleCb; } |
---|
441 | Pel*& getPCMSampleCr () { return m_pcIPCMSampleCr; } |
---|
442 | |
---|
443 | UChar getCbf ( UInt uiIdx, TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx]; } |
---|
444 | UChar* getCbf ( TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]]; } |
---|
445 | UChar getCbf ( UInt uiIdx, TextType eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
446 | Void setCbf ( UInt uiIdx, TextType eType, UChar uh ) { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh; } |
---|
447 | Void clearCbf ( UInt uiIdx, TextType eType, UInt uiNumParts ); |
---|
448 | UChar getQtRootCbf ( UInt uiIdx ) { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); } |
---|
449 | |
---|
450 | Void setCbfSubParts ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
451 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
452 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
453 | |
---|
454 | // ------------------------------------------------------------------------------------------------------------------- |
---|
455 | // member functions for coding tool information |
---|
456 | // ------------------------------------------------------------------------------------------------------------------- |
---|
457 | |
---|
458 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
459 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
460 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
461 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
462 | |
---|
463 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
464 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
465 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
466 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
467 | template <typename T> |
---|
468 | Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
469 | |
---|
470 | #if AMP_MRG |
---|
471 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
472 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
473 | #endif |
---|
474 | |
---|
475 | UChar* getLumaIntraDir () { return m_puhLumaIntraDir; } |
---|
476 | UChar getLumaIntraDir ( UInt uiIdx ) { return m_puhLumaIntraDir[uiIdx]; } |
---|
477 | Void setLumaIntraDir ( UInt uiIdx, UChar uh ) { m_puhLumaIntraDir[uiIdx] = uh; } |
---|
478 | Void setLumaIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
479 | |
---|
480 | UChar* getChromaIntraDir () { return m_puhChromaIntraDir; } |
---|
481 | UChar getChromaIntraDir ( UInt uiIdx ) { return m_puhChromaIntraDir[uiIdx]; } |
---|
482 | Void setChromaIntraDir ( UInt uiIdx, UChar uh ) { m_puhChromaIntraDir[uiIdx] = uh; } |
---|
483 | Void setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
484 | |
---|
485 | UChar* getInterDir () { return m_puhInterDir; } |
---|
486 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
487 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
488 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
489 | |
---|
490 | Bool* getAlfCtrlFlag () { return m_puiAlfCtrlFlag; } |
---|
491 | Bool getAlfCtrlFlag ( UInt uiIdx ) { return m_puiAlfCtrlFlag[uiIdx]; } |
---|
492 | Void setAlfCtrlFlag ( UInt uiIdx, Bool uiFlag){ m_puiAlfCtrlFlag[uiIdx] = uiFlag; } |
---|
493 | Void setAlfCtrlFlagSubParts( Bool uiFlag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
494 | |
---|
495 | Void createTmpAlfCtrlFlag (); |
---|
496 | Void destroyTmpAlfCtrlFlag (); |
---|
497 | Void copyAlfCtrlFlagToTmp (); |
---|
498 | Void copyAlfCtrlFlagFromTmp(); |
---|
499 | |
---|
500 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
501 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
502 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
503 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
504 | |
---|
505 | #if BURST_IPCM |
---|
506 | Int getNumSucIPCM () { return m_numSucIPCM; } |
---|
507 | Void setNumSucIPCM ( Int num ) { m_numSucIPCM = num; } |
---|
508 | Bool getLastCUSucIPCMFlag () { return m_lastCUSucIPCMFlag; } |
---|
509 | Void setLastCUSucIPCMFlag ( Bool flg ) { m_lastCUSucIPCMFlag = flg; } |
---|
510 | #endif |
---|
511 | |
---|
512 | /// get slice ID for SU |
---|
513 | Int getSUSliceID (UInt uiIdx) {return m_piSliceSUMap[uiIdx]; } |
---|
514 | |
---|
515 | /// get the pointer of slice ID map |
---|
516 | Int* getSliceSUMap () {return m_piSliceSUMap; } |
---|
517 | |
---|
518 | /// set the pointer of slice ID map |
---|
519 | Void setSliceSUMap (Int *pi) {m_piSliceSUMap = pi; } |
---|
520 | |
---|
521 | std::vector<NDBFBlockInfo>* getNDBFilterBlocks() {return &m_vNDFBlock;} |
---|
522 | Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight |
---|
523 | ,Bool bIndependentSliceBoundaryEnabled |
---|
524 | ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary |
---|
525 | ,Bool bIndependentTileBoundaryEnabled ); |
---|
526 | |
---|
527 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
528 | #if !QC_MULTI_DIS_CAN |
---|
529 | Int getPdmMergeCandidate( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv ); |
---|
530 | Bool getPdmMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false ); |
---|
531 | #else |
---|
532 | Bool getPdmMvPredDisCan( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, DisInfo* pDInfo, Bool bMerge = false ); |
---|
533 | Int getPdmMergeCandidateDisCan( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo ); |
---|
534 | Void getDisMvpCand ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo ); |
---|
535 | #if LGE_DVMCP |
---|
536 | Void getDisMvpCand2( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo, Bool bMerge=false, RefPicList eRefPicList=REF_PIC_LIST_X, Int iRefIdx=-1 ); |
---|
537 | #endif |
---|
538 | |
---|
539 | #endif |
---|
540 | Bool getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv ); |
---|
541 | #endif |
---|
542 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
543 | Bool* getResPredAvail () { return m_pbResPredAvailable; } |
---|
544 | Bool getResPredAvail ( UInt uiIdx ) { return m_pbResPredAvailable[uiIdx]; } |
---|
545 | Void setResPredAvail ( UInt uiIdx, Bool b ) { m_pbResPredAvailable[uiIdx] = b; } |
---|
546 | Void setResPredAvailSubParts ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
547 | |
---|
548 | Bool* getResPredFlag () { return m_pbResPredFlag; } |
---|
549 | Bool getResPredFlag ( UInt uiIdx ) { return m_pbResPredFlag[uiIdx]; } |
---|
550 | Void setResPredFlag ( UInt uiIdx, Bool b ) { m_pbResPredFlag[uiIdx] = b; } |
---|
551 | Void setResPredFlagSubParts ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
552 | |
---|
553 | Void setResPredIndicator ( Bool bAv, Bool bRP ) { m_pbResPredAvailable[0] = bAv; m_pbResPredFlag[0] = bRP; } |
---|
554 | #endif |
---|
555 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
556 | Bool getResidualSamples( UInt uiPartIdx, |
---|
557 | #if QC_SIMPLIFIEDIVRP_M24938 |
---|
558 | Bool bRecon , |
---|
559 | #endif |
---|
560 | TComYuv* pcYuv = 0 ); |
---|
561 | #endif |
---|
562 | // ------------------------------------------------------------------------------------------------------------------- |
---|
563 | // member functions for accessing partition information |
---|
564 | // ------------------------------------------------------------------------------------------------------------------- |
---|
565 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
566 | Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); |
---|
567 | #else |
---|
568 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); |
---|
569 | #endif |
---|
570 | #if LG_RESTRICTEDRESPRED_M24766 |
---|
571 | Int getResiPredMode(UInt uiPartAddr); |
---|
572 | Void getPUResiPredShift (Int *iPUPredResiShift, UInt uiAbsPartIndex); |
---|
573 | #endif |
---|
574 | UChar getNumPartInter (); |
---|
575 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
576 | |
---|
577 | // ------------------------------------------------------------------------------------------------------------------- |
---|
578 | // member functions for motion vector |
---|
579 | // ------------------------------------------------------------------------------------------------------------------- |
---|
580 | |
---|
581 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
582 | |
---|
583 | AMVP_MODE getAMVPMode ( UInt uiIdx ); |
---|
584 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
585 | #if PARALLEL_MERGE |
---|
586 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
587 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
588 | #endif |
---|
589 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
590 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
591 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
592 | |
---|
593 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
594 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
595 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
596 | |
---|
597 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
598 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
599 | |
---|
600 | Void clipMv ( TComMv& rcMv ); |
---|
601 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
602 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
603 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
604 | |
---|
605 | Void compressMV (); |
---|
606 | |
---|
607 | #if OL_DEPTHLIMIT |
---|
608 | Void resetPartInfo () {m_uiPartNum = 0;}; |
---|
609 | Void incrementPartInfo () {m_uiPartNum ++;}; |
---|
610 | Void updatePartInfo(UInt uiSymbol, UInt uiDepth) {m_uiPartInfo[m_uiPartNum][0] = uiSymbol; m_uiPartInfo |
---|
611 | [m_uiPartNum][1] = uiDepth;}; |
---|
612 | UInt* readPartInfo() {return (UInt*)m_uiPartInfo;}; |
---|
613 | // UInt getPartNumIdx() {return m_uiPartNum;}; //added this to get the index |
---|
614 | //flag to signal to start dumping |
---|
615 | Void setPartDumpFlag(bool flag) {b_dumpPartInfo = flag;}; |
---|
616 | Bool getPartDumpFlag() {return b_dumpPartInfo;}; |
---|
617 | #endif |
---|
618 | |
---|
619 | // ------------------------------------------------------------------------------------------------------------------- |
---|
620 | // utility functions for neighbouring information |
---|
621 | // ------------------------------------------------------------------------------------------------------------------- |
---|
622 | |
---|
623 | TComDataCU* getCULeft () { return m_pcCULeft; } |
---|
624 | TComDataCU* getCUAbove () { return m_pcCUAbove; } |
---|
625 | TComDataCU* getCUAboveLeft () { return m_pcCUAboveLeft; } |
---|
626 | TComDataCU* getCUAboveRight () { return m_pcCUAboveRight; } |
---|
627 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
628 | |
---|
629 | |
---|
630 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true |
---|
631 | , Bool bEnforceTileRestriction=true |
---|
632 | ); |
---|
633 | |
---|
634 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false |
---|
635 | , Bool planarAtLCUBoundary = false |
---|
636 | , Bool bEnforceTileRestriction=true |
---|
637 | ); |
---|
638 | |
---|
639 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false ); |
---|
640 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false ); |
---|
641 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true ); |
---|
642 | |
---|
643 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true ); |
---|
644 | #if H0204_QP_PREDICTION |
---|
645 | TComDataCU* getQpMinCuAbove ( UInt& aPartUnitIdx , UInt currAbsIdxInLCU, Bool enforceSliceRestriction=true, Bool enforceEntropySliceRestriction=true ); |
---|
646 | #endif |
---|
647 | #if H0736_AVC_STYLE_QP_RANGE |
---|
648 | Char getRefQP ( UInt uiCurrAbsIdxInLCU ); |
---|
649 | #else |
---|
650 | UChar getRefQP ( UInt uiCurrAbsIdxInLCU ); |
---|
651 | #endif |
---|
652 | |
---|
653 | TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiPuWidth, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true ); |
---|
654 | TComDataCU* getPUBelowLeftAdi ( UInt& uiBLPartUnitIdx, UInt uiPuHeight, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true ); |
---|
655 | |
---|
656 | Void deriveLeftRightTopIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
657 | Void deriveLeftBottomIdx ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
658 | |
---|
659 | Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); |
---|
660 | Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); |
---|
661 | |
---|
662 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
663 | #if SIMP_MRG_PRUN |
---|
664 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); |
---|
665 | #else |
---|
666 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand ); |
---|
667 | #endif |
---|
668 | Void deriveLeftRightTopIdxGeneral ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
669 | Void deriveLeftBottomIdxGeneral ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
670 | |
---|
671 | |
---|
672 | // ------------------------------------------------------------------------------------------------------------------- |
---|
673 | // member functions for modes |
---|
674 | // ------------------------------------------------------------------------------------------------------------------- |
---|
675 | |
---|
676 | Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
677 | Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) |
---|
678 | |
---|
679 | // ------------------------------------------------------------------------------------------------------------------- |
---|
680 | // member functions for symbol prediction (most probable / mode conversion) |
---|
681 | // ------------------------------------------------------------------------------------------------------------------- |
---|
682 | |
---|
683 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
684 | Void convertTransIdx ( UInt uiAbsPartIdx, UInt uiTrIdx, UInt& ruiLumaTrMode, UInt& ruiChromaTrMode ); |
---|
685 | |
---|
686 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
687 | Int getIntraDirLumaPredictor ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL ); |
---|
688 | |
---|
689 | // ------------------------------------------------------------------------------------------------------------------- |
---|
690 | // member functions for SBAC context |
---|
691 | // ------------------------------------------------------------------------------------------------------------------- |
---|
692 | |
---|
693 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
694 | UInt getCtxQtCbf ( UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); |
---|
695 | |
---|
696 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
697 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
698 | |
---|
699 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
700 | UInt getCtxResPredFlag ( UInt uiAbsPartIdx ); |
---|
701 | #endif |
---|
702 | |
---|
703 | UInt getSliceStartCU ( UInt pos ) { return m_uiSliceStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
704 | UInt getEntropySliceStartCU ( UInt pos ) { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
705 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
706 | |
---|
707 | #if LGE_EDGE_INTRA |
---|
708 | UInt getCtxEdgeIntra ( UInt uiAbsPartIdx ); |
---|
709 | #endif |
---|
710 | |
---|
711 | // ------------------------------------------------------------------------------------------------------------------- |
---|
712 | // member functions for RD cost storage |
---|
713 | // ------------------------------------------------------------------------------------------------------------------- |
---|
714 | |
---|
715 | Double& getTotalCost() { return m_dTotalCost; } |
---|
716 | UInt& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
717 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
718 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
719 | |
---|
720 | UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); |
---|
721 | |
---|
722 | Bool useNonSquareTrans( UInt uiTrMode, Int absPartIdx ); |
---|
723 | Void getNSQTSize(Int trMode, Int absPartIdx, Int &trWidth, Int &trHeight); |
---|
724 | Bool useNonSquarePU ( UInt absPartIdx); |
---|
725 | UInt getInterTUSplitDirection ( Int width, Int height, Int trLastWidth, Int trLastHeight ); |
---|
726 | UInt getNSAbsPartIdx ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt innerQuadIdx, UInt trMode ); |
---|
727 | UInt getNSAddrChroma ( UInt uiLog2TrSizeC, UInt uiTrModeC, UInt uiQuadrant, UInt absTUPartIdx ); |
---|
728 | |
---|
729 | // ------------------------------------------------------------------------------------------------------------------- |
---|
730 | // member functions for depth model modes |
---|
731 | // ------------------------------------------------------------------------------------------------------------------- |
---|
732 | #if HHI_DMM_WEDGE_INTRA |
---|
733 | UInt* getWedgeFullTabIdx () { return m_puiWedgeFullTabIdx; } |
---|
734 | UInt getWedgeFullTabIdx ( UInt uiIdx ) { return m_puiWedgeFullTabIdx[uiIdx]; } |
---|
735 | Void setWedgeFullTabIdx ( UInt uiIdx, UInt uh ) { m_puiWedgeFullTabIdx[uiIdx] = uh; } |
---|
736 | Void setWedgeFullTabIdxSubParts ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
737 | Int* getWedgeFullDeltaDC1 () { return m_piWedgeFullDeltaDC1; } |
---|
738 | Int getWedgeFullDeltaDC1 ( UInt uiIdx ) { return m_piWedgeFullDeltaDC1[uiIdx]; } |
---|
739 | Void setWedgeFullDeltaDC1 ( UInt uiIdx, Int i ) { m_piWedgeFullDeltaDC1[uiIdx] = i; } |
---|
740 | Void setWedgeFullDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
741 | Int* getWedgeFullDeltaDC2 () { return m_piWedgeFullDeltaDC2; } |
---|
742 | Int getWedgeFullDeltaDC2 ( UInt uiIdx ) { return m_piWedgeFullDeltaDC2[uiIdx]; } |
---|
743 | Void setWedgeFullDeltaDC2 ( UInt uiIdx, Int i ) { m_piWedgeFullDeltaDC2[uiIdx] = i; } |
---|
744 | Void setWedgeFullDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
745 | |
---|
746 | UInt* getWedgePredDirTabIdx () { return m_puiWedgePredDirTabIdx; } |
---|
747 | UInt getWedgePredDirTabIdx ( UInt uiIdx ) { return m_puiWedgePredDirTabIdx[uiIdx]; } |
---|
748 | Void setWedgePredDirTabIdx ( UInt uiIdx, UInt uh ) { m_puiWedgePredDirTabIdx[uiIdx] = uh; } |
---|
749 | Void setWedgePredDirTabIdxSubParts ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
750 | Int* getWedgePredDirDeltaDC1 () { return m_piWedgePredDirDeltaDC1; } |
---|
751 | Int getWedgePredDirDeltaDC1 ( UInt uiIdx ) { return m_piWedgePredDirDeltaDC1[uiIdx]; } |
---|
752 | Void setWedgePredDirDeltaDC1 ( UInt uiIdx, Int i ) { m_piWedgePredDirDeltaDC1[uiIdx] = i; } |
---|
753 | Void setWedgePredDirDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
754 | Int* getWedgePredDirDeltaDC2 () { return m_piWedgePredDirDeltaDC2; } |
---|
755 | Int getWedgePredDirDeltaDC2 ( UInt uiIdx ) { return m_piWedgePredDirDeltaDC2[uiIdx]; } |
---|
756 | Void setWedgePredDirDeltaDC2 ( UInt uiIdx, Int i ) { m_piWedgePredDirDeltaDC2[uiIdx] = i; } |
---|
757 | Void setWedgePredDirDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
758 | Int* getWedgePredDirDeltaEnd () { return m_piWedgePredDirDeltaEnd; } |
---|
759 | Int getWedgePredDirDeltaEnd ( UInt uiIdx ) { return m_piWedgePredDirDeltaEnd[uiIdx]; } |
---|
760 | Void setWedgePredDirDeltaEnd ( UInt uiIdx, Int iD ) { m_piWedgePredDirDeltaEnd[uiIdx] = iD; } |
---|
761 | Void setWedgePredDirDeltaEndSubParts ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
762 | #endif |
---|
763 | #if HHI_DMM_PRED_TEX |
---|
764 | UInt* getWedgePredTexTabIdx () { return m_puiWedgePredTexTabIdx; } |
---|
765 | UInt getWedgePredTexTabIdx ( UInt uiIdx ) { return m_puiWedgePredTexTabIdx[uiIdx]; } |
---|
766 | Void setWedgePredTexTabIdx ( UInt uiIdx, UInt uh ) { m_puiWedgePredTexTabIdx[uiIdx] = uh; } |
---|
767 | Void setWedgePredTexTabIdxSubParts ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
768 | Int* getWedgePredTexDeltaDC1 () { return m_piWedgePredTexDeltaDC1; } |
---|
769 | Int getWedgePredTexDeltaDC1 ( UInt uiIdx ) { return m_piWedgePredTexDeltaDC1[uiIdx]; } |
---|
770 | Void setWedgePredTexDeltaDC1 ( UInt uiIdx, Int i ) { m_piWedgePredTexDeltaDC1[uiIdx] = i; } |
---|
771 | Void setWedgePredTexDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
772 | Int* getWedgePredTexDeltaDC2 () { return m_piWedgePredTexDeltaDC2; } |
---|
773 | Int getWedgePredTexDeltaDC2 ( UInt uiIdx ) { return m_piWedgePredTexDeltaDC2[uiIdx]; } |
---|
774 | Void setWedgePredTexDeltaDC2 ( UInt uiIdx, Int i ) { m_piWedgePredTexDeltaDC2[uiIdx] = i; } |
---|
775 | Void setWedgePredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
776 | |
---|
777 | Int* getContourPredTexDeltaDC1 () { return m_piContourPredTexDeltaDC1; } |
---|
778 | Int getContourPredTexDeltaDC1 ( UInt uiIdx ) { return m_piContourPredTexDeltaDC1[uiIdx]; } |
---|
779 | Void setContourPredTexDeltaDC1 ( UInt uiIdx, Int i ) { m_piContourPredTexDeltaDC1[uiIdx] = i; } |
---|
780 | Void setContourPredTexDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
781 | Int* getContourPredTexDeltaDC2 () { return m_piContourPredTexDeltaDC2; } |
---|
782 | Int getContourPredTexDeltaDC2 ( UInt uiIdx ) { return m_piContourPredTexDeltaDC2[uiIdx]; } |
---|
783 | Void setContourPredTexDeltaDC2 ( UInt uiIdx, Int i ) { m_piContourPredTexDeltaDC2[uiIdx] = i; } |
---|
784 | Void setContourPredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
785 | #endif |
---|
786 | |
---|
787 | #if LGE_EDGE_INTRA |
---|
788 | UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; } |
---|
789 | UChar* getEdgeNumber( ) { return m_pucEdgeNumber; } |
---|
790 | UChar getEdgeNumber( UInt uiIdx ) { return m_pucEdgeNumber[uiIdx]; } |
---|
791 | Void setEdgeNumber( UInt uiIdx, UChar val ) { m_pucEdgeNumber[uiIdx] = val; } |
---|
792 | UChar* getEdgeStartPos( ) { return m_pucEdgeStartPos; } |
---|
793 | UChar getEdgeStartPos( UInt uiIdx ) { return m_pucEdgeStartPos[uiIdx]; } |
---|
794 | Void setEdgeStartPos( UInt uiIdx, UChar val ) { m_pucEdgeStartPos[uiIdx] = val; } |
---|
795 | Bool* getEdgeLeftFirst( ) { return m_pbEdgeLeftFirst; } |
---|
796 | Bool getEdgeLeftFirst( UInt uiIdx ) { return m_pbEdgeLeftFirst[uiIdx]; } |
---|
797 | Void setEdgeLeftFirst( UInt uiIdx, Bool val ) { m_pbEdgeLeftFirst[uiIdx] = val; } |
---|
798 | Bool* getEdgePartition( UInt uiIdx ) { return &m_pbEdgePartition[uiIdx * 16]; } |
---|
799 | Void reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ); |
---|
800 | |
---|
801 | #if LGE_EDGE_INTRA_DELTA_DC |
---|
802 | Int* getEdgeDeltaDC0( ) { return m_piEdgeDeltaDC0; } |
---|
803 | Int* getEdgeDeltaDC1( ) { return m_piEdgeDeltaDC1; } |
---|
804 | Int getEdgeDeltaDC0( UInt uiIdx ) { return m_piEdgeDeltaDC0[uiIdx]; } |
---|
805 | Int getEdgeDeltaDC1( UInt uiIdx ) { return m_piEdgeDeltaDC1[uiIdx]; } |
---|
806 | Void setEdgeDeltaDC0( UInt uiIdx, Int val ) { m_piEdgeDeltaDC0[uiIdx] = val; } |
---|
807 | Void setEdgeDeltaDC1( UInt uiIdx, Int val ) { m_piEdgeDeltaDC1[uiIdx] = val; } |
---|
808 | #endif |
---|
809 | #endif |
---|
810 | }; |
---|
811 | |
---|
812 | namespace RasterAddress |
---|
813 | { |
---|
814 | /** Check whether 2 addresses point to the same column |
---|
815 | * \param addrA First address in raster scan order |
---|
816 | * \param addrB Second address in raters scan order |
---|
817 | * \param numUnitsPerRow Number of units in a row |
---|
818 | * \return Result of test |
---|
819 | */ |
---|
820 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
821 | { |
---|
822 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
823 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
824 | } |
---|
825 | |
---|
826 | /** Check whether 2 addresses point to the same row |
---|
827 | * \param addrA First address in raster scan order |
---|
828 | * \param addrB Second address in raters scan order |
---|
829 | * \param numUnitsPerRow Number of units in a row |
---|
830 | * \return Result of test |
---|
831 | */ |
---|
832 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
833 | { |
---|
834 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
835 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
836 | } |
---|
837 | |
---|
838 | /** Check whether 2 addresses point to the same row or column |
---|
839 | * \param addrA First address in raster scan order |
---|
840 | * \param addrB Second address in raters scan order |
---|
841 | * \param numUnitsPerRow Number of units in a row |
---|
842 | * \return Result of test |
---|
843 | */ |
---|
844 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
845 | { |
---|
846 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
847 | } |
---|
848 | |
---|
849 | /** Check whether one address points to the first column |
---|
850 | * \param addr Address in raster scan order |
---|
851 | * \param numUnitsPerRow Number of units in a row |
---|
852 | * \return Result of test |
---|
853 | */ |
---|
854 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
855 | { |
---|
856 | // addr % numUnitsPerRow == 0 |
---|
857 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
858 | } |
---|
859 | |
---|
860 | /** Check whether one address points to the first row |
---|
861 | * \param addr Address in raster scan order |
---|
862 | * \param numUnitsPerRow Number of units in a row |
---|
863 | * \return Result of test |
---|
864 | */ |
---|
865 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
866 | { |
---|
867 | // addr / numUnitsPerRow == 0 |
---|
868 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
869 | } |
---|
870 | |
---|
871 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
872 | * \param addr Address in raster scan order |
---|
873 | * \param val Given column index value |
---|
874 | * \param numUnitsPerRow Number of units in a row |
---|
875 | * \return Result of test |
---|
876 | */ |
---|
877 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
878 | { |
---|
879 | // addr % numUnitsPerRow < val |
---|
880 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
881 | } |
---|
882 | |
---|
883 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
884 | * \param addr Address in raster scan order |
---|
885 | * \param val Given row index value |
---|
886 | * \param numUnitsPerRow Number of units in a row |
---|
887 | * \return Result of test |
---|
888 | */ |
---|
889 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
890 | { |
---|
891 | // addr / numUnitsPerRow < val |
---|
892 | return addr < val * numUnitsPerRow; |
---|
893 | } |
---|
894 | }; |
---|
895 | |
---|
896 | //! \} |
---|
897 | |
---|
898 | #endif |
---|