[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 |
---|
[1029] | 4 | * granted under this license. |
---|
[313] | 5 | * |
---|
[1259] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[313] | 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 | |
---|
[1029] | 39 | #ifndef __TCOMDATACU__ |
---|
| 40 | #define __TCOMDATACU__ |
---|
[313] | 41 | |
---|
[1262] | 42 | #include <algorithm> |
---|
| 43 | #include <vector> |
---|
[313] | 44 | |
---|
| 45 | // Include files |
---|
| 46 | #include "CommonDef.h" |
---|
| 47 | #include "TComMotionInfo.h" |
---|
| 48 | #include "TComSlice.h" |
---|
| 49 | #include "TComRdCost.h" |
---|
| 50 | #include "TComPattern.h" |
---|
| 51 | |
---|
| 52 | //! \ingroup TLibCommon |
---|
| 53 | //! \{ |
---|
| 54 | |
---|
[1029] | 55 | class TComTU; // forward declaration |
---|
| 56 | |
---|
| 57 | static const UInt NUM_MOST_PROBABLE_MODES=3; |
---|
| 58 | |
---|
[313] | 59 | // ==================================================================================================================== |
---|
| 60 | // Class definition |
---|
| 61 | // ==================================================================================================================== |
---|
| 62 | |
---|
| 63 | /// CU data structure class |
---|
| 64 | class TComDataCU |
---|
| 65 | { |
---|
| 66 | private: |
---|
[1029] | 67 | |
---|
[313] | 68 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 69 | // class pointers |
---|
| 70 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 71 | |
---|
[313] | 72 | TComPic* m_pcPic; ///< picture class pointer |
---|
| 73 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
[1029] | 74 | |
---|
[313] | 75 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 76 | // CU description |
---|
| 77 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 78 | |
---|
| 79 | UInt m_ctuRsAddr; ///< CTU (also known as LCU) address in a slice (Raster-scan address, as opposed to tile-scan/encoding order). |
---|
| 80 | UInt m_absZIdxInCtu; ///< absolute address in a CTU. It's Z scan order |
---|
[313] | 81 | UInt m_uiCUPelX; ///< CU position in a pixel (X) |
---|
| 82 | UInt m_uiCUPelY; ///< CU position in a pixel (Y) |
---|
| 83 | UInt m_uiNumPartition; ///< total number of minimum partitions in a CU |
---|
| 84 | UChar* m_puhWidth; ///< array of widths |
---|
| 85 | UChar* m_puhHeight; ///< array of heights |
---|
| 86 | UChar* m_puhDepth; ///< array of depths |
---|
| 87 | Int m_unitSize; ///< size of a "minimum partition" |
---|
| 88 | |
---|
| 89 | #if SVC_EXTENSION |
---|
| 90 | UInt m_layerId; ///< layer id |
---|
| 91 | #endif |
---|
| 92 | |
---|
| 93 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 94 | // CU data |
---|
| 95 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 96 | |
---|
| 97 | Bool* m_skipFlag; ///< array of skip flags |
---|
| 98 | Char* m_pePartSize; ///< array of partition sizes |
---|
| 99 | Char* m_pePredMode; ///< array of prediction modes |
---|
| 100 | Char* m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values |
---|
| 101 | Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags |
---|
| 102 | Char* m_phQP; ///< array of QP values |
---|
| 103 | UChar* m_ChromaQpAdj; ///< array of chroma QP adjustments (indexed) |
---|
| 104 | UInt m_codedChromaQpAdj; |
---|
| 105 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
| 106 | UChar* m_puhTransformSkip[MAX_NUM_COMPONENT];///< array of transform skipping flags |
---|
| 107 | UChar* m_puhCbf[MAX_NUM_COMPONENT]; ///< array of coded block flags (CBF) |
---|
| 108 | TComCUMvField m_acCUMvField[NUM_REF_PIC_LIST_01]; ///< array of motion vectors. |
---|
| 109 | TCoeff* m_pcTrCoeff[MAX_NUM_COMPONENT]; ///< array of transform coefficient buffers (0->Y, 1->Cb, 2->Cr) |
---|
[313] | 110 | #if ADAPTIVE_QP_SELECTION |
---|
[1029] | 111 | TCoeff* m_pcArlCoeff[MAX_NUM_COMPONENT]; // ARL coefficient buffer (0->Y, 1->Cb, 2->Cr) |
---|
| 112 | static TCoeff* m_pcGlbArlCoeff[MAX_NUM_COMPONENT]; // global ARL buffer |
---|
| 113 | Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d |
---|
[313] | 114 | #endif |
---|
| 115 | |
---|
[1029] | 116 | Pel* m_pcIPCMSample[MAX_NUM_COMPONENT]; ///< PCM sample buffer (0->Y, 1->Cb, 2->Cr) |
---|
| 117 | |
---|
[313] | 118 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 119 | // neighbour access variables |
---|
| 120 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 121 | |
---|
| 122 | TComDataCU* m_pCtuAboveLeft; ///< pointer of above-left CTU. |
---|
| 123 | TComDataCU* m_pCtuAboveRight; ///< pointer of above-right CTU. |
---|
| 124 | TComDataCU* m_pCtuAbove; ///< pointer of above CTU. |
---|
| 125 | TComDataCU* m_pCtuLeft; ///< pointer of left CTU |
---|
| 126 | TComDataCU* m_apcCUColocated[NUM_REF_PIC_LIST_01]; ///< pointer of temporally colocated CU's for both directions |
---|
[313] | 127 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
| 128 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
| 129 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
| 130 | TComMv m_cMvPred; ///< motion vector predictor |
---|
[1029] | 131 | |
---|
[313] | 132 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 133 | // coding tool information |
---|
| 134 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 135 | |
---|
[313] | 136 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
| 137 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
| 138 | #if AMP_MRG |
---|
| 139 | Bool m_bIsMergeAMP; |
---|
| 140 | #endif |
---|
[1029] | 141 | UChar* m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]; // 0-> Luma, 1-> Chroma |
---|
[313] | 142 | UChar* m_puhInterDir; ///< array of inter directions |
---|
[1029] | 143 | Char* m_apiMVPIdx[NUM_REF_PIC_LIST_01]; ///< array of motion vector predictor candidates |
---|
| 144 | Char* m_apiMVPNum[NUM_REF_PIC_LIST_01]; ///< array of number of possible motion vectors predictors |
---|
[313] | 145 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
| 146 | |
---|
| 147 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 148 | // misc. variables |
---|
| 149 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 150 | |
---|
[313] | 151 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
| 152 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
[1029] | 153 | Distortion m_uiTotalDistortion; ///< sum of partition distortion |
---|
[313] | 154 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
[1029] | 155 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
[313] | 156 | Char m_codedQP; |
---|
[1029] | 157 | UChar* m_explicitRdpcmMode[MAX_NUM_COMPONENT]; ///< Stores the explicit RDPCM mode for all TUs belonging to this CU |
---|
| 158 | |
---|
[313] | 159 | protected: |
---|
[1029] | 160 | |
---|
[313] | 161 | /// add possible motion vector predictor candidates |
---|
| 162 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 163 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 164 | |
---|
| 165 | Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
[1029] | 166 | Bool xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx ); |
---|
| 167 | |
---|
[313] | 168 | /// compute required bits to encode MVD (used in AMVP) |
---|
| 169 | UInt xGetMvdBits ( TComMv cMvd ); |
---|
| 170 | UInt xGetComponentBits ( Int iVal ); |
---|
[1029] | 171 | |
---|
[313] | 172 | /// compute scaling factor from POC difference |
---|
| 173 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[1029] | 174 | |
---|
[313] | 175 | Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
| 176 | |
---|
| 177 | public: |
---|
| 178 | TComDataCU(); |
---|
| 179 | virtual ~TComDataCU(); |
---|
[1029] | 180 | |
---|
[313] | 181 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 182 | // create / destroy / initialize / copy |
---|
| 183 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 184 | |
---|
| 185 | Void create ( ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
[313] | 186 | #if ADAPTIVE_QP_SELECTION |
---|
| 187 | , Bool bGlobalRMARLBuffer = false |
---|
[1029] | 188 | #endif |
---|
[313] | 189 | ); |
---|
| 190 | Void destroy (); |
---|
[1029] | 191 | |
---|
| 192 | Void initCtu ( TComPic* pcPic, UInt ctuRsAddr ); |
---|
| 193 | Void initEstData ( const UInt uiDepth, const Int qp, const Bool bTransquantBypass ); |
---|
[313] | 194 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
| 195 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 196 | |
---|
| 197 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
| 198 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList ); |
---|
| 199 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[1029] | 200 | |
---|
[313] | 201 | Void copyToPic ( UChar uiDepth ); |
---|
[1246] | 202 | |
---|
[313] | 203 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 204 | // member functions for CU description |
---|
| 205 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 206 | |
---|
| 207 | TComPic* getPic () { return m_pcPic; } |
---|
| 208 | const TComPic* getPic () const { return m_pcPic; } |
---|
| 209 | TComSlice* getSlice () { return m_pcSlice; } |
---|
| 210 | const TComSlice* getSlice () const { return m_pcSlice; } |
---|
| 211 | UInt& getCtuRsAddr () { return m_ctuRsAddr; } |
---|
| 212 | UInt getCtuRsAddr () const { return m_ctuRsAddr; } |
---|
| 213 | UInt getZorderIdxInCtu () const { return m_absZIdxInCtu; } |
---|
| 214 | UInt getCUPelX () const { return m_uiCUPelX; } |
---|
| 215 | UInt getCUPelY () const { return m_uiCUPelY; } |
---|
| 216 | |
---|
[313] | 217 | UChar* getDepth () { return m_puhDepth; } |
---|
[1029] | 218 | UChar getDepth ( UInt uiIdx ) const { return m_puhDepth[uiIdx]; } |
---|
[313] | 219 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
[1029] | 220 | |
---|
[313] | 221 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
[1029] | 222 | |
---|
[313] | 223 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 224 | // member functions for CU data |
---|
| 225 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 226 | |
---|
[313] | 227 | Char* getPartitionSize () { return m_pePartSize; } |
---|
| 228 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
| 229 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
| 230 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 231 | Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 232 | |
---|
[1029] | 233 | Bool* getSkipFlag () { return m_skipFlag; } |
---|
| 234 | Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } |
---|
| 235 | Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } |
---|
| 236 | Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); |
---|
| 237 | |
---|
[313] | 238 | Char* getPredictionMode () { return m_pePredMode; } |
---|
| 239 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
[1029] | 240 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
| 241 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 242 | |
---|
| 243 | Char* getCrossComponentPredictionAlpha( ComponentID compID ) { return m_crossComponentPredictionAlpha[compID]; } |
---|
| 244 | Char getCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx]; } |
---|
| 245 | |
---|
[313] | 246 | Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } |
---|
| 247 | Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } |
---|
[1029] | 248 | |
---|
[313] | 249 | UChar* getWidth () { return m_puhWidth; } |
---|
| 250 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
| 251 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
[1029] | 252 | |
---|
[313] | 253 | UChar* getHeight () { return m_puhHeight; } |
---|
| 254 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
| 255 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
[1029] | 256 | |
---|
[313] | 257 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1029] | 258 | |
---|
[313] | 259 | Char* getQP () { return m_phQP; } |
---|
[1029] | 260 | Char getQP ( UInt uiIdx ) const { return m_phQP[uiIdx]; } |
---|
[313] | 261 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
| 262 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 263 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
| 264 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
[1029] | 265 | Void setQPSubCUs ( Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); |
---|
[313] | 266 | Void setCodedQP ( Char qp ) { m_codedQP = qp; } |
---|
| 267 | Char getCodedQP () { return m_codedQP; } |
---|
| 268 | |
---|
[1029] | 269 | UChar* getChromaQpAdj () { return m_ChromaQpAdj; } |
---|
| 270 | UChar getChromaQpAdj (Int idx) const { return m_ChromaQpAdj[idx]; } |
---|
| 271 | Void setChromaQpAdj (Int idx, UChar val) { m_ChromaQpAdj[idx] = val; } |
---|
| 272 | Void setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth ); |
---|
| 273 | Void setCodedChromaQpAdj ( Char qp ) { m_codedChromaQpAdj = qp; } |
---|
| 274 | Char getCodedChromaQpAdj () { return m_codedChromaQpAdj; } |
---|
| 275 | |
---|
| 276 | Bool isLosslessCoded ( UInt absPartIdx ); |
---|
| 277 | |
---|
[313] | 278 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
| 279 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
| 280 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 281 | |
---|
[1029] | 282 | UChar* getTransformSkip ( ComponentID compID ) { return m_puhTransformSkip[compID];} |
---|
| 283 | UChar getTransformSkip ( UInt uiIdx, ComponentID compID) { return m_puhTransformSkip[compID][uiIdx];} |
---|
| 284 | Void setTransformSkipSubParts ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 285 | Void setTransformSkipSubParts ( const UInt useTransformSkip[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[313] | 286 | |
---|
[1029] | 287 | UChar* getExplicitRdpcmMode ( ComponentID component ) { return m_explicitRdpcmMode[component]; } |
---|
| 288 | UChar getExplicitRdpcmMode ( ComponentID component, UInt partIdx ) {return m_explicitRdpcmMode[component][partIdx]; } |
---|
| 289 | Void setExplicitRdpcmModePartRange ( UInt rdpcmMode, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 290 | |
---|
| 291 | Bool isRDPCMEnabled ( UInt uiAbsPartIdx ) { return getSlice()->getSPS()->getUseResidualDPCM(isIntra(uiAbsPartIdx) ? RDPCM_SIGNAL_IMPLICIT : RDPCM_SIGNAL_EXPLICIT); } |
---|
| 292 | |
---|
| 293 | Void setCrossComponentPredictionAlphaPartRange ( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 294 | Void setTransformSkipPartRange ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 295 | |
---|
| 296 | UInt getQuadtreeTULog2MinSizeInCU( UInt uiIdx ); |
---|
| 297 | |
---|
[313] | 298 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
[1029] | 299 | |
---|
| 300 | TCoeff* getCoeff (ComponentID component) { return m_pcTrCoeff[component]; } |
---|
| 301 | |
---|
[313] | 302 | #if ADAPTIVE_QP_SELECTION |
---|
[1029] | 303 | TCoeff* getArlCoeff ( ComponentID component ) { return m_pcArlCoeff[component]; } |
---|
[313] | 304 | #endif |
---|
[1029] | 305 | Pel* getPCMSample ( ComponentID component ) { return m_pcIPCMSample[component]; } |
---|
[313] | 306 | |
---|
[1029] | 307 | UChar getCbf ( UInt uiIdx, ComponentID eType ) { return m_puhCbf[eType][uiIdx]; } |
---|
| 308 | UChar* getCbf ( ComponentID eType ) { return m_puhCbf[eType]; } |
---|
| 309 | UChar getCbf ( UInt uiIdx, ComponentID eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
| 310 | Void setCbf ( UInt uiIdx, ComponentID eType, UChar uh ) { m_puhCbf[eType][uiIdx] = uh; } |
---|
| 311 | Void clearCbf ( UInt uiIdx, ComponentID eType, UInt uiNumParts ); |
---|
| 312 | UChar getQtRootCbf ( UInt uiIdx ); |
---|
| 313 | |
---|
| 314 | Void setCbfSubParts ( const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 315 | Void setCbfSubParts ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 316 | Void setCbfSubParts ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 317 | |
---|
| 318 | Void setCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 319 | Void bitwiseOrCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 320 | |
---|
[313] | 321 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 322 | // member functions for coding tool information |
---|
| 323 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 324 | |
---|
[313] | 325 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
| 326 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
| 327 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
| 328 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 329 | |
---|
| 330 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
| 331 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
| 332 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
| 333 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 334 | template <typename T> |
---|
[1029] | 335 | Void setSubPart ( T bParameter, T* pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[313] | 336 | |
---|
| 337 | #if AMP_MRG |
---|
| 338 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
| 339 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
| 340 | #endif |
---|
| 341 | |
---|
[1029] | 342 | UChar* getIntraDir ( const ChannelType channelType ) const { return m_puhIntraDir[channelType]; } |
---|
| 343 | UChar getIntraDir ( const ChannelType channelType, const UInt uiIdx ) const { return m_puhIntraDir[channelType][uiIdx]; } |
---|
| 344 | |
---|
| 345 | Void setIntraDirSubParts ( const ChannelType channelType, |
---|
| 346 | const UInt uiDir, |
---|
| 347 | const UInt uiAbsPartIdx, |
---|
| 348 | const UInt uiDepth ); |
---|
| 349 | |
---|
[313] | 350 | UChar* getInterDir () { return m_puhInterDir; } |
---|
| 351 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
| 352 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
| 353 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 354 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
| 355 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
| 356 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
| 357 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 358 | |
---|
| 359 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 360 | // member functions for accessing partition information |
---|
| 361 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 362 | |
---|
[1236] | 363 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx |
---|
[1029] | 364 | UChar getNumPartitions ( const UInt uiAbsPartIdx = 0 ); |
---|
[313] | 365 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
[1029] | 366 | |
---|
[313] | 367 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 368 | // member functions for motion vector |
---|
| 369 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 370 | |
---|
[313] | 371 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
[1029] | 372 | |
---|
[313] | 373 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
| 374 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
| 375 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
[1029] | 376 | |
---|
[313] | 377 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
| 378 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
| 379 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
| 380 | |
---|
| 381 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
| 382 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
| 383 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
[1029] | 384 | |
---|
[313] | 385 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 386 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[1029] | 387 | |
---|
[313] | 388 | Void clipMv ( TComMv& rcMv ); |
---|
| 389 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
| 390 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
| 391 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
[1029] | 392 | |
---|
[313] | 393 | Void compressMV (); |
---|
[1029] | 394 | |
---|
[313] | 395 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 396 | // utility functions for neighbouring information |
---|
| 397 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 398 | |
---|
| 399 | TComDataCU* getCtuLeft () { return m_pCtuLeft; } |
---|
| 400 | TComDataCU* getCtuAbove () { return m_pCtuAbove; } |
---|
| 401 | TComDataCU* getCtuAboveLeft () { return m_pCtuAboveLeft; } |
---|
| 402 | TComDataCU* getCtuAboveRight () { return m_pCtuAboveRight; } |
---|
[313] | 403 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
[1029] | 404 | Bool CUIsFromSameSlice ( const TComDataCU *pCU /* Can be NULL */) const { return ( pCU!=NULL && pCU->getSlice()->getSliceCurStartCtuTsAddr() == getSlice()->getSliceCurStartCtuTsAddr() ); } |
---|
| 405 | Bool CUIsFromSameTile ( const TComDataCU *pCU /* Can be NULL */) const; |
---|
| 406 | Bool CUIsFromSameSliceAndTile ( const TComDataCU *pCU /* Can be NULL */) const; |
---|
| 407 | Bool CUIsFromSameSliceTileAndWavefrontRow( const TComDataCU *pCU /* Can be NULL */) const; |
---|
| 408 | Bool isLastSubCUOfCtu(const UInt absPartIdx); |
---|
[313] | 409 | |
---|
| 410 | |
---|
[1029] | 411 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, |
---|
| 412 | UInt uiCurrPartUnitIdx, |
---|
| 413 | Bool bEnforceSliceRestriction=true, |
---|
[313] | 414 | Bool bEnforceTileRestriction=true ); |
---|
| 415 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, |
---|
[1029] | 416 | UInt uiCurrPartUnitIdx, |
---|
| 417 | Bool bEnforceSliceRestriction=true, |
---|
| 418 | Bool planarAtCTUBoundary = false, |
---|
[313] | 419 | Bool bEnforceTileRestriction=true ); |
---|
| 420 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 421 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 422 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 423 | |
---|
[1029] | 424 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu ); |
---|
| 425 | TComDataCU* getQpMinCuAbove ( UInt& uiAPartUnitIdx , UInt uiCurrAbsIdxInCtu ); |
---|
| 426 | Char getRefQP ( UInt uiCurrAbsIdxInCtu ); |
---|
[313] | 427 | |
---|
| 428 | TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 429 | TComDataCU* getPUBelowLeftAdi ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
[1029] | 430 | |
---|
[313] | 431 | Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 432 | Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[1029] | 433 | |
---|
[313] | 434 | Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); |
---|
[1029] | 435 | Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); // NOTE: Unused function. |
---|
| 436 | |
---|
[313] | 437 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
| 438 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); |
---|
[1029] | 439 | |
---|
[313] | 440 | Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 441 | Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[1029] | 442 | |
---|
[313] | 443 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 444 | // member functions for modes |
---|
| 445 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 446 | |
---|
| 447 | Bool isIntra ( UInt uiPartIdx ) const { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
| 448 | Bool isInter ( UInt uiPartIdx ) const { return m_pePredMode[ uiPartIdx ] == MODE_INTER; } |
---|
[1258] | 449 | Bool isSkipped ( UInt uiPartIdx ); ///< returns true, if the partiton is skipped |
---|
[313] | 450 | Bool isBipredRestriction( UInt puIdx ); |
---|
| 451 | |
---|
| 452 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 453 | // member functions for symbol prediction (most probable / mode conversion) |
---|
| 454 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 455 | |
---|
[313] | 456 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
[1029] | 457 | |
---|
[313] | 458 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
[1244] | 459 | Void getIntraDirPredictor ( UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int* piMode = NULL ); |
---|
[1029] | 460 | |
---|
[313] | 461 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 462 | // member functions for SBAC context |
---|
| 463 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1029] | 464 | |
---|
[313] | 465 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1029] | 466 | UInt getCtxQtCbf ( TComTU &rTu, const ChannelType chType ); |
---|
[313] | 467 | |
---|
| 468 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
| 469 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
| 470 | |
---|
[1029] | 471 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
| 472 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 473 | // member functions for RD cost storage |
---|
| 474 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 475 | |
---|
| 476 | Double& getTotalCost() { return m_dTotalCost; } |
---|
| 477 | Distortion& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
| 478 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
| 479 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
| 480 | |
---|
| 481 | UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ; |
---|
| 482 | |
---|
[442] | 483 | #if SVC_EXTENSION |
---|
[595] | 484 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
| 485 | UInt getLayerId () { return m_layerId; } |
---|
[1057] | 486 | UInt getLayerIdx () { return m_pcSlice->getVPS()->getLayerIdxInVps(m_layerId); } |
---|
[595] | 487 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 488 | Bool isInterLayerReference(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); |
---|
| 489 | #endif |
---|
[313] | 490 | #if FAST_INTRA_SHVC |
---|
| 491 | Int reduceSetOfIntraModes ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int &fullSetOfModes ); |
---|
| 492 | #endif |
---|
| 493 | #if REF_IDX_ME_ZEROMV |
---|
[1029] | 494 | Bool xCheckZeroMVILRMerge(UChar uhInterDir, TComMvField& cMvFieldL0, TComMvField& cMvFieldL1); |
---|
| 495 | Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx); |
---|
[313] | 496 | #endif |
---|
[822] | 497 | TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false ); |
---|
| 498 | TComDataCU* getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false ); |
---|
[595] | 499 | Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); |
---|
[345] | 500 | #endif |
---|
[313] | 501 | }; |
---|
| 502 | |
---|
| 503 | namespace RasterAddress |
---|
| 504 | { |
---|
| 505 | /** Check whether 2 addresses point to the same column |
---|
| 506 | * \param addrA First address in raster scan order |
---|
| 507 | * \param addrB Second address in raters scan order |
---|
| 508 | * \param numUnitsPerRow Number of units in a row |
---|
| 509 | * \return Result of test |
---|
| 510 | */ |
---|
| 511 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 512 | { |
---|
| 513 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
| 514 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 515 | } |
---|
[1029] | 516 | |
---|
[313] | 517 | /** Check whether 2 addresses point to the same row |
---|
| 518 | * \param addrA First address in raster scan order |
---|
| 519 | * \param addrB Second address in raters scan order |
---|
| 520 | * \param numUnitsPerRow Number of units in a row |
---|
| 521 | * \return Result of test |
---|
| 522 | */ |
---|
| 523 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 524 | { |
---|
| 525 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
| 526 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 527 | } |
---|
[1029] | 528 | |
---|
[313] | 529 | /** Check whether 2 addresses point to the same row or column |
---|
| 530 | * \param addrA First address in raster scan order |
---|
| 531 | * \param addrB Second address in raters scan order |
---|
| 532 | * \param numUnitsPerRow Number of units in a row |
---|
| 533 | * \return Result of test |
---|
| 534 | */ |
---|
| 535 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 536 | { |
---|
| 537 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
| 538 | } |
---|
[1029] | 539 | |
---|
[313] | 540 | /** Check whether one address points to the first column |
---|
| 541 | * \param addr Address in raster scan order |
---|
| 542 | * \param numUnitsPerRow Number of units in a row |
---|
| 543 | * \return Result of test |
---|
| 544 | */ |
---|
| 545 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
| 546 | { |
---|
| 547 | // addr % numUnitsPerRow == 0 |
---|
| 548 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 549 | } |
---|
[1029] | 550 | |
---|
[313] | 551 | /** Check whether one address points to the first row |
---|
| 552 | * \param addr Address in raster scan order |
---|
| 553 | * \param numUnitsPerRow Number of units in a row |
---|
| 554 | * \return Result of test |
---|
| 555 | */ |
---|
| 556 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
| 557 | { |
---|
| 558 | // addr / numUnitsPerRow == 0 |
---|
| 559 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 560 | } |
---|
[1029] | 561 | |
---|
[313] | 562 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
| 563 | * \param addr Address in raster scan order |
---|
| 564 | * \param val Given column index value |
---|
| 565 | * \param numUnitsPerRow Number of units in a row |
---|
| 566 | * \return Result of test |
---|
| 567 | */ |
---|
| 568 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 569 | { |
---|
| 570 | // addr % numUnitsPerRow < val |
---|
| 571 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
| 572 | } |
---|
[1029] | 573 | |
---|
[313] | 574 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
| 575 | * \param addr Address in raster scan order |
---|
| 576 | * \param val Given row index value |
---|
| 577 | * \param numUnitsPerRow Number of units in a row |
---|
| 578 | * \return Result of test |
---|
| 579 | */ |
---|
| 580 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 581 | { |
---|
| 582 | // addr / numUnitsPerRow < val |
---|
| 583 | return addr < val * numUnitsPerRow; |
---|
| 584 | } |
---|
[1029] | 585 | } |
---|
[313] | 586 | |
---|
| 587 | //! \} |
---|
| 588 | |
---|
| 589 | #endif |
---|