[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[608] | 6 | * Copyright (c) 2010-2013, ITU/ISO/IEC |
---|
[5] | 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TComDataCU.h |
---|
| 35 | \brief CU data structure (header) |
---|
| 36 | \todo not all entities are documented |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #ifndef _TCOMDATACU_ |
---|
| 40 | #define _TCOMDATACU_ |
---|
| 41 | |
---|
| 42 | #include <assert.h> |
---|
| 43 | |
---|
| 44 | // Include files |
---|
| 45 | #include "CommonDef.h" |
---|
| 46 | #include "TComMotionInfo.h" |
---|
| 47 | #include "TComSlice.h" |
---|
| 48 | #include "TComRdCost.h" |
---|
| 49 | #include "TComPattern.h" |
---|
[56] | 50 | |
---|
[608] | 51 | #if H_3D_ARP |
---|
[2] | 52 | #include "TComYuv.h" |
---|
[56] | 53 | #endif |
---|
[2] | 54 | |
---|
| 55 | #include <algorithm> |
---|
| 56 | #include <vector> |
---|
| 57 | |
---|
[56] | 58 | //! \ingroup TLibCommon |
---|
| 59 | //! \{ |
---|
| 60 | |
---|
[2] | 61 | // ==================================================================================================================== |
---|
[56] | 62 | // Non-deblocking in-loop filter processing block data structure |
---|
| 63 | // ==================================================================================================================== |
---|
| 64 | |
---|
| 65 | /// Non-deblocking filter processing block border tag |
---|
| 66 | enum NDBFBlockBorderTag |
---|
| 67 | { |
---|
| 68 | SGU_L = 0, |
---|
| 69 | SGU_R, |
---|
| 70 | SGU_T, |
---|
| 71 | SGU_B, |
---|
| 72 | SGU_TL, |
---|
| 73 | SGU_TR, |
---|
| 74 | SGU_BL, |
---|
| 75 | SGU_BR, |
---|
| 76 | NUM_SGU_BORDER |
---|
| 77 | }; |
---|
| 78 | |
---|
| 79 | /// Non-deblocking filter processing block information |
---|
| 80 | struct NDBFBlockInfo |
---|
| 81 | { |
---|
| 82 | Int tileID; //!< tile ID |
---|
| 83 | Int sliceID; //!< slice ID |
---|
| 84 | UInt startSU; //!< starting SU z-scan address in LCU |
---|
| 85 | UInt endSU; //!< ending SU z-scan address in LCU |
---|
| 86 | UInt widthSU; //!< number of SUs in width |
---|
| 87 | UInt heightSU; //!< number of SUs in height |
---|
| 88 | UInt posX; //!< top-left X coordinate in picture |
---|
| 89 | UInt posY; //!< top-left Y coordinate in picture |
---|
| 90 | UInt width; //!< number of pixels in width |
---|
| 91 | UInt height; //!< number of pixels in height |
---|
| 92 | Bool isBorderAvailable[NUM_SGU_BORDER]; //!< the border availabilities |
---|
| 93 | Bool allBordersAvailable; |
---|
| 94 | |
---|
| 95 | NDBFBlockInfo():tileID(0), sliceID(0), startSU(0), endSU(0) {} //!< constructor |
---|
| 96 | const NDBFBlockInfo& operator= (const NDBFBlockInfo& src); //!< "=" operator |
---|
| 97 | }; |
---|
| 98 | |
---|
| 99 | |
---|
| 100 | // ==================================================================================================================== |
---|
[2] | 101 | // Class definition |
---|
| 102 | // ==================================================================================================================== |
---|
| 103 | |
---|
| 104 | /// CU data structure class |
---|
| 105 | class TComDataCU |
---|
| 106 | { |
---|
| 107 | private: |
---|
| 108 | |
---|
| 109 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 110 | // class pointers |
---|
| 111 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 112 | |
---|
| 113 | TComPic* m_pcPic; ///< picture class pointer |
---|
| 114 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
| 115 | TComPattern* m_pcPattern; ///< neighbour access class pointer |
---|
| 116 | |
---|
| 117 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 118 | // CU description |
---|
| 119 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 120 | |
---|
| 121 | UInt m_uiCUAddr; ///< CU address in a slice |
---|
| 122 | UInt m_uiAbsIdxInLCU; ///< absolute address in a CU. It's Z scan order |
---|
| 123 | UInt m_uiCUPelX; ///< CU position in a pixel (X) |
---|
| 124 | UInt m_uiCUPelY; ///< CU position in a pixel (Y) |
---|
| 125 | UInt m_uiNumPartition; ///< total number of minimum partitions in a CU |
---|
| 126 | UChar* m_puhWidth; ///< array of widths |
---|
| 127 | UChar* m_puhHeight; ///< array of heights |
---|
| 128 | UChar* m_puhDepth; ///< array of depths |
---|
[56] | 129 | Int m_unitSize; ///< size of a "minimum partition" |
---|
[2] | 130 | |
---|
| 131 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 132 | // CU data |
---|
| 133 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 134 | Bool* m_skipFlag; ///< array of skip flags |
---|
[56] | 135 | Char* m_pePartSize; ///< array of partition sizes |
---|
| 136 | Char* m_pePredMode; ///< array of prediction modes |
---|
[608] | 137 | Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags |
---|
[56] | 138 | Char* m_phQP; ///< array of QP values |
---|
[2] | 139 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
[608] | 140 | UChar* m_puhTransformSkip[3];///< array of transform skipping flags |
---|
[2] | 141 | UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) |
---|
| 142 | TComCUMvField m_acCUMvField[2]; ///< array of motion vectors |
---|
| 143 | TCoeff* m_pcTrCoeffY; ///< transformed coefficient buffer (Y) |
---|
| 144 | TCoeff* m_pcTrCoeffCb; ///< transformed coefficient buffer (Cb) |
---|
| 145 | TCoeff* m_pcTrCoeffCr; ///< transformed coefficient buffer (Cr) |
---|
[56] | 146 | #if ADAPTIVE_QP_SELECTION |
---|
| 147 | Int* m_pcArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 148 | Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 149 | Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
[121] | 150 | Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d |
---|
[56] | 151 | |
---|
| 152 | static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 153 | static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 154 | static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
| 155 | #endif |
---|
[2] | 156 | |
---|
[56] | 157 | Pel* m_pcIPCMSampleY; ///< PCM sample buffer (Y) |
---|
| 158 | Pel* m_pcIPCMSampleCb; ///< PCM sample buffer (Cb) |
---|
| 159 | Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) |
---|
| 160 | |
---|
| 161 | Int* m_piSliceSUMap; ///< pointer of slice ID map |
---|
| 162 | std::vector<NDBFBlockInfo> m_vNDFBlock; |
---|
| 163 | |
---|
[2] | 164 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 165 | // neighbour access variables |
---|
| 166 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 167 | |
---|
| 168 | TComDataCU* m_pcCUAboveLeft; ///< pointer of above-left CU |
---|
| 169 | TComDataCU* m_pcCUAboveRight; ///< pointer of above-right CU |
---|
| 170 | TComDataCU* m_pcCUAbove; ///< pointer of above CU |
---|
| 171 | TComDataCU* m_pcCULeft; ///< pointer of left CU |
---|
| 172 | TComDataCU* m_apcCUColocated[2]; ///< pointer of temporally colocated CU's for both directions |
---|
| 173 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
| 174 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
| 175 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
| 176 | TComMv m_cMvPred; ///< motion vector predictor |
---|
| 177 | |
---|
| 178 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 179 | // coding tool information |
---|
| 180 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 181 | |
---|
| 182 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
| 183 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
[56] | 184 | #if AMP_MRG |
---|
| 185 | Bool m_bIsMergeAMP; |
---|
| 186 | #endif |
---|
| 187 | UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) |
---|
| 188 | UChar* m_puhChromaIntraDir; ///< array of intra directions (chroma) |
---|
| 189 | UChar* m_puhInterDir; ///< array of inter directions |
---|
| 190 | Char* m_apiMVPIdx[2]; ///< array of motion vector predictor candidates |
---|
| 191 | Char* m_apiMVPNum[2]; ///< array of number of possible motion vectors predictors |
---|
| 192 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
[608] | 193 | #if H_3D_NBDV |
---|
| 194 | DisInfo* m_pDvInfo; |
---|
[5] | 195 | #endif |
---|
[608] | 196 | #if H_3D_VSP |
---|
| 197 | Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not |
---|
| 198 | ///< 0: non-VSP; 1: VSP |
---|
| 199 | #endif |
---|
| 200 | #if H_3D_ARP |
---|
[443] | 201 | UChar* m_puhARPW; |
---|
| 202 | #endif |
---|
[608] | 203 | #if H_3D_IC |
---|
| 204 | Bool* m_pbICFlag; ///< array of IC flags |
---|
| 205 | #endif |
---|
| 206 | #if H_3D_DIM |
---|
| 207 | Pel* m_dimDeltaDC[DIM_NUM_TYPE][2]; |
---|
| 208 | #if H_3D_DIM_DMM |
---|
| 209 | UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; |
---|
| 210 | UInt* m_dmm3IntraTabIdx; |
---|
| 211 | #endif |
---|
| 212 | #if H_3D_DIM_RBC |
---|
[100] | 213 | UChar* m_pucEdgeCode; ///< array of edge code |
---|
| 214 | UChar* m_pucEdgeNumber; ///< total number of edge |
---|
| 215 | UChar* m_pucEdgeStartPos; ///< starting point position |
---|
| 216 | Bool* m_pbEdgeLeftFirst; ///< true if edge should be checked in left boundary first |
---|
| 217 | Bool* m_pbEdgePartition; ///< true if it belongs to region 1, otherwise, region 0 |
---|
| 218 | #endif |
---|
[608] | 219 | #if H_3D_DIM_SDC |
---|
| 220 | Bool* m_pbSDCFlag; |
---|
| 221 | Pel* m_apSegmentDCOffset[2]; |
---|
[100] | 222 | #endif |
---|
[608] | 223 | #endif |
---|
[655] | 224 | #if H_3D_INTER_SDC |
---|
[608] | 225 | Bool* m_pbInterSDCFlag; |
---|
| 226 | Int* m_apSegmentInterDCOffset[4]; |
---|
| 227 | UChar* m_pucInterSDCMask; |
---|
| 228 | #endif |
---|
[708] | 229 | #if ETRIKHU_MERGE_REUSE_F0093 |
---|
| 230 | Bool m_bAvailableFlagA1; ///< A1 available flag |
---|
| 231 | Bool m_bAvailableFlagB1; ///< B1 available flag |
---|
| 232 | Bool m_bAvailableFlagB0; ///< B0 available flag |
---|
| 233 | Bool m_bAvailableFlagA0; ///< A0 available flag |
---|
| 234 | Bool m_bAvailableFlagB2; ///< B2 available flag |
---|
| 235 | #endif |
---|
[56] | 236 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 237 | // misc. variables |
---|
| 238 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 239 | |
---|
| 240 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
| 241 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
[608] | 242 | #if H_3D_VSO |
---|
[189] | 243 | Dist m_uiTotalDistortion; ///< sum of partition distortion |
---|
[608] | 244 | #else |
---|
| 245 | UInt m_uiTotalDistortion; ///< sum of partition distortion |
---|
| 246 | #endif |
---|
[56] | 247 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
| 248 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
[608] | 249 | UInt* m_sliceStartCU; ///< Start CU address of current slice |
---|
| 250 | UInt* m_sliceSegmentStartCU; ///< Start CU address of current slice |
---|
| 251 | Char m_codedQP; |
---|
[708] | 252 | #if ETRIKHU_MERGE_REUSE_F0093 |
---|
| 253 | DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing |
---|
| 254 | #endif |
---|
| 255 | |
---|
[2] | 256 | protected: |
---|
| 257 | |
---|
| 258 | /// add possible motion vector predictor candidates |
---|
| 259 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 260 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
[608] | 261 | #if H_3D_VSP |
---|
[708] | 262 | #if ETRIKHU_MERGE_REUSE_F0093 |
---|
[622] | 263 | Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, |
---|
[708] | 264 | Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo); |
---|
| 265 | #else |
---|
| 266 | Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount, |
---|
[608] | 267 | Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag ); |
---|
[296] | 268 | #endif |
---|
[708] | 269 | #endif |
---|
[622] | 270 | #if H_3D_IV_MERGE |
---|
[708] | 271 | #if ETRIKHU_MERGE_REUSE_F0093 |
---|
[622] | 272 | Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, |
---|
[708] | 273 | Int* ivCandRefIdx, Int posIvDC, Int* vspFlag, Int &iCount3DV, InheritedVSPDisInfo* inheritedVSPDisInfo ); |
---|
| 274 | #else |
---|
| 275 | Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* ivCandDir, TComMv* ivCandMv, |
---|
[622] | 276 | Int* ivCandRefIdx, Int posIvDC, Int* vspFlag ); |
---|
[708] | 277 | #endif |
---|
[622] | 278 | Bool xGetPosFirstAvailDmvCand( Int iCount, TComMvField* pcMvFieldNeighbours, Int* ivCandDir, Int posIvDC, Int* vspFlag, Int& iFirDispCand ); |
---|
[443] | 279 | #endif |
---|
[608] | 280 | |
---|
| 281 | Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
[296] | 282 | Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx |
---|
[608] | 283 | #if H_3D_TMVP |
---|
[296] | 284 | , |
---|
[608] | 285 | Bool bMRG = true |
---|
[296] | 286 | #endif |
---|
| 287 | ); |
---|
[2] | 288 | |
---|
| 289 | /// compute required bits to encode MVD (used in AMVP) |
---|
| 290 | UInt xGetMvdBits ( TComMv cMvd ); |
---|
| 291 | UInt xGetComponentBits ( Int iVal ); |
---|
| 292 | |
---|
| 293 | /// compute scaling factor from POC difference |
---|
[608] | 294 | #if !H_3D_ARP |
---|
[2] | 295 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[443] | 296 | #endif |
---|
[56] | 297 | |
---|
[608] | 298 | Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
[56] | 299 | |
---|
[2] | 300 | public: |
---|
| 301 | TComDataCU(); |
---|
| 302 | virtual ~TComDataCU(); |
---|
| 303 | |
---|
| 304 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 305 | // create / destroy / initialize / copy |
---|
| 306 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 307 | #if H_3D_ARP |
---|
[443] | 308 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[608] | 309 | #endif |
---|
[56] | 310 | Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
| 311 | #if ADAPTIVE_QP_SELECTION |
---|
| 312 | , Bool bGlobalRMARLBuffer = false |
---|
| 313 | #endif |
---|
| 314 | ); |
---|
[2] | 315 | Void destroy (); |
---|
| 316 | |
---|
| 317 | Void initCU ( TComPic* pcPic, UInt uiCUAddr ); |
---|
[56] | 318 | Void initEstData ( UInt uiDepth, Int qp ); |
---|
| 319 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
| 320 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 321 | #if H_3D_NBDV |
---|
[443] | 322 | Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); |
---|
| 323 | #endif |
---|
[2] | 324 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[608] | 325 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList |
---|
| 326 | #if H_3D_NBDV |
---|
[443] | 327 | , Bool bNBDV = false |
---|
| 328 | #endif |
---|
| 329 | ); |
---|
[608] | 330 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[2] | 331 | |
---|
| 332 | Void copyToPic ( UChar uiDepth ); |
---|
| 333 | Void copyToPic ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth ); |
---|
| 334 | |
---|
| 335 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 336 | // member functions for CU description |
---|
| 337 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 338 | |
---|
| 339 | TComPic* getPic () { return m_pcPic; } |
---|
| 340 | TComSlice* getSlice () { return m_pcSlice; } |
---|
| 341 | UInt& getAddr () { return m_uiCUAddr; } |
---|
| 342 | UInt& getZorderIdxInCU () { return m_uiAbsIdxInLCU; } |
---|
[56] | 343 | UInt getSCUAddr (); |
---|
[2] | 344 | UInt getCUPelX () { return m_uiCUPelX; } |
---|
| 345 | UInt getCUPelY () { return m_uiCUPelY; } |
---|
| 346 | TComPattern* getPattern () { return m_pcPattern; } |
---|
| 347 | |
---|
| 348 | UChar* getDepth () { return m_puhDepth; } |
---|
| 349 | UChar getDepth ( UInt uiIdx ) { return m_puhDepth[uiIdx]; } |
---|
| 350 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
| 351 | |
---|
[56] | 352 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
[608] | 353 | #if H_3D |
---|
[56] | 354 | Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ); |
---|
[5] | 355 | #endif |
---|
[608] | 356 | |
---|
| 357 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 358 | // member functions for CU data |
---|
| 359 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 360 | |
---|
[56] | 361 | Char* getPartitionSize () { return m_pePartSize; } |
---|
| 362 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
[2] | 363 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
| 364 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 365 | Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 366 | |
---|
[608] | 367 | Bool* getSkipFlag () { return m_skipFlag; } |
---|
| 368 | Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } |
---|
| 369 | Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } |
---|
| 370 | Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); |
---|
| 371 | |
---|
[56] | 372 | Char* getPredictionMode () { return m_pePredMode; } |
---|
| 373 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
[608] | 374 | Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } |
---|
| 375 | Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } |
---|
[2] | 376 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
| 377 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 378 | |
---|
| 379 | UChar* getWidth () { return m_puhWidth; } |
---|
| 380 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
| 381 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
| 382 | |
---|
| 383 | UChar* getHeight () { return m_puhHeight; } |
---|
| 384 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
| 385 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
| 386 | |
---|
| 387 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 388 | |
---|
[56] | 389 | Char* getQP () { return m_phQP; } |
---|
| 390 | Char getQP ( UInt uiIdx ) { return m_phQP[uiIdx]; } |
---|
| 391 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
| 392 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 393 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
| 394 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
[608] | 395 | Void setQPSubCUs ( Int qp, TComDataCU* pcCU, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); |
---|
| 396 | Void setCodedQP ( Char qp ) { m_codedQP = qp; } |
---|
| 397 | Char getCodedQP () { return m_codedQP; } |
---|
[56] | 398 | |
---|
| 399 | Bool isLosslessCoded(UInt absPartIdx); |
---|
[2] | 400 | |
---|
| 401 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
| 402 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
| 403 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 404 | |
---|
| 405 | UChar* getTransformSkip ( TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]];} |
---|
| 406 | UChar getTransformSkip ( UInt uiIdx,TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]][uiIdx];} |
---|
| 407 | Void setTransformSkipSubParts ( UInt useTransformSkip, TextType eType, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 408 | Void setTransformSkipSubParts ( UInt useTransformSkipY, UInt useTransformSkipU, UInt useTransformSkipV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 409 | |
---|
[56] | 410 | UInt getQuadtreeTULog2MinSizeInCU( UInt absPartIdx ); |
---|
[2] | 411 | |
---|
| 412 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
| 413 | |
---|
| 414 | TCoeff*& getCoeffY () { return m_pcTrCoeffY; } |
---|
| 415 | TCoeff*& getCoeffCb () { return m_pcTrCoeffCb; } |
---|
| 416 | TCoeff*& getCoeffCr () { return m_pcTrCoeffCr; } |
---|
[56] | 417 | #if ADAPTIVE_QP_SELECTION |
---|
| 418 | Int*& getArlCoeffY () { return m_pcArlCoeffY; } |
---|
| 419 | Int*& getArlCoeffCb () { return m_pcArlCoeffCb; } |
---|
| 420 | Int*& getArlCoeffCr () { return m_pcArlCoeffCr; } |
---|
| 421 | #endif |
---|
[2] | 422 | |
---|
[56] | 423 | Pel*& getPCMSampleY () { return m_pcIPCMSampleY; } |
---|
| 424 | Pel*& getPCMSampleCb () { return m_pcIPCMSampleCb; } |
---|
| 425 | Pel*& getPCMSampleCr () { return m_pcIPCMSampleCr; } |
---|
| 426 | |
---|
[2] | 427 | UChar getCbf ( UInt uiIdx, TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx]; } |
---|
| 428 | UChar* getCbf ( TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]]; } |
---|
| 429 | UChar getCbf ( UInt uiIdx, TextType eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
| 430 | Void setCbf ( UInt uiIdx, TextType eType, UChar uh ) { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh; } |
---|
| 431 | Void clearCbf ( UInt uiIdx, TextType eType, UInt uiNumParts ); |
---|
| 432 | UChar getQtRootCbf ( UInt uiIdx ) { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); } |
---|
| 433 | |
---|
| 434 | Void setCbfSubParts ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 435 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 436 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 437 | |
---|
| 438 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 439 | // member functions for coding tool information |
---|
| 440 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 441 | |
---|
| 442 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
| 443 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
| 444 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
| 445 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 446 | |
---|
| 447 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
| 448 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
| 449 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
| 450 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 451 | template <typename T> |
---|
| 452 | Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[622] | 453 | #if H_3D_VSP |
---|
[608] | 454 | template<typename T> |
---|
| 455 | Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[189] | 456 | #endif |
---|
[56] | 457 | #if AMP_MRG |
---|
| 458 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
| 459 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
[5] | 460 | #endif |
---|
[2] | 461 | |
---|
| 462 | UChar* getLumaIntraDir () { return m_puhLumaIntraDir; } |
---|
| 463 | UChar getLumaIntraDir ( UInt uiIdx ) { return m_puhLumaIntraDir[uiIdx]; } |
---|
| 464 | Void setLumaIntraDir ( UInt uiIdx, UChar uh ) { m_puhLumaIntraDir[uiIdx] = uh; } |
---|
| 465 | Void setLumaIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 466 | |
---|
| 467 | UChar* getChromaIntraDir () { return m_puhChromaIntraDir; } |
---|
| 468 | UChar getChromaIntraDir ( UInt uiIdx ) { return m_puhChromaIntraDir[uiIdx]; } |
---|
| 469 | Void setChromaIntraDir ( UInt uiIdx, UChar uh ) { m_puhChromaIntraDir[uiIdx] = uh; } |
---|
| 470 | Void setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 471 | |
---|
| 472 | UChar* getInterDir () { return m_puhInterDir; } |
---|
| 473 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
| 474 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
| 475 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 476 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
| 477 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
| 478 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
| 479 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 480 | #if H_3D_NBDV |
---|
| 481 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 482 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); |
---|
| 483 | DisInfo* getDvInfo () { return m_pDvInfo; } |
---|
| 484 | DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } |
---|
| 485 | #endif |
---|
[56] | 486 | /// get slice ID for SU |
---|
| 487 | Int getSUSliceID (UInt uiIdx) {return m_piSliceSUMap[uiIdx]; } |
---|
[2] | 488 | |
---|
[56] | 489 | /// get the pointer of slice ID map |
---|
| 490 | Int* getSliceSUMap () {return m_piSliceSUMap; } |
---|
[2] | 491 | |
---|
[56] | 492 | /// set the pointer of slice ID map |
---|
| 493 | Void setSliceSUMap (Int *pi) {m_piSliceSUMap = pi; } |
---|
[2] | 494 | |
---|
[56] | 495 | std::vector<NDBFBlockInfo>* getNDBFilterBlocks() {return &m_vNDFBlock;} |
---|
| 496 | Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight |
---|
[608] | 497 | ,std::vector<Bool>& LFCrossSliceBoundary |
---|
[56] | 498 | ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary |
---|
| 499 | ,Bool bIndependentTileBoundaryEnabled ); |
---|
[608] | 500 | #if H_3D_NBDV |
---|
| 501 | Void xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb ); |
---|
| 502 | Bool xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, |
---|
| 503 | UInt uiMvpDvPos |
---|
| 504 | #if H_3D_NBDV_REF |
---|
| 505 | , Bool bDepthRefine = false |
---|
| 506 | #endif |
---|
| 507 | ); |
---|
| 508 | Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); |
---|
| 509 | Bool getDisMvpCandNBDV ( DisInfo* pDInfo |
---|
| 510 | #if H_3D_NBDV_REF |
---|
| 511 | , Bool bDepthRefine = false |
---|
[189] | 512 | #endif |
---|
[608] | 513 | ); |
---|
| 514 | |
---|
[708] | 515 | #if ETRIKHU_MERGE_REUSE_F0093 |
---|
| 516 | Void rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo* inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV); |
---|
| 517 | #endif |
---|
[669] | 518 | #if QC_DEPTH_IV_MRG_F0125 |
---|
| 519 | Bool getDispNeighBlocks ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); |
---|
| 520 | Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); |
---|
| 521 | #endif |
---|
| 522 | |
---|
[608] | 523 | #if H_3D_NBDV_REF |
---|
| 524 | Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); |
---|
| 525 | Void estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred ); |
---|
| 526 | #endif //H_3D_NBDV_REF |
---|
[443] | 527 | #endif |
---|
[655] | 528 | #if H_3D_FAST_TEXTURE_ENCODING |
---|
[608] | 529 | Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); |
---|
[56] | 530 | #endif |
---|
[608] | 531 | #if H_3D_IV_MERGE |
---|
[669] | 532 | Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc |
---|
| 533 | #if QC_DEPTH_IV_MRG_F0125 |
---|
| 534 | , Bool bIsDepth |
---|
[5] | 535 | #endif |
---|
[669] | 536 | ); |
---|
| 537 | #endif |
---|
[608] | 538 | #if H_3D_ARP |
---|
| 539 | UChar* getARPW () { return m_puhARPW; } |
---|
| 540 | UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } |
---|
| 541 | Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } |
---|
| 542 | Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 543 | Double getARPWFactor ( UInt uiIdx ); |
---|
[443] | 544 | #endif |
---|
[608] | 545 | #if H_3D_IC |
---|
| 546 | Bool* getICFlag () { return m_pbICFlag; } |
---|
| 547 | Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } |
---|
| 548 | Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } |
---|
| 549 | Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 550 | Bool isICFlagRequired ( UInt uiAbsPartIdx ); |
---|
| 551 | Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); |
---|
| 552 | #else |
---|
[2] | 553 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 554 | // member functions for accessing partition information |
---|
| 555 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 556 | |
---|
| 557 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); |
---|
[77] | 558 | #endif |
---|
[2] | 559 | UChar getNumPartInter (); |
---|
| 560 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 561 | |
---|
| 562 | #if H_3D_DIM |
---|
| 563 | Pel* getDimDeltaDC ( UInt dimType, UInt segId ) { return m_dimDeltaDC[dimType][segId]; } |
---|
| 564 | Pel getDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx ) { return m_dimDeltaDC[dimType][segId][uiIdx]; } |
---|
| 565 | Void setDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val; } |
---|
| 566 | #if H_3D_DIM_DMM |
---|
| 567 | UInt* getDmmWedgeTabIdx ( UInt dmmType ) { return m_dmmWedgeTabIdx[dmmType]; } |
---|
| 568 | UInt getDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx ) { return m_dmmWedgeTabIdx[dmmType][uiIdx]; } |
---|
| 569 | Void setDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; } |
---|
| 570 | Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 571 | |
---|
| 572 | UInt* getDmm3IntraTabIdx () { return m_dmm3IntraTabIdx; } |
---|
| 573 | UInt getDmm3IntraTabIdx ( UInt uiIdx ) { return m_dmm3IntraTabIdx[uiIdx]; } |
---|
| 574 | Void setDmm3IntraTabIdx ( UInt uiIdx, UInt uh ) { m_dmm3IntraTabIdx[uiIdx] = uh; } |
---|
| 575 | Void setDmm3IntraTabIdxSubParts ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 576 | #endif |
---|
| 577 | #if H_3D_DIM_RBC |
---|
| 578 | UChar* getEdgeCode( UInt uiIdx ) { return &m_pucEdgeCode[uiIdx * RBC_MAX_EDGE_NUM_PER_4x4]; } |
---|
| 579 | |
---|
| 580 | UChar* getEdgeNumber( ) { return m_pucEdgeNumber; } |
---|
| 581 | UChar getEdgeNumber( UInt uiIdx ) { return m_pucEdgeNumber[uiIdx]; } |
---|
| 582 | Void setEdgeNumber( UInt uiIdx, UChar val ) { m_pucEdgeNumber[uiIdx] = val; } |
---|
| 583 | |
---|
| 584 | UChar* getEdgeStartPos( ) { return m_pucEdgeStartPos; } |
---|
| 585 | UChar getEdgeStartPos( UInt uiIdx ) { return m_pucEdgeStartPos[uiIdx]; } |
---|
| 586 | Void setEdgeStartPos( UInt uiIdx, UChar val ) { m_pucEdgeStartPos[uiIdx] = val; } |
---|
| 587 | |
---|
| 588 | Bool* getEdgeLeftFirst( ) { return m_pbEdgeLeftFirst; } |
---|
| 589 | Bool getEdgeLeftFirst( UInt uiIdx ) { return m_pbEdgeLeftFirst[uiIdx]; } |
---|
| 590 | Void setEdgeLeftFirst( UInt uiIdx, Bool val ) { m_pbEdgeLeftFirst[uiIdx] = val; } |
---|
| 591 | |
---|
| 592 | Bool* getEdgePartition( UInt uiIdx ) { return &m_pbEdgePartition[uiIdx * 16]; } |
---|
| 593 | |
---|
| 594 | Void reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion ); |
---|
| 595 | #endif |
---|
| 596 | #if H_3D_DIM_SDC |
---|
| 597 | Bool* getSDCFlag () { return m_pbSDCFlag; } |
---|
| 598 | Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } |
---|
| 599 | Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 600 | |
---|
[608] | 601 | Bool getSDCAvailable ( UInt uiAbsPartIdx ); |
---|
| 602 | |
---|
| 603 | Pel* getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; } |
---|
| 604 | Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } |
---|
| 605 | Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } |
---|
| 606 | #endif |
---|
| 607 | #endif |
---|
[655] | 608 | #if H_3D_INTER_SDC |
---|
[608] | 609 | Bool* getInterSDCFlag () { return m_pbInterSDCFlag; } |
---|
| 610 | Bool getInterSDCFlag ( UInt uiIdx ) { return m_pbInterSDCFlag[uiIdx]; } |
---|
| 611 | Void setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 612 | UInt getCtxInterSDCFlag ( UInt uiAbsPartIdx ); |
---|
| 613 | Int* getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; } |
---|
| 614 | Int getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; } |
---|
| 615 | Void setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; } |
---|
| 616 | |
---|
| 617 | Void xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask ); |
---|
| 618 | |
---|
| 619 | UChar* getInterSDCMask () { return m_pucInterSDCMask; } |
---|
| 620 | #endif |
---|
| 621 | |
---|
[2] | 622 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 623 | // member functions for motion vector |
---|
| 624 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 625 | |
---|
| 626 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
| 627 | |
---|
[608] | 628 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
[56] | 629 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
| 630 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
[2] | 631 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
| 632 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
[56] | 633 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
| 634 | |
---|
[2] | 635 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
| 636 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
[56] | 637 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
[2] | 638 | |
---|
| 639 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 640 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 641 | |
---|
| 642 | Void clipMv ( TComMv& rcMv ); |
---|
| 643 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
| 644 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
| 645 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
[655] | 646 | #if H_3D |
---|
| 647 | Void compressMV ( Int scale ); |
---|
[608] | 648 | #else |
---|
[2] | 649 | Void compressMV (); |
---|
[608] | 650 | #endif |
---|
[2] | 651 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 652 | // utility functions for neighbouring information |
---|
| 653 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 654 | |
---|
| 655 | TComDataCU* getCULeft () { return m_pcCULeft; } |
---|
| 656 | TComDataCU* getCUAbove () { return m_pcCUAbove; } |
---|
| 657 | TComDataCU* getCUAboveLeft () { return m_pcCUAboveLeft; } |
---|
| 658 | TComDataCU* getCUAboveRight () { return m_pcCUAboveRight; } |
---|
| 659 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
[56] | 660 | |
---|
| 661 | |
---|
[608] | 662 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, |
---|
| 663 | UInt uiCurrPartUnitIdx, |
---|
| 664 | Bool bEnforceSliceRestriction=true, |
---|
| 665 | Bool bEnforceTileRestriction=true ); |
---|
| 666 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, |
---|
| 667 | UInt uiCurrPartUnitIdx, |
---|
| 668 | Bool bEnforceSliceRestriction=true, |
---|
| 669 | Bool planarAtLCUBoundary = false, |
---|
| 670 | Bool bEnforceTileRestriction=true ); |
---|
| 671 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 672 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 673 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
[56] | 674 | |
---|
[608] | 675 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU ); |
---|
| 676 | TComDataCU* getQpMinCuAbove ( UInt& aPartUnitIdx , UInt currAbsIdxInLCU ); |
---|
[56] | 677 | Char getRefQP ( UInt uiCurrAbsIdxInLCU ); |
---|
| 678 | |
---|
[608] | 679 | TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 680 | TComDataCU* getPUBelowLeftAdi ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
[2] | 681 | |
---|
[608] | 682 | Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 683 | Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[2] | 684 | |
---|
| 685 | Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 686 | Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 687 | |
---|
| 688 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
[708] | 689 | |
---|
| 690 | #if ETRIKHU_MERGE_REUSE_F0093 |
---|
| 691 | Bool getAvailableFlagA1() { return m_bAvailableFlagA1;} |
---|
| 692 | Bool getAvailableFlagB1() { return m_bAvailableFlagB1;} |
---|
| 693 | Bool getAvailableFlagB0() { return m_bAvailableFlagB0;} |
---|
| 694 | Bool getAvailableFlagA0() { return m_bAvailableFlagA0;} |
---|
| 695 | Bool getAvailableFlagB2() { return m_bAvailableFlagB2;} |
---|
| 696 | Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } |
---|
| 697 | Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); |
---|
| 698 | Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 699 | #else |
---|
| 700 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 701 | #endif |
---|
[608] | 702 | #if H_3D_VSP |
---|
| 703 | , Int* vspFlag |
---|
| 704 | , InheritedVSPDisInfo* inheritedVSPDisInfo |
---|
[443] | 705 | #endif |
---|
[608] | 706 | , Int& numValidMergeCand, Int mrgCandIdx = -1 ); |
---|
[622] | 707 | |
---|
[608] | 708 | #if H_3D_VSP |
---|
[622] | 709 | inline Void xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo* inheritedVSPDisInfo); |
---|
| 710 | |
---|
[608] | 711 | Char* getVSPFlag () { return m_piVSPFlag; } |
---|
| 712 | Char getVSPFlag ( UInt uiIdx ) { return m_piVSPFlag[uiIdx]; } |
---|
| 713 | Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } |
---|
| 714 | Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 715 | #endif |
---|
| 716 | Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 717 | Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[2] | 718 | |
---|
| 719 | |
---|
| 720 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 721 | // member functions for modes |
---|
| 722 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 723 | |
---|
| 724 | Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
| 725 | Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) |
---|
[608] | 726 | Bool isBipredRestriction( UInt puIdx ); |
---|
| 727 | |
---|
[2] | 728 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 729 | // member functions for symbol prediction (most probable / mode conversion) |
---|
| 730 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 731 | |
---|
| 732 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
| 733 | |
---|
[56] | 734 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
| 735 | Int getIntraDirLumaPredictor ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL ); |
---|
[2] | 736 | |
---|
| 737 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 738 | // member functions for SBAC context |
---|
| 739 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 740 | |
---|
| 741 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 742 | UInt getCtxQtCbf ( TextType eType, UInt uiTrDepth ); |
---|
[56] | 743 | |
---|
[2] | 744 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 745 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
| 746 | |
---|
| 747 | #if H_3D_ARP |
---|
| 748 | UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); |
---|
| 749 | #endif |
---|
| 750 | #if H_3D_IC |
---|
[189] | 751 | UInt getCtxICFlag ( UInt uiAbsPartIdx ); |
---|
| 752 | #endif |
---|
[608] | 753 | UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
| 754 | UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
[56] | 755 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
[2] | 756 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 757 | // member functions for RD cost storage |
---|
| 758 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 759 | |
---|
| 760 | Double& getTotalCost() { return m_dTotalCost; } |
---|
[608] | 761 | #if H_3D_VSO |
---|
[189] | 762 | Dist& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
[608] | 763 | #else |
---|
| 764 | UInt& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
| 765 | #endif |
---|
[2] | 766 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
| 767 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
| 768 | |
---|
| 769 | UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); |
---|
| 770 | |
---|
| 771 | }; |
---|
| 772 | |
---|
[56] | 773 | namespace RasterAddress |
---|
| 774 | { |
---|
| 775 | /** Check whether 2 addresses point to the same column |
---|
| 776 | * \param addrA First address in raster scan order |
---|
| 777 | * \param addrB Second address in raters scan order |
---|
| 778 | * \param numUnitsPerRow Number of units in a row |
---|
| 779 | * \return Result of test |
---|
| 780 | */ |
---|
| 781 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 782 | { |
---|
| 783 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
| 784 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 785 | } |
---|
| 786 | |
---|
| 787 | /** Check whether 2 addresses point to the same row |
---|
| 788 | * \param addrA First address in raster scan order |
---|
| 789 | * \param addrB Second address in raters scan order |
---|
| 790 | * \param numUnitsPerRow Number of units in a row |
---|
| 791 | * \return Result of test |
---|
| 792 | */ |
---|
| 793 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 794 | { |
---|
| 795 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
| 796 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 797 | } |
---|
| 798 | |
---|
| 799 | /** Check whether 2 addresses point to the same row or column |
---|
| 800 | * \param addrA First address in raster scan order |
---|
| 801 | * \param addrB Second address in raters scan order |
---|
| 802 | * \param numUnitsPerRow Number of units in a row |
---|
| 803 | * \return Result of test |
---|
| 804 | */ |
---|
| 805 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 806 | { |
---|
| 807 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
| 808 | } |
---|
| 809 | |
---|
| 810 | /** Check whether one address points to the first column |
---|
| 811 | * \param addr Address in raster scan order |
---|
| 812 | * \param numUnitsPerRow Number of units in a row |
---|
| 813 | * \return Result of test |
---|
| 814 | */ |
---|
| 815 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
| 816 | { |
---|
| 817 | // addr % numUnitsPerRow == 0 |
---|
| 818 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 819 | } |
---|
| 820 | |
---|
| 821 | /** Check whether one address points to the first row |
---|
| 822 | * \param addr Address in raster scan order |
---|
| 823 | * \param numUnitsPerRow Number of units in a row |
---|
| 824 | * \return Result of test |
---|
| 825 | */ |
---|
| 826 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
| 827 | { |
---|
| 828 | // addr / numUnitsPerRow == 0 |
---|
| 829 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 830 | } |
---|
| 831 | |
---|
| 832 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
| 833 | * \param addr Address in raster scan order |
---|
| 834 | * \param val Given column index value |
---|
| 835 | * \param numUnitsPerRow Number of units in a row |
---|
| 836 | * \return Result of test |
---|
| 837 | */ |
---|
| 838 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 839 | { |
---|
| 840 | // addr % numUnitsPerRow < val |
---|
| 841 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
| 842 | } |
---|
| 843 | |
---|
| 844 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
| 845 | * \param addr Address in raster scan order |
---|
| 846 | * \param val Given row index value |
---|
| 847 | * \param numUnitsPerRow Number of units in a row |
---|
| 848 | * \return Result of test |
---|
| 849 | */ |
---|
| 850 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 851 | { |
---|
| 852 | // addr / numUnitsPerRow < val |
---|
| 853 | return addr < val * numUnitsPerRow; |
---|
| 854 | } |
---|
| 855 | }; |
---|
| 856 | |
---|
| 857 | //! \} |
---|
| 858 | |
---|
[2] | 859 | #endif |
---|