[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 | * |
---|
[872] | 6 | * Copyright (c) 2010-2014, 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 | |
---|
| 61 | |
---|
[833] | 62 | #if H_3D_DBBP |
---|
| 63 | typedef struct _DBBPTmpData |
---|
| 64 | { |
---|
| 65 | TComMv acMvd[2][2]; // for two segments and two lists |
---|
| 66 | TComMvField acMvField[2][2]; // for two segments and two lists |
---|
| 67 | Int aiMvpNum[2][2]; // for two segments and two lists |
---|
| 68 | Int aiMvpIdx[2][2]; // for two segments and two lists |
---|
| 69 | UChar auhInterDir[2]; // for two segments |
---|
| 70 | Bool abMergeFlag[2]; // for two segments |
---|
| 71 | UChar auhMergeIndex[2]; // for two segments |
---|
| 72 | PartSize eVirtualPartSize; |
---|
| 73 | UInt uiVirtualPartIndex; |
---|
| 74 | } DBBPTmpData; |
---|
| 75 | #endif |
---|
[56] | 76 | |
---|
| 77 | // ==================================================================================================================== |
---|
[2] | 78 | // Class definition |
---|
| 79 | // ==================================================================================================================== |
---|
| 80 | |
---|
| 81 | /// CU data structure class |
---|
| 82 | class TComDataCU |
---|
| 83 | { |
---|
| 84 | private: |
---|
| 85 | |
---|
| 86 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 87 | // class pointers |
---|
| 88 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 89 | |
---|
| 90 | TComPic* m_pcPic; ///< picture class pointer |
---|
| 91 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
| 92 | TComPattern* m_pcPattern; ///< neighbour access class pointer |
---|
| 93 | |
---|
| 94 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 95 | // CU description |
---|
| 96 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 97 | |
---|
| 98 | UInt m_uiCUAddr; ///< CU address in a slice |
---|
| 99 | UInt m_uiAbsIdxInLCU; ///< absolute address in a CU. It's Z scan order |
---|
| 100 | UInt m_uiCUPelX; ///< CU position in a pixel (X) |
---|
| 101 | UInt m_uiCUPelY; ///< CU position in a pixel (Y) |
---|
| 102 | UInt m_uiNumPartition; ///< total number of minimum partitions in a CU |
---|
| 103 | UChar* m_puhWidth; ///< array of widths |
---|
| 104 | UChar* m_puhHeight; ///< array of heights |
---|
| 105 | UChar* m_puhDepth; ///< array of depths |
---|
[56] | 106 | Int m_unitSize; ///< size of a "minimum partition" |
---|
[2] | 107 | |
---|
| 108 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 109 | // CU data |
---|
| 110 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 111 | Bool* m_skipFlag; ///< array of skip flags |
---|
[1039] | 112 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 113 | Bool* m_singleDepthFlag; ///< array of single depth flags |
---|
| 114 | Pel* m_apSingleDepthValue; |
---|
| 115 | #endif |
---|
[56] | 116 | Char* m_pePartSize; ///< array of partition sizes |
---|
| 117 | Char* m_pePredMode; ///< array of prediction modes |
---|
[608] | 118 | Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags |
---|
[56] | 119 | Char* m_phQP; ///< array of QP values |
---|
[2] | 120 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
[608] | 121 | UChar* m_puhTransformSkip[3];///< array of transform skipping flags |
---|
[2] | 122 | UChar* m_puhCbf[3]; ///< array of coded block flags (CBF) |
---|
| 123 | TComCUMvField m_acCUMvField[2]; ///< array of motion vectors |
---|
| 124 | TCoeff* m_pcTrCoeffY; ///< transformed coefficient buffer (Y) |
---|
| 125 | TCoeff* m_pcTrCoeffCb; ///< transformed coefficient buffer (Cb) |
---|
| 126 | TCoeff* m_pcTrCoeffCr; ///< transformed coefficient buffer (Cr) |
---|
[56] | 127 | #if ADAPTIVE_QP_SELECTION |
---|
| 128 | Int* m_pcArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 129 | Int* m_pcArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 130 | Int* m_pcArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
[121] | 131 | Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d |
---|
[56] | 132 | |
---|
| 133 | static Int* m_pcGlbArlCoeffY; ///< ARL coefficient buffer (Y) |
---|
| 134 | static Int* m_pcGlbArlCoeffCb; ///< ARL coefficient buffer (Cb) |
---|
| 135 | static Int* m_pcGlbArlCoeffCr; ///< ARL coefficient buffer (Cr) |
---|
| 136 | #endif |
---|
[2] | 137 | |
---|
[56] | 138 | Pel* m_pcIPCMSampleY; ///< PCM sample buffer (Y) |
---|
| 139 | Pel* m_pcIPCMSampleCb; ///< PCM sample buffer (Cb) |
---|
| 140 | Pel* m_pcIPCMSampleCr; ///< PCM sample buffer (Cr) |
---|
| 141 | |
---|
[2] | 142 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 143 | // neighbour access variables |
---|
| 144 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 145 | |
---|
| 146 | TComDataCU* m_pcCUAboveLeft; ///< pointer of above-left CU |
---|
| 147 | TComDataCU* m_pcCUAboveRight; ///< pointer of above-right CU |
---|
| 148 | TComDataCU* m_pcCUAbove; ///< pointer of above CU |
---|
| 149 | TComDataCU* m_pcCULeft; ///< pointer of left CU |
---|
| 150 | TComDataCU* m_apcCUColocated[2]; ///< pointer of temporally colocated CU's for both directions |
---|
| 151 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
| 152 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
| 153 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
| 154 | TComMv m_cMvPred; ///< motion vector predictor |
---|
| 155 | |
---|
| 156 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 157 | // coding tool information |
---|
| 158 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 159 | |
---|
| 160 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
| 161 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
[56] | 162 | #if AMP_MRG |
---|
| 163 | Bool m_bIsMergeAMP; |
---|
| 164 | #endif |
---|
| 165 | UChar* m_puhLumaIntraDir; ///< array of intra directions (luma) |
---|
| 166 | UChar* m_puhChromaIntraDir; ///< array of intra directions (chroma) |
---|
| 167 | UChar* m_puhInterDir; ///< array of inter directions |
---|
| 168 | Char* m_apiMVPIdx[2]; ///< array of motion vector predictor candidates |
---|
| 169 | Char* m_apiMVPNum[2]; ///< array of number of possible motion vectors predictors |
---|
| 170 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
[608] | 171 | #if H_3D_NBDV |
---|
| 172 | DisInfo* m_pDvInfo; |
---|
[5] | 173 | #endif |
---|
[608] | 174 | #if H_3D_VSP |
---|
| 175 | Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not |
---|
| 176 | ///< 0: non-VSP; 1: VSP |
---|
| 177 | #endif |
---|
[773] | 178 | #if H_3D_SPIVMP |
---|
[724] | 179 | Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP |
---|
| 180 | ///< 0: non-SPIVMP; 1: SPIVMP |
---|
| 181 | #endif |
---|
[608] | 182 | #if H_3D_ARP |
---|
[443] | 183 | UChar* m_puhARPW; |
---|
| 184 | #endif |
---|
[608] | 185 | #if H_3D_IC |
---|
| 186 | Bool* m_pbICFlag; ///< array of IC flags |
---|
| 187 | #endif |
---|
| 188 | #if H_3D_DIM |
---|
| 189 | Pel* m_dimDeltaDC[DIM_NUM_TYPE][2]; |
---|
| 190 | #if H_3D_DIM_DMM |
---|
| 191 | UInt* m_dmmWedgeTabIdx[DMM_NUM_TYPE]; |
---|
| 192 | #endif |
---|
| 193 | #if H_3D_DIM_SDC |
---|
| 194 | Bool* m_pbSDCFlag; |
---|
| 195 | Pel* m_apSegmentDCOffset[2]; |
---|
[950] | 196 | Pel m_apDmmPredictor[2]; |
---|
[100] | 197 | #endif |
---|
[608] | 198 | #endif |
---|
[833] | 199 | #if H_3D_DBBP |
---|
| 200 | Bool* m_pbDBBPFlag; ///< array of DBBP flags |
---|
| 201 | DBBPTmpData m_sDBBPTmpData; |
---|
| 202 | #endif |
---|
[773] | 203 | #if H_3D |
---|
[724] | 204 | Bool m_bAvailableFlagA1; ///< A1 available flag |
---|
| 205 | Bool m_bAvailableFlagB1; ///< B1 available flag |
---|
| 206 | Bool m_bAvailableFlagB0; ///< B0 available flag |
---|
| 207 | Bool m_bAvailableFlagA0; ///< A0 available flag |
---|
| 208 | Bool m_bAvailableFlagB2; ///< B2 available flag |
---|
| 209 | #endif |
---|
[56] | 210 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 211 | // misc. variables |
---|
| 212 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 213 | |
---|
| 214 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
| 215 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
[608] | 216 | #if H_3D_VSO |
---|
[189] | 217 | Dist m_uiTotalDistortion; ///< sum of partition distortion |
---|
[608] | 218 | #else |
---|
| 219 | UInt m_uiTotalDistortion; ///< sum of partition distortion |
---|
| 220 | #endif |
---|
[56] | 221 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
| 222 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
[608] | 223 | UInt* m_sliceStartCU; ///< Start CU address of current slice |
---|
| 224 | UInt* m_sliceSegmentStartCU; ///< Start CU address of current slice |
---|
| 225 | Char m_codedQP; |
---|
[773] | 226 | #if H_3D |
---|
[724] | 227 | DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing |
---|
| 228 | #endif |
---|
| 229 | |
---|
[884] | 230 | #if H_3D_DDD |
---|
[833] | 231 | UChar* m_pucDisparityDerivedDepth; |
---|
| 232 | Bool* m_pbUseDDD; |
---|
| 233 | Int m_iUseDDDCandIdx; |
---|
| 234 | UChar m_ucDDTmpDepth; |
---|
| 235 | #endif |
---|
| 236 | |
---|
[976] | 237 | #if H_3D_IV_MERGE |
---|
[950] | 238 | TComMotionCand m_mergCands[MRG_IVSHIFT+1]; |
---|
| 239 | Int m_baseListidc; |
---|
| 240 | #endif |
---|
| 241 | |
---|
[2] | 242 | protected: |
---|
| 243 | |
---|
| 244 | /// add possible motion vector predictor candidates |
---|
| 245 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 246 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
[608] | 247 | #if H_3D_VSP |
---|
[950] | 248 | Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount); |
---|
[296] | 249 | #endif |
---|
[622] | 250 | #if H_3D_IV_MERGE |
---|
[950] | 251 | Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ); |
---|
[1039] | 252 | #if! SEC_SIMP_SHIFTED_DV_I0086 |
---|
[950] | 253 | Bool xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand ); |
---|
[443] | 254 | #endif |
---|
[1039] | 255 | #endif |
---|
[608] | 256 | |
---|
| 257 | Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
[296] | 258 | Bool xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx |
---|
[608] | 259 | #if H_3D_TMVP |
---|
[296] | 260 | , |
---|
[608] | 261 | Bool bMRG = true |
---|
[296] | 262 | #endif |
---|
| 263 | ); |
---|
[2] | 264 | |
---|
| 265 | /// compute required bits to encode MVD (used in AMVP) |
---|
| 266 | UInt xGetMvdBits ( TComMv cMvd ); |
---|
| 267 | UInt xGetComponentBits ( Int iVal ); |
---|
| 268 | |
---|
| 269 | /// compute scaling factor from POC difference |
---|
[608] | 270 | #if !H_3D_ARP |
---|
[2] | 271 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[443] | 272 | #endif |
---|
[56] | 273 | |
---|
[608] | 274 | Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
[56] | 275 | |
---|
[884] | 276 | #if H_3D_VSP |
---|
[833] | 277 | Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); |
---|
| 278 | #endif |
---|
| 279 | |
---|
[2] | 280 | public: |
---|
| 281 | TComDataCU(); |
---|
| 282 | virtual ~TComDataCU(); |
---|
| 283 | |
---|
| 284 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 285 | // create / destroy / initialize / copy |
---|
| 286 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 287 | #if H_3D_ARP |
---|
[443] | 288 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[608] | 289 | #endif |
---|
[56] | 290 | Void create ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
| 291 | #if ADAPTIVE_QP_SELECTION |
---|
| 292 | , Bool bGlobalRMARLBuffer = false |
---|
| 293 | #endif |
---|
| 294 | ); |
---|
[2] | 295 | Void destroy (); |
---|
| 296 | |
---|
| 297 | Void initCU ( TComPic* pcPic, UInt uiCUAddr ); |
---|
[872] | 298 | Void initEstData ( UInt uiDepth, Int qp, Bool bTransquantBypass ); |
---|
[56] | 299 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
| 300 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 301 | #if H_3D_NBDV |
---|
[443] | 302 | Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); |
---|
| 303 | #endif |
---|
[2] | 304 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[608] | 305 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList |
---|
| 306 | #if H_3D_NBDV |
---|
[443] | 307 | , Bool bNBDV = false |
---|
| 308 | #endif |
---|
| 309 | ); |
---|
[608] | 310 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[2] | 311 | |
---|
| 312 | Void copyToPic ( UChar uiDepth ); |
---|
| 313 | Void copyToPic ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth ); |
---|
| 314 | |
---|
| 315 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 316 | // member functions for CU description |
---|
| 317 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 318 | |
---|
| 319 | TComPic* getPic () { return m_pcPic; } |
---|
| 320 | TComSlice* getSlice () { return m_pcSlice; } |
---|
| 321 | UInt& getAddr () { return m_uiCUAddr; } |
---|
| 322 | UInt& getZorderIdxInCU () { return m_uiAbsIdxInLCU; } |
---|
[56] | 323 | UInt getSCUAddr (); |
---|
[2] | 324 | UInt getCUPelX () { return m_uiCUPelX; } |
---|
| 325 | UInt getCUPelY () { return m_uiCUPelY; } |
---|
| 326 | TComPattern* getPattern () { return m_pcPattern; } |
---|
| 327 | |
---|
| 328 | UChar* getDepth () { return m_puhDepth; } |
---|
| 329 | UChar getDepth ( UInt uiIdx ) { return m_puhDepth[uiIdx]; } |
---|
| 330 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
| 331 | |
---|
[56] | 332 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
[608] | 333 | #if H_3D |
---|
[56] | 334 | Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ); |
---|
[5] | 335 | #endif |
---|
[608] | 336 | |
---|
| 337 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 338 | // member functions for CU data |
---|
| 339 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 340 | |
---|
[56] | 341 | Char* getPartitionSize () { return m_pePartSize; } |
---|
| 342 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
[2] | 343 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
| 344 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 345 | Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 346 | |
---|
[833] | 347 | #if H_3D_DBBP |
---|
| 348 | Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); |
---|
| 349 | #endif |
---|
| 350 | |
---|
[608] | 351 | Bool* getSkipFlag () { return m_skipFlag; } |
---|
| 352 | Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } |
---|
| 353 | Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } |
---|
| 354 | Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); |
---|
[1039] | 355 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 356 | Bool* getSingleDepthFlag () { return m_singleDepthFlag; } |
---|
| 357 | Bool getSingleDepthFlag (UInt idx) { return m_singleDepthFlag[idx]; } |
---|
| 358 | Void setSingleDepthFlag ( UInt idx, Bool singleDepth) { m_singleDepthFlag[idx] = singleDepth; } |
---|
| 359 | Void setSingleDepthFlagSubParts ( Bool singleDepth, UInt absPartIdx, UInt depth ); |
---|
[608] | 360 | |
---|
[1039] | 361 | Pel* getSingleDepthValue( ) { return m_apSingleDepthValue; } |
---|
| 362 | Pel getSingleDepthValue (UInt idx) { return m_apSingleDepthValue[idx]; } |
---|
| 363 | Void setSingleDepthValue ( UInt idx, Pel pDepthValue) { m_apSingleDepthValue[idx] = pDepthValue; } |
---|
| 364 | Void setSingleDepthValueSubParts (Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ); |
---|
| 365 | #endif |
---|
[56] | 366 | Char* getPredictionMode () { return m_pePredMode; } |
---|
| 367 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
[608] | 368 | Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } |
---|
| 369 | Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } |
---|
[2] | 370 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
| 371 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 372 | |
---|
[833] | 373 | #if H_3D_DBBP |
---|
| 374 | Bool* getDBBPFlag () { return m_pbDBBPFlag; } |
---|
| 375 | Bool getDBBPFlag ( UInt uiIdx ) { return m_pbDBBPFlag[uiIdx]; } |
---|
| 376 | Void setDBBPFlag ( UInt uiIdx, Bool b ) { m_pbDBBPFlag[uiIdx] = b; } |
---|
| 377 | Void setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 378 | DBBPTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; } |
---|
| 379 | #endif |
---|
| 380 | |
---|
[2] | 381 | UChar* getWidth () { return m_puhWidth; } |
---|
| 382 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
| 383 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
| 384 | |
---|
| 385 | UChar* getHeight () { return m_puhHeight; } |
---|
| 386 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
| 387 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
| 388 | |
---|
| 389 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 390 | |
---|
[56] | 391 | Char* getQP () { return m_phQP; } |
---|
| 392 | Char getQP ( UInt uiIdx ) { return m_phQP[uiIdx]; } |
---|
| 393 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
| 394 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 395 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
| 396 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
[608] | 397 | Void setQPSubCUs ( Int qp, TComDataCU* pcCU, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); |
---|
| 398 | Void setCodedQP ( Char qp ) { m_codedQP = qp; } |
---|
| 399 | Char getCodedQP () { return m_codedQP; } |
---|
[56] | 400 | |
---|
| 401 | Bool isLosslessCoded(UInt absPartIdx); |
---|
[2] | 402 | |
---|
| 403 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
| 404 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
| 405 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 406 | |
---|
| 407 | UChar* getTransformSkip ( TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]];} |
---|
| 408 | UChar getTransformSkip ( UInt uiIdx,TextType eType) { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]][uiIdx];} |
---|
| 409 | Void setTransformSkipSubParts ( UInt useTransformSkip, TextType eType, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 410 | Void setTransformSkipSubParts ( UInt useTransformSkipY, UInt useTransformSkipU, UInt useTransformSkipV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 411 | |
---|
[56] | 412 | UInt getQuadtreeTULog2MinSizeInCU( UInt absPartIdx ); |
---|
[2] | 413 | |
---|
| 414 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
| 415 | |
---|
| 416 | TCoeff*& getCoeffY () { return m_pcTrCoeffY; } |
---|
| 417 | TCoeff*& getCoeffCb () { return m_pcTrCoeffCb; } |
---|
| 418 | TCoeff*& getCoeffCr () { return m_pcTrCoeffCr; } |
---|
[56] | 419 | #if ADAPTIVE_QP_SELECTION |
---|
| 420 | Int*& getArlCoeffY () { return m_pcArlCoeffY; } |
---|
| 421 | Int*& getArlCoeffCb () { return m_pcArlCoeffCb; } |
---|
| 422 | Int*& getArlCoeffCr () { return m_pcArlCoeffCr; } |
---|
| 423 | #endif |
---|
[2] | 424 | |
---|
[56] | 425 | Pel*& getPCMSampleY () { return m_pcIPCMSampleY; } |
---|
| 426 | Pel*& getPCMSampleCb () { return m_pcIPCMSampleCb; } |
---|
| 427 | Pel*& getPCMSampleCr () { return m_pcIPCMSampleCr; } |
---|
| 428 | |
---|
[2] | 429 | UChar getCbf ( UInt uiIdx, TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx]; } |
---|
| 430 | UChar* getCbf ( TextType eType ) { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]]; } |
---|
| 431 | UChar getCbf ( UInt uiIdx, TextType eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
| 432 | Void setCbf ( UInt uiIdx, TextType eType, UChar uh ) { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh; } |
---|
| 433 | Void clearCbf ( UInt uiIdx, TextType eType, UInt uiNumParts ); |
---|
| 434 | UChar getQtRootCbf ( UInt uiIdx ) { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); } |
---|
| 435 | |
---|
| 436 | Void setCbfSubParts ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 437 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 438 | Void setCbfSubParts ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 439 | |
---|
| 440 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 441 | // member functions for coding tool information |
---|
| 442 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 443 | |
---|
| 444 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
| 445 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
| 446 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
| 447 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 448 | |
---|
| 449 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
| 450 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
| 451 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
| 452 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 453 | template <typename T> |
---|
| 454 | Void setSubPart ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[622] | 455 | #if H_3D_VSP |
---|
[608] | 456 | template<typename T> |
---|
| 457 | Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[189] | 458 | #endif |
---|
[56] | 459 | #if AMP_MRG |
---|
| 460 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
| 461 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
[5] | 462 | #endif |
---|
[2] | 463 | |
---|
| 464 | UChar* getLumaIntraDir () { return m_puhLumaIntraDir; } |
---|
| 465 | UChar getLumaIntraDir ( UInt uiIdx ) { return m_puhLumaIntraDir[uiIdx]; } |
---|
| 466 | Void setLumaIntraDir ( UInt uiIdx, UChar uh ) { m_puhLumaIntraDir[uiIdx] = uh; } |
---|
| 467 | Void setLumaIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 468 | |
---|
| 469 | UChar* getChromaIntraDir () { return m_puhChromaIntraDir; } |
---|
| 470 | UChar getChromaIntraDir ( UInt uiIdx ) { return m_puhChromaIntraDir[uiIdx]; } |
---|
| 471 | Void setChromaIntraDir ( UInt uiIdx, UChar uh ) { m_puhChromaIntraDir[uiIdx] = uh; } |
---|
| 472 | Void setChromIntraDirSubParts( UInt uiDir, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 473 | |
---|
| 474 | UChar* getInterDir () { return m_puhInterDir; } |
---|
| 475 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
| 476 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
| 477 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 478 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
| 479 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
| 480 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
| 481 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 482 | #if H_3D_NBDV |
---|
| 483 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 484 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); |
---|
| 485 | DisInfo* getDvInfo () { return m_pDvInfo; } |
---|
| 486 | DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } |
---|
| 487 | #endif |
---|
| 488 | #if H_3D_NBDV |
---|
| 489 | Void xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb ); |
---|
| 490 | Bool xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, |
---|
| 491 | UInt uiMvpDvPos |
---|
| 492 | #if H_3D_NBDV_REF |
---|
| 493 | , Bool bDepthRefine = false |
---|
| 494 | #endif |
---|
| 495 | ); |
---|
| 496 | Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); |
---|
| 497 | Bool getDisMvpCandNBDV ( DisInfo* pDInfo |
---|
| 498 | #if H_3D_NBDV_REF |
---|
| 499 | , Bool bDepthRefine = false |
---|
[189] | 500 | #endif |
---|
[608] | 501 | ); |
---|
| 502 | |
---|
[773] | 503 | #if H_3D |
---|
[833] | 504 | Bool getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); |
---|
[724] | 505 | Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); |
---|
| 506 | #endif |
---|
[1039] | 507 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 508 | Bool getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index); |
---|
| 509 | #endif |
---|
[608] | 510 | #if H_3D_NBDV_REF |
---|
| 511 | Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); |
---|
| 512 | Void estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred ); |
---|
| 513 | #endif //H_3D_NBDV_REF |
---|
[443] | 514 | #endif |
---|
[655] | 515 | #if H_3D_FAST_TEXTURE_ENCODING |
---|
[608] | 516 | Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); |
---|
[56] | 517 | #endif |
---|
[773] | 518 | #if H_3D_SPIVMP |
---|
[724] | 519 | Void getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight); |
---|
| 520 | Void getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ); |
---|
| 521 | Void setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ); |
---|
| 522 | #endif |
---|
[608] | 523 | #if H_3D_IV_MERGE |
---|
[773] | 524 | Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth |
---|
| 525 | |
---|
| 526 | #if H_3D_SPIVMP |
---|
[724] | 527 | , TComMvField* pcMFieldSP, UChar* puhInterDirSP |
---|
[976] | 528 | #endif |
---|
[950] | 529 | , Bool bICFlag |
---|
[724] | 530 | ); |
---|
| 531 | #endif |
---|
[608] | 532 | #if H_3D_ARP |
---|
| 533 | UChar* getARPW () { return m_puhARPW; } |
---|
| 534 | UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } |
---|
| 535 | Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } |
---|
| 536 | Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 537 | Double getARPWFactor ( UInt uiIdx ); |
---|
[443] | 538 | #endif |
---|
[608] | 539 | #if H_3D_IC |
---|
| 540 | Bool* getICFlag () { return m_pbICFlag; } |
---|
| 541 | Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } |
---|
| 542 | Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } |
---|
| 543 | Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 544 | Bool isICFlagRequired ( UInt uiAbsPartIdx ); |
---|
| 545 | Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); |
---|
| 546 | #else |
---|
[2] | 547 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 548 | // member functions for accessing partition information |
---|
| 549 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 550 | |
---|
| 551 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); |
---|
[77] | 552 | #endif |
---|
[964] | 553 | UChar getNumPartitions (); |
---|
[2] | 554 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 555 | |
---|
| 556 | #if H_3D_DIM |
---|
| 557 | Pel* getDimDeltaDC ( UInt dimType, UInt segId ) { return m_dimDeltaDC[dimType][segId]; } |
---|
| 558 | Pel getDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx ) { return m_dimDeltaDC[dimType][segId][uiIdx]; } |
---|
| 559 | Void setDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val; } |
---|
| 560 | #if H_3D_DIM_DMM |
---|
| 561 | UInt* getDmmWedgeTabIdx ( UInt dmmType ) { return m_dmmWedgeTabIdx[dmmType]; } |
---|
| 562 | UInt getDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx ) { return m_dmmWedgeTabIdx[dmmType][uiIdx]; } |
---|
| 563 | Void setDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; } |
---|
| 564 | Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 565 | |
---|
| 566 | #endif |
---|
| 567 | #if H_3D_DIM_SDC |
---|
| 568 | Bool* getSDCFlag () { return m_pbSDCFlag; } |
---|
| 569 | Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } |
---|
| 570 | Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 571 | |
---|
[608] | 572 | Bool getSDCAvailable ( UInt uiAbsPartIdx ); |
---|
| 573 | |
---|
| 574 | Pel* getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; } |
---|
| 575 | Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } |
---|
| 576 | Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } |
---|
[950] | 577 | Void setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; } |
---|
| 578 | Pel getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; } |
---|
[833] | 579 | UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 580 | #endif |
---|
| 581 | #endif |
---|
| 582 | |
---|
[2] | 583 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 584 | // member functions for motion vector |
---|
| 585 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 586 | |
---|
| 587 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
| 588 | |
---|
[608] | 589 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
[56] | 590 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
| 591 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
[2] | 592 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
| 593 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
[56] | 594 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
| 595 | |
---|
[2] | 596 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
| 597 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
[56] | 598 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
[2] | 599 | |
---|
| 600 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 601 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 602 | |
---|
| 603 | Void clipMv ( TComMv& rcMv ); |
---|
| 604 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
| 605 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
| 606 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
[655] | 607 | #if H_3D |
---|
| 608 | Void compressMV ( Int scale ); |
---|
[608] | 609 | #else |
---|
[2] | 610 | Void compressMV (); |
---|
[608] | 611 | #endif |
---|
[2] | 612 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 613 | // utility functions for neighbouring information |
---|
| 614 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 615 | |
---|
| 616 | TComDataCU* getCULeft () { return m_pcCULeft; } |
---|
| 617 | TComDataCU* getCUAbove () { return m_pcCUAbove; } |
---|
| 618 | TComDataCU* getCUAboveLeft () { return m_pcCUAboveLeft; } |
---|
| 619 | TComDataCU* getCUAboveRight () { return m_pcCUAboveRight; } |
---|
| 620 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
[56] | 621 | |
---|
| 622 | |
---|
[608] | 623 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, |
---|
| 624 | UInt uiCurrPartUnitIdx, |
---|
| 625 | Bool bEnforceSliceRestriction=true, |
---|
| 626 | Bool bEnforceTileRestriction=true ); |
---|
| 627 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, |
---|
| 628 | UInt uiCurrPartUnitIdx, |
---|
| 629 | Bool bEnforceSliceRestriction=true, |
---|
| 630 | Bool planarAtLCUBoundary = false, |
---|
| 631 | Bool bEnforceTileRestriction=true ); |
---|
| 632 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 633 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
| 634 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
[56] | 635 | |
---|
[608] | 636 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU ); |
---|
| 637 | TComDataCU* getQpMinCuAbove ( UInt& aPartUnitIdx , UInt currAbsIdxInLCU ); |
---|
[56] | 638 | Char getRefQP ( UInt uiCurrAbsIdxInLCU ); |
---|
| 639 | |
---|
[608] | 640 | TComDataCU* getPUAboveRightAdi ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 641 | TComDataCU* getPUBelowLeftAdi ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
[2] | 642 | |
---|
[608] | 643 | Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 644 | Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[2] | 645 | |
---|
| 646 | Void deriveLeftRightTopIdxAdi ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 647 | Void deriveLeftBottomIdxAdi ( UInt& ruiPartIdxLB, UInt uiPartOffset, UInt uiPartDepth ); |
---|
| 648 | |
---|
| 649 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
[724] | 650 | |
---|
[773] | 651 | #if H_3D |
---|
[724] | 652 | Bool getAvailableFlagA1() { return m_bAvailableFlagA1;} |
---|
| 653 | Bool getAvailableFlagB1() { return m_bAvailableFlagB1;} |
---|
| 654 | Bool getAvailableFlagB0() { return m_bAvailableFlagB0;} |
---|
| 655 | Bool getAvailableFlagA0() { return m_bAvailableFlagA0;} |
---|
| 656 | Bool getAvailableFlagB2() { return m_bAvailableFlagB2;} |
---|
| 657 | Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } |
---|
[950] | 658 | Void buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 659 | #if H_3D_VSP |
---|
| 660 | , Int* vspFlag |
---|
| 661 | #endif |
---|
| 662 | #if H_3D_SPIVMP |
---|
| 663 | , Bool* pbSPIVMPFlag |
---|
| 664 | #endif |
---|
| 665 | , Int& numValidMergeCand |
---|
| 666 | ); |
---|
[724] | 667 | Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); |
---|
| 668 | Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 669 | #else |
---|
| 670 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 671 | #endif |
---|
[1039] | 672 | #if H_3D_VSP && !FIX_TICKET_79 |
---|
[608] | 673 | , InheritedVSPDisInfo* inheritedVSPDisInfo |
---|
[443] | 674 | #endif |
---|
[773] | 675 | #if H_3D_SPIVMP |
---|
[950] | 676 | , TComMvField* pcMvFieldSP, UChar* puhInterDirSP |
---|
[724] | 677 | #endif |
---|
| 678 | , Int& numValidMergeCand, Int mrgCandIdx = -1 |
---|
| 679 | ); |
---|
[622] | 680 | |
---|
[608] | 681 | #if H_3D_VSP |
---|
[1039] | 682 | #if !FIX_TICKET_76 |
---|
[622] | 683 | inline Void xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo* inheritedVSPDisInfo); |
---|
[1039] | 684 | #endif |
---|
[622] | 685 | |
---|
[773] | 686 | #if H_3D_SPIVMP |
---|
[724] | 687 | Bool* getSPIVMPFlag () { return m_pbSPIVMPFlag; } |
---|
| 688 | Bool getSPIVMPFlag ( UInt uiIdx ) { return m_pbSPIVMPFlag[uiIdx]; } |
---|
| 689 | Void setSPIVMPFlag ( UInt uiIdx, Bool n ) { m_pbSPIVMPFlag[uiIdx] = n; } |
---|
| 690 | Void setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 691 | #endif |
---|
| 692 | |
---|
[608] | 693 | Char* getVSPFlag () { return m_piVSPFlag; } |
---|
| 694 | Char getVSPFlag ( UInt uiIdx ) { return m_piVSPFlag[uiIdx]; } |
---|
| 695 | Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } |
---|
| 696 | Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[833] | 697 | Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); |
---|
[608] | 698 | #endif |
---|
| 699 | Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 700 | Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[2] | 701 | |
---|
| 702 | |
---|
| 703 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 704 | // member functions for modes |
---|
| 705 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 706 | |
---|
| 707 | Bool isIntra ( UInt uiPartIdx ) { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
| 708 | Bool isSkipped ( UInt uiPartIdx ); ///< SKIP (no residual) |
---|
[608] | 709 | Bool isBipredRestriction( UInt puIdx ); |
---|
| 710 | |
---|
[773] | 711 | #if H_3D_IC |
---|
[724] | 712 | Bool isIC ( UInt uiPartIdx ); |
---|
| 713 | #endif |
---|
| 714 | |
---|
[2] | 715 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 716 | // member functions for symbol prediction (most probable / mode conversion) |
---|
| 717 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 718 | |
---|
| 719 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
| 720 | |
---|
[56] | 721 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
| 722 | Int getIntraDirLumaPredictor ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL ); |
---|
[2] | 723 | |
---|
| 724 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 725 | // member functions for SBAC context |
---|
| 726 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 727 | |
---|
| 728 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 729 | UInt getCtxQtCbf ( TextType eType, UInt uiTrDepth ); |
---|
[56] | 730 | |
---|
[2] | 731 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 732 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
| 733 | |
---|
| 734 | #if H_3D_ARP |
---|
| 735 | UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); |
---|
| 736 | #endif |
---|
| 737 | UInt getSliceStartCU ( UInt pos ) { return m_sliceStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
| 738 | UInt getSliceSegmentStartCU ( UInt pos ) { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU]; } |
---|
[56] | 739 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
[2] | 740 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 741 | // member functions for RD cost storage |
---|
| 742 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 743 | |
---|
| 744 | Double& getTotalCost() { return m_dTotalCost; } |
---|
[608] | 745 | #if H_3D_VSO |
---|
[189] | 746 | Dist& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
[608] | 747 | #else |
---|
| 748 | UInt& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
| 749 | #endif |
---|
[2] | 750 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
| 751 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
| 752 | |
---|
| 753 | UInt getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra); |
---|
| 754 | |
---|
[884] | 755 | #if H_3D_DDD |
---|
[833] | 756 | UChar* getDDDepth () { return m_pucDisparityDerivedDepth; } |
---|
| 757 | UChar getDDDepth ( UInt uiIdx ) { return m_pucDisparityDerivedDepth[uiIdx]; } |
---|
| 758 | Void setDDDepth ( UInt uiIdx, UChar n ) { m_pucDisparityDerivedDepth[uiIdx] = n; } |
---|
| 759 | Void setDDDepthSubParts( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 760 | |
---|
| 761 | Bool* getUseDDD () { return m_pbUseDDD; } |
---|
| 762 | Bool getUseDDD ( UInt uiIdx ) { return m_pbUseDDD[uiIdx]; } |
---|
| 763 | Void setUseDDD ( UInt uiIdx, Bool n ) { m_pbUseDDD[uiIdx] = n; } |
---|
| 764 | Void setUseDDD( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 765 | |
---|
| 766 | Void setUseDDD ( Bool bUseDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 767 | |
---|
| 768 | UChar getDDTmpDepth(){ return m_ucDDTmpDepth; } |
---|
| 769 | Int getUseDDDCandIdx(){ return m_iUseDDDCandIdx;} |
---|
| 770 | |
---|
| 771 | #endif |
---|
[1039] | 772 | |
---|
| 773 | #if SHARP_DMM1_I0110 |
---|
| 774 | Bool isDMM1UpscaleMode ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; }; |
---|
| 775 | UInt getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth = uiWidth; } return uiBaseWidth; } |
---|
| 776 | #endif |
---|
| 777 | |
---|
[2] | 778 | }; |
---|
| 779 | |
---|
[56] | 780 | namespace RasterAddress |
---|
| 781 | { |
---|
| 782 | /** Check whether 2 addresses point to the same column |
---|
| 783 | * \param addrA First address in raster scan order |
---|
| 784 | * \param addrB Second address in raters scan order |
---|
| 785 | * \param numUnitsPerRow Number of units in a row |
---|
| 786 | * \return Result of test |
---|
| 787 | */ |
---|
| 788 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 789 | { |
---|
| 790 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
| 791 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 792 | } |
---|
| 793 | |
---|
| 794 | /** Check whether 2 addresses point to the same row |
---|
| 795 | * \param addrA First address in raster scan order |
---|
| 796 | * \param addrB Second address in raters scan order |
---|
| 797 | * \param numUnitsPerRow Number of units in a row |
---|
| 798 | * \return Result of test |
---|
| 799 | */ |
---|
| 800 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 801 | { |
---|
| 802 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
| 803 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 804 | } |
---|
| 805 | |
---|
| 806 | /** Check whether 2 addresses point to the same row or column |
---|
| 807 | * \param addrA First address in raster scan order |
---|
| 808 | * \param addrB Second address in raters scan order |
---|
| 809 | * \param numUnitsPerRow Number of units in a row |
---|
| 810 | * \return Result of test |
---|
| 811 | */ |
---|
| 812 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 813 | { |
---|
| 814 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
| 815 | } |
---|
| 816 | |
---|
| 817 | /** Check whether one address points to the first column |
---|
| 818 | * \param addr Address in raster scan order |
---|
| 819 | * \param numUnitsPerRow Number of units in a row |
---|
| 820 | * \return Result of test |
---|
| 821 | */ |
---|
| 822 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
| 823 | { |
---|
| 824 | // addr % numUnitsPerRow == 0 |
---|
| 825 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 826 | } |
---|
| 827 | |
---|
| 828 | /** Check whether one address points to the first row |
---|
| 829 | * \param addr Address in raster scan order |
---|
| 830 | * \param numUnitsPerRow Number of units in a row |
---|
| 831 | * \return Result of test |
---|
| 832 | */ |
---|
| 833 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
| 834 | { |
---|
| 835 | // addr / numUnitsPerRow == 0 |
---|
| 836 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 837 | } |
---|
| 838 | |
---|
| 839 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
| 840 | * \param addr Address in raster scan order |
---|
| 841 | * \param val Given column index value |
---|
| 842 | * \param numUnitsPerRow Number of units in a row |
---|
| 843 | * \return Result of test |
---|
| 844 | */ |
---|
| 845 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 846 | { |
---|
| 847 | // addr % numUnitsPerRow < val |
---|
| 848 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
| 849 | } |
---|
| 850 | |
---|
| 851 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
| 852 | * \param addr Address in raster scan order |
---|
| 853 | * \param val Given row index value |
---|
| 854 | * \param numUnitsPerRow Number of units in a row |
---|
| 855 | * \return Result of test |
---|
| 856 | */ |
---|
| 857 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 858 | { |
---|
| 859 | // addr / numUnitsPerRow < val |
---|
| 860 | return addr < val * numUnitsPerRow; |
---|
| 861 | } |
---|
| 862 | }; |
---|
| 863 | |
---|
| 864 | //! \} |
---|
| 865 | |
---|
[2] | 866 | #endif |
---|