Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.h


Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComDataCU.h

    r1196 r1313  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    6 * Copyright (c) 2010-2015, ITU/ISO/IEC
     6 * Copyright (c) 2010-2015, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    3737*/
    3838
    39 #ifndef _TCOMDATACU_
    40 #define _TCOMDATACU_
    41 
    42 #include <assert.h>
     39#ifndef __TCOMDATACU__
     40#define __TCOMDATACU__
     41
     42#include <algorithm>
     43#include <vector>
    4344
    4445// Include files
     
    4950#include "TComPattern.h"
    5051
    51 #if H_3D_ARP
    52 #include "TComYuv.h"
    53 #endif
    54 
    55 #include <algorithm>
    56 #include <vector>
    57 
    5852//! \ingroup TLibCommon
    5953//! \{
    6054
    61 
    62 #if H_3D_DBBP
     55class TComTU; // forward declaration
     56
     57static const UInt NUM_MOST_PROBABLE_MODES=3;
     58
     59#if NH_3D_DBBP
    6360typedef struct _DBBPTmpData
    6461{
     
    7572#endif
    7673
     74
    7775// ====================================================================================================================
    7876// Class definition
     
    8381{
    8482private:
    85  
     83
    8684  // -------------------------------------------------------------------------------------------------------------------
    8785  // class pointers
    8886  // -------------------------------------------------------------------------------------------------------------------
    89  
     87
    9088  TComPic*      m_pcPic;              ///< picture class pointer
    9189  TComSlice*    m_pcSlice;            ///< slice header pointer
    92   TComPattern*  m_pcPattern;          ///< neighbour access class pointer
    93  
     90
    9491  // -------------------------------------------------------------------------------------------------------------------
    9592  // CU description
    9693  // -------------------------------------------------------------------------------------------------------------------
    97  
    98   UInt          m_uiCUAddr;           ///< CU address in a slice
    99   UInt          m_uiAbsIdxInLCU;      ///< absolute address in a CU. It's Z scan order
     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
    10097  UInt          m_uiCUPelX;           ///< CU position in a pixel (X)
    10198  UInt          m_uiCUPelY;           ///< CU position in a pixel (Y)
     
    105102  UChar*        m_puhDepth;           ///< array of depths
    106103  Int           m_unitSize;           ///< size of a "minimum partition"
    107  
     104
    108105  // -------------------------------------------------------------------------------------------------------------------
    109106  // CU data
    110107  // -------------------------------------------------------------------------------------------------------------------
    111   Bool*         m_skipFlag;           ///< array of skip flags
    112 #if H_3D
    113   Bool*         m_bDISFlag;         
    114   UInt*         m_uiDISType;
    115 #endif
    116   Char*         m_pePartSize;         ///< array of partition sizes
    117   Char*         m_pePredMode;         ///< array of prediction modes
    118   Bool*         m_CUTransquantBypass;   ///< array of cu_transquant_bypass flags
    119   Char*         m_phQP;               ///< array of QP values
    120   UChar*        m_puhTrIdx;           ///< array of transform indices
    121   UChar*        m_puhTransformSkip[3];///< array of transform skipping flags
    122   UChar*        m_puhCbf[3];          ///< array of coded block flags (CBF)
    123   TComCUMvField m_acCUMvField[2];     ///< array of motion vectors
    124   TCoeff*       m_pcTrCoeffY;         ///< transformed coefficient buffer (Y)
    125   TCoeff*       m_pcTrCoeffCb;        ///< transformed coefficient buffer (Cb)
    126   TCoeff*       m_pcTrCoeffCr;        ///< transformed coefficient buffer (Cr)
     108
     109  Bool*          m_skipFlag;           ///< array of skip flags
     110#if NH_3D_DIS
     111  Bool*          m_bDISFlag;         
     112  UChar*         m_ucDISType;
     113#endif
     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)
    127126#if ADAPTIVE_QP_SELECTION
    128   Int*          m_pcArlCoeffY;        ///< ARL coefficient buffer (Y)
    129   Int*          m_pcArlCoeffCb;       ///< ARL coefficient buffer (Cb)
    130   Int*          m_pcArlCoeffCr;       ///< ARL coefficient buffer (Cr)
    131   Bool          m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d
    132 
    133   static Int*   m_pcGlbArlCoeffY;     ///< ARL coefficient buffer (Y)
    134   static Int*   m_pcGlbArlCoeffCb;    ///< ARL coefficient buffer (Cb)
    135   static Int*   m_pcGlbArlCoeffCr;    ///< ARL coefficient buffer (Cr)
    136 #endif
    137  
    138   Pel*          m_pcIPCMSampleY;      ///< PCM sample buffer (Y)
    139   Pel*          m_pcIPCMSampleCb;     ///< PCM sample buffer (Cb)
    140   Pel*          m_pcIPCMSampleCr;     ///< PCM sample buffer (Cr)
     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
     129#endif
     130
     131  Pel*           m_pcIPCMSample[MAX_NUM_COMPONENT];    ///< PCM sample buffer (0->Y, 1->Cb, 2->Cr)
    141132
    142133  // -------------------------------------------------------------------------------------------------------------------
    143134  // neighbour access variables
    144135  // -------------------------------------------------------------------------------------------------------------------
    145  
    146   TComDataCU*   m_pcCUAboveLeft;      ///< pointer of above-left CU
    147   TComDataCU*   m_pcCUAboveRight;     ///< pointer of above-right CU
    148   TComDataCU*   m_pcCUAbove;          ///< pointer of above CU
    149   TComDataCU*   m_pcCULeft;           ///< pointer of left CU
    150   TComDataCU*   m_apcCUColocated[2];  ///< pointer of temporally colocated CU's for both directions
     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
    151142  TComMvField   m_cMvFieldA;          ///< motion vector of position A
    152143  TComMvField   m_cMvFieldB;          ///< motion vector of position B
    153144  TComMvField   m_cMvFieldC;          ///< motion vector of position C
    154145  TComMv        m_cMvPred;            ///< motion vector predictor
    155  
     146
    156147  // -------------------------------------------------------------------------------------------------------------------
    157148  // coding tool information
    158149  // -------------------------------------------------------------------------------------------------------------------
    159  
     150
    160151  Bool*         m_pbMergeFlag;        ///< array of merge flags
    161152  UChar*        m_puhMergeIndex;      ///< array of merge candidate indices
     
    163154  Bool          m_bIsMergeAMP;
    164155#endif
    165   UChar*        m_puhLumaIntraDir;    ///< array of intra directions (luma)
    166   UChar*        m_puhChromaIntraDir;  ///< array of intra directions (chroma)
     156  UChar*        m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]; // 0-> Luma, 1-> Chroma
    167157  UChar*        m_puhInterDir;        ///< array of inter directions
    168   Char*         m_apiMVPIdx[2];       ///< array of motion vector predictor candidates
    169   Char*         m_apiMVPNum[2];       ///< array of number of possible motion vectors predictors
     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
    170160  Bool*         m_pbIPCMFlag;         ///< array of intra_pcm flags
    171 #if H_3D_NBDV
     161#if NH_3D_NBDV
    172162  DisInfo*      m_pDvInfo;
    173163#endif
    174 #if H_3D_VSP
     164#if NH_3D_VSP
    175165  Char*         m_piVSPFlag;          ///< array of VSP flags to indicate whehter a block uses VSP or not  ///< 0: non-VSP; 1: VSP
    176166#endif
    177 #if H_3D_SPIVMP
     167#if NH_3D_SPIVMP
    178168  Bool*         m_pbSPIVMPFlag;       ///< array of sub-PU IVMP flags to indicate whehter a block uses sub-PU IVMP ///< 0: non-SPIVMP; 1: SPIVMP
    179169#endif
    180 #if H_3D_ARP
     170#if NH_3D_ARP
    181171  UChar*        m_puhARPW;
    182172#endif
    183 #if H_3D_IC
     173#if NH_3D_IC
    184174  Bool*         m_pbICFlag;           ///< array of IC flags
    185175#endif
    186 #if H_3D_DIM
    187   Pel*          m_dimDeltaDC[DIM_NUM_TYPE][2];
    188 #if H_3D_DIM_DMM
    189   UInt*         m_dmmWedgeTabIdx[DMM_NUM_TYPE];
    190 #endif
    191 #if H_3D_DIM_SDC
     176#if NH_3D_DMM
     177  Pel*          m_dmmDeltaDC[NUM_DMM][2];
     178  UInt*         m_dmm1WedgeTabIdx;
     179#endif
     180#if NH_3D_SDC_INTRA
    192181  Bool*         m_pbSDCFlag;
    193182  Pel*          m_apSegmentDCOffset[2];
    194   Pel           m_apDmmPredictor[2];
    195 #endif
    196 #endif
    197 #if H_3D_DBBP
     183#endif
     184#if NH_3D_DBBP
    198185  Bool*         m_pbDBBPFlag;        ///< array of DBBP flags
    199186  DbbpTmpData   m_sDBBPTmpData;
    200187#endif
    201 #if H_3D
     188#if NH_3D_MLC
    202189  Bool          m_bAvailableFlagA1;    ///< A1 available flag
    203190  Bool          m_bAvailableFlagB1;    ///< B1 available flag
     
    206193  Bool          m_bAvailableFlagB2;    ///< B2 available flag
    207194#endif
     195
     196
    208197  // -------------------------------------------------------------------------------------------------------------------
    209198  // misc. variables
    210199  // -------------------------------------------------------------------------------------------------------------------
    211  
     200
    212201  Bool          m_bDecSubCu;          ///< indicates decoder-mode
    213202  Double        m_dTotalCost;         ///< sum of partition RD costs
    214 #if H_3D_VSO
     203#if NH_3D_VSO
    215204  Dist          m_uiTotalDistortion;  ///< sum of partition distortion
    216205#else
    217   UInt          m_uiTotalDistortion;  ///< sum of partition distortion
     206  Distortion    m_uiTotalDistortion;  ///< sum of partition distortion
    218207#endif
    219208  UInt          m_uiTotalBits;        ///< sum of partition bits
    220   UInt          m_uiTotalBins;       ///< sum of partition bins
    221   UInt*         m_sliceStartCU;    ///< Start CU address of current slice
    222   UInt*         m_sliceSegmentStartCU; ///< Start CU address of current slice
     209  UInt          m_uiTotalBins;        ///< sum of partition bins
    223210  Char          m_codedQP;
    224 #if H_3D
    225   DisInfo       m_cDefaultDisInfo;    ///< Default disparity information for initializing
    226 #endif
    227 #if H_3D_IV_MERGE
    228   TComMotionCand  m_mergCands[MRG_IVSHIFT+1];
    229   Int           m_baseListidc;
    230 #endif
     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;
     215#endif
     216
     217  UChar*        m_explicitRdpcmMode[MAX_NUM_COMPONENT]; ///< Stores the explicit RDPCM mode for all TUs belonging to this CU
    231218
    232219protected:
    233  
     220
    234221  /// add possible motion vector predictor candidates
    235222  Bool          xAddMVPCand           ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    236223  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
    237 #if H_3D_VSP
     224#if NH_3D_VSP
    238225  Bool          xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount);
    239226#endif
    240 #if H_3D_IV_MERGE
     227#if NH_3D_IV_MERGE
    241228  Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx );
    242229#endif
    243230
    244231  Void          deriveRightBottomIdx        ( UInt uiPartIdx, UInt& ruiPartIdxRB );
    245   Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx
    246 #if H_3D_TMVP
     232  Bool          xGetColMVP( RefPicList eRefPicList, Int ctuRsAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx
     233#if NH_3D_TMVP
    247234  ,  Bool bMRG = true
    248235#endif
    249   );
    250  
    251   /// compute required bits to encode MVD (used in AMVP)
    252   UInt          xGetMvdBits           ( TComMv cMvd );
    253   UInt          xGetComponentBits     ( Int iVal );
    254  
     236 );
     237
     238
    255239  /// compute scaling factor from POC difference
    256 #if !H_3D_ARP
     240#if !NH_3D_ARP
    257241  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    258242#endif
     
    260244  Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter );
    261245
    262 #if H_3D_VSP
     246#if NH_3D_VSP
    263247  Void xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
    264248#endif
     
    267251  TComDataCU();
    268252  virtual ~TComDataCU();
    269  
     253
    270254  // -------------------------------------------------------------------------------------------------------------------
    271255  // create / destroy / initialize / copy
    272256  // -------------------------------------------------------------------------------------------------------------------
    273 #if H_3D_ARP
     257#if NH_3D_ARP
     258  /// compute scaling factor from POC difference
    274259  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
    275260#endif
    276   Void          create                ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize
     261  Void          create                ( ChromaFormat chromaFormatIDC, UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize
    277262#if ADAPTIVE_QP_SELECTION
    278     , Bool bGlobalRMARLBuffer = false
    279 #endif 
     263    , TCoeff *pParentARLBuffer = 0
     264#endif
    280265    );
    281266  Void          destroy               ();
    282  
    283   Void          initCU                ( TComPic* pcPic, UInt uiCUAddr );
    284   Void          initEstData           ( UInt uiDepth, Int qp, Bool bTransquantBypass );
     267
     268  Void          initCtu               ( TComPic* pcPic, UInt ctuRsAddr );
     269  Void          initEstData           ( const UInt uiDepth, const Int qp, const Bool bTransquantBypass );
    285270  Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp );
    286271  Void          setOutsideCUPart      ( UInt uiAbsPartIdx, UInt uiDepth );
    287 #if H_3D_NBDV
    288   Void          copyDVInfoFrom (TComDataCU* pcCU, UInt uiAbsPartIdx);
    289 #endif
    290   Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
    291   Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList
    292 #if H_3D_NBDV
     272#if NH_3D_NBDV
     273  Void          copyDVInfoFrom        (TComDataCU* pcCU, UInt uiAbsPartIdx);
     274#endif
     275
     276  Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx );
     277  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList
     278#if NH_3D_NBDV
    293279  , Bool bNBDV = false
    294280#endif
    295   );
     281);
    296282  Void          copyPartFrom          ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
    297  
     283
    298284  Void          copyToPic             ( UChar uiDepth );
    299   Void          copyToPic             ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth );
    300  
     285
    301286  // -------------------------------------------------------------------------------------------------------------------
    302287  // member functions for CU description
    303288  // -------------------------------------------------------------------------------------------------------------------
    304  
    305   TComPic*      getPic                ()                        { return m_pcPic;           }
    306   TComSlice*    getSlice              ()                        { return m_pcSlice;         }
    307 #if H_3D_DISABLE_CHROMA
    308   Void         setSlice              ( TComSlice* pcSlice)     { m_pcSlice = pcSlice;       }
    309 #endif
    310   UInt&         getAddr               ()                        { return m_uiCUAddr;        }
    311   UInt&         getZorderIdxInCU      ()                        { return m_uiAbsIdxInLCU; }
    312   UInt          getSCUAddr            ();
    313   UInt          getCUPelX             ()                        { return m_uiCUPelX;        }
    314   UInt          getCUPelY             ()                        { return m_uiCUPelY;        }
    315   TComPattern*  getPattern            ()                        { return m_pcPattern;       }
    316  
     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
    317300  UChar*        getDepth              ()                        { return m_puhDepth;        }
    318   UChar         getDepth              ( UInt uiIdx )            { return m_puhDepth[uiIdx]; }
     301  UChar         getDepth              ( UInt uiIdx ) const      { return m_puhDepth[uiIdx]; }
    319302  Void          setDepth              ( UInt uiIdx, UChar  uh ) { m_puhDepth[uiIdx] = uh;   }
    320  
     303
    321304  Void          setDepthSubParts      ( UInt uiDepth, UInt uiAbsPartIdx );
    322 #if H_3D
    323   Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY );
    324 #endif
    325  
     305#if NH_3D_VSO
     306  Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY ) const;
     307#endif
     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
    326313  // -------------------------------------------------------------------------------------------------------------------
    327314  // member functions for CU data
    328315  // -------------------------------------------------------------------------------------------------------------------
    329  
     316
    330317  Char*         getPartitionSize      ()                        { return m_pePartSize;        }
    331318  PartSize      getPartitionSize      ( UInt uiIdx )            { return static_cast<PartSize>( m_pePartSize[uiIdx] ); }
     
    333320  Void          setPartSizeSubParts   ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth );
    334321  Void          setCUTransquantBypassSubParts( Bool flag, UInt uiAbsPartIdx, UInt uiDepth );
     322
     323#if NH_3D_DBBP
     324  Pel*          getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride);
     325#endif
    335326 
    336 #if H_3D_DBBP
    337   Pel*          getVirtualDepthBlock(UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt& uiDepthStride);
    338 #endif
    339  
    340   Bool*        getSkipFlag            ()                        { return m_skipFlag;          }
    341   Bool         getSkipFlag            (UInt idx)                { return m_skipFlag[idx];     }
    342   Void         setSkipFlag           ( UInt idx, Bool skip)     { m_skipFlag[idx] = skip;   }
    343   Void         setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
    344 #if H_3D
     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
    345332  Bool*        getDISFlag            ()                         { return m_bDISFlag;          }
    346333  Bool         getDISFlag            ( UInt idx)                { return m_bDISFlag[idx];     }
    347334  Void         setDISFlag            ( UInt idx, Bool bDIS)     { m_bDISFlag[idx] = bDIS;   }
    348   Void         setDISFlagSubParts    ( Bool bDIS, UInt absPartIdx, UInt depth );
    349 
    350   UInt*        getDISType            ()                         { return m_uiDISType; }
    351   UInt         getDISType            ( UInt idx)                { return m_uiDISType[idx];     }
    352   Void         getDISType            ( UInt idx, UInt uiDISType)     { m_uiDISType[idx] = uiDISType;   }
    353   Void         setDISTypeSubParts    ( UInt uiDISType, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth );
     335  Void         setDISFlagSubParts    ( Bool bDIS, UInt uiAbsPartIdx, UInt uiDepth );
     336
     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 );
    354341#endif
    355342  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
    356343  PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
    357   Bool*         getCUTransquantBypass ()                        { return m_CUTransquantBypass;        }
    358   Bool          getCUTransquantBypass( UInt uiIdx )             { return m_CUTransquantBypass[uiIdx]; }
    359344  Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
    360345  Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
    361  
    362 #if H_3D_DBBP
     346
     347#if NH_3D_DBBP
    363348  Bool*         getDBBPFlag           ()                        { return m_pbDBBPFlag;               }
    364349  Bool          getDBBPFlag           ( UInt uiIdx )            { return m_pbDBBPFlag[uiIdx];        }
     
    367352  DbbpTmpData*  getDBBPTmpData        () { return &m_sDBBPTmpData; }
    368353#endif
    369  
     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
    370361  UChar*        getWidth              ()                        { return m_puhWidth;          }
    371362  UChar         getWidth              ( UInt uiIdx )            { return m_puhWidth[uiIdx];   }
    372363  Void          setWidth              ( UInt uiIdx, UChar  uh ) { m_puhWidth[uiIdx] = uh;     }
    373  
     364
    374365  UChar*        getHeight             ()                        { return m_puhHeight;         }
    375366  UChar         getHeight             ( UInt uiIdx )            { return m_puhHeight[uiIdx];  }
    376367  Void          setHeight             ( UInt uiIdx, UChar  uh ) { m_puhHeight[uiIdx] = uh;    }
    377  
     368
    378369  Void          setSizeSubParts       ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth );
    379  
     370
    380371  Char*         getQP                 ()                        { return m_phQP;              }
    381   Char          getQP                 ( UInt uiIdx )            { return m_phQP[uiIdx];       }
     372  Char          getQP                 ( UInt uiIdx ) const      { return m_phQP[uiIdx];       }
    382373  Void          setQP                 ( UInt uiIdx, Char value ){ m_phQP[uiIdx] =  value;     }
    383374  Void          setQPSubParts         ( Int qp,   UInt uiAbsPartIdx, UInt uiDepth );
    384375  Int           getLastValidPartIdx   ( Int iAbsPartIdx );
    385376  Char          getLastCodedQP        ( UInt uiAbsPartIdx );
    386   Void          setQPSubCUs           ( Int qp, TComDataCU* pcCU, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf );
     377  Void          setQPSubCUs           ( Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf );
    387378  Void          setCodedQP            ( Char qp )               { m_codedQP = qp;             }
    388379  Char          getCodedQP            ()                        { return m_codedQP;           }
    389380
    390   Bool          isLosslessCoded(UInt absPartIdx);
    391  
     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
    392390  UChar*        getTransformIdx       ()                        { return m_puhTrIdx;          }
    393391  UChar         getTransformIdx       ( UInt uiIdx )            { return m_puhTrIdx[uiIdx];   }
    394392  Void          setTrIdxSubParts      ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth );
    395393
    396   UChar*        getTransformSkip      ( TextType eType)    { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]];}
    397   UChar         getTransformSkip      ( UInt uiIdx,TextType eType)    { return m_puhTransformSkip[g_aucConvertTxtTypeToIdx[eType]][uiIdx];}
    398   Void          setTransformSkipSubParts  ( UInt useTransformSkip, TextType eType, UInt uiAbsPartIdx, UInt uiDepth);
    399   Void          setTransformSkipSubParts  ( UInt useTransformSkipY, UInt useTransformSkipU, UInt useTransformSkipV, UInt uiAbsPartIdx, UInt uiDepth );
    400 
    401   UInt          getQuadtreeTULog2MinSizeInCU( UInt absPartIdx );
    402  
     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 );
     398
     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
    403410  TComCUMvField* getCUMvField         ( RefPicList e )          { return  &m_acCUMvField[e];  }
    404  
    405   TCoeff*&      getCoeffY             ()                        { return m_pcTrCoeffY;        }
    406   TCoeff*&      getCoeffCb            ()                        { return m_pcTrCoeffCb;       }
    407   TCoeff*&      getCoeffCr            ()                        { return m_pcTrCoeffCr;       }
     411
     412  TCoeff*       getCoeff              (ComponentID component)   { return m_pcTrCoeff[component]; }
     413
    408414#if ADAPTIVE_QP_SELECTION
    409   Int*&         getArlCoeffY          ()                        { return m_pcArlCoeffY;       }
    410   Int*&         getArlCoeffCb         ()                        { return m_pcArlCoeffCb;      }
    411   Int*&         getArlCoeffCr         ()                        { return m_pcArlCoeffCr;      }
    412 #endif
    413  
    414   Pel*&         getPCMSampleY         ()                        { return m_pcIPCMSampleY;     }
    415   Pel*&         getPCMSampleCb        ()                        { return m_pcIPCMSampleCb;    }
    416   Pel*&         getPCMSampleCr        ()                        { return m_pcIPCMSampleCr;    }
    417 
    418   UChar         getCbf    ( UInt uiIdx, TextType eType )                  { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx];  }
    419   UChar*        getCbf    ( TextType eType )                              { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]];         }
    420 
    421   UChar         getCbf    ( UInt uiIdx, TextType eType, UInt uiTrDepth )  { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); }
    422   Void          setCbf    ( UInt uiIdx, TextType eType, UChar uh )        { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh;    }
    423 
    424   Void          clearCbf  ( UInt uiIdx, TextType eType, UInt uiNumParts );
    425   UChar         getQtRootCbf          ( UInt uiIdx )                      { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); }
    426  
    427   Void          setCbfSubParts        ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth          );
    428   Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth                    );
    429   Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth    );
    430  
     415  TCoeff*       getArlCoeff           ( ComponentID component ) { return m_pcArlCoeff[component]; }
     416#endif
     417  Pel*          getPCMSample          ( ComponentID component ) { return m_pcIPCMSample[component]; }
     418
     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 );
     425
     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    );
     429
     430  Void          setCbfPartRange       ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes      );
     431  Void          bitwiseOrCbfPartRange ( UInt uiCbf, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes      );
     432
    431433  // -------------------------------------------------------------------------------------------------------------------
    432434  // member functions for coding tool information
    433435  // -------------------------------------------------------------------------------------------------------------------
    434  
     436
    435437  Bool*         getMergeFlag          ()                        { return m_pbMergeFlag;               }
    436438  Bool          getMergeFlag          ( UInt uiIdx )            { return m_pbMergeFlag[uiIdx];        }
     
    443445  Void          setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    444446  template <typename T>
    445   Void          setSubPart            ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
    446 #if H_3D_VSP
     447  Void          setSubPart            ( T bParameter, T* pbBaseCtu, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
     448#if H_3D_VSP || NH_3D_DBBP
    447449  template<typename T>
    448450  Void          setSubPartT           ( T uiParameter, T* puhBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
    449451#endif
     452
    450453#if AMP_MRG
    451454  Void          setMergeAMP( Bool b )      { m_bIsMergeAMP = b; }
     
    453456#endif
    454457
    455   UChar*        getLumaIntraDir       ()                        { return m_puhLumaIntraDir;           }
    456   UChar         getLumaIntraDir       ( UInt uiIdx )            { return m_puhLumaIntraDir[uiIdx];    }
    457   Void          setLumaIntraDir       ( UInt uiIdx, UChar  uh ) { m_puhLumaIntraDir[uiIdx] = uh;      }
    458   Void          setLumaIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
    459  
    460   UChar*        getChromaIntraDir     ()                        { return m_puhChromaIntraDir;         }
    461   UChar         getChromaIntraDir     ( UInt uiIdx )            { return m_puhChromaIntraDir[uiIdx];  }
    462   Void          setChromaIntraDir     ( UInt uiIdx, UChar  uh ) { m_puhChromaIntraDir[uiIdx] = uh;    }
    463   Void          setChromIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
    464  
     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
    465466  UChar*        getInterDir           ()                        { return m_puhInterDir;               }
    466467  UChar         getInterDir           ( UInt uiIdx )            { return m_puhInterDir[uiIdx];        }
     
    471472  Void          setIPCMFlag           (UInt uiIdx, Bool b )     { m_pbIPCMFlag[uiIdx] = b;           }
    472473  Void          setIPCMFlagSubParts   (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth);
    473 #if H_3D_NBDV
     474#if NH_3D_NBDV
    474475  Void          setDvInfoSubParts     ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiDepth );
     476#if H_3D_VSP || NH_3D_DBBP
    475477  Void          setDvInfoSubParts     ( DisInfo cDvInfo, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth);
     478#endif
    476479  DisInfo*      getDvInfo             ()                        { return m_pDvInfo;                 }
    477480  DisInfo       getDvInfo             (UInt uiIdx)              { return m_pDvInfo[uiIdx];          }
    478481#endif
    479 #if H_3D_NBDV
     482#if NH_3D_NBDV
    480483  Void          xDeriveRightBottomNbIdx(Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb );
    481484  Bool          xCheckSpatialNBDV (TComDataCU* pcTmpCU, UInt uiIdx, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, IDVInfo* paMvpDvInfo,
    482485                                   UInt uiMvpDvPos
    483 #if H_3D_NBDV_REF
     486#if NH_3D_NBDV_REF
    484487  , Bool bDepthRefine = false
    485488#endif
     
    487490  Bool          xGetColDisMV      ( Int currCandPic, RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
    488491  Void          getDisMvpCandNBDV ( DisInfo* pDInfo
    489 #if H_3D_NBDV_REF
     492#if NH_3D_NBDV_REF
    490493   , Bool bDepthRefine = false
    491494#endif
    492495   );
    493496   
    494 #if H_3D
     497#if NH_3D_IV_MERGE
    495498  Void          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
    496   Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
    497 
    498    Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
    499 #endif
    500 #if H_3D_NBDV_REF
     499#endif
     500
     501#if NH_3D_NBDV_REF
    501502  Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT );
    502503  Void          estimateDVFromDM(Int refViewIdx, UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred );
    503 #endif //H_3D_NBDV_REF
    504 #endif
    505 #if  H_3D_FAST_TEXTURE_ENCODING
     504#endif //NH_3D_NBDV_REF
     505#endif
     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
    506510  Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
    507511#endif
    508 #if H_3D_SPIVMP
     512#if NH_3D_SPIVMP
    509513  Void          getSPPara(Int iPUWidth, Int iPUHeight, Int& iNumSP, Int& iNumSPInOneLine, Int& iSPWidth, Int& iSPHeight);
    510514  Void          getSPAbsPartIdx(UInt uiBaseAbsPartIdx, Int iWidth, Int iHeight, Int iPartIdx, Int iNumPartLine, UInt& ruiPartAddr );
    511515  Void          setInterDirSP( UInt uiDir, UInt uiAbsPartIdx, Int iWidth, Int iHeight );
    512516#endif
    513 #if H_3D_IV_MERGE
     517#if NH_3D_IV_MERGE
    514518  Bool          getInterViewMergeCands          ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc, Bool bIsDepth           
    515519
    516 #if H_3D_SPIVMP
     520#if NH_3D_SPIVMP
    517521    , TComMvField* pcMFieldSP, UChar* puhInterDirSP
    518522#endif   
     
    520524    );   
    521525#endif
    522 #if H_3D_ARP
     526#if NH_3D_ARP
    523527  UChar*        getARPW            ()                        { return m_puhARPW;               }
    524528  UChar         getARPW            ( UInt uiIdx )            { return m_puhARPW[uiIdx];        }
    525529  Void          setARPW            ( UInt uiIdx, UChar w )   { m_puhARPW[uiIdx] = w;           }
    526530  Void          setARPWSubParts    ( UChar w, UInt uiAbsPartIdx, UInt uiDepth );
    527   Double        getARPWFactor      ( UInt uiIdx );
    528 #endif
    529 #if H_3D_IC
     531#endif
     532#if NH_3D_IC
    530533  Bool*         getICFlag          ()                        { return m_pbICFlag;               }
    531534  Bool          getICFlag          ( UInt uiIdx )            { return m_pbICFlag[uiIdx];        }
     
    534537  Bool          isICFlagRequired   ( UInt uiAbsPartIdx );
    535538  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
     539#elif NH_3D_VSP
     540  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
    536541#else
    537542  // -------------------------------------------------------------------------------------------------------------------
    538543  // member functions for accessing partition information
    539544  // -------------------------------------------------------------------------------------------------------------------
    540  
    541   Void          getPartIndexAndSize   ( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight );
    542 #endif
    543 UChar         getNumPartitions       ();
     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
     547#endif
     548  UChar         getNumPartitions      ( const UInt uiAbsPartIdx = 0 );
    544549  Bool          isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth);
    545550
    546 #if H_3D_DIM
    547   Pel*  getDimDeltaDC                 ( UInt dimType, UInt segId )                      { return m_dimDeltaDC[dimType][segId];        }
    548   Pel   getDimDeltaDC                 ( UInt dimType, UInt segId, UInt uiIdx )          { return m_dimDeltaDC[dimType][segId][uiIdx]; }
    549   Void  setDimDeltaDC                 ( UInt dimType, UInt segId, UInt uiIdx, Pel val ) { m_dimDeltaDC[dimType][segId][uiIdx] = val;  }
    550 #if H_3D_DIM_DMM
    551   UInt* getDmmWedgeTabIdx             ( UInt dmmType )                          { return m_dmmWedgeTabIdx[dmmType];          }       
    552   UInt  getDmmWedgeTabIdx             ( UInt dmmType, UInt uiIdx )              { return m_dmmWedgeTabIdx[dmmType][uiIdx];   }
    553   Void  setDmmWedgeTabIdx             ( UInt dmmType, UInt uiIdx, UInt tabIdx ) { m_dmmWedgeTabIdx[dmmType][uiIdx] = tabIdx; }
    554   Void  setDmmWedgeTabIdxSubParts     ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth );
    555 
    556 #endif
    557 #if H_3D_DIM_SDC
     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;  }
     555
     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 );
     560#endif
     561#if NH_3D_SDC_INTRA
    558562  Bool*         getSDCFlag          ()                        { return m_pbSDCFlag;               }
    559563  Bool          getSDCFlag          ( UInt uiIdx )            { return m_pbSDCFlag[uiIdx];        }
     
    565569  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    566570  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
    567   Void          setDmmPredictor ( Pel pOffset, UInt uiSeg) { m_apDmmPredictor[uiSeg] = pOffset; }
    568   Pel           getDmmPredictor ( UInt uiSeg) { return m_apDmmPredictor[uiSeg]; }
    569   UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
    570 #endif
    571571#endif
    572572 
     
    574574  // member functions for motion vector
    575575  // -------------------------------------------------------------------------------------------------------------------
    576  
     576
    577577  Void          getMvField            ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField );
    578  
     578
    579579  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
    580580  Bool          isDiffMER             ( Int xN, Int yN, Int xP, Int yP);
    581581  Void          getPartPosition       ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH);
     582
    582583  Void          setMVPIdx             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
    583584  Int           getMVPIdx             ( RefPicList eRefPicList, UInt uiIdx)               { return m_apiMVPIdx[eRefPicList][uiIdx];     }
     
    587588  Int           getMVPNum             ( RefPicList eRefPicList, UInt uiIdx )              { return m_apiMVPNum[eRefPicList][uiIdx];     }
    588589  Char*         getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
    589  
     590
    590591  Void          setMVPIdxSubParts     ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    591592  Void          setMVPNumSubParts     ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
    592  
     593
    593594  Void          clipMv                ( TComMv&     rcMv     );
    594 #if H_MV
     595#if NH_MV
    595596  Void          checkMvVertRest (TComMv&  rcMv,  RefPicList eRefPicList, int iRefIdx );
    596597#endif
     
    598599  Void          getMvPredAbove        ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldB.getMv(); }
    599600  Void          getMvPredAboveRight   ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldC.getMv(); }
    600 #if H_3D
     601#if NH_3D
    601602  Void          compressMV            ( Int scale );
    602603#else           
     
    606607  // utility functions for neighbouring information
    607608  // -------------------------------------------------------------------------------------------------------------------
    608  
    609   TComDataCU*   getCULeft                   () { return m_pcCULeft;       }
    610   TComDataCU*   getCUAbove                  () { return m_pcCUAbove;      }
    611   TComDataCU*   getCUAboveLeft              () { return m_pcCUAboveLeft;  }
    612   TComDataCU*   getCUAboveRight             () { return m_pcCUAboveRight; }
     609
     610  TComDataCU*   getCtuLeft                  () { return m_pCtuLeft;       }
     611  TComDataCU*   getCtuAbove                 () { return m_pCtuAbove;      }
     612  TComDataCU*   getCtuAboveLeft             () { return m_pCtuAboveLeft;  }
     613  TComDataCU*   getCtuAboveRight            () { return m_pCtuAboveRight; }
    613614  TComDataCU*   getCUColocated              ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; }
    614 
    615 
    616   TComDataCU*   getPULeft                   ( UInt&  uiLPartUnitIdx,
    617                                               UInt uiCurrPartUnitIdx,
    618                                               Bool bEnforceSliceRestriction=true,
     615  Bool          CUIsFromSameSlice           ( const TComDataCU *pCU /* Can be NULL */) const { return ( pCU!=NULL && pCU->getSlice()->getSliceCurStartCtuTsAddr() == getSlice()->getSliceCurStartCtuTsAddr() ); }
     616  Bool          CUIsFromSameTile            ( const TComDataCU *pCU /* Can be NULL */) const;
     617  Bool          CUIsFromSameSliceAndTile    ( const TComDataCU *pCU /* Can be NULL */) const;
     618  Bool          CUIsFromSameSliceTileAndWavefrontRow( const TComDataCU *pCU /* Can be NULL */) const;
     619  Bool          isLastSubCUOfCtu(const UInt absPartIdx);
     620
     621
     622  TComDataCU*   getPULeft                   ( UInt&  uiLPartUnitIdx,
     623                                              UInt uiCurrPartUnitIdx,
     624                                              Bool bEnforceSliceRestriction=true,
    619625                                              Bool bEnforceTileRestriction=true );
    620626  TComDataCU*   getPUAbove                  ( UInt&  uiAPartUnitIdx,
    621                                               UInt uiCurrPartUnitIdx, 
    622                                               Bool bEnforceSliceRestriction=true, 
    623                                               Bool planarAtLCUBoundary = false,
     627                                              UInt uiCurrPartUnitIdx,
     628                                              Bool bEnforceSliceRestriction=true,
     629                                              Bool planarAtCTUBoundary = false,
    624630                                              Bool bEnforceTileRestriction=true );
    625631  TComDataCU*   getPUAboveLeft              ( UInt&  uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true );
    626   TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true );
    627   TComDataCU*   getPUBelowLeft              ( UInt&  uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true );
    628 
    629   TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU );
    630   TComDataCU*   getQpMinCuAbove             ( UInt&  aPartUnitIdx , UInt currAbsIdxInLCU );
    631   Char          getRefQP                    ( UInt   uiCurrAbsIdxInLCU                       );
    632 
    633   TComDataCU*   getPUAboveRightAdi          ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
    634   TComDataCU*   getPUBelowLeftAdi           ( UInt&  uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
    635  
     632
     633  TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu );
     634  TComDataCU*   getQpMinCuAbove             ( UInt&  uiAPartUnitIdx , UInt uiCurrAbsIdxInCtu );
     635  Char          getRefQP                    ( UInt   uiCurrAbsIdxInCtu                      );
     636
     637  /// 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)
     638  TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
     639  /// 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)
     640  TComDataCU*   getPUBelowLeft              ( UInt&  uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true );
     641
    636642  Void          deriveLeftRightTopIdx       ( UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
    637643  Void          deriveLeftBottomIdx         ( UInt uiPartIdx, UInt& ruiPartIdxLB );
    638  
    639   Void          deriveLeftRightTopIdxAdi    ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth );
    640   Void          deriveLeftBottomIdxAdi      ( UInt& ruiPartIdxLB, UInt  uiPartOffset, UInt uiPartDepth );
    641  
     644
    642645  Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
    643 
    644 #if H_3D
    645   Bool          getAvailableFlagA1() { return m_bAvailableFlagA1;}
    646   Bool          getAvailableFlagB1() { return m_bAvailableFlagB1;}
    647   Bool          getAvailableFlagB0() { return m_bAvailableFlagB0;}
    648   Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;}
    649   Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;}
     646#if NH_3D_FIX_PRUNING
     647  Bool          hasEqualMotion              ( Int dirA, const TComMvField* mvFieldA,  Int dirB, const TComMvField* mvFieldB  );
     648#endif
     649#if NH_3D_MLC
     650  Bool          getAvailableFlagA1() { return m_bAvailableFlagA1;   }
     651  Bool          getAvailableFlagB1() { return m_bAvailableFlagB1;   }
     652  Bool          getAvailableFlagB0() { return m_bAvailableFlagB0;   }
     653  Bool          getAvailableFlagA0() { return m_bAvailableFlagA0;   }
     654  Bool          getAvailableFlagB2() { return m_bAvailableFlagB2;   }
    650655  Void          initAvailableFlags() { m_bAvailableFlagA1 = m_bAvailableFlagB1 = m_bAvailableFlagB0 = m_bAvailableFlagA0 = m_bAvailableFlagB2 = 0;  }
    651656  Void          buildMCL(TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    652 #if H_3D_VSP
     657#if NH_3D_VSP
    653658    , Int* vspFlag
    654659#endif
    655 #if H_3D_SPIVMP
     660#if NH_3D_SPIVMP
    656661    , Bool* pbSPIVMPFlag
    657662#endif
    658663    , Int& numValidMergeCand
    659664    );
    660   Void          getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1);
    661   Void          xGetInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    662 #else
    663   Void          getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
    664 #endif
    665 #if H_3D_SPIVMP
    666                                             , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
    667 #endif
    668                                             , Int& numValidMergeCand, Int mrgCandIdx = -1
    669                                             );
    670 
    671 #if H_3D_VSP
    672 #if H_3D_SPIVMP
     665  Void          xGetInterMergeCandidates      ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
     666#if NH_3D_SPIVMP
     667  , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
     668#endif
     669  , Int& numValidMergeCand, Int mrgCandIdx = -1 );
     670#endif
     671  Void          getInterMergeCandidates       ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 );
     672
     673#if NH_3D_VSP
     674#if NH_3D_SPIVMP
    673675  Bool*         getSPIVMPFlag        ()                        { return m_pbSPIVMPFlag;          }
    674676  Bool          getSPIVMPFlag        ( UInt uiIdx )            { return m_pbSPIVMPFlag[uiIdx];   }
     
    685687  Void          deriveLeftRightTopIdxGeneral  ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
    686688  Void          deriveLeftBottomIdxGeneral    ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB );
    687  
    688  
     689
    689690  // -------------------------------------------------------------------------------------------------------------------
    690691  // member functions for modes
    691692  // -------------------------------------------------------------------------------------------------------------------
    692  
    693   Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
    694   Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
     693
     694  Bool          isIntra            ( UInt uiPartIdx )  const { return m_pePredMode[ uiPartIdx ] == MODE_INTRA;                                              }
     695  Bool          isInter            ( UInt uiPartIdx )  const { return m_pePredMode[ uiPartIdx ] == MODE_INTER;                                              }
     696  Bool          isSkipped          ( UInt uiPartIdx );                                                     ///< returns true, if the partiton is skipped
    695697  Bool          isBipredRestriction( UInt puIdx );
    696698
    697 #if H_3D_IC
    698   Bool          isIC      ( UInt uiPartIdx );
    699 #endif
    700 
    701699  // -------------------------------------------------------------------------------------------------------------------
    702700  // member functions for symbol prediction (most probable / mode conversion)
    703701  // -------------------------------------------------------------------------------------------------------------------
    704  
     702
    705703  UInt          getIntraSizeIdx                 ( UInt uiAbsPartIdx                                       );
    706  
     704
    707705  Void          getAllowedChromaDir             ( UInt uiAbsPartIdx, UInt* uiModeList );
    708   Int           getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );
    709  
     706  Void          getIntraDirPredictor            ( UInt uiAbsPartIdx, Int uiIntraDirPred[NUM_MOST_PROBABLE_MODES], const ComponentID compID, Int* piMode = NULL );
     707
    710708  // -------------------------------------------------------------------------------------------------------------------
    711709  // member functions for SBAC context
    712710  // -------------------------------------------------------------------------------------------------------------------
    713  
     711
    714712  UInt          getCtxSplitFlag                 ( UInt   uiAbsPartIdx, UInt uiDepth                   );
    715   UInt          getCtxQtCbf                     ( TextType eType, UInt uiTrDepth );
     713  UInt          getCtxQtCbf                     ( TComTU &rTu, const ChannelType chType );
    716714
    717715  UInt          getCtxSkipFlag                  ( UInt   uiAbsPartIdx                                 );
    718716  UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
    719  
    720 #if H_3D_ARP
     717#if NH_3D_ARP
    721718  UInt          getCTXARPWFlag                  ( UInt   uiAbsPartIdx                                 );
    722719#endif 
    723   UInt          getSliceStartCU         ( UInt pos )                  { return m_sliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
    724   UInt          getSliceSegmentStartCU  ( UInt pos )                  { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
    725   UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
     720
     721  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                              }
    726722  // -------------------------------------------------------------------------------------------------------------------
    727723  // member functions for RD cost storage
    728724  // -------------------------------------------------------------------------------------------------------------------
    729  
     725
    730726  Double&       getTotalCost()                  { return m_dTotalCost;        }
    731 #if H_3D_VSO
     727#if NH_3D_VSO
    732728  Dist&         getTotalDistortion()            { return m_uiTotalDistortion; }
    733729#else
    734   UInt&         getTotalDistortion()            { return m_uiTotalDistortion; }
     730  Distortion&   getTotalDistortion()            { return m_uiTotalDistortion; }
    735731#endif
    736732  UInt&         getTotalBits()                  { return m_uiTotalBits;       }
    737733  UInt&         getTotalNumPart()               { return m_uiNumPartition;    }
    738734
    739   UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
    740 
    741 
    742 #if H_3D_DIM
    743   Bool         isDMM1UpscaleMode       ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; };
    744   UInt         getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth =  uiWidth; } return uiBaseWidth; }
    745 #endif
    746 
     735  UInt          getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ;
    747736};
    748737
     
    760749    return (( addrA ^ addrB ) &  ( numUnitsPerRow - 1 ) ) == 0;
    761750  }
    762  
     751
    763752  /** Check whether 2 addresses point to the same row
    764753   * \param addrA          First address in raster scan order
     
    772761    return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0;
    773762  }
    774  
     763
    775764  /** Check whether 2 addresses point to the same row or column
    776765   * \param addrA          First address in raster scan order
     
    783772    return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow );
    784773  }
    785  
     774
    786775  /** Check whether one address points to the first column
    787776   * \param addr           Address in raster scan order
     
    794783    return ( addr & ( numUnitsPerRow - 1 ) ) == 0;
    795784  }
    796  
     785
    797786  /** Check whether one address points to the first row
    798787   * \param addr           Address in raster scan order
     
    805794    return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0;
    806795  }
    807  
     796
    808797  /** Check whether one address points to a column whose index is smaller than a given value
    809798   * \param addr           Address in raster scan order
     
    817806    return ( addr & ( numUnitsPerRow - 1 ) ) < val;
    818807  }
    819  
     808
    820809  /** Check whether one address points to a row whose index is smaller than a given value
    821810   * \param addr           Address in raster scan order
     
    829818    return addr < val * numUnitsPerRow;
    830819  }
    831 };
     820}
    832821
    833822//! \}
Note: See TracChangeset for help on using the changeset viewer.