source: 3DVCSoftware/branches/HTM-6.2-dev1-LG/source/Lib/TLibCommon/TComDataCU.h @ 930

Last change on this file since 930 was 408, checked in by lg, 12 years ago

D0135->D0092->D0091

  • Property svn:eol-style set to native
File size: 54.6 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-2012, 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 H3D_IVRP
52#include "TComYuv.h"
53#endif
54
55#include <algorithm>
56#include <vector>
57
58//! \ingroup TLibCommon
59//! \{
60
61// ====================================================================================================================
62// Non-deblocking in-loop filter processing block data structure
63// ====================================================================================================================
64
65/// Non-deblocking filter processing block border tag
66enum NDBFBlockBorderTag
67{
68  SGU_L = 0,
69  SGU_R,
70  SGU_T,
71  SGU_B,
72  SGU_TL,
73  SGU_TR,
74  SGU_BL,
75  SGU_BR,
76  NUM_SGU_BORDER
77};
78
79/// Non-deblocking filter processing block information
80struct NDBFBlockInfo
81{
82  Int   tileID;   //!< tile ID
83  Int   sliceID;  //!< slice ID
84  UInt  startSU;  //!< starting SU z-scan address in LCU
85  UInt  endSU;    //!< ending SU z-scan address in LCU
86  UInt  widthSU;  //!< number of SUs in width
87  UInt  heightSU; //!< number of SUs in height
88  UInt  posX;     //!< top-left X coordinate in picture
89  UInt  posY;     //!< top-left Y coordinate in picture
90  UInt  width;    //!< number of pixels in width
91  UInt  height;   //!< number of pixels in height
92  Bool  isBorderAvailable[NUM_SGU_BORDER];  //!< the border availabilities
93  Bool  allBordersAvailable;
94
95  NDBFBlockInfo():tileID(0), sliceID(0), startSU(0), endSU(0) {} //!< constructor
96  const NDBFBlockInfo& operator= (const NDBFBlockInfo& src);  //!< "=" operator
97};
98
99
100// ====================================================================================================================
101// Class definition
102// ====================================================================================================================
103
104/// CU data structure class
105class TComDataCU
106{
107private:
108 
109  // -------------------------------------------------------------------------------------------------------------------
110  // class pointers
111  // -------------------------------------------------------------------------------------------------------------------
112 
113  TComPic*      m_pcPic;              ///< picture class pointer
114  TComSlice*    m_pcSlice;            ///< slice header pointer
115  TComPattern*  m_pcPattern;          ///< neighbour access class pointer
116 
117  // -------------------------------------------------------------------------------------------------------------------
118  // CU description
119  // -------------------------------------------------------------------------------------------------------------------
120 
121  UInt          m_uiCUAddr;           ///< CU address in a slice
122  UInt          m_uiAbsIdxInLCU;      ///< absolute address in a CU. It's Z scan order
123  UInt          m_uiCUPelX;           ///< CU position in a pixel (X)
124  UInt          m_uiCUPelY;           ///< CU position in a pixel (Y)
125  UInt          m_uiNumPartition;     ///< total number of minimum partitions in a CU
126  UChar*        m_puhWidth;           ///< array of widths
127  UChar*        m_puhHeight;          ///< array of heights
128  UChar*        m_puhDepth;           ///< array of depths
129  Int           m_unitSize;           ///< size of a "minimum partition"
130#if HHI_MPI
131  Int*          m_piTextureModeDepth; ///< at which depth are prediction data inherited from texture picture ( -1 : none )
132#endif
133 
134  // -------------------------------------------------------------------------------------------------------------------
135  // CU data
136  // -------------------------------------------------------------------------------------------------------------------
137 
138  Char*         m_pePartSize;         ///< array of partition sizes
139#if HHI_INTERVIEW_SKIP
140  Bool*         m_pbRenderable;        ///< array of merge flags
141#endif
142  Char*         m_pePredMode;         ///< array of prediction modes
143  Char*         m_phQP;               ///< array of QP values
144  UChar*        m_puhTrIdx;           ///< array of transform indices
145  UChar*        m_nsqtPartIdx;        ///< array of absPartIdx mapping table, map zigzag to NSQT
146  UChar*        m_puhCbf[3];          ///< array of coded block flags (CBF)
147  TComCUMvField m_acCUMvField[2];     ///< array of motion vectors
148  TCoeff*       m_pcTrCoeffY;         ///< transformed coefficient buffer (Y)
149  TCoeff*       m_pcTrCoeffCb;        ///< transformed coefficient buffer (Cb)
150  TCoeff*       m_pcTrCoeffCr;        ///< transformed coefficient buffer (Cr)
151#if ADAPTIVE_QP_SELECTION
152  Int*          m_pcArlCoeffY;        ///< ARL coefficient buffer (Y)
153  Int*          m_pcArlCoeffCb;       ///< ARL coefficient buffer (Cb)
154  Int*          m_pcArlCoeffCr;       ///< ARL coefficient buffer (Cr)
155  Bool          m_ArlCoeffIsAliasedAllocation; ///< ARL coefficient buffer is an alias of the global buffer and must not be free()'d
156
157  static Int*   m_pcGlbArlCoeffY;     ///< ARL coefficient buffer (Y)
158  static Int*   m_pcGlbArlCoeffCb;    ///< ARL coefficient buffer (Cb)
159  static Int*   m_pcGlbArlCoeffCr;    ///< ARL coefficient buffer (Cr)
160
161#endif
162 
163  Pel*          m_pcIPCMSampleY;      ///< PCM sample buffer (Y)
164  Pel*          m_pcIPCMSampleCb;     ///< PCM sample buffer (Cb)
165  Pel*          m_pcIPCMSampleCr;     ///< PCM sample buffer (Cr)
166
167  Int*          m_piSliceSUMap;       ///< pointer of slice ID map
168  std::vector<NDBFBlockInfo> m_vNDFBlock;
169
170  // -------------------------------------------------------------------------------------------------------------------
171  // neighbour access variables
172  // -------------------------------------------------------------------------------------------------------------------
173 
174  TComDataCU*   m_pcCUAboveLeft;      ///< pointer of above-left CU
175  TComDataCU*   m_pcCUAboveRight;     ///< pointer of above-right CU
176  TComDataCU*   m_pcCUAbove;          ///< pointer of above CU
177  TComDataCU*   m_pcCULeft;           ///< pointer of left CU
178  TComDataCU*   m_apcCUColocated[2];  ///< pointer of temporally colocated CU's for both directions
179  TComMvField   m_cMvFieldA;          ///< motion vector of position A
180  TComMvField   m_cMvFieldB;          ///< motion vector of position B
181  TComMvField   m_cMvFieldC;          ///< motion vector of position C
182  TComMv        m_cMvPred;            ///< motion vector predictor
183 
184  // -------------------------------------------------------------------------------------------------------------------
185  // coding tool information
186  // -------------------------------------------------------------------------------------------------------------------
187 
188  Bool*         m_pbMergeFlag;        ///< array of merge flags
189#if LGE_ILLUCOMP_B0045
190  Bool*         m_pbICFlag;           ///< array of IC flags
191#endif
192  UChar*        m_puhMergeIndex;      ///< array of merge candidate indices
193#if MERL_VSP_C0152
194  Char*         m_piVSPIndex;         ///< array of VSP flags to indicate the current block uses synthetic predictor or not
195                                      ///< value 0: non-VSP, value 1: VSP
196#endif
197#if AMP_MRG
198  Bool          m_bIsMergeAMP;
199#endif
200  UChar*        m_puhLumaIntraDir;    ///< array of intra directions (luma)
201  UChar*        m_puhChromaIntraDir;  ///< array of intra directions (chroma)
202  UChar*        m_puhInterDir;        ///< array of inter directions
203  Char*         m_apiMVPIdx[2];       ///< array of motion vector predictor candidates
204  Char*         m_apiMVPNum[2];       ///< array of number of possible motion vectors predictors
205  Bool*         m_puiAlfCtrlFlag;     ///< array of ALF flags
206  Bool*         m_puiTmpAlfCtrlFlag;  ///< temporal array of ALF flags
207 
208  Bool*         m_pbIPCMFlag;         ///< array of intra_pcm flags
209
210  Int           m_numSucIPCM;         ///< the number of succesive IPCM blocks associated with the current log2CUSize
211  Bool          m_lastCUSucIPCMFlag;  ///< True indicates that the last CU is IPCM and shares the same root as the current CU. 
212#if H3D_IVRP
213  Bool*         m_pbResPredAvailable; ///< array of residual prediction available flags
214  Bool*         m_pbResPredFlag;      ///< array of residual prediction flags
215#endif
216
217#if LGE_EDGE_INTRA_A0070
218  UChar*        m_pucEdgeCode;          ///< array of edge code
219  UChar*        m_pucEdgeNumber;        ///< total number of edge
220  UChar*        m_pucEdgeStartPos;      ///< starting point position
221  Bool*         m_pbEdgeLeftFirst;      ///< true if edge should be checked in left boundary first
222  Bool*         m_pbEdgePartition;      ///< true if it belongs to region 1, otherwise, region 0
223#if LGE_EDGE_INTRA_DELTA_DC
224  Int*          m_piEdgeDeltaDC0;
225  Int*          m_piEdgeDeltaDC1;
226#endif
227#endif
228
229  // -------------------------------------------------------------------------------------------------------------------
230  // misc. variables
231  // -------------------------------------------------------------------------------------------------------------------
232 
233  Bool          m_bDecSubCu;          ///< indicates decoder-mode
234  Double        m_dTotalCost;         ///< sum of partition RD costs
235  Dist          m_uiTotalDistortion;  ///< sum of partition distortion
236  UInt          m_uiTotalBits;        ///< sum of partition bits
237  UInt          m_uiTotalBins;       ///< sum of partition bins
238  UInt*         m_uiSliceStartCU;    ///< Start CU address of current slice
239  UInt*         m_uiEntropySliceStartCU; ///< Start CU address of current slice
240 
241  // -------------------------------------------------------------------------------------------------------------------
242  // depth model mode data
243  // -------------------------------------------------------------------------------------------------------------------
244#if HHI_DMM_WEDGE_INTRA
245  UInt*         m_puiWedgeFullTabIdx;
246  Int*          m_piWedgeFullDeltaDC1;
247  Int*          m_piWedgeFullDeltaDC2;
248
249  UInt*         m_puiWedgePredDirTabIdx;
250  Int*          m_piWedgePredDirDeltaDC1;
251  Int*          m_piWedgePredDirDeltaDC2;
252  Int*          m_piWedgePredDirDeltaEnd;
253#endif
254#if HHI_DMM_PRED_TEX
255  UInt*         m_puiWedgePredTexTabIdx;
256#if LGE_DMM3_SIMP_C0044
257  UInt*         m_puiWedgePredTexIntraTabIdx;
258#endif
259  Int*          m_piWedgePredTexDeltaDC1;
260  Int*          m_piWedgePredTexDeltaDC2;
261
262  Int*          m_piContourPredTexDeltaDC1;
263  Int*          m_piContourPredTexDeltaDC2;
264#endif
265 
266#if RWTH_SDC_DLT_B0036
267  Bool*         m_pbSDCFlag;
268  Pel*          m_apSegmentDCOffset[2];
269#endif
270
271protected:
272 
273  /// add possible motion vector predictor candidates
274  Bool          xAddMVPCand           ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
275  Bool          xAddMVPCandOrder      ( AMVPInfo* pInfo, RefPicList eRefPicList, Int iRefIdx, UInt uiPartUnitIdx, MVP_DIR eDir );
276#if MERL_VSP_C0152
277#if LGE_VSP_INHERIT_D0092
278  inline Bool   xAddVspMergeCand      ( UChar ucVspMergePos, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
279                                        UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo );
280#else
281  inline Bool   xAddVspMergeCand      ( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
282                                        UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo );
283#endif
284  inline Void   xInheritVspMode       ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo
285#if QC_BVSP_CleanUP_D0191
286   ,UChar *puhInterDirNeighbours
287#endif
288 ) ;
289#endif
290  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
291  Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx
292#if QC_TMVP_MRG_REFIDX_C0047
293  ,
294  Bool bMRG = 0
295#endif
296  );
297#if H3D_NBDV
298  Void          xDeriveRightBottomNbIdx( PartSize eCUMode, UInt uiPartIdx, Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb );
299  Bool          xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, UInt uiPartIdx, UInt uiPartAddr, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, McpDisInfo* paMvpDvInfo, UInt uiMvpDvPos, Bool bDepthRefine );
300  Bool          xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
301#endif
302 
303
304  Void xCheckCornerCand( TComDataCU* pcCorner, UInt uiCornerIdx, UInt uiIter, Bool& rbValidCand );
305  /// compute required bits to encode MVD (used in AMVP)
306  UInt          xGetMvdBits           ( TComMv cMvd );
307  UInt          xGetComponentBits     ( Int iVal );
308 
309  /// compute scaling factor from POC difference
310  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
311 
312  Void xDeriveCenterIdx( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxCenter );
313  Bool xGetCenterCol( UInt uiPartIdx, RefPicList eRefPicList, int iRefIdx, TComMv *pcMv );
314 
315  Void xCheckDuplicateCand(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, bool* pbCandIsInter, UInt& ruiArrayAddr);
316
317
318public:
319  TComDataCU();
320  virtual ~TComDataCU();
321 
322  // -------------------------------------------------------------------------------------------------------------------
323  // create / destroy / initialize / copy
324  // -------------------------------------------------------------------------------------------------------------------
325 
326  Void          create                ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize
327#if ADAPTIVE_QP_SELECTION
328    , Bool bGlobalRMARLBuffer = false
329#endif 
330    );
331  Void          destroy               ();
332 
333  Void          initCU                ( TComPic* pcPic, UInt uiCUAddr );
334  Void          initEstData           ( UInt uiDepth, Int qp );
335  Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp );
336  Void          setOutsideCUPart      ( UInt uiAbsPartIdx, UInt uiDepth );
337
338  Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
339  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList );
340  Void          copyPartFrom          ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
341 
342  Void          copyToPic             ( UChar uiDepth );
343  Void          copyToPic             ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth );
344 
345  // -------------------------------------------------------------------------------------------------------------------
346  // member functions for CU description
347  // -------------------------------------------------------------------------------------------------------------------
348 
349  TComPic*      getPic                ()                        { return m_pcPic;           }
350  TComSlice*    getSlice              ()                        { return m_pcSlice;         }
351  UInt&         getAddr               ()                        { return m_uiCUAddr;        }
352  UInt&         getZorderIdxInCU      ()                        { return m_uiAbsIdxInLCU; }
353  UInt          getSCUAddr            ();
354  UInt          getCUPelX             ()                        { return m_uiCUPelX;        }
355  UInt          getCUPelY             ()                        { return m_uiCUPelY;        }
356  TComPattern*  getPattern            ()                        { return m_pcPattern;       }
357 
358  UChar*        getDepth              ()                        { return m_puhDepth;        }
359  UChar         getDepth              ( UInt uiIdx )            { return m_puhDepth[uiIdx]; }
360  Void          setDepth              ( UInt uiIdx, UChar  uh ) { m_puhDepth[uiIdx] = uh;   }
361 
362  Void          setDepthSubParts      ( UInt uiDepth, UInt uiAbsPartIdx );
363  Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY );
364#if HHI_MPI
365  Int*          getTextureModeDepth   ()                        { return m_piTextureModeDepth; }
366  Int           getTextureModeDepth   ( UInt uiIdx )            { return m_piTextureModeDepth[uiIdx]; }
367  Void          setTextureModeDepth   ( UInt uiIdx, Int iTextureModeDepth ){ m_piTextureModeDepth[uiIdx] = iTextureModeDepth; }
368  Void          setTextureModeDepthSubParts( Int iTextureModeDepth, UInt uiAbsPartIdx, UInt uiDepth );
369  Void          copyTextureMotionDataFrom( TComDataCU* pcCU, UInt uiDepth, UInt uiAbsPartIdxSrc, UInt uiAbsPartIdxDst = 0 );
370#endif
371
372   // -------------------------------------------------------------------------------------------------------------------
373  // member functions for CU data
374  // -------------------------------------------------------------------------------------------------------------------
375 
376  Char*         getPartitionSize      ()                        { return m_pePartSize;        }
377  PartSize      getPartitionSize      ( UInt uiIdx )            { return static_cast<PartSize>( m_pePartSize[uiIdx] ); }
378  Void          setPartitionSize      ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh;   }
379  Void          setPartSizeSubParts   ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth );
380 
381#if HHI_INTERVIEW_SKIP
382  Bool*         getRenderable          ()                        { return m_pbRenderable;               }
383    Bool          getRenderable          ( UInt uiIdx )            { return m_pbRenderable[uiIdx];        }
384    Void          setRenderable          ( UInt uiIdx, Bool b )    { m_pbRenderable[uiIdx] = b;           }
385    Void          setRenderableSubParts  ( Bool bRenderable, UInt uiAbsPartIdx, UInt uiDepth );
386#endif
387 
388  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
389  PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
390  Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
391  Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
392 
393  UChar*        getWidth              ()                        { return m_puhWidth;          }
394  UChar         getWidth              ( UInt uiIdx )            { return m_puhWidth[uiIdx];   }
395  Void          setWidth              ( UInt uiIdx, UChar  uh ) { m_puhWidth[uiIdx] = uh;     }
396 
397  UChar*        getHeight             ()                        { return m_puhHeight;         }
398  UChar         getHeight             ( UInt uiIdx )            { return m_puhHeight[uiIdx];  }
399  Void          setHeight             ( UInt uiIdx, UChar  uh ) { m_puhHeight[uiIdx] = uh;    }
400 
401  Void          setSizeSubParts       ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth );
402 
403  Char*         getQP                 ()                        { return m_phQP;              }
404  Char          getQP                 ( UInt uiIdx )            { return m_phQP[uiIdx];       }
405  Void          setQP                 ( UInt uiIdx, Char value ){ m_phQP[uiIdx] =  value;     }
406  Void          setQPSubParts         ( Int qp,   UInt uiAbsPartIdx, UInt uiDepth );
407  Int           getLastValidPartIdx   ( Int iAbsPartIdx );
408  Char          getLastCodedQP        ( UInt uiAbsPartIdx );
409
410#if LOSSLESS_CODING
411  Bool          isLosslessCoded(UInt absPartIdx);
412#endif
413  UChar*        getNSQTPartIdx        ()                        { return m_nsqtPartIdx;        }
414  UChar         getNSQTPartIdx        ( UInt idx )              { return m_nsqtPartIdx[idx];   }
415  Void          setNSQTIdxSubParts    ( UInt absPartIdx, UInt depth );
416  Void          setNSQTIdxSubParts    ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt trMode );
417 
418  UChar*        getTransformIdx       ()                        { return m_puhTrIdx;          }
419  UChar         getTransformIdx       ( UInt uiIdx )            { return m_puhTrIdx[uiIdx];   }
420  Void          setTrIdxSubParts      ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth );
421 
422  UInt          getQuadtreeTULog2MinSizeInCU( UInt absPartIdx );
423 
424  TComCUMvField* getCUMvField         ( RefPicList e )          { return  &m_acCUMvField[e];  }
425 
426  TCoeff*&      getCoeffY             ()                        { return m_pcTrCoeffY;        }
427  TCoeff*&      getCoeffCb            ()                        { return m_pcTrCoeffCb;       }
428  TCoeff*&      getCoeffCr            ()                        { return m_pcTrCoeffCr;       }
429#if ADAPTIVE_QP_SELECTION
430  Int*&         getArlCoeffY          ()                        { return m_pcArlCoeffY;       }
431  Int*&         getArlCoeffCb         ()                        { return m_pcArlCoeffCb;      }
432  Int*&         getArlCoeffCr         ()                        { return m_pcArlCoeffCr;      }
433#endif
434 
435  Pel*&         getPCMSampleY         ()                        { return m_pcIPCMSampleY;     }
436  Pel*&         getPCMSampleCb        ()                        { return m_pcIPCMSampleCb;    }
437  Pel*&         getPCMSampleCr        ()                        { return m_pcIPCMSampleCr;    }
438
439  UChar         getCbf    ( UInt uiIdx, TextType eType )                  { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx];  }
440  UChar*        getCbf    ( TextType eType )                              { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]];         }
441  UChar         getCbf    ( UInt uiIdx, TextType eType, UInt uiTrDepth )  { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); }
442  Void          setCbf    ( UInt uiIdx, TextType eType, UChar uh )        { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh;    }
443  Void          clearCbf  ( UInt uiIdx, TextType eType, UInt uiNumParts );
444  UChar         getQtRootCbf          ( UInt uiIdx )                      { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); }
445 
446  Void          setCbfSubParts        ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth          );
447  Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth                    );
448  Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth    );
449 
450  // -------------------------------------------------------------------------------------------------------------------
451  // member functions for coding tool information
452  // -------------------------------------------------------------------------------------------------------------------
453 
454  Bool*         getMergeFlag          ()                        { return m_pbMergeFlag;               }
455  Bool          getMergeFlag          ( UInt uiIdx )            { return m_pbMergeFlag[uiIdx];        }
456  Void          setMergeFlag          ( UInt uiIdx, Bool b )    { m_pbMergeFlag[uiIdx] = b;           }
457  Void          setMergeFlagSubParts  ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
458
459  UChar*        getMergeIndex         ()                        { return m_puhMergeIndex;                         }
460  UChar         getMergeIndex         ( UInt uiIdx )            { return m_puhMergeIndex[uiIdx];                  }
461  Void          setMergeIndex         ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex;  }
462  Void          setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
463
464#if MERL_VSP_C0152
465  Char*         getVSPIndex        ()                        { return m_piVSPIndex;        }
466  Char          getVSPIndex        ( UInt uiIdx )            { return m_piVSPIndex[uiIdx]; }
467  Void          setVSPIndex        ( UInt uiIdx, Int n )     { m_piVSPIndex[uiIdx] = n;    }
468  Void          setVSPIndexSubParts( Char bVSPIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
469#endif
470
471  template <typename T>
472  Void          setSubPart            ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
473
474#if LGE_ILLUCOMP_B0045
475  Bool*         getICFlag             ()                        { return m_pbICFlag;               }
476  Bool          getICFlag             ( UInt uiIdx )            { return m_pbICFlag[uiIdx];        }
477  Void          setICFlag             ( UInt uiIdx, Bool  uh )  { m_pbICFlag[uiIdx] = uh;          }
478  Void          setICFlagSubParts     ( Bool bICFlag,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
479#if LGE_ILLUCOMP_DEPTH_C0046
480  Bool          isICFlagRequired      (UInt uiAbsPartIdx, UInt uiDepth); //This modification is not needed after integrating JCT3V-C0137
481#else
482  Bool          isICFlagRequired      (UInt uiAbsPartIdx);
483#endif
484#endif
485
486#if AMP_MRG
487  Void          setMergeAMP( Bool b )      { m_bIsMergeAMP = b; }
488  Bool          getMergeAMP( )             { return m_bIsMergeAMP; }
489#endif
490
491  UChar*        getLumaIntraDir       ()                        { return m_puhLumaIntraDir;           }
492  UChar         getLumaIntraDir       ( UInt uiIdx )            { return m_puhLumaIntraDir[uiIdx];    }
493  Void          setLumaIntraDir       ( UInt uiIdx, UChar  uh ) { m_puhLumaIntraDir[uiIdx] = uh;      }
494  Void          setLumaIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
495 
496  UChar*        getChromaIntraDir     ()                        { return m_puhChromaIntraDir;         }
497  UChar         getChromaIntraDir     ( UInt uiIdx )            { return m_puhChromaIntraDir[uiIdx];  }
498  Void          setChromaIntraDir     ( UInt uiIdx, UChar  uh ) { m_puhChromaIntraDir[uiIdx] = uh;    }
499  Void          setChromIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
500 
501  UChar*        getInterDir           ()                        { return m_puhInterDir;               }
502  UChar         getInterDir           ( UInt uiIdx )            { return m_puhInterDir[uiIdx];        }
503  Void          setInterDir           ( UInt uiIdx, UChar  uh ) { m_puhInterDir[uiIdx] = uh;          }
504  Void          setInterDirSubParts   ( UInt uiDir,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
505 
506  Bool*         getAlfCtrlFlag        ()                        { return m_puiAlfCtrlFlag;            }
507  Bool          getAlfCtrlFlag        ( UInt uiIdx )            { return m_puiAlfCtrlFlag[uiIdx];     }
508  Void          setAlfCtrlFlag        ( UInt uiIdx, Bool uiFlag){ m_puiAlfCtrlFlag[uiIdx] = uiFlag;   }
509  Void          setAlfCtrlFlagSubParts( Bool uiFlag, UInt uiAbsPartIdx, UInt uiDepth );
510 
511  Void          createTmpAlfCtrlFlag  ();
512  Void          destroyTmpAlfCtrlFlag ();
513  Void          copyAlfCtrlFlagToTmp  ();
514  Void          copyAlfCtrlFlagFromTmp();
515 
516  Bool*         getIPCMFlag           ()                        { return m_pbIPCMFlag;               }
517  Bool          getIPCMFlag           (UInt uiIdx )             { return m_pbIPCMFlag[uiIdx];        }
518  Void          setIPCMFlag           (UInt uiIdx, Bool b )     { m_pbIPCMFlag[uiIdx] = b;           }
519  Void          setIPCMFlagSubParts   (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth);
520
521  Int           getNumSucIPCM         ()                        { return m_numSucIPCM;             }
522  Void          setNumSucIPCM         ( Int num )               { m_numSucIPCM = num;              }
523  Bool          getLastCUSucIPCMFlag  ()                        { return m_lastCUSucIPCMFlag;        }
524  Void          setLastCUSucIPCMFlag  ( Bool flg )              { m_lastCUSucIPCMFlag = flg;         }
525
526  /// get slice ID for SU
527  Int           getSUSliceID          (UInt uiIdx)              {return m_piSliceSUMap[uiIdx];      } 
528
529  /// get the pointer of slice ID map
530  Int*          getSliceSUMap         ()                        {return m_piSliceSUMap;             }
531
532  /// set the pointer of slice ID map
533  Void          setSliceSUMap         (Int *pi)                 {m_piSliceSUMap = pi;               }
534
535  std::vector<NDBFBlockInfo>* getNDBFilterBlocks()      {return &m_vNDFBlock;}
536  Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight
537                                          ,Bool bIndependentSliceBoundaryEnabled
538                                          ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary
539                                          ,Bool bIndependentTileBoundaryEnabled );
540
541#if H3D_IVMP
542#if !H3D_NBDV
543  Int           getPdmMergeCandidate      ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
544  Bool          getPdmMvPred              ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
545#else //!H3D_NBDV
546  Bool          getUnifiedMvPredCan       ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
547  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
548  Void          getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerg = false
549#if MERL_VSP_C0152
550                              , Bool bDepthRefine = false
551#endif //MERL_VSP_C0152
552    );
553#endif // !H3D_NBDV
554
555
556
557#if MERL_VSP_C0152
558  Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine = false);
559  Void          estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false);
560#endif
561  Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
562#endif //  H3D_IVMP
563#if H3D_IVRP
564  Bool*         getResPredAvail         ()                        { return m_pbResPredAvailable;        }
565  Bool          getResPredAvail         ( UInt uiIdx )            { return m_pbResPredAvailable[uiIdx]; }
566  Void          setResPredAvail         ( UInt uiIdx, Bool b )    { m_pbResPredAvailable[uiIdx] = b;    }
567  Void          setResPredAvailSubParts ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
568
569  Bool*         getResPredFlag          ()                        { return m_pbResPredFlag;        }
570  Bool          getResPredFlag          ( UInt uiIdx )            { return m_pbResPredFlag[uiIdx]; }
571  Void          setResPredFlag          ( UInt uiIdx, Bool b )    { m_pbResPredFlag[uiIdx] = b;    }
572  Void          setResPredFlagSubParts  ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
573
574  Void          setResPredIndicator     ( Bool bAv, Bool bRP )    { m_pbResPredAvailable[0] = bAv; m_pbResPredFlag[0] = bRP; }
575#endif
576#if H3D_IVRP
577  Bool          getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv = 0 );
578#endif
579  // -------------------------------------------------------------------------------------------------------------------
580  // member functions for accessing partition information
581  // -------------------------------------------------------------------------------------------------------------------
582#if H3D_IVRP
583  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
584#endif
585  UChar         getNumPartInter       ();
586  Bool          isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth);
587 
588  // -------------------------------------------------------------------------------------------------------------------
589  // member functions for motion vector
590  // -------------------------------------------------------------------------------------------------------------------
591 
592  Void          getMvField            ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField );
593 
594  AMVP_MODE     getAMVPMode           ( UInt uiIdx );
595#if H3D_IVMP
596  Void          fillMvpCandBase       ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
597  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1);
598#endif
599  Bool          isDiffMER             ( Int xN, Int yN, Int xP, Int yP);
600  Void          getPartPosition       ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH);
601  Void          setMVPIdx             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
602  Int           getMVPIdx             ( RefPicList eRefPicList, UInt uiIdx)               { return m_apiMVPIdx[eRefPicList][uiIdx];     }
603  Char*         getMVPIdx             ( RefPicList eRefPicList )                          { return m_apiMVPIdx[eRefPicList];            }
604
605  Void          setMVPNum             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum;  }
606  Int           getMVPNum             ( RefPicList eRefPicList, UInt uiIdx )              { return m_apiMVPNum[eRefPicList][uiIdx];     }
607  Char*         getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
608 
609  Void          setMVPIdxSubParts     ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
610  Void          setMVPNumSubParts     ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
611 
612  Void          clipMv                ( TComMv&     rcMv     );
613  Void          getMvPredLeft         ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldA.getMv(); }
614  Void          getMvPredAbove        ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldB.getMv(); }
615  Void          getMvPredAboveRight   ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldC.getMv(); }
616 
617  Void          compressMV            ();
618 
619  // -------------------------------------------------------------------------------------------------------------------
620  // utility functions for neighbouring information
621  // -------------------------------------------------------------------------------------------------------------------
622 
623  TComDataCU*   getCULeft                   () { return m_pcCULeft;       }
624  TComDataCU*   getCUAbove                  () { return m_pcCUAbove;      }
625  TComDataCU*   getCUAboveLeft              () { return m_pcCUAboveLeft;  }
626  TComDataCU*   getCUAboveRight             () { return m_pcCUAboveRight; }
627  TComDataCU*   getCUColocated              ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; }
628
629
630  TComDataCU*   getPULeft                   ( UInt&  uiLPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true
631                                            , Bool bEnforceTileRestriction=true 
632                                            );
633
634  TComDataCU*   getPUAbove                  ( UInt&  uiAPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false
635                                            , Bool planarAtLCUBoundary = false 
636                                            , Bool bEnforceTileRestriction=true 
637                                            );
638
639  TComDataCU*   getPUAboveLeft              ( UInt&  uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false );
640  TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false );
641  TComDataCU*   getPUBelowLeft              ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
642
643  TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
644  TComDataCU*   getQpMinCuAbove             ( UInt&  aPartUnitIdx , UInt currAbsIdxInLCU, Bool enforceSliceRestriction=true, Bool enforceEntropySliceRestriction=true );
645  Char          getRefQP                    ( UInt   uiCurrAbsIdxInLCU                       );
646
647  TComDataCU*   getPUAboveRightAdi          ( UInt&  uiARPartUnitIdx, UInt uiPuWidth, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
648  TComDataCU*   getPUBelowLeftAdi           ( UInt& uiBLPartUnitIdx, UInt uiPuHeight, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
649 
650  Void          deriveLeftRightTopIdx       ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
651  Void          deriveLeftBottomIdx         ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLB );
652 
653  Void          deriveLeftRightTopIdxAdi    ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth );
654  Void          deriveLeftBottomIdxAdi      ( UInt& ruiPartIdxLB, UInt  uiPartOffset, UInt uiPartDepth );
655 
656  Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
657#if MERL_VSP_C0152
658  Void          getInterMergeCandidates     ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, Int mrgCandIdx = -1 );
659#else
660  Void          getInterMergeCandidates     ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 );
661#endif
662  Void          deriveLeftRightTopIdxGeneral( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
663  Void          deriveLeftBottomIdxGeneral  ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB );
664 
665 
666  // -------------------------------------------------------------------------------------------------------------------
667  // member functions for modes
668  // -------------------------------------------------------------------------------------------------------------------
669 
670  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
671  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
672 
673  // -------------------------------------------------------------------------------------------------------------------
674  // member functions for symbol prediction (most probable / mode conversion)
675  // -------------------------------------------------------------------------------------------------------------------
676 
677  UInt          getIntraSizeIdx                 ( UInt uiAbsPartIdx                                       );
678  Void          convertTransIdx                 ( UInt uiAbsPartIdx, UInt uiTrIdx, UInt& ruiLumaTrMode, UInt& ruiChromaTrMode );
679 
680  Void          getAllowedChromaDir             ( UInt uiAbsPartIdx, UInt* uiModeList );
681  Int           getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );
682 
683  // -------------------------------------------------------------------------------------------------------------------
684  // member functions for SBAC context
685  // -------------------------------------------------------------------------------------------------------------------
686 
687  UInt          getCtxSplitFlag                 ( UInt   uiAbsPartIdx, UInt uiDepth                   );
688  UInt          getCtxQtCbf                     ( UInt   uiAbsPartIdx, TextType eType, UInt uiTrDepth );
689
690  UInt          getCtxSkipFlag                  ( UInt   uiAbsPartIdx                                 );
691#if LGE_ILLUCOMP_B0045
692  UInt          getCtxICFlag                    ( UInt   uiAbsPartIdx                                 );
693#endif
694  UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
695
696#if H3D_IVRP
697  UInt          getCtxResPredFlag               ( UInt   uiAbsPartIdx                                 );
698#endif
699 
700  UInt          getSliceStartCU         ( UInt pos )                  { return m_uiSliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
701  UInt          getEntropySliceStartCU  ( UInt pos )                  { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
702  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
703
704#if LGE_EDGE_INTRA_A0070
705  UInt          getCtxEdgeIntra ( UInt uiAbsPartIdx );
706#endif
707
708  // -------------------------------------------------------------------------------------------------------------------
709  // member functions for RD cost storage
710  // -------------------------------------------------------------------------------------------------------------------
711 
712  Double&       getTotalCost()                  { return m_dTotalCost;        }
713  Dist&         getTotalDistortion()            { return m_uiTotalDistortion; }
714  UInt&         getTotalBits()                  { return m_uiTotalBits;       }
715  UInt&         getTotalNumPart()               { return m_uiNumPartition;    }
716
717  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
718
719  Bool          useNonSquareTrans( UInt uiTrMode, Int absPartIdx );
720  Void          getNSQTSize(Int trMode, Int absPartIdx, Int &trWidth, Int &trHeight);
721  Bool          useNonSquarePU   ( UInt absPartIdx);
722  UInt          getInterTUSplitDirection ( Int width, Int height, Int trLastWidth, Int trLastHeight );
723  UInt          getNSAbsPartIdx  ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt innerQuadIdx, UInt trMode );
724  UInt          getNSAddrChroma   ( UInt uiLog2TrSizeC, UInt uiTrModeC, UInt uiQuadrant, UInt absTUPartIdx );
725 
726// -------------------------------------------------------------------------------------------------------------------
727  // member functions for depth model modes
728  // -------------------------------------------------------------------------------------------------------------------
729#if HHI_DMM_WEDGE_INTRA
730  UInt* getWedgeFullTabIdx                ()                      { return m_puiWedgeFullTabIdx;              }
731  UInt  getWedgeFullTabIdx                ( UInt uiIdx )          { return m_puiWedgeFullTabIdx[uiIdx];       }
732  Void  setWedgeFullTabIdx                ( UInt uiIdx, UInt uh ) { m_puiWedgeFullTabIdx[uiIdx] = uh;         }
733  Void  setWedgeFullTabIdxSubParts        ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
734  Int*  getWedgeFullDeltaDC1              ()                      { return m_piWedgeFullDeltaDC1;             }
735  Int   getWedgeFullDeltaDC1              ( UInt uiIdx )          { return m_piWedgeFullDeltaDC1[uiIdx];      }
736  Void  setWedgeFullDeltaDC1              ( UInt uiIdx, Int i )   { m_piWedgeFullDeltaDC1[uiIdx] = i;         }
737  Void  setWedgeFullDeltaDC1SubParts      ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
738  Int*  getWedgeFullDeltaDC2              ()                      { return m_piWedgeFullDeltaDC2;             }
739  Int   getWedgeFullDeltaDC2              ( UInt uiIdx )          { return m_piWedgeFullDeltaDC2[uiIdx];      }
740  Void  setWedgeFullDeltaDC2              ( UInt uiIdx, Int i )   { m_piWedgeFullDeltaDC2[uiIdx] = i;         }
741  Void  setWedgeFullDeltaDC2SubParts      ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
742
743  UInt* getWedgePredDirTabIdx             ()                      { return m_puiWedgePredDirTabIdx;           }
744  UInt  getWedgePredDirTabIdx             ( UInt uiIdx )          { return m_puiWedgePredDirTabIdx[uiIdx];    }
745  Void  setWedgePredDirTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredDirTabIdx[uiIdx] = uh;      }
746  Void  setWedgePredDirTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
747  Int*  getWedgePredDirDeltaDC1           ()                      { return m_piWedgePredDirDeltaDC1;          }
748  Int   getWedgePredDirDeltaDC1           ( UInt uiIdx )          { return m_piWedgePredDirDeltaDC1[uiIdx];   }
749  Void  setWedgePredDirDeltaDC1           ( UInt uiIdx, Int i )   { m_piWedgePredDirDeltaDC1[uiIdx] = i;      }
750  Void  setWedgePredDirDeltaDC1SubParts   ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
751  Int*  getWedgePredDirDeltaDC2           ()                      { return m_piWedgePredDirDeltaDC2;          }
752  Int   getWedgePredDirDeltaDC2           ( UInt uiIdx )          { return m_piWedgePredDirDeltaDC2[uiIdx];   }
753  Void  setWedgePredDirDeltaDC2           ( UInt uiIdx, Int i )   { m_piWedgePredDirDeltaDC2[uiIdx] = i;      }
754  Void  setWedgePredDirDeltaDC2SubParts   ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
755  Int*  getWedgePredDirDeltaEnd           ()                      { return m_piWedgePredDirDeltaEnd;          }
756  Int   getWedgePredDirDeltaEnd           ( UInt uiIdx )          { return m_piWedgePredDirDeltaEnd[uiIdx];   }
757  Void  setWedgePredDirDeltaEnd           ( UInt uiIdx, Int iD )  { m_piWedgePredDirDeltaEnd[uiIdx] = iD;     }
758  Void  setWedgePredDirDeltaEndSubParts   ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );
759#endif
760#if HHI_DMM_PRED_TEX
761  UInt* getWedgePredTexTabIdx             ()                      { return m_puiWedgePredTexTabIdx;           }
762  UInt  getWedgePredTexTabIdx             ( UInt uiIdx )          { return m_puiWedgePredTexTabIdx[uiIdx];    }
763  Void  setWedgePredTexTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredTexTabIdx[uiIdx] = uh;      }
764  Void  setWedgePredTexTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
765#if LGE_DMM3_SIMP_C0044
766  UInt* getWedgePredTexIntraTabIdx             ()                      { return m_puiWedgePredTexIntraTabIdx;           }
767  UInt  getWedgePredTexIntraTabIdx             ( UInt uiIdx )          { return m_puiWedgePredTexIntraTabIdx[uiIdx];    }
768  Void  setWedgePredTexIntraTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredTexIntraTabIdx[uiIdx] = uh;      }
769  Void  setWedgePredTexIntraTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
770#endif
771  Int*  getWedgePredTexDeltaDC1           ()                      { return m_piWedgePredTexDeltaDC1;          }
772  Int   getWedgePredTexDeltaDC1           ( UInt uiIdx )          { return m_piWedgePredTexDeltaDC1[uiIdx];   }
773  Void  setWedgePredTexDeltaDC1           ( UInt uiIdx, Int i )   { m_piWedgePredTexDeltaDC1[uiIdx] = i;      }
774  Void  setWedgePredTexDeltaDC1SubParts   ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
775  Int*  getWedgePredTexDeltaDC2           ()                      { return m_piWedgePredTexDeltaDC2;          }
776  Int   getWedgePredTexDeltaDC2           ( UInt uiIdx )          { return m_piWedgePredTexDeltaDC2[uiIdx];   }
777  Void  setWedgePredTexDeltaDC2           ( UInt uiIdx, Int i )   { m_piWedgePredTexDeltaDC2[uiIdx] = i;      }
778  Void  setWedgePredTexDeltaDC2SubParts   ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
779
780  Int*  getContourPredTexDeltaDC1         ()                      { return m_piContourPredTexDeltaDC1;        }
781  Int   getContourPredTexDeltaDC1         ( UInt uiIdx )          { return m_piContourPredTexDeltaDC1[uiIdx]; }
782  Void  setContourPredTexDeltaDC1         ( UInt uiIdx, Int i )   { m_piContourPredTexDeltaDC1[uiIdx] = i;    }
783  Void  setContourPredTexDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
784  Int*  getContourPredTexDeltaDC2         ()                      { return m_piContourPredTexDeltaDC2;        }
785  Int   getContourPredTexDeltaDC2         ( UInt uiIdx )          { return m_piContourPredTexDeltaDC2[uiIdx]; }
786  Void  setContourPredTexDeltaDC2         ( UInt uiIdx, Int i )   { m_piContourPredTexDeltaDC2[uiIdx] = i;    }
787  Void  setContourPredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
788#endif
789
790#if LGE_EDGE_INTRA_A0070
791  UChar*        getEdgeCode( UInt uiIdx )                 { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; }
792  UChar*        getEdgeNumber( )                          { return m_pucEdgeNumber;           }
793  UChar         getEdgeNumber( UInt uiIdx )               { return m_pucEdgeNumber[uiIdx];    }
794  Void          setEdgeNumber( UInt uiIdx, UChar val )    { m_pucEdgeNumber[uiIdx] = val;     }
795  UChar*        getEdgeStartPos( )                        { return m_pucEdgeStartPos;         }
796  UChar         getEdgeStartPos( UInt uiIdx )             { return m_pucEdgeStartPos[uiIdx];  }
797  Void          setEdgeStartPos( UInt uiIdx, UChar val )  { m_pucEdgeStartPos[uiIdx] = val;   }
798  Bool*         getEdgeLeftFirst( )                       { return m_pbEdgeLeftFirst;         }
799  Bool          getEdgeLeftFirst( UInt uiIdx )            { return m_pbEdgeLeftFirst[uiIdx];  }
800  Void          setEdgeLeftFirst( UInt uiIdx, Bool val )  { m_pbEdgeLeftFirst[uiIdx] = val;   }
801  Bool*         getEdgePartition( UInt uiIdx )              { return &m_pbEdgePartition[uiIdx * 16]; }
802  Void          reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion );
803
804#if LGE_EDGE_INTRA_DELTA_DC
805  Int*          getEdgeDeltaDC0( )                          { return m_piEdgeDeltaDC0; }
806  Int*          getEdgeDeltaDC1( )                          { return m_piEdgeDeltaDC1; }
807  Int           getEdgeDeltaDC0( UInt uiIdx )               { return m_piEdgeDeltaDC0[uiIdx]; }
808  Int           getEdgeDeltaDC1( UInt uiIdx )               { return m_piEdgeDeltaDC1[uiIdx]; }
809  Void          setEdgeDeltaDC0( UInt uiIdx, Int val )      { m_piEdgeDeltaDC0[uiIdx] = val;  }
810  Void          setEdgeDeltaDC1( UInt uiIdx, Int val )      { m_piEdgeDeltaDC1[uiIdx] = val;  }
811#endif
812#endif
813 
814#if RWTH_SDC_DLT_B0036
815  Bool*         getSDCFlag          ()                        { return m_pbSDCFlag;               }
816  Bool          getSDCFlag          ( UInt uiIdx )            { return m_pbSDCFlag[uiIdx];        }
817  Void          setSDCFlagSubParts  ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
818 
819  UInt          getCtxSDCFlag              ( UInt uiAbsPartIdx );
820 
821  Bool          getSDCAvailable             ( UInt uiAbsPartIdx );
822 
823  Pel*          getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; }
824  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
825  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
826 
827
828#endif
829};
830
831namespace RasterAddress
832{
833  /** Check whether 2 addresses point to the same column
834   * \param addrA          First address in raster scan order
835   * \param addrB          Second address in raters scan order
836   * \param numUnitsPerRow Number of units in a row
837   * \return Result of test
838   */
839  static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow )
840  {
841    // addrA % numUnitsPerRow == addrB % numUnitsPerRow
842    return (( addrA ^ addrB ) &  ( numUnitsPerRow - 1 ) ) == 0;
843  }
844 
845  /** Check whether 2 addresses point to the same row
846   * \param addrA          First address in raster scan order
847   * \param addrB          Second address in raters scan order
848   * \param numUnitsPerRow Number of units in a row
849   * \return Result of test
850   */
851  static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow )
852  {
853    // addrA / numUnitsPerRow == addrB / numUnitsPerRow
854    return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0;
855  }
856 
857  /** Check whether 2 addresses point to the same row or column
858   * \param addrA          First address in raster scan order
859   * \param addrB          Second address in raters scan order
860   * \param numUnitsPerRow Number of units in a row
861   * \return Result of test
862   */
863  static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow )
864  {
865    return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow );
866  }
867 
868  /** Check whether one address points to the first column
869   * \param addr           Address in raster scan order
870   * \param numUnitsPerRow Number of units in a row
871   * \return Result of test
872   */
873  static inline Bool isZeroCol( Int addr, Int numUnitsPerRow )
874  {
875    // addr % numUnitsPerRow == 0
876    return ( addr & ( numUnitsPerRow - 1 ) ) == 0;
877  }
878 
879  /** Check whether one address points to the first row
880   * \param addr           Address in raster scan order
881   * \param numUnitsPerRow Number of units in a row
882   * \return Result of test
883   */
884  static inline Bool isZeroRow( Int addr, Int numUnitsPerRow )
885  {
886    // addr / numUnitsPerRow == 0
887    return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0;
888  }
889 
890  /** Check whether one address points to a column whose index is smaller than a given value
891   * \param addr           Address in raster scan order
892   * \param val            Given column index value
893   * \param numUnitsPerRow Number of units in a row
894   * \return Result of test
895   */
896  static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow )
897  {
898    // addr % numUnitsPerRow < val
899    return ( addr & ( numUnitsPerRow - 1 ) ) < val;
900  }
901 
902  /** Check whether one address points to a row whose index is smaller than a given value
903   * \param addr           Address in raster scan order
904   * \param val            Given row index value
905   * \param numUnitsPerRow Number of units in a row
906   * \return Result of test
907   */
908  static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow )
909  {
910    // addr / numUnitsPerRow < val
911    return addr < val * numUnitsPerRow;
912  }
913};
914
915//! \}
916
917#endif
Note: See TracBrowser for help on using the repository browser.