source: 3DVCSoftware/branches/HTM-9.3-dev1-RWTH/source/Lib/TLibCommon/TComDataCU.h @ 831

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