Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.h


Ignore:
Timestamp:
11 May 2012, 21:20:17 (13 years ago)
Author:
hschwarz
Message:

updated trunk (move to HM6.1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r42 r56  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license.
     4 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2011, ISO/IEC
     6 * Copyright (c) 2010-2012, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    1515 *    this list of conditions and the following disclaimer in the documentation
    1616 *    and/or other materials provided with the distribution.
    17  *  * Neither the name of the ISO/IEC nor the names of its contributors may
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    1818 *    be used to endorse or promote products derived from this software without
    1919 *    specific prior written permission.
     
    3232 */
    3333
    34 
    35 
    3634/** \file     TComSlice.h
    3735    \brief    slice header and SPS class (header)
     
    4139#define __TCOMSLICE__
    4240
    43 
     41#include <cstring>
     42#include <map>
     43#include <vector>
    4444#include "CommonDef.h"
    45 #ifdef WEIGHT_PRED
    46   #include <string.h>   // To avoid compilation failure with some g++ linux compilators...
    47 #endif
     45#include "TComRom.h"
    4846#include "TComList.h"
    49 #include <math.h>
     47
     48//! \ingroup TLibCommon
     49//! \{
    5050
    5151class TComPic;
     52class TComTrQuant;
    5253#if DEPTH_MAP_GENERATION
    5354class TComDepthMapGenerator;
     
    5657class TComResidualGenerator;
    5758#endif
     59// ====================================================================================================================
     60// Constants
     61// ====================================================================================================================
     62
     63/// max number of supported APS in software
     64#define MAX_NUM_SUPPORTED_APS 1
    5865
    5966// ====================================================================================================================
    6067// Class definition
    6168// ====================================================================================================================
     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
    62145
    63146/// SPS class
     
    65148{
    66149private:
     150  Int         m_SPSId;
     151  Int         m_ProfileIdc;
     152  Int         m_LevelIdc;
     153  Int         m_chromaFormatIdc;
     154
     155  UInt        m_uiMaxTLayers;           // maximum number of temporal layers
     156
     157  UInt        m_uiViewId;
     158  Int         m_iViewOrderIdx;
     159  Bool        m_bDepth;
     160  UInt        m_uiCamParPrecision;
     161  Bool        m_bCamParInSliceHeader;
     162  Int         m_aaiCodedScale [2][MAX_VIEW_NUM];
     163  Int         m_aaiCodedOffset[2][MAX_VIEW_NUM];
     164
    67165  // Structure
    68   UInt        m_uiSPSId;
    69   UInt        m_uiWidth;
    70   UInt        m_uiHeight;
     166  UInt        m_picWidthInLumaSamples;
     167  UInt        m_picHeightInLumaSamples;
     168#if PIC_CROPPING
     169  Bool        m_picCroppingFlag;
     170  Int         m_picCropLeftOffset;
     171  Int         m_picCropRightOffset;
     172  Int         m_picCropTopOffset;
     173  Int         m_picCropBottomOffset;
     174#else
    71175  Int         m_aiPad[2];
     176#endif
    72177  UInt        m_uiMaxCUWidth;
    73178  UInt        m_uiMaxCUHeight;
     
    75180  UInt        m_uiMinTrDepth;
    76181  UInt        m_uiMaxTrDepth;
    77 
    78 #if BITSTREAM_EXTRACTION
    79   UInt        m_uiLayerId;
    80 #endif
    81   UInt        m_uiViewId;
    82   Int         m_iViewOrderIdx;
    83   Bool        m_bDepth;
    84   UInt        m_uiCamParPrecision;
    85   Bool        m_bCamParInSliceHeader;
    86   Int         m_aaiCodedScale [2][MAX_NUMBER_VIEWS];
    87   Int         m_aaiCodedOffset[2][MAX_NUMBER_VIEWS];
     182#if RPS_IN_SPS
     183  TComRPSList* m_RPSList;
     184  Bool        m_bLongTermRefsPresent;
     185#endif
     186#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     187  Int         m_numReorderPics[MAX_TLAYER];
     188#else
     189  Int         m_maxNumberOfReferencePictures;
     190  Int         m_numReorderFrames;
     191#endif
     192 
     193  Int         m_iNumberOfUsableInterViewRefs;
     194  Int         m_aiUsableInterViewRefs[MAX_VIEW_NUM];
    88195
    89196  // Tool list
     
    92199  UInt        m_uiQuadtreeTUMaxDepthInter;
    93200  UInt        m_uiQuadtreeTUMaxDepthIntra;
     201  Bool        m_usePCM;
     202  UInt        m_pcmLog2MaxSize;
     203  UInt        m_uiPCMLog2MinSize;
     204  Bool        m_bDisInter4x4;
     205  Bool        m_useAMP;
    94206  Bool        m_bUseALF;
    95   Bool        m_bUseDQP;
    96 #if !HHI_NO_LowDelayCoding
    97   Bool        m_bUseLDC;
    98 #endif
     207#if LCU_SYNTAX_ALF
     208  Bool        m_bALFCoefInSlice;
     209#endif
     210#if !PIC_CROPPING
    99211  Bool        m_bUsePAD;
    100   Bool        m_bUseMRG; // SOPH:
    101 
    102 #if LM_CHROMA
     212#endif
    103213  Bool        m_bUseLMChroma; // JL:
    104 #endif
    105 
    106 #if DCM_COMB_LIST
     214
    107215  Bool        m_bUseLComb;
    108216  Bool        m_bLCMod;
    109 #endif
    110 
    111 #if HHI_RMP_SWITCH
    112   Bool        m_bUseRMP;
    113 #endif
     217  Bool        m_useNSQT;
     218 
     219#if H0412_REF_PIC_LIST_RESTRICTION
     220  Bool        m_restrictedRefPicListsFlag;
     221  Bool        m_listsModificationPresentFlag;
     222#endif
     223
    114224  // Parameter
    115225  AMVP_MODE   m_aeAMVPMode[MAX_CU_DEPTH];
    116226  UInt        m_uiBitDepth;
    117227  UInt        m_uiBitIncrement;
    118 
     228#if H0736_AVC_STYLE_QP_RANGE
     229  Int         m_qpBDOffsetY;
     230  Int         m_qpBDOffsetC;
     231#endif
     232
     233#if LOSSLESS_CODING
     234  Bool        m_useLossless;
     235#endif
     236
     237  UInt        m_uiPCMBitDepthLuma;
     238  UInt        m_uiPCMBitDepthChroma;
     239  Bool        m_bPCMFilterDisableFlag;
     240
     241  UInt        m_uiBitsForPOC;
    119242  // Max physical transform size
    120243  UInt        m_uiMaxTrSize;
    121 
     244 
    122245  Int m_iAMPAcc[MAX_CU_DEPTH];
    123246
    124 #if MTK_NONCROSS_INLOOP_FILTER
    125247  Bool        m_bLFCrossSliceBoundaryFlag;
    126 #endif
    127 #if MTK_SAO
    128   Bool        m_bUseSAO;
    129 #endif
     248  Bool        m_bUseSAO;
    130249#if HHI_MPI
    131250  Bool        m_bUseMVI;
    132251#endif
    133252
    134   UInt m_uiCodedPictureBufferSize ;
     253  Bool     m_bLFCrossTileBoundaryFlag;
     254  Int      m_iUniformSpacingIdr;
     255  Int      m_iTileBoundaryIndependenceIdr;
     256  Int      m_iNumColumnsMinus1;
     257  UInt*    m_puiColumnWidth;
     258  Int      m_iNumRowsMinus1;
     259  UInt*    m_puiRowHeight;
     260 
     261  Bool        m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
     262
     263  Bool        m_scalingListEnabledFlag;
     264#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     265  UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
     266  UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];
     267#else
     268  UInt        m_uiMaxDecFrameBuffering;
     269  UInt        m_uiMaxLatencyIncrease;
     270#endif
     271
     272  Bool        m_useDF;
     273
     274#if TILES_WPP_ENTRY_POINT_SIGNALLING
     275  UInt        m_tilesOrEntropyCodingSyncIdc;
     276  Int         m_numSubstreams;
     277#endif
    135278
    136279#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    137280  Bool  m_bUseDMM;
    138 #endif
    139 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
    140   Bool  m_bUseDMM34;
    141281#endif
    142282
     
    144284  UInt  m_uiPredDepthMapGeneration;
    145285  UInt  m_uiPdmPrecision;
    146   Int   m_aiPdmScaleNomDelta[MAX_NUMBER_VIEWS];
    147   Int   m_aiPdmOffset       [MAX_NUMBER_VIEWS];
    148 #endif
     286  Int   m_aiPdmScaleNomDelta[MAX_VIEW_NUM];
     287  Int   m_aiPdmOffset       [MAX_VIEW_NUM];
     288#endif
     289
    149290#if HHI_INTER_VIEW_MOTION_PRED
    150291  UInt  m_uiMultiviewMvPredMode;
     
    165306  virtual ~TComSPS();
    166307
     308  Int  getSPSId       ()         { return m_SPSId;          }
     309  Void setSPSId       (Int i)    { m_SPSId = i;             }
     310  Int  getProfileIdc  ()         { return m_ProfileIdc;     }
     311  Void setProfileIdc  (Int i)    { m_ProfileIdc = i;        }
     312  Int  getLevelIdc    ()         { return m_LevelIdc;       }
     313  Void setLevelIdc    (Int i)    { m_LevelIdc = i;          }
     314
     315  Int  getChromaFormatIdc ()         { return m_chromaFormatIdc;       }
     316  Void setChromaFormatIdc (Int i)    { m_chromaFormatIdc = i;          }
     317 
    167318  // structure
    168   Void setSPSId       ( UInt u ) { m_uiSPSId = u;           }
    169   UInt getSPSId       ()         { return m_uiSPSId;        }
    170   Void setWidth       ( UInt u ) { m_uiWidth = u;           }
    171   UInt getWidth       ()         { return  m_uiWidth;       }
    172   Void setHeight      ( UInt u ) { m_uiHeight = u;          }
    173   UInt getHeight      ()         { return  m_uiHeight;      }
     319  Void setPicWidthInLumaSamples       ( UInt u ) { m_picWidthInLumaSamples = u;        }
     320  UInt getPicWidthInLumaSamples       ()         { return  m_picWidthInLumaSamples;    }
     321  Void setPicHeightInLumaSamples      ( UInt u ) { m_picHeightInLumaSamples = u;       }
     322  UInt getPicHeightInLumaSamples      ()         { return  m_picHeightInLumaSamples;   }
     323
     324#if PIC_CROPPING
     325  Bool getPicCroppingFlag() const          { return m_picCroppingFlag; }
     326  Void setPicCroppingFlag(Bool val)        { m_picCroppingFlag = val; }
     327  Int  getPicCropLeftOffset() const        { return m_picCropLeftOffset; }
     328  Void setPicCropLeftOffset(Int val)       { m_picCropLeftOffset = val; }
     329  Int  getPicCropRightOffset() const       { return m_picCropRightOffset; }
     330  Void setPicCropRightOffset(Int val)      { m_picCropRightOffset = val; }
     331  Int  getPicCropTopOffset() const         { return m_picCropTopOffset; }
     332  Void setPicCropTopOffset(Int val)        { m_picCropTopOffset = val; }
     333  Int  getPicCropBottomOffset() const      { return m_picCropBottomOffset; }
     334  Void setPicCropBottomOffset(Int val)     { m_picCropBottomOffset = val; }
     335#endif
     336
    174337  Void setMaxCUWidth  ( UInt u ) { m_uiMaxCUWidth = u;      }
    175338  UInt getMaxCUWidth  ()         { return  m_uiMaxCUWidth;  }
     
    178341  Void setMaxCUDepth  ( UInt u ) { m_uiMaxCUDepth = u;      }
    179342  UInt getMaxCUDepth  ()         { return  m_uiMaxCUDepth;  }
     343  Void setUsePCM      ( Bool b ) { m_usePCM = b;           }
     344  Bool getUsePCM      ()         { return m_usePCM;        }
     345  Void setPCMLog2MaxSize  ( UInt u ) { m_pcmLog2MaxSize = u;      }
     346  UInt getPCMLog2MaxSize  ()         { return  m_pcmLog2MaxSize;  }
     347  Void setPCMLog2MinSize  ( UInt u ) { m_uiPCMLog2MinSize = u;      }
     348  UInt getPCMLog2MinSize  ()         { return  m_uiPCMLog2MinSize;  }
     349  Void setBitsForPOC  ( UInt u ) { m_uiBitsForPOC = u;      }
     350  UInt getBitsForPOC  ()         { return m_uiBitsForPOC;   }
     351  Bool getDisInter4x4()         { return m_bDisInter4x4;        }
     352  Void setDisInter4x4      ( Bool b ) { m_bDisInter4x4  = b;          }
     353  Bool getUseAMP() { return m_useAMP; }
     354  Void setUseAMP( Bool b ) { m_useAMP = b; }
    180355  Void setMinTrDepth  ( UInt u ) { m_uiMinTrDepth = u;      }
    181356  UInt getMinTrDepth  ()         { return  m_uiMinTrDepth;  }
     
    190365  UInt getQuadtreeTUMaxDepthInter()         { return m_uiQuadtreeTUMaxDepthInter; }
    191366  UInt getQuadtreeTUMaxDepthIntra()         { return m_uiQuadtreeTUMaxDepthIntra; }
     367#if !PIC_CROPPING
    192368  Void setPad         (Int iPad[2]) { m_aiPad[0] = iPad[0]; m_aiPad[1] = iPad[1]; }
     369#endif
     370#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     371  Void setNumReorderPics(Int i, UInt tlayer)              { m_numReorderPics[tlayer] = i;    }
     372  Int  getNumReorderPics(UInt tlayer)                     { return m_numReorderPics[tlayer]; }
     373#else
     374  Void setMaxNumberOfReferencePictures( Int u )  { m_maxNumberOfReferencePictures = u;    }
     375  Int  getMaxNumberOfReferencePictures()         { return m_maxNumberOfReferencePictures; }
     376  Void setNumReorderFrames( Int i )              { m_numReorderFrames = i;    }
     377  Int  getNumReorderFrames()                     { return m_numReorderFrames; }
     378#endif
     379#if RPS_IN_SPS
     380  Void      setRPSList( TComRPSList* RPSList )   { m_RPSList = RPSList;       }
     381  TComRPSList* getRPSList()                      { return m_RPSList;          }
     382  Bool      getLongTermRefsPresent()         { return m_bLongTermRefsPresent; }
     383  Void      setLongTermRefsPresent(Bool b)   { m_bLongTermRefsPresent=b;      }
     384#endif
     385
     386  Void setNumberOfUsableInterViewRefs( Int number )      { m_iNumberOfUsableInterViewRefs = number;    }
     387  Int  getNumberOfUsableInterViewRefs()                  { return m_iNumberOfUsableInterViewRefs;      }
     388  Void setUsableInterViewRef( Int pos, Int deltaViewId ) { m_aiUsableInterViewRefs[pos] = deltaViewId; }
     389  Int  getUsableInterViewRef( Int pos )                  { return m_aiUsableInterViewRefs[pos];        }
     390
     391#if !PIC_CROPPING
    193392  Void setPadX        ( Int  u ) { m_aiPad[0] = u; }
    194393  Void setPadY        ( Int  u ) { m_aiPad[1] = u; }
    195394  Int  getPad         ( Int  u ) { assert(u < 2); return m_aiPad[u];}
    196395  Int* getPad         ( )        { return m_aiPad; }
    197 
    198   Void        initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
    199   Void        initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
    200 
    201   UInt        getViewId             ()  { return m_uiViewId; }
    202   Int         getViewOrderIdx       ()  { return m_iViewOrderIdx; }
    203   Bool        isDepth               ()  { return m_bDepth; }
    204   UInt        getCamParPrecision    ()  { return m_uiCamParPrecision; }
    205   Bool        hasCamParInSliceHeader()  { return m_bCamParInSliceHeader; }
    206   Int*        getCodedScale         ()  { return m_aaiCodedScale [0]; }
    207   Int*        getCodedOffset        ()  { return m_aaiCodedOffset[0]; }
    208   Int*        getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
    209   Int*        getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
    210 
     396#endif
     397 
    211398  // physical transform
    212399  Void setMaxTrSize   ( UInt u ) { m_uiMaxTrSize = u;       }
    213400  UInt getMaxTrSize   ()         { return  m_uiMaxTrSize;   }
    214 
     401 
    215402  // Tool list
    216403  Bool getUseALF      ()         { return m_bUseALF;        }
    217   Bool getUseDQP      ()         { return m_bUseDQP;        }
    218 
    219 #if !HHI_NO_LowDelayCoding
    220   Bool getUseLDC      ()         { return m_bUseLDC;        }
    221 #endif
     404#if LCU_SYNTAX_ALF
     405  Void setUseALFCoefInSlice(Bool b) {m_bALFCoefInSlice = b;}
     406  Bool getUseALFCoefInSlice()    {return m_bALFCoefInSlice;}
     407#endif
     408
     409#if !PIC_CROPPING
    222410  Bool getUsePAD      ()         { return m_bUsePAD;        }
    223   Bool getUseMRG      ()         { return m_bUseMRG;        } // SOPH:
    224 
     411  Void setUsePAD      ( Bool b ) { m_bUsePAD   = b;         }
     412#endif
    225413  Void setUseALF      ( Bool b ) { m_bUseALF  = b;          }
    226   Void setUseDQP      ( Bool b ) { m_bUseDQP   = b;         }
    227 
    228 #if !HHI_NO_LowDelayCoding
    229   Void setUseLDC      ( Bool b ) { m_bUseLDC   = b;         }
    230 #endif
    231   Void setUsePAD      ( Bool b ) { m_bUsePAD   = b;         }
    232   Void setUseMRG      ( Bool b ) { m_bUseMRG  = b;          } // SOPH:
    233  
    234 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
    235   Bool getUseDMM()         { return m_bUseDMM; }
    236   Void setUseDMM( Bool b ) { m_bUseDMM = b;    }
    237 #endif
    238 #if HHI_DMM_PRED_TEX && FLEX_CODING_ORDER
    239   Bool getUseDMM34()         { return m_bUseDMM34; }
    240   Void setUseDMM34( Bool b ) { m_bUseDMM34 = b;    }
    241 #endif
    242 
    243 #if DCM_COMB_LIST
    244414  Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
    245415  Bool getUseLComb    ()         { return m_bUseLComb;      }
    246416  Void setLCMod       (Bool b)   { m_bLCMod = b;     }
    247417  Bool getLCMod       ()         { return m_bLCMod;  }
    248 #endif
    249 
    250 #if HHI_RMP_SWITCH
    251   Bool getUseRMP     ()         { return m_bUseRMP; }
    252   Void setUseRMP     ( Bool b ) { m_bUseRMP = b;    }
    253 #endif
    254 
    255 #if LM_CHROMA
     418
    256419  Bool getUseLMChroma ()         { return m_bUseLMChroma;        }
    257420  Void setUseLMChroma ( Bool b ) { m_bUseLMChroma  = b;          }
     421
     422#if LOSSLESS_CODING
     423  Bool getUseLossless ()         { return m_useLossless; }
     424  Void setUseLossless ( Bool b ) { m_useLossless  = b; }
     425#endif
     426  Bool getUseNSQT() { return m_useNSQT; }
     427  Void setUseNSQT( Bool b ) { m_useNSQT = b; }
     428 
     429#if H0412_REF_PIC_LIST_RESTRICTION
     430  Bool getRestrictedRefPicListsFlag    ()          { return m_restrictedRefPicListsFlag;   }
     431  Void setRestrictedRefPicListsFlag    ( Bool b )  { m_restrictedRefPicListsFlag = b;      }
     432  Bool getListsModificationPresentFlag ()          { return m_listsModificationPresentFlag; }
     433  Void setListsModificationPresentFlag ( Bool b )  { m_listsModificationPresentFlag = b;    }
    258434#endif
    259435
     
    261437  AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth);  return m_aeAMVPMode[uiDepth]; }
    262438  Void      setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth);  m_aeAMVPMode[uiDepth] = eMode; }
     439 
     440  // AMP accuracy
     441  Int       getAMPAcc   ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; }
     442  Void      setAMPAcc   ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth);  m_iAMPAcc[uiDepth] = iAccu; }
    263443
    264444  // Bit-depth
     
    267447  UInt      getBitIncrement ()         { return m_uiBitIncrement; }
    268448  Void      setBitIncrement ( UInt u ) { m_uiBitIncrement = u;    }
    269 
    270 #if MTK_NONCROSS_INLOOP_FILTER
     449#if H0736_AVC_STYLE_QP_RANGE
     450  Int       getQpBDOffsetY  ()             { return m_qpBDOffsetY;   }
     451  Void      setQpBDOffsetY  ( Int value  ) { m_qpBDOffsetY = value;  }
     452  Int       getQpBDOffsetC  ()             { return m_qpBDOffsetC;   }
     453  Void      setQpBDOffsetC  ( Int value  ) { m_qpBDOffsetC = value;  }
     454#endif
     455
    271456  Void      setLFCrossSliceBoundaryFlag     ( Bool   bValue  )    { m_bLFCrossSliceBoundaryFlag = bValue; }
    272   Bool      getLFCrossSliceBoundaryFlag     ()                    { return m_bLFCrossSliceBoundaryFlag;   }
    273 #endif
    274 
    275 #if MTK_SAO
     457  Bool      getLFCrossSliceBoundaryFlag     ()                    { return m_bLFCrossSliceBoundaryFlag;   }
     458
     459  Void setUseDF                   ( Bool b ) { m_useDF = b; }
     460  Bool getUseDF                   ()         { return m_useDF; }
     461
    276462  Void setUseSAO                  (Bool bVal)  {m_bUseSAO = bVal;}
    277463  Bool getUseSAO                  ()           {return m_bUseSAO;}
    278 #endif
    279464
    280465#if HHI_MPI
     
    283468#endif
    284469
    285   Void      setCodedPictureBufferSize( UInt u ) { m_uiCodedPictureBufferSize = u ;}
    286   UInt      getCodedPictureBufferSize( )        { return m_uiCodedPictureBufferSize ;}
     470  UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
     471  Void      setMaxTLayers( UInt uiMaxTLayers )        { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
     472
     473  Bool      getTemporalIdNestingFlag()                { return m_bTemporalIdNestingFlag; }
     474  Void      setTemporalIdNestingFlag( Bool bValue )   { m_bTemporalIdNestingFlag = bValue; }
     475  UInt      getPCMBitDepthLuma     ()         { return m_uiPCMBitDepthLuma;     }
     476  Void      setPCMBitDepthLuma     ( UInt u ) { m_uiPCMBitDepthLuma = u;        }
     477  UInt      getPCMBitDepthChroma   ()         { return m_uiPCMBitDepthChroma;   }
     478  Void      setPCMBitDepthChroma   ( UInt u ) { m_uiPCMBitDepthChroma = u;      }
     479  Void      setPCMFilterDisableFlag     ( Bool   bValue  )    { m_bPCMFilterDisableFlag = bValue; }
     480  Bool      getPCMFilterDisableFlag     ()                    { return m_bPCMFilterDisableFlag;   }
     481
     482  Void    setLFCrossTileBoundaryFlag               ( Bool   bValue  )    { m_bLFCrossTileBoundaryFlag = bValue; }
     483  Bool    getLFCrossTileBoundaryFlag               ()                    { return m_bLFCrossTileBoundaryFlag;   }
     484  Void     setUniformSpacingIdr             ( Int i )           { m_iUniformSpacingIdr = i; }
     485  Int      getUniformSpacingIdr             ()                  { return m_iUniformSpacingIdr; }
     486#if !REMOVE_TILE_DEPENDENCE
     487  Void     setTileBoundaryIndependenceIdr   ( Int i )           { m_iTileBoundaryIndependenceIdr = i; }
     488  Int      getTileBoundaryIndependenceIdr   ()                  { return m_iTileBoundaryIndependenceIdr; }
     489#endif
     490  Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
     491  Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
     492  Void     setColumnWidth ( UInt* columnWidth )
     493  {
     494    if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
     495    {
     496      m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
     497
     498      for(Int i=0; i<m_iNumColumnsMinus1; i++)
     499      {
     500        m_puiColumnWidth[i] = columnWidth[i];
     501     }
     502    }
     503  }
     504  UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
     505  Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
     506  Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
     507  Void     setRowHeight    ( UInt* rowHeight )
     508  {
     509    if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
     510    {
     511      m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
     512
     513      for(Int i=0; i<m_iNumRowsMinus1; i++)
     514      {
     515        m_puiRowHeight[i] = rowHeight[i];
     516      }
     517    }
     518  }
     519  UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
     520  Bool getScalingListFlag       ()         { return m_scalingListEnabledFlag;     }
     521  Void setScalingListFlag       ( Bool b ) { m_scalingListEnabledFlag  = b;       }
     522#if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER
     523  UInt getMaxDecPicBuffering  (UInt tlayer)            { return m_uiMaxDecPicBuffering[tlayer]; }
     524  Void setMaxDecPicBuffering  ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui;   }
     525  UInt getMaxLatencyIncrease  (UInt tlayer)            { return m_uiMaxLatencyIncrease[tlayer];   }
     526  Void setMaxLatencyIncrease  ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui;      }
     527#else
     528  UInt getMaxDecFrameBuffering  ()            { return m_uiMaxDecFrameBuffering; }
     529  Void setMaxDecFrameBuffering  ( UInt ui )   { m_uiMaxDecFrameBuffering = ui;   }
     530  UInt getMaxLatencyIncrease    ()            { return m_uiMaxLatencyIncrease;   }
     531  Void setMaxLatencyIncrease    ( UInt ui )   { m_uiMaxLatencyIncrease= ui;      }
     532#endif
     533#if TILES_WPP_ENTRY_POINT_SIGNALLING
     534  UInt getTilesOrEntropyCodingSyncIdc ()                    { return m_tilesOrEntropyCodingSyncIdc;   }
     535  Void setTilesOrEntropyCodingSyncIdc ( UInt val )          { m_tilesOrEntropyCodingSyncIdc = val;    }
     536  Int  getNumSubstreams               ()                    { return m_numSubstreams;                 }
     537  Void setNumSubstreams               ( Int numSubstreams ) { m_numSubstreams = numSubstreams;        }
     538#endif
     539
     540#if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX
     541  Bool getUseDMM()         { return m_bUseDMM; }
     542  Void setUseDMM( Bool b ) { m_bUseDMM = b;    }
     543#endif
     544
     545  Void initMultiviewSPS      ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 );
     546  Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx );
     547
     548  UInt getViewId             ()  { return m_uiViewId; }
     549  Int  getViewOrderIdx       ()  { return m_iViewOrderIdx; }
     550  Bool isDepth               ()  { return m_bDepth; }
     551  UInt getCamParPrecision    ()  { return m_uiCamParPrecision; }
     552  Bool hasCamParInSliceHeader()  { return m_bCamParInSliceHeader; }
     553  Int* getCodedScale         ()  { return m_aaiCodedScale [0]; }
     554  Int* getCodedOffset        ()  { return m_aaiCodedOffset[0]; }
     555  Int* getInvCodedScale      ()  { return m_aaiCodedScale [1]; }
     556  Int* getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
     557
    287558
    288559#if DEPTH_MAP_GENERATION
    289   Void  setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 );
     560  Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 );
    290561#endif
    291562#if HHI_INTER_VIEW_RESIDUAL_PRED
     
    294565
    295566#if DEPTH_MAP_GENERATION
    296   UInt  getPredDepthMapGeneration()          { return m_uiPredDepthMapGeneration; }
    297   UInt  getPdmPrecision          ()          { return m_uiPdmPrecision;           }
    298   Int*  getPdmScaleNomDelta      ()          { return m_aiPdmScaleNomDelta;       }
    299   Int*  getPdmOffset             ()          { return m_aiPdmOffset;              }
    300 #endif
     567  UInt getPredDepthMapGeneration()          { return m_uiPredDepthMapGeneration; }
     568  UInt getPdmPrecision          ()          { return m_uiPdmPrecision;           }
     569  Int* getPdmScaleNomDelta      ()          { return m_aiPdmScaleNomDelta;       }
     570  Int* getPdmOffset             ()          { return m_aiPdmOffset;              }
     571#endif
     572
    301573#if HHI_INTER_VIEW_MOTION_PRED
    302574  UInt  getMultiviewMvPredMode   ()          { return m_uiMultiviewMvPredMode;    }
     
    314586  TComResidualGenerator*  getResidualGenerator()                                              { return m_pcResidualGenerator; }
    315587#endif
    316 
    317 #if BITSTREAM_EXTRACTION
    318   Void      setLayerId              ( UInt u ) { m_uiLayerId = u; }
    319   UInt      getLayerId              ()         { return m_uiLayerId; }
    320 #endif
     588};
     589
     590#if !RPS_IN_SPS
     591/// Reference Picture Set class
     592class TComReferencePictureSet
     593{
     594private:
     595  Int m_numberOfPictures;
     596  Int m_numberOfNegativePictures;
     597  Int m_numberOfPositivePictures;
     598  Int m_numberOfLongtermPictures;
     599  Int  m_deltaPOC[MAX_NUM_REF_PICS];
     600  Int  m_POC[MAX_NUM_REF_PICS];
     601  Bool m_used[MAX_NUM_REF_PICS];
     602  Bool m_interRPSPrediction;
     603  Int  m_deltaRIdxMinus1;   
     604  Int  m_deltaRPS;
     605  Int  m_numRefIdc;
     606  Int  m_refIdc[MAX_NUM_REF_PICS+1];
     607
     608public:
     609  TComReferencePictureSet();
     610  virtual ~TComReferencePictureSet();
     611
     612  Void setUsed(Int bufferNum, Bool used);
     613  Void setDeltaPOC(Int bufferNum, Int deltaPOC);
     614  Void setPOC(Int bufferNum, Int deltaPOC);
     615  Void setNumberOfPictures(Int numberOfPictures);
     616
     617  Int  getUsed(Int bufferNum);
     618  Int  getDeltaPOC(Int bufferNum);
     619  Int  getPOC(Int bufferNum);
     620  Int  getNumberOfPictures();
     621
     622  Void setNumberOfNegativePictures(Int number)  { m_numberOfNegativePictures = number; }
     623  Int  getNumberOfNegativePictures()            { return m_numberOfNegativePictures; }
     624  Void setNumberOfPositivePictures(Int number)  { m_numberOfPositivePictures = number; }
     625  Int  getNumberOfPositivePictures()            { return m_numberOfPositivePictures; }
     626  Void setNumberOfLongtermPictures(Int number)  { m_numberOfLongtermPictures = number; }
     627  Int  getNumberOfLongtermPictures()            { return m_numberOfLongtermPictures; }
     628
     629  Void setInterRPSPrediction(Bool flag)         { m_interRPSPrediction = flag; }
     630  Bool getInterRPSPrediction()                  { return m_interRPSPrediction; }
     631  Void setDeltaRIdxMinus1(Int x)                { m_deltaRIdxMinus1 = x; }
     632  Int  getDeltaRIdxMinus1()                     { return m_deltaRIdxMinus1; }
     633  Void setDeltaRPS(Int x)                       { m_deltaRPS = x; }
     634  Int  getDeltaRPS()                            { return m_deltaRPS; }
     635  Void setNumRefIdc(Int x)                      { m_numRefIdc = x; }
     636  Int  getNumRefIdc()                           { return m_numRefIdc; }
     637
     638  Void setRefIdc(Int bufferNum, Int refIdc);
     639  Int  getRefIdc(Int bufferNum);
     640
     641  Void sortDeltaPOC();
     642  Void printDeltaPOC();
     643};
     644
     645/// Reference Picture Set set class
     646class TComRPSList
     647{
     648private:
     649  Int  m_numberOfReferencePictureSets;
     650  TComReferencePictureSet* m_referencePictureSets;
     651 
     652public:
     653  TComRPSList();
     654  virtual ~TComRPSList();
     655 
     656  Void  create  (Int numberOfEntries);
     657  Void  destroy ();
     658
     659
     660  TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum);
     661  Int getNumberOfReferencePictureSets();
     662  Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets);
     663};
     664#endif
     665
     666/// Reference Picture Lists class
     667class TComRefPicListModification
     668{
     669private:
     670  UInt      m_bRefPicListModificationFlagL0; 
     671  UInt      m_bRefPicListModificationFlagL1; 
     672#if !H0137_0138_LIST_MODIFICATION
     673  UInt      m_uiNumberOfRefPicListModificationsL0;
     674  UInt      m_uiNumberOfRefPicListModificationsL1;
     675  UInt      m_ListIdcL0[32];
     676#endif
     677  UInt      m_RefPicSetIdxL0[32];
     678#if !H0137_0138_LIST_MODIFICATION
     679  UInt      m_ListIdcL1[32];
     680#endif
     681  UInt      m_RefPicSetIdxL1[32];
     682   
     683public:
     684  TComRefPicListModification();
     685  virtual ~TComRefPicListModification();
     686 
     687  Void  create                    ();
     688  Void  destroy                   ();
     689
     690  Bool       getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; }
     691  Void       setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; }
     692  Bool       getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; }
     693  Void       setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; }
     694#if !H0137_0138_LIST_MODIFICATION
     695  UInt       getNumberOfRefPicListModificationsL0() { return m_uiNumberOfRefPicListModificationsL0; }
     696  Void       setNumberOfRefPicListModificationsL0(UInt nr) { m_uiNumberOfRefPicListModificationsL0 = nr; }
     697  UInt       getNumberOfRefPicListModificationsL1() { return m_uiNumberOfRefPicListModificationsL1; }
     698  Void       setNumberOfRefPicListModificationsL1(UInt nr) { m_uiNumberOfRefPicListModificationsL1 = nr; }
     699  Void       setListIdcL0(UInt idx, UInt idc) { m_ListIdcL0[idx] = idc; }
     700  UInt       getListIdcL0(UInt idx) { return m_ListIdcL0[idx]; }
     701#endif
     702  Void       setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; }
     703  UInt       getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; }
     704#if !H0137_0138_LIST_MODIFICATION
     705  Void       setListIdcL1(UInt idx, UInt idc) { m_ListIdcL1[idx] = idc; }
     706  UInt       getListIdcL1(UInt idx) { return m_ListIdcL1[idx]; }
     707#endif
     708  Void       setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; }
     709  UInt       getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; }
    321710};
    322711
     
    325714{
    326715private:
    327 #if CONSTRAINED_INTRA_PRED
    328   Bool        m_bConstrainedIntraPred;    //  constrained_intra_pred_flag
    329 #endif
    330 #ifdef WEIGHT_PRED
     716  Int         m_PPSId;                    // pic_parameter_set_id
     717  Int         m_SPSId;                    // seq_parameter_set_id
     718  Int         m_picInitQPMinus26;
     719  Bool        m_useDQP;
     720  Bool        m_bConstrainedIntraPred;    // constrained_intra_pred_flag
     721 
     722  // access channel
     723  TComSPS*    m_pcSPS;
     724#if !RPS_IN_SPS
     725  TComRPSList* m_RPSList;
     726#endif
     727  UInt        m_uiMaxCuDQPDepth;
     728  UInt        m_uiMinCuDQPSize;
     729
     730  Int        m_iChromaQpOffset;
     731  Int        m_iChromaQpOffset2nd;
     732
     733#if !RPS_IN_SPS
     734  Bool        m_bLongTermRefsPresent;
     735#endif
     736
     737#if !H0566_TLA
     738  UInt        m_uiNumTlayerSwitchingFlags;            // num_temporal_layer_switching_point_flags
     739  Bool        m_abTLayerSwitchingFlag[ MAX_TLAYER ];  // temporal_layer_switching_point_flag
     740#endif
     741
     742  Int         m_iSliceGranularity;
     743
    331744  Bool        m_bUseWeightPred;           // Use of Weighting Prediction (P_SLICE)
    332745  UInt        m_uiBiPredIdc;              // Use of Weighting Bi-Prediction (B_SLICE)
    333 #endif
    334   UInt        m_uiPPSId;
    335   UInt        m_uiSPSId;
    336 #if BITSTREAM_EXTRACTION
    337   UInt        m_uiLayerId;
    338 #endif
    339 
     746
     747#if H0388
     748  Bool        m_OutputFlagPresentFlag;   // Indicates the presence of output_flag in slice header
     749#endif
     750
     751  Int      m_iTileBehaviorControlPresentFlag;
     752  Bool     m_bLFCrossTileBoundaryFlag;
     753  Int      m_iColumnRowInfoPresent;
     754  Int      m_iUniformSpacingIdr;
     755#if !REMOVE_TILE_DEPENDENCE
     756  Int      m_iTileBoundaryIndependenceIdr;
     757#endif
     758  Int      m_iNumColumnsMinus1;
     759  UInt*    m_puiColumnWidth;
     760  Int      m_iNumRowsMinus1;
     761  UInt*    m_puiRowHeight;
     762 
     763  Int      m_iEntropyCodingMode; // !!! in PPS now, but also remains in slice header!
     764#if !WPP_SIMPLIFICATION 
     765  Int      m_iEntropyCodingSynchro;
     766  Bool     m_bCabacIstateReset;
     767#endif
     768  Int      m_iNumSubstreams;
     769
     770  Bool     m_enableTMVPFlag;
     771
     772#if MULTIBITS_DATA_HIDING
     773  Int      m_signHideFlag;
     774  Int      m_signHidingThreshold;
     775#endif
     776
     777#if CABAC_INIT_FLAG
     778  Bool     m_cabacInitPresentFlag;
     779  UInt     m_encCABACTableIdx;           // Used to transmit table selection across slices
     780#endif
     781#if DBL_CONTROL
     782  Bool     m_DeblockingFilterControlPresent;
     783#endif
     784#if PARALLEL_MERGE
     785  UInt m_log2ParallelMergeLevelMinus2;
     786#endif
    340787public:
    341788  TComPPS();
    342789  virtual ~TComPPS();
    343 
    344   Void      setPPSId                ( UInt u ) { m_uiPPSId = u; }
    345   UInt      getPPSId                ()         { return m_uiPPSId; }
    346   Void      setSPSId                ( UInt u ) { m_uiSPSId = u; }
    347   UInt      getSPSId                ()         { return m_uiSPSId; }
    348 #if CONSTRAINED_INTRA_PRED
     790 
     791  Int       getPPSId ()      { return m_PPSId; }
     792  Void      setPPSId (Int i) { m_PPSId = i; }
     793  Int       getSPSId ()      { return m_SPSId; }
     794  Void      setSPSId (Int i) { m_SPSId = i; }
     795 
     796  Int       getSliceGranularity()        { return m_iSliceGranularity; }
     797  Void      setSliceGranularity( Int i ) { m_iSliceGranularity = i;    }
     798  Int       getPicInitQPMinus26 ()         { return  m_picInitQPMinus26; }
     799  Void      setPicInitQPMinus26 ( Int i )  { m_picInitQPMinus26 = i;     }
     800  Bool      getUseDQP ()                   { return m_useDQP;        }
     801  Void      setUseDQP ( Bool b )           { m_useDQP   = b;         }
    349802  Bool      getConstrainedIntraPred ()         { return  m_bConstrainedIntraPred; }
    350803  Void      setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b;     }
    351 #endif
    352 
    353 #ifdef WEIGHT_PRED
    354   Bool getUseWP                     ()          { return m_bUseWeightPred;      }
    355   UInt getWPBiPredIdc               ()          { return m_uiBiPredIdc;         }
    356 
    357   Void setUseWP                     ( Bool b )  { m_bUseWeightPred = b;       }
    358   Void setWPBiPredIdc               ( UInt u )  { m_uiBiPredIdc = u;          }
    359 #endif
    360 
    361 #if BITSTREAM_EXTRACTION
    362   Void      setLayerId              ( UInt u ) { m_uiLayerId = u; }
    363   UInt      getLayerId              ()         { return m_uiLayerId; }
     804
     805#if !H0566_TLA
     806  UInt      getNumTLayerSwitchingFlags()                                  { return m_uiNumTlayerSwitchingFlags; }
     807  Void      setNumTLayerSwitchingFlags( UInt uiNumTlayerSwitchingFlags )  { assert( uiNumTlayerSwitchingFlags < MAX_TLAYER ); m_uiNumTlayerSwitchingFlags = uiNumTlayerSwitchingFlags; }
     808
     809  Bool      getTLayerSwitchingFlag( UInt uiTLayer )                       { assert( uiTLayer < MAX_TLAYER ); return m_abTLayerSwitchingFlag[ uiTLayer ]; }
     810  Void      setTLayerSwitchingFlag( UInt uiTLayer, Bool bValue )          { m_abTLayerSwitchingFlag[ uiTLayer ] = bValue; }
     811#endif
     812
     813#if !RPS_IN_SPS
     814  Bool      getLongTermRefsPresent()         { return m_bLongTermRefsPresent; }
     815  Void      setLongTermRefsPresent(Bool b)   { m_bLongTermRefsPresent=b;      }
     816#endif
     817  Void      setSPS              ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
     818  TComSPS*  getSPS              ()         { return m_pcSPS;          }
     819#if !RPS_IN_SPS
     820  Void      setRPSList          ( TComRPSList* RPSList ) { m_RPSList = RPSList; }
     821  TComRPSList* getRPSList       ()         { return m_RPSList;        }
     822#endif
     823  Void      setMaxCuDQPDepth    ( UInt u ) { m_uiMaxCuDQPDepth = u;   }
     824  UInt      getMaxCuDQPDepth    ()         { return m_uiMaxCuDQPDepth;}
     825  Void      setMinCuDQPSize     ( UInt u ) { m_uiMinCuDQPSize = u;    }
     826  UInt      getMinCuDQPSize     ()         { return m_uiMinCuDQPSize; }
     827
     828  Void      setChromaQpOffset   ( Int i ) { m_iChromaQpOffset = i; }
     829  Int       getChromaQpOffset   () { return m_iChromaQpOffset;}
     830  Void      setChromaQpOffset2nd( Int i ) { m_iChromaQpOffset2nd = i; }
     831  Int       getChromaQpOffset2nd() { return m_iChromaQpOffset2nd;}
     832
     833  Bool getUseWP                     ()          { return m_bUseWeightPred;  }
     834  UInt getWPBiPredIdc               ()          { return m_uiBiPredIdc;     }
     835
     836  Void setUseWP                     ( Bool b )  { m_bUseWeightPred = b;     }
     837  Void setWPBiPredIdc               ( UInt u )  { m_uiBiPredIdc = u;        }
     838
     839#if H0388
     840  Void      setOutputFlagPresentFlag( Bool b )  { m_OutputFlagPresentFlag = b;    }
     841  Bool      getOutputFlagPresentFlag()          { return m_OutputFlagPresentFlag; }
     842#endif
     843
     844  Void    setTileBehaviorControlPresentFlag        ( Int i )             { m_iTileBehaviorControlPresentFlag = i;    }
     845  Int     getTileBehaviorControlPresentFlag        ()                    { return m_iTileBehaviorControlPresentFlag; }
     846  Void    setLFCrossTileBoundaryFlag               ( Bool   bValue  )    { m_bLFCrossTileBoundaryFlag = bValue; }
     847  Bool    getLFCrossTileBoundaryFlag               ()                    { return m_bLFCrossTileBoundaryFlag;   }
     848  Void     setColumnRowInfoPresent          ( Int i )           { m_iColumnRowInfoPresent = i; }
     849  Int      getColumnRowInfoPresent          ()                  { return m_iColumnRowInfoPresent; }
     850  Void     setUniformSpacingIdr             ( Int i )           { m_iUniformSpacingIdr = i; }
     851  Int      getUniformSpacingIdr             ()                  { return m_iUniformSpacingIdr; }
     852#if !REMOVE_TILE_DEPENDENCE
     853  Void     setTileBoundaryIndependenceIdr   ( Int i )           { m_iTileBoundaryIndependenceIdr = i; }
     854  Int      getTileBoundaryIndependenceIdr   ()                  { return m_iTileBoundaryIndependenceIdr; }
     855#endif
     856  Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
     857  Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
     858  Void     setColumnWidth ( UInt* columnWidth )
     859  {
     860    if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
     861    {
     862      m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
     863
     864      for(Int i=0; i<m_iNumColumnsMinus1; i++)
     865      {
     866        m_puiColumnWidth[i] = columnWidth[i];
     867      }
     868    }
     869  }
     870  UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
     871  Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
     872  Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
     873  Void     setRowHeight    ( UInt* rowHeight )
     874  {
     875    if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
     876    {
     877      m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
     878
     879      for(Int i=0; i<m_iNumRowsMinus1; i++)
     880      {
     881        m_puiRowHeight[i] = rowHeight[i];
     882      }
     883    }
     884  }
     885  UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
     886  Void     setEntropyCodingMode(Int iEntropyCodingMode)       { m_iEntropyCodingMode = iEntropyCodingMode; }
     887  Int      getEntropyCodingMode()                             { return m_iEntropyCodingMode; }
     888#if !WPP_SIMPLIFICATION
     889  Void     setEntropyCodingSynchro(Int iEntropyCodingSynchro) { m_iEntropyCodingSynchro = iEntropyCodingSynchro; }
     890  Int      getEntropyCodingSynchro()                          { return m_iEntropyCodingSynchro; }
     891  Void     setCabacIstateReset(Bool bCabacIstateReset)        { m_bCabacIstateReset = bCabacIstateReset; }
     892  Bool     getCabacIstateReset()                              { return m_bCabacIstateReset; }
     893#endif
     894  Void     setNumSubstreams(Int iNumSubstreams)               { m_iNumSubstreams = iNumSubstreams; }
     895  Int      getNumSubstreams()                                 { return m_iNumSubstreams; }
     896
     897#if MULTIBITS_DATA_HIDING
     898  Void      setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; }
     899  Void      setTSIG( Int tsig )                 { m_signHidingThreshold = tsig; }
     900  Int       getSignHideFlag()                    { return m_signHideFlag; }
     901  Int       getTSIG()                            { return m_signHidingThreshold; }
     902#endif
     903
     904  Void     setEnableTMVPFlag( Bool b )  { m_enableTMVPFlag = b;    }
     905  Bool     getEnableTMVPFlag()          { return m_enableTMVPFlag; }
     906
     907#if CABAC_INIT_FLAG
     908  Void     setCabacInitPresentFlag( Bool flag )     { m_cabacInitPresentFlag = flag;    }
     909  Void     setEncCABACTableIdx( Int idx )           { m_encCABACTableIdx = idx;         }
     910  Bool     getCabacInitPresentFlag()                { return m_cabacInitPresentFlag;    }
     911  UInt     getEncCABACTableIdx()                    { return m_encCABACTableIdx;        }
     912#endif
     913#if DBL_CONTROL
     914  Void setDeblockingFilterControlPresent    ( Bool bValue )       { m_DeblockingFilterControlPresent = bValue; }
     915  Bool getDeblockingFilterControlPresent    ()                    { return m_DeblockingFilterControlPresent; }
     916#endif
     917#if PARALLEL_MERGE
     918  UInt getLog2ParallelMergeLevelMinus2      ()                    { return m_log2ParallelMergeLevelMinus2; }
     919  Void setLog2ParallelMergeLevelMinus2      (UInt mrgLevel)       { m_log2ParallelMergeLevelMinus2 = mrgLevel; }
    364920#endif
    365921};
    366922
    367 #ifdef WEIGHT_PRED
     923/// SCALING_LIST class
     924class TComScalingList
     925{
     926public:
     927  TComScalingList();
     928  virtual ~TComScalingList();
     929  Void     setScalingListPresentFlag    (Bool b)                               { m_scalingListPresentFlag = b;    }
     930  Bool     getScalingListPresentFlag    ()                                     { return m_scalingListPresentFlag; }
     931  Int*     getScalingListAddress          (UInt sizeId, UInt listId)           { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient
     932  Bool     checkPredMode                  (UInt sizeId, UInt listId);
     933  Void     setRefMatrixId                 (UInt sizeId, UInt listId, UInt u)   { m_refMatrixId[sizeId][listId] = u;    }     //!< set reference matrix ID
     934  UInt     getRefMatrixId                 (UInt sizeId, UInt listId)           { return m_refMatrixId[sizeId][listId]; }     //!< get reference matrix ID
     935  Int*     getScalingListDefaultAddress   (UInt sizeId, UInt listId);                                                        //!< get default matrix coefficient
     936  Void     processDefaultMarix            (UInt sizeId, UInt listId);
     937#if SCALING_LIST
     938  Void     setScalingListDC               (UInt sizeId, UInt listId, UInt u)   { m_scalingListDC[sizeId][listId] = u; }      //!< set DC value
     939  Int      getScalingListDC               (UInt sizeId, UInt listId)           { return m_scalingListDC[sizeId][listId]; }   //!< get DC value
     940  Void     checkDcOfMatrix                ();
     941  Void     setUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId, Bool b)   { m_useDefaultScalingMatrixFlag[sizeId][listId] = b;    } //!< set default matrix enabled/disabled in each matrix
     942  Bool     getUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId)           { return m_useDefaultScalingMatrixFlag[sizeId][listId]; } //!< get default matrix enabled/disabled in each matrix
     943#endif
     944  Void     processRefMatrix               (UInt sizeId, UInt listId , UInt refListId );
     945  Bool     xParseScalingList              (char* pchFile);
     946
     947private:
     948  Void     init                    ();
     949  Void     destroy                 ();
     950#if SCALING_LIST
     951  Int      m_scalingListDC               [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16
     952  Bool     m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag
     953#endif
     954  UInt     m_refMatrixId                 [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID
     955  Bool     m_scalingListPresentFlag;                                                //!< flag for using default matrix
     956  UInt     m_predMatrixId                [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index
     957  Int      *m_scalingListCoef            [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
     958};
     959
     960/// APS class
     961class TComAPS
     962{
     963public:
     964  TComAPS();
     965  virtual ~TComAPS();
     966
     967  Void      setAPSID      (Int iID)   {m_apsID = iID;            }  //!< set APS ID
     968  Int       getAPSID      ()          {return m_apsID;           }  //!< get APS ID
     969  Void      setSaoEnabled (Bool bVal) {m_bSaoEnabled = bVal;     }  //!< set SAO enabled/disabled in APS
     970  Bool      getSaoEnabled ()          {return m_bSaoEnabled;     }  //!< get SAO enabled/disabled in APS
     971  Void      setAlfEnabled (Bool bVal) {m_bAlfEnabled = bVal;     }  //!< set ALF enabled/disabled in APS
     972  Bool      getAlfEnabled ()          {return m_bAlfEnabled;     }  //!< get ALF enabled/disabled in APS
     973
     974#if LCU_SYNTAX_ALF
     975  AlfParamSet* getAlfParam   ()          {return m_alfParamSet;}
     976#else
     977  ALFParam* getAlfParam   ()          {return m_pAlfParam;       }  //!< get ALF parameters in APS
     978#endif
     979  SAOParam* getSaoParam   ()          {return m_pSaoParam;       }  //!< get SAO parameters in APS
     980
     981  Void      createSaoParam();   //!< create SAO parameter object
     982  Void      destroySaoParam();  //!< destroy SAO parameter object
     983
     984  Void      createAlfParam();   //!< create ALF parameter object
     985  Void      destroyAlfParam();  //!< destroy ALF parameter object
     986
     987  Void      setLoopFilterOffsetInAPS(Bool val)  {m_loopFilterOffsetInAPS = val; }      //!< set offset for deblocking filter enabled/disabled in APS
     988  Bool      getLoopFilterOffsetInAPS()          {return m_loopFilterOffsetInAPS; }     //!< get offset for deblocking filter enabled/disabled in APS
     989  Void      setLoopFilterDisable(Bool val)      {m_loopFilterDisable = val; }          //!< set offset for deblocking filter disabled
     990  Bool      getLoopFilterDisable()              {return m_loopFilterDisable; }         //!< get offset for deblocking filter disabled
     991  Void      setLoopFilterBetaOffset(Int val)    {m_loopFilterBetaOffsetDiv2 = val; }    //!< set beta offset for deblocking filter
     992  Int       getLoopFilterBetaOffset()           {return m_loopFilterBetaOffsetDiv2; }   //!< get beta offset for deblocking filter
     993  Void      setLoopFilterTcOffset(Int val)      {m_loopFilterTcOffsetDiv2 = val; }      //!< set tc offset for deblocking filter
     994  Int       getLoopFilterTcOffset()             {return m_loopFilterTcOffsetDiv2; }     //!< get tc offset for deblocking filter
     995
     996  Void      createScalingList();
     997  Void      destroyScalingList();
     998  Void      setScalingListEnabled (Bool bVal) { m_scalingListEnabled = bVal; }  //!< set ScalingList enabled/disabled in APS
     999  Bool      getScalingListEnabled ()          { return m_scalingListEnabled; }  //!< get ScalingList enabled/disabled in APS
     1000  TComScalingList* getScalingList ()          { return m_scalingList; }         //!< get ScalingList class pointer in APS
     1001#if SAO_UNIT_INTERLEAVING
     1002  Bool     getSaoInterleavingFlag() {return m_saoInterleavingFlag;}             //!< get SAO interleaving flag in APS
     1003  Void     setSaoInterleavingFlag(Bool bVal) {m_saoInterleavingFlag = bVal;}    //!< set SAO interleaving flag in APS
     1004#endif
     1005
     1006private:
     1007  Int         m_apsID;        //!< APS ID
     1008  Bool        m_bSaoEnabled;  //!< SAO enabled/disabled in APS (true for enabled)
     1009  Bool        m_bAlfEnabled;  //!< ALF enabled/disabled in APS (true for enabled)
     1010  SAOParam*   m_pSaoParam;    //!< SAO parameter object pointer
     1011#if LCU_SYNTAX_ALF
     1012  AlfParamSet*   m_alfParamSet;
     1013#else
     1014  ALFParam*   m_pAlfParam;    //!< ALF parameter object pointer
     1015#endif
     1016  Bool        m_loopFilterOffsetInAPS;       //< offset for deblocking filter in 0 = slice header, 1 = APS
     1017  Bool        m_loopFilterDisable;           //< Deblocking filter enabled/disabled in APS
     1018  Int         m_loopFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
     1019  Int         m_loopFilterTcOffsetDiv2;      //< tc offset for deblocking filter
     1020  Bool        m_scalingListEnabled;     //!< ScalingList enabled/disabled in APS (true for enabled)
     1021  TComScalingList*     m_scalingList;   //!< ScalingList class pointer
     1022#if SAO_UNIT_INTERLEAVING
     1023  Bool        m_saoInterleavingFlag;    //!< SAO interleaving flag
     1024#endif
     1025
     1026public:
     1027  TComAPS& operator= (const TComAPS& src);  //!< "=" operator for APS object
     1028};
     1029
    3681030typedef struct {
    3691031  // Explicit weighted prediction parameters parsed in slice header,
     
    3821044  Int64 iDC;
    3831045} wpACDCParam;
    384 #endif
    3851046
    3861047/// slice header class
    3871048class TComSlice
    3881049{
    389 
     1050 
    3901051private:
    3911052  //  Bitstream writing
    392   UInt        m_uiPPSId;
     1053  Int         m_iAPSId; //!< APS ID in slice header
     1054  bool       m_alfEnabledFlag;
     1055  bool       m_saoEnabledFlag;
     1056#if SAO_UNIT_INTERLEAVING
     1057  bool       m_saoInterleavingFlag;   ///< SAO interleaving flag
     1058  bool       m_saoEnabledFlagCb;      ///< SAO Cb enabled flag
     1059  bool       m_saoEnabledFlagCr;      ///< SAO Cr enabled flag
     1060#endif
     1061  Int         m_iPPSId;               ///< picture parameter set ID
     1062#if H0388
     1063  Bool        m_PicOutputFlag;        ///< pic_output_flag
     1064#endif
    3931065  Int         m_iPOC;
    394 #if BITSTREAM_EXTRACTION
    395   UInt        m_uiLayerId;
    396 #endif
    397 #if SONY_COLPIC_AVAILABILITY
    398   Int         m_iViewOrderIdx;
    399 #endif
    400 #if DCM_DECODING_REFRESH
    401   NalUnitType m_eNalUnitType;         ///< Nal unit type for the slice
    402 #endif
     1066  Int         m_iLastIDR;
     1067  static Int  m_prevPOC;
     1068  TComReferencePictureSet *m_pcRPS;
     1069  TComReferencePictureSet m_LocalRPS;
     1070  Int         m_iBDidx;
     1071  Int         m_iCombinationBDidx;
     1072  Bool        m_bCombineWithReferenceFlag;
     1073  TComRefPicListModification m_RefPicListModification;
     1074  NalUnitType m_eNalUnitType;            ///< Nal unit type for the slice
     1075  NalUnitType m_eNalUnitTypeBaseViewMvc; ///< Nal unit type of the base view slice for multiview coding
    4031076  SliceType   m_eSliceType;
    4041077  Int         m_iSliceQp;
    405   Int         m_iSymbolMode;
     1078#if ADAPTIVE_QP_SELECTION
     1079  Int         m_iSliceQpBase;
     1080#endif
    4061081  Bool        m_bLoopFilterDisable;
    407 
    408 #if DCM_COMB_LIST
     1082  Bool        m_loopFilterOffsetInAPS;
     1083  Bool        m_inheritDblParamFromAPS;      //< offsets for deblocking filter inherit from APS
     1084  Int         m_loopFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
     1085  Int         m_loopFilterTcOffsetDiv2;      //< tc offset for deblocking filter
     1086 
    4091087  Int         m_aiNumRefIdx   [3];    //  for multiple reference of current slice
    4101088
     
    4161094  Bool        m_bRefPicListModificationFlagLC;
    4171095  Bool        m_bRefPicListCombinationFlag;
    418 #else
    419   Int         m_aiNumRefIdx   [2];    //  for multiple reference of current slice
    420 #endif
     1096
     1097  Bool        m_bCheckLDC;
    4211098
    4221099  //  Data
    4231100  Int         m_iSliceQpDelta;
    424   TComPic*    m_apcRefPicList [2][MAX_NUM_REF];
    425   Int         m_aiRefPOCList  [2][MAX_NUM_REF];
     1101  TComPic*    m_apcRefPicList  [2][MAX_NUM_REF+1];
     1102  Int         m_aiRefPOCList   [2][MAX_NUM_REF+1];
     1103  Int         m_aiRefViewIdList[2][MAX_NUM_REF+1];
     1104  TComPic*    m_pcTexturePic;
    4261105  Int         m_iDepth;
    427   TComPic*    m_pcTexturePic;
    428 
     1106 
    4291107  // referenced slice?
    4301108  Bool        m_bRefenced;
    431 #ifdef ROUNDING_CONTROL_BIPRED
    432   Bool        m_bRounding;
    433 #endif
    434 
     1109 
    4351110  // access channel
    4361111  TComSPS*    m_pcSPS;
    4371112  TComPPS*    m_pcPPS;
    4381113  TComPic*    m_pcPic;
     1114#if ADAPTIVE_QP_SELECTION
     1115  TComTrQuant* m_pcTrQuant;
     1116#endif 
     1117  TComAPS*    m_pcAPS;  //!< pointer to APS parameter object
    4391118
    4401119  UInt        m_uiColDir;  // direction to get colocated CUs
    441 
     1120 
     1121#if COLLOCATED_REF_IDX
     1122  UInt        m_colRefIdx;
     1123#endif
     1124
     1125#if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA
     1126  Double      m_dLambdaLuma;
     1127  Double      m_dLambdaChroma;
     1128#else
    4421129  Double      m_dLambda;
     1130#endif
    4431131
    4441132  Bool        m_abEqualRef  [2][MAX_NUM_REF][MAX_NUM_REF];
    445 
    446   Int         m_iViewIdx;
    447   Int         m_aiRefViewList[2][MAX_INPUT_VIEW_NUM];
    448 
     1133 
    4491134  Bool        m_bNoBackPredFlag;
    450 #if MS_LCEC_LOOKUP_TABLE_EXCEPTION
    4511135  Bool        m_bRefIdxCombineCoding;
    452 #endif
    453 
    454   Int         m_aaiCodedScale [2][MAX_NUMBER_VIEWS];
    455   Int         m_aaiCodedOffset[2][MAX_NUMBER_VIEWS];
     1136
     1137  UInt        m_uiTLayer;
     1138  Bool        m_bTLayerSwitchingFlag;
    4561139
    4571140  UInt        m_uiSliceMode;
     
    4671150  Bool        m_bNextEntropySlice;
    4681151  UInt        m_uiSliceBits;
    469 
    470 #ifdef WEIGHT_PRED
     1152  UInt        m_uiEntropySliceCounter;
     1153  Bool        m_bFinalized;
     1154
    4711155  wpScalingParam  m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V]
    472   wpACDCParam   m_weightACDCParam[3]; // [0:Y, 1:U, 2:V]
     1156  wpACDCParam    m_weightACDCParam[3];                 // [0:Y, 1:U, 2:V]
     1157  wpScalingParam  m_weightPredTableLC[2*MAX_NUM_REF][3]; // [refIdxLC][0:Y, 1:U, 2:V]
     1158
     1159  UInt        *m_uiTileByteLocation;
     1160  UInt        m_uiTileCount;
     1161  Int         m_iTileMarkerFlag;
     1162  UInt        m_uiTileOffstForMultES;
     1163
     1164  UInt*       m_puiSubstreamSizes;
     1165  TComScalingList*     m_scalingList;                 //!< pointer of quantization matrix
     1166#if CABAC_INIT_FLAG
     1167  Bool        m_cabacInitFlag;
     1168#else
     1169  Int         m_cabacInitIdc;
     1170#endif
     1171
     1172#if H0111_MVD_L1_ZERO
     1173  Bool       m_bLMvdL1Zero;
     1174#endif
     1175#if TILES_WPP_ENTRY_POINT_SIGNALLING
     1176  Int         m_numEntryPointOffsets;
     1177#endif
     1178
     1179  Int        m_viewId;
     1180  Bool       m_isDepth;
     1181  Int        m_aaiCodedScale [2][MAX_VIEW_NUM];
     1182  Int        m_aaiCodedOffset[2][MAX_VIEW_NUM];
     1183
     1184#if SONY_COLPIC_AVAILABILITY
     1185  Int         m_iViewOrderIdx;
    4731186#endif
    4741187
     
    4761189  TComSlice();
    4771190  virtual ~TComSlice();
    478 
     1191 
    4791192  Void      initSlice       ();
    480 
     1193  Void      initTiles();
     1194
     1195 
    4811196  Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    4821197  TComSPS*  getSPS          () { return m_pcSPS; }
    483 
    484   Void      setPPS          ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; }
     1198 
     1199  Void      setPPS          ( TComPPS* pcPPS )         { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); }
    4851200  TComPPS*  getPPS          () { return m_pcPPS; }
    4861201
    487   UInt      getPPSId        ()                          { return  m_uiPPSId;            }
     1202#if ADAPTIVE_QP_SELECTION
     1203  Void          setTrQuant          ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; }
     1204  TComTrQuant*  getTrQuant          () { return m_pcTrQuant; }
     1205#endif
     1206
     1207  Void      setPPSId        ( Int PPSId )         { m_iPPSId = PPSId; }
     1208  Int       getPPSId        () { return m_iPPSId; }
     1209  Void      setAPS          ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer
     1210  TComAPS*  getAPS          ()                 { return m_pcAPS;  } //!< get APS pointer
     1211  Void      setAPSId        ( Int Id)          { m_iAPSId =Id;    } //!< set APS ID
     1212  Int       getAPSId        ()                 { return m_iAPSId; } //!< get APS ID
     1213#if H0388
     1214  Void      setPicOutputFlag( Bool b )         { m_PicOutputFlag = b;    }
     1215  Bool      getPicOutputFlag()                 { return m_PicOutputFlag; }
     1216#endif
     1217  Void      setAlfEnabledFlag(Bool s) {m_alfEnabledFlag =s; }
     1218  Bool      getAlfEnabledFlag() { return m_alfEnabledFlag; }
     1219  Void      setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; }
     1220  Bool      getSaoEnabledFlag() { return m_saoEnabledFlag; }
     1221#if SAO_UNIT_INTERLEAVING
     1222  Void      setSaoInterleavingFlag(Bool s) {m_saoInterleavingFlag =s; } //!< set SAO interleaving flag
     1223  Bool      getSaoInterleavingFlag() { return m_saoInterleavingFlag;  } //!< get SAO interleaving flag
     1224  Void      setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; }       //!< set SAO Cb enabled flag
     1225  Bool      getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; }        //!< get SAO Cb enabled flag
     1226  Void      setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; }       //!< set SAO Cr enabled flag
     1227  Bool      getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; }        //!< get SAO Cr enabled flag
     1228#endif
     1229  Void      setRPS          ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; }
     1230  TComReferencePictureSet*  getRPS          () { return m_pcRPS; }
     1231  TComReferencePictureSet*  getLocalRPS     () { return &m_LocalRPS; }
     1232
     1233  Void      setRPSidx          ( Int iBDidx ) { m_iBDidx = iBDidx; }
     1234  Int       getRPSidx          () { return m_iBDidx; }
     1235  Void      setCombinationBDidx          ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; }
     1236  Int       getCombinationBDidx          () { return m_iCombinationBDidx; }
     1237  Void      setCombineWithReferenceFlag          ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; }
     1238  Bool      getCombineWithReferenceFlag          () { return m_bCombineWithReferenceFlag; }
     1239  Int       getPrevPOC      ()                          { return  m_prevPOC;       }
     1240
     1241  TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; }
     1242  Void      setLastIDR(Int iIDRPOC)                       { m_iLastIDR = iIDRPOC; }
     1243  Int       getLastIDR()                                  { return m_iLastIDR; }
    4881244  SliceType getSliceType    ()                          { return  m_eSliceType;         }
    4891245  Int       getPOC          ()                          { return  m_iPOC;           }
    490 #if SONY_COLPIC_AVAILABILITY
    491   Int       getViewOrderIdx ()                          { return  m_iViewOrderIdx;  }
    492 #endif
    4931246  Int       getSliceQp      ()                          { return  m_iSliceQp;           }
     1247#if ADAPTIVE_QP_SELECTION
     1248  Int       getSliceQpBase  ()                          { return  m_iSliceQpBase;       }
     1249#endif
    4941250  Int       getSliceQpDelta ()                          { return  m_iSliceQpDelta;      }
    495   Int       getSymbolMode   ()                          { return  m_iSymbolMode;        }
    4961251  Bool      getLoopFilterDisable()                      { return  m_bLoopFilterDisable; }
     1252  Bool      getLoopFilterOffsetInAPS()                  { return  m_loopFilterOffsetInAPS;}
     1253  Bool      getInheritDblParamFromAPS()                 { return  m_inheritDblParamFromAPS; }
     1254  Int       getLoopFilterBetaOffset()                   { return  m_loopFilterBetaOffsetDiv2; }
     1255  Int       getLoopFilterTcOffset()                     { return  m_loopFilterTcOffsetDiv2; }
     1256
    4971257  Int       getNumRefIdx        ( RefPicList e )                { return  m_aiNumRefIdx[e];             }
    4981258  TComPic*  getPic              ()                              { return  m_pcPic;                      }
    4991259  TComPic*  getRefPic           ( RefPicList e, Int iRefIdx)    { return  m_apcRefPicList[e][iRefIdx];  }
    5001260  Int       getRefPOC           ( RefPicList e, Int iRefIdx)    { return  m_aiRefPOCList[e][iRefIdx];   }
     1261  Int       getRefViewId        ( RefPicList e, Int iRefIdx)    { return  m_aiRefViewIdList[e][iRefIdx]; }
     1262  TComPic*  getTexturePic       () const                        { return  m_pcTexturePic; }
     1263#if SONY_COLPIC_AVAILABILITY
     1264  Int       getViewOrderIdx     ()                                  { return  m_iViewOrderIdx;              }
     1265#endif
    5011266  Int       getDepth            ()                              { return  m_iDepth;                     }
    5021267  UInt      getColDir           ()                              { return  m_uiColDir;                   }
    503 
    504 #if DCM_COMB_LIST
     1268#if COLLOCATED_REF_IDX
     1269  Bool      getColRefIdx        ()                              { return  m_colRefIdx;                  }
     1270  Void      checkColRefIdx      (UInt curSliceIdx, TComPic* pic);
     1271#endif
     1272  Bool      getCheckLDC     ()                                  { return m_bCheckLDC; }
     1273#if H0111_MVD_L1_ZERO
     1274  Bool      getMvdL1ZeroFlag ()                                  { return m_bLMvdL1Zero;    }
     1275#endif
    5051276  Int       getRefIdxOfLC       (RefPicList e, Int iRefIdx)     { return m_iRefIdxOfLC[e][iRefIdx];           }
    5061277  Int       getListIdFromIdxOfLC(Int iRefIdx)                   { return m_eListIdFromIdxOfLC[iRefIdx];       }
     
    5091280  Int       getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx)            { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];}
    5101281  Bool      getRefPicListModificationFlagLC()                   {return m_bRefPicListModificationFlagLC;}
    511   Void      setRefPicListModificationFlagLC(Bool bflag)         {m_bRefPicListModificationFlagLC=bflag;}
     1282  Void      setRefPicListModificationFlagLC(Bool bflag)         {m_bRefPicListModificationFlagLC=bflag;}     
    5121283  Bool      getRefPicListCombinationFlag()                      {return m_bRefPicListCombinationFlag;}
    513   Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}
     1284  Void      setRefPicListCombinationFlag(Bool bflag)            {m_bRefPicListCombinationFlag=bflag;}     
    5141285  Void      setListIdFromIdxOfLC(Int  iRefIdx, UInt uiVal)      { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; }
    5151286  Void      setRefIdxFromIdxOfLC(Int  iRefIdx, UInt uiVal)      { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; }
    5161287  Void      setRefIdxOfLC       (RefPicList e, Int iRefIdx, Int RefIdxLC)     { m_iRefIdxOfLC[e][iRefIdx]=RefIdxLC;}
    517 #endif
    5181288
    5191289  Void      setReferenced(Bool b)                               { m_bRefenced = b; }
    5201290  Bool      isReferenced()                                      { return m_bRefenced; }
    521 #ifdef ROUNDING_CONTROL_BIPRED
    522   Void      setRounding(Bool bRound)                            { m_bRounding = bRound; }
    523   Bool      isRounding()                                        { return m_bRounding; }
    524 #endif
    525 
    526   Void      setPPSId            ( UInt u )                      { m_uiPPSId           = u;      }
    527   Void      setPOC              ( Int i )                       { m_iPOC              = i;      }
     1291 
     1292  Void      setPOC              ( Int i )                       { m_iPOC              = i; if(getTLayer()==0) m_prevPOC=i; }
     1293  Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
     1294  NalUnitType getNalUnitType    ()                              { return m_eNalUnitType;        }
     1295  Void      setNalUnitTypeBaseViewMvc  ( NalUnitType e )        { m_eNalUnitTypeBaseViewMvc = e;    }
     1296  NalUnitType getNalUnitTypeBaseViewMvc()                       { return m_eNalUnitTypeBaseViewMvc; }
     1297  Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, TComList<TComPic*>& rcListPic);
     1298  Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
     1299  Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
     1300  Void      setSliceQp          ( Int i )                       { m_iSliceQp          = i;      }
     1301#if ADAPTIVE_QP_SELECTION
     1302  Void      setSliceQpBase      ( Int i )                       { m_iSliceQpBase      = i;      }
     1303#endif
     1304  Void      setSliceQpDelta     ( Int i )                       { m_iSliceQpDelta     = i;      }
     1305  Void      setLoopFilterDisable( Bool b )                      { m_bLoopFilterDisable= b;      }
     1306  Void      setLoopFilterOffsetInAPS( Bool b )                  { m_loopFilterOffsetInAPS = b;}
     1307  Void      setInheritDblParamFromAPS( Bool b )                 { m_inheritDblParamFromAPS = b; }
     1308  Void      setLoopFilterBetaOffset( Int i )                    { m_loopFilterBetaOffsetDiv2 = i; }
     1309  Void      setLoopFilterTcOffset( Int i )                      { m_loopFilterTcOffsetDiv2 = i; }
     1310 
     1311  Void      setRefPic           ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; }
     1312  Void      setRefPOC           ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
     1313  Void      setRefViewId        ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdList[e][iRefIdx] = i; }
     1314  Void      setTexturePic       ( TComPic *pcTexturePic )       { m_pcTexturePic = pcTexturePic; }
    5281315#if SONY_COLPIC_AVAILABILITY
    5291316  Void      setViewOrderIdx     ( Int i )                       { m_iViewOrderIdx     = i;      }
    5301317#endif
    531 #if DCM_DECODING_REFRESH
    532   Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
    533   NalUnitType getNalUnitType    ()                              { return m_eNalUnitType;        }
    534   Void      decodingRefreshMarking(UInt& uiPOCCDR, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
    535 #endif
    536   Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
    537   Void      setSliceQp          ( Int i )                       { m_iSliceQp          = i;      }
    538   Void      setSliceQpDelta     ( Int i )                       { m_iSliceQpDelta     = i;      }
    539   Void      setSymbolMode       ( Int b  )                      { m_iSymbolMode       = b;      }
    540   Void      setLoopFilterDisable( Bool b )                      { m_bLoopFilterDisable= b;      }
    541 
    542   Void      setRefPic           ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; }
    543   Void      setRefPOC           ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
    5441318  Void      setNumRefIdx        ( RefPicList e, Int i )         { m_aiNumRefIdx[e]    = i;      }
    5451319  Void      setPic              ( TComPic* p )                  { m_pcPic             = p;      }
    5461320  Void      setDepth            ( Int iDepth )                  { m_iDepth            = iDepth; }
    547 
    548   Void      setRefPicList       ( TComList<TComPic*>& rcListPic );
    549   Void      setRefPOCList       ();
     1321 
     1322  Int       getNumPocTotalCurr();
     1323  Int       getNumPocTotalCurrMvc();
     1324  Void      setRefPicListMvc    ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics );
     1325  Void      setRefPOCnViewListsMvc();
     1326
    5501327  Void      setColDir           ( UInt uiDir ) { m_uiColDir = uiDir; }
    551 
    552   Void      setRefPicListFromGOPSTring( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics );
    553   Void      setRefPicListExplicitlyDecoderSided( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics );
     1328#if COLLOCATED_REF_IDX
     1329  Void      setColRefIdx        ( UInt refIdx) { m_colRefIdx = refIdx; }
     1330#endif
     1331  Void      setCheckLDC         ( Bool b )                      { m_bCheckLDC = b; }
     1332#if H0111_MVD_L1_ZERO
     1333  Void      setMvdL1ZeroFlag     ( Bool b)                       { m_bLMvdL1Zero = b; }
     1334#endif 
    5541335
    5551336  Bool      isIntra         ()                          { return  m_eSliceType == I_SLICE;  }
    5561337  Bool      isInterB        ()                          { return  m_eSliceType == B_SLICE;  }
    5571338  Bool      isInterP        ()                          { return  m_eSliceType == P_SLICE;  }
    558 
     1339 
     1340#if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA 
     1341  Void      setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;}
     1342  Double    getLambdaLuma() { return m_dLambdaLuma;        }
     1343  Double    getLambdaChroma() { return m_dLambdaChroma;        }
     1344#else
    5591345  Void      setLambda( Double d ) { m_dLambda = d; }
    5601346  Double    getLambda() { return m_dLambda;        }
    561 
    562 #if BITSTREAM_EXTRACTION
    563   Void      setLayerId( UInt u )                        { m_uiLayerId = u; }
    564   UInt      getLayerId()                                { return m_uiLayerId; }
    565 #endif
    566 
    567   Void      setViewIdx(Int i)                           { m_iViewIdx = i; }
    568   Int       getViewIdx()                                { return m_iViewIdx; }
    569 
    570   Void      setRefViewIdx       ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewList[e][iRefIdx] = i; }
    571   Int       getRefViewIdx       ( RefPicList e, Int iRefIdx)    { return  m_aiRefViewList[e][iRefIdx]; }
    572 
     1347#endif
     1348 
    5731349  Void      initEqualRef();
    5741350  Bool      isEqualRef  ( RefPicList e, Int iRefIdx1, Int iRefIdx2 )
     
    5771353    return m_abEqualRef[e][iRefIdx1][iRefIdx2];
    5781354  }
    579 
     1355 
    5801356  Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b)
    5811357  {
    5821358    m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b;
    5831359  }
    584 
     1360 
    5851361  static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
    586 
     1362 
    5871363  Bool getNoBackPredFlag() { return m_bNoBackPredFlag; }
    5881364  Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; }
    589 #if MS_LCEC_LOOKUP_TABLE_EXCEPTION
    5901365  Bool getRefIdxCombineCoding() { return m_bRefIdxCombineCoding; }
    5911366  Void setRefIdxCombineCoding( Bool b ) { m_bRefIdxCombineCoding = b; }
    592 #endif
    593 #if DCM_COMB_LIST
    594   Void      generateCombinedList       ();
    595 #endif
     1367  Void generateCombinedList       ();
     1368
     1369  UInt getTLayer             ()                            { return m_uiTLayer;                      }
     1370  Void setTLayer             ( UInt uiTLayer )             { m_uiTLayer = uiTLayer;                  }
     1371
     1372#if !H0566_TLA
     1373  Bool getTLayerSwitchingFlag()                            { return m_bTLayerSwitchingFlag;          }
     1374  Void setTLayerSwitchingFlag( Bool bValue )               { m_bTLayerSwitchingFlag = bValue;        }
     1375#endif
     1376
     1377  Void setTLayerInfo( UInt uiTLayer );
     1378  Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum );
     1379  Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
     1380#if H0566_TLA && H0566_TLA_SET_FOR_SWITCHING_POINTS
     1381  Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
     1382#endif
     1383#if START_DECODING_AT_CRA
     1384  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag, Int pocRandomAccess = 0);
     1385#else
     1386  Int       checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag);
     1387#endif
     1388  Void      createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet);
     1389
     1390  Void decodingMarkingForNoTMVP( TComList<TComPic*>& rcListPic, Int currentPOC );
     1391
     1392  UInt m_uiMaxNumMergeCand;
     1393  Void setMaxNumMergeCand               (UInt maxNumMergeCand ) { m_uiMaxNumMergeCand = maxNumMergeCand;  }
     1394  UInt getMaxNumMergeCand               ()                  {return m_uiMaxNumMergeCand;                  }
     1395
    5961396  Void setSliceMode                     ( UInt uiMode )     { m_uiSliceMode = uiMode;                     }
    5971397  UInt getSliceMode                     ()                  { return m_uiSliceMode;                       }
     
    6181418  Bool isNextEntropySlice               ()                  { return m_bNextEntropySlice;                 }
    6191419  Void setSliceBits                     ( UInt uiVal )      { m_uiSliceBits = uiVal;                      }
    620   UInt getSliceBits                     ()                  { return m_uiSliceBits;                       }
    621 
     1420  UInt getSliceBits                     ()                  { return m_uiSliceBits;                       } 
     1421  Void setEntropySliceCounter           ( UInt uiVal )      { m_uiEntropySliceCounter = uiVal;            }
     1422  UInt getEntropySliceCounter           ()                  { return m_uiEntropySliceCounter;             }
     1423  Void setFinalized                     ( Bool uiVal )      { m_bFinalized = uiVal;                       }
     1424  Bool getFinalized                     ()                  { return m_bFinalized;                        }
     1425  Void  setWpScaling    ( wpScalingParam  wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); }
     1426  Void  getWpScaling    ( RefPicList e, Int iRefIdx, wpScalingParam *&wp);
     1427
     1428  Void  resetWpScaling  (wpScalingParam  wp[2][MAX_NUM_REF][3]);
     1429  Void  initWpScaling    (wpScalingParam  wp[2][MAX_NUM_REF][3]);
     1430  Void  initWpScaling   ();
     1431  inline Bool applyWP   () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); }
     1432 
     1433  Void  setWpAcDcParam  ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); }
     1434  Void  getWpAcDcParam  ( wpACDCParam *&wp );
     1435  Void  initWpAcDcParam ();
     1436  Void  copyWPtable     (wpScalingParam *&wp_src, wpScalingParam *&wp_dst);
     1437  Void  getWpScalingLC  ( Int iRefIdx, wpScalingParam *&wp);
     1438  Void  resetWpScalingLC(wpScalingParam  wp[2*MAX_NUM_REF][3]);
     1439  Void  setWpParamforLC();
     1440  Void setTileLocationCount             ( UInt uiCount )      { m_uiTileCount = uiCount;                  }
     1441  UInt getTileLocationCount             ()                    { return m_uiTileCount;                     }
     1442  Void setTileLocation                  ( Int i, UInt uiLOC ) { m_uiTileByteLocation[i] = uiLOC;          }
     1443  UInt getTileLocation                  ( Int i )             { return m_uiTileByteLocation[i];           }
     1444  Void setTileMarkerFlag                ( Int iFlag )         { m_iTileMarkerFlag = iFlag;                }
     1445  Int  getTileMarkerFlag                ()                    { return m_iTileMarkerFlag;                 }
     1446  Void setTileOffstForMultES            (UInt uiOffset )      { m_uiTileOffstForMultES = uiOffset;        }
     1447  UInt getTileOffstForMultES            ()                    { return m_uiTileOffstForMultES;            }
     1448  Void allocSubstreamSizes              ( UInt uiNumSubstreams );
     1449  UInt* getSubstreamSizes               ()                  { return m_puiSubstreamSizes; }
     1450  Void  setScalingList              ( TComScalingList* scalingList ) { m_scalingList = scalingList; }
     1451  TComScalingList*   getScalingList ()                               { return m_scalingList; }
     1452  Void  setDefaultScalingList       ();
     1453  Bool  checkDefaultScalingList     ();
     1454#if CABAC_INIT_FLAG
     1455  Void      setCabacInitFlag  ( Bool val ) { m_cabacInitFlag = val;      }  //!< set CABAC initial flag
     1456  Bool      getCabacInitFlag  ()           { return m_cabacInitFlag;     }  //!< get CABAC initial flag
     1457#else
     1458  Void      setCABACinitIDC(Int iVal) {m_cabacInitIdc = iVal;    }  //!< set CABAC initial IDC number
     1459  Int       getCABACinitIDC()         {return m_cabacInitIdc;    }  //!< get CABAC initial IDC number
     1460#endif
     1461#if TILES_WPP_ENTRY_POINT_SIGNALLING
     1462  Void      setNumEntryPointOffsets(Int val)  { m_numEntryPointOffsets = val;     }
     1463  Int       getNumEntryPointOffsets()         { return m_numEntryPointOffsets;    }
     1464#endif
     1465
     1466  Void setViewId( Int viewId )       { m_viewId = viewId;   }
     1467  Int  getViewId()                   { return m_viewId;     }
     1468  Void setIsDepth( Bool isDepth )    { m_isDepth = isDepth; }
     1469  Bool getIsDepth()                  { return m_isDepth;    }
     1470 
    6221471  Void      initMultiviewSlice    ( Int** aaiScale = 0, Int** aaiOffset = 0 );
    6231472
     
    6271476  Int*      getInvCodedOffset     ()  { return m_aaiCodedOffset[1]; }
    6281477
    629   Void setTexturePic( TComPic *pcTexturePic ) { m_pcTexturePic = pcTexturePic; }
    630   TComPic *getTexturePic() const { return m_pcTexturePic; }
    631 
    632 #ifdef WEIGHT_PRED
    633   Void  setWpScaling( wpScalingParam  wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); }
    634   Void  getWpScaling( RefPicList e, Int iRefIdx, wpScalingParam *&wp);
    635   Void  displayWpScaling();
    636   Void  resetWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3]);
    637   Void  initWpScaling(wpScalingParam  wp[2][MAX_NUM_REF][3]);
    638   Void  initWpScaling();
    639   inline Bool applyWP() { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); }
    640 
    641   Void  setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); }
    642   Void  getWpAcDcParam ( wpACDCParam *&wp );
    643   Void  initWpAcDcParam();
    644 #endif
    645 
    6461478protected:
    647 #if 0
    648   TComPic*  xGetRefPic  (TComList<TComPic*>& rcListPic,
    649                          Bool                bDRBFlag,
    650                          ERBIndex            eERBIndex,
    651                          UInt                uiPOCCurr,
    652                          RefPicList          eRefPicList,
    653                          UInt                uiNthRefPic );
    654 #endif
    655 
     1479  TComPic*  xGetRefPic        (TComList<TComPic*>& rcListPic, UInt uiPOC);
     1480  TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, UInt uiPOC);
     1481  TComPic*  xGetInterViewRefPic( std::vector<TComPic*>& rcListIvPic, UInt uiViewId );
    6561482};// END CLASS DEFINITION TComSlice
    6571483
    6581484
     1485template <class T> class ParameterSetMap
     1486{
     1487public:
     1488  ParameterSetMap(Int maxId)
     1489  :m_maxId (maxId)
     1490  {}
     1491
     1492  ~ParameterSetMap()
     1493  {
     1494    for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++)
     1495    {
     1496      delete (*i).second;
     1497    }
     1498  }
     1499
     1500  Void storePS(Int psId, T *ps)
     1501  {
     1502    assert ( psId < m_maxId );
     1503    if ( m_paramsetMap.find(psId) != m_paramsetMap.end() )
     1504    {
     1505      delete m_paramsetMap[psId];
     1506    }
     1507    m_paramsetMap[psId] = ps;
     1508  }
     1509
     1510  Void mergePSList(ParameterSetMap<T> &rPsList)
     1511  {
     1512    for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++)
     1513    {
     1514      storePS(i->first, i->second);
     1515    }
     1516    rPsList.m_paramsetMap.clear();
     1517  }
     1518
     1519
     1520  T* getPS(Int psId)
     1521  {
     1522    return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId];
     1523  }
     1524
     1525  T* getFirstPS()
     1526  {
     1527    return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second;
     1528  }
     1529
     1530private:
     1531  std::map<Int,T *> m_paramsetMap;
     1532  Int               m_maxId;
     1533};
     1534
     1535class ParameterSetManager
     1536{
     1537public:
     1538  ParameterSetManager();
     1539  virtual ~ParameterSetManager();
     1540
     1541  //! store sequence parameter set and take ownership of it
     1542  Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); };
     1543  //! get pointer to existing sequence parameter set 
     1544  TComSPS* getSPS(Int spsId)  { return m_spsMap.getPS(spsId); };
     1545  TComSPS* getFirstSPS()      { return m_spsMap.getFirstPS(); };
     1546
     1547  //! store picture parameter set and take ownership of it
     1548  Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); };
     1549  //! get pointer to existing picture parameter set 
     1550  TComPPS* getPPS(Int ppsId)  { return m_ppsMap.getPS(ppsId); };
     1551  TComPPS* getFirstPPS()      { return m_ppsMap.getFirstPS(); };
     1552
     1553  //! store adaptation parameter set and take ownership of it
     1554  Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); };
     1555  //! getPointer to existing adaptation parameter set 
     1556  TComAPS* getAPS(Int apsId)  { return m_apsMap.getPS(apsId); };
     1557
     1558protected:
     1559  ParameterSetMap<TComSPS> m_spsMap;
     1560  ParameterSetMap<TComPPS> m_ppsMap;
     1561  ParameterSetMap<TComAPS> m_apsMap;
     1562};
     1563
     1564//! \}
     1565
    6591566#endif // __TCOMSLICE__
    660 
Note: See TracChangeset for help on using the changeset viewer.