source: 3DVCSoftware/branches/HTM-11.0-dev0/source/Lib/TLibCommon/TComDataCU.h @ 962

Last change on this file since 962 was 962, checked in by tech, 10 years ago

Update to HM-14.0

Integration of:

#define H_MV_HLS_8_SYN_Q0041_03 1 #3 Syntax only (HS /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows …: #define H_MV_HLS_7_OTHER_P0187_1 0 (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution
#define H_MV_HLS_8_SYN_39_19 1
#39 Syntax only + (PS/Q0165,Q0078/presence of num_add_output_layer_sets) proposal 2. change condition for presence of num_add_output_layer_sets to avoid sending it when there is only one layer set.
#define H_MV_HLS_8_HRD_Q0101_04 1 #4 (HRD /Q0101/Bitstream part buffer) On Bitstream Partition Buffer. Decision (BF/Cleanup): Adopt (sub-proposals 1–11, refined as described).
#define H_MV_HLS_8_PPS_NODOC_NN 1
#NN (PPS /NODOC/reserved flag): Add a flag in PPS for SHVC color gamut scalability
#define H_MV_HLS_8_MIS_Q0177_47 1 #47 (MISC /Q0177/EOS NAL) proposal 2: clarification of description of end of sequence NAL unit
#define H_MV_HLS_8_HRD_Q0182_05 1
#5 (HRD /Q0182/Bitstream part buffer) Decision (BF/Cleanup/Ed): Adopted (such that we use the main proposal for sub-proposal 1, and alternative 1 for sub-proposal 2). + #define H_MV_HLS_8_HRD_Q0182_06 0 #6 (HRD /Q0182/hrd_parameters) Sub-proposal 2 Alternative 1: Clarify that the VPS hrd_parameters( ) syntax structure that applies to the layer set which is associated with the bitstream partition initial arrival time SEI message is used to determine the lengths of the nal_initial_arrival_delay[ i ] and vcl_initial_arrival_delay[ i ] syntax elements. Decision (BF/Cleanup/Ed): Adopted alternative 1 for sub-proposal 2
#define H_MV_HLS_8_SPS_NODOC_48 1
#48 (SPS /NODOC/PPS extension cleanups) Alignment with RExt
#define H_MV_HLS_8_DBP_NODOC_42 1 #42 (DBP /NODOC/sharing) Remove sub-DPB sharing and processes that mark inter-layer reference pictures as "unused for reference"
#define H_MV_HLS_8_RPS_Q0100_36 1
#36 (RPS /Q0100/constraint to semantics) v3, add constraint to RPS semantics
#define H_MV_HLS_8_POC_Q0142_32 1 #32 (POC /Q0142/poc_lsb_not_present_flag) v2: Add semantic constraints to poc_lsb_not_present_flag.
#define H_MV_HLS_8_HRD_Q0102_08 1
#8 (HRD /Q0102/sps_max_dec_pic_buffering_minus1) Sub-proposal 2: A semantics bug fix is proposed for sps_max_dec_pic_buffering_minus1 as a bug-fix. In discussion, the first option was preferred. Decision (BF/Cleanup/Ed.): Adopt.
#define H_MV_HLS_8_MIS_Q0102_30 1 #30 (MISC /Q0102/loop index) proposal 3, change the max loop index for signaling bit rate and pic rate info to MaxSubLayersInLayerSetMinus1
#define H_MV_HLS_8_GEN_Q0108_13 1
#13 (GEN /Q0108/STSA TemporalId) Agreed to remove restriction from proposal 2, to allow STSA pics of non-base layers to have TemporalId equal to 0.
#define H_MV_HLS_8_PMS_Q0195_21 1 #21 (PS /Q0195/constraint update_ref_format_flag) proposal 2: add a semantic constraint on the value of update_ref_format_flag
#define H_MV_HLS_8_PMS_Q0195_20 1
#20 (PS /Q0195/syntax table rep format) proposal 1: restructure syntax table for sending of rep_format_idx_present_flag and vps_num_ref_formats_minus1
#define H_MV_HLS_8_MIS_Q0177_22 1 #22 (MISC /Q0177/inference sps_temporal_id_nesting_flag) proposal 1: modify inference rule for sps_temporal_id_nesting_flag when it is not present
#define H_MV_HLS_8_PMS_Q0165_18 1
#18 (PS /Q0165/disallow an empty layer set) proposal 1.a), add a constraint to disallow an empty layer set
#define H_MV_HLS_8_RPS_Q0060_17 1 #17 (RPS /Q0060/condition refLayerPicIdc) Proposal 2: Add a condition to the derivation of refLayerPicIdc of (TemporalId == 0)
#define H_MV_HLS_8_POC_Q0146_15 1
#15 (POC /Q0146/inference of poc_msb_val_present_flag) Proposal 1.1: Change inference rule in semantics of poc_msb_val_present_flag

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