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