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