[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 | * |
---|
[608] | 6 | * Copyright (c) 2010-2013, 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 | |
---|
[608] | 51 | #if H_3D_ARP |
---|
[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 | Bool allBordersAvailable; |
---|
| 94 | |
---|
| 95 | NDBFBlockInfo():tileID(0), sliceID(0), startSU(0), endSU(0) {} //!< constructor |
---|
| 96 | const NDBFBlockInfo& operator= (const NDBFBlockInfo& src); //!< "=" operator |
---|
| 97 | }; |
---|
| 98 | |
---|
[833] | 99 | #if H_3D_DBBP |
---|
| 100 | typedef struct _DBBPTmpData |
---|
| 101 | { |
---|
| 102 | TComMv acMvd[2][2]; // for two segments and two lists |
---|
| 103 | TComMvField acMvField[2][2]; // for two segments and two lists |
---|
| 104 | Int aiMvpNum[2][2]; // for two segments and two lists |
---|
| 105 | Int aiMvpIdx[2][2]; // for two segments and two lists |
---|
| 106 | UChar auhInterDir[2]; // for two segments |
---|
| 107 | Bool abMergeFlag[2]; // for two segments |
---|
| 108 | UChar auhMergeIndex[2]; // for two segments |
---|
| 109 | Char ahVSPFlag[2]; // for two segments |
---|
| 110 | DisInfo acDvInfo[2]; // for two segments |
---|
| 111 | |
---|
| 112 | PartSize eVirtualPartSize; |
---|
| 113 | UInt uiVirtualPartIndex; |
---|
| 114 | } DBBPTmpData; |
---|
| 115 | #endif |
---|
[56] | 116 | |
---|
| 117 | // ==================================================================================================================== |
---|
[2] | 118 | // Class definition |
---|
| 119 | // ==================================================================================================================== |
---|
| 120 | |
---|
| 121 | /// CU data structure class |
---|
| 122 | class TComDataCU |
---|
| 123 | { |
---|
| 124 | private: |
---|
| 125 | |
---|
| 126 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 127 | // class pointers |
---|
| 128 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 129 | |
---|
| 130 | TComPic* m_pcPic; ///< picture class pointer |
---|
| 131 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
| 132 | TComPattern* m_pcPattern; ///< neighbour access class pointer |
---|
| 133 | |
---|
| 134 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 135 | // CU description |
---|
| 136 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 137 | |
---|
| 138 | UInt m_uiCUAddr; ///< CU address in a slice |
---|
| 139 | UInt m_uiAbsIdxInLCU; ///< absolute address in a CU. It's Z scan order |
---|
| 140 | UInt m_uiCUPelX; ///< CU position in a pixel (X) |
---|
| 141 | UInt m_uiCUPelY; ///< CU position in a pixel (Y) |
---|
| 142 | UInt m_uiNumPartition; ///< total number of minimum partitions in a CU |
---|
| 143 | UChar* m_puhWidth; ///< array of widths |
---|
| 144 | UChar* m_puhHeight; ///< array of heights |
---|
| 145 | UChar* m_puhDepth; ///< array of depths |
---|
[56] | 146 | Int m_unitSize; ///< size of a "minimum partition" |
---|
[2] | 147 | |
---|
| 148 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 149 | // CU data |
---|
| 150 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 151 | Bool* m_skipFlag; ///< array of skip flags |
---|
[56] | 152 | Char* m_pePartSize; ///< array of partition sizes |
---|
| 153 | Char* m_pePredMode; ///< array of prediction modes |
---|
[608] | 154 | Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags |
---|
[56] | 155 | Char* m_phQP; ///< array of QP values |
---|
[2] | 156 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
[608] | 157 | UChar* m_puhTransformSkip[3];///< array of transform skipping flags |
---|
[2] | 158 | UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) |
---|
| 159 | TComCUMvField m_acCUMvField[2]; ///< array of motion vectors |
---|
| 160 | TCoeff* m_pcTrCoeffY; ///< transformed coefficient buffer (Y) |
---|
| 161 | TCoeff* m_pcTrCoeffCb; ///< transformed coefficient buffer (Cb) |
---|
| 162 | TCoeff* m_pcTrCoeffCr; ///< transformed coefficient buffer (Cr) |
---|
[56] | 163 | #if ADAPTIVE_QP_SELECTION |
---|
| 164 | Int* m_pcArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 165 | Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 166 | Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
[121] | 167 | Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d |
---|
[56] | 168 | |
---|
| 169 | static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 170 | static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 171 | static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
| 172 | #endif |
---|
[2] | 173 | |
---|
[56] | 174 | Pel* m_pcIPCMSampleY; ///< PCM sample buffer (Y) |
---|
| 175 | Pel* m_pcIPCMSampleCb; ///< PCM sample buffer (Cb) |
---|
| 176 | Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) |
---|
| 177 | |
---|
| 178 | Int* m_piSliceSUMap; ///< pointer of slice ID map |
---|
| 179 | std::vector<NDBFBlockInfo> m_vNDFBlock; |
---|
| 180 | |
---|
[2] | 181 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 182 | // neighbour access variables |
---|
| 183 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 184 | |
---|
| 185 | TComDataCU* m_pcCUAboveLeft; ///< pointer of above-left CU |
---|
| 186 | TComDataCU* m_pcCUAboveRight; ///< pointer of above-right CU |
---|
| 187 | TComDataCU* m_pcCUAbove; ///< pointer of above CU |
---|
| 188 | TComDataCU* m_pcCULeft; ///< pointer of left CU |
---|
| 189 | TComDataCU* m_apcCUColocated[2]; ///< pointer of temporally colocated CU's for both directions |
---|
| 190 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
| 191 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
| 192 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
| 193 | TComMv m_cMvPred; ///< motion vector predictor |
---|
| 194 | |
---|
| 195 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 196 | // coding tool information |
---|
| 197 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 198 | |
---|
| 199 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
| 200 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
[56] | 201 | #if AMP_MRG |
---|
| 202 | Bool m_bIsMergeAMP; |
---|
| 203 | #endif |
---|
| 204 | UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) |
---|
| 205 | UChar* m_puhChromaIntraDir; ///< array of intra directions (chroma) |
---|
| 206 | UChar* m_puhInterDir; ///< array of inter directions |
---|
| 207 | Char* m_apiMVPIdx[2]; ///< array of motion vector predictor candidates |
---|
| 208 | Char* m_apiMVPNum[2]; ///< array of number of possible motion vectors predictors |
---|
| 209 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
[608] | 210 | #if H_3D_NBDV |
---|
| 211 | DisInfo* m_pDvInfo; |
---|
[5] | 212 | #endif |
---|
[608] | 213 | #if H_3D_VSP |
---|
| 214 | Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not |
---|
| 215 | ///< 0: non-VSP; 1: VSP |
---|
| 216 | #endif |
---|
[773] | 217 | #if H_3D_SPIVMP |
---|
[724] | 218 | Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP |
---|
| 219 | ///< 0: non-SPIVMP; 1: SPIVMP |
---|
| 220 | #endif |
---|
[608] | 221 | #if H_3D_ARP |
---|
[443] | 222 | UChar* m_puhARPW; |
---|
| 223 | #endif |
---|
[608] | 224 | #if H_3D_IC |
---|
| 225 | Bool* m_pbICFlag; ///< array of IC flags |
---|
| 226 | #endif |
---|
| 227 | #if H_3D_DIM |
---|
| 228 | Pel* m_dimDeltaDC[DIM_NUM_TYPE][2]; |
---|
| 229 | #if H_3D_DIM_DMM |
---|
| 230 | UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; |
---|
| 231 | #endif |
---|
| 232 | #if H_3D_DIM_SDC |
---|
| 233 | Bool* m_pbSDCFlag; |
---|
[833] | 234 | #if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101 |
---|
| 235 | Pel* m_apSegmentDCOffset[4]; |
---|
| 236 | #else |
---|
[608] | 237 | Pel* m_apSegmentDCOffset[2]; |
---|
[100] | 238 | #endif |
---|
[608] | 239 | #endif |
---|
[833] | 240 | #endif |
---|
[655] | 241 | #if H_3D_INTER_SDC |
---|
[833] | 242 | #if !QC_SDC_UNIFY_G0130 |
---|
[608] | 243 | Bool* m_pbInterSDCFlag; |
---|
| 244 | Int* m_apSegmentInterDCOffset[4]; |
---|
[833] | 245 | #endif |
---|
| 246 | #if !SEC_INTER_SDC_G0101 |
---|
[608] | 247 | UChar* m_pucInterSDCMask; |
---|
| 248 | #endif |
---|
[833] | 249 | #endif |
---|
| 250 | #if H_3D_DBBP |
---|
| 251 | Bool* m_pbDBBPFlag; ///< array of DBBP flags |
---|
| 252 | DBBPTmpData m_sDBBPTmpData; |
---|
| 253 | #endif |
---|
[773] | 254 | #if H_3D |
---|
[724] | 255 | Bool m_bAvailableFlagA1; ///< A1 available flag |
---|
| 256 | Bool m_bAvailableFlagB1; ///< B1 available flag |
---|
| 257 | Bool m_bAvailableFlagB0; ///< B0 available flag |
---|
| 258 | Bool m_bAvailableFlagA0; ///< A0 available flag |
---|
| 259 | Bool m_bAvailableFlagB2; ///< B2 available flag |
---|
| 260 | #endif |
---|
[56] | 261 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 262 | // misc. variables |
---|
| 263 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 264 | |
---|
| 265 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
| 266 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
[608] | 267 | #if H_3D_VSO |
---|
[189] | 268 | Dist m_uiTotalDistortion; ///< sum of partition distortion |
---|
[608] | 269 | #else |
---|
| 270 | UInt m_uiTotalDistortion; ///< sum of partition distortion |
---|
| 271 | #endif |
---|
[56] | 272 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
| 273 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
[608] | 274 | UInt* m_sliceStartCU; ///< Start CU address of current slice |
---|
| 275 | UInt* m_sliceSegmentStartCU; ///< Start CU address of current slice |
---|
| 276 | Char m_codedQP; |
---|
[773] | 277 | #if H_3D |
---|
[724] | 278 | DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing |
---|
| 279 | #endif |
---|
| 280 | |
---|
[833] | 281 | #if MTK_DDD_G0063 |
---|
| 282 | UChar* m_pucDisparityDerivedDepth; |
---|
| 283 | Bool* m_pbUseDDD; |
---|
| 284 | Int m_iUseDDDCandIdx; |
---|
| 285 | UChar m_ucDDTmpDepth; |
---|
| 286 | #endif |
---|
| 287 | |
---|
[2] | 288 | protected: |
---|
| 289 | |
---|
| 290 | /// add possible motion vector predictor candidates |
---|
| 291 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 292 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
[608] | 293 | #if H_3D_VSP |
---|
[622] | 294 | Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, |
---|
[724] | 295 | Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo); |
---|
[296] | 296 | #endif |
---|
[622] | 297 | #if H_3D_IV_MERGE |
---|
| 298 | Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, |
---|
[724] | 299 | Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ); |
---|
[622] | 300 | Bool xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand ); |
---|
[443] | 301 | #endif |
---|
[608] | 302 | |
---|
| 303 | Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
[296] | 304 | Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx |
---|
[608] | 305 | #if H_3D_TMVP |
---|
[296] | 306 | , |
---|
[608] | 307 | Bool bMRG = true |
---|
[296] | 308 | #endif |
---|
| 309 | ); |
---|
[2] | 310 | |
---|
| 311 | /// compute required bits to encode MVD (used in AMVP) |
---|
| 312 | UInt xGetMvdBits ( TComMv cMvd ); |
---|
| 313 | UInt xGetComponentBits ( Int iVal ); |
---|
| 314 | |
---|
| 315 | /// compute scaling factor from POC difference |
---|
[608] | 316 | #if !H_3D_ARP |
---|
[2] | 317 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[443] | 318 | #endif |
---|
[56] | 319 | |
---|
[608] | 320 | Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
[56] | 321 | |
---|
[833] | 322 | #if NTT_STORE_SPDV_VSP_G0148 |
---|
| 323 | Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); |
---|
| 324 | #endif |
---|
| 325 | |
---|
[2] | 326 | public: |
---|
| 327 | TComDataCU(); |
---|
| 328 | virtual ~TComDataCU(); |
---|
| 329 | |
---|
| 330 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 331 | // create / destroy / initialize / copy |
---|
| 332 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 333 | #if H_3D_ARP |
---|
[443] | 334 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[608] | 335 | #endif |
---|
[56] | 336 | Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
| 337 | #if ADAPTIVE_QP_SELECTION |
---|
| 338 | , Bool bGlobalRMARLBuffer = false |
---|
| 339 | #endif |
---|
| 340 | ); |
---|
[2] | 341 | Void destroy (); |
---|
| 342 | |
---|
| 343 | Void initCU ( TComPic* pcPic, UInt uiCUAddr ); |
---|
[56] | 344 | Void initEstData ( UInt uiDepth, Int qp ); |
---|
| 345 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
| 346 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 347 | #if H_3D_NBDV |
---|
[443] | 348 | Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); |
---|
| 349 | #endif |
---|
[2] | 350 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[608] | 351 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList |
---|
| 352 | #if H_3D_NBDV |
---|
[443] | 353 | , Bool bNBDV = false |
---|
| 354 | #endif |
---|
| 355 | ); |
---|
[608] | 356 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[2] | 357 | |
---|
| 358 | Void copyToPic ( UChar uiDepth ); |
---|
| 359 | Void copyToPic ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth ); |
---|
| 360 | |
---|
| 361 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 362 | // member functions for CU description |
---|
| 363 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 364 | |
---|
| 365 | TComPic* getPic () { return m_pcPic; } |
---|
| 366 | TComSlice* getSlice () { return m_pcSlice; } |
---|
| 367 | UInt& getAddr () { return m_uiCUAddr; } |
---|
| 368 | UInt& getZorderIdxInCU () { return m_uiAbsIdxInLCU; } |
---|
[56] | 369 | UInt getSCUAddr (); |
---|
[2] | 370 | UInt getCUPelX () { return m_uiCUPelX; } |
---|
| 371 | UInt getCUPelY () { return m_uiCUPelY; } |
---|
| 372 | TComPattern* getPattern () { return m_pcPattern; } |
---|
| 373 | |
---|
| 374 | UChar* getDepth () { return m_puhDepth; } |
---|
| 375 | UChar getDepth ( UInt uiIdx ) { return m_puhDepth[uiIdx]; } |
---|
| 376 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
| 377 | |
---|
[56] | 378 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
[608] | 379 | #if H_3D |
---|
[56] | 380 | Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ); |
---|
[5] | 381 | #endif |
---|
[608] | 382 | |
---|
| 383 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 384 | // member functions for CU data |
---|
| 385 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 386 | |
---|
[56] | 387 | Char* getPartitionSize () { return m_pePartSize; } |
---|
| 388 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
[2] | 389 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
| 390 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 391 | Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 392 | |
---|
[833] | 393 | #if H_3D_DBBP |
---|
| 394 | Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); |
---|
| 395 | #endif |
---|
| 396 | |
---|
[608] | 397 | Bool* getSkipFlag () { return m_skipFlag; } |
---|
| 398 | Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } |
---|
| 399 | Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } |
---|
| 400 | Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); |
---|
| 401 | |
---|
[56] | 402 | Char* getPredictionMode () { return m_pePredMode; } |
---|
| 403 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
[608] | 404 | Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } |
---|
| 405 | Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } |
---|
[2] | 406 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
| 407 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 408 | |
---|
[833] | 409 | #if H_3D_DBBP |
---|
| 410 | Bool* getDBBPFlag () { return m_pbDBBPFlag; } |
---|
| 411 | Bool getDBBPFlag ( UInt uiIdx ) { return m_pbDBBPFlag[uiIdx]; } |
---|
| 412 | Void setDBBPFlag ( UInt uiIdx, Bool b ) { m_pbDBBPFlag[uiIdx] = b; } |
---|
| 413 | Void setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 414 | DBBPTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; } |
---|
| 415 | #endif |
---|
| 416 | |
---|
[2] | 417 | UChar* getWidth () { return m_puhWidth; } |
---|
| 418 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
| 419 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
| 420 | |
---|
| 421 | UChar* getHeight () { return m_puhHeight; } |
---|
| 422 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
| 423 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
| 424 | |
---|
| 425 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 426 | |
---|
[56] | 427 | Char* getQP () { return m_phQP; } |
---|
| 428 | Char getQP ( UInt uiIdx ) { return m_phQP[uiIdx]; } |
---|
| 429 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
| 430 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 431 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
| 432 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
[608] | 433 | Void setQPSubCUs ( Int qp, TComDataCU* pcCU, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); |
---|
| 434 | Void setCodedQP ( Char qp ) { m_codedQP = qp; } |
---|
| 435 | Char getCodedQP () { return m_codedQP; } |
---|
[56] | 436 | |
---|
| 437 | Bool isLosslessCoded(UInt absPartIdx); |
---|
[2] | 438 | |
---|
| 439 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
| 440 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
| 441 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 442 | |
---|
| 443 | UChar* getTransformSkip ( TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]];} |
---|
| 444 | UChar getTransformSkip ( UInt uiIdx,TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]][uiIdx];} |
---|
| 445 | Void setTransformSkipSubParts ( UInt useTransformSkip, TextType eType, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 446 | Void setTransformSkipSubParts ( UInt useTransformSkipY, UInt useTransformSkipU, UInt useTransformSkipV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 447 | |
---|
[56] | 448 | UInt getQuadtreeTULog2MinSizeInCU( UInt absPartIdx ); |
---|
[2] | 449 | |
---|
| 450 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
| 451 | |
---|
| 452 | TCoeff*& getCoeffY () { return m_pcTrCoeffY; } |
---|
| 453 | TCoeff*& getCoeffCb () { return m_pcTrCoeffCb; } |
---|
| 454 | TCoeff*& getCoeffCr () { return m_pcTrCoeffCr; } |
---|
[56] | 455 | #if ADAPTIVE_QP_SELECTION |
---|
| 456 | Int*& getArlCoeffY () { return m_pcArlCoeffY; } |
---|
| 457 | Int*& getArlCoeffCb () { return m_pcArlCoeffCb; } |
---|
| 458 | Int*& getArlCoeffCr () { return m_pcArlCoeffCr; } |
---|
| 459 | #endif |
---|
[2] | 460 | |
---|
[56] | 461 | Pel*& getPCMSampleY () { return m_pcIPCMSampleY; } |
---|
| 462 | Pel*& getPCMSampleCb () { return m_pcIPCMSampleCb; } |
---|
| 463 | Pel*& getPCMSampleCr () { return m_pcIPCMSampleCr; } |
---|
| 464 | |
---|
[2] | 465 | UChar getCbf ( UInt uiIdx, TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx]; } |
---|
| 466 | UChar* getCbf ( TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]]; } |
---|
| 467 | UChar getCbf ( UInt uiIdx, TextType eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
| 468 | Void setCbf ( UInt uiIdx, TextType eType, UChar uh ) { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh; } |
---|
| 469 | Void clearCbf ( UInt uiIdx, TextType eType, UInt uiNumParts ); |
---|
| 470 | UChar getQtRootCbf ( UInt uiIdx ) { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); } |
---|
| 471 | |
---|
| 472 | Void setCbfSubParts ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 473 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 474 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 475 | |
---|
| 476 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 477 | // member functions for coding tool information |
---|
| 478 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 479 | |
---|
| 480 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
| 481 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
| 482 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
| 483 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 484 | |
---|
| 485 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
| 486 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
| 487 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
| 488 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 489 | template <typename T> |
---|
| 490 | Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[622] | 491 | #if H_3D_VSP |
---|
[608] | 492 | template<typename T> |
---|
| 493 | Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[189] | 494 | #endif |
---|
[56] | 495 | #if AMP_MRG |
---|
| 496 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
| 497 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
[5] | 498 | #endif |
---|
[2] | 499 | |
---|
| 500 | UChar* getLumaIntraDir () { return m_puhLumaIntraDir; } |
---|
| 501 | UChar getLumaIntraDir ( UInt uiIdx ) { return m_puhLumaIntraDir[uiIdx]; } |
---|
| 502 | Void setLumaIntraDir ( UInt uiIdx, UChar uh ) { m_puhLumaIntraDir[uiIdx] = uh; } |
---|
| 503 | Void setLumaIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 504 | |
---|
| 505 | UChar* getChromaIntraDir () { return m_puhChromaIntraDir; } |
---|
| 506 | UChar getChromaIntraDir ( UInt uiIdx ) { return m_puhChromaIntraDir[uiIdx]; } |
---|
| 507 | Void setChromaIntraDir ( UInt uiIdx, UChar uh ) { m_puhChromaIntraDir[uiIdx] = uh; } |
---|
| 508 | Void setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 509 | |
---|
| 510 | UChar* getInterDir () { return m_puhInterDir; } |
---|
| 511 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
| 512 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
| 513 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 514 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
| 515 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
| 516 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
| 517 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 518 | #if H_3D_NBDV |
---|
| 519 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 520 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); |
---|
| 521 | DisInfo* getDvInfo () { return m_pDvInfo; } |
---|
| 522 | DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } |
---|
| 523 | #endif |
---|
[56] | 524 | /// get slice ID for SU |
---|
| 525 | Int getSUSliceID (UInt uiIdx) {return m_piSliceSUMap[uiIdx]; } |
---|
[2] | 526 | |
---|
[56] | 527 | /// get the pointer of slice ID map |
---|
| 528 | Int* getSliceSUMap () {return m_piSliceSUMap; } |
---|
[2] | 529 | |
---|
[56] | 530 | /// set the pointer of slice ID map |
---|
| 531 | Void setSliceSUMap (Int *pi) {m_piSliceSUMap = pi; } |
---|
[2] | 532 | |
---|
[56] | 533 | std::vector<NDBFBlockInfo>* getNDBFilterBlocks() {return &m_vNDFBlock;} |
---|
| 534 | Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight |
---|
[608] | 535 | ,std::vector<Bool>& LFCrossSliceBoundary |
---|
[56] | 536 | ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary |
---|
| 537 | ,Bool bIndependentTileBoundaryEnabled ); |
---|
[608] | 538 | #if H_3D_NBDV |
---|
| 539 | Void xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb ); |
---|
| 540 | Bool xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, |
---|
| 541 | UInt uiMvpDvPos |
---|
| 542 | #if H_3D_NBDV_REF |
---|
| 543 | , Bool bDepthRefine = false |
---|
| 544 | #endif |
---|
| 545 | ); |
---|
| 546 | Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); |
---|
| 547 | Bool getDisMvpCandNBDV ( DisInfo* pDInfo |
---|
| 548 | #if H_3D_NBDV_REF |
---|
| 549 | , Bool bDepthRefine = false |
---|
[189] | 550 | #endif |
---|
[608] | 551 | ); |
---|
| 552 | |
---|
[773] | 553 | #if H_3D |
---|
[724] | 554 | Void rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo* inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV); |
---|
[833] | 555 | #if SEC_DEPTH_DV_DERIVAITON_G0074 |
---|
| 556 | Bool getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); |
---|
| 557 | #else |
---|
[724] | 558 | Bool getDispNeighBlocks ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); |
---|
[833] | 559 | #endif |
---|
[724] | 560 | Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); |
---|
| 561 | #endif |
---|
| 562 | |
---|
[608] | 563 | #if H_3D_NBDV_REF |
---|
| 564 | Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); |
---|
| 565 | Void estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred ); |
---|
| 566 | #endif //H_3D_NBDV_REF |
---|
[443] | 567 | #endif |
---|
[655] | 568 | #if H_3D_FAST_TEXTURE_ENCODING |
---|
[608] | 569 | Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); |
---|
[56] | 570 | #endif |
---|
[773] | 571 | #if H_3D_SPIVMP |
---|
[724] | 572 | Void getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight); |
---|
| 573 | Void getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ); |
---|
| 574 | Void setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ); |
---|
| 575 | #endif |
---|
[608] | 576 | #if H_3D_IV_MERGE |
---|
[773] | 577 | Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth |
---|
| 578 | |
---|
| 579 | #if H_3D_SPIVMP |
---|
[724] | 580 | , TComMvField* pcMFieldSP, UChar* puhInterDirSP |
---|
| 581 | #endif |
---|
| 582 | ); |
---|
| 583 | #endif |
---|
[608] | 584 | #if H_3D_ARP |
---|
| 585 | UChar* getARPW () { return m_puhARPW; } |
---|
| 586 | UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } |
---|
| 587 | Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } |
---|
| 588 | Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 589 | Double getARPWFactor ( UInt uiIdx ); |
---|
[443] | 590 | #endif |
---|
[608] | 591 | #if H_3D_IC |
---|
| 592 | Bool* getICFlag () { return m_pbICFlag; } |
---|
| 593 | Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } |
---|
| 594 | Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } |
---|
| 595 | Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 596 | Bool isICFlagRequired ( UInt uiAbsPartIdx ); |
---|
| 597 | Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); |
---|
| 598 | #else |
---|
[2] | 599 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 600 | // member functions for accessing partition information |
---|
| 601 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 602 | |
---|
| 603 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); |
---|
[77] | 604 | #endif |
---|
[2] | 605 | UChar getNumPartInter (); |
---|
| 606 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 607 | |
---|
| 608 | #if H_3D_DIM |
---|
| 609 | Pel* getDimDeltaDC ( UInt dimType, UInt segId ) { return m_dimDeltaDC[dimType][segId]; } |
---|
| 610 | Pel getDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx ) { return m_dimDeltaDC[dimType][segId][uiIdx]; } |
---|
| 611 | Void setDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val; } |
---|
| 612 | #if H_3D_DIM_DMM |
---|
| 613 | UInt* getDmmWedgeTabIdx ( UInt dmmType ) { return m_dmmWedgeTabIdx[dmmType]; } |
---|
| 614 | UInt getDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx ) { return m_dmmWedgeTabIdx[dmmType][uiIdx]; } |
---|
| 615 | Void setDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; } |
---|
| 616 | Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 617 | |
---|
| 618 | #endif |
---|
| 619 | #if H_3D_DIM_SDC |
---|
| 620 | Bool* getSDCFlag () { return m_pbSDCFlag; } |
---|
| 621 | Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } |
---|
| 622 | Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 623 | |
---|
[608] | 624 | Bool getSDCAvailable ( UInt uiAbsPartIdx ); |
---|
| 625 | |
---|
| 626 | Pel* getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; } |
---|
| 627 | Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } |
---|
| 628 | Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } |
---|
[833] | 629 | #if QC_GENERIC_SDC_G0122 |
---|
| 630 | UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); |
---|
| 631 | UInt getCtxAngleFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 632 | #endif |
---|
| 633 | #endif |
---|
[833] | 634 | #endif |
---|
[655] | 635 | #if H_3D_INTER_SDC |
---|
[833] | 636 | #if !QC_SDC_UNIFY_G0130 |
---|
[608] | 637 | Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } |
---|
| 638 | Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } |
---|
| 639 | Void setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 640 | UInt getCtxInterSDCFlag ( UInt uiAbsPartIdx ); |
---|
| 641 | Int* getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; } |
---|
| 642 | Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; } |
---|
| 643 | Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } |
---|
| 644 | |
---|
[833] | 645 | #endif |
---|
| 646 | #if !SEC_INTER_SDC_G0101 |
---|
[608] | 647 | Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); |
---|
| 648 | |
---|
| 649 | UChar* getInterSDCMask () { return m_pucInterSDCMask; } |
---|
| 650 | #endif |
---|
[833] | 651 | #endif |
---|
[608] | 652 | |
---|
[2] | 653 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 654 | // member functions for motion vector |
---|
| 655 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 656 | |
---|
| 657 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
| 658 | |
---|
[608] | 659 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
[56] | 660 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
| 661 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
[2] | 662 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
| 663 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
[56] | 664 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
| 665 | |
---|
[2] | 666 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
| 667 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
[56] | 668 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
[2] | 669 | |
---|
| 670 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 671 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 672 | |
---|
| 673 | Void clipMv ( TComMv& rcMv ); |
---|
| 674 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
| 675 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
| 676 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
[655] | 677 | #if H_3D |
---|
| 678 | Void compressMV ( Int scale ); |
---|
[608] | 679 | #else |
---|
[2] | 680 | Void compressMV (); |
---|
[608] | 681 | #endif |
---|
[2] | 682 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 683 | // utility functions for neighbouring information |
---|
| 684 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 685 | |
---|
| 686 | TComDataCU* getCULeft () { return m_pcCULeft; } |
---|
| 687 | TComDataCU* getCUAbove () { return m_pcCUAbove; } |
---|
| 688 | TComDataCU* getCUAboveLeft () { return m_pcCUAboveLeft; } |
---|
| 689 | TComDataCU* getCUAboveRight () { return m_pcCUAboveRight; } |
---|
| 690 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
[56] | 691 | |
---|
| 692 | |
---|
[608] | 693 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, |
---|
| 694 | UInt uiCurrPartUnitIdx, |
---|
| 695 | Bool bEnforceSliceRestriction=true, |
---|
| 696 | Bool bEnforceTileRestriction=true ); |
---|
| 697 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, |
---|
| 698 | UInt uiCurrPartUnitIdx, |
---|
| 699 | Bool bEnforceSliceRestriction=true, |
---|
| 700 | Bool planarAtLCUBoundary = false, |
---|
| 701 | Bool bEnforceTileRestriction=true ); |
---|
| 702 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 703 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 704 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
[56] | 705 | |
---|
[608] | 706 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU ); |
---|
| 707 | TComDataCU* getQpMinCuAbove ( UInt& aPartUnitIdx , UInt currAbsIdxInLCU ); |
---|
[56] | 708 | Char getRefQP ( UInt uiCurrAbsIdxInLCU ); |
---|
| 709 | |
---|
[608] | 710 | TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 711 | TComDataCU* getPUBelowLeftAdi ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
[2] | 712 | |
---|
[608] | 713 | Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 714 | Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[2] | 715 | |
---|
| 716 | Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 717 | Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 718 | |
---|
| 719 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
[724] | 720 | |
---|
[773] | 721 | #if H_3D |
---|
[724] | 722 | Bool getAvailableFlagA1() { return m_bAvailableFlagA1;} |
---|
| 723 | Bool getAvailableFlagB1() { return m_bAvailableFlagB1;} |
---|
| 724 | Bool getAvailableFlagB0() { return m_bAvailableFlagB0;} |
---|
| 725 | Bool getAvailableFlagA0() { return m_bAvailableFlagA0;} |
---|
| 726 | Bool getAvailableFlagB2() { return m_bAvailableFlagB2;} |
---|
| 727 | Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } |
---|
| 728 | Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); |
---|
| 729 | Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 730 | #else |
---|
| 731 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 732 | #endif |
---|
[608] | 733 | #if H_3D_VSP |
---|
| 734 | , Int* vspFlag |
---|
| 735 | , InheritedVSPDisInfo* inheritedVSPDisInfo |
---|
[443] | 736 | #endif |
---|
[773] | 737 | #if H_3D_SPIVMP |
---|
[724] | 738 | , Bool* pbSPIVMPFlag, TComMvField* pcMvFieldSP, UChar* puhInterDirSP |
---|
| 739 | #endif |
---|
| 740 | , Int& numValidMergeCand, Int mrgCandIdx = -1 |
---|
| 741 | ); |
---|
[622] | 742 | |
---|
[608] | 743 | #if H_3D_VSP |
---|
[622] | 744 | inline Void xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo* inheritedVSPDisInfo); |
---|
| 745 | |
---|
[773] | 746 | #if H_3D_SPIVMP |
---|
[724] | 747 | Bool* getSPIVMPFlag () { return m_pbSPIVMPFlag; } |
---|
| 748 | Bool getSPIVMPFlag ( UInt uiIdx ) { return m_pbSPIVMPFlag[uiIdx]; } |
---|
| 749 | Void setSPIVMPFlag ( UInt uiIdx, Bool n ) { m_pbSPIVMPFlag[uiIdx] = n; } |
---|
| 750 | Void setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 751 | #endif |
---|
| 752 | |
---|
[608] | 753 | Char* getVSPFlag () { return m_piVSPFlag; } |
---|
| 754 | Char getVSPFlag ( UInt uiIdx ) { return m_piVSPFlag[uiIdx]; } |
---|
| 755 | Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } |
---|
| 756 | Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[833] | 757 | #if NTT_STORE_SPDV_VSP_G0148 |
---|
| 758 | Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); |
---|
[608] | 759 | #endif |
---|
[833] | 760 | #endif |
---|
[608] | 761 | Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 762 | Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[2] | 763 | |
---|
| 764 | |
---|
| 765 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 766 | // member functions for modes |
---|
| 767 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 768 | |
---|
| 769 | Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
| 770 | Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) |
---|
[608] | 771 | Bool isBipredRestriction( UInt puIdx ); |
---|
| 772 | |
---|
[773] | 773 | #if H_3D_IC |
---|
[724] | 774 | Bool isIC ( UInt uiPartIdx ); |
---|
| 775 | #endif |
---|
| 776 | |
---|
[2] | 777 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 778 | // member functions for symbol prediction (most probable / mode conversion) |
---|
| 779 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 780 | |
---|
| 781 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
| 782 | |
---|
[56] | 783 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
| 784 | Int getIntraDirLumaPredictor ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL ); |
---|
[2] | 785 | |
---|
| 786 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 787 | // member functions for SBAC context |
---|
| 788 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 789 | |
---|
| 790 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 791 | UInt getCtxQtCbf ( TextType eType, UInt uiTrDepth ); |
---|
[56] | 792 | |
---|
[2] | 793 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 794 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
| 795 | |
---|
| 796 | #if H_3D_ARP |
---|
| 797 | UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); |
---|
| 798 | #endif |
---|
[833] | 799 | #if !MTK_IC_FLAG_CABAC_SIMP_G0061 |
---|
[608] | 800 | #if H_3D_IC |
---|
[189] | 801 | UInt getCtxICFlag ( UInt uiAbsPartIdx ); |
---|
| 802 | #endif |
---|
[833] | 803 | #endif |
---|
[608] | 804 | UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
| 805 | UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
[56] | 806 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
[2] | 807 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 808 | // member functions for RD cost storage |
---|
| 809 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 810 | |
---|
| 811 | Double& getTotalCost() { return m_dTotalCost; } |
---|
[608] | 812 | #if H_3D_VSO |
---|
[189] | 813 | Dist& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
[608] | 814 | #else |
---|
| 815 | UInt& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
| 816 | #endif |
---|
[2] | 817 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
| 818 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
| 819 | |
---|
| 820 | UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); |
---|
| 821 | |
---|
[833] | 822 | #if MTK_DDD_G0063 |
---|
| 823 | UChar* getDDDepth () { return m_pucDisparityDerivedDepth; } |
---|
| 824 | UChar getDDDepth ( UInt uiIdx ) { return m_pucDisparityDerivedDepth[uiIdx]; } |
---|
| 825 | Void setDDDepth ( UInt uiIdx, UChar n ) { m_pucDisparityDerivedDepth[uiIdx] = n; } |
---|
| 826 | Void setDDDepthSubParts( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 827 | |
---|
| 828 | Bool* getUseDDD () { return m_pbUseDDD; } |
---|
| 829 | Bool getUseDDD ( UInt uiIdx ) { return m_pbUseDDD[uiIdx]; } |
---|
| 830 | Void setUseDDD ( UInt uiIdx, Bool n ) { m_pbUseDDD[uiIdx] = n; } |
---|
| 831 | Void setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 832 | |
---|
| 833 | Void setUseDDD ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 834 | |
---|
| 835 | UChar getDDTmpDepth(){ return m_ucDDTmpDepth; } |
---|
| 836 | Int getUseDDDCandIdx(){ return m_iUseDDDCandIdx;} |
---|
| 837 | |
---|
| 838 | #endif |
---|
[2] | 839 | }; |
---|
| 840 | |
---|
[56] | 841 | namespace RasterAddress |
---|
| 842 | { |
---|
| 843 | /** Check whether 2 addresses point to the same column |
---|
| 844 | * \param addrA First address in raster scan order |
---|
| 845 | * \param addrB Second address in raters scan order |
---|
| 846 | * \param numUnitsPerRow Number of units in a row |
---|
| 847 | * \return Result of test |
---|
| 848 | */ |
---|
| 849 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 850 | { |
---|
| 851 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
| 852 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 853 | } |
---|
| 854 | |
---|
| 855 | /** Check whether 2 addresses point to the same row |
---|
| 856 | * \param addrA First address in raster scan order |
---|
| 857 | * \param addrB Second address in raters scan order |
---|
| 858 | * \param numUnitsPerRow Number of units in a row |
---|
| 859 | * \return Result of test |
---|
| 860 | */ |
---|
| 861 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 862 | { |
---|
| 863 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
| 864 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 865 | } |
---|
| 866 | |
---|
| 867 | /** Check whether 2 addresses point to the same row or column |
---|
| 868 | * \param addrA First address in raster scan order |
---|
| 869 | * \param addrB Second address in raters scan order |
---|
| 870 | * \param numUnitsPerRow Number of units in a row |
---|
| 871 | * \return Result of test |
---|
| 872 | */ |
---|
| 873 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 874 | { |
---|
| 875 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
| 876 | } |
---|
| 877 | |
---|
| 878 | /** Check whether one address points to the first column |
---|
| 879 | * \param addr Address in raster scan order |
---|
| 880 | * \param numUnitsPerRow Number of units in a row |
---|
| 881 | * \return Result of test |
---|
| 882 | */ |
---|
| 883 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
| 884 | { |
---|
| 885 | // addr % numUnitsPerRow == 0 |
---|
| 886 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 887 | } |
---|
| 888 | |
---|
| 889 | /** Check whether one address points to the first row |
---|
| 890 | * \param addr Address in raster scan order |
---|
| 891 | * \param numUnitsPerRow Number of units in a row |
---|
| 892 | * \return Result of test |
---|
| 893 | */ |
---|
| 894 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
| 895 | { |
---|
| 896 | // addr / numUnitsPerRow == 0 |
---|
| 897 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 898 | } |
---|
| 899 | |
---|
| 900 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
| 901 | * \param addr Address in raster scan order |
---|
| 902 | * \param val Given column index value |
---|
| 903 | * \param numUnitsPerRow Number of units in a row |
---|
| 904 | * \return Result of test |
---|
| 905 | */ |
---|
| 906 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 907 | { |
---|
| 908 | // addr % numUnitsPerRow < val |
---|
| 909 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
| 910 | } |
---|
| 911 | |
---|
| 912 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
| 913 | * \param addr Address in raster scan order |
---|
| 914 | * \param val Given row index value |
---|
| 915 | * \param numUnitsPerRow Number of units in a row |
---|
| 916 | * \return Result of test |
---|
| 917 | */ |
---|
| 918 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 919 | { |
---|
| 920 | // addr / numUnitsPerRow < val |
---|
| 921 | return addr < val * numUnitsPerRow; |
---|
| 922 | } |
---|
| 923 | }; |
---|
| 924 | |
---|
| 925 | //! \} |
---|
| 926 | |
---|
[2] | 927 | #endif |
---|