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

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

Merged HTM-10.0-dev0@871. (MV-HEVC 7 HLS)

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