source: 3DVCSoftware/branches/HTM-5.0-Nokia/source/Lib/TLibCommon/TComSlice.h @ 200

Last change on this file since 200 was 200, checked in by nokia, 12 years ago

Reintegration of Flexible Coding Order to 3DV-HTM v5.1
To enable following params are required:
FCO : 1
FCOCodingOrder : T0D0D1D2T1T2
VSOConfig: [ox0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][ox2 B(cc1) I(s1.25 s1.5 s1.75)]

  • Property svn:eol-style set to native
File size: 80.2 KB
Line 
1/* The copyright in this software is being made available under the BSD
2 * License, included below. This software may be subject to other third party
3 * and contributor rights, including patent rights, and no such rights are
4 * granted under this license. 
5 *
6 * Copyright (c) 2010-2012, ITU/ISO/IEC
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 *  * Redistributions of source code must retain the above copyright notice,
13 *    this list of conditions and the following disclaimer.
14 *  * Redistributions in binary form must reproduce the above copyright notice,
15 *    this list of conditions and the following disclaimer in the documentation
16 *    and/or other materials provided with the distribution.
17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
18 *    be used to endorse or promote products derived from this software without
19 *    specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34/** \file     TComSlice.h
35    \brief    slice header and SPS class (header)
36*/
37
38#ifndef __TCOMSLICE__
39#define __TCOMSLICE__
40
41#include <cstring>
42#include <map>
43#include <vector>
44#include "CommonDef.h"
45#include "TComRom.h"
46#include "TComList.h"
47
48//! \ingroup TLibCommon
49//! \{
50
51class TComPic;
52class TComTrQuant;
53#if DEPTH_MAP_GENERATION
54class TComDepthMapGenerator;
55#endif
56#if HHI_INTER_VIEW_RESIDUAL_PRED
57class TComResidualGenerator;
58#endif
59// ====================================================================================================================
60// Constants
61// ====================================================================================================================
62
63/// max number of supported APS in software
64#define MAX_NUM_SUPPORTED_APS 1
65
66// ====================================================================================================================
67// Class definition
68// ====================================================================================================================
69
70#if RPS_IN_SPS
71/// Reference Picture Set class
72class TComReferencePictureSet
73{
74private:
75  Int  m_numberOfPictures;
76  Int  m_numberOfNegativePictures;
77  Int  m_numberOfPositivePictures;
78  Int  m_numberOfLongtermPictures;
79  Int  m_deltaPOC[MAX_NUM_REF_PICS];
80  Int  m_POC[MAX_NUM_REF_PICS];
81  Bool m_used[MAX_NUM_REF_PICS];
82  Bool m_interRPSPrediction;
83  Int  m_deltaRIdxMinus1;   
84  Int  m_deltaRPS; 
85  Int  m_numRefIdc; 
86  Int  m_refIdc[MAX_NUM_REF_PICS+1];
87
88public:
89  TComReferencePictureSet();
90  virtual ~TComReferencePictureSet();
91
92  Void setNumberOfPictures(Int numberOfPictures);
93  Int  getNumberOfPictures();
94  Void setNumberOfNegativePictures(Int number)  { m_numberOfNegativePictures = number; }
95  Int  getNumberOfNegativePictures()            { return m_numberOfNegativePictures; }
96  Void setNumberOfPositivePictures(Int number)  { m_numberOfPositivePictures = number; }
97  Int  getNumberOfPositivePictures()            { return m_numberOfPositivePictures; }
98  Void setNumberOfLongtermPictures(Int number)  { m_numberOfLongtermPictures = number; }
99  Int  getNumberOfLongtermPictures()            { return m_numberOfLongtermPictures; }
100
101  Void setDeltaPOC(Int bufferNum, Int deltaPOC);
102  Int  getDeltaPOC(Int bufferNum);
103  Void setPOC(Int bufferNum, Int deltaPOC);
104  Int  getPOC(Int bufferNum);
105
106  Void setUsed(Int bufferNum, Bool used);
107  Int  getUsed(Int bufferNum);
108
109  Void setInterRPSPrediction(Bool flag)         { m_interRPSPrediction = flag; }
110  Bool getInterRPSPrediction()                  { return m_interRPSPrediction; }
111  Void setDeltaRIdxMinus1(Int x)                { m_deltaRIdxMinus1 = x; }
112  Int  getDeltaRIdxMinus1()                     { return m_deltaRIdxMinus1; }
113  Void setDeltaRPS(Int x)                       { m_deltaRPS = x; }
114  Int  getDeltaRPS()                            { return m_deltaRPS; }
115  Void setNumRefIdc(Int x)                      { m_numRefIdc = x; }
116  Int  getNumRefIdc()                           { return m_numRefIdc; }
117
118  Void setRefIdc(Int bufferNum, Int refIdc);
119  Int  getRefIdc(Int bufferNum);
120
121  Void sortDeltaPOC();
122  Void printDeltaPOC();
123};
124
125/// Reference Picture Set set class
126class TComRPSList
127{
128private:
129  Int  m_numberOfReferencePictureSets;
130  TComReferencePictureSet* m_referencePictureSets;
131 
132public:
133  TComRPSList();
134  virtual ~TComRPSList();
135 
136  Void  create  (Int numberOfEntries);
137  Void  destroy ();
138
139
140  TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum);
141  Int getNumberOfReferencePictureSets();
142  Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets);
143};
144#endif
145
146#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
147/// VPS class
148
149class TComVPS
150{
151private:
152  Int         m_VPSId;
153  UInt        m_uiMaxTLayers;
154  UInt        m_uiMaxLayers;
155  Bool        m_bTemporalIdNestingFlag;
156
157  UInt        m_uiExtensionType;
158#if !QC_MVHEVC_B0046 
159  Bool        m_bDependentFlag[MAX_LAYER_NUM];
160#else
161  UInt        m_uiNumHRDParameter;
162  UInt        m_numAddiLayerOperationPoints;
163  UInt        m_numAddiProLevelSets;
164  UInt        m_numDirectRefLayer[MAX_LAYER_NUM];
165  UInt        m_numDirectRefID[MAX_LAYER_NUM][MAX_LAYER_NUM];
166  UInt        m_numOpLayerIdMinus1[MAX_LAYER_NUM];
167  UInt        m_numOpLayerId[MAX_LAYER_NUM][MAX_LAYER_NUM];
168#endif
169  UInt        m_uiViewId[MAX_LAYER_NUM];
170#if !QC_MVHEVC_B0046 
171  Bool        m_bDepthFlag[MAX_LAYER_NUM];
172#endif
173  Int         m_iViewOrderIdx[MAX_LAYER_NUM];
174#if !QC_MVHEVC_B0046 
175  UInt        m_uiDependentLayer[MAX_LAYER_NUM];
176#endif
177
178  UInt        m_numReorderPics[MAX_TLAYER];
179  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER]; 
180  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
181 
182public:
183  TComVPS();
184  virtual ~TComVPS();
185 
186  Int     getVPSId       ()                   { return m_VPSId;          }
187  Void    setVPSId       (Int i)              { m_VPSId = i;             }
188 
189  UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
190  Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
191   
192  UInt    getMaxLayers   ()                   { return m_uiMaxLayers;   }
193  Void    setMaxLayers   (UInt l)             { m_uiMaxLayers = l; }
194 
195  Bool    getTemporalNestingFlag   ()         { return m_uiMaxLayers;   }
196  Void    setTemporalNestingFlag   (UInt t)   { m_bTemporalIdNestingFlag = t; }
197#if !QC_MVHEVC_B0046
198  Void    setExtensionType(UInt v)                     { m_uiExtensionType = v;    }
199  UInt    getExtensionType()                             { return m_uiExtensionType; }
200 
201  Void    setDependentFlag(Bool d, UInt layer)              { m_bDependentFlag[layer] = d;    }
202  Bool    getDependentFlag(UInt layer)                      { return m_bDependentFlag[layer]; }
203#endif
204  Void    setViewId(UInt v, UInt layer)                     { m_uiViewId[layer] = v;    }
205  UInt    getViewId(UInt layer)                             { return m_uiViewId[layer]; }
206#if !QC_MVHEVC_B0046
207  Void    setDepthFlag(Bool d, UInt layer)                  { m_bDepthFlag[layer] = d;    }
208  Bool    getDepthFlag(UInt layer)                          { return m_bDepthFlag[layer]; }
209#endif
210  Void    setViewOrderIdx(Int v, UInt layer)                { m_iViewOrderIdx[layer] = v;    }
211  Int     getViewOrderIdx(UInt layer)                       { return m_iViewOrderIdx[layer]; }
212#if !QC_MVHEVC_B0046   
213  Void    setDependentLayer(UInt v, UInt layer)                     { m_uiDependentLayer[layer] = v;    }
214  UInt    getDependentLayer(UInt layer)                             { return m_uiDependentLayer[layer]; }
215#endif
216  Void    setNumReorderPics(UInt v, UInt tLayer)                { m_numReorderPics[tLayer] = v;    }
217  UInt    getNumReorderPics(UInt tLayer)                        { return m_numReorderPics[tLayer]; }
218 
219  Void    setMaxDecPicBuffering(UInt v, UInt tLayer)          { m_uiMaxDecPicBuffering[tLayer] = v;    }
220  UInt    getMaxDecPicBuffering(UInt tLayer)                  { return m_uiMaxDecPicBuffering[tLayer]; }
221 
222  Void    setMaxLatencyIncrease(UInt v, UInt tLayer)                { m_uiMaxLatencyIncrease[tLayer] = v;    }
223  UInt    getMaxLatencyIncrease(UInt tLayer)                        { return m_uiMaxLatencyIncrease[tLayer]; }
224#if QC_MVHEVC_B0046
225  Void    setNumHRDParameters(UInt n)                                { m_uiNumHRDParameter = n;    }
226  UInt    getNumHRDParameters()                                      { return m_uiNumHRDParameter; }
227  Void    setNumDirectRefLayer(UInt n, UInt layer)                   { m_numDirectRefLayer[layer] = n;        };
228  UInt    getNumDirectRefLayer(UInt layer)                           { return m_numDirectRefLayer[layer];     };
229  Void    setDirectRefLayerId (UInt n, UInt layer, UInt refId)       { m_numDirectRefID[layer][refId] = n;   assert(refId < MAX_NUM_REF ); };
230  UInt    getDirectRefLayerId (        UInt layer, UInt refId)       { return m_numDirectRefID[layer][refId]; };
231  UInt    getNumAddiLayerOperationPoints(      )               { return m_numAddiLayerOperationPoints;  };
232  Void    setNumAddiLayerOperationPoints(UInt n)                {  m_numAddiLayerOperationPoints = n;  };
233  Void    setNumAddiProLevelSets        (UInt n)                     {  m_numAddiProLevelSets = n;}
234  UInt    getNumAddiProLevelSets        (      )                     { return m_numAddiProLevelSets;}
235
236  Void    setNumOpLayerIdMinus1         (UInt n, UInt layer)                     {  m_numOpLayerIdMinus1[layer] = n;}
237  UInt    getNumOpLayerIdMinus1         (UInt layer      )                       { return m_numOpLayerIdMinus1[layer];}
238
239  Void    setNumOpLayerId               (UInt n, UInt layer, UInt OpId)                     {  m_numOpLayerId[layer][OpId] = n;}
240  UInt    getNumOpLayerId               (UInt layer, UInt OpId        )                     { return m_numOpLayerId[layer][OpId];}
241
242#endif
243};
244
245#endif
246
247/// SPS class
248class TComSPS
249{
250private:
251#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
252  Int          m_VPSId;
253#endif
254  Int         m_SPSId;
255  Int         m_ProfileIdc;
256  Int         m_LevelIdc;
257  Int         m_chromaFormatIdc;
258
259  UInt        m_uiMaxTLayers;           // maximum number of temporal layers
260
261  UInt        m_uiViewId;
262  Int         m_iViewOrderIdx;
263  Bool        m_bDepth;
264  UInt        m_uiCamParPrecision;
265  Bool        m_bCamParInSliceHeader;
266  Int         m_aaiCodedScale [2][MAX_VIEW_NUM];
267  Int         m_aaiCodedOffset[2][MAX_VIEW_NUM];
268
269  // Structure
270  UInt        m_picWidthInLumaSamples;
271  UInt        m_picHeightInLumaSamples;
272#if PIC_CROPPING
273  Bool        m_picCroppingFlag;
274  Int         m_picCropLeftOffset;
275  Int         m_picCropRightOffset;
276  Int         m_picCropTopOffset;
277  Int         m_picCropBottomOffset;
278#else
279  Int         m_aiPad[2];
280#endif
281  UInt        m_uiMaxCUWidth;
282  UInt        m_uiMaxCUHeight;
283  UInt        m_uiMaxCUDepth;
284  UInt        m_uiMinTrDepth;
285  UInt        m_uiMaxTrDepth;
286#if RPS_IN_SPS
287  TComRPSList* m_RPSList;
288  Bool        m_bLongTermRefsPresent;
289#endif
290#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
291  Int         m_numReorderPics[MAX_TLAYER];
292#else
293  Int         m_maxNumberOfReferencePictures;
294  Int         m_numReorderFrames;
295#endif
296 
297  Int         m_iNumberOfUsableInterViewRefs;
298  Int         m_aiUsableInterViewRefs[MAX_VIEW_NUM];
299
300  // Tool list
301  UInt        m_uiQuadtreeTULog2MaxSize;
302  UInt        m_uiQuadtreeTULog2MinSize;
303  UInt        m_uiQuadtreeTUMaxDepthInter;
304  UInt        m_uiQuadtreeTUMaxDepthIntra;
305  Bool        m_usePCM;
306  UInt        m_pcmLog2MaxSize;
307  UInt        m_uiPCMLog2MinSize;
308  Bool        m_bDisInter4x4;
309  Bool        m_useAMP;
310  Bool        m_bUseALF;
311#if LCU_SYNTAX_ALF
312  Bool        m_bALFCoefInSlice;
313#endif
314#if !PIC_CROPPING
315  Bool        m_bUsePAD;
316#endif
317  Bool        m_bUseLMChroma; // JL:
318
319  Bool        m_bUseLComb;
320  Bool        m_bLCMod;
321  Bool        m_useNSQT;
322 
323#if H0412_REF_PIC_LIST_RESTRICTION
324  Bool        m_restrictedRefPicListsFlag;
325  Bool        m_listsModificationPresentFlag;
326#endif
327
328  // Parameter
329  AMVP_MODE   m_aeAMVPMode[MAX_CU_DEPTH];
330  UInt        m_uiBitDepth;
331  UInt        m_uiBitIncrement;
332#if H0736_AVC_STYLE_QP_RANGE
333  Int         m_qpBDOffsetY;
334  Int         m_qpBDOffsetC;
335#endif
336
337#if LOSSLESS_CODING
338  Bool        m_useLossless;
339#endif
340
341  UInt        m_uiPCMBitDepthLuma;
342  UInt        m_uiPCMBitDepthChroma;
343  Bool        m_bPCMFilterDisableFlag;
344
345  UInt        m_uiBitsForPOC;
346  // Max physical transform size
347  UInt        m_uiMaxTrSize;
348 
349  Int m_iAMPAcc[MAX_CU_DEPTH];
350
351  Bool        m_bLFCrossSliceBoundaryFlag;
352  Bool        m_bUseSAO; 
353#if HHI_MPI
354  Bool        m_bUseMVI;
355#endif
356 
357#if RWTH_SDC_DLT_B0036
358  Bool        m_bUseDLT;
359 
360  UInt        m_uiBitsPerDepthValue;
361  UInt        m_uiNumDepthmapValues;
362  UInt*       m_uiDepthValue2Idx;
363  UInt*       m_uiIdx2DepthValue;
364#endif
365
366  Bool     m_bLFCrossTileBoundaryFlag;
367  Int      m_iUniformSpacingIdr;
368  Int      m_iTileBoundaryIndependenceIdr;
369  Int      m_iNumColumnsMinus1;
370  UInt*    m_puiColumnWidth;
371  Int      m_iNumRowsMinus1;
372  UInt*    m_puiRowHeight;
373 
374  Bool        m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
375
376  Bool        m_scalingListEnabledFlag;
377#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
378  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER]; 
379  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
380#else
381  UInt        m_uiMaxDecFrameBuffering; 
382  UInt        m_uiMaxLatencyIncrease;
383#endif
384
385  Bool        m_useDF;
386
387#if TILES_WPP_ENTRY_POINT_SIGNALLING
388  UInt        m_tilesOrEntropyCodingSyncIdc;
389  Int         m_numSubstreams;
390#endif
391
392#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
393  Bool  m_bUseDMM;
394#endif
395
396#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
397  Bool  m_bUseDMM34;
398#endif
399
400#if OL_QTLIMIT_PREDCODING_B0068
401  Bool m_bUseQTLPC;
402#endif
403
404#if DEPTH_MAP_GENERATION
405  UInt  m_uiPredDepthMapGeneration;
406  UInt  m_uiPdmPrecision;
407  Int   m_aiPdmScaleNomDelta[MAX_VIEW_NUM];
408  Int   m_aiPdmOffset       [MAX_VIEW_NUM];
409#endif
410
411#if HHI_INTER_VIEW_MOTION_PRED
412  UInt  m_uiMultiviewMvPredMode;
413#endif
414#if HHI_INTER_VIEW_RESIDUAL_PRED
415  UInt  m_uiMultiviewResPredMode;
416#endif
417
418#if DEPTH_MAP_GENERATION
419  TComDepthMapGenerator* m_pcDepthMapGenerator;
420#endif
421#if HHI_INTER_VIEW_RESIDUAL_PRED
422  TComResidualGenerator* m_pcResidualGenerator;
423#endif
424
425public:
426  TComSPS();
427  virtual ~TComSPS();
428#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
429  Int  getVPSId       ()         { return m_VPSId;          }
430  Void setVPSId       (Int i)    { m_VPSId = i;             }
431#endif
432  Int  getSPSId       ()         { return m_SPSId;          }
433  Void setSPSId       (Int i)    { m_SPSId = i;             }
434  Int  getProfileIdc  ()         { return m_ProfileIdc;     }
435  Void setProfileIdc  (Int i)    { m_ProfileIdc = i;        }
436  Int  getLevelIdc    ()         { return m_LevelIdc;       }
437  Void setLevelIdc    (Int i)    { m_LevelIdc = i;          }
438
439  Int  getChromaFormatIdc ()         { return m_chromaFormatIdc;       }
440  Void setChromaFormatIdc (Int i)    { m_chromaFormatIdc = i;          }
441 
442  // structure
443  Void setPicWidthInLumaSamples       ( UInt u ) { m_picWidthInLumaSamples = u;        }
444  UInt getPicWidthInLumaSamples       ()         { return  m_picWidthInLumaSamples;    }
445  Void setPicHeightInLumaSamples      ( UInt u ) { m_picHeightInLumaSamples = u;       }
446  UInt getPicHeightInLumaSamples      ()         { return  m_picHeightInLumaSamples;   }
447
448#if PIC_CROPPING
449  Bool getPicCroppingFlag() const          { return m_picCroppingFlag; }
450  Void setPicCroppingFlag(Bool val)        { m_picCroppingFlag = val; }
451  Int  getPicCropLeftOffset() const        { return m_picCropLeftOffset; }
452  Void setPicCropLeftOffset(Int val)       { m_picCropLeftOffset = val; }
453  Int  getPicCropRightOffset() const       { return m_picCropRightOffset; }
454  Void setPicCropRightOffset(Int val)      { m_picCropRightOffset = val; }
455  Int  getPicCropTopOffset() const         { return m_picCropTopOffset; }
456  Void setPicCropTopOffset(Int val)        { m_picCropTopOffset = val; }
457  Int  getPicCropBottomOffset() const      { return m_picCropBottomOffset; }
458  Void setPicCropBottomOffset(Int val)     { m_picCropBottomOffset = val; }
459#endif
460
461  Void setMaxCUWidth  ( UInt u ) { m_uiMaxCUWidth = u;      }
462  UInt getMaxCUWidth  ()         { return  m_uiMaxCUWidth;  }
463  Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u;     }
464  UInt getMaxCUHeight ()         { return  m_uiMaxCUHeight; }
465  Void setMaxCUDepth  ( UInt u ) { m_uiMaxCUDepth = u;      }
466  UInt getMaxCUDepth  ()         { return  m_uiMaxCUDepth;  }
467  Void setUsePCM      ( Bool b ) { m_usePCM = b;           }
468  Bool getUsePCM      ()         { return m_usePCM;        }
469  Void setPCMLog2MaxSize  ( UInt u ) { m_pcmLog2MaxSize = u;      }
470  UInt getPCMLog2MaxSize  ()         { return  m_pcmLog2MaxSize;  }
471  Void setPCMLog2MinSize  ( UInt u ) { m_uiPCMLog2MinSize = u;      }
472  UInt getPCMLog2MinSize  ()         { return  m_uiPCMLog2MinSize;  }
473  Void setBitsForPOC  ( UInt u ) { m_uiBitsForPOC = u;      }
474  UInt getBitsForPOC  ()         { return m_uiBitsForPOC;   }
475  Bool getDisInter4x4()         { return m_bDisInter4x4;        }
476  Void setDisInter4x4      ( Bool b ) { m_bDisInter4x4  = b;          }
477  Bool getUseAMP() { return m_useAMP; }
478  Void setUseAMP( Bool b ) { m_useAMP = b; }
479  Void setMinTrDepth  ( UInt u ) { m_uiMinTrDepth = u;      }
480  UInt getMinTrDepth  ()         { return  m_uiMinTrDepth;  }
481  Void setMaxTrDepth  ( UInt u ) { m_uiMaxTrDepth = u;      }
482  UInt getMaxTrDepth  ()         { return  m_uiMaxTrDepth;  }
483  Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u;    }
484  UInt getQuadtreeTULog2MaxSize()         { return m_uiQuadtreeTULog2MaxSize; }
485  Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u;    }
486  UInt getQuadtreeTULog2MinSize()         { return m_uiQuadtreeTULog2MinSize; }
487  Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u;    }
488  Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u;    }
489  UInt getQuadtreeTUMaxDepthInter()         { return m_uiQuadtreeTUMaxDepthInter; }
490  UInt getQuadtreeTUMaxDepthIntra()         { return m_uiQuadtreeTUMaxDepthIntra; }
491#if !PIC_CROPPING
492  Void setPad         (Int iPad[2]) { m_aiPad[0] = iPad[0]; m_aiPad[1] = iPad[1]; }
493#endif
494#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
495  Void setNumReorderPics(Int i, UInt tlayer)              { m_numReorderPics[tlayer] = i;    }
496  Int  getNumReorderPics(UInt tlayer)                     { return m_numReorderPics[tlayer]; }
497#else
498  Void setMaxNumberOfReferencePictures( Int u )  { m_maxNumberOfReferencePictures = u;    }
499  Int  getMaxNumberOfReferencePictures()         { return m_maxNumberOfReferencePictures; }
500  Void setNumReorderFrames( Int i )              { m_numReorderFrames = i;    }
501  Int  getNumReorderFrames()                     { return m_numReorderFrames; }
502#endif
503#if RPS_IN_SPS
504  Void      setRPSList( TComRPSList* RPSList )   { m_RPSList = RPSList;       }
505  TComRPSList* getRPSList()                      { return m_RPSList;          }
506  Bool      getLongTermRefsPresent()         { return m_bLongTermRefsPresent; }
507  Void      setLongTermRefsPresent(Bool b)   { m_bLongTermRefsPresent=b;      }
508#endif
509
510  Void setNumberOfUsableInterViewRefs( Int number )      { m_iNumberOfUsableInterViewRefs = number;    }
511  Int  getNumberOfUsableInterViewRefs()                  { return m_iNumberOfUsableInterViewRefs;      }
512  Void setUsableInterViewRef( Int pos, Int deltaViewId ) { m_aiUsableInterViewRefs[pos] = deltaViewId; }
513  Int  getUsableInterViewRef( Int pos )                  { return m_aiUsableInterViewRefs[pos];        }
514
515#if !PIC_CROPPING
516  Void setPadX        ( Int  u ) { m_aiPad[0] = u; }
517  Void setPadY        ( Int  u ) { m_aiPad[1] = u; }
518  Int  getPad         ( Int  u ) { assert(u < 2); return m_aiPad[u];}
519  Int* getPad         ( )        { return m_aiPad; }
520#endif
521 
522  // physical transform
523  Void setMaxTrSize   ( UInt u ) { m_uiMaxTrSize = u;       }
524  UInt getMaxTrSize   ()         { return  m_uiMaxTrSize;   }
525 
526  // Tool list
527  Bool getUseALF      ()         { return m_bUseALF;        }
528#if LCU_SYNTAX_ALF
529  Void setUseALFCoefInSlice(Bool b) {m_bALFCoefInSlice = b;}
530  Bool getUseALFCoefInSlice()    {return m_bALFCoefInSlice;}
531#endif
532
533#if !PIC_CROPPING
534  Bool getUsePAD      ()         { return m_bUsePAD;        }
535  Void setUsePAD      ( Bool b ) { m_bUsePAD   = b;         }
536#endif
537  Void setUseALF      ( Bool b ) { m_bUseALF  = b;          }
538  Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
539  Bool getUseLComb    ()         { return m_bUseLComb;      }
540  Void setLCMod       (Bool b)   { m_bLCMod = b;     }
541  Bool getLCMod       ()         { return m_bLCMod;  }
542
543  Bool getUseLMChroma ()         { return m_bUseLMChroma;        }
544  Void setUseLMChroma ( Bool b ) { m_bUseLMChroma  = b;          }
545
546#if LOSSLESS_CODING
547  Bool getUseLossless ()         { return m_useLossless; }
548  Void setUseLossless ( Bool b ) { m_useLossless  = b; }
549#endif
550  Bool getUseNSQT() { return m_useNSQT; }
551  Void setUseNSQT( Bool b ) { m_useNSQT = b; }
552 
553#if H0412_REF_PIC_LIST_RESTRICTION
554  Bool getRestrictedRefPicListsFlag    ()          { return m_restrictedRefPicListsFlag;   }
555  Void setRestrictedRefPicListsFlag    ( Bool b )  { m_restrictedRefPicListsFlag = b;      }
556  Bool getListsModificationPresentFlag ()          { return m_listsModificationPresentFlag; }
557  Void setListsModificationPresentFlag ( Bool b )  { m_listsModificationPresentFlag = b;    }
558#endif
559
560  // AMVP mode (for each depth)
561  AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth);  return m_aeAMVPMode[uiDepth]; }
562  Void      setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth);  m_aeAMVPMode[uiDepth] = eMode; }
563 
564  // AMP accuracy
565  Int       getAMPAcc   ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; }
566  Void      setAMPAcc   ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth);  m_iAMPAcc[uiDepth] = iAccu; }
567
568  // Bit-depth
569  UInt      getBitDepth     ()         { return m_uiBitDepth;     }
570  Void      setBitDepth     ( UInt u ) { m_uiBitDepth = u;        }
571  UInt      getBitIncrement ()         { return m_uiBitIncrement; }
572  Void      setBitIncrement ( UInt u ) { m_uiBitIncrement = u;    }
573#if H0736_AVC_STYLE_QP_RANGE
574  Int       getQpBDOffsetY  ()             { return m_qpBDOffsetY;   }
575  Void      setQpBDOffsetY  ( Int value  ) { m_qpBDOffsetY = value;  }
576  Int       getQpBDOffsetC  ()             { return m_qpBDOffsetC;   }
577  Void      setQpBDOffsetC  ( Int value  ) { m_qpBDOffsetC = value;  }
578#endif
579
580  Void      setLFCrossSliceBoundaryFlag     ( Bool   bValue  )    { m_bLFCrossSliceBoundaryFlag = bValue; }
581  Bool      getLFCrossSliceBoundaryFlag     ()                    { return m_bLFCrossSliceBoundaryFlag;   } 
582
583  Void setUseDF                   ( Bool b ) { m_useDF = b; }
584  Bool getUseDF                   ()         { return m_useDF; }
585
586  Void setUseSAO                  (Bool bVal)  {m_bUseSAO = bVal;}
587  Bool getUseSAO                  ()           {return m_bUseSAO;}
588
589#if HHI_MPI
590  Void setUseMVI                  (Bool bVal)  {m_bUseMVI = bVal;}
591  Bool getUseMVI                  ()           {return m_bUseMVI;}
592#endif
593 
594#if RWTH_SDC_DLT_B0036
595  Bool getUseDLT      ()          { return m_bUseDLT; }
596  Void setUseDLT      ( Bool b ) { m_bUseDLT  = b;          }
597 
598  UInt getBitsPerDepthValue()       { return m_bUseDLT?m_uiBitsPerDepthValue:g_uiBitDepth; }
599  UInt getNumDepthValues()          { return m_bUseDLT?m_uiNumDepthmapValues:g_uiIBDI_MAX; }
600  UInt depthValue2idx(Pel uiValue)  { return m_bUseDLT?m_uiDepthValue2Idx[uiValue]:uiValue; }
601  Pel  idx2DepthValue(UInt uiIdx)   { return m_bUseDLT?m_uiIdx2DepthValue[uiIdx]:uiIdx; }
602  Void setDepthLUTs   (UInt* uidx2DepthValue = NULL, UInt uiNumDepthValues = 0);
603#endif
604
605  UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
606  Void      setMaxTLayers( UInt uiMaxTLayers )        { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
607
608  Bool      getTemporalIdNestingFlag()                { return m_bTemporalIdNestingFlag; }
609  Void      setTemporalIdNestingFlag( Bool bValue )   { m_bTemporalIdNestingFlag = bValue; }
610  UInt      getPCMBitDepthLuma     ()         { return m_uiPCMBitDepthLuma;     }
611  Void      setPCMBitDepthLuma     ( UInt u ) { m_uiPCMBitDepthLuma = u;        }
612  UInt      getPCMBitDepthChroma   ()         { return m_uiPCMBitDepthChroma;   }
613  Void      setPCMBitDepthChroma   ( UInt u ) { m_uiPCMBitDepthChroma = u;      }
614  Void      setPCMFilterDisableFlag     ( Bool   bValue  )    { m_bPCMFilterDisableFlag = bValue; }
615  Bool      getPCMFilterDisableFlag     ()                    { return m_bPCMFilterDisableFlag;   } 
616
617  Void    setLFCrossTileBoundaryFlag               ( Bool   bValue  )    { m_bLFCrossTileBoundaryFlag = bValue; }
618  Bool    getLFCrossTileBoundaryFlag               ()                    { return m_bLFCrossTileBoundaryFlag;   }
619  Void     setUniformSpacingIdr             ( Int i )           { m_iUniformSpacingIdr = i; }
620  Int      getUniformSpacingIdr             ()                  { return m_iUniformSpacingIdr; }
621#if !REMOVE_TILE_DEPENDENCE
622  Void     setTileBoundaryIndependenceIdr   ( Int i )           { m_iTileBoundaryIndependenceIdr = i; }
623  Int      getTileBoundaryIndependenceIdr   ()                  { return m_iTileBoundaryIndependenceIdr; }
624#endif
625  Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
626  Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
627  Void     setColumnWidth ( UInt* columnWidth )
628  {
629    if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
630    {
631      m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
632
633      for(Int i=0; i<m_iNumColumnsMinus1; i++)
634      {
635        m_puiColumnWidth[i] = columnWidth[i];
636     }
637    }
638  }
639  UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
640  Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
641  Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
642  Void     setRowHeight    ( UInt* rowHeight )
643  {
644    if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
645    {
646      m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
647
648      for(Int i=0; i<m_iNumRowsMinus1; i++)
649      {
650        m_puiRowHeight[i] = rowHeight[i];
651      }
652    }
653  }
654  UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
655  Bool getScalingListFlag       ()         { return m_scalingListEnabledFlag;     }
656  Void setScalingListFlag       ( Bool b ) { m_scalingListEnabledFlag  = b;       }
657#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
658  UInt getMaxDecPicBuffering  (UInt tlayer)            { return m_uiMaxDecPicBuffering[tlayer]; }
659  Void setMaxDecPicBuffering  ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui;   }
660  UInt getMaxLatencyIncrease  (UInt tlayer)            { return m_uiMaxLatencyIncrease[tlayer];   }
661  Void setMaxLatencyIncrease  ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui;      }
662#else
663  UInt getMaxDecFrameBuffering  ()            { return m_uiMaxDecFrameBuffering; }
664  Void setMaxDecFrameBuffering  ( UInt ui )   { m_uiMaxDecFrameBuffering = ui;   }
665  UInt getMaxLatencyIncrease    ()            { return m_uiMaxLatencyIncrease;   }
666  Void setMaxLatencyIncrease    ( UInt ui )   { m_uiMaxLatencyIncrease= ui;      }
667#endif
668#if TILES_WPP_ENTRY_POINT_SIGNALLING
669  UInt getTilesOrEntropyCodingSyncIdc ()                    { return m_tilesOrEntropyCodingSyncIdc;   }
670  Void setTilesOrEntropyCodingSyncIdc ( UInt val )          { m_tilesOrEntropyCodingSyncIdc = val;    }
671  Int  getNumSubstreams               ()                    { return m_numSubstreams;                 }
672  Void setNumSubstreams               ( Int numSubstreams ) { m_numSubstreams = numSubstreams;        }
673#endif
674
675#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
676  Bool getUseDMM()         { return m_bUseDMM; }
677  Void setUseDMM( Bool b ) { m_bUseDMM = b;    }
678#endif
679
680#if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
681  Bool getUseDMM34()         { return m_bUseDMM34; }
682  Void setUseDMM34( Bool b ) { m_bUseDMM34 = b;    }
683#endif
684
685#if OL_QTLIMIT_PREDCODING_B0068
686  Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b;    }
687  Bool getUseQTLPC()         { return m_bUseQTLPC; }
688#endif
689
690  Void initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
691  Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
692
693  UInt getViewId             ()  { return m_uiViewId; }
694  Int  getViewOrderIdx       ()  { return m_iViewOrderIdx; }
695  Bool isDepth               ()  { return m_bDepth; }
696  UInt getCamParPrecision    ()  { return m_uiCamParPrecision; }
697  Bool hasCamParInSliceHeader()  { return m_bCamParInSliceHeader; }
698  Int* getCodedScale         ()  { return m_aaiCodedScale [0]; }
699  Int* getCodedOffset        ()  { return m_aaiCodedOffset[0]; }
700  Int* getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
701  Int* getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
702
703
704#if DEPTH_MAP_GENERATION
705  Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 );
706#endif
707#if HHI_INTER_VIEW_RESIDUAL_PRED
708  Void  setMultiviewResPredMode  ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; }
709#endif
710
711#if DEPTH_MAP_GENERATION
712  UInt getPredDepthMapGeneration()          { return m_uiPredDepthMapGeneration; }
713  UInt getPdmPrecision          ()          { return m_uiPdmPrecision;           }
714  Int* getPdmScaleNomDelta      ()          { return m_aiPdmScaleNomDelta;       }
715  Int* getPdmOffset             ()          { return m_aiPdmOffset;              }
716#endif
717
718#if HHI_INTER_VIEW_MOTION_PRED
719  UInt  getMultiviewMvPredMode   ()          { return m_uiMultiviewMvPredMode;    }
720#endif
721#if HHI_INTER_VIEW_RESIDUAL_PRED
722  UInt  getMultiviewResPredMode  ()          { return m_uiMultiviewResPredMode;   }
723#endif
724
725#if DEPTH_MAP_GENERATION
726  Void                    setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator )  { m_pcDepthMapGenerator = pcDepthMapGenerator; }
727  TComDepthMapGenerator*  getDepthMapGenerator()                                              { return m_pcDepthMapGenerator; }
728#endif
729#if HHI_INTER_VIEW_RESIDUAL_PRED
730  Void                    setResidualGenerator( TComResidualGenerator* pcResidualGenerator )  { m_pcResidualGenerator = pcResidualGenerator; }
731  TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
732#endif
733};
734
735#if !RPS_IN_SPS
736/// Reference Picture Set class
737class TComReferencePictureSet
738{
739private:
740  Int m_numberOfPictures;
741  Int m_numberOfNegativePictures;
742  Int m_numberOfPositivePictures;
743  Int m_numberOfLongtermPictures;
744  Int  m_deltaPOC[MAX_NUM_REF_PICS];
745  Int  m_POC[MAX_NUM_REF_PICS];
746  Bool m_used[MAX_NUM_REF_PICS];
747  Bool m_interRPSPrediction;
748  Int  m_deltaRIdxMinus1;   
749  Int  m_deltaRPS; 
750  Int  m_numRefIdc; 
751  Int  m_refIdc[MAX_NUM_REF_PICS+1];
752
753public:
754  TComReferencePictureSet();
755  virtual ~TComReferencePictureSet();
756
757  Void setUsed(Int bufferNum, Bool used);
758  Void setDeltaPOC(Int bufferNum, Int deltaPOC);
759  Void setPOC(Int bufferNum, Int deltaPOC);
760  Void setNumberOfPictures(Int numberOfPictures);
761
762  Int  getUsed(Int bufferNum);
763  Int  getDeltaPOC(Int bufferNum);
764  Int  getPOC(Int bufferNum);
765  Int  getNumberOfPictures();
766
767  Void setNumberOfNegativePictures(Int number)  { m_numberOfNegativePictures = number; }
768  Int  getNumberOfNegativePictures()            { return m_numberOfNegativePictures; }
769  Void setNumberOfPositivePictures(Int number)  { m_numberOfPositivePictures = number; }
770  Int  getNumberOfPositivePictures()            { return m_numberOfPositivePictures; }
771  Void setNumberOfLongtermPictures(Int number)  { m_numberOfLongtermPictures = number; }
772  Int  getNumberOfLongtermPictures()            { return m_numberOfLongtermPictures; }
773
774  Void setInterRPSPrediction(Bool flag)         { m_interRPSPrediction = flag; }
775  Bool getInterRPSPrediction()                  { return m_interRPSPrediction; }
776  Void setDeltaRIdxMinus1(Int x)                { m_deltaRIdxMinus1 = x; }
777  Int  getDeltaRIdxMinus1()                     { return m_deltaRIdxMinus1; }
778  Void setDeltaRPS(Int x)                       { m_deltaRPS = x; }
779  Int  getDeltaRPS()                            { return m_deltaRPS; }
780  Void setNumRefIdc(Int x)                      { m_numRefIdc = x; }
781  Int  getNumRefIdc()                           { return m_numRefIdc; }
782
783  Void setRefIdc(Int bufferNum, Int refIdc);
784  Int  getRefIdc(Int bufferNum);
785
786  Void sortDeltaPOC();
787  Void printDeltaPOC();
788};
789
790/// Reference Picture Set set class
791class TComRPSList
792{
793private:
794  Int  m_numberOfReferencePictureSets;
795  TComReferencePictureSet* m_referencePictureSets;
796 
797public:
798  TComRPSList();
799  virtual ~TComRPSList();
800 
801  Void  create  (Int numberOfEntries);
802  Void  destroy ();
803
804
805  TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum);
806  Int getNumberOfReferencePictureSets();
807  Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets);
808};
809#endif
810
811/// Reference Picture Lists class
812class TComRefPicListModification
813{
814private:
815  UInt      m_bRefPicListModificationFlagL0; 
816  UInt      m_bRefPicListModificationFlagL1; 
817#if !H0137_0138_LIST_MODIFICATION
818  UInt      m_uiNumberOfRefPicListModificationsL0;
819  UInt      m_uiNumberOfRefPicListModificationsL1;
820  UInt      m_ListIdcL0[32];
821#endif
822  UInt      m_RefPicSetIdxL0[32];
823#if !H0137_0138_LIST_MODIFICATION
824  UInt      m_ListIdcL1[32];
825#endif
826  UInt      m_RefPicSetIdxL1[32];
827   
828public:
829  TComRefPicListModification();
830  virtual ~TComRefPicListModification();
831 
832  Void  create                    ();
833  Void  destroy                   ();
834
835  Bool       getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; }
836  Void       setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; }
837  Bool       getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; }
838  Void       setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; }
839#if !H0137_0138_LIST_MODIFICATION
840  UInt       getNumberOfRefPicListModificationsL0() { return m_uiNumberOfRefPicListModificationsL0; }
841  Void       setNumberOfRefPicListModificationsL0(UInt nr) { m_uiNumberOfRefPicListModificationsL0 = nr; }
842  UInt       getNumberOfRefPicListModificationsL1() { return m_uiNumberOfRefPicListModificationsL1; }
843  Void       setNumberOfRefPicListModificationsL1(UInt nr) { m_uiNumberOfRefPicListModificationsL1 = nr; }
844  Void       setListIdcL0(UInt idx, UInt idc) { m_ListIdcL0[idx] = idc; }
845  UInt       getListIdcL0(UInt idx) { return m_ListIdcL0[idx]; }
846#endif
847  Void       setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; }
848  UInt       getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; }
849#if !H0137_0138_LIST_MODIFICATION
850  Void       setListIdcL1(UInt idx, UInt idc) { m_ListIdcL1[idx] = idc; }
851  UInt       getListIdcL1(UInt idx) { return m_ListIdcL1[idx]; }
852#endif
853  Void       setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; }
854  UInt       getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; }
855};
856
857/// PPS class
858class TComPPS
859{
860private:
861  Int         m_PPSId;                    // pic_parameter_set_id
862  Int         m_SPSId;                    // seq_parameter_set_id
863  Int         m_picInitQPMinus26;
864  Bool        m_useDQP;
865  Bool        m_bConstrainedIntraPred;    // constrained_intra_pred_flag
866 
867  // access channel
868  TComSPS*    m_pcSPS;
869#if !RPS_IN_SPS
870  TComRPSList* m_RPSList;
871#endif
872  UInt        m_uiMaxCuDQPDepth;
873  UInt        m_uiMinCuDQPSize;
874
875  Int        m_iChromaQpOffset;
876  Int        m_iChromaQpOffset2nd;
877
878#if !RPS_IN_SPS
879  Bool        m_bLongTermRefsPresent;
880#endif
881
882#if !H0566_TLA
883  UInt        m_uiNumTlayerSwitchingFlags;            // num_temporal_layer_switching_point_flags
884  Bool        m_abTLayerSwitchingFlag[ MAX_TLAYER ];  // temporal_layer_switching_point_flag
885#endif
886
887  Int         m_iSliceGranularity;
888
889  Bool        m_bUseWeightPred;           // Use of Weighting Prediction (P_SLICE)
890  UInt        m_uiBiPredIdc;              // Use of Weighting Bi-Prediction (B_SLICE)
891
892#if H0388
893  Bool        m_OutputFlagPresentFlag;   // Indicates the presence of output_flag in slice header
894#endif
895
896  Int      m_iTileBehaviorControlPresentFlag;
897  Bool     m_bLFCrossTileBoundaryFlag;
898  Int      m_iColumnRowInfoPresent;
899  Int      m_iUniformSpacingIdr;
900#if !REMOVE_TILE_DEPENDENCE
901  Int      m_iTileBoundaryIndependenceIdr;
902#endif
903  Int      m_iNumColumnsMinus1;
904  UInt*    m_puiColumnWidth;
905  Int      m_iNumRowsMinus1;
906  UInt*    m_puiRowHeight;
907 
908  Int      m_iEntropyCodingMode; // !!! in PPS now, but also remains in slice header!
909#if !WPP_SIMPLIFICATION 
910  Int      m_iEntropyCodingSynchro;
911  Bool     m_bCabacIstateReset;
912#endif
913  Int      m_iNumSubstreams;
914
915  Bool     m_enableTMVPFlag;
916
917#if MULTIBITS_DATA_HIDING
918  Int      m_signHideFlag;
919  Int      m_signHidingThreshold;
920#endif
921
922#if CABAC_INIT_FLAG
923  Bool     m_cabacInitPresentFlag;
924  UInt     m_encCABACTableIdx;           // Used to transmit table selection across slices
925#if FIX_POZNAN_CABAC_INIT_FLAG
926  UInt     m_encPrevPOC;
927#endif
928#endif
929#if DBL_CONTROL
930  Bool     m_DeblockingFilterControlPresent;
931#endif
932#if PARALLEL_MERGE
933  UInt m_log2ParallelMergeLevelMinus2;
934#endif
935public:
936  TComPPS();
937  virtual ~TComPPS();
938 
939  Int       getPPSId ()      { return m_PPSId; }
940  Void      setPPSId (Int i) { m_PPSId = i; }
941  Int       getSPSId ()      { return m_SPSId; }
942  Void      setSPSId (Int i) { m_SPSId = i; }
943 
944  Int       getSliceGranularity()        { return m_iSliceGranularity; }
945  Void      setSliceGranularity( Int i ) { m_iSliceGranularity = i;    }
946  Int       getPicInitQPMinus26 ()         { return  m_picInitQPMinus26; }
947  Void      setPicInitQPMinus26 ( Int i )  { m_picInitQPMinus26 = i;     }
948  Bool      getUseDQP ()                   { return m_useDQP;        }
949  Void      setUseDQP ( Bool b )           { m_useDQP   = b;         }
950  Bool      getConstrainedIntraPred ()         { return  m_bConstrainedIntraPred; }
951  Void      setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b;     }
952
953#if !H0566_TLA
954  UInt      getNumTLayerSwitchingFlags()                                  { return m_uiNumTlayerSwitchingFlags; }
955  Void      setNumTLayerSwitchingFlags( UInt uiNumTlayerSwitchingFlags )  { assert( uiNumTlayerSwitchingFlags < MAX_TLAYER ); m_uiNumTlayerSwitchingFlags = uiNumTlayerSwitchingFlags; }
956
957  Bool      getTLayerSwitchingFlag( UInt uiTLayer )                       { assert( uiTLayer < MAX_TLAYER ); return m_abTLayerSwitchingFlag[ uiTLayer ]; }
958  Void      setTLayerSwitchingFlag( UInt uiTLayer, Bool bValue )          { m_abTLayerSwitchingFlag[ uiTLayer ] = bValue; }
959#endif
960
961#if !RPS_IN_SPS
962  Bool      getLongTermRefsPresent()         { return m_bLongTermRefsPresent; }
963  Void      setLongTermRefsPresent(Bool b)   { m_bLongTermRefsPresent=b;      }
964#endif
965  Void      setSPS              ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
966  TComSPS*  getSPS              ()         { return m_pcSPS;          }
967#if !RPS_IN_SPS
968  Void      setRPSList          ( TComRPSList* RPSList ) { m_RPSList = RPSList; }
969  TComRPSList* getRPSList       ()         { return m_RPSList;        }
970#endif
971  Void      setMaxCuDQPDepth    ( UInt u ) { m_uiMaxCuDQPDepth = u;   }
972  UInt      getMaxCuDQPDepth    ()         { return m_uiMaxCuDQPDepth;}
973  Void      setMinCuDQPSize     ( UInt u ) { m_uiMinCuDQPSize = u;    }
974  UInt      getMinCuDQPSize     ()         { return m_uiMinCuDQPSize; }
975
976  Void      setChromaQpOffset   ( Int i ) { m_iChromaQpOffset = i; }
977  Int       getChromaQpOffset   () { return m_iChromaQpOffset;}
978  Void      setChromaQpOffset2nd( Int i ) { m_iChromaQpOffset2nd = i; }
979  Int       getChromaQpOffset2nd() { return m_iChromaQpOffset2nd;}
980
981  Bool getUseWP                     ()          { return m_bUseWeightPred;  }
982  UInt getWPBiPredIdc               ()          { return m_uiBiPredIdc;     }
983
984  Void setUseWP                     ( Bool b )  { m_bUseWeightPred = b;     }
985  Void setWPBiPredIdc               ( UInt u )  { m_uiBiPredIdc = u;        }
986
987#if H0388
988  Void      setOutputFlagPresentFlag( Bool b )  { m_OutputFlagPresentFlag = b;    }
989  Bool      getOutputFlagPresentFlag()          { return m_OutputFlagPresentFlag; }
990#endif
991
992  Void    setTileBehaviorControlPresentFlag        ( Int i )             { m_iTileBehaviorControlPresentFlag = i;    }
993  Int     getTileBehaviorControlPresentFlag        ()                    { return m_iTileBehaviorControlPresentFlag; }
994  Void    setLFCrossTileBoundaryFlag               ( Bool   bValue  )    { m_bLFCrossTileBoundaryFlag = bValue; }
995  Bool    getLFCrossTileBoundaryFlag               ()                    { return m_bLFCrossTileBoundaryFlag;   }
996  Void     setColumnRowInfoPresent          ( Int i )           { m_iColumnRowInfoPresent = i; }
997  Int      getColumnRowInfoPresent          ()                  { return m_iColumnRowInfoPresent; }
998  Void     setUniformSpacingIdr             ( Int i )           { m_iUniformSpacingIdr = i; }
999  Int      getUniformSpacingIdr             ()                  { return m_iUniformSpacingIdr; }
1000#if !REMOVE_TILE_DEPENDENCE
1001  Void     setTileBoundaryIndependenceIdr   ( Int i )           { m_iTileBoundaryIndependenceIdr = i; }
1002  Int      getTileBoundaryIndependenceIdr   ()                  { return m_iTileBoundaryIndependenceIdr; }
1003#endif
1004  Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
1005  Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
1006  Void     setColumnWidth ( UInt* columnWidth )
1007  {
1008    if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
1009    {
1010      m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
1011
1012      for(Int i=0; i<m_iNumColumnsMinus1; i++)
1013      {
1014        m_puiColumnWidth[i] = columnWidth[i];
1015      }
1016    }
1017  }
1018  UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
1019  Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
1020  Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
1021  Void     setRowHeight    ( UInt* rowHeight )
1022  {
1023    if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
1024    {
1025      m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
1026
1027      for(Int i=0; i<m_iNumRowsMinus1; i++)
1028      {
1029        m_puiRowHeight[i] = rowHeight[i];
1030      }
1031    }
1032  }
1033  UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
1034  Void     setEntropyCodingMode(Int iEntropyCodingMode)       { m_iEntropyCodingMode = iEntropyCodingMode; }
1035  Int      getEntropyCodingMode()                             { return m_iEntropyCodingMode; }
1036#if !WPP_SIMPLIFICATION
1037  Void     setEntropyCodingSynchro(Int iEntropyCodingSynchro) { m_iEntropyCodingSynchro = iEntropyCodingSynchro; }
1038  Int      getEntropyCodingSynchro()                          { return m_iEntropyCodingSynchro; }
1039  Void     setCabacIstateReset(Bool bCabacIstateReset)        { m_bCabacIstateReset = bCabacIstateReset; }
1040  Bool     getCabacIstateReset()                              { return m_bCabacIstateReset; }
1041#endif
1042  Void     setNumSubstreams(Int iNumSubstreams)               { m_iNumSubstreams = iNumSubstreams; }
1043  Int      getNumSubstreams()                                 { return m_iNumSubstreams; }
1044
1045#if MULTIBITS_DATA_HIDING
1046  Void      setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; }
1047  Void      setTSIG( Int tsig )                 { m_signHidingThreshold = tsig; }
1048  Int       getSignHideFlag()                    { return m_signHideFlag; }
1049  Int       getTSIG()                            { return m_signHidingThreshold; }
1050#endif
1051
1052  Void     setEnableTMVPFlag( Bool b )  { m_enableTMVPFlag = b;    }
1053  Bool     getEnableTMVPFlag()          { return m_enableTMVPFlag; }
1054
1055#if CABAC_INIT_FLAG
1056  Void     setCabacInitPresentFlag( Bool flag )     { m_cabacInitPresentFlag = flag;    }
1057  Void     setEncCABACTableIdx( Int idx )           { m_encCABACTableIdx = idx;         }
1058  Bool     getCabacInitPresentFlag()                { return m_cabacInitPresentFlag;    }
1059  UInt     getEncCABACTableIdx()                    { return m_encCABACTableIdx;        }
1060#if FIX_POZNAN_CABAC_INIT_FLAG
1061  Void     setEncPrevPOC(UInt uiPOC)                { m_encPrevPOC = uiPOC;             }
1062  UInt     getEncPrevPOC()                          { return m_encPrevPOC;              }
1063#endif
1064#endif
1065#if DBL_CONTROL
1066  Void setDeblockingFilterControlPresent    ( Bool bValue )       { m_DeblockingFilterControlPresent = bValue; }
1067  Bool getDeblockingFilterControlPresent    ()                    { return m_DeblockingFilterControlPresent; }
1068#endif
1069#if PARALLEL_MERGE
1070  UInt getLog2ParallelMergeLevelMinus2      ()                    { return m_log2ParallelMergeLevelMinus2; }
1071  Void setLog2ParallelMergeLevelMinus2      (UInt mrgLevel)       { m_log2ParallelMergeLevelMinus2 = mrgLevel; }
1072#endif
1073};
1074
1075/// SCALING_LIST class
1076class TComScalingList
1077{
1078public:
1079  TComScalingList();
1080  virtual ~TComScalingList();
1081  Void     setScalingListPresentFlag    (Bool b)                               { m_scalingListPresentFlag = b;    }
1082  Bool     getScalingListPresentFlag    ()                                     { return m_scalingListPresentFlag; }
1083  Int*     getScalingListAddress          (UInt sizeId, UInt listId)           { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient
1084  Bool     checkPredMode                  (UInt sizeId, UInt listId);
1085  Void     setRefMatrixId                 (UInt sizeId, UInt listId, UInt u)   { m_refMatrixId[sizeId][listId] = u;    }     //!< set reference matrix ID
1086  UInt     getRefMatrixId                 (UInt sizeId, UInt listId)           { return m_refMatrixId[sizeId][listId]; }     //!< get reference matrix ID
1087  Int*     getScalingListDefaultAddress   (UInt sizeId, UInt listId);                                                        //!< get default matrix coefficient
1088  Void     processDefaultMarix            (UInt sizeId, UInt listId);
1089#if SCALING_LIST
1090  Void     setScalingListDC               (UInt sizeId, UInt listId, UInt u)   { m_scalingListDC[sizeId][listId] = u; }      //!< set DC value
1091  Int      getScalingListDC               (UInt sizeId, UInt listId)           { return m_scalingListDC[sizeId][listId]; }   //!< get DC value
1092  Void     checkDcOfMatrix                ();
1093  Void     setUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId, Bool b)   { m_useDefaultScalingMatrixFlag[sizeId][listId] = b;    } //!< set default matrix enabled/disabled in each matrix
1094  Bool     getUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId)           { return m_useDefaultScalingMatrixFlag[sizeId][listId]; } //!< get default matrix enabled/disabled in each matrix
1095#endif
1096  Void     processRefMatrix               (UInt sizeId, UInt listId , UInt refListId );
1097  Bool     xParseScalingList              (char* pchFile);
1098
1099private:
1100  Void     init                    ();
1101  Void     destroy                 ();
1102#if SCALING_LIST
1103  Int      m_scalingListDC               [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16
1104  Bool     m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag
1105#endif
1106  UInt     m_refMatrixId                 [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID
1107  Bool     m_scalingListPresentFlag;                                                //!< flag for using default matrix
1108  UInt     m_predMatrixId                [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index
1109  Int      *m_scalingListCoef            [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
1110};
1111
1112/// APS class
1113class TComAPS
1114{
1115public:
1116  TComAPS();
1117  virtual ~TComAPS();
1118
1119  Void      setAPSID      (Int iID)   {m_apsID = iID;            }  //!< set APS ID
1120  Int       getAPSID      ()          {return m_apsID;           }  //!< get APS ID
1121  Void      setSaoEnabled (Bool bVal) {m_bSaoEnabled = bVal;     }  //!< set SAO enabled/disabled in APS
1122  Bool      getSaoEnabled ()          {return m_bSaoEnabled;     }  //!< get SAO enabled/disabled in APS
1123  Void      setAlfEnabled (Bool bVal) {m_bAlfEnabled = bVal;     }  //!< set ALF enabled/disabled in APS
1124  Bool      getAlfEnabled ()          {return m_bAlfEnabled;     }  //!< get ALF enabled/disabled in APS
1125
1126#if LCU_SYNTAX_ALF
1127  AlfParamSet* getAlfParam   ()          {return m_alfParamSet;}
1128#else
1129  ALFParam* getAlfParam   ()          {return m_pAlfParam;       }  //!< get ALF parameters in APS
1130#endif
1131  SAOParam* getSaoParam   ()          {return m_pSaoParam;       }  //!< get SAO parameters in APS
1132
1133  Void      createSaoParam();   //!< create SAO parameter object
1134  Void      destroySaoParam();  //!< destroy SAO parameter object
1135
1136  Void      createAlfParam();   //!< create ALF parameter object
1137  Void      destroyAlfParam();  //!< destroy ALF parameter object
1138
1139  Void      setLoopFilterOffsetInAPS(Bool val)  {m_loopFilterOffsetInAPS = val; }      //!< set offset for deblocking filter enabled/disabled in APS
1140  Bool      getLoopFilterOffsetInAPS()          {return m_loopFilterOffsetInAPS; }     //!< get offset for deblocking filter enabled/disabled in APS
1141  Void      setLoopFilterDisable(Bool val)      {m_loopFilterDisable = val; }          //!< set offset for deblocking filter disabled
1142  Bool      getLoopFilterDisable()              {return m_loopFilterDisable; }         //!< get offset for deblocking filter disabled
1143  Void      setLoopFilterBetaOffset(Int val)    {m_loopFilterBetaOffsetDiv2 = val; }    //!< set beta offset for deblocking filter
1144  Int       getLoopFilterBetaOffset()           {return m_loopFilterBetaOffsetDiv2; }   //!< get beta offset for deblocking filter
1145  Void      setLoopFilterTcOffset(Int val)      {m_loopFilterTcOffsetDiv2 = val; }      //!< set tc offset for deblocking filter
1146  Int       getLoopFilterTcOffset()             {return m_loopFilterTcOffsetDiv2; }     //!< get tc offset for deblocking filter
1147
1148  Void      createScalingList();
1149  Void      destroyScalingList();
1150  Void      setScalingListEnabled (Bool bVal) { m_scalingListEnabled = bVal; }  //!< set ScalingList enabled/disabled in APS
1151  Bool      getScalingListEnabled ()          { return m_scalingListEnabled; }  //!< get ScalingList enabled/disabled in APS
1152  TComScalingList* getScalingList ()          { return m_scalingList; }         //!< get ScalingList class pointer in APS
1153#if SAO_UNIT_INTERLEAVING
1154  Bool     getSaoInterleavingFlag() {return m_saoInterleavingFlag;}             //!< get SAO interleaving flag in APS
1155  Void     setSaoInterleavingFlag(Bool bVal) {m_saoInterleavingFlag = bVal;}    //!< set SAO interleaving flag in APS
1156#endif
1157
1158private:
1159  Int         m_apsID;        //!< APS ID
1160  Bool        m_bSaoEnabled;  //!< SAO enabled/disabled in APS (true for enabled)
1161  Bool        m_bAlfEnabled;  //!< ALF enabled/disabled in APS (true for enabled)
1162  SAOParam*   m_pSaoParam;    //!< SAO parameter object pointer
1163#if LCU_SYNTAX_ALF
1164  AlfParamSet*   m_alfParamSet;
1165#else
1166  ALFParam*   m_pAlfParam;    //!< ALF parameter object pointer
1167#endif
1168  Bool        m_loopFilterOffsetInAPS;       //< offset for deblocking filter in 0 = slice header, 1 = APS
1169  Bool        m_loopFilterDisable;           //< Deblocking filter enabled/disabled in APS
1170  Int         m_loopFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
1171  Int         m_loopFilterTcOffsetDiv2;      //< tc offset for deblocking filter
1172  Bool        m_scalingListEnabled;     //!< ScalingList enabled/disabled in APS (true for enabled)
1173  TComScalingList*     m_scalingList;   //!< ScalingList class pointer
1174#if SAO_UNIT_INTERLEAVING
1175  Bool        m_saoInterleavingFlag;    //!< SAO interleaving flag
1176#endif
1177
1178public:
1179  TComAPS& operator= (const TComAPS& src);  //!< "=" operator for APS object
1180};
1181
1182typedef struct {
1183  // Explicit weighted prediction parameters parsed in slice header,
1184  // or Implicit weighted prediction parameters (8 bits depth values).
1185  Bool        bPresentFlag;
1186  UInt        uiLog2WeightDenom;
1187  Int         iWeight;
1188  Int         iOffset;
1189
1190  // Weighted prediction scaling values built from above parameters (bitdepth scaled):
1191  Int         w, o, offset, shift, round;
1192} wpScalingParam;
1193
1194typedef struct {
1195  Int64 iAC;
1196  Int64 iDC;
1197} wpACDCParam;
1198
1199/// slice header class
1200class TComSlice
1201{
1202 
1203private:
1204  //  Bitstream writing
1205  Int         m_iAPSId; //!< APS ID in slice header
1206  bool       m_alfEnabledFlag;
1207  bool       m_saoEnabledFlag;
1208#if SAO_UNIT_INTERLEAVING
1209  bool       m_saoInterleavingFlag;   ///< SAO interleaving flag
1210  bool       m_saoEnabledFlagCb;      ///< SAO Cb enabled flag
1211  bool       m_saoEnabledFlagCr;      ///< SAO Cr enabled flag
1212#endif
1213  Int         m_iPPSId;               ///< picture parameter set ID
1214#if H0388
1215  Bool        m_PicOutputFlag;        ///< pic_output_flag
1216#endif
1217  Int         m_iPOC;
1218  Int         m_iLastIDR;
1219  static Int  m_prevPOC;
1220  TComReferencePictureSet *m_pcRPS;
1221  TComReferencePictureSet m_LocalRPS;
1222  Int         m_iBDidx; 
1223  Int         m_iCombinationBDidx;
1224  Bool        m_bCombineWithReferenceFlag;
1225  TComRefPicListModification m_RefPicListModification;
1226  NalUnitType m_eNalUnitType;            ///< Nal unit type for the slice
1227  NalUnitType m_eNalUnitTypeBaseViewMvc; ///< Nal unit type of the base view slice for multiview coding
1228  SliceType   m_eSliceType;
1229  Int         m_iSliceQp;
1230#if ADAPTIVE_QP_SELECTION
1231  Int         m_iSliceQpBase;
1232#endif
1233  Bool        m_bLoopFilterDisable;
1234  Bool        m_loopFilterOffsetInAPS;
1235  Bool        m_inheritDblParamFromAPS;      //< offsets for deblocking filter inherit from APS
1236  Int         m_loopFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
1237  Int         m_loopFilterTcOffsetDiv2;      //< tc offset for deblocking filter
1238 
1239  Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
1240
1241  Int         m_iRefIdxOfLC[2][MAX_NUM_REF_LC];
1242  Int         m_eListIdFromIdxOfLC[MAX_NUM_REF_LC];
1243  Int         m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC];
1244  Int         m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC];
1245  Int         m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC];
1246  Bool        m_bRefPicListModificationFlagLC;
1247  Bool        m_bRefPicListCombinationFlag;
1248
1249  Bool        m_bCheckLDC;
1250
1251  //  Data
1252  Int         m_iSliceQpDelta;
1253  TComPic*    m_apcRefPicList  [2][MAX_NUM_REF+1];
1254  Int         m_aiRefPOCList   [2][MAX_NUM_REF+1];
1255  Int         m_aiRefViewIdList[2][MAX_NUM_REF+1];
1256  TComPic*    m_pcTexturePic;
1257  Int         m_iDepth;
1258 
1259  // referenced slice?
1260  Bool        m_bRefenced;
1261 
1262  // access channel
1263#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
1264  TComVPS*    m_pcVPS;
1265#endif
1266#if QC_IV_AS_LT_B0046
1267  Bool                  m_bWasLongTerm[2][MAX_NUM_REF+1]; //was long-term picture
1268#endif
1269  TComSPS*    m_pcSPS;
1270  TComPPS*    m_pcPPS;
1271  TComPic*    m_pcPic;
1272#if ADAPTIVE_QP_SELECTION
1273  TComTrQuant* m_pcTrQuant;
1274#endif 
1275  TComAPS*    m_pcAPS;  //!< pointer to APS parameter object
1276
1277  UInt        m_uiColDir;  // direction to get colocated CUs
1278 
1279#if COLLOCATED_REF_IDX
1280  UInt        m_colRefIdx;
1281#endif
1282
1283#if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA
1284  Double      m_dLambdaLuma;
1285  Double      m_dLambdaChroma;
1286#else
1287  Double      m_dLambda;
1288#endif
1289
1290  Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
1291 
1292  Bool        m_bNoBackPredFlag;
1293  Bool        m_bRefIdxCombineCoding;
1294
1295  UInt        m_uiTLayer;
1296  Bool        m_bTLayerSwitchingFlag;
1297
1298  UInt        m_uiSliceMode;
1299  UInt        m_uiSliceArgument;
1300  UInt        m_uiSliceCurStartCUAddr;
1301  UInt        m_uiSliceCurEndCUAddr;
1302  UInt        m_uiSliceIdx;
1303  UInt        m_uiEntropySliceMode;
1304  UInt        m_uiEntropySliceArgument;
1305  UInt        m_uiEntropySliceCurStartCUAddr;
1306  UInt        m_uiEntropySliceCurEndCUAddr;
1307  Bool        m_bNextSlice;
1308  Bool        m_bNextEntropySlice;
1309  UInt        m_uiSliceBits;
1310  UInt        m_uiEntropySliceCounter;
1311  Bool        m_bFinalized;
1312
1313  wpScalingParam  m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V]
1314  wpACDCParam    m_weightACDCParam[3];                 // [0:Y, 1:U, 2:V]
1315  wpScalingParam  m_weightPredTableLC[2*MAX_NUM_REF][3]; // [refIdxLC][0:Y, 1:U, 2:V]
1316
1317  UInt        *m_uiTileByteLocation;
1318  UInt        m_uiTileCount;
1319  Int         m_iTileMarkerFlag;
1320  UInt        m_uiTileOffstForMultES;
1321
1322  UInt*       m_puiSubstreamSizes;
1323  TComScalingList*     m_scalingList;                 //!< pointer of quantization matrix
1324#if CABAC_INIT_FLAG
1325  Bool        m_cabacInitFlag; 
1326#else
1327  Int         m_cabacInitIdc; 
1328#endif
1329
1330#if H0111_MVD_L1_ZERO
1331  Bool       m_bLMvdL1Zero;
1332#endif
1333#if TILES_WPP_ENTRY_POINT_SIGNALLING
1334  Int         m_numEntryPointOffsets;
1335#endif
1336
1337  Int        m_viewId;
1338  Bool       m_isDepth;
1339  Int        m_aaiCodedScale [2][MAX_VIEW_NUM];
1340  Int        m_aaiCodedOffset[2][MAX_VIEW_NUM];
1341
1342#if SONY_COLPIC_AVAILABILITY|QC_MVHEVC_B0046
1343  Int         m_iViewOrderIdx;
1344#endif
1345#if LGE_ILLUCOMP_B0045
1346  Bool        m_bApplyIC;
1347#endif
1348
1349public:
1350  TComSlice();
1351  virtual ~TComSlice();
1352 
1353  Void      initSlice       ();
1354  Void      initTiles();
1355
1356#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
1357  Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
1358  TComVPS*  getVPS          () { return m_pcVPS; }
1359#endif
1360#if QC_IV_AS_LT_B0046
1361  Void          setWasLongTerm( Bool lt,  RefPicList e, Int iRefIdx ) { m_bWasLongTerm[e][iRefIdx] = lt; }
1362  Bool          getWasLongTerm( RefPicList e, Int iRefIdx           ) { return m_bWasLongTerm[e][iRefIdx] ; }
1363#endif
1364
1365  Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
1366  TComSPS*  getSPS          () { return m_pcSPS; }
1367 
1368  Void      setPPS          ( TComPPS* pcPPS )         { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); }
1369  TComPPS*  getPPS          () { return m_pcPPS; }
1370
1371#if ADAPTIVE_QP_SELECTION
1372  Void          setTrQuant          ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; }
1373  TComTrQuant*  getTrQuant          () { return m_pcTrQuant; }
1374#endif
1375
1376  Void      setPPSId        ( Int PPSId )         { m_iPPSId = PPSId; }
1377  Int       getPPSId        () { return m_iPPSId; }
1378  Void      setAPS          ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer
1379  TComAPS*  getAPS          ()                 { return m_pcAPS;  } //!< get APS pointer
1380  Void      setAPSId        ( Int Id)          { m_iAPSId =Id;    } //!< set APS ID
1381  Int       getAPSId        ()                 { return m_iAPSId; } //!< get APS ID
1382#if H0388
1383  Void      setPicOutputFlag( Bool b )         { m_PicOutputFlag = b;    }
1384  Bool      getPicOutputFlag()                 { return m_PicOutputFlag; }
1385#endif
1386  Void      setAlfEnabledFlag(Bool s) {m_alfEnabledFlag =s; }
1387  Bool      getAlfEnabledFlag() { return m_alfEnabledFlag; }
1388  Void      setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; }
1389  Bool      getSaoEnabledFlag() { return m_saoEnabledFlag; }
1390#if SAO_UNIT_INTERLEAVING
1391  Void      setSaoInterleavingFlag(Bool s) {m_saoInterleavingFlag =s; } //!< set SAO interleaving flag
1392  Bool      getSaoInterleavingFlag() { return m_saoInterleavingFlag;  } //!< get SAO interleaving flag
1393  Void      setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; }       //!< set SAO Cb enabled flag
1394  Bool      getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; }        //!< get SAO Cb enabled flag
1395  Void      setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; }       //!< set SAO Cr enabled flag
1396  Bool      getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; }        //!< get SAO Cr enabled flag
1397#endif
1398  Void      setRPS          ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; }
1399  TComReferencePictureSet*  getRPS          () { return m_pcRPS; }
1400  TComReferencePictureSet*  getLocalRPS     () { return &m_LocalRPS; }
1401
1402  Void      setRPSidx          ( Int iBDidx ) { m_iBDidx = iBDidx; }
1403  Int       getRPSidx          () { return m_iBDidx; }
1404  Void      setCombinationBDidx          ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; }
1405  Int       getCombinationBDidx          () { return m_iCombinationBDidx; }
1406  Void      setCombineWithReferenceFlag          ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; }
1407  Bool      getCombineWithReferenceFlag          () { return m_bCombineWithReferenceFlag; }
1408  Int       getPrevPOC      ()                          { return  m_prevPOC;       }
1409
1410  TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; }
1411  Void      setLastIDR(Int iIDRPOC)                       { m_iLastIDR = iIDRPOC; }
1412  Int       getLastIDR()                                  { return m_iLastIDR; }
1413  SliceType getSliceType    ()                          { return  m_eSliceType;         }
1414  Int       getPOC          ()                          { return  m_iPOC;           }
1415  Int       getSliceQp      ()                          { return  m_iSliceQp;           }
1416#if ADAPTIVE_QP_SELECTION
1417  Int       getSliceQpBase  ()                          { return  m_iSliceQpBase;       }
1418#endif
1419  Int       getSliceQpDelta ()                          { return  m_iSliceQpDelta;      }
1420  Bool      getLoopFilterDisable()                      { return  m_bLoopFilterDisable; }
1421  Bool      getLoopFilterOffsetInAPS()                  { return  m_loopFilterOffsetInAPS;}
1422  Bool      getInheritDblParamFromAPS()                 { return  m_inheritDblParamFromAPS; }
1423  Int       getLoopFilterBetaOffset()                   { return  m_loopFilterBetaOffsetDiv2; }
1424  Int       getLoopFilterTcOffset()                     { return  m_loopFilterTcOffsetDiv2; }
1425
1426  Int       getNumRefIdx        ( RefPicList e )                { return  m_aiNumRefIdx[e];             }
1427  TComPic*  getPic              ()                              { return  m_pcPic;                      }
1428  TComPic*  getRefPic           ( RefPicList e, Int iRefIdx)    { return  m_apcRefPicList[e][iRefIdx];  }
1429  Int       getRefPOC           ( RefPicList e, Int iRefIdx)    { return  m_aiRefPOCList[e][iRefIdx];   }
1430  Int       getRefViewId        ( RefPicList e, Int iRefIdx)    { return  m_aiRefViewIdList[e][iRefIdx]; }
1431  TComPic*  getTexturePic       () const                        { return  m_pcTexturePic; }
1432#if SONY_COLPIC_AVAILABILITY
1433  Int       getViewOrderIdx     ()                                  { return  m_iViewOrderIdx;              }
1434#endif
1435  Int       getDepth            ()                              { return  m_iDepth;                     }
1436  UInt      getColDir           ()                              { return  m_uiColDir;                   }
1437#if COLLOCATED_REF_IDX
1438  Bool      getColRefIdx        ()                              { return  m_colRefIdx;                  }
1439  Void      checkColRefIdx      (UInt curSliceIdx, TComPic* pic);
1440#endif
1441  Bool      getCheckLDC     ()                                  { return m_bCheckLDC; }
1442#if H0111_MVD_L1_ZERO
1443  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
1444#endif
1445  Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
1446  Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
1447  Int       getRefIdxFromIdxOfLC(Int iRefIdx)                   { return m_iRefIdxFromIdxOfLC[iRefIdx];       }
1448  Int       getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx)            { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];}
1449  Int       getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx)            { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];}
1450  Bool      getRefPicListModificationFlagLC()                   {return m_bRefPicListModificationFlagLC;}
1451  Void      setRefPicListModificationFlagLC(Bool bflag)         {m_bRefPicListModificationFlagLC=bflag;}     
1452  Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
1453  Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}     
1454  Void      setListIdFromIdxOfLC(Int  iRefIdx, UInt uiVal)      { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; }
1455  Void      setRefIdxFromIdxOfLC(Int  iRefIdx, UInt uiVal)      { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; }
1456  Void      setRefIdxOfLC       (RefPicList e, Int iRefIdx, Int RefIdxLC)     { m_iRefIdxOfLC[e][iRefIdx]=RefIdxLC;}
1457
1458  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
1459  Bool      isReferenced()                                      { return m_bRefenced; }
1460 
1461  Void      setPOC              ( Int i )                       { m_iPOC              = i; if(getTLayer()==0) m_prevPOC=i; }
1462  Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
1463  NalUnitType getNalUnitType    ()                              { return m_eNalUnitType;        }
1464  Void      setNalUnitTypeBaseViewMvc  ( NalUnitType e )        { m_eNalUnitTypeBaseViewMvc = e;    }
1465  NalUnitType getNalUnitTypeBaseViewMvc()                       { return m_eNalUnitTypeBaseViewMvc; }
1466  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, TComList<TComPic*>& rcListPic);
1467  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
1468  Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
1469  Void      setSliceQp          ( Int i )                       { m_iSliceQp          = i;      }
1470#if ADAPTIVE_QP_SELECTION
1471  Void      setSliceQpBase      ( Int i )                       { m_iSliceQpBase      = i;      }
1472#endif
1473  Void      setSliceQpDelta     ( Int i )                       { m_iSliceQpDelta     = i;      }
1474  Void      setLoopFilterDisable( Bool b )                      { m_bLoopFilterDisable= b;      }
1475  Void      setLoopFilterOffsetInAPS( Bool b )                  { m_loopFilterOffsetInAPS = b;}
1476  Void      setInheritDblParamFromAPS( Bool b )                 { m_inheritDblParamFromAPS = b; }
1477  Void      setLoopFilterBetaOffset( Int i )                    { m_loopFilterBetaOffsetDiv2 = i; }
1478  Void      setLoopFilterTcOffset( Int i )                      { m_loopFilterTcOffsetDiv2 = i; }
1479 
1480  Void      setRefPic           ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; }
1481  Void      setRefPOC           ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
1482  Void      setRefViewId        ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdList[e][iRefIdx] = i; }
1483  Void      setTexturePic       ( TComPic *pcTexturePic )       { m_pcTexturePic = pcTexturePic; }
1484#if SONY_COLPIC_AVAILABILITY
1485  Void      setViewOrderIdx     ( Int i )                       { m_iViewOrderIdx     = i;      }
1486#endif
1487  Void      setNumRefIdx        ( RefPicList e, Int i )         { m_aiNumRefIdx[e]    = i;      }
1488  Void      setPic              ( TComPic* p )                  { m_pcPic             = p;      }
1489  Void      setDepth            ( Int iDepth )                  { m_iDepth            = iDepth; }
1490 
1491  Int       getNumPocTotalCurr();
1492  Int       getNumPocTotalCurrMvc();
1493  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics );
1494  Void      setRefPOCnViewListsMvc();
1495
1496  Void      setColDir           ( UInt uiDir ) { m_uiColDir = uiDir; }
1497#if COLLOCATED_REF_IDX
1498  Void      setColRefIdx        ( UInt refIdx) { m_colRefIdx = refIdx; }
1499#endif
1500  Void      setCheckLDC         ( Bool b )                      { m_bCheckLDC = b; }
1501#if H0111_MVD_L1_ZERO
1502  Void      setMvdL1ZeroFlag     ( Bool b)                       { m_bLMvdL1Zero = b; }
1503#endif 
1504
1505  Bool      isIntra         ()                          { return  m_eSliceType == I_SLICE;  }
1506  Bool      isInterB        ()                          { return  m_eSliceType == B_SLICE;  }
1507  Bool      isInterP        ()                          { return  m_eSliceType == P_SLICE;  }
1508 
1509#if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA 
1510  Void      setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;}
1511  Double    getLambdaLuma() { return m_dLambdaLuma;        }
1512  Double    getLambdaChroma() { return m_dLambdaChroma;        }
1513#else
1514  Void      setLambda( Double d ) { m_dLambda = d; }
1515  Double    getLambda() { return m_dLambda;        }
1516#endif
1517 
1518  Void      initEqualRef();
1519  Bool      isEqualRef  ( RefPicList e, Int iRefIdx1, Int iRefIdx2 )
1520  {
1521    if (iRefIdx1 < 0 || iRefIdx2 < 0) return false;
1522    return m_abEqualRef[e][iRefIdx1][iRefIdx2];
1523  }
1524 
1525  Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b)
1526  {
1527    m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b;
1528  }
1529 
1530  static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
1531 
1532  Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
1533  Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
1534  Bool getRefIdxCombineCoding() { return m_bRefIdxCombineCoding; }
1535  Void setRefIdxCombineCoding( Bool b ) { m_bRefIdxCombineCoding = b; }
1536  Void generateCombinedList       ();
1537
1538  UInt getTLayer             ()                            { return m_uiTLayer;                      }
1539  Void setTLayer             ( UInt uiTLayer )             { m_uiTLayer = uiTLayer;                  }
1540
1541#if !H0566_TLA
1542  Bool getTLayerSwitchingFlag()                            { return m_bTLayerSwitchingFlag;          }
1543  Void setTLayerSwitchingFlag( Bool bValue )               { m_bTLayerSwitchingFlag = bValue;        }
1544#endif
1545
1546  Void setTLayerInfo( UInt uiTLayer );
1547  Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); 
1548  Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
1549#if H0566_TLA && H0566_TLA_SET_FOR_SWITCHING_POINTS
1550  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
1551#endif
1552#if START_DECODING_AT_CRA
1553  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag, Int pocRandomAccess = 0);
1554#else
1555  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag);
1556#endif
1557  Void      createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet);
1558
1559  Void decodingMarkingForNoTMVP( TComList<TComPic*>& rcListPic, Int currentPOC );
1560
1561  UInt m_uiMaxNumMergeCand;
1562  Void setMaxNumMergeCand               (UInt maxNumMergeCand ) { m_uiMaxNumMergeCand = maxNumMergeCand;  }
1563  UInt getMaxNumMergeCand               ()                  {return m_uiMaxNumMergeCand;                  }
1564
1565  Void setSliceMode                     ( UInt uiMode )     { m_uiSliceMode = uiMode;                     }
1566  UInt getSliceMode                     ()                  { return m_uiSliceMode;                       }
1567  Void setSliceArgument                 ( UInt uiArgument ) { m_uiSliceArgument = uiArgument;             }
1568  UInt getSliceArgument                 ()                  { return m_uiSliceArgument;                   }
1569  Void setSliceCurStartCUAddr           ( UInt uiAddr )     { m_uiSliceCurStartCUAddr = uiAddr;           }
1570  UInt getSliceCurStartCUAddr           ()                  { return m_uiSliceCurStartCUAddr;             }
1571  Void setSliceCurEndCUAddr             ( UInt uiAddr )     { m_uiSliceCurEndCUAddr = uiAddr;             }
1572  UInt getSliceCurEndCUAddr             ()                  { return m_uiSliceCurEndCUAddr;               }
1573  Void setSliceIdx                      ( UInt i)           { m_uiSliceIdx = i;                           }
1574  UInt getSliceIdx                      ()                  { return  m_uiSliceIdx;                       }
1575  Void copySliceInfo                    (TComSlice *pcSliceSrc);
1576  Void setEntropySliceMode              ( UInt uiMode )     { m_uiEntropySliceMode = uiMode;              }
1577  UInt getEntropySliceMode              ()                  { return m_uiEntropySliceMode;                }
1578  Void setEntropySliceArgument          ( UInt uiArgument ) { m_uiEntropySliceArgument = uiArgument;      }
1579  UInt getEntropySliceArgument          ()                  { return m_uiEntropySliceArgument;            }
1580  Void setEntropySliceCurStartCUAddr    ( UInt uiAddr )     { m_uiEntropySliceCurStartCUAddr = uiAddr;    }
1581  UInt getEntropySliceCurStartCUAddr    ()                  { return m_uiEntropySliceCurStartCUAddr;      }
1582  Void setEntropySliceCurEndCUAddr      ( UInt uiAddr )     { m_uiEntropySliceCurEndCUAddr = uiAddr;      }
1583  UInt getEntropySliceCurEndCUAddr      ()                  { return m_uiEntropySliceCurEndCUAddr;        }
1584  Void setNextSlice                     ( Bool b )          { m_bNextSlice = b;                           }
1585  Bool isNextSlice                      ()                  { return m_bNextSlice;                        }
1586  Void setNextEntropySlice              ( Bool b )          { m_bNextEntropySlice = b;                    }
1587  Bool isNextEntropySlice               ()                  { return m_bNextEntropySlice;                 }
1588  Void setSliceBits                     ( UInt uiVal )      { m_uiSliceBits = uiVal;                      }
1589  UInt getSliceBits                     ()                  { return m_uiSliceBits;                       } 
1590  Void setEntropySliceCounter           ( UInt uiVal )      { m_uiEntropySliceCounter = uiVal;            }
1591  UInt getEntropySliceCounter           ()                  { return m_uiEntropySliceCounter;             }
1592  Void setFinalized                     ( Bool uiVal )      { m_bFinalized = uiVal;                       }
1593  Bool getFinalized                     ()                  { return m_bFinalized;                        }
1594  Void  setWpScaling    ( wpScalingParam  wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); }
1595  Void  getWpScaling    ( RefPicList e, Int iRefIdx, wpScalingParam *&wp);
1596
1597  Void  resetWpScaling  (wpScalingParam  wp[2][MAX_NUM_REF][3]);
1598  Void  initWpScaling    (wpScalingParam  wp[2][MAX_NUM_REF][3]);
1599  Void  initWpScaling   ();
1600  inline Bool applyWP   () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); }
1601 
1602  Void  setWpAcDcParam  ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); }
1603  Void  getWpAcDcParam  ( wpACDCParam *&wp );
1604  Void  initWpAcDcParam ();
1605  Void  copyWPtable     (wpScalingParam *&wp_src, wpScalingParam *&wp_dst);
1606  Void  getWpScalingLC  ( Int iRefIdx, wpScalingParam *&wp);
1607  Void  resetWpScalingLC(wpScalingParam  wp[2*MAX_NUM_REF][3]);
1608  Void  setWpParamforLC();
1609  Void setTileLocationCount             ( UInt uiCount )      { m_uiTileCount = uiCount;                  }
1610  UInt getTileLocationCount             ()                    { return m_uiTileCount;                     }
1611  Void setTileLocation                  ( Int i, UInt uiLOC ) { m_uiTileByteLocation[i] = uiLOC;          }
1612  UInt getTileLocation                  ( Int i )             { return m_uiTileByteLocation[i];           }
1613  Void setTileMarkerFlag                ( Int iFlag )         { m_iTileMarkerFlag = iFlag;                }
1614  Int  getTileMarkerFlag                ()                    { return m_iTileMarkerFlag;                 }
1615  Void setTileOffstForMultES            (UInt uiOffset )      { m_uiTileOffstForMultES = uiOffset;        }
1616  UInt getTileOffstForMultES            ()                    { return m_uiTileOffstForMultES;            }
1617  Void allocSubstreamSizes              ( UInt uiNumSubstreams );
1618  UInt* getSubstreamSizes               ()                  { return m_puiSubstreamSizes; }
1619  Void  setScalingList              ( TComScalingList* scalingList ) { m_scalingList = scalingList; }
1620  TComScalingList*   getScalingList ()                               { return m_scalingList; }
1621  Void  setDefaultScalingList       ();
1622  Bool  checkDefaultScalingList     ();
1623#if CABAC_INIT_FLAG
1624  Void      setCabacInitFlag  ( Bool val ) { m_cabacInitFlag = val;      }  //!< set CABAC initial flag
1625  Bool      getCabacInitFlag  ()           { return m_cabacInitFlag;     }  //!< get CABAC initial flag
1626#else
1627  Void      setCABACinitIDC(Int iVal) {m_cabacInitIdc = iVal;    }  //!< set CABAC initial IDC number
1628  Int       getCABACinitIDC()         {return m_cabacInitIdc;    }  //!< get CABAC initial IDC number
1629#endif
1630#if TILES_WPP_ENTRY_POINT_SIGNALLING
1631  Void      setNumEntryPointOffsets(Int val)  { m_numEntryPointOffsets = val;     }
1632  Int       getNumEntryPointOffsets()         { return m_numEntryPointOffsets;    }
1633#endif
1634
1635  Void setViewId( Int viewId )       { m_viewId = viewId;   }
1636  Int  getViewId()                   { return m_viewId;     }
1637#if QC_MVHEVC_B0046
1638  Void    setViewOrderIdx(Int v, UInt layer)                { m_iViewOrderIdx = v;    }
1639  Int     getViewOrderIdx()                                 { return m_iViewOrderIdx; }
1640#endif
1641  Void setIsDepth( Bool isDepth )    { m_isDepth = isDepth; }
1642  Bool getIsDepth()                  { return m_isDepth;    }
1643 
1644  Void      initMultiviewSlice    ( Int** aaiScale = 0, Int** aaiOffset = 0 );
1645
1646  Int*      getCodedScale         ()  { return m_aaiCodedScale [0]; }
1647  Int*      getCodedOffset        ()  { return m_aaiCodedOffset[0]; }
1648  Int*      getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
1649  Int*      getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
1650
1651#if LGE_ILLUCOMP_B0045
1652  Void      setApplyIC            ( Bool b ) { m_bApplyIC = b; }
1653  Bool      getApplyIC            ()  { return m_bApplyIC; }
1654  Void      xSetApplyIC           ();
1655#endif
1656
1657protected:
1658  TComPic*  xGetRefPic        (TComList<TComPic*>& rcListPic, UInt uiPOC);
1659  TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, UInt uiPOC);
1660  TComPic*  xGetInterViewRefPic( std::vector<TComPic*>& rcListIvPic, UInt uiViewId );
1661};// END CLASS DEFINITION TComSlice
1662
1663
1664template <class T> class ParameterSetMap
1665{
1666public:
1667  ParameterSetMap(Int maxId)
1668  :m_maxId (maxId)
1669  {}
1670
1671  ~ParameterSetMap()
1672  {
1673    for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++)
1674    {
1675      delete (*i).second;
1676    }
1677  }
1678
1679  Void storePS(Int psId, T *ps)
1680  {
1681    assert ( psId < m_maxId );
1682    if ( m_paramsetMap.find(psId) != m_paramsetMap.end() )
1683    {
1684      delete m_paramsetMap[psId];
1685    }
1686    m_paramsetMap[psId] = ps; 
1687  }
1688
1689  Void mergePSList(ParameterSetMap<T> &rPsList)
1690  {
1691    for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++)
1692    {
1693      storePS(i->first, i->second);
1694    }
1695    rPsList.m_paramsetMap.clear();
1696  }
1697
1698
1699  T* getPS(Int psId)
1700  {
1701    return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId];
1702  }
1703
1704  T* getFirstPS()
1705  {
1706    return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second;
1707  }
1708
1709#if QC_MVHEVC_B0046
1710  Void clearPSList()
1711  {
1712    m_paramsetMap.clear();
1713  }
1714#endif
1715private:
1716  std::map<Int,T *> m_paramsetMap;
1717  Int               m_maxId;
1718};
1719
1720class ParameterSetManager
1721{
1722public:
1723  ParameterSetManager();
1724  virtual ~ParameterSetManager();
1725#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
1726  //! store video parameter set and take ownership of it
1727  Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); };
1728  //! get pointer to existing video parameter set 
1729  TComVPS* getVPS(Int vpsId)  { return m_vpsMap.getPS(vpsId); };
1730  TComVPS* getFirstVPS()      { return m_vpsMap.getFirstPS(); };
1731#if QC_MVHEVC_B0046
1732  Void     clearVPS()         { m_vpsMap.clearPSList(); };
1733  Void     clearSPS()         { m_spsMap.clearPSList(); };
1734  Void     clearPPS()         { m_ppsMap.clearPSList(); };
1735#endif
1736#endif
1737  //! store sequence parameter set and take ownership of it
1738  Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); };
1739  //! get pointer to existing sequence parameter set 
1740  TComSPS* getSPS(Int spsId)  { return m_spsMap.getPS(spsId); };
1741  TComSPS* getFirstSPS()      { return m_spsMap.getFirstPS(); };
1742
1743  //! store picture parameter set and take ownership of it
1744  Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); };
1745  //! get pointer to existing picture parameter set 
1746  TComPPS* getPPS(Int ppsId)  { return m_ppsMap.getPS(ppsId); };
1747  TComPPS* getFirstPPS()      { return m_ppsMap.getFirstPS(); };
1748
1749  //! store adaptation parameter set and take ownership of it
1750  Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); };
1751  //! getPointer to existing adaptation parameter set 
1752  TComAPS* getAPS(Int apsId)  { return m_apsMap.getPS(apsId); };
1753
1754protected:
1755  ParameterSetMap<TComSPS> m_spsMap; 
1756  ParameterSetMap<TComPPS> m_ppsMap; 
1757  ParameterSetMap<TComAPS> m_apsMap; 
1758#if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046
1759  ParameterSetMap<TComVPS> m_vpsMap; 
1760#endif
1761};
1762
1763//! \}
1764
1765#endif // __TCOMSLICE__
Note: See TracBrowser for help on using the repository browser.