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