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