[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 |
---|
[1200] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[1200] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[5] | 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TComDataCU.h |
---|
| 35 | \brief CU data structure (header) |
---|
| 36 | \todo not all entities are documented |
---|
| 37 | */ |
---|
| 38 | |
---|
[1200] | 39 | #ifndef __TCOMDATACU__ |
---|
| 40 | #define __TCOMDATACU__ |
---|
[2] | 41 | |
---|
[1200] | 42 | #include <algorithm> |
---|
| 43 | #include <vector> |
---|
[2] | 44 | |
---|
| 45 | // Include files |
---|
| 46 | #include "CommonDef.h" |
---|
| 47 | #include "TComMotionInfo.h" |
---|
| 48 | #include "TComSlice.h" |
---|
| 49 | #include "TComRdCost.h" |
---|
| 50 | #include "TComPattern.h" |
---|
[56] | 51 | |
---|
[608] | 52 | #if H_3D_ARP |
---|
[2] | 53 | #include "TComYuv.h" |
---|
[56] | 54 | #endif |
---|
[1200] | 55 | #if H_3D |
---|
[2] | 56 | #include <algorithm> |
---|
| 57 | #include <vector> |
---|
[1200] | 58 | #endif |
---|
[2] | 59 | |
---|
[56] | 60 | //! \ingroup TLibCommon |
---|
| 61 | //! \{ |
---|
| 62 | |
---|
[1200] | 63 | class TComTU; // forward declaration |
---|
[56] | 64 | |
---|
[1200] | 65 | static const UInt NUM_MOST_PROBABLE_MODES=3; |
---|
| 66 | |
---|
[1222] | 67 | #if NH_3D_DBBP |
---|
[833] | 68 | typedef struct _DBBPTmpData |
---|
| 69 | { |
---|
| 70 | TComMv acMvd[2][2]; // for two segments and two lists |
---|
| 71 | TComMvField acMvField[2][2]; // for two segments and two lists |
---|
| 72 | Int aiMvpNum[2][2]; // for two segments and two lists |
---|
| 73 | Int aiMvpIdx[2][2]; // for two segments and two lists |
---|
| 74 | UChar auhInterDir[2]; // for two segments |
---|
| 75 | Bool abMergeFlag[2]; // for two segments |
---|
| 76 | UChar auhMergeIndex[2]; // for two segments |
---|
| 77 | PartSize eVirtualPartSize; |
---|
| 78 | UInt uiVirtualPartIndex; |
---|
[1196] | 79 | } DbbpTmpData; |
---|
[833] | 80 | #endif |
---|
[56] | 81 | |
---|
[1200] | 82 | |
---|
[56] | 83 | // ==================================================================================================================== |
---|
[2] | 84 | // Class definition |
---|
| 85 | // ==================================================================================================================== |
---|
| 86 | |
---|
| 87 | /// CU data structure class |
---|
| 88 | class TComDataCU |
---|
| 89 | { |
---|
| 90 | private: |
---|
[1200] | 91 | |
---|
[2] | 92 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 93 | // class pointers |
---|
| 94 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 95 | |
---|
[2] | 96 | TComPic* m_pcPic; ///< picture class pointer |
---|
| 97 | TComSlice* m_pcSlice; ///< slice header pointer |
---|
[1200] | 98 | |
---|
[2] | 99 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 100 | // CU description |
---|
| 101 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 102 | |
---|
| 103 | UInt m_ctuRsAddr; ///< CTU (also known as LCU) address in a slice (Raster-scan address, as opposed to tile-scan/encoding order). |
---|
| 104 | UInt m_absZIdxInCtu; ///< absolute address in a CTU. It's Z scan order |
---|
[2] | 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" |
---|
[1200] | 112 | |
---|
[2] | 113 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 114 | // CU data |
---|
| 115 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 116 | |
---|
| 117 | Bool* m_skipFlag; ///< array of skip flags |
---|
[1196] | 118 | #if H_3D |
---|
[1179] | 119 | Bool* m_bDISFlag; |
---|
| 120 | UInt* m_uiDISType; |
---|
[1039] | 121 | #endif |
---|
[1200] | 122 | Char* m_pePartSize; ///< array of partition sizes |
---|
| 123 | Char* m_pePredMode; ///< array of prediction modes |
---|
| 124 | Char* m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values |
---|
| 125 | Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags |
---|
| 126 | Char* m_phQP; ///< array of QP values |
---|
| 127 | UChar* m_ChromaQpAdj; ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 |
---|
| 128 | UInt m_codedChromaQpAdj; |
---|
| 129 | UChar* m_puhTrIdx; ///< array of transform indices |
---|
| 130 | UChar* m_puhTransformSkip[MAX_NUM_COMPONENT];///< array of transform skipping flags |
---|
| 131 | UChar* m_puhCbf[MAX_NUM_COMPONENT]; ///< array of coded block flags (CBF) |
---|
| 132 | TComCUMvField m_acCUMvField[NUM_REF_PIC_LIST_01]; ///< array of motion vectors. |
---|
| 133 | TCoeff* m_pcTrCoeff[MAX_NUM_COMPONENT]; ///< array of transform coefficient buffers (0->Y, 1->Cb, 2->Cr) |
---|
[56] | 134 | #if ADAPTIVE_QP_SELECTION |
---|
[1200] | 135 | TCoeff* m_pcArlCoeff[MAX_NUM_COMPONENT]; // ARL coefficient buffer (0->Y, 1->Cb, 2->Cr) |
---|
| 136 | Bool m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d |
---|
[56] | 137 | #endif |
---|
| 138 | |
---|
[1200] | 139 | Pel* m_pcIPCMSample[MAX_NUM_COMPONENT]; ///< PCM sample buffer (0->Y, 1->Cb, 2->Cr) |
---|
| 140 | |
---|
[2] | 141 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 142 | // neighbour access variables |
---|
| 143 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 144 | |
---|
| 145 | TComDataCU* m_pCtuAboveLeft; ///< pointer of above-left CTU. |
---|
| 146 | TComDataCU* m_pCtuAboveRight; ///< pointer of above-right CTU. |
---|
| 147 | TComDataCU* m_pCtuAbove; ///< pointer of above CTU. |
---|
| 148 | TComDataCU* m_pCtuLeft; ///< pointer of left CTU |
---|
| 149 | TComDataCU* m_apcCUColocated[NUM_REF_PIC_LIST_01]; ///< pointer of temporally colocated CU's for both directions |
---|
[2] | 150 | TComMvField m_cMvFieldA; ///< motion vector of position A |
---|
| 151 | TComMvField m_cMvFieldB; ///< motion vector of position B |
---|
| 152 | TComMvField m_cMvFieldC; ///< motion vector of position C |
---|
| 153 | TComMv m_cMvPred; ///< motion vector predictor |
---|
[1200] | 154 | |
---|
[2] | 155 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 156 | // coding tool information |
---|
| 157 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 158 | |
---|
[2] | 159 | Bool* m_pbMergeFlag; ///< array of merge flags |
---|
| 160 | UChar* m_puhMergeIndex; ///< array of merge candidate indices |
---|
[56] | 161 | #if AMP_MRG |
---|
| 162 | Bool m_bIsMergeAMP; |
---|
| 163 | #endif |
---|
[1200] | 164 | UChar* m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]; // 0-> Luma, 1-> Chroma |
---|
[56] | 165 | UChar* m_puhInterDir; ///< array of inter directions |
---|
[1200] | 166 | Char* m_apiMVPIdx[NUM_REF_PIC_LIST_01]; ///< array of motion vector predictor candidates |
---|
| 167 | Char* m_apiMVPNum[NUM_REF_PIC_LIST_01]; ///< array of number of possible motion vectors predictors |
---|
[56] | 168 | Bool* m_pbIPCMFlag; ///< array of intra_pcm flags |
---|
[1210] | 169 | #if NH_3D_NBDV |
---|
[608] | 170 | DisInfo* m_pDvInfo; |
---|
[5] | 171 | #endif |
---|
[608] | 172 | #if H_3D_VSP |
---|
[1196] | 173 | Char* m_piVSPFlag; ///< array of VSP flags to indicate whehter a block uses VSP or not ///< 0: non-VSP; 1: VSP |
---|
[608] | 174 | #endif |
---|
[773] | 175 | #if H_3D_SPIVMP |
---|
[1196] | 176 | Bool* m_pbSPIVMPFlag; ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP |
---|
[724] | 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]; |
---|
[1196] | 192 | Pel m_apDmmPredictor[2]; |
---|
[100] | 193 | #endif |
---|
[608] | 194 | #endif |
---|
[1222] | 195 | #if NH_3D_DBBP |
---|
[833] | 196 | Bool* m_pbDBBPFlag; ///< array of DBBP flags |
---|
[1196] | 197 | DbbpTmpData m_sDBBPTmpData; |
---|
[833] | 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 |
---|
[1200] | 206 | |
---|
| 207 | |
---|
[56] | 208 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 209 | // misc. variables |
---|
| 210 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 211 | |
---|
[56] | 212 | Bool m_bDecSubCu; ///< indicates decoder-mode |
---|
| 213 | Double m_dTotalCost; ///< sum of partition RD costs |
---|
[1200] | 214 | #if NH_3D_VSO |
---|
[189] | 215 | Dist m_uiTotalDistortion; ///< sum of partition distortion |
---|
[608] | 216 | #else |
---|
[1200] | 217 | Distortion m_uiTotalDistortion; ///< sum of partition distortion |
---|
[608] | 218 | #endif |
---|
[56] | 219 | UInt m_uiTotalBits; ///< sum of partition bits |
---|
[1200] | 220 | UInt m_uiTotalBins; ///< sum of partition bins |
---|
[608] | 221 | Char m_codedQP; |
---|
[773] | 222 | #if H_3D |
---|
[724] | 223 | DisInfo m_cDefaultDisInfo; ///< Default disparity information for initializing |
---|
| 224 | #endif |
---|
[976] | 225 | #if H_3D_IV_MERGE |
---|
[950] | 226 | TComMotionCand m_mergCands[MRG_IVSHIFT+1]; |
---|
| 227 | Int m_baseListidc; |
---|
| 228 | #endif |
---|
| 229 | |
---|
[1200] | 230 | UChar* m_explicitRdpcmMode[MAX_NUM_COMPONENT]; ///< Stores the explicit RDPCM mode for all TUs belonging to this CU |
---|
| 231 | |
---|
[2] | 232 | protected: |
---|
[1200] | 233 | |
---|
[2] | 234 | /// add possible motion vector predictor candidates |
---|
| 235 | Bool xAddMVPCand ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
| 236 | Bool xAddMVPCandOrder ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir ); |
---|
[608] | 237 | #if H_3D_VSP |
---|
[950] | 238 | Bool xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount); |
---|
[296] | 239 | #endif |
---|
[622] | 240 | #if H_3D_IV_MERGE |
---|
[950] | 241 | Bool xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int* ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ); |
---|
[443] | 242 | #endif |
---|
[608] | 243 | |
---|
| 244 | Void deriveRightBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxRB ); |
---|
[1200] | 245 | Bool xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx |
---|
[608] | 246 | #if H_3D_TMVP |
---|
[1196] | 247 | , Bool bMRG = true |
---|
[296] | 248 | #endif |
---|
[1200] | 249 | ); |
---|
| 250 | |
---|
| 251 | |
---|
[2] | 252 | /// compute scaling factor from POC difference |
---|
[608] | 253 | #if !H_3D_ARP |
---|
[2] | 254 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[443] | 255 | #endif |
---|
[56] | 256 | |
---|
[608] | 257 | Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter ); |
---|
[56] | 258 | |
---|
[884] | 259 | #if H_3D_VSP |
---|
[833] | 260 | Void xSetMvFieldForVSP ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize ); |
---|
| 261 | #endif |
---|
| 262 | |
---|
[2] | 263 | public: |
---|
| 264 | TComDataCU(); |
---|
| 265 | virtual ~TComDataCU(); |
---|
[1200] | 266 | |
---|
[2] | 267 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 268 | // create / destroy / initialize / copy |
---|
| 269 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[608] | 270 | #if H_3D_ARP |
---|
[443] | 271 | Int xGetDistScaleFactor ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC ); |
---|
[608] | 272 | #endif |
---|
[1200] | 273 | Void create ( ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize |
---|
[56] | 274 | #if ADAPTIVE_QP_SELECTION |
---|
[1200] | 275 | , TCoeff *pParentARLBuffer = 0 |
---|
| 276 | #endif |
---|
[56] | 277 | ); |
---|
[2] | 278 | Void destroy (); |
---|
[1200] | 279 | |
---|
| 280 | Void initCtu ( TComPic* pcPic, UInt ctuRsAddr ); |
---|
| 281 | Void initEstData ( const UInt uiDepth, const Int qp, const Bool bTransquantBypass ); |
---|
[56] | 282 | Void initSubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp ); |
---|
| 283 | Void setOutsideCUPart ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1210] | 284 | #if NH_3D_NBDV |
---|
| 285 | Void copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx); |
---|
[443] | 286 | #endif |
---|
[1200] | 287 | |
---|
| 288 | Void copySubCU ( TComDataCU* pcCU, UInt uiPartUnitIdx ); |
---|
| 289 | Void copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList |
---|
[1210] | 290 | #if NH_3D_NBDV |
---|
[443] | 291 | , Bool bNBDV = false |
---|
| 292 | #endif |
---|
[1200] | 293 | ); |
---|
[608] | 294 | Void copyPartFrom ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth ); |
---|
[1200] | 295 | |
---|
[2] | 296 | Void copyToPic ( UChar uiDepth ); |
---|
[1200] | 297 | |
---|
[2] | 298 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 299 | // member functions for CU description |
---|
| 300 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 301 | |
---|
| 302 | TComPic* getPic () { return m_pcPic; } |
---|
| 303 | const TComPic* getPic () const { return m_pcPic; } |
---|
| 304 | TComSlice* getSlice () { return m_pcSlice; } |
---|
| 305 | const TComSlice* getSlice () const { return m_pcSlice; } |
---|
| 306 | UInt& getCtuRsAddr () { return m_ctuRsAddr; } |
---|
| 307 | UInt getCtuRsAddr () const { return m_ctuRsAddr; } |
---|
| 308 | UInt getZorderIdxInCtu () const { return m_absZIdxInCtu; } |
---|
| 309 | UInt getCUPelX () const { return m_uiCUPelX; } |
---|
| 310 | UInt getCUPelY () const { return m_uiCUPelY; } |
---|
| 311 | |
---|
[2] | 312 | UChar* getDepth () { return m_puhDepth; } |
---|
[1200] | 313 | UChar getDepth ( UInt uiIdx ) const { return m_puhDepth[uiIdx]; } |
---|
[2] | 314 | Void setDepth ( UInt uiIdx, UChar uh ) { m_puhDepth[uiIdx] = uh; } |
---|
[1200] | 315 | |
---|
[56] | 316 | Void setDepthSubParts ( UInt uiDepth, UInt uiAbsPartIdx ); |
---|
[1200] | 317 | #if NH_3D_VSO |
---|
| 318 | Void getPosInPic ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ) const; |
---|
[5] | 319 | #endif |
---|
[1200] | 320 | |
---|
[608] | 321 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[2] | 322 | // member functions for CU data |
---|
| 323 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 324 | |
---|
[56] | 325 | Char* getPartitionSize () { return m_pePartSize; } |
---|
| 326 | PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } |
---|
[2] | 327 | Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } |
---|
| 328 | Void setPartSizeSubParts ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 329 | Void setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1200] | 330 | |
---|
[1222] | 331 | #if NH_3D_DBBP |
---|
[833] | 332 | Pel* getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride); |
---|
| 333 | #endif |
---|
| 334 | |
---|
[1200] | 335 | Bool* getSkipFlag () { return m_skipFlag; } |
---|
| 336 | Bool getSkipFlag (UInt idx) { return m_skipFlag[idx]; } |
---|
| 337 | Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } |
---|
| 338 | Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); |
---|
[1196] | 339 | #if H_3D |
---|
[1179] | 340 | Bool* getDISFlag () { return m_bDISFlag; } |
---|
| 341 | Bool getDISFlag ( UInt idx) { return m_bDISFlag[idx]; } |
---|
| 342 | Void setDISFlag ( UInt idx, Bool bDIS) { m_bDISFlag[idx] = bDIS; } |
---|
| 343 | Void setDISFlagSubParts ( Bool bDIS, UInt absPartIdx, UInt depth ); |
---|
| 344 | |
---|
| 345 | UInt* getDISType () { return m_uiDISType; } |
---|
| 346 | UInt getDISType ( UInt idx) { return m_uiDISType[idx]; } |
---|
| 347 | Void getDISType ( UInt idx, UInt uiDISType) { m_uiDISType[idx] = uiDISType; } |
---|
| 348 | Void setDISTypeSubParts ( UInt uiDISType, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ); |
---|
| 349 | #endif |
---|
[56] | 350 | Char* getPredictionMode () { return m_pePredMode; } |
---|
| 351 | PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } |
---|
[2] | 352 | Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } |
---|
| 353 | Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1200] | 354 | |
---|
[1222] | 355 | #if NH_3D_DBBP |
---|
[833] | 356 | Bool* getDBBPFlag () { return m_pbDBBPFlag; } |
---|
| 357 | Bool getDBBPFlag ( UInt uiIdx ) { return m_pbDBBPFlag[uiIdx]; } |
---|
| 358 | Void setDBBPFlag ( UInt uiIdx, Bool b ) { m_pbDBBPFlag[uiIdx] = b; } |
---|
| 359 | Void setDBBPFlagSubParts ( Bool bDBBPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[1196] | 360 | DbbpTmpData* getDBBPTmpData () { return &m_sDBBPTmpData; } |
---|
[833] | 361 | #endif |
---|
[1200] | 362 | |
---|
| 363 | Char* getCrossComponentPredictionAlpha( ComponentID compID ) { return m_crossComponentPredictionAlpha[compID]; } |
---|
| 364 | Char getCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx]; } |
---|
| 365 | |
---|
| 366 | Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } |
---|
| 367 | Bool getCUTransquantBypass( UInt uiIdx ) { return m_CUTransquantBypass[uiIdx]; } |
---|
| 368 | |
---|
[2] | 369 | UChar* getWidth () { return m_puhWidth; } |
---|
| 370 | UChar getWidth ( UInt uiIdx ) { return m_puhWidth[uiIdx]; } |
---|
| 371 | Void setWidth ( UInt uiIdx, UChar uh ) { m_puhWidth[uiIdx] = uh; } |
---|
[1200] | 372 | |
---|
[2] | 373 | UChar* getHeight () { return m_puhHeight; } |
---|
| 374 | UChar getHeight ( UInt uiIdx ) { return m_puhHeight[uiIdx]; } |
---|
| 375 | Void setHeight ( UInt uiIdx, UChar uh ) { m_puhHeight[uiIdx] = uh; } |
---|
[1200] | 376 | |
---|
[2] | 377 | Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1200] | 378 | |
---|
[56] | 379 | Char* getQP () { return m_phQP; } |
---|
[1200] | 380 | Char getQP ( UInt uiIdx ) const { return m_phQP[uiIdx]; } |
---|
[56] | 381 | Void setQP ( UInt uiIdx, Char value ){ m_phQP[uiIdx] = value; } |
---|
| 382 | Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 383 | Int getLastValidPartIdx ( Int iAbsPartIdx ); |
---|
| 384 | Char getLastCodedQP ( UInt uiAbsPartIdx ); |
---|
[1200] | 385 | Void setQPSubCUs ( Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); |
---|
[608] | 386 | Void setCodedQP ( Char qp ) { m_codedQP = qp; } |
---|
| 387 | Char getCodedQP () { return m_codedQP; } |
---|
[56] | 388 | |
---|
[1200] | 389 | UChar* getChromaQpAdj () { return m_ChromaQpAdj; } ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 |
---|
| 390 | UChar getChromaQpAdj (Int idx) const { return m_ChromaQpAdj[idx]; } ///< When value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 |
---|
| 391 | Void setChromaQpAdj (Int idx, UChar val) { m_ChromaQpAdj[idx] = val; } ///< When val = 0, cu_chroma_qp_offset_flag=0; when val>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=val-1 |
---|
| 392 | Void setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth ); |
---|
| 393 | Void setCodedChromaQpAdj ( Char qp ) { m_codedChromaQpAdj = qp; } |
---|
| 394 | Char getCodedChromaQpAdj () { return m_codedChromaQpAdj; } |
---|
| 395 | |
---|
| 396 | Bool isLosslessCoded ( UInt absPartIdx ); |
---|
| 397 | |
---|
[2] | 398 | UChar* getTransformIdx () { return m_puhTrIdx; } |
---|
| 399 | UChar getTransformIdx ( UInt uiIdx ) { return m_puhTrIdx[uiIdx]; } |
---|
| 400 | Void setTrIdxSubParts ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 401 | |
---|
[1200] | 402 | UChar* getTransformSkip ( ComponentID compID ) { return m_puhTransformSkip[compID];} |
---|
| 403 | UChar getTransformSkip ( UInt uiIdx, ComponentID compID) { return m_puhTransformSkip[compID][uiIdx];} |
---|
| 404 | Void setTransformSkipSubParts ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth); |
---|
| 405 | Void setTransformSkipSubParts ( const UInt useTransformSkip[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[608] | 406 | |
---|
[1200] | 407 | UChar* getExplicitRdpcmMode ( ComponentID component ) { return m_explicitRdpcmMode[component]; } |
---|
| 408 | UChar getExplicitRdpcmMode ( ComponentID component, UInt partIdx ) {return m_explicitRdpcmMode[component][partIdx]; } |
---|
| 409 | Void setExplicitRdpcmModePartRange ( UInt rdpcmMode, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 410 | |
---|
| 411 | Bool isRDPCMEnabled ( UInt uiAbsPartIdx ) { return getSlice()->getSPS()->getSpsRangeExtension().getRdpcmEnabledFlag(isIntra(uiAbsPartIdx) ? RDPCM_SIGNAL_IMPLICIT : RDPCM_SIGNAL_EXPLICIT); } |
---|
| 412 | |
---|
| 413 | Void setCrossComponentPredictionAlphaPartRange ( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 414 | Void setTransformSkipPartRange ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 415 | |
---|
| 416 | UInt getQuadtreeTULog2MinSizeInCU( UInt uiIdx ); |
---|
| 417 | |
---|
[2] | 418 | TComCUMvField* getCUMvField ( RefPicList e ) { return &m_acCUMvField[e]; } |
---|
[1200] | 419 | |
---|
| 420 | TCoeff* getCoeff (ComponentID component) { return m_pcTrCoeff[component]; } |
---|
| 421 | |
---|
[56] | 422 | #if ADAPTIVE_QP_SELECTION |
---|
[1200] | 423 | TCoeff* getArlCoeff ( ComponentID component ) { return m_pcArlCoeff[component]; } |
---|
[56] | 424 | #endif |
---|
[1200] | 425 | Pel* getPCMSample ( ComponentID component ) { return m_pcIPCMSample[component]; } |
---|
[56] | 426 | |
---|
[1200] | 427 | UChar getCbf ( UInt uiIdx, ComponentID eType ) { return m_puhCbf[eType][uiIdx]; } |
---|
| 428 | UChar* getCbf ( ComponentID eType ) { return m_puhCbf[eType]; } |
---|
| 429 | UChar getCbf ( UInt uiIdx, ComponentID eType, UInt uiTrDepth ) { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); } |
---|
| 430 | Void setCbf ( UInt uiIdx, ComponentID eType, UChar uh ) { m_puhCbf[eType][uiIdx] = uh; } |
---|
| 431 | Void clearCbf ( UInt uiIdx, ComponentID eType, UInt uiNumParts ); |
---|
| 432 | UChar getQtRootCbf ( UInt uiIdx ); |
---|
[1179] | 433 | |
---|
[1200] | 434 | Void setCbfSubParts ( const UInt uiCbf[MAX_NUM_COMPONENT], UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 435 | Void setCbfSubParts ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 436 | Void setCbfSubParts ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[1179] | 437 | |
---|
[1200] | 438 | Void setCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 439 | Void bitwiseOrCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); |
---|
| 440 | |
---|
[2] | 441 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 442 | // member functions for coding tool information |
---|
| 443 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 444 | |
---|
[2] | 445 | Bool* getMergeFlag () { return m_pbMergeFlag; } |
---|
| 446 | Bool getMergeFlag ( UInt uiIdx ) { return m_pbMergeFlag[uiIdx]; } |
---|
| 447 | Void setMergeFlag ( UInt uiIdx, Bool b ) { m_pbMergeFlag[uiIdx] = b; } |
---|
| 448 | Void setMergeFlagSubParts ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 449 | |
---|
| 450 | UChar* getMergeIndex () { return m_puhMergeIndex; } |
---|
| 451 | UChar getMergeIndex ( UInt uiIdx ) { return m_puhMergeIndex[uiIdx]; } |
---|
| 452 | Void setMergeIndex ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex; } |
---|
| 453 | Void setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 454 | template <typename T> |
---|
[1200] | 455 | Void setSubPart ( T bParameter, T* pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[622] | 456 | #if H_3D_VSP |
---|
[608] | 457 | template<typename T> |
---|
| 458 | Void setSubPartT ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx ); |
---|
[189] | 459 | #endif |
---|
[1200] | 460 | |
---|
[56] | 461 | #if AMP_MRG |
---|
| 462 | Void setMergeAMP( Bool b ) { m_bIsMergeAMP = b; } |
---|
| 463 | Bool getMergeAMP( ) { return m_bIsMergeAMP; } |
---|
[5] | 464 | #endif |
---|
[2] | 465 | |
---|
[1200] | 466 | UChar* getIntraDir ( const ChannelType channelType ) const { return m_puhIntraDir[channelType]; } |
---|
| 467 | UChar getIntraDir ( const ChannelType channelType, const UInt uiIdx ) const { return m_puhIntraDir[channelType][uiIdx]; } |
---|
| 468 | |
---|
| 469 | Void setIntraDirSubParts ( const ChannelType channelType, |
---|
| 470 | const UInt uiDir, |
---|
| 471 | const UInt uiAbsPartIdx, |
---|
| 472 | const UInt uiDepth ); |
---|
| 473 | |
---|
[2] | 474 | UChar* getInterDir () { return m_puhInterDir; } |
---|
| 475 | UChar getInterDir ( UInt uiIdx ) { return m_puhInterDir[uiIdx]; } |
---|
| 476 | Void setInterDir ( UInt uiIdx, UChar uh ) { m_puhInterDir[uiIdx] = uh; } |
---|
| 477 | Void setInterDirSubParts ( UInt uiDir, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[56] | 478 | Bool* getIPCMFlag () { return m_pbIPCMFlag; } |
---|
| 479 | Bool getIPCMFlag (UInt uiIdx ) { return m_pbIPCMFlag[uiIdx]; } |
---|
| 480 | Void setIPCMFlag (UInt uiIdx, Bool b ) { m_pbIPCMFlag[uiIdx] = b; } |
---|
| 481 | Void setIPCMFlagSubParts (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth); |
---|
[1210] | 482 | #if NH_3D_NBDV |
---|
[608] | 483 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 484 | Void setDvInfoSubParts ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth); |
---|
| 485 | DisInfo* getDvInfo () { return m_pDvInfo; } |
---|
| 486 | DisInfo getDvInfo (UInt uiIdx) { return m_pDvInfo[uiIdx]; } |
---|
| 487 | #endif |
---|
[1210] | 488 | #if NH_3D_NBDV |
---|
[608] | 489 | Void xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb ); |
---|
| 490 | Bool xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo, |
---|
| 491 | UInt uiMvpDvPos |
---|
[1217] | 492 | #if NH_3D_NBDV_REF |
---|
[608] | 493 | , Bool bDepthRefine = false |
---|
| 494 | #endif |
---|
| 495 | ); |
---|
| 496 | Bool xGetColDisMV ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx ); |
---|
[1179] | 497 | Void getDisMvpCandNBDV ( DisInfo* pDInfo |
---|
[1217] | 498 | #if NH_3D_NBDV_REF |
---|
[608] | 499 | , Bool bDepthRefine = false |
---|
[189] | 500 | #endif |
---|
[608] | 501 | ); |
---|
| 502 | |
---|
[773] | 503 | #if H_3D |
---|
[1179] | 504 | Void getDispforDepth ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp); |
---|
[724] | 505 | Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); |
---|
[1196] | 506 | |
---|
[1179] | 507 | Bool getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index); |
---|
[1039] | 508 | #endif |
---|
[1217] | 509 | #if NH_3D_NBDV_REF |
---|
[608] | 510 | Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); |
---|
| 511 | Void estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred ); |
---|
[1217] | 512 | #endif //NH_3D_NBDV_REF |
---|
[443] | 513 | #endif |
---|
[655] | 514 | #if H_3D_FAST_TEXTURE_ENCODING |
---|
[608] | 515 | Void getIVNStatus ( UInt uiPartIdx, DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD); |
---|
[56] | 516 | #endif |
---|
[773] | 517 | #if H_3D_SPIVMP |
---|
[724] | 518 | Void getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight); |
---|
| 519 | Void getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr ); |
---|
| 520 | Void setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight ); |
---|
| 521 | #endif |
---|
[608] | 522 | #if H_3D_IV_MERGE |
---|
[773] | 523 | Bool getInterViewMergeCands ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth |
---|
| 524 | |
---|
| 525 | #if H_3D_SPIVMP |
---|
[724] | 526 | , TComMvField* pcMFieldSP, UChar* puhInterDirSP |
---|
[976] | 527 | #endif |
---|
[950] | 528 | , Bool bICFlag |
---|
[724] | 529 | ); |
---|
| 530 | #endif |
---|
[608] | 531 | #if H_3D_ARP |
---|
| 532 | UChar* getARPW () { return m_puhARPW; } |
---|
| 533 | UChar getARPW ( UInt uiIdx ) { return m_puhARPW[uiIdx]; } |
---|
| 534 | Void setARPW ( UInt uiIdx, UChar w ) { m_puhARPW[uiIdx] = w; } |
---|
| 535 | Void setARPWSubParts ( UChar w, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 536 | Double getARPWFactor ( UInt uiIdx ); |
---|
[443] | 537 | #endif |
---|
[608] | 538 | #if H_3D_IC |
---|
| 539 | Bool* getICFlag () { return m_pbICFlag; } |
---|
| 540 | Bool getICFlag ( UInt uiIdx ) { return m_pbICFlag[uiIdx]; } |
---|
| 541 | Void setICFlag ( UInt uiIdx, Bool uh ) { m_pbICFlag[uiIdx] = uh; } |
---|
| 542 | Void setICFlagSubParts ( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 543 | Bool isICFlagRequired ( UInt uiAbsPartIdx ); |
---|
| 544 | Void getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false); |
---|
| 545 | #else |
---|
[2] | 546 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 547 | // member functions for accessing partition information |
---|
| 548 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 549 | |
---|
| 550 | Void getPartIndexAndSize ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight ); // This is for use by a leaf/sub CU object only, with no additional AbsPartIdx |
---|
[77] | 551 | #endif |
---|
[1200] | 552 | UChar getNumPartitions ( const UInt uiAbsPartIdx = 0 ); |
---|
[2] | 553 | Bool isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth); |
---|
[608] | 554 | |
---|
| 555 | #if H_3D_DIM |
---|
| 556 | Pel* getDimDeltaDC ( UInt dimType, UInt segId ) { return m_dimDeltaDC[dimType][segId]; } |
---|
| 557 | Pel getDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx ) { return m_dimDeltaDC[dimType][segId][uiIdx]; } |
---|
| 558 | Void setDimDeltaDC ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val; } |
---|
| 559 | #if H_3D_DIM_DMM |
---|
| 560 | UInt* getDmmWedgeTabIdx ( UInt dmmType ) { return m_dmmWedgeTabIdx[dmmType]; } |
---|
| 561 | UInt getDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx ) { return m_dmmWedgeTabIdx[dmmType][uiIdx]; } |
---|
| 562 | Void setDmmWedgeTabIdx ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; } |
---|
| 563 | Void setDmmWedgeTabIdxSubParts ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
| 564 | |
---|
| 565 | #endif |
---|
| 566 | #if H_3D_DIM_SDC |
---|
| 567 | Bool* getSDCFlag () { return m_pbSDCFlag; } |
---|
| 568 | Bool getSDCFlag ( UInt uiIdx ) { return m_pbSDCFlag[uiIdx]; } |
---|
| 569 | Void setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[2] | 570 | |
---|
[608] | 571 | Bool getSDCAvailable ( UInt uiAbsPartIdx ); |
---|
| 572 | |
---|
| 573 | Pel* getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; } |
---|
| 574 | Pel getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; } |
---|
| 575 | Void setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; } |
---|
[950] | 576 | Void setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; } |
---|
| 577 | Pel getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; } |
---|
[833] | 578 | UInt getCtxSDCFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 579 | #endif |
---|
| 580 | #endif |
---|
| 581 | |
---|
[2] | 582 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 583 | // member functions for motion vector |
---|
| 584 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 585 | |
---|
[2] | 586 | Void getMvField ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField ); |
---|
[1200] | 587 | |
---|
[608] | 588 | Void fillMvpCand ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo ); |
---|
[56] | 589 | Bool isDiffMER ( Int xN, Int yN, Int xP, Int yP); |
---|
| 590 | Void getPartPosition ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH); |
---|
[1200] | 591 | |
---|
[2] | 592 | Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } |
---|
| 593 | Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } |
---|
[56] | 594 | Char* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } |
---|
| 595 | |
---|
[2] | 596 | Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } |
---|
| 597 | Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } |
---|
[56] | 598 | Char* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } |
---|
[1200] | 599 | |
---|
[2] | 600 | Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 601 | Void setMVPNumSubParts ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[1200] | 602 | |
---|
[2] | 603 | Void clipMv ( TComMv& rcMv ); |
---|
[1200] | 604 | #if NH_MV |
---|
[1196] | 605 | Void checkMvVertRest (TComMv& rcMv, RefPicList eRefPicList, int iRefIdx ); |
---|
[1179] | 606 | #endif |
---|
[2] | 607 | Void getMvPredLeft ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldA.getMv(); } |
---|
| 608 | Void getMvPredAbove ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldB.getMv(); } |
---|
| 609 | Void getMvPredAboveRight ( TComMv& rcMvPred ) { rcMvPred = m_cMvFieldC.getMv(); } |
---|
[1200] | 610 | #if NH_3D |
---|
[655] | 611 | Void compressMV ( Int scale ); |
---|
[608] | 612 | #else |
---|
[2] | 613 | Void compressMV (); |
---|
[608] | 614 | #endif |
---|
[2] | 615 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 616 | // utility functions for neighbouring information |
---|
| 617 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 618 | |
---|
| 619 | TComDataCU* getCtuLeft () { return m_pCtuLeft; } |
---|
| 620 | TComDataCU* getCtuAbove () { return m_pCtuAbove; } |
---|
| 621 | TComDataCU* getCtuAboveLeft () { return m_pCtuAboveLeft; } |
---|
| 622 | TComDataCU* getCtuAboveRight () { return m_pCtuAboveRight; } |
---|
[2] | 623 | TComDataCU* getCUColocated ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; } |
---|
[1200] | 624 | Bool CUIsFromSameSlice ( const TComDataCU *pCU /* Can be NULL */) const { return ( pCU!=NULL && pCU->getSlice()->getSliceCurStartCtuTsAddr() == getSlice()->getSliceCurStartCtuTsAddr() ); } |
---|
| 625 | Bool CUIsFromSameTile ( const TComDataCU *pCU /* Can be NULL */) const; |
---|
| 626 | Bool CUIsFromSameSliceAndTile ( const TComDataCU *pCU /* Can be NULL */) const; |
---|
| 627 | Bool CUIsFromSameSliceTileAndWavefrontRow( const TComDataCU *pCU /* Can be NULL */) const; |
---|
| 628 | Bool isLastSubCUOfCtu(const UInt absPartIdx); |
---|
[56] | 629 | |
---|
| 630 | |
---|
[1200] | 631 | TComDataCU* getPULeft ( UInt& uiLPartUnitIdx, |
---|
| 632 | UInt uiCurrPartUnitIdx, |
---|
| 633 | Bool bEnforceSliceRestriction=true, |
---|
[608] | 634 | Bool bEnforceTileRestriction=true ); |
---|
| 635 | TComDataCU* getPUAbove ( UInt& uiAPartUnitIdx, |
---|
[1200] | 636 | UInt uiCurrPartUnitIdx, |
---|
| 637 | Bool bEnforceSliceRestriction=true, |
---|
| 638 | Bool planarAtCTUBoundary = false, |
---|
[608] | 639 | Bool bEnforceTileRestriction=true ); |
---|
| 640 | TComDataCU* getPUAboveLeft ( UInt& uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true ); |
---|
[56] | 641 | |
---|
[1200] | 642 | TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu ); |
---|
| 643 | TComDataCU* getQpMinCuAbove ( UInt& uiAPartUnitIdx , UInt uiCurrAbsIdxInCtu ); |
---|
| 644 | Char getRefQP ( UInt uiCurrAbsIdxInCtu ); |
---|
[56] | 645 | |
---|
[1200] | 646 | /// returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU, at a horizontal offset (to the right) of uiPartUnitOffset (in parts) |
---|
| 647 | TComDataCU* getPUAboveRight ( UInt& uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 648 | /// returns CU and part index of the PU left of the lefthand column of the current uiCurrPartUnitIdx of the CU, at a vertical offset (below) of uiPartUnitOffset (in parts) |
---|
| 649 | TComDataCU* getPUBelowLeft ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true ); |
---|
| 650 | |
---|
[608] | 651 | Void deriveLeftRightTopIdx ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 652 | Void deriveLeftBottomIdx ( UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[1200] | 653 | |
---|
[2] | 654 | Bool hasEqualMotion ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx ); |
---|
[724] | 655 | |
---|
[773] | 656 | #if H_3D |
---|
[724] | 657 | Bool getAvailableFlagA1() { return m_bAvailableFlagA1;} |
---|
| 658 | Bool getAvailableFlagB1() { return m_bAvailableFlagB1;} |
---|
| 659 | Bool getAvailableFlagB0() { return m_bAvailableFlagB0;} |
---|
| 660 | Bool getAvailableFlagA0() { return m_bAvailableFlagA0;} |
---|
| 661 | Bool getAvailableFlagB2() { return m_bAvailableFlagB2;} |
---|
| 662 | Void initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0; } |
---|
[950] | 663 | Void buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 664 | #if H_3D_VSP |
---|
| 665 | , Int* vspFlag |
---|
| 666 | #endif |
---|
| 667 | #if H_3D_SPIVMP |
---|
| 668 | , Bool* pbSPIVMPFlag |
---|
| 669 | #endif |
---|
| 670 | , Int& numValidMergeCand |
---|
| 671 | ); |
---|
[724] | 672 | Void getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1); |
---|
| 673 | Void xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours |
---|
| 674 | #else |
---|
[1200] | 675 | Void getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 ); |
---|
[724] | 676 | #endif |
---|
[773] | 677 | #if H_3D_SPIVMP |
---|
[950] | 678 | , TComMvField* pcMvFieldSP, UChar* puhInterDirSP |
---|
[724] | 679 | #endif |
---|
[622] | 680 | |
---|
[608] | 681 | #if H_3D_VSP |
---|
[773] | 682 | #if H_3D_SPIVMP |
---|
[724] | 683 | Bool* getSPIVMPFlag () { return m_pbSPIVMPFlag; } |
---|
| 684 | Bool getSPIVMPFlag ( UInt uiIdx ) { return m_pbSPIVMPFlag[uiIdx]; } |
---|
| 685 | Void setSPIVMPFlag ( UInt uiIdx, Bool n ) { m_pbSPIVMPFlag[uiIdx] = n; } |
---|
| 686 | Void setSPIVMPFlagSubParts( Bool bSPIVMPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
| 687 | #endif |
---|
| 688 | |
---|
[608] | 689 | Char* getVSPFlag () { return m_piVSPFlag; } |
---|
| 690 | Char getVSPFlag ( UInt uiIdx ) { return m_piVSPFlag[uiIdx]; } |
---|
| 691 | Void setVSPFlag ( UInt uiIdx, Int n ) { m_piVSPFlag[uiIdx] = n; } |
---|
| 692 | Void setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); |
---|
[833] | 693 | Void setMvFieldPUForVSP ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize ); |
---|
[608] | 694 | #endif |
---|
| 695 | Void deriveLeftRightTopIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT ); |
---|
| 696 | Void deriveLeftBottomIdxGeneral ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB ); |
---|
[1200] | 697 | |
---|
[2] | 698 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 699 | // member functions for modes |
---|
| 700 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 701 | |
---|
| 702 | Bool isIntra ( UInt uiPartIdx ) const { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; } |
---|
| 703 | Bool isInter ( UInt uiPartIdx ) const { return m_pePredMode[ uiPartIdx ] == MODE_INTER; } |
---|
| 704 | Bool isSkipped ( UInt uiPartIdx ); ///< returns true, if the partiton is skipped |
---|
[608] | 705 | Bool isBipredRestriction( UInt puIdx ); |
---|
| 706 | |
---|
[773] | 707 | #if H_3D_IC |
---|
[724] | 708 | Bool isIC ( UInt uiPartIdx ); |
---|
| 709 | #endif |
---|
| 710 | |
---|
[2] | 711 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 712 | // member functions for symbol prediction (most probable / mode conversion) |
---|
| 713 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 714 | |
---|
[2] | 715 | UInt getIntraSizeIdx ( UInt uiAbsPartIdx ); |
---|
[1200] | 716 | |
---|
[56] | 717 | Void getAllowedChromaDir ( UInt uiAbsPartIdx, UInt* uiModeList ); |
---|
[1200] | 718 | Void getIntraDirPredictor ( UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int* piMode = NULL ); |
---|
| 719 | |
---|
[2] | 720 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 721 | // member functions for SBAC context |
---|
| 722 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 723 | |
---|
[2] | 724 | UInt getCtxSplitFlag ( UInt uiAbsPartIdx, UInt uiDepth ); |
---|
[1200] | 725 | UInt getCtxQtCbf ( TComTU &rTu, const ChannelType chType ); |
---|
[56] | 726 | |
---|
[2] | 727 | UInt getCtxSkipFlag ( UInt uiAbsPartIdx ); |
---|
[608] | 728 | UInt getCtxInterDir ( UInt uiAbsPartIdx ); |
---|
| 729 | #if H_3D_ARP |
---|
| 730 | UInt getCTXARPWFlag ( UInt uiAbsPartIdx ); |
---|
| 731 | #endif |
---|
[1200] | 732 | |
---|
| 733 | UInt& getTotalBins () { return m_uiTotalBins; } |
---|
[2] | 734 | // ------------------------------------------------------------------------------------------------------------------- |
---|
| 735 | // member functions for RD cost storage |
---|
| 736 | // ------------------------------------------------------------------------------------------------------------------- |
---|
[1200] | 737 | |
---|
[2] | 738 | Double& getTotalCost() { return m_dTotalCost; } |
---|
[1200] | 739 | #if NH_3D_VSO |
---|
[189] | 740 | Dist& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
[608] | 741 | #else |
---|
[1200] | 742 | Distortion& getTotalDistortion() { return m_uiTotalDistortion; } |
---|
[608] | 743 | #endif |
---|
[2] | 744 | UInt& getTotalBits() { return m_uiTotalBits; } |
---|
| 745 | UInt& getTotalNumPart() { return m_uiNumPartition; } |
---|
| 746 | |
---|
[1200] | 747 | UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ; |
---|
[2] | 748 | |
---|
[1084] | 749 | #if H_3D_DIM |
---|
[1039] | 750 | Bool isDMM1UpscaleMode ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; }; |
---|
| 751 | UInt getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth = uiWidth; } return uiBaseWidth; } |
---|
| 752 | #endif |
---|
| 753 | |
---|
[2] | 754 | }; |
---|
| 755 | |
---|
[56] | 756 | namespace RasterAddress |
---|
| 757 | { |
---|
| 758 | /** Check whether 2 addresses point to the same column |
---|
| 759 | * \param addrA First address in raster scan order |
---|
| 760 | * \param addrB Second address in raters scan order |
---|
| 761 | * \param numUnitsPerRow Number of units in a row |
---|
| 762 | * \return Result of test |
---|
| 763 | */ |
---|
| 764 | static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 765 | { |
---|
| 766 | // addrA % numUnitsPerRow == addrB % numUnitsPerRow |
---|
| 767 | return (( addrA ^ addrB ) & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 768 | } |
---|
[1200] | 769 | |
---|
[56] | 770 | /** Check whether 2 addresses point to the same row |
---|
| 771 | * \param addrA First address in raster scan order |
---|
| 772 | * \param addrB Second address in raters scan order |
---|
| 773 | * \param numUnitsPerRow Number of units in a row |
---|
| 774 | * \return Result of test |
---|
| 775 | */ |
---|
| 776 | static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 777 | { |
---|
| 778 | // addrA / numUnitsPerRow == addrB / numUnitsPerRow |
---|
| 779 | return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 780 | } |
---|
[1200] | 781 | |
---|
[56] | 782 | /** Check whether 2 addresses point to the same row or column |
---|
| 783 | * \param addrA First address in raster scan order |
---|
| 784 | * \param addrB Second address in raters scan order |
---|
| 785 | * \param numUnitsPerRow Number of units in a row |
---|
| 786 | * \return Result of test |
---|
| 787 | */ |
---|
| 788 | static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow ) |
---|
| 789 | { |
---|
| 790 | return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow ); |
---|
| 791 | } |
---|
[1200] | 792 | |
---|
[56] | 793 | /** Check whether one address points to the first column |
---|
| 794 | * \param addr Address in raster scan order |
---|
| 795 | * \param numUnitsPerRow Number of units in a row |
---|
| 796 | * \return Result of test |
---|
| 797 | */ |
---|
| 798 | static inline Bool isZeroCol( Int addr, Int numUnitsPerRow ) |
---|
| 799 | { |
---|
| 800 | // addr % numUnitsPerRow == 0 |
---|
| 801 | return ( addr & ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 802 | } |
---|
[1200] | 803 | |
---|
[56] | 804 | /** Check whether one address points to the first row |
---|
| 805 | * \param addr Address in raster scan order |
---|
| 806 | * \param numUnitsPerRow Number of units in a row |
---|
| 807 | * \return Result of test |
---|
| 808 | */ |
---|
| 809 | static inline Bool isZeroRow( Int addr, Int numUnitsPerRow ) |
---|
| 810 | { |
---|
| 811 | // addr / numUnitsPerRow == 0 |
---|
| 812 | return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0; |
---|
| 813 | } |
---|
[1200] | 814 | |
---|
[56] | 815 | /** Check whether one address points to a column whose index is smaller than a given value |
---|
| 816 | * \param addr Address in raster scan order |
---|
| 817 | * \param val Given column index value |
---|
| 818 | * \param numUnitsPerRow Number of units in a row |
---|
| 819 | * \return Result of test |
---|
| 820 | */ |
---|
| 821 | static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 822 | { |
---|
| 823 | // addr % numUnitsPerRow < val |
---|
| 824 | return ( addr & ( numUnitsPerRow - 1 ) ) < val; |
---|
| 825 | } |
---|
[1200] | 826 | |
---|
[56] | 827 | /** Check whether one address points to a row whose index is smaller than a given value |
---|
| 828 | * \param addr Address in raster scan order |
---|
| 829 | * \param val Given row index value |
---|
| 830 | * \param numUnitsPerRow Number of units in a row |
---|
| 831 | * \return Result of test |
---|
| 832 | */ |
---|
| 833 | static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow ) |
---|
| 834 | { |
---|
| 835 | // addr / numUnitsPerRow < val |
---|
| 836 | return addr < val * numUnitsPerRow; |
---|
| 837 | } |
---|
[1200] | 838 | } |
---|
[56] | 839 | |
---|
| 840 | //! \} |
---|
| 841 | |
---|
[2] | 842 | #endif |
---|