source: 3DVCSoftware/branches/HTM-13.1-dev0/source/Lib/TLibCommon/TComDataCU.h @ 1175

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

Added direct dependency type for qtl.
Updated cfg files.
updated copy right headers.

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