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