source: 3DVCSoftware/trunk/source/Lib/TLibCommon/TComDataCU.h @ 332

Last change on this file since 332 was 332, checked in by tech, 11 years ago

Merged branch 6.1-Cleanup@329.

  • Property svn:eol-style set to native
File size: 54.2 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  inline Bool   xAddVspMergeCand      ( UChar ucVspMergePos, Int vspIdx, Bool* bVspMvZeroDone, UInt uiDepth, Bool* abCandIsInter, Int& iCount,
278                                        UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, Int* iVSPIndexTrue, Int mrgCandIdx, DisInfo* pDisInfo );
279  inline Void   xInheritVspMode       ( TComDataCU* pcCURef, UInt uiIdx, Bool* bVspMvZeroDone, Int iCount, Int* iVSPIndexTrue, TComMvField* pcMvFieldNeighbours, DisInfo* pDInfo ) ;
280#endif
281  Void          deriveRightBottomIdx        ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxRB );
282  Bool          xGetColMVP( RefPicList eRefPicList, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int& riRefIdx
283#if QC_TMVP_MRG_REFIDX_C0047
284  ,
285  Bool bMRG = 0
286#endif
287  );
288#if H3D_NBDV
289  Void          xDeriveRightBottomNbIdx( PartSize eCUMode, UInt uiPartIdx, Int &uiLCUIdxRBNb, Int &uiPartIdxRBNb );
290  Bool          xCheckSpatialNBDV( TComDataCU* pcTmpCU, UInt uiIdx, UInt uiPartIdx, UInt uiPartAddr, DisInfo* pNbDvInfo, Bool bSearchForMvpDv, McpDisInfo* paMvpDvInfo, UInt uiMvpDvPos, Bool bDepthRefine );
291  Bool          xGetColDisMV( RefPicList eRefPicList, Int refidx, Int uiCUAddr, Int uiPartUnitIdx, TComMv& rcMv, Int & iTargetViewIdx, Int & iStartViewIdx );
292#endif
293 
294
295  Void xCheckCornerCand( TComDataCU* pcCorner, UInt uiCornerIdx, UInt uiIter, Bool& rbValidCand );
296  /// compute required bits to encode MVD (used in AMVP)
297  UInt          xGetMvdBits           ( TComMv cMvd );
298  UInt          xGetComponentBits     ( Int iVal );
299 
300  /// compute scaling factor from POC difference
301  Int           xGetDistScaleFactor   ( Int iCurrPOC, Int iCurrRefPOC, Int iColPOC, Int iColRefPOC );
302 
303  Void xDeriveCenterIdx( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxCenter );
304  Bool xGetCenterCol( UInt uiPartIdx, RefPicList eRefPicList, int iRefIdx, TComMv *pcMv );
305 
306  Void xCheckDuplicateCand(TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, bool* pbCandIsInter, UInt& ruiArrayAddr);
307
308
309public:
310  TComDataCU();
311  virtual ~TComDataCU();
312 
313  // -------------------------------------------------------------------------------------------------------------------
314  // create / destroy / initialize / copy
315  // -------------------------------------------------------------------------------------------------------------------
316 
317  Void          create                ( UInt uiNumPartition, UInt uiWidth, UInt uiHeight, Bool bDecSubCu, Int unitSize
318#if ADAPTIVE_QP_SELECTION
319    , Bool bGlobalRMARLBuffer = false
320#endif 
321    );
322  Void          destroy               ();
323 
324  Void          initCU                ( TComPic* pcPic, UInt uiCUAddr );
325  Void          initEstData           ( UInt uiDepth, Int qp );
326  Void          initSubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth, Int qp );
327  Void          setOutsideCUPart      ( UInt uiAbsPartIdx, UInt uiDepth );
328
329  Void          copySubCU             ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
330  Void          copyInterPredInfoFrom ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList );
331  Void          copyPartFrom          ( TComDataCU* pcCU, UInt uiPartUnitIdx, UInt uiDepth );
332 
333  Void          copyToPic             ( UChar uiDepth );
334  Void          copyToPic             ( UChar uiDepth, UInt uiPartIdx, UInt uiPartDepth );
335 
336  // -------------------------------------------------------------------------------------------------------------------
337  // member functions for CU description
338  // -------------------------------------------------------------------------------------------------------------------
339 
340  TComPic*      getPic                ()                        { return m_pcPic;           }
341  TComSlice*    getSlice              ()                        { return m_pcSlice;         }
342  UInt&         getAddr               ()                        { return m_uiCUAddr;        }
343  UInt&         getZorderIdxInCU      ()                        { return m_uiAbsIdxInLCU; }
344  UInt          getSCUAddr            ();
345  UInt          getCUPelX             ()                        { return m_uiCUPelX;        }
346  UInt          getCUPelY             ()                        { return m_uiCUPelY;        }
347  TComPattern*  getPattern            ()                        { return m_pcPattern;       }
348 
349  UChar*        getDepth              ()                        { return m_puhDepth;        }
350  UChar         getDepth              ( UInt uiIdx )            { return m_puhDepth[uiIdx]; }
351  Void          setDepth              ( UInt uiIdx, UChar  uh ) { m_puhDepth[uiIdx] = uh;   }
352 
353  Void          setDepthSubParts      ( UInt uiDepth, UInt uiAbsPartIdx );
354  Void          getPosInPic           ( UInt uiAbsPartIndex, Int& riPosX, Int& riPosY );
355#if HHI_MPI
356  Int*          getTextureModeDepth   ()                        { return m_piTextureModeDepth; }
357  Int           getTextureModeDepth   ( UInt uiIdx )            { return m_piTextureModeDepth[uiIdx]; }
358  Void          setTextureModeDepth   ( UInt uiIdx, Int iTextureModeDepth ){ m_piTextureModeDepth[uiIdx] = iTextureModeDepth; }
359  Void          setTextureModeDepthSubParts( Int iTextureModeDepth, UInt uiAbsPartIdx, UInt uiDepth );
360  Void          copyTextureMotionDataFrom( TComDataCU* pcCU, UInt uiDepth, UInt uiAbsPartIdxSrc, UInt uiAbsPartIdxDst = 0 );
361#endif
362
363   // -------------------------------------------------------------------------------------------------------------------
364  // member functions for CU data
365  // -------------------------------------------------------------------------------------------------------------------
366 
367  Char*         getPartitionSize      ()                        { return m_pePartSize;        }
368  PartSize      getPartitionSize      ( UInt uiIdx )            { return static_cast<PartSize>( m_pePartSize[uiIdx] ); }
369  Void          setPartitionSize      ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh;   }
370  Void          setPartSizeSubParts   ( PartSize eMode, UInt uiAbsPartIdx, UInt uiDepth );
371 
372#if HHI_INTERVIEW_SKIP
373  Bool*         getRenderable          ()                        { return m_pbRenderable;               }
374    Bool          getRenderable          ( UInt uiIdx )            { return m_pbRenderable[uiIdx];        }
375    Void          setRenderable          ( UInt uiIdx, Bool b )    { m_pbRenderable[uiIdx] = b;           }
376    Void          setRenderableSubParts  ( Bool bRenderable, UInt uiAbsPartIdx, UInt uiDepth );
377#endif
378 
379  Char*         getPredictionMode     ()                        { return m_pePredMode;        }
380  PredMode      getPredictionMode     ( UInt uiIdx )            { return static_cast<PredMode>( m_pePredMode[uiIdx] ); }
381  Void          setPredictionMode     ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh;   }
382  Void          setPredModeSubParts   ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth );
383 
384  UChar*        getWidth              ()                        { return m_puhWidth;          }
385  UChar         getWidth              ( UInt uiIdx )            { return m_puhWidth[uiIdx];   }
386  Void          setWidth              ( UInt uiIdx, UChar  uh ) { m_puhWidth[uiIdx] = uh;     }
387 
388  UChar*        getHeight             ()                        { return m_puhHeight;         }
389  UChar         getHeight             ( UInt uiIdx )            { return m_puhHeight[uiIdx];  }
390  Void          setHeight             ( UInt uiIdx, UChar  uh ) { m_puhHeight[uiIdx] = uh;    }
391 
392  Void          setSizeSubParts       ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth );
393 
394  Char*         getQP                 ()                        { return m_phQP;              }
395  Char          getQP                 ( UInt uiIdx )            { return m_phQP[uiIdx];       }
396  Void          setQP                 ( UInt uiIdx, Char value ){ m_phQP[uiIdx] =  value;     }
397  Void          setQPSubParts         ( Int qp,   UInt uiAbsPartIdx, UInt uiDepth );
398  Int           getLastValidPartIdx   ( Int iAbsPartIdx );
399  Char          getLastCodedQP        ( UInt uiAbsPartIdx );
400
401#if LOSSLESS_CODING
402  Bool          isLosslessCoded(UInt absPartIdx);
403#endif
404  UChar*        getNSQTPartIdx        ()                        { return m_nsqtPartIdx;        }
405  UChar         getNSQTPartIdx        ( UInt idx )              { return m_nsqtPartIdx[idx];   }
406  Void          setNSQTIdxSubParts    ( UInt absPartIdx, UInt depth );
407  Void          setNSQTIdxSubParts    ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt trMode );
408 
409  UChar*        getTransformIdx       ()                        { return m_puhTrIdx;          }
410  UChar         getTransformIdx       ( UInt uiIdx )            { return m_puhTrIdx[uiIdx];   }
411  Void          setTrIdxSubParts      ( UInt uiTrIdx, UInt uiAbsPartIdx, UInt uiDepth );
412 
413  UInt          getQuadtreeTULog2MinSizeInCU( UInt absPartIdx );
414 
415  TComCUMvField* getCUMvField         ( RefPicList e )          { return  &m_acCUMvField[e];  }
416 
417  TCoeff*&      getCoeffY             ()                        { return m_pcTrCoeffY;        }
418  TCoeff*&      getCoeffCb            ()                        { return m_pcTrCoeffCb;       }
419  TCoeff*&      getCoeffCr            ()                        { return m_pcTrCoeffCr;       }
420#if ADAPTIVE_QP_SELECTION
421  Int*&         getArlCoeffY          ()                        { return m_pcArlCoeffY;       }
422  Int*&         getArlCoeffCb         ()                        { return m_pcArlCoeffCb;      }
423  Int*&         getArlCoeffCr         ()                        { return m_pcArlCoeffCr;      }
424#endif
425 
426  Pel*&         getPCMSampleY         ()                        { return m_pcIPCMSampleY;     }
427  Pel*&         getPCMSampleCb        ()                        { return m_pcIPCMSampleCb;    }
428  Pel*&         getPCMSampleCr        ()                        { return m_pcIPCMSampleCr;    }
429
430  UChar         getCbf    ( UInt uiIdx, TextType eType )                  { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx];  }
431  UChar*        getCbf    ( TextType eType )                              { return m_puhCbf[g_aucConvertTxtTypeToIdx[eType]];         }
432  UChar         getCbf    ( UInt uiIdx, TextType eType, UInt uiTrDepth )  { return ( ( getCbf( uiIdx, eType ) >> uiTrDepth ) & 0x1 ); }
433  Void          setCbf    ( UInt uiIdx, TextType eType, UChar uh )        { m_puhCbf[g_aucConvertTxtTypeToIdx[eType]][uiIdx] = uh;    }
434  Void          clearCbf  ( UInt uiIdx, TextType eType, UInt uiNumParts );
435  UChar         getQtRootCbf          ( UInt uiIdx )                      { return getCbf( uiIdx, TEXT_LUMA, 0 ) || getCbf( uiIdx, TEXT_CHROMA_U, 0 ) || getCbf( uiIdx, TEXT_CHROMA_V, 0 ); }
436 
437  Void          setCbfSubParts        ( UInt uiCbfY, UInt uiCbfU, UInt uiCbfV, UInt uiAbsPartIdx, UInt uiDepth          );
438  Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiDepth                    );
439  Void          setCbfSubParts        ( UInt uiCbf, TextType eTType, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth    );
440 
441  // -------------------------------------------------------------------------------------------------------------------
442  // member functions for coding tool information
443  // -------------------------------------------------------------------------------------------------------------------
444 
445  Bool*         getMergeFlag          ()                        { return m_pbMergeFlag;               }
446  Bool          getMergeFlag          ( UInt uiIdx )            { return m_pbMergeFlag[uiIdx];        }
447  Void          setMergeFlag          ( UInt uiIdx, Bool b )    { m_pbMergeFlag[uiIdx] = b;           }
448  Void          setMergeFlagSubParts  ( Bool bMergeFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
449
450  UChar*        getMergeIndex         ()                        { return m_puhMergeIndex;                         }
451  UChar         getMergeIndex         ( UInt uiIdx )            { return m_puhMergeIndex[uiIdx];                  }
452  Void          setMergeIndex         ( UInt uiIdx, UInt uiMergeIndex ) { m_puhMergeIndex[uiIdx] = uiMergeIndex;  }
453  Void          setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
454
455#if MERL_VSP_C0152
456  Char*         getVSPIndex        ()                        { return m_piVSPIndex;        }
457  Char          getVSPIndex        ( UInt uiIdx )            { return m_piVSPIndex[uiIdx]; }
458  Void          setVSPIndex        ( UInt uiIdx, Int n )     { m_piVSPIndex[uiIdx] = n;    }
459  Void          setVSPIndexSubParts( Char bVSPIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
460#endif
461
462  template <typename T>
463  Void          setSubPart            ( T bParameter, T* pbBaseLCU, UInt uiCUAddr, UInt uiCUDepth, UInt uiPUIdx );
464
465#if LGE_ILLUCOMP_B0045
466  Bool*         getICFlag             ()                        { return m_pbICFlag;               }
467  Bool          getICFlag             ( UInt uiIdx )            { return m_pbICFlag[uiIdx];        }
468  Void          setICFlag             ( UInt uiIdx, Bool  uh )  { m_pbICFlag[uiIdx] = uh;          }
469  Void          setICFlagSubParts     ( Bool bICFlag,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
470#if LGE_ILLUCOMP_DEPTH_C0046
471  Bool          isICFlagRequired      (UInt uiAbsPartIdx, UInt uiDepth); //This modification is not needed after integrating JCT3V-C0137
472#else
473  Bool          isICFlagRequired      (UInt uiAbsPartIdx);
474#endif
475#endif
476
477#if AMP_MRG
478  Void          setMergeAMP( Bool b )      { m_bIsMergeAMP = b; }
479  Bool          getMergeAMP( )             { return m_bIsMergeAMP; }
480#endif
481
482  UChar*        getLumaIntraDir       ()                        { return m_puhLumaIntraDir;           }
483  UChar         getLumaIntraDir       ( UInt uiIdx )            { return m_puhLumaIntraDir[uiIdx];    }
484  Void          setLumaIntraDir       ( UInt uiIdx, UChar  uh ) { m_puhLumaIntraDir[uiIdx] = uh;      }
485  Void          setLumaIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
486 
487  UChar*        getChromaIntraDir     ()                        { return m_puhChromaIntraDir;         }
488  UChar         getChromaIntraDir     ( UInt uiIdx )            { return m_puhChromaIntraDir[uiIdx];  }
489  Void          setChromaIntraDir     ( UInt uiIdx, UChar  uh ) { m_puhChromaIntraDir[uiIdx] = uh;    }
490  Void          setChromIntraDirSubParts( UInt uiDir,  UInt uiAbsPartIdx, UInt uiDepth );
491 
492  UChar*        getInterDir           ()                        { return m_puhInterDir;               }
493  UChar         getInterDir           ( UInt uiIdx )            { return m_puhInterDir[uiIdx];        }
494  Void          setInterDir           ( UInt uiIdx, UChar  uh ) { m_puhInterDir[uiIdx] = uh;          }
495  Void          setInterDirSubParts   ( UInt uiDir,  UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
496 
497  Bool*         getAlfCtrlFlag        ()                        { return m_puiAlfCtrlFlag;            }
498  Bool          getAlfCtrlFlag        ( UInt uiIdx )            { return m_puiAlfCtrlFlag[uiIdx];     }
499  Void          setAlfCtrlFlag        ( UInt uiIdx, Bool uiFlag){ m_puiAlfCtrlFlag[uiIdx] = uiFlag;   }
500  Void          setAlfCtrlFlagSubParts( Bool uiFlag, UInt uiAbsPartIdx, UInt uiDepth );
501 
502  Void          createTmpAlfCtrlFlag  ();
503  Void          destroyTmpAlfCtrlFlag ();
504  Void          copyAlfCtrlFlagToTmp  ();
505  Void          copyAlfCtrlFlagFromTmp();
506 
507  Bool*         getIPCMFlag           ()                        { return m_pbIPCMFlag;               }
508  Bool          getIPCMFlag           (UInt uiIdx )             { return m_pbIPCMFlag[uiIdx];        }
509  Void          setIPCMFlag           (UInt uiIdx, Bool b )     { m_pbIPCMFlag[uiIdx] = b;           }
510  Void          setIPCMFlagSubParts   (Bool bIpcmFlag, UInt uiAbsPartIdx, UInt uiDepth);
511
512  Int           getNumSucIPCM         ()                        { return m_numSucIPCM;             }
513  Void          setNumSucIPCM         ( Int num )               { m_numSucIPCM = num;              }
514  Bool          getLastCUSucIPCMFlag  ()                        { return m_lastCUSucIPCMFlag;        }
515  Void          setLastCUSucIPCMFlag  ( Bool flg )              { m_lastCUSucIPCMFlag = flg;         }
516
517  /// get slice ID for SU
518  Int           getSUSliceID          (UInt uiIdx)              {return m_piSliceSUMap[uiIdx];      } 
519
520  /// get the pointer of slice ID map
521  Int*          getSliceSUMap         ()                        {return m_piSliceSUMap;             }
522
523  /// set the pointer of slice ID map
524  Void          setSliceSUMap         (Int *pi)                 {m_piSliceSUMap = pi;               }
525
526  std::vector<NDBFBlockInfo>* getNDBFilterBlocks()      {return &m_vNDFBlock;}
527  Void setNDBFilterBlockBorderAvailability(UInt numLCUInPicWidth, UInt numLCUInPicHeight, UInt numSUInLCUWidth, UInt numSUInLCUHeight, UInt picWidth, UInt picHeight
528                                          ,Bool bIndependentSliceBoundaryEnabled
529                                          ,Bool bTopTileBoundary, Bool bDownTileBoundary, Bool bLeftTileBoundary, Bool bRightTileBoundary
530                                          ,Bool bIndependentTileBoundaryEnabled );
531
532#if H3D_IVMP
533#if !H3D_NBDV
534  Int           getPdmMergeCandidate      ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv );
535  Bool          getPdmMvPred              ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv, Bool bMerge = false );
536#else //!H3D_NBDV
537  Bool          getUnifiedMvPredCan       ( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* iPdm, Bool bMerge );
538  Void          getDisMvpCand        ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo );
539  Void          getDisMvpCandNBDV( UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDInfo , Bool bParMerg = false
540#if MERL_VSP_C0152
541                              , Bool bDepthRefine = false
542#endif //MERL_VSP_C0152
543    );
544#endif // !H3D_NBDV
545
546
547
548#if MERL_VSP_C0152
549  Pel           getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT, Int iShiftPrec, Bool bSimpleDvpRefine = false);
550  Void          estimateDVFromDM(UInt uiPartIdx, TComPic* picDepth, UInt uiPartAddr, TComMv* cMvPred, Bool bSimpleDvpRefine = false);
551#endif
552  Bool          getIViewOrgDepthMvPred( UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, TComMv& rcMv );
553#endif //  H3D_IVMP
554#if H3D_IVRP
555  Bool*         getResPredAvail         ()                        { return m_pbResPredAvailable;        }
556  Bool          getResPredAvail         ( UInt uiIdx )            { return m_pbResPredAvailable[uiIdx]; }
557  Void          setResPredAvail         ( UInt uiIdx, Bool b )    { m_pbResPredAvailable[uiIdx] = b;    }
558  Void          setResPredAvailSubParts ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
559
560  Bool*         getResPredFlag          ()                        { return m_pbResPredFlag;        }
561  Bool          getResPredFlag          ( UInt uiIdx )            { return m_pbResPredFlag[uiIdx]; }
562  Void          setResPredFlag          ( UInt uiIdx, Bool b )    { m_pbResPredFlag[uiIdx] = b;    }
563  Void          setResPredFlagSubParts  ( Bool b, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
564
565  Void          setResPredIndicator     ( Bool bAv, Bool bRP )    { m_pbResPredAvailable[0] = bAv; m_pbResPredFlag[0] = bRP; }
566#endif
567#if H3D_IVRP
568  Bool          getResidualSamples( UInt uiPartIdx, Bool bRecon, TComYuv* pcYuv = 0 );
569#endif
570  // -------------------------------------------------------------------------------------------------------------------
571  // member functions for accessing partition information
572  // -------------------------------------------------------------------------------------------------------------------
573#if H3D_IVRP
574  Void          getPartIndexAndSize( UInt uiPartIdx, UInt& ruiPartAddr, Int& riWidth, Int& riHeight, UInt uiAbsPartIdx = 0, Bool bLCU = false);
575#endif
576  UChar         getNumPartInter       ();
577  Bool          isFirstAbsZorderIdxInDepth (UInt uiAbsPartIdx, UInt uiDepth);
578 
579  // -------------------------------------------------------------------------------------------------------------------
580  // member functions for motion vector
581  // -------------------------------------------------------------------------------------------------------------------
582 
583  Void          getMvField            ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefPicList, TComMvField& rcMvField );
584 
585  AMVP_MODE     getAMVPMode           ( UInt uiIdx );
586#if H3D_IVMP
587  Void          fillMvpCandBase       ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo );
588  Void          fillMvpCand           ( UInt uiPartIdx, UInt uiPartAddr, RefPicList eRefPicList, Int iRefIdx, AMVPInfo* pInfo , Int iMVPIdx=-1);
589#endif
590  Bool          isDiffMER             ( Int xN, Int yN, Int xP, Int yP);
591  Void          getPartPosition       ( UInt partIdx, Int& xP, Int& yP, Int& nPSW, Int& nPSH);
592  Void          setMVPIdx             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx)  { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx;  }
593  Int           getMVPIdx             ( RefPicList eRefPicList, UInt uiIdx)               { return m_apiMVPIdx[eRefPicList][uiIdx];     }
594  Char*         getMVPIdx             ( RefPicList eRefPicList )                          { return m_apiMVPIdx[eRefPicList];            }
595
596  Void          setMVPNum             ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum;  }
597  Int           getMVPNum             ( RefPicList eRefPicList, UInt uiIdx )              { return m_apiMVPNum[eRefPicList][uiIdx];     }
598  Char*         getMVPNum             ( RefPicList eRefPicList )                          { return m_apiMVPNum[eRefPicList];            }
599 
600  Void          setMVPIdxSubParts     ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
601  Void          setMVPNumSubParts     ( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
602 
603  Void          clipMv                ( TComMv&     rcMv     );
604  Void          getMvPredLeft         ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldA.getMv(); }
605  Void          getMvPredAbove        ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldB.getMv(); }
606  Void          getMvPredAboveRight   ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldC.getMv(); }
607 
608  Void          compressMV            ();
609 
610  // -------------------------------------------------------------------------------------------------------------------
611  // utility functions for neighbouring information
612  // -------------------------------------------------------------------------------------------------------------------
613 
614  TComDataCU*   getCULeft                   () { return m_pcCULeft;       }
615  TComDataCU*   getCUAbove                  () { return m_pcCUAbove;      }
616  TComDataCU*   getCUAboveLeft              () { return m_pcCUAboveLeft;  }
617  TComDataCU*   getCUAboveRight             () { return m_pcCUAboveRight; }
618  TComDataCU*   getCUColocated              ( RefPicList eRefPicList ) { return m_apcCUColocated[eRefPicList]; }
619
620
621  TComDataCU*   getPULeft                   ( UInt&  uiLPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true
622                                            , Bool bEnforceTileRestriction=true 
623                                            );
624
625  TComDataCU*   getPUAbove                  ( UInt&  uiAPartUnitIdx , UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false
626                                            , Bool planarAtLCUBoundary = false 
627                                            , Bool bEnforceTileRestriction=true 
628                                            );
629
630  TComDataCU*   getPUAboveLeft              ( UInt&  uiALPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false );
631  TComDataCU*   getPUAboveRight             ( UInt&  uiARPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true, Bool MotionDataCompresssion = false );
632  TComDataCU*   getPUBelowLeft              ( UInt& uiBLPartUnitIdx, UInt uiCurrPartUnitIdx, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
633
634  TComDataCU*   getQpMinCuLeft              ( UInt&  uiLPartUnitIdx , UInt uiCurrAbsIdxInLCU, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
635  TComDataCU*   getQpMinCuAbove             ( UInt&  aPartUnitIdx , UInt currAbsIdxInLCU, Bool enforceSliceRestriction=true, Bool enforceEntropySliceRestriction=true );
636  Char          getRefQP                    ( UInt   uiCurrAbsIdxInLCU                       );
637
638  TComDataCU*   getPUAboveRightAdi          ( UInt&  uiARPartUnitIdx, UInt uiPuWidth, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
639  TComDataCU*   getPUBelowLeftAdi           ( UInt& uiBLPartUnitIdx, UInt uiPuHeight, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset = 1, Bool bEnforceSliceRestriction=true, Bool bEnforceEntropySliceRestriction=true );
640 
641  Void          deriveLeftRightTopIdx       ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
642  Void          deriveLeftBottomIdx         ( PartSize eCUMode, UInt uiPartIdx, UInt& ruiPartIdxLB );
643 
644  Void          deriveLeftRightTopIdxAdi    ( UInt& ruiPartIdxLT, UInt& ruiPartIdxRT, UInt uiPartOffset, UInt uiPartDepth );
645  Void          deriveLeftBottomIdxAdi      ( UInt& ruiPartIdxLB, UInt  uiPartOffset, UInt uiPartDepth );
646 
647  Bool          hasEqualMotion              ( UInt uiAbsPartIdx, TComDataCU* pcCandCU, UInt uiCandAbsPartIdx );
648#if MERL_VSP_C0152
649  Void          getInterMergeCandidates     ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int* uiVSPIndexTrue, Int mrgCandIdx = -1 );
650#else
651  Void          getInterMergeCandidates     ( UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours, Int& numValidMergeCand, Int mrgCandIdx = -1 );
652#endif
653  Void          deriveLeftRightTopIdxGeneral( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
654  Void          deriveLeftBottomIdxGeneral  ( PartSize eCUMode, UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLB );
655 
656 
657  // -------------------------------------------------------------------------------------------------------------------
658  // member functions for modes
659  // -------------------------------------------------------------------------------------------------------------------
660 
661  Bool          isIntra   ( UInt uiPartIdx )  { return m_pePredMode[ uiPartIdx ] == MODE_INTRA; }
662  Bool          isSkipped ( UInt uiPartIdx );                                                     ///< SKIP (no residual)
663 
664  // -------------------------------------------------------------------------------------------------------------------
665  // member functions for symbol prediction (most probable / mode conversion)
666  // -------------------------------------------------------------------------------------------------------------------
667 
668  UInt          getIntraSizeIdx                 ( UInt uiAbsPartIdx                                       );
669  Void          convertTransIdx                 ( UInt uiAbsPartIdx, UInt uiTrIdx, UInt& ruiLumaTrMode, UInt& ruiChromaTrMode );
670 
671  Void          getAllowedChromaDir             ( UInt uiAbsPartIdx, UInt* uiModeList );
672  Int           getIntraDirLumaPredictor        ( UInt uiAbsPartIdx, Int* uiIntraDirPred, Int* piMode = NULL );
673 
674  // -------------------------------------------------------------------------------------------------------------------
675  // member functions for SBAC context
676  // -------------------------------------------------------------------------------------------------------------------
677 
678  UInt          getCtxSplitFlag                 ( UInt   uiAbsPartIdx, UInt uiDepth                   );
679  UInt          getCtxQtCbf                     ( UInt   uiAbsPartIdx, TextType eType, UInt uiTrDepth );
680
681  UInt          getCtxSkipFlag                  ( UInt   uiAbsPartIdx                                 );
682#if LGE_ILLUCOMP_B0045
683  UInt          getCtxICFlag                    ( UInt   uiAbsPartIdx                                 );
684#endif
685  UInt          getCtxInterDir                  ( UInt   uiAbsPartIdx                                 );
686
687#if H3D_IVRP
688  UInt          getCtxResPredFlag               ( UInt   uiAbsPartIdx                                 );
689#endif
690 
691  UInt          getSliceStartCU         ( UInt pos )                  { return m_uiSliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
692  UInt          getEntropySliceStartCU  ( UInt pos )                  { return m_uiEntropySliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
693  UInt&         getTotalBins            ()                            { return m_uiTotalBins;                                                                                                  }
694
695#if LGE_EDGE_INTRA_A0070
696  UInt          getCtxEdgeIntra ( UInt uiAbsPartIdx );
697#endif
698
699  // -------------------------------------------------------------------------------------------------------------------
700  // member functions for RD cost storage
701  // -------------------------------------------------------------------------------------------------------------------
702 
703  Double&       getTotalCost()                  { return m_dTotalCost;        }
704  Dist&         getTotalDistortion()            { return m_uiTotalDistortion; }
705  UInt&         getTotalBits()                  { return m_uiTotalBits;       }
706  UInt&         getTotalNumPart()               { return m_uiNumPartition;    }
707
708  UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
709
710  Bool          useNonSquareTrans( UInt uiTrMode, Int absPartIdx );
711  Void          getNSQTSize(Int trMode, Int absPartIdx, Int &trWidth, Int &trHeight);
712  Bool          useNonSquarePU   ( UInt absPartIdx);
713  UInt          getInterTUSplitDirection ( Int width, Int height, Int trLastWidth, Int trLastHeight );
714  UInt          getNSAbsPartIdx  ( UInt log2TrafoSize, UInt absPartIdx, UInt absTUPartIdx, UInt innerQuadIdx, UInt trMode );
715  UInt          getNSAddrChroma   ( UInt uiLog2TrSizeC, UInt uiTrModeC, UInt uiQuadrant, UInt absTUPartIdx );
716 
717// -------------------------------------------------------------------------------------------------------------------
718  // member functions for depth model modes
719  // -------------------------------------------------------------------------------------------------------------------
720#if HHI_DMM_WEDGE_INTRA
721  UInt* getWedgeFullTabIdx                ()                      { return m_puiWedgeFullTabIdx;              }
722  UInt  getWedgeFullTabIdx                ( UInt uiIdx )          { return m_puiWedgeFullTabIdx[uiIdx];       }
723  Void  setWedgeFullTabIdx                ( UInt uiIdx, UInt uh ) { m_puiWedgeFullTabIdx[uiIdx] = uh;         }
724  Void  setWedgeFullTabIdxSubParts        ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
725  Int*  getWedgeFullDeltaDC1              ()                      { return m_piWedgeFullDeltaDC1;             }
726  Int   getWedgeFullDeltaDC1              ( UInt uiIdx )          { return m_piWedgeFullDeltaDC1[uiIdx];      }
727  Void  setWedgeFullDeltaDC1              ( UInt uiIdx, Int i )   { m_piWedgeFullDeltaDC1[uiIdx] = i;         }
728  Void  setWedgeFullDeltaDC1SubParts      ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
729  Int*  getWedgeFullDeltaDC2              ()                      { return m_piWedgeFullDeltaDC2;             }
730  Int   getWedgeFullDeltaDC2              ( UInt uiIdx )          { return m_piWedgeFullDeltaDC2[uiIdx];      }
731  Void  setWedgeFullDeltaDC2              ( UInt uiIdx, Int i )   { m_piWedgeFullDeltaDC2[uiIdx] = i;         }
732  Void  setWedgeFullDeltaDC2SubParts      ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
733
734  UInt* getWedgePredDirTabIdx             ()                      { return m_puiWedgePredDirTabIdx;           }
735  UInt  getWedgePredDirTabIdx             ( UInt uiIdx )          { return m_puiWedgePredDirTabIdx[uiIdx];    }
736  Void  setWedgePredDirTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredDirTabIdx[uiIdx] = uh;      }
737  Void  setWedgePredDirTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
738  Int*  getWedgePredDirDeltaDC1           ()                      { return m_piWedgePredDirDeltaDC1;          }
739  Int   getWedgePredDirDeltaDC1           ( UInt uiIdx )          { return m_piWedgePredDirDeltaDC1[uiIdx];   }
740  Void  setWedgePredDirDeltaDC1           ( UInt uiIdx, Int i )   { m_piWedgePredDirDeltaDC1[uiIdx] = i;      }
741  Void  setWedgePredDirDeltaDC1SubParts   ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
742  Int*  getWedgePredDirDeltaDC2           ()                      { return m_piWedgePredDirDeltaDC2;          }
743  Int   getWedgePredDirDeltaDC2           ( UInt uiIdx )          { return m_piWedgePredDirDeltaDC2[uiIdx];   }
744  Void  setWedgePredDirDeltaDC2           ( UInt uiIdx, Int i )   { m_piWedgePredDirDeltaDC2[uiIdx] = i;      }
745  Void  setWedgePredDirDeltaDC2SubParts   ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
746  Int*  getWedgePredDirDeltaEnd           ()                      { return m_piWedgePredDirDeltaEnd;          }
747  Int   getWedgePredDirDeltaEnd           ( UInt uiIdx )          { return m_piWedgePredDirDeltaEnd[uiIdx];   }
748  Void  setWedgePredDirDeltaEnd           ( UInt uiIdx, Int iD )  { m_piWedgePredDirDeltaEnd[uiIdx] = iD;     }
749  Void  setWedgePredDirDeltaEndSubParts   ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );
750#endif
751#if HHI_DMM_PRED_TEX
752  UInt* getWedgePredTexTabIdx             ()                      { return m_puiWedgePredTexTabIdx;           }
753  UInt  getWedgePredTexTabIdx             ( UInt uiIdx )          { return m_puiWedgePredTexTabIdx[uiIdx];    }
754  Void  setWedgePredTexTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredTexTabIdx[uiIdx] = uh;      }
755  Void  setWedgePredTexTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
756#if LGE_DMM3_SIMP_C0044
757  UInt* getWedgePredTexIntraTabIdx             ()                      { return m_puiWedgePredTexIntraTabIdx;           }
758  UInt  getWedgePredTexIntraTabIdx             ( UInt uiIdx )          { return m_puiWedgePredTexIntraTabIdx[uiIdx];    }
759  Void  setWedgePredTexIntraTabIdx             ( UInt uiIdx, UInt uh ) { m_puiWedgePredTexIntraTabIdx[uiIdx] = uh;      }
760  Void  setWedgePredTexIntraTabIdxSubParts     ( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth );
761#endif
762  Int*  getWedgePredTexDeltaDC1           ()                      { return m_piWedgePredTexDeltaDC1;          }
763  Int   getWedgePredTexDeltaDC1           ( UInt uiIdx )          { return m_piWedgePredTexDeltaDC1[uiIdx];   }
764  Void  setWedgePredTexDeltaDC1           ( UInt uiIdx, Int i )   { m_piWedgePredTexDeltaDC1[uiIdx] = i;      }
765  Void  setWedgePredTexDeltaDC1SubParts   ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
766  Int*  getWedgePredTexDeltaDC2           ()                      { return m_piWedgePredTexDeltaDC2;          }
767  Int   getWedgePredTexDeltaDC2           ( UInt uiIdx )          { return m_piWedgePredTexDeltaDC2[uiIdx];   }
768  Void  setWedgePredTexDeltaDC2           ( UInt uiIdx, Int i )   { m_piWedgePredTexDeltaDC2[uiIdx] = i;      }
769  Void  setWedgePredTexDeltaDC2SubParts   ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
770
771  Int*  getContourPredTexDeltaDC1         ()                      { return m_piContourPredTexDeltaDC1;        }
772  Int   getContourPredTexDeltaDC1         ( UInt uiIdx )          { return m_piContourPredTexDeltaDC1[uiIdx]; }
773  Void  setContourPredTexDeltaDC1         ( UInt uiIdx, Int i )   { m_piContourPredTexDeltaDC1[uiIdx] = i;    }
774  Void  setContourPredTexDeltaDC1SubParts ( Int iDC1, UInt uiAbsPartIdx, UInt uiDepth );
775  Int*  getContourPredTexDeltaDC2         ()                      { return m_piContourPredTexDeltaDC2;        }
776  Int   getContourPredTexDeltaDC2         ( UInt uiIdx )          { return m_piContourPredTexDeltaDC2[uiIdx]; }
777  Void  setContourPredTexDeltaDC2         ( UInt uiIdx, Int i )   { m_piContourPredTexDeltaDC2[uiIdx] = i;    }
778  Void  setContourPredTexDeltaDC2SubParts ( Int iDC2, UInt uiAbsPartIdx, UInt uiDepth );
779#endif
780
781#if LGE_EDGE_INTRA_A0070
782  UChar*        getEdgeCode( UInt uiIdx )                 { return &m_pucEdgeCode[uiIdx * LGE_EDGE_INTRA_MAX_EDGE_NUM_PER_4x4]; }
783  UChar*        getEdgeNumber( )                          { return m_pucEdgeNumber;           }
784  UChar         getEdgeNumber( UInt uiIdx )               { return m_pucEdgeNumber[uiIdx];    }
785  Void          setEdgeNumber( UInt uiIdx, UChar val )    { m_pucEdgeNumber[uiIdx] = val;     }
786  UChar*        getEdgeStartPos( )                        { return m_pucEdgeStartPos;         }
787  UChar         getEdgeStartPos( UInt uiIdx )             { return m_pucEdgeStartPos[uiIdx];  }
788  Void          setEdgeStartPos( UInt uiIdx, UChar val )  { m_pucEdgeStartPos[uiIdx] = val;   }
789  Bool*         getEdgeLeftFirst( )                       { return m_pbEdgeLeftFirst;         }
790  Bool          getEdgeLeftFirst( UInt uiIdx )            { return m_pbEdgeLeftFirst[uiIdx];  }
791  Void          setEdgeLeftFirst( UInt uiIdx, Bool val )  { m_pbEdgeLeftFirst[uiIdx] = val;   }
792  Bool*         getEdgePartition( UInt uiIdx )              { return &m_pbEdgePartition[uiIdx * 16]; }
793  Void          reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion );
794
795#if LGE_EDGE_INTRA_DELTA_DC
796  Int*          getEdgeDeltaDC0( )                          { return m_piEdgeDeltaDC0; }
797  Int*          getEdgeDeltaDC1( )                          { return m_piEdgeDeltaDC1; }
798  Int           getEdgeDeltaDC0( UInt uiIdx )               { return m_piEdgeDeltaDC0[uiIdx]; }
799  Int           getEdgeDeltaDC1( UInt uiIdx )               { return m_piEdgeDeltaDC1[uiIdx]; }
800  Void          setEdgeDeltaDC0( UInt uiIdx, Int val )      { m_piEdgeDeltaDC0[uiIdx] = val;  }
801  Void          setEdgeDeltaDC1( UInt uiIdx, Int val )      { m_piEdgeDeltaDC1[uiIdx] = val;  }
802#endif
803#endif
804 
805#if RWTH_SDC_DLT_B0036
806  Bool*         getSDCFlag          ()                        { return m_pbSDCFlag;               }
807  Bool          getSDCFlag          ( UInt uiIdx )            { return m_pbSDCFlag[uiIdx];        }
808  Void          setSDCFlagSubParts  ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
809 
810  UInt          getCtxSDCFlag              ( UInt uiAbsPartIdx );
811 
812  Bool          getSDCAvailable             ( UInt uiAbsPartIdx );
813 
814  Pel*          getSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentDCOffset[uiSeg]; }
815  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
816  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
817 
818
819#endif
820};
821
822namespace RasterAddress
823{
824  /** Check whether 2 addresses point to the same column
825   * \param addrA          First address in raster scan order
826   * \param addrB          Second address in raters scan order
827   * \param numUnitsPerRow Number of units in a row
828   * \return Result of test
829   */
830  static inline Bool isEqualCol( Int addrA, Int addrB, Int numUnitsPerRow )
831  {
832    // addrA % numUnitsPerRow == addrB % numUnitsPerRow
833    return (( addrA ^ addrB ) &  ( numUnitsPerRow - 1 ) ) == 0;
834  }
835 
836  /** Check whether 2 addresses point to the same row
837   * \param addrA          First address in raster scan order
838   * \param addrB          Second address in raters scan order
839   * \param numUnitsPerRow Number of units in a row
840   * \return Result of test
841   */
842  static inline Bool isEqualRow( Int addrA, Int addrB, Int numUnitsPerRow )
843  {
844    // addrA / numUnitsPerRow == addrB / numUnitsPerRow
845    return (( addrA ^ addrB ) &~ ( numUnitsPerRow - 1 ) ) == 0;
846  }
847 
848  /** Check whether 2 addresses point to the same row or column
849   * \param addrA          First address in raster scan order
850   * \param addrB          Second address in raters scan order
851   * \param numUnitsPerRow Number of units in a row
852   * \return Result of test
853   */
854  static inline Bool isEqualRowOrCol( Int addrA, Int addrB, Int numUnitsPerRow )
855  {
856    return isEqualCol( addrA, addrB, numUnitsPerRow ) | isEqualRow( addrA, addrB, numUnitsPerRow );
857  }
858 
859  /** Check whether one address points to the first column
860   * \param addr           Address in raster scan order
861   * \param numUnitsPerRow Number of units in a row
862   * \return Result of test
863   */
864  static inline Bool isZeroCol( Int addr, Int numUnitsPerRow )
865  {
866    // addr % numUnitsPerRow == 0
867    return ( addr & ( numUnitsPerRow - 1 ) ) == 0;
868  }
869 
870  /** Check whether one address points to the first row
871   * \param addr           Address in raster scan order
872   * \param numUnitsPerRow Number of units in a row
873   * \return Result of test
874   */
875  static inline Bool isZeroRow( Int addr, Int numUnitsPerRow )
876  {
877    // addr / numUnitsPerRow == 0
878    return ( addr &~ ( numUnitsPerRow - 1 ) ) == 0;
879  }
880 
881  /** Check whether one address points to a column whose index is smaller than a given value
882   * \param addr           Address in raster scan order
883   * \param val            Given column index value
884   * \param numUnitsPerRow Number of units in a row
885   * \return Result of test
886   */
887  static inline Bool lessThanCol( Int addr, Int val, Int numUnitsPerRow )
888  {
889    // addr % numUnitsPerRow < val
890    return ( addr & ( numUnitsPerRow - 1 ) ) < val;
891  }
892 
893  /** Check whether one address points to a row whose index is smaller than a given value
894   * \param addr           Address in raster scan order
895   * \param val            Given row index value
896   * \param numUnitsPerRow Number of units in a row
897   * \return Result of test
898   */
899  static inline Bool lessThanRow( Int addr, Int val, Int numUnitsPerRow )
900  {
901    // addr / numUnitsPerRow < val
902    return addr < val * numUnitsPerRow;
903  }
904};
905
906//! \}
907
908#endif
Note: See TracBrowser for help on using the repository browser.