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