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