[313] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2013, ITU/ISO/IEC |
---|
| 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | /** \file TComDataCU.h |
---|
| 35 | \brief CU data structure (header) |
---|
| 36 | \todo not all entities are documented |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #ifndef _TCOMDATACU_ |
---|
| 40 | #define _TCOMDATACU_ |
---|
| 41 | |
---|
| 42 | #include <assert.h> |
---|
| 43 | |
---|
| 44 | // Include files |
---|
| 45 | #include "CommonDef.h" |
---|
| 46 | #include "TComMotionInfo.h" |
---|
| 47 | #include "TComSlice.h" |
---|
| 48 | #include "TComRdCost.h" |
---|
| 49 | #include "TComPattern.h" |
---|
| 50 | |
---|
| 51 | #include <algorithm> |
---|
| 52 | #include <vector> |
---|
| 53 | |
---|
| 54 | //! \ingroup TLibCommon |
---|
| 55 | //! \{ |
---|
| 56 | |
---|
| 57 | // ==================================================================================================================== |
---|
| 58 | // Non-deblocking in-loop filter processing block data structure |
---|
| 59 | // ==================================================================================================================== |
---|
| 60 | |
---|
| 61 | /// Non-deblocking filter processing block border tag |
---|
| 62 | enum NDBFBlockBorderTag |
---|
| 63 | { |
---|
| 64 | SGU_L = 0, |
---|
| 65 | SGU_R, |
---|
| 66 | SGU_T, |
---|
| 67 | SGU_B, |
---|
| 68 | SGU_TL, |
---|
| 69 | SGU_TR, |
---|
| 70 | SGU_BL, |
---|
| 71 | SGU_BR, |
---|
| 72 | NUM_SGU_BORDER |
---|
| 73 | }; |
---|
| 74 | |
---|
| 75 | /// Non-deblocking filter processing block information |
---|
| 76 | struct NDBFBlockInfo |
---|
| 77 | { |
---|
| 78 | Int tileID; //!< tile ID |
---|
| 79 | Int sliceID; //!< slice ID |
---|
| 80 | UInt startSU; //!< starting SU z-scan address in LCU |
---|
| 81 | UInt endSU; //!< ending SU z-scan address in LCU |
---|
| 82 | UInt widthSU; //!< number of SUs in width |
---|
| 83 | UInt heightSU; //!< number of SUs in height |
---|
| 84 | UInt posX; //!< top-left X coordinate in picture |
---|
| 85 | UInt posY; //!< top-left Y coordinate in picture |
---|
| 86 | UInt width; //!< number of pixels in width |
---|
| 87 | UInt height; //!< number of pixels in height |
---|
| 88 | Bool isBorderAvailable[NUM_SGU_BORDER]; //!< the border availabilities |
---|
| 89 | Bool allBordersAvailable; |
---|
| 90 | |
---|
| 91 | NDBFBlockInfo():tileID(0), sliceID(0), startSU(0), endSU(0) {} //!< constructor |
---|
| 92 | const NDBFBlockInfo& operator= (const NDBFBlockInfo& src); //!< "=" operator |
---|
| 93 | }; |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | // ==================================================================================================================== |
---|
| 97 | // Class definition |
---|
| 98 | // ==================================================================================================================== |
---|
| 99 | |
---|
| 100 | /// CU data structure class |
---|
| 101 | class TComDataCU |
---|
| 102 | { |
---|
| 103 | private: |
---|
| 104 | |
---|
| 105 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 106 | // class pointers |
---|
| 107 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 108 | |
---|
| 109 | TComPic* m_pcPic; ///< picture class pointer |
---|
| 110 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
| 111 | TComPattern* m_pcPattern; ///< neighbour access class pointer |
---|
| 112 | |
---|
| 113 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 114 | // CU description |
---|
| 115 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 116 | |
---|
| 117 | UInt m_uiCUAddr; ///< CU address in a slice |
---|
| 118 | UInt m_uiAbsIdxInLCU; ///< absolute address in a CU. It's Z scan order |
---|
| 119 | UInt m_uiCUPelX; ///< CU position in a pixel (X) |
---|
| 120 | UInt m_uiCUPelY; ///< CU position in a pixel (Y) |
---|
| 121 | UInt m_uiNumPartition; ///< total number of minimum partitions in a CU |
---|
| 122 | UChar* m_puhWidth; ///< array of widths |
---|
| 123 | UChar* m_puhHeight; ///< array of heights |
---|
| 124 | UChar* m_puhDepth; ///< array of depths |
---|
| 125 | Int m_unitSize; ///< size of a "minimum partition" |
---|
| 126 | |
---|
| 127 | #if SVC_EXTENSION |
---|
| 128 | UInt m_layerId; ///< layer id |
---|
| 129 | #endif |
---|
| 130 | |
---|
| 131 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 132 | // CU data |
---|
| 133 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 134 | Bool* m_skipFlag; ///< array of skip flags |
---|
| 135 | Char* m_pePartSize; ///< array of partition sizes |
---|
| 136 | Char* m_pePredMode; ///< array of prediction modes |
---|
| 137 | Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags |
---|
| 138 | Char* m_phQP; ///< array of QP values |
---|
| 139 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
| 140 | UChar* m_puhTransformSkip[3];///< array of transform skipping flags |
---|
| 141 | UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) |
---|
| 142 | TComCUMvField m_acCUMvField[2]; ///< array of motion vectors |
---|
| 143 | TCoeff* m_pcTrCoeffY; ///< transformed coefficient buffer (Y) |
---|
| 144 | TCoeff* m_pcTrCoeffCb; ///< transformed coefficient buffer (Cb) |
---|
| 145 | TCoeff* m_pcTrCoeffCr; ///< transformed coefficient buffer (Cr) |
---|
| 146 | #if ADAPTIVE_QP_SELECTION |
---|
| 147 | Int* m_pcArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 148 | Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 149 | Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
| 150 | Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d |
---|
| 151 | |
---|
| 152 | static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 153 | static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 154 | static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
| 155 | #endif |
---|
| 156 | |
---|
| 157 | Pel* m_pcIPCMSampleY; ///< PCM sample buffer (Y) |
---|
| 158 | Pel* m_pcIPCMSampleCb; ///< PCM sample buffer (Cb) |
---|
| 159 | Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) |
---|
| 160 | |
---|
| 161 | Int* m_piSliceSUMap; ///< pointer of slice ID map |
---|
| 162 | std::vector<NDBFBlockInfo> m_vNDFBlock; |
---|
| 163 | |
---|
| 164 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 165 | // neighbour access variables |
---|
| 166 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 167 | |
---|
| 168 | TComDataCU* m_pcCUAboveLeft; ///< pointer of above-left CU |
---|
| 169 | TComDataCU* m_pcCUAboveRight; ///< pointer of above-right CU |
---|
| 170 | TComDataCU* m_pcCUAbove; ///< pointer of above CU |
---|
| 171 | TComDataCU* m_pcCULeft; ///< pointer of left CU |
---|
| 172 | TComDataCU* m_apcCUColocated[2]; ///< pointer of temporally colocated CU's for both directions |
---|
| 173 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
| 174 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
| 175 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
| 176 | TComMv m_cMvPred; ///< motion vector predictor |
---|
| 177 | |
---|
| 178 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 179 | // coding tool information |
---|
| 180 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 181 | |
---|
| 182 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
| 183 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
| 184 | #if AMP_MRG |
---|
| 185 | Bool m_bIsMergeAMP; |
---|
| 186 | #endif |
---|
| 187 | UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) |
---|
| 188 | UChar* m_puhChromaIntraDir; ///< array of intra directions (chroma) |
---|
| 189 | UChar* m_puhInterDir; ///< array of inter directions |
---|
| 190 | Char* m_apiMVPIdx[2]; ///< array of motion vector predictor candidates |
---|
| 191 | Char* m_apiMVPNum[2]; ///< array of number of possible motion vectors predictors |
---|
| 192 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
| 193 | |
---|
| 194 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 195 | // misc. variables |
---|
| 196 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 197 | |
---|
| 198 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
| 199 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
| 200 | UInt m_uiTotalDistortion; ///< sum of partition distortion |
---|
| 201 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
| 202 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
| 203 | UInt* m_sliceStartCU; ///< Start CU address of current slice |
---|
| 204 | UInt* m_sliceSegmentStartCU; ///< Start CU address of current slice |
---|
| 205 | Char m_codedQP; |
---|
| 206 | protected: |
---|
| 207 | |
---|
| 208 | /// add possible motion vector predictor candidates |
---|
| 209 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 210 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 211 | |
---|
| 212 | Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
| 213 | Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); |
---|
| 214 | |
---|
| 215 | /// compute required bits to encode MVD (used in AMVP) |
---|
| 216 | UInt xGetMvdBits ( TComMv cMvd ); |
---|
| 217 | UInt xGetComponentBits ( Int iVal ); |
---|
| 218 | |
---|
| 219 | /// compute scaling factor from POC difference |
---|
| 220 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
| 221 | |
---|
| 222 | Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
| 223 | |
---|
| 224 | public: |
---|
| 225 | TComDataCU(); |
---|
| 226 | virtual ~TComDataCU(); |
---|
| 227 | |
---|
| 228 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 229 | // create / destroy / initialize / copy |
---|
| 230 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 231 | |
---|
| 232 | Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
| 233 | #if ADAPTIVE_QP_SELECTION |
---|
| 234 | , Bool bGlobalRMARLBuffer = false |
---|
| 235 | #endif |
---|
| 236 | ); |
---|
| 237 | Void destroy (); |
---|
| 238 | |
---|
| 239 | Void initCU ( TComPic* pcPic, UInt uiCUAddr ); |
---|
| 240 | Void initEstData ( UInt uiDepth, Int qp ); |
---|
| 241 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
| 242 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 243 | |
---|
| 244 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
| 245 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList ); |
---|
| 246 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
| 247 | |
---|
| 248 | Void copyToPic ( UChar uiDepth ); |
---|
| 249 | Void copyToPic ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth ); |
---|
| 250 | |
---|
| 251 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 252 | // member functions for CU description |
---|
| 253 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 254 | |
---|
| 255 | TComPic* getPic () { return m_pcPic; } |
---|
| 256 | TComSlice* getSlice () { return m_pcSlice; } |
---|
| 257 | UInt& getAddr () { return m_uiCUAddr; } |
---|
| 258 | UInt& getZorderIdxInCU () { return m_uiAbsIdxInLCU; } |
---|
| 259 | UInt getSCUAddr (); |
---|
| 260 | UInt getCUPelX () { return m_uiCUPelX; } |
---|
| 261 | UInt getCUPelY () { return m_uiCUPelY; } |
---|
| 262 | TComPattern* getPattern () { return m_pcPattern; } |
---|
| 263 | |
---|
| 264 | UChar* getDepth () { return m_puhDepth; } |
---|
| 265 | UChar getDepth ( UInt uiIdx ) { return m_puhDepth[uiIdx]; } |
---|
| 266 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
| 267 | |
---|
| 268 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
| 269 | |
---|
| 270 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 271 | // member functions for CU data |
---|
| 272 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 273 | |
---|
| 274 | Char* getPartitionSize () { return m_pePartSize; } |
---|
| 275 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
| 276 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
| 277 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 278 | Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 279 | |
---|
| 280 | Bool* getSkipFlag () { return m_skipFlag; } |
---|
| 281 | Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } |
---|
| 282 | Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } |
---|
| 283 | Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); |
---|
| 284 | |
---|
| 285 | Char* getPredictionMode () { return m_pePredMode; } |
---|
| 286 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
| 287 | Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } |
---|
| 288 | Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } |
---|
| 289 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
| 290 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 291 | |
---|
| 292 | UChar* getWidth () { return m_puhWidth; } |
---|
| 293 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
| 294 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
| 295 | |
---|
| 296 | UChar* getHeight () { return m_puhHeight; } |
---|
| 297 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
| 298 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
| 299 | |
---|
| 300 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 301 | |
---|
| 302 | Char* getQP () { return m_phQP; } |
---|
| 303 | Char getQP ( UInt uiIdx ) { return m_phQP[uiIdx]; } |
---|
| 304 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
| 305 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 306 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
| 307 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
| 308 | Void setQPSubCUs ( Int qp, TComDataCU* pcCU, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); |
---|
| 309 | Void setCodedQP ( Char qp ) { m_codedQP = qp; } |
---|
| 310 | Char getCodedQP () { return m_codedQP; } |
---|
| 311 | |
---|
| 312 | Bool isLosslessCoded(UInt absPartIdx); |
---|
| 313 | |
---|
| 314 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
| 315 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
| 316 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 317 | |
---|
| 318 | UChar* getTransformSkip ( TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]];} |
---|
| 319 | UChar getTransformSkip ( UInt uiIdx,TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]][uiIdx];} |
---|
| 320 | Void setTransformSkipSubParts ( UInt useTransformSkip, TextType eType, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 321 | Void setTransformSkipSubParts ( UInt useTransformSkipY, UInt useTransformSkipU, UInt useTransformSkipV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 322 | |
---|
| 323 | UInt getQuadtreeTULog2MinSizeInCU( UInt absPartIdx ); |
---|
| 324 | |
---|
| 325 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
| 326 | |
---|
| 327 | TCoeff*& getCoeffY () { return m_pcTrCoeffY; } |
---|
| 328 | TCoeff*& getCoeffCb () { return m_pcTrCoeffCb; } |
---|
| 329 | TCoeff*& getCoeffCr () { return m_pcTrCoeffCr; } |
---|
| 330 | #if ADAPTIVE_QP_SELECTION |
---|
| 331 | Int*& getArlCoeffY () { return m_pcArlCoeffY; } |
---|
| 332 | Int*& getArlCoeffCb () { return m_pcArlCoeffCb; } |
---|
| 333 | Int*& getArlCoeffCr () { return m_pcArlCoeffCr; } |
---|
| 334 | #endif |
---|
| 335 | |
---|
| 336 | Pel*& getPCMSampleY () { return m_pcIPCMSampleY; } |
---|
| 337 | Pel*& getPCMSampleCb () { return m_pcIPCMSampleCb; } |
---|
| 338 | Pel*& getPCMSampleCr () { return m_pcIPCMSampleCr; } |
---|
| 339 | |
---|
| 340 | UChar getCbf ( UInt uiIdx, TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx]; } |
---|
| 341 | UChar* getCbf ( TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]]; } |
---|
| 342 | UChar getCbf ( UInt uiIdx, TextType eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
| 343 | Void setCbf ( UInt uiIdx, TextType eType, UChar uh ) { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh; } |
---|
| 344 | Void clearCbf ( UInt uiIdx, TextType eType, UInt uiNumParts ); |
---|
| 345 | UChar getQtRootCbf ( UInt uiIdx ) { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); } |
---|
| 346 | |
---|
| 347 | Void setCbfSubParts ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 348 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 349 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 350 | |
---|
| 351 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 352 | // member functions for coding tool information |
---|
| 353 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 354 | |
---|
| 355 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
| 356 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
| 357 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
| 358 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 359 | |
---|
| 360 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
| 361 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
| 362 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
| 363 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 364 | template <typename T> |
---|
| 365 | Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
| 366 | |
---|
| 367 | #if AMP_MRG |
---|
| 368 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
| 369 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
| 370 | #endif |
---|
| 371 | |
---|
| 372 | UChar* getLumaIntraDir () { return m_puhLumaIntraDir; } |
---|
| 373 | UChar getLumaIntraDir ( UInt uiIdx ) { return m_puhLumaIntraDir[uiIdx]; } |
---|
| 374 | Void setLumaIntraDir ( UInt uiIdx, UChar uh ) { m_puhLumaIntraDir[uiIdx] = uh; } |
---|
| 375 | Void setLumaIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 376 | |
---|
| 377 | UChar* getChromaIntraDir () { return m_puhChromaIntraDir; } |
---|
| 378 | UChar getChromaIntraDir ( UInt uiIdx ) { return m_puhChromaIntraDir[uiIdx]; } |
---|
| 379 | Void setChromaIntraDir ( UInt uiIdx, UChar uh ) { m_puhChromaIntraDir[uiIdx] = uh; } |
---|
| 380 | Void setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 381 | |
---|
| 382 | UChar* getInterDir () { return m_puhInterDir; } |
---|
| 383 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
| 384 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
| 385 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 386 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
| 387 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
| 388 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
| 389 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 390 | |
---|
| 391 | /// get slice ID for SU |
---|
| 392 | Int getSUSliceID (UInt uiIdx) {return m_piSliceSUMap[uiIdx]; } |
---|
| 393 | |
---|
| 394 | /// get the pointer of slice ID map |
---|
| 395 | Int* getSliceSUMap () {return m_piSliceSUMap; } |
---|
| 396 | |
---|
| 397 | /// set the pointer of slice ID map |
---|
| 398 | Void setSliceSUMap (Int *pi) {m_piSliceSUMap = pi; } |
---|
| 399 | |
---|
| 400 | std::vector<NDBFBlockInfo>* getNDBFilterBlocks() {return &m_vNDFBlock;} |
---|
| 401 | Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight |
---|
| 402 | ,std::vector<Bool>& LFCrossSliceBoundary |
---|
| 403 | ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary |
---|
| 404 | ,Bool bIndependentTileBoundaryEnabled ); |
---|
| 405 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 406 | // member functions for accessing partition information |
---|
| 407 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 408 | |
---|
| 409 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); |
---|
| 410 | UChar getNumPartInter (); |
---|
| 411 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 412 | |
---|
| 413 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 414 | // member functions for motion vector |
---|
| 415 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 416 | |
---|
| 417 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
| 418 | |
---|
| 419 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
| 420 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
| 421 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
| 422 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
| 423 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
| 424 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
| 425 | |
---|
| 426 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
| 427 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
| 428 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
| 429 | |
---|
| 430 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 431 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 432 | |
---|
| 433 | Void clipMv ( TComMv& rcMv ); |
---|
| 434 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
| 435 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
| 436 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
| 437 | |
---|
| 438 | Void compressMV (); |
---|
| 439 | |
---|
| 440 | #if SVC_EXTENSION |
---|
| 441 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
| 442 | UInt getLayerId () { return m_layerId; } |
---|
| 443 | #endif |
---|
| 444 | |
---|
| 445 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 446 | // utility functions for neighbouring information |
---|
| 447 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 448 | |
---|
| 449 | TComDataCU* getCULeft () { return m_pcCULeft; } |
---|
| 450 | TComDataCU* getCUAbove () { return m_pcCUAbove; } |
---|
| 451 | TComDataCU* getCUAboveLeft () { return m_pcCUAboveLeft; } |
---|
| 452 | TComDataCU* getCUAboveRight () { return m_pcCUAboveRight; } |
---|
| 453 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
| 454 | |
---|
| 455 | |
---|
| 456 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, |
---|
| 457 | UInt uiCurrPartUnitIdx, |
---|
| 458 | Bool bEnforceSliceRestriction=true, |
---|
| 459 | Bool bEnforceTileRestriction=true ); |
---|
| 460 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, |
---|
| 461 | UInt uiCurrPartUnitIdx, |
---|
| 462 | Bool bEnforceSliceRestriction=true, |
---|
| 463 | Bool planarAtLCUBoundary = false, |
---|
| 464 | Bool bEnforceTileRestriction=true ); |
---|
| 465 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 466 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 467 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 468 | |
---|
| 469 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU ); |
---|
| 470 | TComDataCU* getQpMinCuAbove ( UInt& aPartUnitIdx , UInt currAbsIdxInLCU ); |
---|
| 471 | Char getRefQP ( UInt uiCurrAbsIdxInLCU ); |
---|
| 472 | |
---|
| 473 | TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 474 | TComDataCU* getPUBelowLeftAdi ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 475 | |
---|
| 476 | Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 477 | Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
| 478 | |
---|
| 479 | Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 480 | Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 481 | |
---|
| 482 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
| 483 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); |
---|
| 484 | Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 485 | Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
| 486 | |
---|
| 487 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 488 | // member functions for modes |
---|
| 489 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 490 | |
---|
| 491 | Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
| 492 | Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) |
---|
| 493 | Bool isBipredRestriction( UInt puIdx ); |
---|
[474] | 494 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 495 | Bool isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); |
---|
| 496 | #endif |
---|
[313] | 497 | |
---|
| 498 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 499 | // member functions for symbol prediction (most probable / mode conversion) |
---|
| 500 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 501 | |
---|
| 502 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
| 503 | |
---|
| 504 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
| 505 | Int getIntraDirLumaPredictor ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL ); |
---|
| 506 | |
---|
| 507 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 508 | // member functions for SBAC context |
---|
| 509 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 510 | |
---|
| 511 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 512 | UInt getCtxQtCbf ( TextType eType, UInt uiTrDepth ); |
---|
| 513 | |
---|
| 514 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
| 515 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
| 516 | |
---|
| 517 | UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
| 518 | UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
| 519 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
| 520 | |
---|
[442] | 521 | #if SVC_EXTENSION |
---|
[313] | 522 | #if FAST_INTRA_SHVC |
---|
| 523 | Int reduceSetOfIntraModes ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ); |
---|
| 524 | #endif |
---|
| 525 | |
---|
| 526 | #if REF_IDX_ME_ZEROMV |
---|
| 527 | Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); |
---|
| 528 | Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx); |
---|
| 529 | #endif |
---|
[345] | 530 | #endif |
---|
[313] | 531 | |
---|
| 532 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 533 | // member functions for RD cost storage |
---|
| 534 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 535 | |
---|
| 536 | Double& getTotalCost() { return m_dTotalCost; } |
---|
| 537 | UInt& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
| 538 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
| 539 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
| 540 | |
---|
| 541 | UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); |
---|
| 542 | |
---|
[442] | 543 | #if SVC_EXTENSION |
---|
| 544 | TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 ); |
---|
| 545 | TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int iMotionMapping = 0 ); |
---|
[313] | 546 | Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); |
---|
| 547 | #endif |
---|
| 548 | }; |
---|
| 549 | |
---|
| 550 | namespace RasterAddress |
---|
| 551 | { |
---|
| 552 | /** Check whether 2 addresses point to the same column |
---|
| 553 | * \param addrA First address in raster scan order |
---|
| 554 | * \param addrB Second address in raters scan order |
---|
| 555 | * \param numUnitsPerRow Number of units in a row |
---|
| 556 | * \return Result of test |
---|
| 557 | */ |
---|
| 558 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 559 | { |
---|
| 560 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
| 561 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 562 | } |
---|
| 563 | |
---|
| 564 | /** Check whether 2 addresses point to the same row |
---|
| 565 | * \param addrA First address in raster scan order |
---|
| 566 | * \param addrB Second address in raters scan order |
---|
| 567 | * \param numUnitsPerRow Number of units in a row |
---|
| 568 | * \return Result of test |
---|
| 569 | */ |
---|
| 570 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 571 | { |
---|
| 572 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
| 573 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 574 | } |
---|
| 575 | |
---|
| 576 | /** Check whether 2 addresses point to the same row or column |
---|
| 577 | * \param addrA First address in raster scan order |
---|
| 578 | * \param addrB Second address in raters scan order |
---|
| 579 | * \param numUnitsPerRow Number of units in a row |
---|
| 580 | * \return Result of test |
---|
| 581 | */ |
---|
| 582 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 583 | { |
---|
| 584 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
| 585 | } |
---|
| 586 | |
---|
| 587 | /** Check whether one address points to the first column |
---|
| 588 | * \param addr Address in raster scan order |
---|
| 589 | * \param numUnitsPerRow Number of units in a row |
---|
| 590 | * \return Result of test |
---|
| 591 | */ |
---|
| 592 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
| 593 | { |
---|
| 594 | // addr % numUnitsPerRow == 0 |
---|
| 595 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 596 | } |
---|
| 597 | |
---|
| 598 | /** Check whether one address points to the first row |
---|
| 599 | * \param addr Address in raster scan order |
---|
| 600 | * \param numUnitsPerRow Number of units in a row |
---|
| 601 | * \return Result of test |
---|
| 602 | */ |
---|
| 603 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
| 604 | { |
---|
| 605 | // addr / numUnitsPerRow == 0 |
---|
| 606 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 607 | } |
---|
| 608 | |
---|
| 609 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
| 610 | * \param addr Address in raster scan order |
---|
| 611 | * \param val Given column index value |
---|
| 612 | * \param numUnitsPerRow Number of units in a row |
---|
| 613 | * \return Result of test |
---|
| 614 | */ |
---|
| 615 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 616 | { |
---|
| 617 | // addr % numUnitsPerRow < val |
---|
| 618 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
| 619 | } |
---|
| 620 | |
---|
| 621 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
| 622 | * \param addr Address in raster scan order |
---|
| 623 | * \param val Given row index value |
---|
| 624 | * \param numUnitsPerRow Number of units in a row |
---|
| 625 | * \return Result of test |
---|
| 626 | */ |
---|
| 627 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 628 | { |
---|
| 629 | // addr / numUnitsPerRow < val |
---|
| 630 | return addr < val * numUnitsPerRow; |
---|
| 631 | } |
---|
| 632 | }; |
---|
| 633 | |
---|
| 634 | //! \} |
---|
| 635 | |
---|
| 636 | #endif |
---|