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