Changeset 1235 in SHVCSoftware for branches/SHM-dev/source/Lib


Ignore:
Timestamp:
13 Jul 2015, 20:38:11 (10 years ago)
Author:
seregin
Message:

port rev 4219 and rev 4246

Location:
branches/SHM-dev/source/Lib
Files:
48 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h

    r1029 r1235  
    222222  Void      clearEmulationPreventionByteLocation()                            { m_emulationPreventionByteLocation.clear();          }
    223223  Void      setEmulationPreventionByteLocation  ( std::vector<UInt> vec )     { m_emulationPreventionByteLocation = vec;            }
     224
     225  const std::vector<uint8_t> *getFifo() const { return m_fifo; }
    224226};
    225227
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp

    r1226 r1235  
    5050, m_bUsedByCurr                           (false)
    5151, m_bIsLongTerm                           (false)
    52 , m_apcPicSym                             (NULL)
    5352, m_pcPicYuvPred                          (NULL)
    5453, m_pcPicYuvResi                          (NULL)
     
    7675}
    7776#if SVC_EXTENSION
    78 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    79                       Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual)
    80 {
    81   m_apcPicSym     = new TComPicSym;  m_apcPicSym   ->create( chromaFormatIDC, iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     77Void TComPic::create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual, const UInt layerId )
     78{
     79  const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
     80  const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
     81  const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
     82 
     83  const Window& conformanceWindow = vps.getConformanceWindow( &sps, layerId );
     84
     85  m_picSym.create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, layerId );
     86
    8287  if (!bIsVirtual)
    8388  {
     
    9398      m_pcFullPelBaseRec[i] = new TComPicYuv;  m_pcFullPelBaseRec[i]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth, &conformanceWindow );
    9499    }
    95   }
    96 
    97   m_layerId = pcSps ? pcSps->getLayerId() : 0;
     100  }   
    98101
    99102  // there are no SEI messages associated with this picture initially
     
    103106  }
    104107  m_bUsedByCurr = false;
    105 
    106   /* store conformance window parameters with picture */
    107   m_conformanceWindow = conformanceWindow;
    108  
    109   /* store display window parameters with picture */
    110   m_defaultDisplayWindow = defaultDisplayWindow;
    111 
    112   /* store number of reorder pics with picture */
    113   memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int));
    114 
    115   return;
    116108}
    117109#else
    118 Void TComPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    119                       Int *numReorderPics, Bool bIsVirtual)
    120 {
    121   m_apcPicSym     = new TComPicSym;  m_apcPicSym   ->create( chromaFormatIDC, iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     110Void TComPic::create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual)
     111{
     112  const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc();
     113  const Int iWidth  = sps.getPicWidthInLumaSamples();
     114  const Int iHeight = sps.getPicHeightInLumaSamples();
     115
     116  m_picSym.create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    122117  if (!bIsVirtual)
    123118  {
    124     m_apcPicYuv[PIC_YUV_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );
     119    m_apcPicYuv[PIC_YUV_ORG    ]   = new TComPicYuv;  m_apcPicYuv[PIC_YUV_ORG     ]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    125120    m_apcPicYuv[PIC_YUV_TRUE_ORG]  = new TComPicYuv;  m_apcPicYuv[PIC_YUV_TRUE_ORG]->create( iWidth, iHeight, chromaFormatIDC, uiMaxWidth, uiMaxHeight, uiMaxDepth );
    126121  }
     
    133128  }
    134129  m_bUsedByCurr = false;
    135 
    136   /* store conformance window parameters with picture */
    137   m_conformanceWindow = conformanceWindow;
    138 
    139   /* store display window parameters with picture */
    140   m_defaultDisplayWindow = defaultDisplayWindow;
    141 
    142   /* store number of reorder pics with picture */
    143   memcpy(m_numReorderPics, numReorderPics, MAX_TLAYER*sizeof(Int));
    144 
    145   return;
    146130}
    147131#endif
     
    149133Void TComPic::destroy()
    150134{
    151   if (m_apcPicSym)
    152   {
    153     m_apcPicSym->destroy();
    154     delete m_apcPicSym;
    155     m_apcPicSym = NULL;
    156   }
     135  m_picSym.destroy();
    157136
    158137  for(UInt i=0; i<NUM_PIC_YUV; i++)
     
    200179{
    201180  UInt subStrm;
    202 
    203   if (pcSlice->getPPS()->getNumSubstreams() > 1) // wavefronts, and possibly tiles being used.
    204   {
    205     if (pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag())
    206     {
    207       const TComPicSym &picSym            = *(getPicSym());
     181  const bool bWPPEnabled=pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag();
     182  const TComPicSym &picSym            = *(getPicSym());
     183
     184  if ((bWPPEnabled && picSym.getFrameHeightInCtus()>1) || (picSym.getNumTiles()>1)) // wavefronts, and possibly tiles being used.
     185  {
     186    if (bWPPEnabled)
     187    {
    208188      const UInt ctuRsAddr                = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr);
    209189      const UInt frameWidthInCtus         = picSym.getFrameWidthInCtus();
     
    220200    else
    221201    {
    222       const TComPicSym &picSym            = *(getPicSym());
    223202      const UInt ctuRsAddr                = bAddressInRaster?ctuAddr : picSym.getCtuTsToRsAddrMap(ctuAddr);
    224203      const UInt tileIndex                = picSym.getTileIdxMap(ctuRsAddr);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPic.h

    r1226 r1235  
    6868  Bool                  m_bUsedByCurr;            //  Used by current picture
    6969  Bool                  m_bIsLongTerm;            //  IS long term picture
    70   TComPicSym*           m_apcPicSym;              //  Symbol
     70  TComPicSym            m_picSym;                 //  Symbol
    7171  TComPicYuv*           m_apcPicYuv[NUM_PIC_YUV];
    7272
     
    7777  UInt                  m_uiCurrSliceIdx;         // Index of current slice
    7878  Bool                  m_bCheckLTMSB;
    79 
    80   Int                   m_numReorderPics[MAX_TLAYER];
    81   Window                m_conformanceWindow;
    82   Window                m_defaultDisplayWindow;
    8379
    8480  Bool                  m_isTop;
     
    10197  TComPic();
    10298  virtual ~TComPic();
    103  
     99
    104100#if SVC_EXTENSION
    105   Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    106                         Int *numReorderPics, TComSPS* pcSps = NULL, Bool bIsVirtual = false );
     101  Void          create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/, const UInt layerId );
    107102#else
    108   Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormatIDC, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow,
    109                         Int *numReorderPics,Bool bIsVirtual /*= false*/ );
    110 #endif //SVC_EXTENSION
     103  Void          create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ );
     104#endif
    111105
    112106  virtual Void  destroy();
     
    122116  Bool          getCheckLTMSBPresent     () { return m_bCheckLTMSB;}
    123117
    124   TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
    125   TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
    126   Int           getPOC() const        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
    127   TComDataCU*   getCtu( UInt ctuRsAddr )           { return  m_apcPicSym->getCtu( ctuRsAddr ); }
    128   const TComDataCU* getCtu( UInt ctuRsAddr ) const { return  m_apcPicSym->getCtu( ctuRsAddr ); }
     118  TComPicSym*   getPicSym()           { return  &m_picSym;    }
     119  TComSlice*    getSlice(Int i)       { return  m_picSym.getSlice(i);  }
     120  Int           getPOC() const        { return  m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC();  }
     121  TComDataCU*   getCtu( UInt ctuRsAddr )           { return  m_picSym.getCtu( ctuRsAddr ); }
     122  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return  m_picSym.getCtu( ctuRsAddr ); }
     123
    129124
    130125  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[PIC_YUV_ORG]; }
     
    136131  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
    137132
    138   UInt          getNumberOfCtusInFrame() const     { return m_apcPicSym->getNumberOfCtusInFrame(); }
    139   UInt          getNumPartInCtuWidth() const       { return m_apcPicSym->getNumPartInCtuWidth();   }
    140   UInt          getNumPartInCtuHeight() const      { return m_apcPicSym->getNumPartInCtuHeight();  }
    141   UInt          getNumPartitionsInCtu() const      { return m_apcPicSym->getNumPartitionsInCtu();  }
    142   UInt          getFrameWidthInCtus() const        { return m_apcPicSym->getFrameWidthInCtus();    }
    143   UInt          getFrameHeightInCtus() const       { return m_apcPicSym->getFrameHeightInCtus();   }
    144   UInt          getMinCUWidth() const              { return m_apcPicSym->getMinCUWidth();          }
    145   UInt          getMinCUHeight() const             { return m_apcPicSym->getMinCUHeight();         }
     133  UInt          getNumberOfCtusInFrame() const     { return m_picSym.getNumberOfCtusInFrame(); }
     134  UInt          getNumPartInCtuWidth() const       { return m_picSym.getNumPartInCtuWidth();   }
     135  UInt          getNumPartInCtuHeight() const      { return m_picSym.getNumPartInCtuHeight();  }
     136  UInt          getNumPartitionsInCtu() const      { return m_picSym.getNumPartitionsInCtu();  }
     137  UInt          getFrameWidthInCtus() const        { return m_picSym.getFrameWidthInCtus();    }
     138  UInt          getFrameHeightInCtus() const       { return m_picSym.getFrameHeightInCtus();   }
     139  UInt          getMinCUWidth() const              { return m_picSym.getMinCUWidth();          }
     140  UInt          getMinCUHeight() const             { return m_picSym.getMinCUHeight();         }
    146141
    147142  Int           getStride(const ComponentID id) const          { return m_apcPicYuv[PIC_YUV_REC]->getStride(id); }
     
    156151  Bool          getOutputMark () const      { return m_bNeededForOutput;  }
    157152
    158   Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
    159   Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
    160 
    161153  Void          compressMotion();
    162154  UInt          getCurrSliceIdx() const           { return m_uiCurrSliceIdx;                }
    163155  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
    164   UInt          getNumAllocatedSlice() const      {return m_apcPicSym->getNumAllocatedSlice();}
    165   Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
    166   Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
    167 
    168   Window&       getConformanceWindow()  { return m_conformanceWindow; }
    169   Window&       getDefDisplayWindow()   { return m_defaultDisplayWindow; }
     156  UInt          getNumAllocatedSlice() const      {return m_picSym.getNumAllocatedSlice();}
     157  Void          allocateNewSlice()           {m_picSym.allocateNewSlice();         }
     158  Void          clearSliceBuffer()           {m_picSym.clearSliceBuffer();         }
     159
     160  const Window& getConformanceWindow() const { return m_picSym.getSPS().getConformanceWindow(); }
     161  Window        getDefDisplayWindow() const  { return m_picSym.getSPS().getVuiParametersPresentFlag() ? m_picSym.getSPS().getVuiParameters()->getDefaultDisplayWindow() : Window(); }
    170162
    171163  Bool          getSAOMergeAvailability(Int currAddr, Int mergeAddr);
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.cpp

    r1029 r1235  
    5959,m_numPartInCtuHeight(0)
    6060,m_numCtusInFrame(0)
    61 ,m_apcTComSlice(NULL)
    62 ,m_uiNumAllocatedSlice(0)
     61,m_apSlices()
    6362,m_pictureCtuArray(NULL)
    6463,m_numTileColumnsMinus1(0)
     
    6867,m_ctuRsToTsAddrMap(NULL)
    6968,m_saoBlkParams(NULL)
     69#if SVC_EXTENSION
     70#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     71, m_piTileSetIdxMap(NULL)
     72, m_pucTileSetType(NULL)
     73, m_pbSkippedTileSetFlag(NULL)
     74#endif
     75#endif
    7076{}
    7177
    72 
    73 Void TComPicSym::create  ( ChromaFormat chromaFormatIDC, Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
     78#if SVC_EXTENSION
     79Void TComPicSym::create  ( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, const UInt layerId )
    7480{
    7581  UInt i;
     82  m_sps = sps;
     83  m_pps = pps;
     84  m_vps = &vps;
     85
     86  const ChromaFormat chromaFormatIDC = vps.getChromaFormatIdc(&sps, layerId);
     87  const Int iPicWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
     88  const Int iPicHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
     89#else
     90Void TComPicSym::create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth )
     91{
     92  UInt i;
     93  m_sps = sps;
     94  m_pps = pps;
     95
     96  const ChromaFormat chromaFormatIDC=sps.getChromaFormatIdc();
     97  const Int iPicWidth  = sps.getPicWidthInLumaSamples();
     98  const Int iPicHeight = sps.getPicHeightInLumaSamples();
     99#endif
    76100
    77101  m_uhTotalDepth       = uiMaxDepth;
     
    93117  m_pictureCtuArray    = new TComDataCU*[m_numCtusInFrame];
    94118
    95   if (m_uiNumAllocatedSlice>0)
    96   {
    97     for ( i=0; i<m_uiNumAllocatedSlice ; i++ )
    98     {
    99       delete m_apcTComSlice[i];
    100     }
    101     delete [] m_apcTComSlice;
    102   }
    103   m_apcTComSlice      = new TComSlice*[m_numCtusInFrame];
    104   m_apcTComSlice[0]   = new TComSlice;
    105   m_uiNumAllocatedSlice = 1;
     119  clearSliceBuffer();
     120  allocateNewSlice();
     121
    106122  for ( i=0; i<m_numCtusInFrame ; i++ )
    107123  {
     
    131147
    132148  m_saoBlkParams = new SAOBlkParam[m_numCtusInFrame];
     149
     150  xInitTiles();
     151  xInitCtuTsRsAddrMaps();
    133152}
    134153
    135154Void TComPicSym::destroy()
    136155{
    137   if (m_uiNumAllocatedSlice>0)
    138   {
    139     for (Int i = 0; i<m_uiNumAllocatedSlice ; i++ )
    140     {
    141       delete m_apcTComSlice[i];
    142     }
    143     delete [] m_apcTComSlice;
    144   }
    145   m_apcTComSlice = NULL;
     156  clearSliceBuffer();
    146157
    147158  for (Int i = 0; i < m_numCtusInFrame; i++)
     
    179190Void TComPicSym::allocateNewSlice()
    180191{
    181   assert ((m_uiNumAllocatedSlice + 1) <= m_numCtusInFrame);
    182   m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice;
    183   if (m_uiNumAllocatedSlice>=2)
    184   {
    185     m_apcTComSlice[m_uiNumAllocatedSlice-1]->copySliceInfo( m_apcTComSlice[m_uiNumAllocatedSlice-2] );
     192  m_apSlices.push_back(new TComSlice);
     193  m_apSlices.back()->setPPS(&m_pps);
     194  m_apSlices.back()->setSPS(&m_sps);
    186195#if SVC_EXTENSION
    187     m_apcTComSlice[m_uiNumAllocatedSlice-1]->initSlice( m_apcTComSlice[m_uiNumAllocatedSlice-1]->getLayerId() );
     196  m_apSlices.back()->setVPS(m_vps);
     197#endif
     198  if (m_apSlices.size()>=2)
     199  {
     200    m_apSlices.back()->copySliceInfo( m_apSlices[m_apSlices.size()-2] );
     201#if SVC_EXTENSION
     202    m_apSlices.back()->initSlice( m_apSlices[m_apSlices.size()-1]->getLayerId() );
    188203#else
    189     m_apcTComSlice[m_uiNumAllocatedSlice-1]->initSlice();
     204    m_apSlices.back()->initSlice();
    190205#endif
    191206  }
     
    194209Void TComPicSym::clearSliceBuffer()
    195210{
    196   UInt i;
    197   for (i = 1; i < m_uiNumAllocatedSlice; i++)
    198   {
    199     delete m_apcTComSlice[i];
    200   }
    201   m_uiNumAllocatedSlice = 1;
    202 }
    203 
    204 Void TComPicSym::initCtuTsRsAddrMaps()
     211  for (UInt i = 0; i < UInt(m_apSlices.size()); i++)
     212  {
     213    delete m_apSlices[i];
     214  }
     215  m_apSlices.clear();
     216}
     217
     218Void TComPicSym::xInitCtuTsRsAddrMaps()
    205219{
    206220  //generate the Coding Order Map and Inverse Coding Order Map
     
    214228}
    215229
    216 Void TComPicSym::initTiles(TComPPS *pps)
     230Void TComPicSym::xInitTiles()
    217231{
    218232  //set NumColumnsMinus1 and NumRowsMinus1
    219   setNumTileColumnsMinus1( pps->getNumTileColumnsMinus1() );
    220   setNumTileRowsMinus1(    pps->getNumTileRowsMinus1()    );
    221 
    222   const Int numCols = pps->getNumTileColumnsMinus1() + 1;
    223   const Int numRows = pps->getNumTileRowsMinus1() + 1;
     233  setNumTileColumnsMinus1( m_pps.getNumTileColumnsMinus1() );
     234  setNumTileRowsMinus1(    m_pps.getNumTileRowsMinus1()    );
     235
     236  const Int numCols = m_pps.getNumTileColumnsMinus1() + 1;
     237  const Int numRows = m_pps.getNumTileRowsMinus1() + 1;
    224238  const Int numTiles = numRows * numCols;
    225239
     
    227241  m_tileParameters.resize(numTiles);
    228242
    229   if( pps->getTileUniformSpacingFlag() )
     243  if( m_pps.getTileUniformSpacingFlag() )
    230244  {
    231245    //set width and height for each (uniform) tile
     
    248262      for(Int col=0; col < getNumTileColumnsMinus1(); col++)
    249263      {
    250         m_tileParameters[row * numCols + col].setTileWidthInCtus( pps->getTileColumnWidth(col) );
    251         cumulativeTileWidth += pps->getTileColumnWidth(col);
     264        m_tileParameters[row * numCols + col].setTileWidthInCtus( m_pps.getTileColumnWidth(col) );
     265        cumulativeTileWidth += m_pps.getTileColumnWidth(col);
    252266      }
    253267      m_tileParameters[row * numCols + getNumTileColumnsMinus1()].setTileWidthInCtus( getFrameWidthInCtus()-cumulativeTileWidth );
     
    260274      for(Int row=0; row < getNumTileRowsMinus1(); row++)
    261275      {
    262         m_tileParameters[row * numCols + col].setTileHeightInCtus( pps->getTileRowHeight(row) );
    263         cumulativeTileHeight += pps->getTileRowHeight(row);
     276        m_tileParameters[row * numCols + col].setTileHeightInCtus( m_pps.getTileRowHeight(row) );
     277        cumulativeTileHeight += m_pps.getTileRowHeight(row);
    264278      }
    265279      m_tileParameters[getNumTileRowsMinus1() * numCols + col].setTileHeightInCtus( getFrameHeightInCtus()-cumulativeTileHeight );
     
    270284  Int minWidth  = 1;
    271285  Int minHeight = 1;
    272   const Int profileIdc = pps->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc();
     286  const Int profileIdc = m_sps.getPTL()->getGeneralPTL()->getProfileIdc();
    273287  if (  profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10) //TODO: add more profiles to the tile-size check...
    274288  {
    275     if (pps->getTilesEnabledFlag())
     289    if (m_pps.getTilesEnabledFlag())
    276290    {
    277291      minHeight = 64  / g_uiMaxCUHeight;
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicSym.h

    r1029 r1235  
    4141
    4242// Include files
     43#include <deque>
    4344#include "CommonDef.h"
    4445#include "TComSlice.h"
     
    9798  UInt          m_numCtusInFrame;
    9899
     100  std::deque<TComSlice*> m_apSlices;
     101
    99102  TComSlice**   m_apcTComSlice;
    100103  UInt          m_uiNumAllocatedSlice;
     
    108111  UInt*         m_ctuRsToTsAddrMap;    ///< for a given RS (Raster-Scan) address, returns the TS (Tile-Scan; coding order) address. cf CtbAddrRsToTs in specification.
    109112
    110   SAOBlkParam *m_saoBlkParams;
    111 
     113  SAOBlkParam  *m_saoBlkParams;
     114  TComSPS       m_sps;
     115  TComPPS       m_pps;
     116
     117  Void               xInitTiles( );
     118  Void               xInitCtuTsRsAddrMaps();
     119  Void               setNumTileColumnsMinus1( Int i )                      { m_numTileColumnsMinus1 = i;    }
     120  Void               setNumTileRowsMinus1( Int i )                         { m_numTileRowsMinus1 = i;       }
     121  Void               setCtuTsToRsAddrMap( Int ctuTsAddr, Int ctuRsAddr )   { *(m_ctuTsToRsAddrMap + ctuTsAddr) = ctuRsAddr; }
     122  Void               setCtuRsToTsAddrMap( Int ctuRsAddr, Int ctuTsOrder )  { *(m_ctuRsToTsAddrMap + ctuRsAddr) = ctuTsOrder; }
     123 
    112124#if SVC_EXTENSION
     125  const TComVPS* m_vps;
    113126#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    114   Int*          m_piTileSetIdxMap;     //the map of the tile set index relative to LCU raster scan address
    115   UChar*        m_pucTileSetType;
    116   Bool*         m_pbSkippedTileSetFlag;
     127  Int*           m_piTileSetIdxMap;     //the map of the tile set index relative to LCU raster scan address
     128  UChar*         m_pucTileSetType;
     129  Bool*          m_pbSkippedTileSetFlag;
    117130#endif
    118131#endif
    119132
    120133public:
    121   Void               create  ( ChromaFormat chromaFormatIDC, Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
     134#if SVC_EXTENSION
     135  Void               create  ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, const UInt layerId );
     136#if CGS_3D_ASYMLUT
     137  TComPPS*           getPPSToUpdate()                                      { return &m_pps; }
     138#endif
     139#else
     140  Void               create  ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
     141#endif
    122142  Void               destroy ();
    123143
    124144  TComPicSym  ();
    125   TComSlice*         getSlice(UInt i)                                      { return m_apcTComSlice[i];             }
    126   const TComSlice*   getSlice(UInt i) const                                { return m_apcTComSlice[i];             }
     145  TComSlice*         getSlice(UInt i)                                      { return m_apSlices[i];             }
     146  const TComSlice*   getSlice(UInt i) const                                { return m_apSlices[i];             }
    127147  UInt               getFrameWidthInCtus() const                           { return m_frameWidthInCtus;            }
    128148  UInt               getFrameHeightInCtus() const                          { return m_frameHeightInCtus;           }
     
    132152  TComDataCU*        getCtu( UInt ctuRsAddr )                              { return m_pictureCtuArray[ctuRsAddr];  }
    133153  const TComDataCU*  getCtu( UInt ctuRsAddr ) const                        { return m_pictureCtuArray[ctuRsAddr];  }
    134 
    135   Void               setSlice(TComSlice* p, UInt i)                        { m_apcTComSlice[i] = p;           }
    136   UInt               getNumAllocatedSlice() const                          { return m_uiNumAllocatedSlice;         }
     154  const TComSPS&     getSPS()                 const                        { return m_sps; }
     155  const TComPPS&     getPPS()                 const                        { return m_pps; }
     156
     157  TComSlice *        swapSliceObject(TComSlice* p, UInt i)                 { p->setSPS(&m_sps); p->setPPS(&m_pps); TComSlice *pTmp=m_apSlices[i];m_apSlices[i] = p; pTmp->setSPS(0); pTmp->setPPS(0); return pTmp; }
     158  UInt               getNumAllocatedSlice() const                          { return UInt(m_apSlices.size());       }
    137159  Void               allocateNewSlice();
    138160  Void               clearSliceBuffer();
     
    140162  UInt               getNumPartInCtuWidth() const                          { return m_numPartInCtuWidth;    }
    141163  UInt               getNumPartInCtuHeight() const                         { return m_numPartInCtuHeight;   }
    142   Void               setNumTileColumnsMinus1( Int i )                      { m_numTileColumnsMinus1 = i;    }
    143164  Int                getNumTileColumnsMinus1() const                       { return m_numTileColumnsMinus1; }
    144   Void               setNumTileRowsMinus1( Int i )                         { m_numTileRowsMinus1 = i;       }
    145165  Int                getNumTileRowsMinus1() const                          { return m_numTileRowsMinus1;    }
    146166  Int                getNumTiles() const                                   { return (m_numTileRowsMinus1+1)*(m_numTileColumnsMinus1+1); }
    147167  TComTile*          getTComTile  ( UInt tileIdx )                         { return &(m_tileParameters[tileIdx]); }
    148168  const TComTile*    getTComTile  ( UInt tileIdx ) const                   { return &(m_tileParameters[tileIdx]); }
    149   Void               setCtuTsToRsAddrMap( Int ctuTsAddr, Int ctuRsAddr )   { *(m_ctuTsToRsAddrMap + ctuTsAddr) = ctuRsAddr; }
    150169  UInt               getCtuTsToRsAddrMap( Int ctuTsAddr ) const            { return *(m_ctuTsToRsAddrMap + (ctuTsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuTsAddr)); }
    151170  UInt               getTileIdxMap( Int ctuRsAddr ) const                  { return *(m_puiTileIdxMap + ctuRsAddr); }
    152   Void               setCtuRsToTsAddrMap( Int ctuRsAddr, Int ctuTsOrder )  { *(m_ctuRsToTsAddrMap + ctuRsAddr) = ctuTsOrder; }
    153171  UInt               getCtuRsToTsAddrMap( Int ctuRsAddr ) const            { return *(m_ctuRsToTsAddrMap + (ctuRsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuRsAddr)); }
    154   Void               initTiles(TComPPS *pps);
    155 
    156   Void               initCtuTsRsAddrMaps();
    157172  SAOBlkParam*       getSAOBlkParam()                                      { return m_saoBlkParams;}
    158173  const SAOBlkParam* getSAOBlkParam() const                                { return m_saoBlkParams;}
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp

    r1117 r1235  
    7777
    7878#if SVC_EXTENSION
    79 Void TComPicYuv::create( const Int iPicWidth, const Int iPicHeight, const ChromaFormat chromaFormatIDC, const UInt uiMaxCUWidth, const UInt uiMaxCUHeight, const UInt uiMaxCUDepth, Window* conformanceWindow )
     79Void TComPicYuv::create( const Int iPicWidth, const Int iPicHeight, const ChromaFormat chromaFormatIDC, const UInt uiMaxCUWidth, const UInt uiMaxCUHeight, const UInt uiMaxCUDepth, const Window* conformanceWindow )
    8080#else
    8181Void TComPicYuv::create( const Int  iPicWidth,    const  Int iPicHeight,    const ChromaFormat chromaFormatIDC,
  • branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h

    r1130 r1235  
    9696  // ------------------------------------------------------------------------------------------------
    9797#if SVC_EXTENSION
    98   Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, Window* conformanceWindow = NULL);
     98  Void  create      ( Int iPicWidth, Int iPicHeight, ChromaFormat chromaFormatIDC, UInt uiMaxCUWidth, UInt uiMaxCUHeight, UInt uiMaxCUDepth, const Window* conformanceWindow = NULL);
    9999#else
    100100  Void          create            (const Int iPicWidth,
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1231 r1235  
    5151ParameterSetMap<TComSPS> ParameterSetManager::m_spsMap(MAX_NUM_SPS);
    5252ParameterSetMap<TComPPS> ParameterSetManager::m_ppsMap(MAX_NUM_PPS);
    53 Int ParameterSetManager::m_activeVPSId = -1;
     53TComVPS ParameterSetManager::m_activeVPS;
    5454#endif
    5555
     
    110110, m_sliceSegmentBits              ( 0 )
    111111, m_bFinalized                    ( false )
     112, m_bTestWeightPred               ( false )
     113, m_bTestWeightBiPred             ( false )
    112114, m_substreamSizes                ( )
    113 , m_scalingList                   ( NULL )
    114115, m_cabacInitFlag                 ( false )
    115116, m_bLMvdL1Zero                   ( false )
     
    117118, m_LFCrossSliceBoundaryFlag      ( false )
    118119, m_enableTMVPFlag                ( true )
     120, m_encCABACTableIdx              (I_SLICE)
    119121#if SVC_EXTENSION
    120122, m_firstSliceInPic               ( false )
     
    190192{
    191193#if SVC_EXTENSION
    192   m_layerId = layerId;
     194  m_layerId                   = layerId;
    193195  m_activeNumILRRefIdx        = 0;
    194196  m_interLayerPredEnabledFlag = 0;
    195   m_picOrderCntLsb = 0;
     197  m_picOrderCntLsb            = 0;
     198  m_pocResetIdc               = 0;
     199  m_pocResetPeriodId          = 0;
     200  m_fullPocResetFlag          = false;
     201  m_pocLsbVal                 = 0;
     202  m_pocMsbVal                 = 0;
     203  m_pocMsbValRequiredFlag     = false;
     204  m_pocMsbValPresentFlag      = false;
     205  m_pocMsbValNeeded           = false;
     206  m_pocResetDeltaPoc          = 0;
    196207#endif
    197208
     
    216227  m_cabacInitFlag        = false;
    217228  m_enableTMVPFlag = true;
    218   m_pocResetIdc                   = 0;
    219   m_pocResetPeriodId              = 0;
    220   m_fullPocResetFlag              = false;
    221   m_pocLsbVal                     = 0;
    222   m_pocMsbVal                     = 0;
    223   m_pocMsbValRequiredFlag         = false;
    224   m_pocMsbValPresentFlag          = false;
    225   m_pocMsbValNeeded  = false;
    226   m_pocResetDeltaPoc = 0;
    227 }
    228 
    229 Bool TComSlice::getRapPicFlag()
     229}
     230
     231Bool TComSlice::getRapPicFlag() const
    230232{
    231233  return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     
    677679}
    678680
    679 Int TComSlice::getNumRpsCurrTempList()
     681Int TComSlice::getNumRpsCurrTempList() const
    680682{
    681683  Int numRpsCurrTempList = 0;
     
    752754}
    753755
    754 Void TComSlice::checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic)
     756Void TComSlice::checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic)
    755757{
    756758  for(Int i = 0; i < pReferencePictureSet->getNumberOfNegativePictures()+pReferencePictureSet->getNumberOfPositivePictures(); i++)
     
    10071009  // access channel
    10081010#if SVC_EXTENSION
    1009   m_pcVPS                = pSrc->m_pcVPS;
    1010   m_layerId              = pSrc->m_layerId;
     1011  m_pcVPS                      = pSrc->m_pcVPS;
     1012  m_layerId                    = pSrc->m_layerId;
    10111013  m_activeNumILRRefIdx         = pSrc->m_activeNumILRRefIdx;
    10121014  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
    10131015  memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
    10141016#endif
    1015   m_pcSPS                = pSrc->m_pcSPS;
    1016   m_pcPPS                = pSrc->m_pcPPS;
    10171017  m_pcRPS                = pSrc->m_pcRPS;
    10181018  m_iLastIDR             = pSrc->m_iLastIDR;
     
    10641064  }
    10651065
    1066   m_cabacInitFlag                = pSrc->m_cabacInitFlag;
    1067 
    1068   m_bLMvdL1Zero = pSrc->m_bLMvdL1Zero;
    1069   m_LFCrossSliceBoundaryFlag = pSrc->m_LFCrossSliceBoundaryFlag;
     1066  m_cabacInitFlag                 = pSrc->m_cabacInitFlag;
     1067
     1068  m_bLMvdL1Zero                   = pSrc->m_bLMvdL1Zero;
     1069  m_LFCrossSliceBoundaryFlag      = pSrc->m_LFCrossSliceBoundaryFlag;
    10701070  m_enableTMVPFlag                = pSrc->m_enableTMVPFlag;
    10711071  m_maxNumMergeCand               = pSrc->m_maxNumMergeCand;
     1072  m_encCABACTableIdx              = pSrc->m_encCABACTableIdx;
    10721073}
    10731074
     
    13341335/** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
    13351336*/
    1336 Void TComSlice::applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet)
     1337Void TComSlice::applyReferencePictureSet( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet)
    13371338{
    13381339  TComPic* rpcPic;
     
    14231424*/
    14241425#if ALLOW_RECOVERY_POINT_AS_RAP
    1425 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1426Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess, Bool bUseRecoveryPoint)
    14261427#else
    1427 Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
     1428Int TComSlice::checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess)
    14281429#endif
    14291430{
     
    16551656*/
    16561657#if ALLOW_RECOVERY_POINT_AS_RAP
    1657 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
     1658Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint)
    16581659#else
    1659 Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
     1660Void TComSlice::createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP)
    16601661#endif
    16611662{
     
    17731774    Int rIdx =  this->getRPSidx() - pReferencePictureSet->getDeltaRIdxMinus1() - 1;
    17741775    Int deltaRPS = pReferencePictureSet->getDeltaRPS();
    1775     TComReferencePictureSet* pcRefRPS = this->getSPS()->getRPSList()->getReferencePictureSet(rIdx);
     1776    const TComReferencePictureSet* pcRefRPS = this->getSPS()->getRPSList()->getReferencePictureSet(rIdx);
    17761777    Int iRefPics = pcRefRPS->getNumberOfPictures();
    17771778    Int iNewIdc=0;
     
    18661867 * \returns Void
    18671868 */
    1868 Void  TComSlice::initWpScaling()
    1869 {
    1870   const Bool bUseHighPrecisionPredictionWeighting = getSPS()->getUseHighPrecisionPredictionWeighting();
     1869Void  TComSlice::initWpScaling(const TComSPS *sps)
     1870{
     1871  const Bool bUseHighPrecisionPredictionWeighting = sps->getUseHighPrecisionPredictionWeighting();
    18711872  for ( Int e=0 ; e<NUM_REF_PIC_LIST_01 ; e++ )
    18721873  {
     
    19041905, m_bTemporalIdNestingFlag    (false)
    19051906, m_numHrdParameters          (  0)
    1906 , m_hrdParameters             (NULL)
    1907 , m_hrdOpSetIdx               (NULL)
    1908 , m_cprmsPresentFlag          (NULL)
     1907, m_hrdParameters             ()
     1908, m_hrdOpSetIdx               ()
     1909, m_cprmsPresentFlag          ()
    19091910, m_baseLayerInternalFlag     (true)
    19101911, m_baseLayerAvailableFlag    (true)
     
    20262027, m_numHrdParameters          (  0)
    20272028, m_maxNuhReservedZeroLayerId (  0)
    2028 , m_hrdParameters             (NULL)
    2029 , m_hrdOpSetIdx               (NULL)
    2030 , m_cprmsPresentFlag          (NULL)
     2029, m_hrdParameters             ()
     2030, m_hrdOpSetIdx               ()
     2031, m_cprmsPresentFlag          ()
    20312032{
    20322033
     
    20422043TComVPS::~TComVPS()
    20432044{
    2044   if( m_hrdParameters    != NULL )     delete[] m_hrdParameters;
    2045   if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
    2046   if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
    20472045}
    20482046
     
    21192117  }
    21202118
    2121   m_scalingList = new TComScalingList;
    21222119  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    21232120  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
     
    21262123TComSPS::~TComSPS()
    21272124{
    2128 #if SVC_EXTENSION
    2129   if( !m_inferScalingListFlag )
    2130 #endif
    2131   delete m_scalingList;
    21322125  m_RPSList.destroy();
    21332126}
     
    22612254, m_bConstrainedIntraPred            (false)
    22622255, m_bSliceChromaQpFlag               (false)
    2263 , m_pcSPS                            (NULL)
    22642256, m_uiMaxCuDQPDepth                  (0)
    2265 , m_uiMinCuDQPSize                   (0)
    22662257, m_MaxCuChromaQpAdjDepth            (0)
    2267 , m_MinCuChromaQpAdjSize             (0)
    22682258, m_ChromaQpAdjTableSize             (0)
    22692259, m_chromaCbQpOffset                 (0)
     
    22822272, m_numTileColumnsMinus1             (0)
    22832273, m_numTileRowsMinus1                (0)
    2284 , m_numSubstreams                    (1)
    22852274, m_signHideFlag                     (false)
    22862275, m_cabacInitPresentFlag             (false)
    2287 , m_encCABACTableIdx                 (I_SLICE)
    22882276, m_sliceHeaderExtensionPresentFlag  (false)
    22892277, m_loopFilterAcrossSlicesEnabledFlag(false)
     
    23052293#endif //SVC_EXTENSION
    23062294{
    2307   m_scalingList = new TComScalingList;
    23082295  for(Int ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
    23092296  {
     
    23162303  ::memset(m_scaledRefLayerOffsetPresentFlag,   0, sizeof(m_scaledRefLayerOffsetPresentFlag));
    23172304  ::memset(m_refRegionOffsetPresentFlag,   0, sizeof(m_refRegionOffsetPresentFlag));
    2318   ::memset(m_resamplePhaseSetPresentFlag,   0, sizeof(m_resamplePhaseSetPresentFlag));
    2319   ::memset(m_phaseHorLuma,   0, sizeof(m_phaseHorLuma));
    2320   ::memset(m_phaseVerLuma,   0, sizeof(m_phaseVerLuma));
    2321   ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
    2322   ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
    23232305#endif //SVC_EXTENSION
    23242306}
     
    23262308TComPPS::~TComPPS()
    23272309{
    2328 #if SVC_EXTENSION
    2329   if( !m_inferScalingListFlag )
    2330 #endif
    2331   delete m_scalingList;
    23322310}
    23332311
     
    23712349}
    23722350
    2373 Int TComReferencePictureSet::getUsed(Int bufferNum)
     2351Int TComReferencePictureSet::getUsed(Int bufferNum) const
    23742352{
    23752353  return m_used[bufferNum];
    23762354}
    23772355
    2378 Int TComReferencePictureSet::getDeltaPOC(Int bufferNum)
     2356Int TComReferencePictureSet::getDeltaPOC(Int bufferNum) const
    23792357{
    23802358  return m_deltaPOC[bufferNum];
    23812359}
    23822360
    2383 Int TComReferencePictureSet::getNumberOfPictures()
     2361Int TComReferencePictureSet::getNumberOfPictures() const
    23842362{
    23852363  return m_numberOfPictures;
    23862364}
    23872365
    2388 Int TComReferencePictureSet::getPOC(Int bufferNum)
     2366Int TComReferencePictureSet::getPOC(Int bufferNum) const
    23892367{
    23902368  return m_POC[bufferNum];
     
    23962374}
    23972375
    2398 Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum)
     2376Bool TComReferencePictureSet::getCheckLTMSBPresent(Int bufferNum) const
    23992377{
    24002378  return m_bCheckLTMSB[bufferNum];
     
    24202398 * \returns Int
    24212399 */
    2422 Int  TComReferencePictureSet::getRefIdc(Int bufferNum)
     2400Int  TComReferencePictureSet::getRefIdc(Int bufferNum) const
    24232401{
    24242402  return m_refIdc[bufferNum];
     
    24662444 * \returns Void
    24672445 */
    2468 Void TComReferencePictureSet::printDeltaPOC()
     2446Void TComReferencePictureSet::printDeltaPOC() const
    24692447{
    24702448  printf("DeltaPOC = { ");
     
    24822460  }
    24832461  printf("}\n");
    2484 }
    2485 
    2486 TComRPSList::TComRPSList()
    2487 :m_referencePictureSets (NULL)
    2488 {
    2489 }
    2490 
    2491 TComRPSList::~TComRPSList()
    2492 {
    2493 }
    2494 
    2495 Void TComRPSList::create( Int numberOfReferencePictureSets)
    2496 {
    2497   m_numberOfReferencePictureSets = numberOfReferencePictureSets;
    2498   m_referencePictureSets = new TComReferencePictureSet[numberOfReferencePictureSets];
    2499 }
    2500 
    2501 Void TComRPSList::destroy()
    2502 {
    2503   if (m_referencePictureSets)
    2504   {
    2505     delete [] m_referencePictureSets;
    2506   }
    2507   m_numberOfReferencePictureSets = 0;
    2508   m_referencePictureSets = NULL;
    2509 }
    2510 
    2511 
    2512 
    2513 TComReferencePictureSet* TComRPSList::getReferencePictureSet(Int referencePictureSetNum)
    2514 {
    2515   return &m_referencePictureSets[referencePictureSetNum];
    2516 }
    2517 
    2518 Int TComRPSList::getNumberOfReferencePictureSets()
    2519 {
    2520   return m_numberOfReferencePictureSets;
    2521 }
    2522 
    2523 Void TComRPSList::setNumberOfReferencePictureSets(Int numberOfReferencePictureSets)
    2524 {
    2525   m_numberOfReferencePictureSets = numberOfReferencePictureSets;
    25262462}
    25272463
     
    25402476TComScalingList::TComScalingList()
    25412477{
    2542   init();
    2543 }
    2544 
    2545 TComScalingList::~TComScalingList()
    2546 {
    2547   destroy();
     2478  for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     2479  {
     2480    for(UInt listId = 0; listId < SCALING_LIST_NUM; listId++)
     2481    {
     2482      m_scalingListCoef[sizeId][listId].resize(min<Int>(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
     2483    }
     2484  }
    25482485}
    25492486
    25502487/** set default quantization matrix to array
    25512488*/
    2552 Void TComSlice::setDefaultScalingList()
     2489Void TComScalingList::setDefaultScalingList()
    25532490{
    25542491  for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     
    25562493    for(UInt listId=0;listId<SCALING_LIST_NUM;listId++)
    25572494    {
    2558       getScalingList()->processDefaultMatrix(sizeId, listId);
     2495      processDefaultMatrix(sizeId, listId);
    25592496    }
    25602497  }
     
    25632500 * \returns true if use default quantization matrix in all size
    25642501*/
    2565 Bool TComSlice::checkDefaultScalingList()
     2502Bool TComScalingList::checkDefaultScalingList()
    25662503{
    25672504  UInt defaultCounter=0;
     
    25712508    for(UInt listId=0;listId<SCALING_LIST_NUM;listId++)
    25722509    {
    2573       if( !memcmp(getScalingList()->getScalingListAddress(sizeId,listId), getScalingList()->getScalingListDefaultAddress(sizeId, listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix
    2574      && ((sizeId < SCALING_LIST_16x16) || (getScalingList()->getScalingListDC(sizeId,listId) == 16))) // check DC value
     2510      if( !memcmp(getScalingListAddress(sizeId,listId), getScalingListDefaultAddress(sizeId, listId),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix
     2511     && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == 16))) // check DC value
    25752512      {
    25762513        defaultCounter++;
     
    25902527{
    25912528  ::memcpy(getScalingListAddress(sizeId, listId),((listId == refListId)? getScalingListDefaultAddress(sizeId, refListId): getScalingListAddress(sizeId, refListId)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]));
     2529}
     2530
     2531Void TComScalingList::checkPredMode(UInt sizeId, UInt listId)
     2532{
     2533  Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
     2534
     2535  for(Int predListIdx = (Int)listId ; predListIdx >= 0; predListIdx-=predListStep)
     2536  {
     2537    if( !memcmp(getScalingListAddress(sizeId,listId),((listId == predListIdx) ?
     2538      getScalingListDefaultAddress(sizeId, predListIdx): getScalingListAddress(sizeId, predListIdx)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix
     2539     && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value
     2540    {
     2541      setRefMatrixId(sizeId, listId, predListIdx);
     2542      setScalingListPredModeFlag(sizeId, listId, false);
     2543      return;
     2544    }
     2545  }
     2546  setScalingListPredModeFlag(sizeId, listId, true);
    25922547}
    25932548
     
    27792734}
    27802735
    2781 /** initialization process of quantization matrix array
    2782  */
    2783 Void TComScalingList::init()
    2784 {
    2785   for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
    2786   {
    2787     for(UInt listId = 0; listId < SCALING_LIST_NUM; listId++)
    2788     {
    2789       m_scalingListCoef[sizeId][listId] = new Int [min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])];
    2790     }
    2791   }
    2792 }
    2793 
    2794 /** destroy quantization matrix array
    2795  */
    2796 Void TComScalingList::destroy()
    2797 {
    2798   for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
    2799   {
    2800     for(UInt listId = 0; listId < SCALING_LIST_NUM; listId++)
    2801     {
    2802       if(m_scalingListCoef[sizeId][listId]) delete [] m_scalingListCoef[sizeId][listId];
    2803     }
    2804   }
    2805 }
    2806 
    28072736/** get default address of quantization matrix
    28082737 * \param sizeId size index
     
    28602789ParameterSetManager::ParameterSetManager()
    28612790#if SVC_EXTENSION
    2862 : m_activeSPSId(-1)
    2863 , m_activePPSId(-1)
     2791: m_activeSPS()
    28642792#else
    28652793: m_vpsMap(MAX_NUM_VPS)
    28662794, m_spsMap(MAX_NUM_SPS)
    28672795, m_ppsMap(MAX_NUM_PPS)
    2868 , m_activeVPSId(-1)
    2869 , m_activeSPSId(-1)
    2870 , m_activePPSId(-1)
    2871 #endif
    2872 {
     2796, m_activeVPS()
     2797, m_activeSPS()
     2798#endif
     2799{
     2800#if !SVC_EXTENSION
     2801  m_activeVPS.setVPSId(-1);
     2802#endif
     2803  m_activeSPS.setSPSId(-1);
    28732804}
    28742805
     
    28862817  {
    28872818    Int vpsId = sps->getVPSId();
    2888     if (m_vpsMap.getPS(vpsId))
    2889     {
    2890       m_activeVPSId = vpsId;
    2891       m_activeSPSId = spsId;
     2819    TComVPS *vps = m_vpsMap.getPS(vpsId);
     2820    if (vps)
     2821    {
     2822      m_activeVPS = *(vps);
     2823      m_activeSPS = *(sps);
    28922824      return true;
    28932825    }
     
    29122844  {
    29132845    Int spsId = pps->getSPSId();
    2914     if (!isIRAP && (spsId != m_activeSPSId))
     2846    if (!isIRAP && (spsId != m_activeSPS.getSPSId() ))
    29152847    {
    29162848      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR.");
     
    29212853    {
    29222854      Int vpsId = sps->getVPSId();
    2923       if (!isIRAP && (vpsId != m_activeVPSId))
     2855      if (!isIRAP && (vpsId != m_activeVPS.getVPSId() ))
    29242856      {
    29252857        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IDR.");
    29262858        return false;
    29272859      }
    2928       if (m_vpsMap.getPS(vpsId))
    2929       {
    2930         m_activePPSId = ppsId;
    2931         m_activeVPSId = vpsId;
    2932         m_activeSPSId = spsId;
     2860      TComVPS *vps =m_vpsMap.getPS(vpsId);
     2861      if (vps)
     2862      {
     2863        m_activeVPS = *(vps);
     2864        m_activeSPS = *(sps);
     2865#if SVC_EXTENSION
     2866        m_activePPS = *(pps);
     2867#endif
    29332868        return true;
    29342869      }
     
    29692904}
    29702905
     2906Void calculateParameterSetChangedFlag(Bool &bChanged, const std::vector<UChar> *pOldData, const std::vector<UChar> *pNewData)
     2907{
     2908  if (!bChanged)
     2909  {
     2910    if ((pOldData==0 && pOldData!=0) || (pOldData!=0 && pOldData==0))
     2911    {
     2912      bChanged=true;
     2913    }
     2914    else if (pOldData!=0 && pOldData!=0)
     2915    {
     2916      // compare the two
     2917      if (pOldData->size() != pOldData->size())
     2918      {
     2919        bChanged=true;
     2920      }
     2921      else
     2922      {
     2923        const UChar *pNewDataArray=&(*pNewData)[0];
     2924        const UChar *pOldDataArray=&(*pOldData)[0];
     2925        if (memcmp(pOldDataArray, pNewDataArray, pOldData->size()))
     2926        {
     2927          bChanged=true;
     2928        }
     2929      }
     2930    }
     2931  }
     2932}
     2933
    29712934#if SVC_EXTENSION
    29722935Void ProfileTierLevel::copyProfileInfo(ProfileTierLevel *ptl)
     
    29852948}
    29862949
    2987 Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId)
    2988 {
    2989   static Window win;
     2950const Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId) const
     2951{
     2952  static const Window win;
    29902953
    29912954  for( Int i = m_numRefLayerLocationOffsets-1; i >= 0; i-- )
     
    29962959    }
    29972960  }
    2998 
    2999   win.resetWindow();  // scaled reference layer offsets are inferred to be zero when not present
     2961 
    30002962  return win;
    30012963}
    30022964
    3003 Window& TComPPS::getRefLayerWindowForLayer(Int layerId)
    3004 {
    3005   static Window win;
     2965const Window& TComPPS::getRefLayerWindowForLayer(Int layerId) const
     2966{
     2967  static const Window win;
    30062968
    30072969  for( Int i = m_numRefLayerLocationOffsets-1; i >= 0; i-- )
     
    30132975  }
    30142976
    3015   win.resetWindow();  // reference region offsets are inferred to be zero when not present
    30162977  return win;
    30172978}
    30182979
    3019 Bool TComPPS::hasZeroResamplingPhase(Int refLayerId)
    3020 {
    3021   Bool phaseSetPresentFlag;
    3022   Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma;
    3023 
    3024   getResamplingPhase(refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma);
    3025 
    3026   return ( phaseHorLuma == 0 && phaseHorChroma == 0 && phaseVerLuma == 0 && phaseVerChroma == 0);
    3027 }
    3028 
    3029 Void TComPPS::getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma)
    3030 {
    3031   phaseSetPresentFlag = false;
    3032   phaseHorLuma = 0, phaseVerLuma = 0, phaseHorChroma = 0, phaseVerChroma = 0;
     2980Bool TComPPS::hasZeroResamplingPhase(Int refLayerId) const
     2981{
     2982  const ResamplingPhase &resamplingPhase = getResamplingPhase(refLayerId);
     2983
     2984  return ( resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0 && resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0 );
     2985}
     2986
     2987const ResamplingPhase& TComPPS::getResamplingPhase(Int refLayerId) const
     2988{
     2989  static const ResamplingPhase resamplingPhase;
    30332990
    30342991  for( Int i = m_numRefLayerLocationOffsets-1; i >= 0; i-- )
     
    30362993    if( refLayerId == m_refLocationOffsetLayerId[i] )
    30372994    {
    3038       phaseSetPresentFlag = m_resamplePhaseSetPresentFlag[i];
    3039       phaseHorLuma        = m_phaseHorLuma[i];
    3040       phaseVerLuma        = m_phaseVerLuma[i];
    3041       phaseHorChroma      = m_phaseHorChroma[i];
    3042       phaseVerChroma      = m_phaseVerChroma[i];
    3043 
    3044       return;
    3045     }
    3046   }
     2995      return m_resamplingPhase[i];
     2996    }
     2997  }
     2998
     2999  return resamplingPhase;
    30473000}
    30483001
     
    32113164}
    32123165
    3213 Int TComVPS::getNumViews()
     3166Int TComVPS::getNumViews() const
    32143167{
    32153168  Int numViews = 1;
    3216   for( Int i = 0; i <= getMaxLayers() - 1; i++ )
    3217   {
    3218     Int lId = getLayerIdInNuh( i );
    3219     if ( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) )
     3169  for( Int i = 0; i < m_uiMaxLayers; i++ )
     3170  {
     3171    Int lId = m_layerIdInNuh[i];
     3172    if( i > 0 && ( getViewIndex( lId ) != getScalabilityId( i - 1, VIEW_ORDER_INDEX ) ) )
    32203173    {
    32213174      numViews++;
     
    32263179}
    32273180
    3228 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
     3181Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType ) const
    32293182{
    32303183  return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;
    32313184}
    32323185
    3233 Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType )
     3186Int TComVPS::scalTypeToScalIdx( ScalabilityType scalType ) const
    32343187{
    32353188  assert( scalType >= 0 && scalType <= MAX_VPS_NUM_SCALABILITY_TYPES );
     
    32453198}
    32463199
    3247 Int TComVPS::getLayerIdcForOls( Int olsIdx, Int layerId )
     3200Int TComVPS::getLayerIdcForOls( Int olsIdx, Int layerId ) const
    32483201{
    32493202  Int layerIdc = -1;
    32503203  UInt lsIdx = m_outputLayerSetIdx[olsIdx];
    32513204
    3252   std::vector<Int>::iterator it = std::find( m_layerSetLayerIdList[lsIdx].begin(), m_layerSetLayerIdList[lsIdx].end(), layerId );
     3205  std::vector<Int>::const_iterator it = std::find( m_layerSetLayerIdList[lsIdx].begin(), m_layerSetLayerIdList[lsIdx].end(), layerId );
    32533206
    32543207  if( it != m_layerSetLayerIdList[lsIdx].end() )
     
    34023355}
    34033356
    3404 Void TComVPS::deriveNecessaryLayerFlag(Int const olsIdx)
     3357Void TComVPS::deriveNecessaryLayerFlag(const Int olsIdx)
    34053358{
    34063359  Int lsIdx = m_outputLayerSetIdx[olsIdx];
     
    34553408}
    34563409
    3457 Int TComVPS::calculateLenOfSyntaxElement( Int const numVal )
     3410Int TComVPS::calculateLenOfSyntaxElement( const Int numVal ) const
    34583411{
    34593412  Int numBits = 1;
     
    34803433UInt TComSlice::getPicWidthInLumaSamples()
    34813434{
    3482   TComSPS *sps = getSPS();
    3483   TComVPS *vps = getVPS();
    34843435  UInt retVal, layerId = getLayerId();
    34853436
     3437  if ( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
     3438  {
     3439    if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
     3440    {
     3441      retVal = m_pcVPS->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples();
     3442    }
     3443    else
     3444    {
     3445      retVal = m_pcSPS->getPicWidthInLumaSamples();
     3446    }
     3447  }
     3448  else
     3449  {
     3450    retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getPicWidthVpsInLumaSamples();
     3451  }
     3452
     3453  return retVal;
     3454}
     3455
     3456UInt TComVPS::getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const
     3457{
     3458  UInt retVal;
     3459
    34863460  if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    34873461  {
    3488     if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
    3489     {
    3490       retVal = vps->getVpsRepFormat(layerId)->getPicWidthVpsInLumaSamples();
     3462    if( layerId == 0 && m_nonHEVCBaseLayerFlag )
     3463    {
     3464      retVal = m_vpsRepFormat[layerId].getPicWidthVpsInLumaSamples();
    34913465    }
    34923466    else
     
    34973471  else
    34983472  {
    3499     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getPicWidthVpsInLumaSamples();
     3473    retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getPicWidthVpsInLumaSamples();
    35003474  }
    35013475
     
    35053479UInt TComSlice::getPicHeightInLumaSamples()
    35063480{
    3507   TComSPS *sps = getSPS();
    3508   TComVPS *vps = getVPS();
    35093481  UInt retVal, layerId = getLayerId();
    35103482
     3483  if ( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
     3484  {
     3485    if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
     3486    {
     3487      retVal = m_pcVPS->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples();
     3488    }
     3489    else
     3490    {
     3491      retVal = m_pcSPS->getPicHeightInLumaSamples();
     3492    }
     3493  }
     3494  else
     3495  {
     3496    retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getPicHeightVpsInLumaSamples();
     3497  }
     3498
     3499  return retVal;
     3500}
     3501
     3502UInt TComVPS::getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const
     3503{
     3504  UInt retVal;
     3505
    35113506  if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    35123507  {
    3513     if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
    3514     {
    3515       retVal = vps->getVpsRepFormat(layerId)->getPicHeightVpsInLumaSamples();
     3508    if( layerId == 0 && m_nonHEVCBaseLayerFlag )
     3509    {
     3510      retVal = m_vpsRepFormat[layerId].getPicHeightVpsInLumaSamples();
    35163511    }
    35173512    else
     
    35223517  else
    35233518  {
    3524     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getPicHeightVpsInLumaSamples();
     3519    retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getPicHeightVpsInLumaSamples();
    35253520  }
    35263521
     
    35283523}
    35293524
    3530 #if AUXILIARY_PICTURES
    35313525ChromaFormat TComSlice::getChromaFormatIdc()
    3532 #else
    3533 UInt TComSlice::getChromaFormatIdc()
    3534 #endif
    3535 {
    3536   TComSPS *sps = getSPS();
    3537   TComVPS *vps = getVPS();
    3538 #if AUXILIARY_PICTURES
     3526{
    35393527  ChromaFormat retVal;
    35403528  UInt layerId = getLayerId();
    3541 #else
     3529
     3530  if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
     3531  {
     3532    if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
     3533    {
     3534      retVal = m_pcVPS->getVpsRepFormat(layerId)->getChromaFormatVpsIdc();
     3535    }
     3536    else
     3537    {
     3538      retVal = m_pcSPS->getChromaFormatIdc();
     3539    }
     3540  }
     3541  else
     3542  {
     3543    retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getChromaFormatVpsIdc();
     3544  }
     3545
     3546  return retVal;
     3547}
     3548
     3549ChromaFormat TComVPS::getChromaFormatIdc( const TComSPS* sps, const UInt layerId ) const
     3550{
     3551  ChromaFormat retVal;
     3552
     3553  if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
     3554  {
     3555    if( layerId == 0 && m_nonHEVCBaseLayerFlag )
     3556    {
     3557      retVal = m_vpsRepFormat[layerId].getChromaFormatVpsIdc();
     3558    }
     3559    else
     3560    {
     3561      retVal = sps->getChromaFormatIdc();
     3562    }
     3563  }
     3564  else
     3565  {
     3566    retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getChromaFormatVpsIdc();
     3567  }
     3568
     3569  return retVal;
     3570}
     3571
     3572UInt TComSlice::getBitDepthY()
     3573{
    35423574  UInt retVal, layerId = getLayerId();
    3543 #endif
     3575
     3576  if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
     3577  {
     3578    if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
     3579    {
     3580      retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVpsLuma();
     3581    }
     3582    else
     3583    {
     3584      retVal = m_pcSPS->getBitDepth(CHANNEL_TYPE_LUMA);
     3585    }
     3586  }
     3587  else
     3588  {
     3589    retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVpsLuma();
     3590  }
     3591
     3592  return retVal;
     3593}
     3594
     3595UInt TComVPS::getBitDepthY( const TComSPS* sps, const UInt layerId ) const
     3596{
     3597  UInt retVal;
    35443598
    35453599  if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    35463600  {
    3547     if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
    3548     {
    3549       retVal = vps->getVpsRepFormat(layerId)->getChromaFormatVpsIdc();
     3601    if( layerId == 0 && m_nonHEVCBaseLayerFlag )
     3602    {
     3603      retVal = m_vpsRepFormat[layerId].getBitDepthVpsLuma();
    35503604    }
    35513605    else
    35523606    {
    3553       retVal = sps->getChromaFormatIdc();
     3607      retVal = sps->getBitDepth(CHANNEL_TYPE_LUMA);
    35543608    }
    35553609  }
    35563610  else
    35573611  {
    3558     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getChromaFormatVpsIdc();
     3612    retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVpsLuma();
    35593613  }
    35603614
     
    35623616}
    35633617
    3564 UInt TComSlice::getBitDepthY()
    3565 {
    3566   TComSPS *sps = getSPS();
    3567   TComVPS *vps = getVPS();
     3618UInt TComSlice::getBitDepthC()
     3619{
    35683620  UInt retVal, layerId = getLayerId();
    35693621
     3622  if( layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
     3623  {
     3624    if( layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
     3625    {
     3626      retVal = m_pcVPS->getVpsRepFormat(layerId)->getBitDepthVpsChroma();
     3627    }
     3628    else
     3629    {
     3630      retVal = m_pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA);
     3631    }
     3632  }
     3633  else
     3634  {
     3635    retVal = m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(layerId)))->getBitDepthVpsChroma();
     3636  }
     3637
     3638  return retVal;
     3639}
     3640
     3641UInt TComVPS::getBitDepthC( const TComSPS* sps, const UInt layerId ) const
     3642{
     3643  UInt retVal;
     3644
    35703645  if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    35713646  {
    3572     if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
    3573     {
    3574       retVal = vps->getVpsRepFormat(layerId)->getBitDepthVpsLuma();
     3647    if( layerId == 0 && m_nonHEVCBaseLayerFlag )
     3648    {
     3649      retVal = m_vpsRepFormat[layerId].getBitDepthVpsChroma();
    35753650    }
    35763651    else
    35773652    {
    3578       retVal = sps->getBitDepth(CHANNEL_TYPE_LUMA);
     3653      retVal = sps->getBitDepth(CHANNEL_TYPE_CHROMA);
    35793654    }
    35803655  }
    35813656  else
    35823657  {
    3583     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getBitDepthVpsLuma();
     3658    retVal = m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getBitDepthVpsChroma();
    35843659  }
    35853660
     
    35873662}
    35883663
    3589 UInt TComSlice::getBitDepthC()
    3590 {
    3591   TComSPS *sps = getSPS();
    3592   TComVPS *vps = getVPS();
    3593   UInt retVal, layerId = getLayerId();
    3594 
    3595   if( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    3596   {
    3597     if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
    3598     {
    3599       retVal = vps->getVpsRepFormat(layerId)->getBitDepthVpsChroma();
     3664Int TComSlice::getQpBDOffsetY()
     3665{
     3666  return (getBitDepthY() - 8) * 6;
     3667}
     3668
     3669Int TComSlice::getQpBDOffsetC()
     3670{
     3671  return (getBitDepthC() - 8) * 6;
     3672}
     3673
     3674const Window& TComSlice::getConformanceWindow() const
     3675{
     3676  if ( m_layerId == 0 || m_pcSPS->getV1CompatibleSPSFlag() == 1 )
     3677  {
     3678    if( m_layerId == 0 && m_pcVPS->getNonHEVCBaseLayerFlag() )
     3679    {
     3680      return m_pcVPS->getVpsRepFormat(m_layerId)->getConformanceWindowVps();
    36003681    }
    36013682    else
    36023683    {
    3603       retVal = sps->getBitDepth(CHANNEL_TYPE_CHROMA);
     3684      return m_pcSPS->getConformanceWindow();
    36043685    }
    36053686  }
    36063687  else
    36073688  {
    3608     retVal = vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getBitDepthVpsChroma();
    3609   }
    3610 
    3611   return retVal;
    3612 }
    3613 
    3614 Int TComSlice::getQpBDOffsetY()
    3615 {
    3616   return (getBitDepthY() - 8) * 6;
    3617 }
    3618 
    3619 Int TComSlice::getQpBDOffsetC()
    3620 {
    3621   return (getBitDepthC() - 8) * 6;
    3622 }
    3623 
    3624 Window& TComSlice::getConformanceWindow()
    3625 {
    3626   TComSPS *sps = getSPS();
    3627   TComVPS *vps = getVPS();
    3628   UInt layerId = getLayerId();
    3629 
     3689    return m_pcVPS->getVpsRepFormat(m_pcSPS->getUpdateRepFormatFlag() ? m_pcSPS->getUpdateRepFormatIndex() : m_pcVPS->getVpsRepFormatIdx(m_pcVPS->getLayerIdxInVps(m_layerId)))->getConformanceWindowVps();
     3690  }
     3691}
     3692
     3693const Window& TComVPS::getConformanceWindow( const TComSPS* sps, const UInt layerId ) const
     3694{
    36303695  if ( layerId == 0 || sps->getV1CompatibleSPSFlag() == 1 )
    36313696  {
    3632     if( layerId == 0 && vps->getNonHEVCBaseLayerFlag() )
    3633     {
    3634       return vps->getVpsRepFormat(layerId)->getConformanceWindowVps();
     3697    if( layerId == 0 && m_nonHEVCBaseLayerFlag )
     3698    {
     3699      return m_vpsRepFormat[layerId].getConformanceWindowVps();
    36353700    }
    36363701    else
     
    36413706  else
    36423707  {
    3643     return vps->getVpsRepFormat(sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(vps->getLayerIdxInVps(layerId)))->getConformanceWindowVps();
     3708    return m_vpsRepFormat[sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : m_vpsRepFormatIdx[m_layerIdxInVps[layerId]]].getConformanceWindowVps();
    36443709  }
    36453710}
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1230 r1235  
    5555#if SVC_EXTENSION
    5656class TComPicYuv;
     57class TComSPS;
    5758#endif
    5859// ====================================================================================================================
     
    8889
    8990public:
    90   TComReferencePictureSet();
     91          TComReferencePictureSet();
    9192  virtual ~TComReferencePictureSet();
    92   Int   getPocLSBLT(Int i)                       { return m_pocLSBLT[i]; }
    93   Void  setPocLSBLT(Int i, Int x)                { m_pocLSBLT[i] = x; }
    94   Int   getDeltaPocMSBCycleLT(Int i)             { return m_deltaPOCMSBCycleLT[i]; }
    95   Void  setDeltaPocMSBCycleLT(Int i, Int x)      { m_deltaPOCMSBCycleLT[i] = x; }
    96   Bool  getDeltaPocMSBPresentFlag(Int i)         { return m_deltaPocMSBPresentFlag[i]; }
    97   Void  setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x;    }
    98   Void setUsed(Int bufferNum, Bool used);
    99   Void setDeltaPOC(Int bufferNum, Int deltaPOC);
    100   Void setPOC(Int bufferNum, Int deltaPOC);
    101   Void setNumberOfPictures(Int numberOfPictures);
    102   Void setCheckLTMSBPresent(Int bufferNum, Bool b );
    103   Bool getCheckLTMSBPresent(Int bufferNum);
    104 
    105   Int  getUsed(Int bufferNum);
    106   Int  getDeltaPOC(Int bufferNum);
    107   Int  getPOC(Int bufferNum);
    108   Int  getNumberOfPictures();
    109 
    110   Void setNumberOfNegativePictures(Int number)  { m_numberOfNegativePictures = number; }
    111   Int  getNumberOfNegativePictures()            { return m_numberOfNegativePictures; }
    112   Void setNumberOfPositivePictures(Int number)  { m_numberOfPositivePictures = number; }
    113   Int  getNumberOfPositivePictures()            { return m_numberOfPositivePictures; }
    114   Void setNumberOfLongtermPictures(Int number)  { m_numberOfLongtermPictures = number; }
    115   Int  getNumberOfLongtermPictures()            { return m_numberOfLongtermPictures; }
    116 
    117   Void setInterRPSPrediction(Bool flag)         { m_interRPSPrediction = flag; }
    118   Bool getInterRPSPrediction()                  { return m_interRPSPrediction; }
    119   Void setDeltaRIdxMinus1(Int x)                { m_deltaRIdxMinus1 = x; }
    120   Int  getDeltaRIdxMinus1()                     { return m_deltaRIdxMinus1; }
    121   Void setDeltaRPS(Int x)                       { m_deltaRPS = x; }
    122   Int  getDeltaRPS()                            { return m_deltaRPS; }
    123   Void setNumRefIdc(Int x)                      { m_numRefIdc = x; }
    124   Int  getNumRefIdc()                           { return m_numRefIdc; }
    125 
    126   Void setRefIdc(Int bufferNum, Int refIdc);
    127   Int  getRefIdc(Int bufferNum);
    128 
    129   Void sortDeltaPOC();
    130   Void printDeltaPOC();
     93  Int     getPocLSBLT(Int i) const                     { return m_pocLSBLT[i];              }
     94  Void    setPocLSBLT(Int i, Int x)                    { m_pocLSBLT[i] = x;                  }
     95  Int     getDeltaPocMSBCycleLT(Int i) const           { return m_deltaPOCMSBCycleLT[i];    }
     96  Void    setDeltaPocMSBCycleLT(Int i, Int x)          { m_deltaPOCMSBCycleLT[i] = x;        }
     97  Bool    getDeltaPocMSBPresentFlag(Int i) const       { return m_deltaPocMSBPresentFlag[i]; }
     98  Void    setDeltaPocMSBPresentFlag(Int i, Bool x)    { m_deltaPocMSBPresentFlag[i] = x;    }
     99  Void    setUsed(Int bufferNum, Bool used);
     100  Void    setDeltaPOC(Int bufferNum, Int deltaPOC);
     101  Void    setPOC(Int bufferNum, Int deltaPOC);
     102  Void    setNumberOfPictures(Int numberOfPictures);
     103  Void    setCheckLTMSBPresent(Int bufferNum, Bool b );
     104  Bool    getCheckLTMSBPresent(Int bufferNum) const;
     105
     106  Int     getUsed(Int bufferNum) const;
     107  Int     getDeltaPOC(Int bufferNum) const;
     108  Int     getPOC(Int bufferNum) const;
     109  Int     getNumberOfPictures() const;
     110
     111  Void    setNumberOfNegativePictures(Int number)      { m_numberOfNegativePictures = number; }
     112  Int     getNumberOfNegativePictures() const          { return m_numberOfNegativePictures;  }
     113  Void    setNumberOfPositivePictures(Int number)      { m_numberOfPositivePictures = number; }
     114  Int     getNumberOfPositivePictures() const          { return m_numberOfPositivePictures;  }
     115  Void    setNumberOfLongtermPictures(Int number)      { m_numberOfLongtermPictures = number; }
     116  Int     getNumberOfLongtermPictures() const          { return m_numberOfLongtermPictures;  }
     117
     118  Void    setInterRPSPrediction(Bool flag)             { m_interRPSPrediction = flag;        }
     119  Bool    getInterRPSPrediction() const                { return m_interRPSPrediction;        }
     120  Void    setDeltaRIdxMinus1(Int x)                    { m_deltaRIdxMinus1 = x;              }
     121  Int     getDeltaRIdxMinus1() const                   { return m_deltaRIdxMinus1;            }
     122  Void    setDeltaRPS(Int x)                           { m_deltaRPS = x;                      }
     123  Int     getDeltaRPS() const                          { return m_deltaRPS;                  }
     124  Void    setNumRefIdc(Int x)                          { m_numRefIdc = x;                    }
     125  Int     getNumRefIdc() const                         { return m_numRefIdc;                  }
     126
     127  Void    setRefIdc(Int bufferNum, Int refIdc);
     128  Int     getRefIdc(Int bufferNum) const ;
     129
     130  Void    sortDeltaPOC();
     131  Void    printDeltaPOC() const;
    131132};
    132133
     
    135136{
    136137private:
    137   Int  m_numberOfReferencePictureSets;
    138   TComReferencePictureSet* m_referencePictureSets;
     138  std::vector<TComReferencePictureSet> m_referencePictureSets;
    139139
    140140public:
    141   TComRPSList();
    142   virtual ~TComRPSList();
    143 
    144   Void  create  (Int numberOfEntries);
    145   Void  destroy ();
    146 
    147 
    148   TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum);
    149   Int getNumberOfReferencePictureSets();
    150   Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets);
     141                                 TComRPSList()                                            { }
     142  virtual                        ~TComRPSList()                                           { }
     143
     144  Void                           create  (Int numberOfEntries)                            { m_referencePictureSets.resize(numberOfEntries);         }
     145  Void                           destroy ()                                               { }
     146
     147
     148  TComReferencePictureSet*       getReferencePictureSet(Int referencePictureSetNum)       { return &m_referencePictureSets[referencePictureSetNum]; }
     149  const TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum) const { return &m_referencePictureSets[referencePictureSetNum]; }
     150
     151  Int                            getNumberOfReferencePictureSets() const                  { return Int(m_referencePictureSets.size());              }
    151152};
    152153
     
    155156{
    156157public:
    157   TComScalingList();
    158   virtual ~TComScalingList();
    159   Void     setScalingListPresentFlag      (Bool b)                             { m_scalingListPresentFlag = b;    }
    160   Bool     getScalingListPresentFlag      ()                                   { return m_scalingListPresentFlag; }
    161   Int*           getScalingListAddress    (UInt sizeId, UInt listId)           { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient
    162   const Int*     getScalingListAddress    (UInt sizeId, UInt listId) const     { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient
    163   Bool     checkPredMode                  (UInt sizeId, UInt listId);
    164   Void     setRefMatrixId                 (UInt sizeId, UInt listId, UInt u)   { m_refMatrixId[sizeId][listId] = u;    }     //!< set reference matrix ID
    165   UInt     getRefMatrixId                 (UInt sizeId, UInt listId)           { return m_refMatrixId[sizeId][listId]; }     //!< get reference matrix ID
    166   Int*     getScalingListDefaultAddress   (UInt sizeId, UInt listId);                                                        //!< get default matrix coefficient
    167   Void     processDefaultMatrix           (UInt sizeId, UInt listId);
    168   Void     setScalingListDC               (UInt sizeId, UInt listId, UInt u)   { m_scalingListDC[sizeId][listId] = u; }      //!< set DC value
    169 
    170   Int      getScalingListDC               (UInt sizeId, UInt listId) const     { return m_scalingListDC[sizeId][listId]; }   //!< get DC value
    171   Void     checkDcOfMatrix                ();
    172   Void     processRefMatrix               (UInt sizeId, UInt listId , UInt refListId );
    173   Bool     xParseScalingList              (Char* pchFile);
     158             TComScalingList();
     159  virtual    ~TComScalingList()                                                 { }
     160  Int*       getScalingListAddress(UInt sizeId, UInt listId)                    { return &(m_scalingListCoef[sizeId][listId][0]);            } //!< get matrix coefficient
     161  const Int* getScalingListAddress(UInt sizeId, UInt listId) const              { return &(m_scalingListCoef[sizeId][listId][0]);            } //!< get matrix coefficient
     162  Void       checkPredMode(UInt sizeId, UInt listId);
     163
     164  Void       setRefMatrixId(UInt sizeId, UInt listId, UInt u)                   { m_refMatrixId[sizeId][listId] = u;                         } //!< set reference matrix ID
     165  UInt       getRefMatrixId(UInt sizeId, UInt listId) const                     { return m_refMatrixId[sizeId][listId];                      } //!< get reference matrix ID
     166
     167  Int*       getScalingListDefaultAddress(UInt sizeId, UInt listId);                                                                           //!< get default matrix coefficient
     168  Void       processDefaultMatrix(UInt sizeId, UInt listId);
     169
     170  Void       setScalingListDC(UInt sizeId, UInt listId, UInt u)                 { m_scalingListDC[sizeId][listId] = u;                       } //!< set DC value
     171  Int        getScalingListDC(UInt sizeId, UInt listId) const                   { return m_scalingListDC[sizeId][listId];                    } //!< get DC value
     172
     173  Void       setScalingListPredModeFlag(UInt sizeId, UInt listId, Bool bIsDPCM) { m_scalingListPredModeFlagIsDPCM[sizeId][listId] = bIsDPCM; }
     174  Bool       getScalingListPredModeFlag(UInt sizeId, UInt listId) const         { return m_scalingListPredModeFlagIsDPCM[sizeId][listId];    }
     175
     176  Void       checkDcOfMatrix();
     177  Void       processRefMatrix(UInt sizeId, UInt listId , UInt refListId );
     178  Bool       xParseScalingList(Char* pchFile);
     179  Void       setDefaultScalingList();
     180  Bool       checkDefaultScalingList();
    174181
    175182private:
    176   Void     init                    ();
    177   Void     destroy                 ();
    178   Void     outputScalingLists(std::ostream &os) const;
    179   Int      m_scalingListDC               [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16
    180   Bool     m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag
    181   UInt     m_refMatrixId                 [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID
    182   Bool     m_scalingListPresentFlag;                                                //!< flag for using default matrix
    183   UInt     m_predMatrixId                [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index
    184   Int      *m_scalingListCoef            [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
     183  Void       outputScalingLists(std::ostream &os) const;
     184  Bool             m_scalingListPredModeFlagIsDPCM [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index
     185  Int              m_scalingListDC                 [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16
     186  UInt             m_refMatrixId                   [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID
     187  std::vector<Int> m_scalingListCoef               [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix
    185188};
    186189
     
    203206
    204207public:
    205   ProfileTierLevel();
    206 
    207   Int  getProfileSpace() const                     { return m_profileSpace; }
    208   Void setProfileSpace(Int x)                      { m_profileSpace = x; }
    209 
    210   Level::Tier  getTierFlag() const                 { return m_tierFlag; }
    211   Void setTierFlag(Level::Tier x)                  { m_tierFlag = x; }
    212 
    213   Profile::Name   getProfileIdc() const            { return m_profileIdc; }
    214   Void setProfileIdc(Profile::Name x)              { m_profileIdc = x; }
    215 
    216   Bool getProfileCompatibilityFlag(Int i) const    { return m_profileCompatibilityFlag[i]; }
    217   Void setProfileCompatibilityFlag(Int i, Bool x)  { m_profileCompatibilityFlag[i] = x; }
    218 
    219   Level::Name   getLevelIdc() const                { return m_levelIdc; }
    220   Void setLevelIdc(Level::Name x)                  { m_levelIdc = x; }
    221 
    222   Bool getProgressiveSourceFlag() const            { return m_progressiveSourceFlag; }
    223   Void setProgressiveSourceFlag(Bool b)            { m_progressiveSourceFlag = b; }
    224 
    225   Bool getInterlacedSourceFlag() const             { return m_interlacedSourceFlag; }
    226   Void setInterlacedSourceFlag(Bool b)             { m_interlacedSourceFlag = b; }
    227 
    228   Bool getNonPackedConstraintFlag() const          { return m_nonPackedConstraintFlag; }
    229   Void setNonPackedConstraintFlag(Bool b)          { m_nonPackedConstraintFlag = b; }
    230 
    231   Bool getFrameOnlyConstraintFlag() const          { return m_frameOnlyConstraintFlag; }
    232   Void setFrameOnlyConstraintFlag(Bool b)          { m_frameOnlyConstraintFlag = b; }
    233 
    234   UInt getBitDepthConstraint() const               { return m_bitDepthConstraintValue; }
    235   Void setBitDepthConstraint(UInt bitDepth)        { m_bitDepthConstraintValue=bitDepth; }
    236 
    237   ChromaFormat getChromaFormatConstraint() const   { return m_chromaFormatConstraintValue; }
    238   Void setChromaFormatConstraint(ChromaFormat fmt) { m_chromaFormatConstraintValue=fmt; }
    239 
    240   Bool getIntraConstraintFlag() const              { return m_intraConstraintFlag; }
    241   Void setIntraConstraintFlag(Bool b)              { m_intraConstraintFlag = b; }
    242 
    243   Bool getLowerBitRateConstraintFlag() const       { return m_lowerBitRateConstraintFlag; }
    244   Void setLowerBitRateConstraintFlag(Bool b)       { m_lowerBitRateConstraintFlag = b; }
     208                ProfileTierLevel();
     209
     210  Int           getProfileSpace() const                     { return m_profileSpace;                }
     211  Void          setProfileSpace(Int x)                      { m_profileSpace = x;                  }
     212
     213  Level::Tier   getTierFlag() const                         { return m_tierFlag;                    }
     214  Void          setTierFlag(Level::Tier x)                  { m_tierFlag = x;                      }
     215
     216  Profile::Name getProfileIdc() const                       { return m_profileIdc;                  }
     217  Void          setProfileIdc(Profile::Name x)              { m_profileIdc = x;                    }
     218
     219  Bool          getProfileCompatibilityFlag(Int i) const    { return m_profileCompatibilityFlag[i]; }
     220  Void          setProfileCompatibilityFlag(Int i, Bool x)  { m_profileCompatibilityFlag[i] = x;    }
     221
     222  Level::Name   getLevelIdc() const                         { return m_levelIdc;                    }
     223  Void          setLevelIdc(Level::Name x)                  { m_levelIdc = x;                      }
     224
     225  Bool          getProgressiveSourceFlag() const            { return m_progressiveSourceFlag;      }
     226  Void          setProgressiveSourceFlag(Bool b)            { m_progressiveSourceFlag = b;          }
     227
     228  Bool          getInterlacedSourceFlag() const             { return m_interlacedSourceFlag;        }
     229  Void          setInterlacedSourceFlag(Bool b)             { m_interlacedSourceFlag = b;          }
     230
     231  Bool          getNonPackedConstraintFlag() const          { return m_nonPackedConstraintFlag;    }
     232  Void          setNonPackedConstraintFlag(Bool b)          { m_nonPackedConstraintFlag = b;        }
     233
     234  Bool          getFrameOnlyConstraintFlag() const          { return m_frameOnlyConstraintFlag;    }
     235  Void          setFrameOnlyConstraintFlag(Bool b)          { m_frameOnlyConstraintFlag = b;        }
     236
     237  UInt          getBitDepthConstraint() const               { return m_bitDepthConstraintValue;    }
     238  Void          setBitDepthConstraint(UInt bitDepth)        { m_bitDepthConstraintValue=bitDepth;  }
     239
     240  ChromaFormat  getChromaFormatConstraint() const           { return m_chromaFormatConstraintValue; }
     241  Void          setChromaFormatConstraint(ChromaFormat fmt) { m_chromaFormatConstraintValue=fmt;    }
     242
     243  Bool          getIntraConstraintFlag() const              { return m_intraConstraintFlag;        }
     244  Void          setIntraConstraintFlag(Bool b)              { m_intraConstraintFlag = b;            }
     245
     246  Bool          getLowerBitRateConstraintFlag() const       { return m_lowerBitRateConstraintFlag; }
     247  Void          setLowerBitRateConstraintFlag(Bool b)       { m_lowerBitRateConstraintFlag = b;    }
    245248
    246249#if SVC_EXTENSION
    247   Void copyProfileInfo(ProfileTierLevel *ptl);
     250  Void          copyProfileInfo(ProfileTierLevel *ptl);
    248251#endif
    249252};
     
    258261
    259262public:
    260   TComPTL();
    261   Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; }
    262   Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; }
    263 
    264   Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; }
    265   Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; }
    266 
    267   ProfileTierLevel* getGeneralPTL()  { return &m_generalPTL; }
    268   ProfileTierLevel* getSubLayerPTL(Int i)  { return &m_subLayerPTL[i]; }
     263                          TComPTL();
     264  Bool                    getSubLayerProfilePresentFlag(Int i) const   { return m_subLayerProfilePresentFlag[i]; }
     265  Void                    setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x;    }
     266
     267  Bool                    getSubLayerLevelPresentFlag(Int i) const     { return m_subLayerLevelPresentFlag[i];   }
     268  Void                    setSubLayerLevelPresentFlag(Int i, Bool x)   { m_subLayerLevelPresentFlag[i] = x;      }
     269
     270  ProfileTierLevel*       getGeneralPTL()                              { return &m_generalPTL;                   }
     271  const ProfileTierLevel* getGeneralPTL() const                        { return &m_generalPTL;                   }
     272  ProfileTierLevel*       getSubLayerPTL(Int i)                        { return &m_subLayerPTL[i];               }
     273  const ProfileTierLevel* getSubLayerPTL(Int i) const                  { return &m_subLayerPTL[i];               }
    269274
    270275#if SVC_EXTENSION
    271   Void copyProfileInfo(TComPTL *ptl);
     276  Void                    copyProfileInfo(TComPTL *ptl);
    272277#endif
    273278};
     
    310315public:
    311316  TComHRD()
    312   :m_nalHrdParametersPresentFlag(0)
    313   ,m_vclHrdParametersPresentFlag(0)
    314   ,m_subPicCpbParamsPresentFlag(false)
    315   ,m_tickDivisorMinus2(0)
    316   ,m_duCpbRemovalDelayLengthMinus1(0)
    317   ,m_subPicCpbParamsInPicTimingSEIFlag(false)
    318   ,m_dpbOutputDelayDuLengthMinus1(0)
    319   ,m_bitRateScale(0)
    320   ,m_cpbSizeScale(0)
     317  :m_nalHrdParametersPresentFlag       (0)
     318  ,m_vclHrdParametersPresentFlag       (0)
     319  ,m_subPicCpbParamsPresentFlag        (false)
     320  ,m_tickDivisorMinus2                 (0)
     321  ,m_duCpbRemovalDelayLengthMinus1     (0)
     322  ,m_subPicCpbParamsInPicTimingSEIFlag (false)
     323  ,m_dpbOutputDelayDuLengthMinus1      (0)
     324  ,m_bitRateScale                      (0)
     325  ,m_cpbSizeScale                      (0)
    321326  ,m_initialCpbRemovalDelayLengthMinus1(23)
    322   ,m_cpbRemovalDelayLengthMinus1(23)
    323   ,m_dpbOutputDelayLengthMinus1(23)
     327  ,m_cpbRemovalDelayLengthMinus1       (23)
     328  ,m_dpbOutputDelayLengthMinus1        (23)
    324329  {}
    325330
    326331  virtual ~TComHRD() {}
    327332
    328   Void setNalHrdParametersPresentFlag       ( Bool flag )  { m_nalHrdParametersPresentFlag = flag;         }
    329   Bool getNalHrdParametersPresentFlag       ( )            { return m_nalHrdParametersPresentFlag;         }
    330 
    331   Void setVclHrdParametersPresentFlag       ( Bool flag )  { m_vclHrdParametersPresentFlag = flag;         }
    332   Bool getVclHrdParametersPresentFlag       ( )            { return m_vclHrdParametersPresentFlag;         }
    333 
    334   Void setSubPicCpbParamsPresentFlag        ( Bool flag )  { m_subPicCpbParamsPresentFlag = flag;          }
    335   Bool getSubPicCpbParamsPresentFlag        ( )            { return m_subPicCpbParamsPresentFlag;          }
    336 
    337   Void setTickDivisorMinus2                 ( UInt value ) { m_tickDivisorMinus2 = value;                  }
    338   UInt getTickDivisorMinus2                 ( )            { return m_tickDivisorMinus2;                   }
    339 
    340   Void setDuCpbRemovalDelayLengthMinus1     ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value;      }
    341   UInt getDuCpbRemovalDelayLengthMinus1     ( )            { return m_duCpbRemovalDelayLengthMinus1;       }
    342 
    343   Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag)   { m_subPicCpbParamsInPicTimingSEIFlag = flag;   }
    344   Bool getSubPicCpbParamsInPicTimingSEIFlag ()             { return m_subPicCpbParamsInPicTimingSEIFlag;   }
    345 
    346   Void setDpbOutputDelayDuLengthMinus1      (UInt value )  { m_dpbOutputDelayDuLengthMinus1 = value;       }
    347   UInt getDpbOutputDelayDuLengthMinus1      ()             { return m_dpbOutputDelayDuLengthMinus1;        }
    348 
    349   Void setBitRateScale                      ( UInt value ) { m_bitRateScale = value;                       }
    350   UInt getBitRateScale                      ( )            { return m_bitRateScale;                        }
    351 
    352   Void setCpbSizeScale                      ( UInt value ) { m_cpbSizeScale = value;                       }
    353   UInt getCpbSizeScale                      ( )            { return m_cpbSizeScale;                        }
    354   Void setDuCpbSizeScale                    ( UInt value ) { m_ducpbSizeScale = value;                     }
    355   UInt getDuCpbSizeScale                    ( )            { return m_ducpbSizeScale;                      }
    356 
    357   Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; }
    358   UInt getInitialCpbRemovalDelayLengthMinus1( )            { return m_initialCpbRemovalDelayLengthMinus1;  }
    359 
    360   Void setCpbRemovalDelayLengthMinus1       ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value;        }
    361   UInt getCpbRemovalDelayLengthMinus1       ( )            { return m_cpbRemovalDelayLengthMinus1;         }
    362 
    363   Void setDpbOutputDelayLengthMinus1        ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value;         }
    364   UInt getDpbOutputDelayLengthMinus1        ( )            { return m_dpbOutputDelayLengthMinus1;          }
    365 
    366   Void setFixedPicRateFlag       ( Int layer, Bool flag )  { m_HRD[layer].fixedPicRateFlag = flag;         }
    367   Bool getFixedPicRateFlag       ( Int layer            )  { return m_HRD[layer].fixedPicRateFlag;         }
    368 
    369   Void setFixedPicRateWithinCvsFlag       ( Int layer, Bool flag )  { m_HRD[layer].fixedPicRateWithinCvsFlag = flag;         }
    370   Bool getFixedPicRateWithinCvsFlag       ( Int layer            )  { return m_HRD[layer].fixedPicRateWithinCvsFlag;         }
    371 
    372   Void setPicDurationInTcMinus1  ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value;   }
    373   UInt getPicDurationInTcMinus1  ( Int layer             ) { return m_HRD[layer].picDurationInTcMinus1;    }
    374 
    375   Void setLowDelayHrdFlag        ( Int layer, Bool flag )  { m_HRD[layer].lowDelayHrdFlag = flag;          }
    376   Bool getLowDelayHrdFlag        ( Int layer            )  { return m_HRD[layer].lowDelayHrdFlag;          }
    377 
    378   Void setCpbCntMinus1           ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; }
    379   UInt getCpbCntMinus1           ( Int layer            )  { return m_HRD[layer].cpbCntMinus1; }
    380 
    381   Void setBitRateValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; }
    382   UInt getBitRateValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl             ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl];  }
    383 
    384   Void setCpbSizeValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value;       }
    385   UInt getCpbSizeValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl            )  { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl];        }
    386   Void setDuCpbSizeValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value;       }
    387   UInt getDuCpbSizeValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl            )  { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl];        }
    388   Void setDuBitRateValueMinus1     ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value;       }
    389   UInt getDuBitRateValueMinus1     (Int layer, Int cpbcnt, Int nalOrVcl )              { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl];        }
    390   Void setCbrFlag                ( Int layer, Int cpbcnt, Int nalOrVcl, Bool value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value;            }
    391   Bool getCbrFlag                ( Int layer, Int cpbcnt, Int nalOrVcl             ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl];             }
    392 
    393   Void setNumDU                              ( UInt value ) { m_numDU = value;                            }
    394   UInt getNumDU                              ( )            { return m_numDU;          }
    395   Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); }
     333  Void    setNalHrdParametersPresentFlag( Bool flag )                                { m_nalHrdParametersPresentFlag = flag;                      }
     334  Bool    getNalHrdParametersPresentFlag( ) const                                    { return m_nalHrdParametersPresentFlag;                      }
     335
     336  Void    setVclHrdParametersPresentFlag( Bool flag )                                { m_vclHrdParametersPresentFlag = flag;                      }
     337  Bool    getVclHrdParametersPresentFlag( ) const                                    { return m_vclHrdParametersPresentFlag;                      }
     338
     339  Void    setSubPicCpbParamsPresentFlag( Bool flag )                                 { m_subPicCpbParamsPresentFlag = flag;                       }
     340  Bool    getSubPicCpbParamsPresentFlag( ) const                                     { return m_subPicCpbParamsPresentFlag;                       }
     341
     342  Void    setTickDivisorMinus2( UInt value )                                         { m_tickDivisorMinus2 = value;                               }
     343  UInt    getTickDivisorMinus2( ) const                                              { return m_tickDivisorMinus2;                                }
     344
     345  Void    setDuCpbRemovalDelayLengthMinus1( UInt value )                             { m_duCpbRemovalDelayLengthMinus1 = value;                   }
     346  UInt    getDuCpbRemovalDelayLengthMinus1( ) const                                  { return m_duCpbRemovalDelayLengthMinus1;                    }
     347
     348  Void    setSubPicCpbParamsInPicTimingSEIFlag( Bool flag)                           { m_subPicCpbParamsInPicTimingSEIFlag = flag;                }
     349  Bool    getSubPicCpbParamsInPicTimingSEIFlag( ) const                              { return m_subPicCpbParamsInPicTimingSEIFlag;                }
     350
     351  Void    setDpbOutputDelayDuLengthMinus1(UInt value )                               { m_dpbOutputDelayDuLengthMinus1 = value;                    }
     352  UInt    getDpbOutputDelayDuLengthMinus1( ) const                                   { return m_dpbOutputDelayDuLengthMinus1;                     }
     353
     354  Void    setBitRateScale( UInt value )                                              { m_bitRateScale = value;                                    }
     355  UInt    getBitRateScale( ) const                                                   { return m_bitRateScale;                                     }
     356
     357  Void    setCpbSizeScale( UInt value )                                              { m_cpbSizeScale = value;                                    }
     358  UInt    getCpbSizeScale( ) const                                                   { return m_cpbSizeScale;                                     }
     359  Void    setDuCpbSizeScale( UInt value )                                            { m_ducpbSizeScale = value;                                  }
     360  UInt    getDuCpbSizeScale( ) const                                                 { return m_ducpbSizeScale;                                   }
     361
     362  Void    setInitialCpbRemovalDelayLengthMinus1( UInt value )                        { m_initialCpbRemovalDelayLengthMinus1 = value;              }
     363  UInt    getInitialCpbRemovalDelayLengthMinus1( ) const                             { return m_initialCpbRemovalDelayLengthMinus1;               }
     364
     365  Void    setCpbRemovalDelayLengthMinus1( UInt value )                               { m_cpbRemovalDelayLengthMinus1 = value;                     }
     366  UInt    getCpbRemovalDelayLengthMinus1( ) const                                    { return m_cpbRemovalDelayLengthMinus1;                      }
     367
     368  Void    setDpbOutputDelayLengthMinus1( UInt value )                                { m_dpbOutputDelayLengthMinus1 = value;                      }
     369  UInt    getDpbOutputDelayLengthMinus1( ) const                                     { return m_dpbOutputDelayLengthMinus1;                       }
     370
     371  Void    setFixedPicRateFlag( Int layer, Bool flag )                                { m_HRD[layer].fixedPicRateFlag = flag;                      }
     372  Bool    getFixedPicRateFlag( Int layer ) const                                     { return m_HRD[layer].fixedPicRateFlag;                      }
     373
     374  Void    setFixedPicRateWithinCvsFlag( Int layer, Bool flag )                       { m_HRD[layer].fixedPicRateWithinCvsFlag = flag;             }
     375  Bool    getFixedPicRateWithinCvsFlag( Int layer ) const                            { return m_HRD[layer].fixedPicRateWithinCvsFlag;             }
     376
     377  Void    setPicDurationInTcMinus1( Int layer, UInt value )                          { m_HRD[layer].picDurationInTcMinus1 = value;                }
     378  UInt    getPicDurationInTcMinus1( Int layer ) const                                { return m_HRD[layer].picDurationInTcMinus1;                 }
     379
     380  Void    setLowDelayHrdFlag( Int layer, Bool flag )                                 { m_HRD[layer].lowDelayHrdFlag = flag;                       }
     381  Bool    getLowDelayHrdFlag( Int layer ) const                                      { return m_HRD[layer].lowDelayHrdFlag;                       }
     382
     383  Void    setCpbCntMinus1( Int layer, UInt value )                                   { m_HRD[layer].cpbCntMinus1 = value;                        }
     384  UInt    getCpbCntMinus1( Int layer ) const                                         { return m_HRD[layer].cpbCntMinus1;                          }
     385
     386  Void    setBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value )  { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; }
     387  UInt    getBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const        { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl];  }
     388
     389  Void    setCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value )  { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value;       }
     390  UInt    getCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const         { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl];        }
     391  Void    setDuCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value;     }
     392  UInt    getDuCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const       { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl];      }
     393  Void    setDuBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value;     }
     394  UInt    getDuBitRateValueMinus1(Int layer, Int cpbcnt, Int nalOrVcl ) const        { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl];      }
     395  Void    setCbrFlag( Int layer, Int cpbcnt, Int nalOrVcl, Bool value )              { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value;            }
     396  Bool    getCbrFlag( Int layer, Int cpbcnt, Int nalOrVcl ) const                    { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl];             }
     397
     398  Void    setNumDU( UInt value )                                                     { m_numDU = value;                                           }
     399  UInt    getNumDU( ) const                                                          { return m_numDU;                                            }
     400  Bool    getCpbDpbDelaysPresentFlag( ) const                      { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); }
    396401
    397402#if SVC_EXTENSION
     
    424429public:
    425430  TimingInfo()
    426   : m_timingInfoPresentFlag(false)
    427   , m_numUnitsInTick(1001)
    428   , m_timeScale(60000)
     431  : m_timingInfoPresentFlag      (false)
     432  , m_numUnitsInTick             (1001)
     433  , m_timeScale                  (60000)
    429434  , m_pocProportionalToTimingFlag(false)
    430   , m_numTicksPocDiffOneMinus1(0) {}
    431 
    432   Void setTimingInfoPresentFlag             ( Bool flag )  { m_timingInfoPresentFlag = flag;               }
    433   Bool getTimingInfoPresentFlag             ( )            { return m_timingInfoPresentFlag;               }
    434 
    435   Void setNumUnitsInTick                    ( UInt value ) { m_numUnitsInTick = value;                     }
    436   UInt getNumUnitsInTick                    ( )            { return m_numUnitsInTick;                      }
    437 
    438   Void setTimeScale                         ( UInt value ) { m_timeScale = value;                          }
    439   UInt getTimeScale                         ( )            { return m_timeScale;                           }
    440 
    441   Bool getPocProportionalToTimingFlag       ( )            { return m_pocProportionalToTimingFlag;         }
    442   Void setPocProportionalToTimingFlag       (Bool x      ) { m_pocProportionalToTimingFlag = x;            }
    443 
    444   Int  getNumTicksPocDiffOneMinus1          ( )            { return m_numTicksPocDiffOneMinus1;            }
    445   Void setNumTicksPocDiffOneMinus1          (Int x       ) { m_numTicksPocDiffOneMinus1 = x;               }
     435  , m_numTicksPocDiffOneMinus1   (0)
     436  {}
     437
     438  Void setTimingInfoPresentFlag( Bool flag )   { m_timingInfoPresentFlag = flag;       }
     439  Bool getTimingInfoPresentFlag( ) const       { return m_timingInfoPresentFlag;       }
     440
     441  Void setNumUnitsInTick( UInt value )         { m_numUnitsInTick = value;             }
     442  UInt getNumUnitsInTick( ) const              { return m_numUnitsInTick;              }
     443
     444  Void setTimeScale( UInt value )              { m_timeScale = value;                  }
     445  UInt getTimeScale( ) const                   { return m_timeScale;                   }
     446
     447  Void setPocProportionalToTimingFlag(Bool x)  { m_pocProportionalToTimingFlag = x;    }
     448  Bool getPocProportionalToTimingFlag( ) const { return m_pocProportionalToTimingFlag; }
     449
     450  Void setNumTicksPocDiffOneMinus1(Int x)      { m_numTicksPocDiffOneMinus1 = x;       }
     451  Int  getNumTicksPocDiffOneMinus1( ) const    { return m_numTicksPocDiffOneMinus1;    }
    446452};
    447453
     
    462468{
    463469private:
    464   Bool          m_enabledFlag;
    465   Int           m_winLeftOffset;
    466   Int           m_winRightOffset;
    467   Int           m_winTopOffset;
    468   Int           m_winBottomOffset;
    469 
     470  Bool m_enabledFlag;
     471  Int  m_winLeftOffset;
     472  Int  m_winRightOffset;
     473  Int  m_winTopOffset;
     474  Int  m_winBottomOffset;
    470475public:
    471476  Window()
    472   : m_enabledFlag (false)
    473   , m_winLeftOffset     (0)
    474   , m_winRightOffset    (0)
    475   , m_winTopOffset      (0)
    476   , m_winBottomOffset   (0)
     477  : m_enabledFlag    (false)
     478  , m_winLeftOffset  (0)
     479  , m_winRightOffset (0)
     480  , m_winTopOffset   (0)
     481  , m_winBottomOffset(0)
    477482  { }
    478483
    479   Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
    480   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; }
    481   Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
    482   Void          setWindowLeftOffset(Int val)      { m_winLeftOffset = val; m_enabledFlag = true; }
    483   Int           getWindowRightOffset() const      { return m_enabledFlag ? m_winRightOffset : 0; }
    484   Void          setWindowRightOffset(Int val)     { m_winRightOffset = val; m_enabledFlag = true; }
    485   Int           getWindowTopOffset() const        { return m_enabledFlag ? m_winTopOffset : 0; }
    486   Void          setWindowTopOffset(Int val)       { m_winTopOffset = val; m_enabledFlag = true; }
    487   Int           getWindowBottomOffset() const     { return m_enabledFlag ? m_winBottomOffset: 0; }
    488   Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
     484  Bool getWindowEnabledFlag() const   { return m_enabledFlag;                          }
     485  Int  getWindowLeftOffset() const    { return m_enabledFlag ? m_winLeftOffset : 0;    }
     486  Void setWindowLeftOffset(Int val)   { m_winLeftOffset = val; m_enabledFlag = true;   }
     487  Int  getWindowRightOffset() const   { return m_enabledFlag ? m_winRightOffset : 0;   }
     488  Void setWindowRightOffset(Int val)  { m_winRightOffset = val; m_enabledFlag = true;  }
     489  Int  getWindowTopOffset() const     { return m_enabledFlag ? m_winTopOffset : 0;     }
     490  Void setWindowTopOffset(Int val)    { m_winTopOffset = val; m_enabledFlag = true;    }
     491  Int  getWindowBottomOffset() const  { return m_enabledFlag ? m_winBottomOffset: 0;   }
     492  Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; }
    489493
    490494#if SVC_EXTENSION
    491   Bool          hasEqualOffset(const Window& ref) const
     495  Bool hasEqualOffset(const Window& ref) const
    492496  {
    493497    return (    this->getWindowLeftOffset()   == ref.getWindowLeftOffset()
     
    498502#endif
    499503
    500   Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
     504 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
    501505  {
    502     m_enabledFlag       = true;
    503     m_winLeftOffset     = offsetLeft;
    504     m_winRightOffset    = offsetLRight;
    505     m_winTopOffset      = offsetLTop;
    506     m_winBottomOffset   = offsetLBottom;
     506    m_enabledFlag     = true;
     507    m_winLeftOffset   = offsetLeft;
     508    m_winRightOffset  = offsetLRight;
     509    m_winTopOffset    = offsetLTop;
     510    m_winBottomOffset = offsetLBottom;
    507511  }
    508512};
    509513
    510514#if SVC_EXTENSION
     515struct ResamplingPhase
     516{
     517 Bool phasePresentFlag;
     518 Int  phaseHorLuma;
     519 Int  phaseVerLuma;
     520 Int  phaseHorChroma;
     521 Int  phaseVerChroma;
     522
     523 ResamplingPhase()
     524  : phasePresentFlag (false)
     525  , phaseHorLuma     (0)
     526  , phaseVerLuma     (0)
     527  , phaseHorChroma   (0)
     528  , phaseVerChroma   (0)
     529 {
     530 }
     531};
     532
    511533class RepFormat
    512534{
    513535  Bool m_chromaAndBitDepthVpsPresentFlag;
    514 #if AUXILIARY_PICTURES
    515536  ChromaFormat m_chromaFormatVpsIdc;
    516 #else
    517   Int  m_chromaFormatVpsIdc;
    518 #endif
    519537  Bool m_separateColourPlaneVpsFlag;
    520538  Int  m_picWidthVpsInLumaSamples;
     
    527545public:
    528546  RepFormat();
    529   Bool getChromaAndBitDepthVpsPresentFlag() { return m_chromaAndBitDepthVpsPresentFlag; }
    530   void setChromaAndBitDepthVpsPresentFlag(Bool x) { m_chromaAndBitDepthVpsPresentFlag = x; }
    531 
    532 #if AUXILIARY_PICTURES
    533   ChromaFormat getChromaFormatVpsIdc()        { return m_chromaFormatVpsIdc; }
    534   Void setChromaFormatVpsIdc(ChromaFormat x)  { m_chromaFormatVpsIdc = x;    }
    535 #else
    536   Int  getChromaFormatVpsIdc()        { return m_chromaFormatVpsIdc; }
    537   Void setChromaFormatVpsIdc(Int x)   { m_chromaFormatVpsIdc = x;    }
    538 #endif
    539 
    540   Bool getSeparateColourPlaneVpsFlag()        { return m_separateColourPlaneVpsFlag; }
    541   Void setSeparateColourPlaneVpsFlag(Bool x)  { m_separateColourPlaneVpsFlag = x;    }
    542 
    543   Int  getPicWidthVpsInLumaSamples()        { return m_picWidthVpsInLumaSamples; }
    544   Void setPicWidthVpsInLumaSamples(Int x)   { m_picWidthVpsInLumaSamples = x;    }
    545 
    546   Int  getPicHeightVpsInLumaSamples()        { return m_picHeightVpsInLumaSamples; }
    547   Void setPicHeightVpsInLumaSamples(Int x)   { m_picHeightVpsInLumaSamples = x;    }
    548 
    549   Int  getBitDepthVpsLuma()           { return m_bitDepthVpsLuma;   }
    550   Void setBitDepthVpsLuma(Int x)      { m_bitDepthVpsLuma = x;      }
     547  Bool getChromaAndBitDepthVpsPresentFlag() const             { return m_chromaAndBitDepthVpsPresentFlag;                        }
     548  void setChromaAndBitDepthVpsPresentFlag(Bool x)             { m_chromaAndBitDepthVpsPresentFlag = x;                           }
     549
     550  ChromaFormat getChromaFormatVpsIdc() const                  { return m_chromaFormatVpsIdc;                                     }
     551  Void setChromaFormatVpsIdc(ChromaFormat x)                  { m_chromaFormatVpsIdc = x;                                        }
     552
     553  Bool getSeparateColourPlaneVpsFlag() const                  { return m_separateColourPlaneVpsFlag;                             }
     554  Void setSeparateColourPlaneVpsFlag(Bool x)                  { m_separateColourPlaneVpsFlag = x;                                }
     555
     556  Int  getPicWidthVpsInLumaSamples() const                    { return m_picWidthVpsInLumaSamples;                               }
     557  Void setPicWidthVpsInLumaSamples(Int x)                     { m_picWidthVpsInLumaSamples = x;                                  }
     558
     559  Int  getPicHeightVpsInLumaSamples() const                   { return m_picHeightVpsInLumaSamples;                              }
     560  Void setPicHeightVpsInLumaSamples(Int x)                    { m_picHeightVpsInLumaSamples = x;                                 }
     561
     562  Int  getBitDepthVpsLuma() const                             { return m_bitDepthVpsLuma;                                        }
     563  Void setBitDepthVpsLuma(Int x)                              { m_bitDepthVpsLuma = x;                                           }
    551564   
    552   Int  getBitDepthVpsChroma()           { return m_bitDepthVpsChroma;   }
    553   Void setBitDepthVpsChroma(Int x)      { m_bitDepthVpsChroma = x;      }
    554 
    555   Int  getBitDepthVps(ChannelType type)           { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma;   }
    556 
    557   Window& getConformanceWindowVps()                           { return  m_conformanceWindowVps;             }
    558   Void    setConformanceWindowVps(Window& conformanceWindow ) { m_conformanceWindowVps = conformanceWindow; }
     565  Int  getBitDepthVpsChroma() const                           { return m_bitDepthVpsChroma;                                      }
     566  Void setBitDepthVpsChroma(Int x)                            { m_bitDepthVpsChroma = x;                                         }
     567
     568  Int  getBitDepthVps(ChannelType type)                       { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma;   }
     569
     570  Window& getConformanceWindowVps()                           { return m_conformanceWindowVps;                                   }
     571  const Window& getConformanceWindowVps() const               { return m_conformanceWindowVps;                                   }
     572  Void    setConformanceWindowVps(Window& conformanceWindow ) { m_conformanceWindowVps = conformanceWindow;                      }
    559573};
    560574#endif
     
    563577{
    564578private:
    565   Int         m_VPSId;
    566   UInt        m_uiMaxTLayers;
    567   UInt        m_uiMaxLayers;
    568   Bool        m_bTemporalIdNestingFlag;
    569 
    570   UInt        m_numReorderPics[MAX_TLAYER];
    571   UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
    572   UInt        m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit)
    573 
    574   UInt        m_numHrdParameters;
     579  Int                   m_VPSId;
     580  UInt                  m_uiMaxTLayers;
     581  UInt                  m_uiMaxLayers;
     582  Bool                  m_bTemporalIdNestingFlag;
     583
     584  UInt                  m_numReorderPics[MAX_TLAYER];
     585  UInt                  m_uiMaxDecPicBuffering[MAX_TLAYER];
     586  UInt                  m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit)
     587
     588  UInt                  m_numHrdParameters;
    575589#if !SVC_EXTENSION
    576   UInt        m_maxNuhReservedZeroLayerId;
    577 #endif
    578   TComHRD*    m_hrdParameters;
    579   UInt*       m_hrdOpSetIdx;
    580   Bool*       m_cprmsPresentFlag;
     590  UInt                  m_maxNuhReservedZeroLayerId;
     591#endif
     592  std::vector<TComHRD>  m_hrdParameters;
     593  std::vector<UInt>     m_hrdOpSetIdx;
     594  std::vector<Bool>     m_cprmsPresentFlag;
    581595#if !SVC_EXTENSION
    582   UInt        m_numOpSets;
    583   Bool        m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1];
    584   TComPTL     m_pcPTL;
    585 #endif
    586   TimingInfo  m_timingInfo;
     596  UInt                  m_numOpSets;
     597  Bool                  m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1];
     598
     599  TComPTL               m_pcPTL;
     600#endif
     601  TimingInfo            m_timingInfo;
    587602
    588603#if SVC_EXTENSION
    589   Bool        m_baseLayerInternalFlag;
    590   Bool        m_baseLayerAvailableFlag;
    591   TComPTL     m_pcPTLList[MAX_NUM_LAYER_IDS + 1];
     604  Bool                  m_baseLayerInternalFlag;
     605  Bool                  m_baseLayerAvailableFlag;
     606  TComPTL               m_pcPTLList[MAX_NUM_LAYER_IDS + 1];
    592607
    593608  std::vector< std::vector<Int> >     m_layerSetLayerIdList;
    594609  std::vector<Int>                    m_numLayerInIdList;
    595610
    596   UInt        m_maxLayerId;
    597   UInt        m_numLayerSets;
    598 
    599   UInt        m_vpsNumLayerSetsMinus1;
    600   Bool        m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
     611  UInt                  m_maxLayerId;
     612  UInt                  m_numLayerSets;
     613
     614  UInt                  m_vpsNumLayerSetsMinus1;
     615  Bool                  m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
    601616
    602617  // ------------------------------------------
    603618  // Variables related to VPS extensions
    604619  // ------------------------------------------
    605   Bool       m_nonHEVCBaseLayerFlag;
    606   Bool       m_splittingFlag;
    607   Bool       m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES];
    608   UInt       m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES];
    609   Bool       m_nuhLayerIdPresentFlag;
    610   UInt       m_layerIdInNuh[MAX_VPS_LAYER_IDX_PLUS1];            // Maps layer ID in the VPS with layer_id_in_nuh
    611   UInt       m_dimensionId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES];
     620  Bool                  m_nonHEVCBaseLayerFlag;
     621  Bool                  m_splittingFlag;
     622  Bool                  m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES];
     623  UInt                  m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES];
     624  Bool                  m_nuhLayerIdPresentFlag;
     625  UInt                  m_layerIdInNuh[MAX_VPS_LAYER_IDX_PLUS1];            // Maps layer ID in the VPS with layer_id_in_nuh
     626  UInt                  m_dimensionId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES];
    612627
    613628  // Below are derived variables
    614   UInt       m_numScalabilityTypes;
    615   UInt       m_layerIdxInVps[MAX_NUM_LAYER_IDS];            // Maps layer_id_in_nuh with the layer ID in the VPS
    616   UInt       m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS];
    617   Bool       m_ilpSshSignalingEnabledFlag;
     629  UInt                  m_numScalabilityTypes;
     630  UInt                  m_layerIdxInVps[MAX_NUM_LAYER_IDS];            // Maps layer_id_in_nuh with the layer ID in the VPS
     631  UInt                  m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS];
     632  Bool                  m_ilpSshSignalingEnabledFlag;
    618633
    619634  // Profile-tier-level signalling related
    620   Bool       m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1];    // The value with index 0 will not be used.
    621 #if !SVC_EXTENSION
    622   std::vector<TComPTL>    m_pcPTLForExtn; 
    623 #endif
     635  Bool                  m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1];    // The value with index 0 will not be used.
    624636
    625637  // Target output layer signalling related
    626   UInt       m_numOutputLayerSets;
    627   UInt       m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
    628   Bool       m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1];
    629   Bool       m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    630   UInt       m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1];
    631   UInt       m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    632   UInt       m_directDepTypeLen;
    633   Bool       m_defaultDirectDependencyTypeFlag;
    634   UInt       m_defaultDirectDependencyType;
    635   UInt       m_directDependencyType[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    636 
    637   UInt       m_numProfileTierLevel;
    638   Int        m_numAddOutputLayerSets;
    639   UInt       m_defaultTargetOutputLayerIdc;
     638  UInt                  m_numOutputLayerSets;
     639  UInt                  m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
     640  Bool                  m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1];
     641  Bool                  m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     642  UInt                  m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1];
     643  UInt                  m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     644  UInt                  m_directDepTypeLen;
     645  Bool                  m_defaultDirectDependencyTypeFlag;
     646  UInt                  m_defaultDirectDependencyType;
     647  UInt                  m_directDependencyType[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     648
     649  UInt                  m_numProfileTierLevel;
     650  Int                   m_numAddOutputLayerSets;
     651  UInt                  m_defaultTargetOutputLayerIdc;
    640652  std::vector< std::vector<Int> >  m_profileLevelTierIdx;
    641   Bool       m_maxOneActiveRefLayerFlag;
    642   Bool       m_pocLsbNotPresentFlag[MAX_VPS_LAYER_IDX_PLUS1];
    643   Bool       m_crossLayerPictureTypeAlignFlag;
    644   Bool       m_crossLayerIrapAlignFlag;
    645   Bool       m_crossLayerAlignedIdrOnlyFlag;
    646   UInt       m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_IDX_PLUS1 - 1][MAX_VPS_LAYER_IDX_PLUS1];
    647   Bool       m_maxTidRefPresentFlag;
    648   Bool       m_maxTSLayersPresentFlag;
    649   UInt       m_maxTSLayerMinus1[MAX_LAYERS];
    650   Bool       m_singleLayerForNonIrapFlag;
    651   Bool       m_higherLayerIrapSkipFlag;
    652   Bool       m_tilesNotInUseFlag;
    653   Bool       m_tilesInUseFlag[MAX_VPS_LAYER_IDX_PLUS1];
    654   Bool       m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_IDX_PLUS1];
    655   Bool       m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    656   Bool       m_wppNotInUseFlag;
    657   Bool       m_wppInUseFlag[MAX_VPS_LAYER_IDX_PLUS1];
    658 
    659   Bool       m_ilpRestrictedRefLayersFlag;
    660   Int        m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    661   Bool       m_ctuBasedOffsetEnabledFlag   [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    662   Int        m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
    663 
    664   Bool       m_vidSigPresentVpsFlag;
    665   Int        m_vpsVidSigInfo;
    666   Int        m_vpsVidSigIdx[MAX_VPS_LAYER_IDX_PLUS1];
    667   Int        m_vpsVidFormat[16];
    668   Bool       m_vpsFullRangeFlag[16];
    669   Int        m_vpsColorPrimaries[16];
    670   Int        m_vpsTransChar[16];
    671   Int        m_vpsMatCoeff[16];
    672 
    673   Bool       m_bitRatePresentVpsFlag;
    674   Bool       m_picRatePresentVpsFlag;
    675   Bool       m_bitRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    676   Bool       m_picRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    677   Int        m_avgBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    678   Int        m_maxBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    679   Int        m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    680   Int        m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    681 
    682   Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
    683 
    684   Bool       m_repFormatIdxPresentFlag;
    685   Int        m_vpsNumRepFormats;            // coded as minus1
    686   RepFormat  m_vpsRepFormat[16];
    687   Int        m_vpsRepFormatIdx[16];
    688 
    689   Int        m_viewIdLen;
    690   Int        m_viewIdVal                [MAX_LAYERS];
    691 
    692   Int        m_numberRefLayers[MAX_NUM_LAYER_IDS];  // number of direct and indirect reference layers of a coding layer
    693   Bool       m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
    694 
    695   Int        m_numAddLayerSets;
    696   UInt       m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
    697   UInt       m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
    698   UInt       m_numPredictedLayers[MAX_NUM_LAYER_IDS];
    699   Int        m_numIndependentLayers;
    700   Int        m_numLayersInTreePartition[MAX_LAYERS];
    701   UInt       m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS];
    702 
    703   Int        m_TolsIdx;
    704   Bool       m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];
    705   Bool       m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    706   Int        m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
    707   Int        m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    708   Int        m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    709   Int        m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
    710 
    711   Bool       m_vpsVuiPresentFlag;
    712   Bool       m_vpsExtensionFlag;
     653  Bool                  m_maxOneActiveRefLayerFlag;
     654  Bool                  m_pocLsbNotPresentFlag[MAX_VPS_LAYER_IDX_PLUS1];
     655  Bool                  m_crossLayerPictureTypeAlignFlag;
     656  Bool                  m_crossLayerIrapAlignFlag;
     657  Bool                  m_crossLayerAlignedIdrOnlyFlag;
     658  UInt                  m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_IDX_PLUS1 - 1][MAX_VPS_LAYER_IDX_PLUS1];
     659  Bool                  m_maxTidRefPresentFlag;
     660  Bool                  m_maxTSLayersPresentFlag;
     661  UInt                  m_maxTSLayerMinus1[MAX_LAYERS];
     662  Bool                  m_singleLayerForNonIrapFlag;
     663  Bool                  m_higherLayerIrapSkipFlag;
     664  Bool                  m_tilesNotInUseFlag;
     665  Bool                  m_tilesInUseFlag[MAX_VPS_LAYER_IDX_PLUS1];
     666  Bool                  m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_IDX_PLUS1];
     667  Bool                  m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     668  Bool                  m_wppNotInUseFlag;
     669  Bool                  m_wppInUseFlag[MAX_VPS_LAYER_IDX_PLUS1];
     670
     671  Bool                  m_ilpRestrictedRefLayersFlag;
     672  Int                   m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     673  Bool                  m_ctuBasedOffsetEnabledFlag   [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     674  Int                   m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
     675
     676  Bool                  m_vidSigPresentVpsFlag;
     677  Int                   m_vpsVidSigInfo;
     678  Int                   m_vpsVidSigIdx[MAX_VPS_LAYER_IDX_PLUS1];
     679  Int                   m_vpsVidFormat[16];
     680  Bool                  m_vpsFullRangeFlag[16];
     681  Int                   m_vpsColorPrimaries[16];
     682  Int                   m_vpsTransChar[16];
     683  Int                   m_vpsMatCoeff[16];
     684
     685  Bool                  m_bitRatePresentVpsFlag;
     686  Bool                  m_picRatePresentVpsFlag;
     687  Bool                  m_bitRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     688  Bool                  m_picRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     689  Int                   m_avgBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     690  Int                   m_maxBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     691  Int                   m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     692  Int                   m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     693
     694  Bool                  m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
     695
     696  Bool                  m_repFormatIdxPresentFlag;
     697  Int                   m_vpsNumRepFormats;            // coded as minus1
     698  RepFormat             m_vpsRepFormat[16];
     699  Int                   m_vpsRepFormatIdx[16];
     700
     701  Int                   m_viewIdLen;
     702  Int                   m_viewIdVal[MAX_LAYERS];
     703
     704  Int                   m_numberRefLayers[MAX_NUM_LAYER_IDS];  // number of direct and indirect reference layers of a coding layer
     705  Bool                  m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
     706
     707  Int                   m_numAddLayerSets;
     708  UInt                  m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS];
     709  UInt                  m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
     710  UInt                  m_numPredictedLayers[MAX_NUM_LAYER_IDS];
     711  Int                   m_numIndependentLayers;
     712  Int                   m_numLayersInTreePartition[MAX_LAYERS];
     713  UInt                  m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS];
     714
     715  Int                   m_TolsIdx;
     716  Bool                  m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];
     717  Bool                  m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     718  Int                   m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
     719  Int                   m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     720  Int                   m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     721  Int                   m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS];
     722
     723  Bool                  m_vpsVuiPresentFlag;
     724  Bool                  m_vpsExtensionFlag;
    713725
    714726#if O0164_MULTI_LAYER_HRD
    715   Bool       m_vpsVuiBspHrdPresentFlag;
    716   Int                 m_vpsNumAddHrdParams;
    717   std::vector<Bool>   m_cprmsAddPresentFlag;
    718   std::vector<Int>    m_numSubLayerHrdMinus1;
    719   std::vector<TComHRD> m_bspHrd;
    720   Int    m_numSignalledPartitioningSchemes[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
    721   Int    m_numPartitionsInSchemeMinus1    [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16];
    722   Int    m_layerIncludedInPartitionFlag   [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_LAYERS][MAX_LAYERS];
    723   Int    m_numBspSchedulesMinus1          [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER];
    724   Int    m_bspHrdIdx                      [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];
    725   Int    m_bspSchedIdx                    [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];
    726 #endif
    727   UInt       m_baseLayerPSCompatibilityFlag[MAX_LAYERS];
    728   Int        m_vpsNonVuiExtLength;
    729   Bool       m_vpsPocLsbAlignedFlag;
     727  Bool                  m_vpsVuiBspHrdPresentFlag;
     728  Int                   m_vpsNumAddHrdParams;
     729  std::vector<Bool>     m_cprmsAddPresentFlag;
     730  std::vector<Int>      m_numSubLayerHrdMinus1;
     731  std::vector<TComHRD>  m_bspHrd;
     732  Int                   m_numSignalledPartitioningSchemes[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
     733  Int                   m_numPartitionsInSchemeMinus1    [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16];
     734  Int                   m_layerIncludedInPartitionFlag   [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_LAYERS][MAX_LAYERS];
     735  Int                   m_numBspSchedulesMinus1          [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER];
     736  Int                   m_bspHrdIdx                      [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];
     737  Int                   m_bspSchedIdx                    [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];
     738#endif
     739  UInt                  m_baseLayerPSCompatibilityFlag[MAX_LAYERS];
     740  Int                   m_vpsNonVuiExtLength;
     741  Bool                  m_vpsPocLsbAlignedFlag;
    730742  std::vector< std::vector<Bool> > m_necessaryLayerFlag;
    731743  std::vector<Int>                 m_numNecessaryLayers;
     
    733745
    734746public:
    735   TComVPS();
    736   virtual ~TComVPS();
    737 
    738   Void    createHrdParamBuffer()
     747                    TComVPS();
     748
     749  virtual           ~TComVPS();
     750
     751  Void              createHrdParamBuffer()
    739752  {
    740     m_hrdParameters    = new TComHRD[ getNumHrdParameters() ];
    741     m_hrdOpSetIdx      = new UInt   [ getNumHrdParameters() ];
    742     m_cprmsPresentFlag = new Bool   [ getNumHrdParameters() ];
     753    m_hrdParameters.resize(getNumHrdParameters());
     754    m_hrdOpSetIdx.resize(getNumHrdParameters());
     755    m_cprmsPresentFlag.resize(getNumHrdParameters());
    743756  }
    744757
    745   TComHRD* getHrdParameters   ( UInt i )             { return &m_hrdParameters[ i ]; }
    746   UInt    getHrdOpSetIdx      ( UInt i )             { return m_hrdOpSetIdx[ i ]; }
    747   Void    setHrdOpSetIdx      ( UInt val, UInt i )   { m_hrdOpSetIdx[ i ] = val;  }
    748   Bool    getCprmsPresentFlag ( UInt i )             { return m_cprmsPresentFlag[ i ]; }
    749   Void    setCprmsPresentFlag ( Bool val, UInt i )   { m_cprmsPresentFlag[ i ] = val;  }
    750 
    751   Int     getVPSId       ()                   { return m_VPSId;          }
    752   Void    setVPSId       (Int i)              { m_VPSId = i;             }
    753 
    754   UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
    755   Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
    756 
    757   UInt    getMaxLayers   ()                   { return m_uiMaxLayers;   }
    758   Void    setMaxLayers   (UInt l)             { m_uiMaxLayers = l; }
    759 
    760   Bool    getTemporalNestingFlag   ()         { return m_bTemporalIdNestingFlag;   }
    761   Void    setTemporalNestingFlag   (Bool t)   { m_bTemporalIdNestingFlag = t; }
    762 
    763   Void    setNumReorderPics(UInt v, UInt tLayer)                { m_numReorderPics[tLayer] = v;    }
    764   UInt    getNumReorderPics(UInt tLayer)                        { return m_numReorderPics[tLayer]; }
    765 
    766   Void    setMaxDecPicBuffering(UInt v, UInt tLayer)            { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v;    }
    767   UInt    getMaxDecPicBuffering(UInt tLayer)                    { return m_uiMaxDecPicBuffering[tLayer]; }
    768 
    769   Void    setMaxLatencyIncrease(UInt v, UInt tLayer)            { m_uiMaxLatencyIncrease[tLayer] = v;    }
    770   UInt    getMaxLatencyIncrease(UInt tLayer)                    { return m_uiMaxLatencyIncrease[tLayer]; }
    771 
    772   UInt    getNumHrdParameters()                                 { return m_numHrdParameters; }
    773   Void    setNumHrdParameters(UInt v)                           { m_numHrdParameters = v;    }
     758  TComHRD*          getHrdParameters( UInt i )                           { return &m_hrdParameters[ i ];                                    }
     759  const TComHRD*    getHrdParameters( UInt i ) const                     { return &m_hrdParameters[ i ];                                    }
     760  UInt              getHrdOpSetIdx( UInt i ) const                       { return m_hrdOpSetIdx[ i ];                                       }
     761  Void              setHrdOpSetIdx( UInt val, UInt i )                   { m_hrdOpSetIdx[ i ] = val;                                        }
     762  Bool              getCprmsPresentFlag( UInt i ) const                  { return m_cprmsPresentFlag[ i ];                                  }
     763  Void              setCprmsPresentFlag( Bool val, UInt i )              { m_cprmsPresentFlag[ i ] = val;                                   }
     764
     765  Int               getVPSId() const                                     { return m_VPSId;                                                  }
     766  Void              setVPSId(Int i)                                      { m_VPSId = i;                                                     }
     767
     768  UInt              getMaxTLayers() const                                { return m_uiMaxTLayers;                                           }
     769  Void              setMaxTLayers(UInt t)                                { m_uiMaxTLayers = t;                                              }
     770
     771  UInt              getMaxLayers() const                                 { return m_uiMaxLayers;                                            }
     772  Void              setMaxLayers(UInt l)                                 { m_uiMaxLayers = l;                                               }
     773
     774  Bool              getTemporalNestingFlag() const                       { return m_bTemporalIdNestingFlag;                                 }
     775  Void              setTemporalNestingFlag(Bool t)                       { m_bTemporalIdNestingFlag = t;                                    }
     776
     777  Void              setNumReorderPics(UInt v, UInt tLayer)               { m_numReorderPics[tLayer] = v;                                    }
     778  UInt              getNumReorderPics(UInt tLayer) const                 { return m_numReorderPics[tLayer];                                 }
     779
     780  Void              setMaxDecPicBuffering(UInt v, UInt tLayer)           { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; }
     781  UInt              getMaxDecPicBuffering(UInt tLayer) const             { return m_uiMaxDecPicBuffering[tLayer];                           }
     782
     783  Void              setMaxLatencyIncrease(UInt v, UInt tLayer)           { m_uiMaxLatencyIncrease[tLayer] = v;                              }
     784  UInt              getMaxLatencyIncrease(UInt tLayer) const             { return m_uiMaxLatencyIncrease[tLayer];                           }
     785
     786  UInt              getNumHrdParameters() const                          { return m_numHrdParameters;                                       }
     787  Void              setNumHrdParameters(UInt v)                          { m_numHrdParameters = v;                                          }
    774788 
    775789#if !SVC_EXTENSION
    776   UInt    getMaxNuhReservedZeroLayerId()                        { return m_maxNuhReservedZeroLayerId; }
    777   Void    setMaxNuhReservedZeroLayerId(UInt v)                  { m_maxNuhReservedZeroLayerId = v;    }
    778 
    779   UInt    getMaxOpSets()                                        { return m_numOpSets; }
    780   Void    setMaxOpSets(UInt v)                                  { m_numOpSets = v;    }
    781 #endif
    782   Bool    getLayerIdIncludedFlag(UInt opsIdx, UInt id)          { return m_layerIdIncludedFlag[opsIdx][id]; }
    783   Void    setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id)  { m_layerIdIncludedFlag[opsIdx][id] = v;    }
     790  UInt              getMaxNuhReservedZeroLayerId() const                 { return m_maxNuhReservedZeroLayerId;                              }
     791  Void              setMaxNuhReservedZeroLayerId(UInt v)                 { m_maxNuhReservedZeroLayerId = v;                                 }
     792
     793  UInt              getMaxOpSets() const                                 { return m_numOpSets;                                              }
     794  Void              setMaxOpSets(UInt v)                                 { m_numOpSets = v;                                                 }
     795#endif
     796  Bool              getLayerIdIncludedFlag(UInt opsIdx, UInt id) const   { return m_layerIdIncludedFlag[opsIdx][id];                        }
     797  Void              setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v;                           }
    784798
    785799#if !SVC_EXTENSION
    786   TComPTL* getPTL() { return &m_pcPTL; }
    787 #endif
    788 
    789   TimingInfo* getTimingInfo() { return &m_timingInfo; }
     800  TComPTL*          getPTL()                                             { return &m_pcPTL;                                                 }
     801  const TComPTL*    getPTL() const                                       { return &m_pcPTL;                                                 }
     802#endif
     803
     804  TimingInfo*       getTimingInfo()                                      { return &m_timingInfo;                                            }
     805  const TimingInfo* getTimingInfo() const                                { return &m_timingInfo;                                            }
    790806
    791807#if SVC_EXTENSION
    792   Void        setBaseLayerInternalFlag(Bool x)                  { m_baseLayerInternalFlag = x;     }
    793   Bool        getBaseLayerInternalFlag()                        { return m_baseLayerInternalFlag;  }
    794   Void        setBaseLayerAvailableFlag(Bool x)                 { m_baseLayerAvailableFlag = x;    }
    795   Bool        getBaseLayerAvailableFlag()                       { return m_baseLayerAvailableFlag; }
     808  Void              setBaseLayerInternalFlag(Bool x)                     { m_baseLayerInternalFlag = x;                                     }
     809  Bool              getBaseLayerInternalFlag() const                     { return m_baseLayerInternalFlag;                                  }
     810  Void              setBaseLayerAvailableFlag(Bool x)                    { m_baseLayerAvailableFlag = x;                                    }
     811  Bool              getBaseLayerAvailableFlag() const                    { return m_baseLayerAvailableFlag;                                }
    796812
    797813#if O0164_MULTI_LAYER_HRD
    798   Void    createBspHrdParamBuffer(UInt numHrds)
     814  Void              createBspHrdParamBuffer(UInt numHrds)
    799815  {
    800816    m_bspHrd.resize( numHrds );
     
    804820#endif
    805821
    806   Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl)         { return m_bspHrd[i].getCpbCntMinus1(sl);    }
    807 
    808   TComPTL* getPTL()                                             { return &m_pcPTLList[0]; }
    809   TComPTL* getPTL(UInt idx)                                     { return &m_pcPTLList[idx]; }
    810 
    811   Int     getLayerSetLayerIdList(Int set, Int layerId)          { return m_layerSetLayerIdList[set][layerId]; }
    812   Void    setLayerSetLayerIdList(Int set, Int layerId, Int x)   { m_layerSetLayerIdList[set][layerId] = x;    }
    813 
    814   Int     getNumLayersInIdList(Int set)                         { return m_numLayerInIdList[set]; }
    815   Void    setNumLayersInIdList(Int set, Int x)                  { m_numLayerInIdList[set] = x;    }
    816 
    817   Void    deriveLayerIdListVariables();
    818   Void    deriveNumberOfSubDpbs();
    819 
    820   Void    setRefLayersFlags(Int currLayerId);
    821   Bool    getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId)              { return m_recursiveRefLayerFlag[currLayerId][refLayerId];}
    822   Void    setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x)      { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x;   }
    823   Int     getNumRefLayers(Int currLayerId)                                       { return m_numberRefLayers[currLayerId];                  }
    824   Void    setNumRefLayers();
    825 
    826   void    deriveLayerIdListVariablesForAddLayerSets();
    827   UInt    getVpsNumLayerSetsMinus1()                                             { return m_vpsNumLayerSetsMinus1; }
    828   Void    setVpsNumLayerSetsMinus1(UInt x)                                       { m_vpsNumLayerSetsMinus1 = x; }
    829   UInt    getNumAddLayerSets()                                                   { return m_numAddLayerSets; }
    830   Void    setNumAddLayerSets(UInt x)                                             { m_numAddLayerSets = x; }
    831   UInt    getHighestLayerIdxPlus1(UInt set, UInt idx)                            { return m_highestLayerIdxPlus1[set][idx]; }
    832   Void    setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx)             { m_highestLayerIdxPlus1[set][idx] = layerIdx; }
    833   Void    setPredictedLayerIds();
    834   UInt    getPredictedLayerId(UInt layerId, UInt predIdx)                        { return m_predictedLayerId[layerId][predIdx]; }
    835   Void    setPredictedLayerId(UInt layerId, UInt predIdx, UInt x)                { m_predictedLayerId[layerId][predIdx] = x; }
    836   UInt    getNumPredictedLayers(UInt layerId)                                    { return m_numPredictedLayers[layerId]; }
    837   Void    setNumPredictedLayers(UInt layerId, UInt x)                            { m_numPredictedLayers[layerId] = x; }
    838   Void    setTreePartitionLayerIdList();
    839   Int     getNumIndependentLayers()                                              { return m_numIndependentLayers; }
    840   Void    setNumIndependentLayers(Int x)                                         { m_numIndependentLayers = x; }
    841   Int     getNumLayersInTreePartition(Int idx)                                   { return m_numLayersInTreePartition[idx]; }
    842   Void    setNumLayersInTreePartition(Int idx, Int x)                            { m_numLayersInTreePartition[idx] = x; }
    843   UInt    getTreePartitionLayerId(Int idx, Int layerIdx)                         { return m_treePartitionLayerIdList[idx][layerIdx]; }
    844   Void    setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId)           { m_treePartitionLayerIdList[idx][layerIdx] = layerId; }
    845 
    846   UInt    getMaxLayerId()                                       { return m_maxLayerId;   }
    847   Void    setMaxLayerId(UInt v)                                 { m_maxLayerId = v;      }
    848   UInt    getNumLayerSets()                                     { return m_numLayerSets; }
    849   Void    setNumLayerSets(UInt v)                               { m_numLayerSets = v;    }
    850 
    851   Bool   getNonHEVCBaseLayerFlag()                              { return m_nonHEVCBaseLayerFlag;   }
    852   Void   setNonHEVCBaseLayerFlag(Bool x)                        { m_nonHEVCBaseLayerFlag = x;      }
    853 
    854   Bool   getSplittingFlag()                                     { return m_splittingFlag;          }
    855   Void   setSplittingFlag(Bool x)                               { m_splittingFlag = x;             }
    856 
    857   Bool   getScalabilityMask(Int id)                             { return m_scalabilityMask[id];    }
    858   Void   setScalabilityMask(Int id, Bool x)                     { m_scalabilityMask[id] = x;       }
    859 
    860   UInt   getDimensionIdLen(Int id)                              { return m_dimensionIdLen[id];     }
    861   Void   setDimensionIdLen(Int id, UInt x)                      { m_dimensionIdLen[id] = x;        }
    862 
    863   Bool   getNuhLayerIdPresentFlag()                             { return m_nuhLayerIdPresentFlag;  }
    864   Void   setNuhLayerIdPresentFlag(Bool x)                       { m_nuhLayerIdPresentFlag = x;     }
    865 
    866   UInt   getLayerIdInNuh(Int layerIdx)                          { return m_layerIdInNuh[layerIdx];    }
    867   Void   setLayerIdInNuh(Int layerIdx, UInt layerId)            { m_layerIdInNuh[layerIdx] = layerId; }
    868 
    869   UInt   getDimensionId(Int layerIdx, Int id)                   { return m_dimensionId[layerIdx][id]; }
    870   Void   setDimensionId(Int layerIdx, Int id, UInt x)           { m_dimensionId[layerIdx][id] = x;    }
    871 
    872   UInt   getNumScalabilityTypes()                               { return m_numScalabilityTypes;    }
    873   Void   setNumScalabilityTypes(UInt x)                         { m_numScalabilityTypes = x;       }
    874 
    875   UInt   getLayerIdxInVps(Int layerId)                          { return m_layerIdxInVps[layerId];     }
    876   Void   setLayerIdxInVps(Int layerId, UInt layerIdx)           { m_layerIdxInVps[layerId] = layerIdx; }
    877 
    878   UInt   getMaxSLayersInLayerSetMinus1(Int ls)                  { return m_maxSLInLayerSetMinus1[ls]; }
    879   Void   setMaxSLayersInLayerSetMinus1(Int ls, Int x)           { m_maxSLInLayerSetMinus1[ls] = x;    }
    880   Bool   getIlpSshSignalingEnabledFlag()                        { return m_ilpSshSignalingEnabledFlag;}
    881   Void   setIlpSshSignalingEnabledFlag(Bool x)                  { m_ilpSshSignalingEnabledFlag = x;}
    882 
    883   Bool   getProfilePresentFlag(Int id)                          { return m_profilePresentFlag[id]; }
    884   Void   setProfilePresentFlag(Int id, Bool x)                  { m_profilePresentFlag[id] = x;    }
     822  Int               getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl)    { return m_bspHrd[i].getCpbCntMinus1(sl);                          }
     823
     824  TComPTL*          getPTL()                                             { return &m_pcPTLList[0];                                          }
     825  const TComPTL*    getPTL() const                                       { return &m_pcPTLList[0];                                          }
     826  TComPTL*          getPTL(UInt idx)                                     { return &m_pcPTLList[idx];                                        }
     827  const TComPTL*    getPTL(UInt idx) const                               { return &m_pcPTLList[idx];                                        }
     828
     829  Int               getLayerSetLayerIdList(Int set, Int layerId) const   { return m_layerSetLayerIdList[set][layerId];                      }
     830  Void              setLayerSetLayerIdList(Int set, Int layerId, Int x)  { m_layerSetLayerIdList[set][layerId] = x;                         }
     831
     832  Int               getNumLayersInIdList(Int set) const                  { return m_numLayerInIdList[set];                                  }
     833  Void              setNumLayersInIdList(Int set, Int x)                 { m_numLayerInIdList[set] = x;                                     }
     834
     835  Void              deriveLayerIdListVariables();
     836  Void              deriveNumberOfSubDpbs();
     837
     838  Void              setRefLayersFlags(Int currLayerId);
     839  Bool              getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId) const    { return m_recursiveRefLayerFlag[currLayerId][refLayerId];}
     840  Void              setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x)  { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x;   }
     841  Int               getNumRefLayers(Int currLayerId) const                             { return m_numberRefLayers[currLayerId];                  }
     842  Void              setNumRefLayers();
     843
     844  Void              deriveLayerIdListVariablesForAddLayerSets();
     845  UInt              getVpsNumLayerSetsMinus1() const                                   { return m_vpsNumLayerSetsMinus1;                      }
     846  Void              setVpsNumLayerSetsMinus1(UInt x)                                   { m_vpsNumLayerSetsMinus1 = x;                         }
     847  UInt              getNumAddLayerSets() const                                         { return m_numAddLayerSets;                            }
     848  Void              setNumAddLayerSets(UInt x)                                         { m_numAddLayerSets = x; }
     849  UInt              getHighestLayerIdxPlus1(UInt set, UInt idx) const                  { return m_highestLayerIdxPlus1[set][idx];             }
     850  Void              setHighestLayerIdxPlus1(UInt set, UInt idx, UInt layerIdx)         { m_highestLayerIdxPlus1[set][idx] = layerIdx;         }
     851  Void              setPredictedLayerIds();
     852  UInt              getPredictedLayerId(UInt layerId, UInt predIdx) const              { return m_predictedLayerId[layerId][predIdx];         }
     853  Void              setPredictedLayerId(UInt layerId, UInt predIdx, UInt x)            { m_predictedLayerId[layerId][predIdx] = x;            }
     854  UInt              getNumPredictedLayers(UInt layerId) const                          { return m_numPredictedLayers[layerId];                }
     855  Void              setNumPredictedLayers(UInt layerId, UInt x)                        { m_numPredictedLayers[layerId] = x;                   }
     856  Void              setTreePartitionLayerIdList();
     857  Int               getNumIndependentLayers() const                                    { return m_numIndependentLayers;                       }
     858  Void              setNumIndependentLayers(Int x)                                     { m_numIndependentLayers = x;                          }
     859  Int               getNumLayersInTreePartition(Int idx) const                         { return m_numLayersInTreePartition[idx];              }
     860  Void              setNumLayersInTreePartition(Int idx, Int x)                        { m_numLayersInTreePartition[idx] = x;                 }
     861  UInt              getTreePartitionLayerId(Int idx, Int layerIdx) const               { return m_treePartitionLayerIdList[idx][layerIdx];    }
     862  Void              setTreePartitionLayerId(Int idx, Int layerIdx, UInt layerId)       { m_treePartitionLayerIdList[idx][layerIdx] = layerId; }
     863
     864  UInt              getMaxLayerId() const                                              { return m_maxLayerId;                               }
     865  Void              setMaxLayerId(UInt v)                                              { m_maxLayerId = v;                                  }
     866  UInt              getNumLayerSets() const                                            { return m_numLayerSets;                             }
     867  Void              setNumLayerSets(UInt v)                                            { m_numLayerSets = v;                                }
     868
     869  Bool              getNonHEVCBaseLayerFlag() const                                    { return m_nonHEVCBaseLayerFlag;                     }
     870  Void              setNonHEVCBaseLayerFlag(Bool x)                                    { m_nonHEVCBaseLayerFlag = x;                        }
     871
     872  Bool              getSplittingFlag() const                                           { return m_splittingFlag;                            }
     873  Void              setSplittingFlag(Bool x)                                           { m_splittingFlag = x;                               }
     874
     875  Bool              getScalabilityMask(Int id) const                                   { return m_scalabilityMask[id];                      }
     876  Void              setScalabilityMask(Int id, Bool x)                                 { m_scalabilityMask[id] = x;                         }
     877
     878  UInt              getDimensionIdLen(Int id) const                                    { return m_dimensionIdLen[id];                       }
     879  Void              setDimensionIdLen(Int id, UInt x)                                  { m_dimensionIdLen[id] = x;                          }
     880
     881  Bool              getNuhLayerIdPresentFlag() const                                   { return m_nuhLayerIdPresentFlag;                    }
     882  Void              setNuhLayerIdPresentFlag(Bool x)                                   { m_nuhLayerIdPresentFlag = x;                       }
     883
     884  UInt              getLayerIdInNuh(Int layerIdx) const                                { return m_layerIdInNuh[layerIdx];                   }
     885  Void              setLayerIdInNuh(Int layerIdx, UInt layerId)                        { m_layerIdInNuh[layerIdx] = layerId;                }
     886
     887  UInt              getDimensionId(Int layerIdx, Int id) const                         { return m_dimensionId[layerIdx][id];                }
     888  Void              setDimensionId(Int layerIdx, Int id, UInt x)                       { m_dimensionId[layerIdx][id] = x;                   }
     889
     890  UInt              getNumScalabilityTypes() const                                     { return m_numScalabilityTypes;                      }
     891  Void              setNumScalabilityTypes(UInt x)                                     { m_numScalabilityTypes = x;                         }
     892
     893  UInt              getLayerIdxInVps(Int layerId) const                                { return m_layerIdxInVps[layerId];                   }
     894  Void              setLayerIdxInVps(Int layerId, UInt layerIdx)                       { m_layerIdxInVps[layerId] = layerIdx;               }
     895
     896  UInt              getMaxSLayersInLayerSetMinus1(Int ls) const                        { return m_maxSLInLayerSetMinus1[ls];                }
     897  Void              setMaxSLayersInLayerSetMinus1(Int ls, Int x)                       { m_maxSLInLayerSetMinus1[ls] = x;                   }
     898  Bool              getIlpSshSignalingEnabledFlag() const                              { return m_ilpSshSignalingEnabledFlag;               }
     899  Void              setIlpSshSignalingEnabledFlag(Bool x)                              { m_ilpSshSignalingEnabledFlag = x;                  }
     900
     901  Bool              getProfilePresentFlag(Int id) const                                { return m_profilePresentFlag[id];                   }
     902  Void              setProfilePresentFlag(Int id, Bool x)                              { m_profilePresentFlag[id] = x;                      }
    885903
    886904  // Target output layer signalling related
    887   UInt   getNumOutputLayerSets()                                { return m_numOutputLayerSets;     }
    888   Void   setNumOutputLayerSets(Int x)                           { m_numOutputLayerSets = x;        }
     905  UInt              getNumOutputLayerSets() const                                      { return m_numOutputLayerSets;                       }
     906  Void              setNumOutputLayerSets(Int x)                                       { m_numOutputLayerSets = x;                          }
    889907 
    890   UInt   getOutputLayerSetIdx(Int idx)                          { return m_outputLayerSetIdx[idx]; }
    891   Void   setOutputLayerSetIdx(Int idx, UInt x)                  { m_outputLayerSetIdx[idx] = x;    }
    892 
    893   Bool   getOutputLayerFlag(Int layerSet, Int layerIdx)          { return m_outputLayerFlag[layerSet][layerIdx]; }
    894   Void   setOutputLayerFlag(Int layerSet, Int layerIdx, Bool x)  { m_outputLayerFlag[layerSet][layerIdx] = x;    }
     908  UInt              getOutputLayerSetIdx(Int idx) const                                { return m_outputLayerSetIdx[idx];                  }
     909  Void              setOutputLayerSetIdx(Int idx, UInt x)                              { m_outputLayerSetIdx[idx] = x;                      }
     910
     911  Bool              getOutputLayerFlag(Int layerSet, Int layerIdx) const               { return m_outputLayerFlag[layerSet][layerIdx];      }
     912  Void              setOutputLayerFlag(Int layerSet, Int layerIdx, Bool x)             { m_outputLayerFlag[layerSet][layerIdx] = x;         }
    895913
    896914  // Direct dependency of layers
    897   Bool   getDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx)             { return m_directDependencyFlag[currLayerIdx][refLayerIdx]; }
    898   Void   setDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx, Bool x)    { m_directDependencyFlag[currLayerIdx][refLayerIdx] = x;    }
     915  Bool              getDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx) const   { return m_directDependencyFlag[currLayerIdx][refLayerIdx]; }
     916  Void              setDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx, Bool x) { m_directDependencyFlag[currLayerIdx][refLayerIdx] = x;    }
    899917 
    900   UInt   getNumDirectRefLayers(Int layerId)                                     { return m_numDirectRefLayers[layerId];                   }
    901   Void   setNumDirectRefLayers(Int layerId, UInt refLayerNum)                   { m_numDirectRefLayers[layerId] = refLayerNum;            }
    902 
    903   UInt   getRefLayerId(Int layerId, Int refLayerIdc)                            { return m_refLayerId[layerId][refLayerIdc];              }
    904   Void   setRefLayerId(Int layerId, Int refLayerIdc, UInt refLayerId)           { m_refLayerId[layerId][refLayerIdc] = refLayerId;        }
    905 
    906   UInt   getDirectDepTypeLen()                                                  { return m_directDepTypeLen;                              }
    907   Void   setDirectDepTypeLen(UInt x)                                            { m_directDepTypeLen = x;                                 }
    908   Bool   getDefaultDirectDependencyTypeFlag()                                   { return m_defaultDirectDependencyTypeFlag;               }
    909   Void   setDefaultDirectDependecyTypeFlag(Bool x)                              { m_defaultDirectDependencyTypeFlag = x;                  }
    910   UInt   getDefaultDirectDependencyType()                                       { return m_defaultDirectDependencyType;                   }
    911   Void   setDefaultDirectDependecyType(UInt x)                                  { m_defaultDirectDependencyType = x;                      }
    912   UInt   getDirectDependencyType(Int currLayerIdx, Int refLayerIdx)             { return m_directDependencyType[currLayerIdx][refLayerIdx]; }
    913   Void   setDirectDependencyType(Int currLayerIdx, Int refLayerIdx, UInt x)    { m_directDependencyType[currLayerIdx][refLayerIdx] = x;    }
    914   Bool   isSamplePredictionType(Int currLayerIdx, Int refLayerIdx)              { assert(currLayerIdx != refLayerIdx); return ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 1 ) ? true : false; }
    915   Bool   isMotionPredictionType(Int currLayerIdx, Int refLayerIdx)              { assert(currLayerIdx != refLayerIdx); return ( ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 2 ) >> 1 ) ? true : false; }
    916 
    917   UInt   getNumProfileTierLevel()                                               { return m_numProfileTierLevel;   }
    918   Void   setNumProfileTierLevel(Int x)                                          { m_numProfileTierLevel = x;      }
    919   Int    getNumAddOutputLayerSets()                                             { return m_numAddOutputLayerSets; }
    920   Void   setNumAddOutputLayerSets(Int x)                                        { m_numAddOutputLayerSets = x   ; }
    921 
    922   UInt   getDefaultTargetOutputLayerIdc()                                       { return m_defaultTargetOutputLayerIdc; }
    923   Void   setDefaultTargetOutputLayerIdc(UInt x)                                 { m_defaultTargetOutputLayerIdc = x    ;}
    924 
    925   Bool getNecessaryLayerFlag(Int const i, Int const j)                          { return m_necessaryLayerFlag[i][j];     }
    926   std::vector< std::vector<Int> >* getProfileLevelTierIdx()                     { return &m_profileLevelTierIdx;         }
    927   std::vector<Int>* getProfileLevelTierIdx(Int const olsIdx)                    { return &m_profileLevelTierIdx[olsIdx]; }
    928   Int    getProfileLevelTierIdx(Int const olsIdx, Int const layerIdx)                   { return m_profileLevelTierIdx[olsIdx][layerIdx]; }
    929   Void   setProfileLevelTierIdx(Int const olsIdx, Int const layerIdx, Int const ptlIdx) { m_profileLevelTierIdx[olsIdx][layerIdx] = ptlIdx; }
    930   Void   addProfileLevelTierIdx(Int const olsIdx, Int const ptlIdx)             { m_profileLevelTierIdx[olsIdx].push_back(ptlIdx); }
    931   Int    calculateLenOfSyntaxElement( Int const numVal );
    932 
    933   Bool   getMaxOneActiveRefLayerFlag()                                          { return m_maxOneActiveRefLayerFlag;             }
    934   Void   setMaxOneActiveRefLayerFlag(Bool x)                                    { m_maxOneActiveRefLayerFlag = x;                }
    935   UInt   getPocLsbNotPresentFlag(Int i)                                         { return m_pocLsbNotPresentFlag[i];              }
    936   Void   setPocLsbNotPresentFlag(Int i, Bool x)                                 { m_pocLsbNotPresentFlag[i] = x;                 }
    937   Bool   getVpsPocLsbAlignedFlag()                                              { return m_vpsPocLsbAlignedFlag;                 }
    938   Void   setVpsPocLsbAlignedFlag(Bool x)                                        { m_vpsPocLsbAlignedFlag = x;                    }
    939   Bool   getCrossLayerPictureTypeAlignFlag()                                    { return m_crossLayerPictureTypeAlignFlag;       }
    940   Void   setCrossLayerPictureTypeAlignFlag(Bool x)                              { m_crossLayerPictureTypeAlignFlag = x;          }
    941   Bool   getCrossLayerAlignedIdrOnlyFlag()                                      { return m_crossLayerAlignedIdrOnlyFlag;         }
    942   Void   setCrossLayerAlignedIdrOnlyFlag(Bool x)                                { m_crossLayerAlignedIdrOnlyFlag = x;            }
    943   Bool   getCrossLayerIrapAlignFlag()                                           { return m_crossLayerIrapAlignFlag;              }
    944   Void   setCrossLayerIrapAlignFlag(Bool x)                                     { m_crossLayerIrapAlignFlag = x;                 }
    945   UInt   getMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx)                     { return m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx];           }
    946   Void   setMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx, UInt maxSublayer)   { m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx] = maxSublayer;    }
    947   Bool   getMaxTidRefPresentFlag()                                              { return m_maxTidRefPresentFlag;                 }
    948   Void   setMaxTidRefPresentFlag(Bool x)                                        { m_maxTidRefPresentFlag = x;                    }
    949   Bool   getMaxTSLayersPresentFlag()                                            { return m_maxTSLayersPresentFlag;               }
    950   Void   setMaxTSLayersPresentFlag(Bool x)                                      { m_maxTSLayersPresentFlag = x;                  }
    951   UInt   getMaxTSLayersMinus1(Int layerIdx)                                     { return m_maxTSLayerMinus1[layerIdx];           }
    952   Void   setMaxTSLayersMinus1(Int layerIdx, UInt maxTSublayer)                  { m_maxTSLayerMinus1[layerIdx] = maxTSublayer;   }
    953   Bool   getSingleLayerForNonIrapFlag()                                         { return m_singleLayerForNonIrapFlag;            }
    954   Void   setSingleLayerForNonIrapFlag(Bool x)                                   { m_singleLayerForNonIrapFlag = x;               }
    955   Bool   getHigherLayerIrapSkipFlag()                                           { return m_higherLayerIrapSkipFlag;              }
    956   Void   setHigherLayerIrapSkipFlag(Bool x)                                     { m_higherLayerIrapSkipFlag = x;                 }
    957 
    958   Bool   getTilesNotInUseFlag()                                                  { return m_tilesNotInUseFlag; }
    959   Void   setTilesNotInUseFlag(Bool x);
    960   Bool   getTilesInUseFlag(Int currLayerId)                                      { return m_tilesInUseFlag[currLayerId]; }
    961   Void   setTilesInUseFlag(Int currLayerId, Bool x)                              { m_tilesInUseFlag[currLayerId] = x; }
    962   Bool   getLoopFilterNotAcrossTilesFlag(Int currLayerId)                        { return m_loopFilterNotAcrossTilesFlag[currLayerId]; }
    963   Void   setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x)                { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; }
    964   Bool   getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId)           { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; }
    965   Void   setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x)   { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; }
    966   Bool   getWppNotInUseFlag()                                                    { return m_wppNotInUseFlag; }
    967   Void   setWppNotInUseFlag(Bool x);
    968   Bool   getWppInUseFlag(Int currLayerId)                                        { return m_wppInUseFlag[currLayerId]; }
    969   Void   setWppInUseFlag(Int currLayerId, Bool x)                                { m_wppInUseFlag[currLayerId] = x; }
    970 
    971   Bool   getIlpRestrictedRefLayersFlag  ( )                                            { return m_ilpRestrictedRefLayersFlag;}
    972   Void   setIlpRestrictedRefLayersFlag  ( Int val )                                    { m_ilpRestrictedRefLayersFlag = val; } 
    973   Int    getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId )            { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}
    974   Void   setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val )   { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val; } 
    975   Bool   getCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId )            { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}
    976   Void   setCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} 
    977   Int    getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId )            { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}
    978   Void   setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val )   { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val; } 
    979 
    980   Bool   getVideoSigPresentVpsFlag()           { return m_vidSigPresentVpsFlag; }
    981   Void   setVideoSigPresentVpsFlag(Bool x)     { m_vidSigPresentVpsFlag = x;    }
    982   Int    getNumVideoSignalInfo()               { return m_vpsVidSigInfo;        }
    983   Void   setNumVideoSignalInfo(Int x)          { m_vpsVidSigInfo = x;           }
    984   Int    getVideoSignalInfoIdx(Int idx)        { return m_vpsVidSigIdx[idx];    }
    985   Void   setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x;       }
    986   Int    getVideoVPSFormat(Int idx)            { return m_vpsVidFormat[idx];    }
    987   Void   setVideoVPSFormat(Int idx, Int x)     { m_vpsVidFormat[idx] = x;       }
    988   Bool   getVideoFullRangeVpsFlag(Int idx)     { return m_vpsFullRangeFlag[idx];}
    989   Void   setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x;   }
    990   Int    getColorPrimaries(Int idx)            { return m_vpsColorPrimaries[idx];   }
    991   Void   setColorPrimaries(Int idx, Int x)     { m_vpsColorPrimaries[idx] = x;      }
    992   Int    getTransCharacter(Int idx)            { return m_vpsTransChar[idx];    }
    993   Void   setTransCharacter(Int idx, Int x)     { m_vpsTransChar[idx] = x;       }
    994   Int    getMaxtrixCoeff(Int idx)              { return m_vpsMatCoeff[idx];     }
    995   Void   setMaxtrixCoeff(Int idx, Int x)       { m_vpsMatCoeff[idx] = x;        }
    996 
    997   Bool   getBitRatePresentVpsFlag()       { return m_bitRatePresentVpsFlag; }
    998   Void   setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x;    }
    999   Bool   getPicRatePresentVpsFlag()       { return m_picRatePresentVpsFlag; }
    1000   Void   setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x;    }
     918  UInt              getNumDirectRefLayers(Int layerId) const                           { return m_numDirectRefLayers[layerId];                   }
     919  Void              setNumDirectRefLayers(Int layerId, UInt refLayerNum)               { m_numDirectRefLayers[layerId] = refLayerNum;            }
     920
     921  UInt              getRefLayerId(Int layerId, Int refLayerIdc) const                  { return m_refLayerId[layerId][refLayerIdc];              }
     922  Void              setRefLayerId(Int layerId, Int refLayerIdc, UInt refLayerId)       { m_refLayerId[layerId][refLayerIdc] = refLayerId;        }
     923
     924  UInt              getDirectDepTypeLen() const                                        { return m_directDepTypeLen;                              }
     925  Void              setDirectDepTypeLen(UInt x)                                        { m_directDepTypeLen = x;                                 }
     926  Bool              getDefaultDirectDependencyTypeFlag() const                         { return m_defaultDirectDependencyTypeFlag;               }
     927  Void              setDefaultDirectDependecyTypeFlag(Bool x)                          { m_defaultDirectDependencyTypeFlag = x;                  }
     928  UInt              getDefaultDirectDependencyType() const                             { return m_defaultDirectDependencyType;                   }
     929  Void              setDefaultDirectDependecyType(UInt x)                              { m_defaultDirectDependencyType = x;                      }
     930  UInt              getDirectDependencyType(Int currLayerIdx, Int refLayerIdx) const   { return m_directDependencyType[currLayerIdx][refLayerIdx]; }
     931  Void              setDirectDependencyType(Int currLayerIdx, Int refLayerIdx, UInt x) { m_directDependencyType[currLayerIdx][refLayerIdx] = x;    }
     932  Bool              isSamplePredictionType(Int currLayerIdx, Int refLayerIdx) const    { assert(currLayerIdx != refLayerIdx); return ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 1 ) ? true : false; }
     933  Bool              isMotionPredictionType(Int currLayerIdx, Int refLayerIdx) const    { assert(currLayerIdx != refLayerIdx); return ( ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 2 ) >> 1 ) ? true : false; }
     934
     935  UInt              getNumProfileTierLevel() const                                     { return m_numProfileTierLevel;                           }
     936  Void              setNumProfileTierLevel(Int x)                                      { m_numProfileTierLevel = x;                              }
     937  Int               getNumAddOutputLayerSets() const                                   { return m_numAddOutputLayerSets;                        }
     938  Void              setNumAddOutputLayerSets(Int x)                                    { m_numAddOutputLayerSets = x;                            }
     939
     940  UInt              getDefaultTargetOutputLayerIdc() const                             { return m_defaultTargetOutputLayerIdc;                  }
     941  Void              setDefaultTargetOutputLayerIdc(UInt x)                             { m_defaultTargetOutputLayerIdc = x;                      }
     942
     943  Bool              getNecessaryLayerFlag(Int const i, Int const j) const              { return m_necessaryLayerFlag[i][j];                      }
     944  std::vector< std::vector<Int> >* getProfileLevelTierIdx()                            { return &m_profileLevelTierIdx;                          }
     945  std::vector<Int>*                getProfileLevelTierIdx(Int const olsIdx)            { return &m_profileLevelTierIdx[olsIdx];                  }
     946  Int               getProfileLevelTierIdx(const Int olsIdx, const Int layerIdx) const { return m_profileLevelTierIdx[olsIdx][layerIdx];              }
     947  Void              setProfileLevelTierIdx(const Int olsIdx, const Int layerIdx, const Int ptlIdx) { m_profileLevelTierIdx[olsIdx][layerIdx] = ptlIdx; }
     948  Void              addProfileLevelTierIdx(const Int olsIdx, const Int ptlIdx)         { m_profileLevelTierIdx[olsIdx].push_back(ptlIdx);              }
     949  Int               calculateLenOfSyntaxElement( const Int numVal ) const;
     950
     951  Bool              getMaxOneActiveRefLayerFlag() const                                { return m_maxOneActiveRefLayerFlag;                 }
     952  Void              setMaxOneActiveRefLayerFlag(Bool x)                                { m_maxOneActiveRefLayerFlag = x;                    }
     953  UInt              getPocLsbNotPresentFlag(Int i) const                               { return m_pocLsbNotPresentFlag[i];                  }
     954  Void              setPocLsbNotPresentFlag(Int i, Bool x)                             { m_pocLsbNotPresentFlag[i] = x;                     }
     955  Bool              getVpsPocLsbAlignedFlag() const                                    { return m_vpsPocLsbAlignedFlag;                     }
     956  Void              setVpsPocLsbAlignedFlag(Bool x)                                    { m_vpsPocLsbAlignedFlag = x;                        }
     957  Bool              getCrossLayerPictureTypeAlignFlag() const                          { return m_crossLayerPictureTypeAlignFlag;           }
     958  Void              setCrossLayerPictureTypeAlignFlag(Bool x)                          { m_crossLayerPictureTypeAlignFlag = x;              }
     959  Bool              getCrossLayerAlignedIdrOnlyFlag() const                            { return m_crossLayerAlignedIdrOnlyFlag;             }
     960  Void              setCrossLayerAlignedIdrOnlyFlag(Bool x)                            { m_crossLayerAlignedIdrOnlyFlag = x;                }
     961  Bool              getCrossLayerIrapAlignFlag() const                                 { return m_crossLayerIrapAlignFlag;                  }
     962  Void              setCrossLayerIrapAlignFlag(Bool x)                                 { m_crossLayerIrapAlignFlag = x;                     }
     963  UInt              getMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx) const       { return m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx];                }
     964  Void              setMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx, UInt maxSublayer)   { m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx] = maxSublayer; }
     965  Bool              getMaxTidRefPresentFlag() const                                    { return m_maxTidRefPresentFlag;                     }
     966  Void              setMaxTidRefPresentFlag(Bool x)                                    { m_maxTidRefPresentFlag = x;                        }
     967  Bool              getMaxTSLayersPresentFlag() const                                  { return m_maxTSLayersPresentFlag;                   }
     968  Void              setMaxTSLayersPresentFlag(Bool x)                                  { m_maxTSLayersPresentFlag = x;                      }
     969  UInt              getMaxTSLayersMinus1(Int layerIdx) const                           { return m_maxTSLayerMinus1[layerIdx];               }
     970  Void              setMaxTSLayersMinus1(Int layerIdx, UInt maxTSublayer)              { m_maxTSLayerMinus1[layerIdx] = maxTSublayer;       }
     971  Bool              getSingleLayerForNonIrapFlag() const                               { return m_singleLayerForNonIrapFlag;                }
     972  Void              setSingleLayerForNonIrapFlag(Bool x)                               { m_singleLayerForNonIrapFlag = x;                   }
     973  Bool              getHigherLayerIrapSkipFlag() const                                 { return m_higherLayerIrapSkipFlag;                  }
     974  Void              setHigherLayerIrapSkipFlag(Bool x)                                 { m_higherLayerIrapSkipFlag = x;                     }
     975
     976  Bool              getTilesNotInUseFlag() const                                       { return m_tilesNotInUseFlag;                        }
     977  Void              setTilesNotInUseFlag(Bool x);
     978  Bool              getTilesInUseFlag(Int currLayerId) const                           { return m_tilesInUseFlag[currLayerId];              }
     979  Void              setTilesInUseFlag(Int currLayerId, Bool x)                         { m_tilesInUseFlag[currLayerId] = x; }
     980  Bool              getLoopFilterNotAcrossTilesFlag(Int currLayerId) const             { return m_loopFilterNotAcrossTilesFlag[currLayerId];}
     981  Void              setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x)           { m_loopFilterNotAcrossTilesFlag[currLayerId] = x;  }
     982  Bool              getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) const     { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; }
     983  Void              setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x)   { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x;    }
     984  Bool              getWppNotInUseFlag() const                                         { return m_wppNotInUseFlag;                          }
     985  Void              setWppNotInUseFlag(Bool x);
     986  Bool              getWppInUseFlag(Int currLayerId) const                             { return m_wppInUseFlag[currLayerId];                }
     987  Void              setWppInUseFlag(Int currLayerId, Bool x)                           { m_wppInUseFlag[currLayerId] = x;                  }
     988
     989  Bool              getIlpRestrictedRefLayersFlag  ( ) const                                      { return m_ilpRestrictedRefLayersFlag;}
     990  Void              setIlpRestrictedRefLayersFlag  ( Int val )                                    { m_ilpRestrictedRefLayersFlag = val; } 
     991  Int               getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) const      { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}
     992  Void              setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val )   { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val; } 
     993  Bool              getCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId ) const      { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}
     994  Void              setCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} 
     995  Int               getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) const      { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}
     996  Void              setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val )   { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val; } 
     997
     998  Bool              getVideoSigPresentVpsFlag() const                                  { return m_vidSigPresentVpsFlag;                      }
     999  Void              setVideoSigPresentVpsFlag(Bool x)                                  { m_vidSigPresentVpsFlag = x;                         }
     1000  Int               getNumVideoSignalInfo() const                                      { return m_vpsVidSigInfo;                             }
     1001  Void              setNumVideoSignalInfo(Int x)                                       { m_vpsVidSigInfo = x;                                }
     1002  Int               getVideoSignalInfoIdx(Int idx) const                               { return m_vpsVidSigIdx[idx];                         }
     1003  Void              setVideoSignalInfoIdx(Int idx, Int x)                              { m_vpsVidSigIdx[idx] = x;                            }
     1004  Int               getVideoVPSFormat(Int idx) const                                   { return m_vpsVidFormat[idx];                         }
     1005  Void              setVideoVPSFormat(Int idx, Int x)                                  { m_vpsVidFormat[idx] = x;                            }
     1006  Bool              getVideoFullRangeVpsFlag(Int idx) const                            { return m_vpsFullRangeFlag[idx];                     }
     1007  Void              setVideoFullRangeVpsFlag(Int idx, Bool x)                          { m_vpsFullRangeFlag[idx] = x;                        }
     1008  Int               getColorPrimaries(Int idx) const                                   { return m_vpsColorPrimaries[idx];                    }
     1009  Void              setColorPrimaries(Int idx, Int x)                                  { m_vpsColorPrimaries[idx] = x;                       }
     1010  Int               getTransCharacter(Int idx) const                                   { return m_vpsTransChar[idx];                         }
     1011  Void              setTransCharacter(Int idx, Int x)                                  { m_vpsTransChar[idx] = x;                            }
     1012  Int               getMaxtrixCoeff(Int idx) const                                     { return m_vpsMatCoeff[idx];                          }
     1013  Void              setMaxtrixCoeff(Int idx, Int x)                                    { m_vpsMatCoeff[idx] = x;                             }
     1014
     1015  Bool              getBitRatePresentVpsFlag() const                                   { return m_bitRatePresentVpsFlag;                    }
     1016  Void              setBitRatePresentVpsFlag(Bool x)                                   { m_bitRatePresentVpsFlag = x;                        }
     1017  Bool              getPicRatePresentVpsFlag() const                                   { return m_picRatePresentVpsFlag;                    }
     1018  Void              setPicRatePresentVpsFlag(Bool x)                                   { m_picRatePresentVpsFlag = x;                        }
    10011019         
    1002   Bool   getBitRatePresentFlag(Int i, Int j)          { return m_bitRatePresentFlag[i][j]; }
    1003   Void   setBitRatePresentFlag(Int i, Int j, Bool x)  { m_bitRatePresentFlag[i][j] = x;    }
    1004   Bool   getPicRatePresentFlag(Int i, Int j)          { return m_picRatePresentFlag[i][j]; }
    1005   Void   setPicRatePresentFlag(Int i, Int j, Bool x)  { m_picRatePresentFlag[i][j] = x;    }
     1020  Bool              getBitRatePresentFlag(Int i, Int j) const                          { return m_bitRatePresentFlag[i][j];                  }
     1021  Void              setBitRatePresentFlag(Int i, Int j, Bool x)                        { m_bitRatePresentFlag[i][j] = x;                     }
     1022  Bool              getPicRatePresentFlag(Int i, Int j) const                          { return m_picRatePresentFlag[i][j];                  }
     1023  Void              setPicRatePresentFlag(Int i, Int j, Bool x)                        { m_picRatePresentFlag[i][j] = x;                     }
    10061024         
    1007   Int    getAvgBitRate(Int i, Int j)          { return m_avgBitRate[i][j]; }
    1008   Void   setAvgBitRate(Int i, Int j, Int x)   { m_avgBitRate[i][j] = x;    }
    1009   Int    getMaxBitRate(Int i, Int j)          { return m_maxBitRate[i][j]; }
    1010   Void   setMaxBitRate(Int i, Int j, Int x)   { m_maxBitRate[i][j] = x;    }
     1025  Int               getAvgBitRate(Int i, Int j) const                                  { return m_avgBitRate[i][j];                          }
     1026  Void              setAvgBitRate(Int i, Int j, Int x)                                 { m_avgBitRate[i][j] = x;                             }
     1027  Int               getMaxBitRate(Int i, Int j) const                                  { return m_maxBitRate[i][j];                          }
     1028  Void              setMaxBitRate(Int i, Int j, Int x)                                 { m_maxBitRate[i][j] = x;                             }
    10111029         
    1012   Int    getConstPicRateIdc(Int i, Int j)          { return m_constPicRateIdc[i][j]; }
    1013   Void   setConstPicRateIdc(Int i, Int j, Int x)   { m_constPicRateIdc[i][j] = x;    }
    1014   Int    getAvgPicRate(Int i, Int j)          { return m_avgPicRate[i][j]; }
    1015   Void   setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
     1030  Int               getConstPicRateIdc(Int i, Int j) const                             { return m_constPicRateIdc[i][j];                    }
     1031  Void              setConstPicRateIdc(Int i, Int j, Int x)                            { m_constPicRateIdc[i][j] = x;                        }
     1032  Int               getAvgPicRate(Int i, Int j) const                                  { return m_avgPicRate[i][j];                          }
     1033  Void              setAvgPicRate(Int i, Int j, Int x)                                 { m_avgPicRate[i][j] = x;                             }
    10161034#if O0164_MULTI_LAYER_HRD
    1017   Bool     getVpsVuiBspHrdPresentFlag()                                         { return m_vpsVuiBspHrdPresentFlag;      }
    1018   Void     setVpsVuiBspHrdPresentFlag(Bool x)                                   { m_vpsVuiBspHrdPresentFlag = x;         }
    1019   Int      getVpsNumAddHrdParams()                                              { return m_vpsNumAddHrdParams; }
    1020   Void     setVpsNumAddHrdParams(Int  i)                                        { m_vpsNumAddHrdParams = i;    }
    1021 
    1022   Bool     getCprmsAddPresentFlag(Int i)                                        { return m_cprmsAddPresentFlag[i];       }
    1023   Void     setCprmsAddPresentFlag(Int  i, Bool  val)                            { m_cprmsAddPresentFlag[i] = val;        }
    1024 
    1025   Int      getNumSubLayerHrdMinus1(Int i)                                       { return m_numSubLayerHrdMinus1[i]; }
    1026   Void     setNumSubLayerHrdMinus1(Int i, Int val)                              { m_numSubLayerHrdMinus1[i] = val;  }
    1027 
    1028   TComHRD*  getBspHrd(Int i)           {return &m_bspHrd[i];}
    1029 
    1030   Int      getNumSignalledPartitioningSchemes(Int  i)                           { return m_numSignalledPartitioningSchemes[i];    }
    1031   Void     setNumSignalledPartitioningSchemes(Int  i, Int  val)                 { m_numSignalledPartitioningSchemes[i] = val;     }
    1032 
    1033   Int      getNumPartitionsInSchemeMinus1(Int  i, Int j)                        { return m_numPartitionsInSchemeMinus1[i][j];}
    1034   Void     setNumPartitionsInSchemeMinus1(Int i, Int j, Int val)                { m_numPartitionsInSchemeMinus1[i][j] = val; }
    1035 
    1036   Int      getLayerIncludedInPartitionFlag(Int  i, Int j, Int k, Int l)         { return m_layerIncludedInPartitionFlag[i][j][k][l];}
    1037   Void     setLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l, Int val) { m_layerIncludedInPartitionFlag[i][j][k][l] = val; }
    1038 
    1039   Int      getNumBspSchedulesMinus1(Int  i, Int j, Int k)                       { return m_numBspSchedulesMinus1[i][j][k];}
    1040   Void     setNumBspSchedulesMinus1(Int i, Int j, Int k, Int val)               { m_numBspSchedulesMinus1[i][j][k] = val; }
    1041 
    1042   Int      getBspSchedIdx(Int  i, Int j, Int k, Int l, Int m)                   { return m_bspSchedIdx[i][j][k][l][m];}
    1043   Void     setBspSchedIdx(Int  i, Int j, Int k, Int l, Int m, Int val)          { m_bspSchedIdx[i][j][k][l][m] = val; }
    1044 
    1045   Int      getBspHrdIdx(Int  i, Int j, Int k, Int l, Int m)                     { return m_bspHrdIdx[i][j][k][l][m];}
    1046   Void     setBspHrdIdx(Int  i, Int j, Int k, Int l, Int m, Int val)            { m_bspHrdIdx[i][j][k][l][m] = val; }
    1047 #endif
    1048   Void   setBaseLayerPSCompatibilityFlag (Int layer, int val)                   { m_baseLayerPSCompatibilityFlag[layer] = val; }
    1049   Int    getBaseLayerPSCompatibilityFlag (Int layer)                            { return m_baseLayerPSCompatibilityFlag[layer];}
    1050   Bool   getAltOuputLayerFlag(Int idx)                                          { return m_altOutputLayerFlag[idx]; }
    1051   Void   setAltOuputLayerFlag(Int idx, Bool x)                                  { m_altOutputLayerFlag[idx] = x;    }
    1052 
    1053   Bool   getRepFormatIdxPresentFlag()                                           { return m_repFormatIdxPresentFlag; }
    1054   Void   setRepFormatIdxPresentFlag(Bool x)                                     { m_repFormatIdxPresentFlag = x;    }
    1055 
    1056   Int    getVpsNumRepFormats()                                                  { return m_vpsNumRepFormats;        }
    1057   Void   setVpsNumRepFormats(Int x)                                             { m_vpsNumRepFormats = x;           }
    1058 
    1059   RepFormat* getVpsRepFormat(Int idx)                                           { return &m_vpsRepFormat[idx];      }
    1060 
    1061   Int    getVpsRepFormatIdx(Int idx)                                            { return m_vpsRepFormatIdx[idx];    }
    1062   Void   setVpsRepFormatIdx(Int idx, Int x)                                     { m_vpsRepFormatIdx[idx] = x;       }         
    1063 
    1064   Void   setViewIdLen( Int  val )                                               { m_viewIdLen = val;  }
    1065   Int    getViewIdLen(  )                                                       { return m_viewIdLen; }
    1066 
    1067   Void   setViewIdVal( Int viewOrderIndex, Int  val )                           { m_viewIdVal[viewOrderIndex] = val;  }
    1068   Int    getViewIdVal( Int viewOrderIndex )                                     { return m_viewIdVal[viewOrderIndex]; }
    1069   Int    getScalabilityId(Int, ScalabilityType scalType );
    1070 
    1071   Int    getViewIndex    ( Int layerIdInNuh )                                   { return getScalabilityId( getLayerIdxInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
    1072 
    1073   Int    getNumViews();
    1074   Int    scalTypeToScalIdx( ScalabilityType scalType );
    1075 
    1076   Bool   getSubLayerFlagInfoPresentFlag(Int olsIdx)         { return m_subLayerFlagInfoPresentFlag[olsIdx]; }
    1077   Void   setSubLayerFlagInfoPresentFlag(Int olsIdx, Bool x) { m_subLayerFlagInfoPresentFlag[olsIdx] = x;    }
    1078 
    1079   Bool   getSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx)         { return m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx]; }
    1080   Void   setSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx, Bool x) { m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx] = x;    }
     1035  Bool              getVpsVuiBspHrdPresentFlag() const                                 { return m_vpsVuiBspHrdPresentFlag;                   }
     1036  Void              setVpsVuiBspHrdPresentFlag(Bool x)                                 { m_vpsVuiBspHrdPresentFlag = x;                      }
     1037  Int               getVpsNumAddHrdParams() const                                      { return m_vpsNumAddHrdParams;                        }
     1038  Void              setVpsNumAddHrdParams(Int  i)                                      { m_vpsNumAddHrdParams = i;                           }
     1039
     1040  Bool              getCprmsAddPresentFlag(Int i) const                                { return m_cprmsAddPresentFlag[i];                    }
     1041  Void              setCprmsAddPresentFlag(Int  i, Bool  val)                          { m_cprmsAddPresentFlag[i] = val;                     }
     1042
     1043  Int               getNumSubLayerHrdMinus1(Int i) const                               { return m_numSubLayerHrdMinus1[i];                   }
     1044  Void              setNumSubLayerHrdMinus1(Int i, Int val)                            { m_numSubLayerHrdMinus1[i] = val;                    }
     1045
     1046  TComHRD*          getBspHrd(Int i)                                                   { return &m_bspHrd[i];                                }
     1047  const TComHRD*    getBspHrd(Int i) const                                             { return &m_bspHrd[i];                                }
     1048
     1049  Int               getNumSignalledPartitioningSchemes(Int  i) const                   { return m_numSignalledPartitioningSchemes[i];        }
     1050  Void              setNumSignalledPartitioningSchemes(Int  i, Int  val)               { m_numSignalledPartitioningSchemes[i] = val;         }
     1051
     1052  Int               getNumPartitionsInSchemeMinus1(Int  i, Int j) const                { return m_numPartitionsInSchemeMinus1[i][j];         }
     1053  Void              setNumPartitionsInSchemeMinus1(Int i, Int j, Int val)              { m_numPartitionsInSchemeMinus1[i][j] = val;          }
     1054
     1055  Int               getLayerIncludedInPartitionFlag(Int  i, Int j, Int k, Int l) const   { return m_layerIncludedInPartitionFlag[i][j][k][l];}
     1056  Void              setLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l, Int val) { m_layerIncludedInPartitionFlag[i][j][k][l] = val; }
     1057
     1058  Int               getNumBspSchedulesMinus1(Int  i, Int j, Int k) const               { return m_numBspSchedulesMinus1[i][j][k];            }
     1059  Void              setNumBspSchedulesMinus1(Int i, Int j, Int k, Int val)             { m_numBspSchedulesMinus1[i][j][k] = val;             }
     1060
     1061  Int               getBspSchedIdx(Int  i, Int j, Int k, Int l, Int m) const           { return m_bspSchedIdx[i][j][k][l][m];                }
     1062  Void              setBspSchedIdx(Int  i, Int j, Int k, Int l, Int m, Int val)        { m_bspSchedIdx[i][j][k][l][m] = val;                 }
     1063
     1064  Int               getBspHrdIdx(Int  i, Int j, Int k, Int l, Int m) const             { return m_bspHrdIdx[i][j][k][l][m];                  }
     1065  Void              setBspHrdIdx(Int  i, Int j, Int k, Int l, Int m, Int val)          { m_bspHrdIdx[i][j][k][l][m] = val;                   }
     1066#endif
     1067  Void              setBaseLayerPSCompatibilityFlag (Int layer, Int val)               { m_baseLayerPSCompatibilityFlag[layer] = val;        }
     1068  Int               getBaseLayerPSCompatibilityFlag (Int layer) const                  { return m_baseLayerPSCompatibilityFlag[layer];       }
     1069  Bool              getAltOuputLayerFlag(Int idx) const                                { return m_altOutputLayerFlag[idx];                   }
     1070  Void              setAltOuputLayerFlag(Int idx, Bool x)                              { m_altOutputLayerFlag[idx] = x;                      }
     1071
     1072  Bool              getRepFormatIdxPresentFlag() const                                 { return m_repFormatIdxPresentFlag;                   }
     1073  Void              setRepFormatIdxPresentFlag(Bool x)                                 { m_repFormatIdxPresentFlag = x;                      }
     1074
     1075  Int               getVpsNumRepFormats() const                                        { return m_vpsNumRepFormats;                          }
     1076  Void              setVpsNumRepFormats(Int x)                                         { m_vpsNumRepFormats = x;                             }
     1077
     1078  RepFormat*        getVpsRepFormat(Int idx)                                           { return &m_vpsRepFormat[idx];                        }
     1079  const RepFormat*  getVpsRepFormat(Int idx) const                                     { return &m_vpsRepFormat[idx];                        }
     1080
     1081  Int               getVpsRepFormatIdx(Int idx) const                                  { return m_vpsRepFormatIdx[idx];                      }
     1082  Void              setVpsRepFormatIdx(Int idx, Int x)                                 { m_vpsRepFormatIdx[idx] = x;                         }         
     1083
     1084  Void              setViewIdLen( Int  val )                                           { m_viewIdLen = val;                                  }
     1085  Int               getViewIdLen() const                                               { return m_viewIdLen;                                 }
     1086
     1087  Void              setViewIdVal( Int viewOrderIndex, Int  val )                       { m_viewIdVal[viewOrderIndex] = val;                  }
     1088  Int               getViewIdVal( Int viewOrderIndex ) const                           { return m_viewIdVal[viewOrderIndex];                 }
     1089  Int               getScalabilityId(Int, ScalabilityType scalType ) const;
     1090
     1091  Int               getViewIndex( Int layerIdInNuh ) const                             { return getScalabilityId( getLayerIdxInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
     1092
     1093  Int               getNumViews() const;
     1094  Int               scalTypeToScalIdx( ScalabilityType scalType ) const;
     1095
     1096  Bool              getSubLayerFlagInfoPresentFlag(Int olsIdx) const                   { return m_subLayerFlagInfoPresentFlag[olsIdx];       }
     1097  Void              setSubLayerFlagInfoPresentFlag(Int olsIdx, Bool x)                 { m_subLayerFlagInfoPresentFlag[olsIdx] = x;          }
     1098
     1099  Bool              getSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx) const   { return m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx]; }
     1100  Void              setSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx, Bool x) { m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx] = x;    }
    10811101
    10821102  // For the 0-th output layer set, use the date from the active SPS for base layer.
    1083   Int    getMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx)        { assert(olsIdx != 0); return m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx]; }
    1084   Void   setMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx, Int x) { m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx] = x;    }
    1085   Int    getLayerIdcForOls( Int olsIdx, Int layerId );
    1086 
    1087   Int    getMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx)        { assert(olsIdx != 0); return m_maxVpsNumReorderPics[olsIdx][subLayerIdx]; }
    1088   Void   setMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsNumReorderPics[olsIdx][subLayerIdx] = x;    }
    1089 
    1090   Int    getMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx)        { assert(olsIdx != 0); return m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx]; }
    1091   Void   setMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx] = x;    }
    1092 
    1093   Int    getNumSubDpbs(Int olsIdx)                          { return m_numSubDpbs[olsIdx]; }
    1094   Void   setNumSubDpbs(Int olsIdx, Int x)                   { m_numSubDpbs[olsIdx] = x;    }
    1095   Void   determineSubDpbInfoFlags();
    1096 
    1097   Bool   getVpsVuiPresentFlag()                        { return m_vpsVuiPresentFlag; }
    1098   Void   setVpsVuiPresentFlag(Bool x)                  { m_vpsVuiPresentFlag = x;    }
    1099   Bool   getVpsExtensionFlag()                         { return m_vpsExtensionFlag;  }
    1100   Void   setVpsExtensionFlag(Bool x)                   { m_vpsExtensionFlag = x;     }
    1101   Int    getVpsNonVuiExtLength()                       { return m_vpsNonVuiExtLength; }
    1102   Void   setVpsNonVuiExtLength(Int x)                  { m_vpsNonVuiExtLength = x; }
     1103  Int               getMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx) const  { assert(olsIdx != 0); return m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx]; }
     1104  Void              setMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx, Int x) { m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx] = x;    }
     1105  Int               getLayerIdcForOls( Int olsIdx, Int layerId ) const;
     1106
     1107  Int               getMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx) const         { assert(olsIdx != 0); return m_maxVpsNumReorderPics[olsIdx][subLayerIdx]; }
     1108  Void              setMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx, Int x)        { m_maxVpsNumReorderPics[olsIdx][subLayerIdx] = x;    }
     1109
     1110  Int               getMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx) const   { assert(olsIdx != 0); return m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx]; }
     1111  Void              setMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx] = x;    }
     1112
     1113  Int               getNumSubDpbs(Int olsIdx) const                                    { return m_numSubDpbs[olsIdx];                      }
     1114  Void              setNumSubDpbs(Int olsIdx, Int x)                                   { m_numSubDpbs[olsIdx] = x;                          }
     1115  Void              determineSubDpbInfoFlags();
     1116
     1117  Bool              getVpsVuiPresentFlag() const                                       { return m_vpsVuiPresentFlag;                        }
     1118  Void              setVpsVuiPresentFlag(Bool x)                                       { m_vpsVuiPresentFlag = x;                           }
     1119  Bool              getVpsExtensionFlag() const                                        { return m_vpsExtensionFlag;                         }
     1120  Void              setVpsExtensionFlag(Bool x)                                        { m_vpsExtensionFlag = x;                            }
     1121  Int               getVpsNonVuiExtLength() const                                      { return m_vpsNonVuiExtLength;                      }
     1122  Void              setVpsNonVuiExtLength(Int x)                                       { m_vpsNonVuiExtLength = x;                          }
    11031123#if O0164_MULTI_LAYER_HRD
    1104   Void   setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess );
    1105 #endif
    1106   Void   deriveNecessaryLayerFlag();
    1107   Void   deriveNecessaryLayerFlag(Int const olsIdx);
    1108   Void   checkNecessaryLayerFlagCondition();
    1109   Void   calculateMaxSLInLayerSets();
     1124  Void              setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess );
     1125#endif
     1126  Void              deriveNecessaryLayerFlag();
     1127  Void              deriveNecessaryLayerFlag(Int const olsIdx);
     1128  Void              checkNecessaryLayerFlagCondition();
     1129  Void              calculateMaxSLInLayerSets();
     1130
     1131  ChromaFormat      getChromaFormatIdc( const TComSPS* sps, const UInt layerId ) const;
     1132  UInt              getPicHeightInLumaSamples( const TComSPS* sps, const UInt layerId ) const;
     1133  UInt              getPicWidthInLumaSamples( const TComSPS* sps, const UInt layerId ) const;
     1134  UInt              getBitDepthY( const TComSPS* sps, const UInt layerId ) const;
     1135  UInt              getBitDepthC( const TComSPS* sps, const UInt layerId ) const;
     1136  const Window&     getConformanceWindow( const TComSPS* sps, const UInt layerId ) const;
    11101137#endif //SVC_EXTENSION
    11111138};
     
    11141141{
    11151142private:
    1116   Bool m_aspectRatioInfoPresentFlag;
    1117   Int  m_aspectRatioIdc;
    1118   Int  m_sarWidth;
    1119   Int  m_sarHeight;
    1120   Bool m_overscanInfoPresentFlag;
    1121   Bool m_overscanAppropriateFlag;
    1122   Bool m_videoSignalTypePresentFlag;
    1123   Int  m_videoFormat;
    1124   Bool m_videoFullRangeFlag;
    1125   Bool m_colourDescriptionPresentFlag;
    1126   Int  m_colourPrimaries;
    1127   Int  m_transferCharacteristics;
    1128   Int  m_matrixCoefficients;
    1129   Bool m_chromaLocInfoPresentFlag;
    1130   Int  m_chromaSampleLocTypeTopField;
    1131   Int  m_chromaSampleLocTypeBottomField;
    1132   Bool m_neutralChromaIndicationFlag;
    1133   Bool m_fieldSeqFlag;
    1134   Window m_defaultDisplayWindow;
    1135   Bool m_frameFieldInfoPresentFlag;
    1136   Bool m_hrdParametersPresentFlag;
    1137   Bool m_bitstreamRestrictionFlag;
    1138   Bool m_tilesFixedStructureFlag;
    1139   Bool m_motionVectorsOverPicBoundariesFlag;
    1140   Bool m_restrictedRefPicListsFlag;
    1141   Int  m_minSpatialSegmentationIdc;
    1142   Int  m_maxBytesPerPicDenom;
    1143   Int  m_maxBitsPerMinCuDenom;
    1144   Int  m_log2MaxMvLengthHorizontal;
    1145   Int  m_log2MaxMvLengthVertical;
    1146   TComHRD m_hrdParameters;
     1143  Bool       m_aspectRatioInfoPresentFlag;
     1144  Int        m_aspectRatioIdc;
     1145  Int        m_sarWidth;
     1146  Int        m_sarHeight;
     1147  Bool       m_overscanInfoPresentFlag;
     1148  Bool       m_overscanAppropriateFlag;
     1149  Bool       m_videoSignalTypePresentFlag;
     1150  Int        m_videoFormat;
     1151  Bool       m_videoFullRangeFlag;
     1152  Bool       m_colourDescriptionPresentFlag;
     1153  Int        m_colourPrimaries;
     1154  Int        m_transferCharacteristics;
     1155  Int        m_matrixCoefficients;
     1156  Bool       m_chromaLocInfoPresentFlag;
     1157  Int        m_chromaSampleLocTypeTopField;
     1158  Int        m_chromaSampleLocTypeBottomField;
     1159  Bool       m_neutralChromaIndicationFlag;
     1160  Bool       m_fieldSeqFlag;
     1161  Window     m_defaultDisplayWindow;
     1162  Bool       m_frameFieldInfoPresentFlag;
     1163  Bool       m_hrdParametersPresentFlag;
     1164  Bool       m_bitstreamRestrictionFlag;
     1165  Bool       m_tilesFixedStructureFlag;
     1166  Bool       m_motionVectorsOverPicBoundariesFlag;
     1167  Bool       m_restrictedRefPicListsFlag;
     1168  Int        m_minSpatialSegmentationIdc;
     1169  Int        m_maxBytesPerPicDenom;
     1170  Int        m_maxBitsPerMinCuDenom;
     1171  Int        m_log2MaxMvLengthHorizontal;
     1172  Int        m_log2MaxMvLengthVertical;
     1173  TComHRD    m_hrdParameters;
    11471174  TimingInfo m_timingInfo;
    11481175
    11491176public:
    11501177  TComVUI()
    1151     :m_aspectRatioInfoPresentFlag(false) //TODO: This initialiser list contains magic numbers
    1152     ,m_aspectRatioIdc(0)
    1153     ,m_sarWidth(0)
    1154     ,m_sarHeight(0)
    1155     ,m_overscanInfoPresentFlag(false)
    1156     ,m_overscanAppropriateFlag(false)
    1157     ,m_videoSignalTypePresentFlag(false)
    1158     ,m_videoFormat(5)
    1159     ,m_videoFullRangeFlag(false)
    1160     ,m_colourDescriptionPresentFlag(false)
    1161     ,m_colourPrimaries(2)
    1162     ,m_transferCharacteristics(2)
    1163     ,m_matrixCoefficients(2)
    1164     ,m_chromaLocInfoPresentFlag(false)
    1165     ,m_chromaSampleLocTypeTopField(0)
    1166     ,m_chromaSampleLocTypeBottomField(0)
    1167     ,m_neutralChromaIndicationFlag(false)
    1168     ,m_fieldSeqFlag(false)
    1169     ,m_frameFieldInfoPresentFlag(false)
    1170     ,m_hrdParametersPresentFlag(false)
    1171     ,m_bitstreamRestrictionFlag(false)
    1172     ,m_tilesFixedStructureFlag(false)
    1173     ,m_motionVectorsOverPicBoundariesFlag(true)
    1174     ,m_restrictedRefPicListsFlag(1)
    1175     ,m_minSpatialSegmentationIdc(0)
    1176     ,m_maxBytesPerPicDenom(2)
    1177     ,m_maxBitsPerMinCuDenom(1)
    1178     ,m_log2MaxMvLengthHorizontal(15)
    1179     ,m_log2MaxMvLengthVertical(15)
    1180   {}
    1181 
    1182   virtual ~TComVUI() {}
    1183 
    1184   Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; }
    1185   Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; }
    1186 
    1187   Int getAspectRatioIdc() { return m_aspectRatioIdc; }
    1188   Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; }
    1189 
    1190   Int getSarWidth() { return m_sarWidth; }
    1191   Void setSarWidth(Int i) { m_sarWidth = i; }
    1192 
    1193   Int getSarHeight() { return m_sarHeight; }
    1194   Void setSarHeight(Int i) { m_sarHeight = i; }
    1195 
    1196   Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; }
    1197   Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; }
    1198 
    1199   Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; }
    1200   Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; }
    1201 
    1202   Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; }
    1203   Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; }
    1204 
    1205   Int getVideoFormat() { return m_videoFormat; }
    1206   Void setVideoFormat(Int i) { m_videoFormat = i; }
    1207 
    1208   Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; }
    1209   Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; }
    1210 
    1211   Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; }
    1212   Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; }
    1213 
    1214   Int getColourPrimaries() { return m_colourPrimaries; }
    1215   Void setColourPrimaries(Int i) { m_colourPrimaries = i; }
    1216 
    1217   Int getTransferCharacteristics() { return m_transferCharacteristics; }
    1218   Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; }
    1219 
    1220   Int getMatrixCoefficients() { return m_matrixCoefficients; }
    1221   Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; }
    1222 
    1223   Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; }
    1224   Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; }
    1225 
    1226   Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; }
    1227   Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; }
    1228 
    1229   Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; }
    1230   Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; }
    1231 
    1232   Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; }
    1233   Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; }
    1234 
    1235   Bool getFieldSeqFlag() { return m_fieldSeqFlag; }
    1236   Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; }
    1237 
    1238   Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; }
    1239   Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; }
    1240 
    1241   Window& getDefaultDisplayWindow()                              { return m_defaultDisplayWindow;                }
    1242   Void    setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; }
    1243 
    1244   Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; }
    1245   Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; }
    1246 
    1247   Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; }
    1248   Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; }
    1249 
    1250   Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; }
    1251   Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; }
    1252 
    1253   Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; }
    1254   Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; }
    1255 
    1256   Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; }
    1257   Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; }
    1258 
    1259   Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; }
    1260   Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; }
    1261 
    1262   Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; }
    1263   Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; }
    1264 
    1265   Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; }
    1266   Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; }
    1267 
    1268   Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; }
    1269   Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; }
    1270 
    1271   Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; }
    1272   Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; }
    1273 
    1274   TComHRD* getHrdParameters                 ()             { return &m_hrdParameters; }
    1275 
    1276   TimingInfo* getTimingInfo() { return &m_timingInfo; }
     1178    : m_aspectRatioInfoPresentFlag        (false) //TODO: This initialiser list contains magic numbers
     1179    , m_aspectRatioIdc                    (0)
     1180    , m_sarWidth                          (0)
     1181    , m_sarHeight                         (0)
     1182    , m_overscanInfoPresentFlag           (false)
     1183    , m_overscanAppropriateFlag           (false)
     1184    , m_videoSignalTypePresentFlag        (false)
     1185    , m_videoFormat                       (5)
     1186    , m_videoFullRangeFlag                (false)
     1187    , m_colourDescriptionPresentFlag      (false)
     1188    , m_colourPrimaries                   (2)
     1189    , m_transferCharacteristics           (2)
     1190    , m_matrixCoefficients                (2)
     1191    , m_chromaLocInfoPresentFlag          (false)
     1192    , m_chromaSampleLocTypeTopField       (0)
     1193    , m_chromaSampleLocTypeBottomField    (0)
     1194    , m_neutralChromaIndicationFlag       (false)
     1195    , m_fieldSeqFlag                      (false)
     1196    , m_frameFieldInfoPresentFlag         (false)
     1197    , m_hrdParametersPresentFlag          (false)
     1198    , m_bitstreamRestrictionFlag          (false)
     1199    , m_tilesFixedStructureFlag           (false)
     1200    , m_motionVectorsOverPicBoundariesFlag(true)
     1201    , m_restrictedRefPicListsFlag         (1)
     1202    , m_minSpatialSegmentationIdc         (0)
     1203    , m_maxBytesPerPicDenom               (2)
     1204    , m_maxBitsPerMinCuDenom              (1)
     1205    , m_log2MaxMvLengthHorizontal         (15)
     1206    , m_log2MaxMvLengthVertical           (15)
     1207 {}
     1208
     1209  virtual           ~TComVUI() {}
     1210
     1211  Bool              getAspectRatioInfoPresentFlag() const                  { return m_aspectRatioInfoPresentFlag;           }
     1212  Void              setAspectRatioInfoPresentFlag(Bool i)                  { m_aspectRatioInfoPresentFlag = i;              }
     1213
     1214  Int               getAspectRatioIdc() const                              { return m_aspectRatioIdc;                       }
     1215  Void              setAspectRatioIdc(Int i)                               { m_aspectRatioIdc = i;                          }
     1216
     1217  Int               getSarWidth() const                                    { return m_sarWidth;                             }
     1218  Void              setSarWidth(Int i)                                     { m_sarWidth = i;                                }
     1219
     1220  Int               getSarHeight() const                                   { return m_sarHeight;                            }
     1221  Void              setSarHeight(Int i)                                    { m_sarHeight = i;                               }
     1222
     1223  Bool              getOverscanInfoPresentFlag() const                     { return m_overscanInfoPresentFlag;              }
     1224  Void              setOverscanInfoPresentFlag(Bool i)                     { m_overscanInfoPresentFlag = i;                 }
     1225
     1226  Bool              getOverscanAppropriateFlag() const                     { return m_overscanAppropriateFlag;              }
     1227  Void              setOverscanAppropriateFlag(Bool i)                     { m_overscanAppropriateFlag = i;                 }
     1228
     1229  Bool              getVideoSignalTypePresentFlag() const                  { return m_videoSignalTypePresentFlag;           }
     1230  Void              setVideoSignalTypePresentFlag(Bool i)                  { m_videoSignalTypePresentFlag = i;              }
     1231
     1232  Int               getVideoFormat() const                                 { return m_videoFormat;                          }
     1233  Void              setVideoFormat(Int i)                                  { m_videoFormat = i;                             }
     1234
     1235  Bool              getVideoFullRangeFlag() const                          { return m_videoFullRangeFlag;                   }
     1236  Void              setVideoFullRangeFlag(Bool i)                          { m_videoFullRangeFlag = i;                      }
     1237
     1238  Bool              getColourDescriptionPresentFlag() const                { return m_colourDescriptionPresentFlag;         }
     1239  Void              setColourDescriptionPresentFlag(Bool i)                { m_colourDescriptionPresentFlag = i;            }
     1240
     1241  Int               getColourPrimaries() const                             { return m_colourPrimaries;                      }
     1242  Void              setColourPrimaries(Int i)                              { m_colourPrimaries = i;                         }
     1243
     1244  Int               getTransferCharacteristics() const                     { return m_transferCharacteristics;              }
     1245  Void              setTransferCharacteristics(Int i)                      { m_transferCharacteristics = i;                 }
     1246
     1247  Int               getMatrixCoefficients() const                          { return m_matrixCoefficients;                   }
     1248  Void              setMatrixCoefficients(Int i)                           { m_matrixCoefficients = i;                      }
     1249
     1250  Bool              getChromaLocInfoPresentFlag() const                    { return m_chromaLocInfoPresentFlag;             }
     1251  Void              setChromaLocInfoPresentFlag(Bool i)                    { m_chromaLocInfoPresentFlag = i;                }
     1252
     1253  Int               getChromaSampleLocTypeTopField() const                 { return m_chromaSampleLocTypeTopField;          }
     1254  Void              setChromaSampleLocTypeTopField(Int i)                  { m_chromaSampleLocTypeTopField = i;             }
     1255
     1256  Int               getChromaSampleLocTypeBottomField() const              { return m_chromaSampleLocTypeBottomField;       }
     1257  Void              setChromaSampleLocTypeBottomField(Int i)               { m_chromaSampleLocTypeBottomField = i;          }
     1258
     1259  Bool              getNeutralChromaIndicationFlag() const                 { return m_neutralChromaIndicationFlag;          }
     1260  Void              setNeutralChromaIndicationFlag(Bool i)                 { m_neutralChromaIndicationFlag = i;             }
     1261
     1262  Bool              getFieldSeqFlag() const                                { return m_fieldSeqFlag;                         }
     1263  Void              setFieldSeqFlag(Bool i)                                { m_fieldSeqFlag = i;                            }
     1264
     1265  Bool              getFrameFieldInfoPresentFlag() const                   { return m_frameFieldInfoPresentFlag;            }
     1266  Void              setFrameFieldInfoPresentFlag(Bool i)                   { m_frameFieldInfoPresentFlag = i;               }
     1267
     1268  Window&           getDefaultDisplayWindow()                              { return m_defaultDisplayWindow;                 }
     1269  const Window&     getDefaultDisplayWindow() const                        { return m_defaultDisplayWindow;                 }
     1270  Void              setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; }
     1271
     1272  Bool              getHrdParametersPresentFlag() const                    { return m_hrdParametersPresentFlag;             }
     1273  Void              setHrdParametersPresentFlag(Bool i)                    { m_hrdParametersPresentFlag = i;                }
     1274
     1275  Bool              getBitstreamRestrictionFlag() const                    { return m_bitstreamRestrictionFlag;             }
     1276  Void              setBitstreamRestrictionFlag(Bool i)                    { m_bitstreamRestrictionFlag = i;                }
     1277
     1278  Bool              getTilesFixedStructureFlag() const                     { return m_tilesFixedStructureFlag;              }
     1279  Void              setTilesFixedStructureFlag(Bool i)                     { m_tilesFixedStructureFlag = i;                 }
     1280
     1281  Bool              getMotionVectorsOverPicBoundariesFlag() const          { return m_motionVectorsOverPicBoundariesFlag;   }
     1282  Void              setMotionVectorsOverPicBoundariesFlag(Bool i)          { m_motionVectorsOverPicBoundariesFlag = i;      }
     1283
     1284  Bool              getRestrictedRefPicListsFlag() const                   { return m_restrictedRefPicListsFlag;            }
     1285  Void              setRestrictedRefPicListsFlag(Bool b)                   { m_restrictedRefPicListsFlag = b;               }
     1286
     1287  Int               getMinSpatialSegmentationIdc() const                   { return m_minSpatialSegmentationIdc;            }
     1288  Void              setMinSpatialSegmentationIdc(Int i)                    { m_minSpatialSegmentationIdc = i;               }
     1289
     1290  Int               getMaxBytesPerPicDenom() const                         { return m_maxBytesPerPicDenom;                  }
     1291  Void              setMaxBytesPerPicDenom(Int i)                          { m_maxBytesPerPicDenom = i;                     }
     1292
     1293  Int               getMaxBitsPerMinCuDenom() const                        { return m_maxBitsPerMinCuDenom;                 }
     1294  Void              setMaxBitsPerMinCuDenom(Int i)                         { m_maxBitsPerMinCuDenom = i;                    }
     1295
     1296  Int               getLog2MaxMvLengthHorizontal() const                   { return m_log2MaxMvLengthHorizontal;            }
     1297  Void              setLog2MaxMvLengthHorizontal(Int i)                    { m_log2MaxMvLengthHorizontal = i;               }
     1298
     1299  Int               getLog2MaxMvLengthVertical() const                     { return m_log2MaxMvLengthVertical;              }
     1300  Void              setLog2MaxMvLengthVertical(Int i)                      { m_log2MaxMvLengthVertical = i;                 }
     1301
     1302  TComHRD*          getHrdParameters()                                     { return &m_hrdParameters;                       }
     1303  const TComHRD*    getHrdParameters()  const                              { return &m_hrdParameters;                       }
     1304
     1305  TimingInfo*       getTimingInfo()                                        { return &m_timingInfo;                          }
     1306  const TimingInfo* getTimingInfo() const                                  { return &m_timingInfo;                          }
    12771307};
    12781308
     
    12811311{
    12821312private:
    1283   Int          m_SPSId;
    1284   Int          m_VPSId;
    1285   ChromaFormat m_chromaFormatIdc;
    1286 
    1287   UInt        m_uiMaxTLayers;           // maximum number of temporal layers
     1313  Int              m_SPSId;
     1314  Int              m_VPSId;
     1315  ChromaFormat     m_chromaFormatIdc;
     1316
     1317  UInt             m_uiMaxTLayers;           // maximum number of temporal layers
    12881318
    12891319  // Structure
    1290   UInt        m_picWidthInLumaSamples;
    1291   UInt        m_picHeightInLumaSamples;
    1292 
    1293   Int         m_log2MinCodingBlockSize;
    1294   Int         m_log2DiffMaxMinCodingBlockSize;
    1295   UInt        m_uiMaxCUWidth;
    1296   UInt        m_uiMaxCUHeight;
    1297   UInt        m_uiMaxCUDepth;
    1298 
    1299   Window      m_conformanceWindow;
    1300 
    1301   TComRPSList m_RPSList;
    1302   Bool        m_bLongTermRefsPresent;
    1303   Bool        m_TMVPFlagsPresent;
    1304   Int         m_numReorderPics[MAX_TLAYER];
     1320  UInt             m_picWidthInLumaSamples;
     1321  UInt             m_picHeightInLumaSamples;
     1322
     1323  Int              m_log2MinCodingBlockSize;
     1324  Int              m_log2DiffMaxMinCodingBlockSize;
     1325  UInt             m_uiMaxCUWidth;
     1326  UInt             m_uiMaxCUHeight;
     1327  UInt             m_uiMaxCUDepth;
     1328
     1329  Window           m_conformanceWindow;
     1330
     1331  TComRPSList      m_RPSList;
     1332  Bool             m_bLongTermRefsPresent;
     1333  Bool             m_TMVPFlagsPresent;
     1334  Int              m_numReorderPics[MAX_TLAYER];
    13051335
    13061336  // Tool list
    1307   UInt        m_uiQuadtreeTULog2MaxSize;
    1308   UInt        m_uiQuadtreeTULog2MinSize;
    1309   UInt        m_uiQuadtreeTUMaxDepthInter;
    1310   UInt        m_uiQuadtreeTUMaxDepthIntra;
    1311   Bool        m_usePCM;
    1312   UInt        m_pcmLog2MaxSize;
    1313   UInt        m_uiPCMLog2MinSize;
    1314   Bool        m_useAMP;
     1337  UInt             m_uiQuadtreeTULog2MaxSize;
     1338  UInt             m_uiQuadtreeTULog2MinSize;
     1339  UInt             m_uiQuadtreeTUMaxDepthInter;
     1340  UInt             m_uiQuadtreeTUMaxDepthIntra;
     1341  Bool             m_usePCM;
     1342  UInt             m_pcmLog2MaxSize;
     1343  UInt             m_uiPCMLog2MinSize;
     1344  Bool             m_useAMP;
    13151345
    13161346  // Parameter
    1317   Int         m_uiBitDepth[MAX_NUM_CHANNEL_TYPE];
    1318   Int         m_qpBDOffset[MAX_NUM_CHANNEL_TYPE];
    1319   Bool        m_useExtendedPrecision;
    1320   Bool        m_useHighPrecisionPredictionWeighting;
    1321   Bool        m_useResidualRotation;
    1322   Bool        m_useSingleSignificanceMapContext;
    1323   Bool        m_useGolombRiceParameterAdaptation;
    1324   Bool        m_alignCABACBeforeBypass;
    1325   Bool        m_useResidualDPCM[NUMBER_OF_RDPCM_SIGNALLING_MODES];
    1326   UInt        m_uiPCMBitDepth[MAX_NUM_CHANNEL_TYPE];
    1327   Bool        m_bPCMFilterDisableFlag;
    1328   Bool        m_disableIntraReferenceSmoothing;
    1329 
    1330   UInt        m_uiBitsForPOC;
    1331   UInt        m_numLongTermRefPicSPS;
    1332   UInt        m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
    1333   Bool        m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS];
     1347  Int              m_uiBitDepth[MAX_NUM_CHANNEL_TYPE];
     1348  Int              m_qpBDOffset[MAX_NUM_CHANNEL_TYPE];
     1349  Bool             m_useExtendedPrecision;
     1350  Bool             m_useHighPrecisionPredictionWeighting;
     1351  Bool             m_useResidualRotation;
     1352  Bool             m_useSingleSignificanceMapContext;
     1353  Bool             m_useGolombRiceParameterAdaptation;
     1354  Bool             m_alignCABACBeforeBypass;
     1355  Bool             m_useResidualDPCM[NUMBER_OF_RDPCM_SIGNALLING_MODES];
     1356  UInt             m_uiPCMBitDepth[MAX_NUM_CHANNEL_TYPE];
     1357  Bool             m_bPCMFilterDisableFlag;
     1358  Bool             m_disableIntraReferenceSmoothing;
     1359
     1360  UInt             m_uiBitsForPOC;
     1361  UInt             m_numLongTermRefPicSPS;
     1362  UInt             m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS];
     1363  Bool             m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS];
    13341364  // Max physical transform size
    1335   UInt        m_uiMaxTrSize;
    1336 
    1337   Int m_iAMPAcc[MAX_CU_DEPTH];
    1338   Bool        m_bUseSAO;
    1339 
    1340   Bool        m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
    1341 
    1342   Bool        m_scalingListEnabledFlag;
    1343   Bool        m_scalingListPresentFlag;
    1344   TComScalingList*     m_scalingList;   //!< ScalingList class pointer
    1345   UInt        m_uiMaxDecPicBuffering[MAX_TLAYER];
    1346   UInt        m_uiMaxLatencyIncrease[MAX_TLAYER];  // Really max latency increase plus 1 (value 0 expresses no limit)
    1347 
    1348   Bool        m_useDF;
    1349   Bool        m_useStrongIntraSmoothing;
    1350 
    1351   Bool        m_vuiParametersPresentFlag;
    1352   TComVUI     m_vuiParameters;
    1353 
    1354   static const Int   m_winUnitX[MAX_CHROMA_FORMAT_IDC+1];
    1355   static const Int   m_winUnitY[MAX_CHROMA_FORMAT_IDC+1];
    1356   TComPTL     m_pcPTL;
     1365  UInt             m_uiMaxTrSize;
     1366
     1367  Bool             m_bUseSAO;
     1368
     1369  Bool             m_bTemporalIdNestingFlag; // temporal_id_nesting_flag
     1370
     1371  Bool             m_scalingListEnabledFlag;
     1372  Bool             m_scalingListPresentFlag;
     1373  TComScalingList  m_scalingList;
     1374  UInt             m_uiMaxDecPicBuffering[MAX_TLAYER];
     1375  UInt             m_uiMaxLatencyIncrease[MAX_TLAYER];  // Really max latency increase plus 1 (value 0 expresses no limit)
     1376
     1377  Bool             m_useStrongIntraSmoothing;
     1378
     1379  Bool             m_vuiParametersPresentFlag;
     1380  TComVUI          m_vuiParameters;
     1381
     1382  static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1];
     1383  static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1];
     1384  TComPTL          m_pcPTL;
    13571385
    13581386#if O0043_BEST_EFFORT_DECODING
    1359   UInt        m_forceDecodeBitDepth; // 0 = do not force the decoder's bit depth, other = force the decoder's bit depth to this value (best effort decoding)
     1387  UInt             m_forceDecodeBitDepth; // 0 = do not force the decoder's bit depth, other = force the decoder's bit depth to this value (best effort decoding)
    13601388#endif
    13611389
    13621390#if SVC_EXTENSION
    1363   UInt        m_layerId;
    1364   Bool        m_extensionFlag;
    1365   Bool        m_bV1CompatibleSPSFlag;
    1366   UInt        m_numScaledRefLayerOffsets;
    1367   Bool        m_multiLayerExtSpsFlag;
    1368   Int         m_NumDirectRefLayers;
    1369   Bool        m_updateRepFormatFlag;
    1370   UInt        m_updateRepFormatIndex;
    1371   Bool        m_inferScalingListFlag;
    1372   UInt        m_scalingListRefLayerId;
     1391  UInt             m_layerId;
     1392  Bool             m_extensionFlag;
     1393  Bool             m_bV1CompatibleSPSFlag;
     1394  UInt             m_numScaledRefLayerOffsets;
     1395  Bool             m_multiLayerExtSpsFlag;
     1396  Int              m_NumDirectRefLayers;
     1397  Bool             m_updateRepFormatFlag;
     1398  UInt             m_updateRepFormatIndex;
     1399  Bool             m_inferScalingListFlag;
     1400  UInt             m_scalingListRefLayerId;
    13731401#endif //SVC_EXTENSION
    13741402
    13751403public:
    1376   TComSPS();
    1377   virtual ~TComSPS();
     1404                         TComSPS();
     1405  virtual                ~TComSPS();
    13781406#if O0043_BEST_EFFORT_DECODING
    1379   Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; }
    1380   UInt getForceDecodeBitDepth()        const { return m_forceDecodeBitDepth;     }
    1381 #endif
    1382 
    1383   Int  getVPSId       ()         { return m_VPSId;          }
    1384   Void setVPSId       (Int i)    { m_VPSId = i;             }
    1385   Int  getSPSId       ()         { return m_SPSId;          }
    1386   Void setSPSId       (Int i)    { m_SPSId = i;             }
    1387   ChromaFormat  getChromaFormatIdc ()         { return m_chromaFormatIdc;       }
    1388   Void setChromaFormatIdc (ChromaFormat i)    { m_chromaFormatIdc = i;          }
    1389 
    1390   static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc];      }
    1391   static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc];      }
     1407  Void                   setForceDecodeBitDepth(UInt bitDepth)                                           { m_forceDecodeBitDepth = bitDepth;                                    }
     1408  UInt                   getForceDecodeBitDepth()        const                                           { return m_forceDecodeBitDepth;                                        }
     1409#endif
     1410
     1411  Int                    getVPSId() const                                                                { return m_VPSId;                                                      }
     1412  Void                   setVPSId(Int i)                                                                 { m_VPSId = i;                                                         }
     1413  Int                    getSPSId() const                                                                { return m_SPSId;                                                      }
     1414  Void                   setSPSId(Int i)                                                                 { m_SPSId = i;                                                         }
     1415  ChromaFormat           getChromaFormatIdc () const                                                     { return m_chromaFormatIdc;                                            }
     1416  Void                   setChromaFormatIdc (ChromaFormat i)                                             { m_chromaFormatIdc = i;                                               }
     1417
     1418  static Int             getWinUnitX (Int chromaFormatIdc)                                               { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; }
     1419  static Int             getWinUnitY (Int chromaFormatIdc)                                               { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; }
    13921420
    13931421  // structure
    1394   Void setPicWidthInLumaSamples       ( UInt u ) { m_picWidthInLumaSamples = u;        }
    1395   UInt getPicWidthInLumaSamples       ()         { return  m_picWidthInLumaSamples;    }
    1396   Void setPicHeightInLumaSamples      ( UInt u ) { m_picHeightInLumaSamples = u;       }
    1397   UInt getPicHeightInLumaSamples      ()         { return  m_picHeightInLumaSamples;   }
    1398 
    1399   Window& getConformanceWindow()                           { return  m_conformanceWindow;             }
    1400   Void    setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; }
    1401 
    1402   UInt  getNumLongTermRefPicSPS()             { return m_numLongTermRefPicSPS; }
    1403   Void  setNumLongTermRefPicSPS(UInt val)     { m_numLongTermRefPicSPS = val; }
    1404 
    1405   UInt  getLtRefPicPocLsbSps(UInt index)             { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); return m_ltRefPicPocLsbSps[index]; }
    1406   Void  setLtRefPicPocLsbSps(UInt index, UInt val)   { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); m_ltRefPicPocLsbSps[index] = val; }
    1407 
    1408   Bool getUsedByCurrPicLtSPSFlag(Int i)              { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); return m_usedByCurrPicLtSPSFlag[i];}
    1409   Void setUsedByCurrPicLtSPSFlag(Int i, Bool x)      { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); m_usedByCurrPicLtSPSFlag[i] = x;}
    1410 
    1411   Int  getLog2MinCodingBlockSize() const           { return m_log2MinCodingBlockSize; }
    1412   Void setLog2MinCodingBlockSize(Int val)          { m_log2MinCodingBlockSize = val; }
    1413   Int  getLog2DiffMaxMinCodingBlockSize() const    { return m_log2DiffMaxMinCodingBlockSize; }
    1414   Void setLog2DiffMaxMinCodingBlockSize(Int val)   { m_log2DiffMaxMinCodingBlockSize = val; }
    1415 
    1416   Void setMaxCUWidth  ( UInt u ) { m_uiMaxCUWidth = u;      }
    1417   UInt getMaxCUWidth  ()         { return  m_uiMaxCUWidth;  }
    1418   Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u;     }
    1419   UInt getMaxCUHeight ()         { return  m_uiMaxCUHeight; }
    1420   Void setMaxCUDepth  ( UInt u ) { m_uiMaxCUDepth = u;      }
    1421   UInt getMaxCUDepth  ()         { return  m_uiMaxCUDepth;  }
    1422   Void setUsePCM      ( Bool b ) { m_usePCM = b;           }
    1423   Bool getUsePCM      ()         { return m_usePCM;        }
    1424   Void setPCMLog2MaxSize  ( UInt u ) { m_pcmLog2MaxSize = u;      }
    1425   UInt getPCMLog2MaxSize  ()         { return  m_pcmLog2MaxSize;  }
    1426   Void setPCMLog2MinSize  ( UInt u ) { m_uiPCMLog2MinSize = u;      }
    1427   UInt getPCMLog2MinSize  ()         { return  m_uiPCMLog2MinSize;  }
    1428   Void setBitsForPOC  ( UInt u ) { m_uiBitsForPOC = u;      }
    1429   UInt getBitsForPOC  ()         { return m_uiBitsForPOC;   }
    1430   Bool getUseAMP() { return m_useAMP; }
    1431   Void setUseAMP( Bool b ) { m_useAMP = b; }
    1432   Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u;    }
    1433   UInt getQuadtreeTULog2MaxSize()         { return m_uiQuadtreeTULog2MaxSize; }
    1434   Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u;    }
    1435   UInt getQuadtreeTULog2MinSize()         { return m_uiQuadtreeTULog2MinSize; }
    1436   Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u;    }
    1437   Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u;    }
    1438   UInt getQuadtreeTUMaxDepthInter()         { return m_uiQuadtreeTUMaxDepthInter; }
    1439   UInt getQuadtreeTUMaxDepthIntra()         { return m_uiQuadtreeTUMaxDepthIntra; }
    1440   Void setNumReorderPics(Int i, UInt tlayer)              { m_numReorderPics[tlayer] = i;    }
    1441   Int  getNumReorderPics(UInt tlayer)                     { return m_numReorderPics[tlayer]; }
    1442   Void         createRPSList( Int numRPS );
    1443   TComRPSList* getRPSList()                      { return &m_RPSList;          }
    1444   Bool      getLongTermRefsPresent()         { return m_bLongTermRefsPresent; }
    1445   Void      setLongTermRefsPresent(Bool b)   { m_bLongTermRefsPresent=b;      }
    1446   Bool      getTMVPFlagsPresent()         { return m_TMVPFlagsPresent; }
    1447   Void      setTMVPFlagsPresent(Bool b)   { m_TMVPFlagsPresent=b;      }
     1422  Void                   setPicWidthInLumaSamples( UInt u )                                              { m_picWidthInLumaSamples = u;                                         }
     1423  UInt                   getPicWidthInLumaSamples() const                                                { return  m_picWidthInLumaSamples;                                     }
     1424  Void                   setPicHeightInLumaSamples( UInt u )                                             { m_picHeightInLumaSamples = u;                                        }
     1425  UInt                   getPicHeightInLumaSamples() const                                               { return  m_picHeightInLumaSamples;                                    }
     1426
     1427  Window&                getConformanceWindow()                                                          { return  m_conformanceWindow;                                         }
     1428  const Window&          getConformanceWindow() const                                                    { return  m_conformanceWindow;                                         }
     1429  Void                   setConformanceWindow(Window& conformanceWindow )                                { m_conformanceWindow = conformanceWindow;                             }
     1430
     1431  UInt                   getNumLongTermRefPicSPS() const                                                 { return m_numLongTermRefPicSPS;                                       }
     1432  Void                   setNumLongTermRefPicSPS(UInt val)                                               { m_numLongTermRefPicSPS = val;                                        }
     1433
     1434  UInt                   getLtRefPicPocLsbSps(UInt index) const                                          { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); return m_ltRefPicPocLsbSps[index]; }
     1435  Void                   setLtRefPicPocLsbSps(UInt index, UInt val)                                      { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); m_ltRefPicPocLsbSps[index] = val;  }
     1436
     1437  Bool                   getUsedByCurrPicLtSPSFlag(Int i) const                                          { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); return m_usedByCurrPicLtSPSFlag[i];    }
     1438  Void                   setUsedByCurrPicLtSPSFlag(Int i, Bool x)                                        { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); m_usedByCurrPicLtSPSFlag[i] = x;       }
     1439
     1440  Int                    getLog2MinCodingBlockSize() const                                               { return m_log2MinCodingBlockSize;                                     }
     1441  Void                   setLog2MinCodingBlockSize(Int val)                                              { m_log2MinCodingBlockSize = val;                                      }
     1442  Int                    getLog2DiffMaxMinCodingBlockSize() const                                        { return m_log2DiffMaxMinCodingBlockSize;                              }
     1443  Void                   setLog2DiffMaxMinCodingBlockSize(Int val)                                       { m_log2DiffMaxMinCodingBlockSize = val;                               }
     1444
     1445  Void                   setMaxCUWidth( UInt u )                                                         { m_uiMaxCUWidth = u;                                                  }
     1446  UInt                   getMaxCUWidth() const                                                           { return  m_uiMaxCUWidth;                                              }
     1447  Void                   setMaxCUHeight( UInt u )                                                        { m_uiMaxCUHeight = u;                                                 }
     1448  UInt                   getMaxCUHeight() const                                                          { return  m_uiMaxCUHeight;                                             }
     1449  Void                   setMaxCUDepth( UInt u )                                                         { m_uiMaxCUDepth = u;                                                  }
     1450  UInt                   getMaxCUDepth() const                                                           { return  m_uiMaxCUDepth;                                              }
     1451  Void                   setUsePCM( Bool b )                                                             { m_usePCM = b;                                                        }
     1452  Bool                   getUsePCM() const                                                               { return m_usePCM;                                                     }
     1453  Void                   setPCMLog2MaxSize( UInt u )                                                     { m_pcmLog2MaxSize = u;                                                }
     1454  UInt                   getPCMLog2MaxSize() const                                                       { return  m_pcmLog2MaxSize;                                            }
     1455  Void                   setPCMLog2MinSize( UInt u )                                                     { m_uiPCMLog2MinSize = u;                                              }
     1456  UInt                   getPCMLog2MinSize() const                                                       { return  m_uiPCMLog2MinSize;                                          }
     1457  Void                   setBitsForPOC( UInt u )                                                         { m_uiBitsForPOC = u;                                                  }
     1458  UInt                   getBitsForPOC() const                                                           { return m_uiBitsForPOC;                                               }
     1459  Bool                   getUseAMP() const                                                               { return m_useAMP;                                                     }
     1460  Void                   setUseAMP( Bool b )                                                             { m_useAMP = b;                                                        }
     1461  Void                   setQuadtreeTULog2MaxSize( UInt u )                                              { m_uiQuadtreeTULog2MaxSize = u;                                       }
     1462  UInt                   getQuadtreeTULog2MaxSize() const                                                { return m_uiQuadtreeTULog2MaxSize;                                    }
     1463  Void                   setQuadtreeTULog2MinSize( UInt u )                                              { m_uiQuadtreeTULog2MinSize = u;                                       }
     1464  UInt                   getQuadtreeTULog2MinSize() const                                                { return m_uiQuadtreeTULog2MinSize;                                    }
     1465  Void                   setQuadtreeTUMaxDepthInter( UInt u )                                            { m_uiQuadtreeTUMaxDepthInter = u;                                     }
     1466  Void                   setQuadtreeTUMaxDepthIntra( UInt u )                                            { m_uiQuadtreeTUMaxDepthIntra = u;                                     }
     1467  UInt                   getQuadtreeTUMaxDepthInter() const                                              { return m_uiQuadtreeTUMaxDepthInter;                                  }
     1468  UInt                   getQuadtreeTUMaxDepthIntra() const                                              { return m_uiQuadtreeTUMaxDepthIntra;                                  }
     1469  Void                   setNumReorderPics(Int i, UInt tlayer)                                           { m_numReorderPics[tlayer] = i;                                        }
     1470  Int                    getNumReorderPics(UInt tlayer) const                                            { return m_numReorderPics[tlayer];                                     }
     1471  Void                   createRPSList( Int numRPS );
     1472  const TComRPSList*     getRPSList() const                                                              { return &m_RPSList;                                                   }
     1473  TComRPSList*           getRPSList()                                                                    { return &m_RPSList;                                                   }
     1474  Bool                   getLongTermRefsPresent() const                                                  { return m_bLongTermRefsPresent;                                       }
     1475  Void                   setLongTermRefsPresent(Bool b)                                                  { m_bLongTermRefsPresent=b;                                            }
     1476  Bool                   getTMVPFlagsPresent() const                                                     { return m_TMVPFlagsPresent;                                           }
     1477  Void                   setTMVPFlagsPresent(Bool b)                                                     { m_TMVPFlagsPresent=b;                                                }
    14481478  // physical transform
    1449   Void setMaxTrSize   ( UInt u ) { m_uiMaxTrSize = u;       }
    1450   UInt getMaxTrSize   ()         { return  m_uiMaxTrSize;   }
    1451 
    1452   // AMP accuracy
    1453   Int       getAMPAcc   ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; }
    1454   Void      setAMPAcc   ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth);  m_iAMPAcc[uiDepth] = iAccu; }
     1479  Void                   setMaxTrSize( UInt u )                                                          { m_uiMaxTrSize = u;                                                   }
     1480  UInt                   getMaxTrSize() const                                                            { return  m_uiMaxTrSize;                                               }
    14551481
    14561482  // Bit-depth
    1457   Int       getBitDepth     (ChannelType type)         { return m_uiBitDepth[type];   }
    1458   Void      setBitDepth     (ChannelType type, Int u ) { m_uiBitDepth[type] = u;      }
    1459   Int       getDifferentialLumaChromaBitDepth() const  { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); }
    1460   Int       getQpBDOffset   (ChannelType type) const   { return m_qpBDOffset[type];   }
    1461   Void      setQpBDOffset   (ChannelType type, Int i)  { m_qpBDOffset[type] = i;      }
    1462   Bool      getUseExtendedPrecision()          const   { return m_useExtendedPrecision;  }
    1463   Void      setUseExtendedPrecision(Bool value)        { m_useExtendedPrecision = value; }
    1464   Bool      getUseHighPrecisionPredictionWeighting() const { return m_useHighPrecisionPredictionWeighting; }
    1465   Void      setUseHighPrecisionPredictionWeighting(Bool value) { m_useHighPrecisionPredictionWeighting = value; }
    1466 
    1467   Void      setUseSAO                  (Bool bVal)  {m_bUseSAO = bVal;}
    1468   Bool      getUseSAO                  ()           {return m_bUseSAO;}
    1469 
    1470   Bool      getUseResidualRotation            ()                 const { return m_useResidualRotation;  }
    1471   Void      setUseResidualRotation            (const Bool value)       { m_useResidualRotation = value; }
    1472 
    1473   Bool      getUseSingleSignificanceMapContext()                 const { return m_useSingleSignificanceMapContext;  }
    1474   Void      setUseSingleSignificanceMapContext(const Bool value)       { m_useSingleSignificanceMapContext = value; }
    1475 
    1476   Bool      getUseGolombRiceParameterAdaptation()                 const { return m_useGolombRiceParameterAdaptation;  }
    1477   Void      setUseGolombRiceParameterAdaptation(const Bool value)       { m_useGolombRiceParameterAdaptation = value; }
    1478 
    1479   Bool      getAlignCABACBeforeBypass         ()                 const { return m_alignCABACBeforeBypass;  }
    1480   Void      setAlignCABACBeforeBypass         (const Bool value)       { m_alignCABACBeforeBypass = value; }
    1481 
    1482   Bool      getUseResidualDPCM (const RDPCMSignallingMode signallingMode)        const      { return m_useResidualDPCM[signallingMode];  }
    1483   Void      setUseResidualDPCM (const RDPCMSignallingMode signallingMode, const Bool value) { m_useResidualDPCM[signallingMode] = value; }
    1484 
    1485   UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
    1486   Void      setMaxTLayers( UInt uiMaxTLayers )        { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
    1487 
    1488   Bool      getTemporalIdNestingFlag()                { return m_bTemporalIdNestingFlag; }
    1489   Void      setTemporalIdNestingFlag( Bool bValue )   { m_bTemporalIdNestingFlag = bValue; }
    1490   UInt      getPCMBitDepth         (ChannelType type) const   { return m_uiPCMBitDepth[type]; }
    1491   Void      setPCMBitDepth         (ChannelType type, UInt u) { m_uiPCMBitDepth[type] = u;    }
    1492   Void      setPCMFilterDisableFlag     ( Bool   bValue  )    { m_bPCMFilterDisableFlag = bValue; }
    1493   Bool      getPCMFilterDisableFlag     ()                    { return m_bPCMFilterDisableFlag;   }
    1494   Void      setDisableIntraReferenceSmoothing (Bool bValue)   { m_disableIntraReferenceSmoothing=bValue; }
    1495   Bool      getDisableIntraReferenceSmoothing ()        const { return m_disableIntraReferenceSmoothing; }
    1496 
    1497   Bool getScalingListFlag       ()         { return m_scalingListEnabledFlag;     }
    1498   Void setScalingListFlag       ( Bool b ) { m_scalingListEnabledFlag  = b;       }
    1499   Bool getScalingListPresentFlag()         { return m_scalingListPresentFlag;     }
    1500   Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag  = b;       }
     1483  Int                    getBitDepth(ChannelType type) const                                             { return m_uiBitDepth[type];                                           }
     1484  Void                   setBitDepth(ChannelType type, Int u )                                           { m_uiBitDepth[type] = u;                                              }
     1485  Int                    getDifferentialLumaChromaBitDepth() const                                       { return Int(m_uiBitDepth[CHANNEL_TYPE_LUMA]) - Int(m_uiBitDepth[CHANNEL_TYPE_CHROMA]); }
     1486  Int                    getQpBDOffset(ChannelType type) const                                           { return m_qpBDOffset[type];                                           }
     1487  Void                   setQpBDOffset(ChannelType type, Int i)                                          { m_qpBDOffset[type] = i;                                              }
     1488  Bool                   getUseExtendedPrecision() const                                                 { return m_useExtendedPrecision;                                       }
     1489  Void                   setUseExtendedPrecision(Bool value)                                             { m_useExtendedPrecision = value;                                      }
     1490  Bool                   getUseHighPrecisionPredictionWeighting() const                                  { return m_useHighPrecisionPredictionWeighting;                        }
     1491  Void                   setUseHighPrecisionPredictionWeighting(Bool value)                              { m_useHighPrecisionPredictionWeighting = value;                       }
     1492
     1493  Void                   setUseSAO(Bool bVal)                                                            { m_bUseSAO = bVal;                                                    }
     1494  Bool                   getUseSAO() const                                                               { return m_bUseSAO;                                                    }
     1495
     1496  Bool                   getUseResidualRotation() const                                                  { return m_useResidualRotation;                                        }
     1497  Void                   setUseResidualRotation(const Bool value)                                        { m_useResidualRotation = value;                                       }
     1498
     1499  Bool                   getUseSingleSignificanceMapContext()                 const                      { return m_useSingleSignificanceMapContext;                            }
     1500  Void                   setUseSingleSignificanceMapContext(const Bool value)                            { m_useSingleSignificanceMapContext = value;                           }
     1501
     1502  Bool                   getUseGolombRiceParameterAdaptation()                 const                     { return m_useGolombRiceParameterAdaptation;                           }
     1503  Void                   setUseGolombRiceParameterAdaptation(const Bool value)                           { m_useGolombRiceParameterAdaptation = value;                          }
     1504
     1505  Bool                   getAlignCABACBeforeBypass()                 const                               { return m_alignCABACBeforeBypass;                                     }
     1506  Void                   setAlignCABACBeforeBypass(const Bool value)                                     { m_alignCABACBeforeBypass = value;                                    }
     1507
     1508  Bool                   getUseResidualDPCM(const RDPCMSignallingMode signallingMode) const              { return m_useResidualDPCM[signallingMode];                            }
     1509  Void                   setUseResidualDPCM(const RDPCMSignallingMode signallingMode, const Bool value)  { m_useResidualDPCM[signallingMode] = value;                           }
     1510
     1511  UInt                   getMaxTLayers() const                                                           { return m_uiMaxTLayers; }
     1512  Void                   setMaxTLayers( UInt uiMaxTLayers )                                              { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
     1513
     1514  Bool                   getTemporalIdNestingFlag() const                                                { return m_bTemporalIdNestingFlag;                                     }
     1515  Void                   setTemporalIdNestingFlag( Bool bValue )                                         { m_bTemporalIdNestingFlag = bValue;                                   }
     1516  UInt                   getPCMBitDepth(ChannelType type) const                                          { return m_uiPCMBitDepth[type];                                        }
     1517  Void                   setPCMBitDepth(ChannelType type, UInt u)                                        { m_uiPCMBitDepth[type] = u;                                           }
     1518  Void                   setPCMFilterDisableFlag( Bool bValue )                                          { m_bPCMFilterDisableFlag = bValue;                                    }
     1519  Bool                   getPCMFilterDisableFlag() const                                                 { return m_bPCMFilterDisableFlag;                                      }
     1520  Void                   setDisableIntraReferenceSmoothing(Bool bValue)                                  { m_disableIntraReferenceSmoothing=bValue;                             }
     1521  Bool                   getDisableIntraReferenceSmoothing() const                                       { return m_disableIntraReferenceSmoothing;                             }
     1522
     1523  Bool                   getScalingListFlag() const                                                      { return m_scalingListEnabledFlag;                                     }
     1524  Void                   setScalingListFlag( Bool b )                                                    { m_scalingListEnabledFlag  = b;                                       }
     1525  Bool                   getScalingListPresentFlag() const                                               { return m_scalingListPresentFlag;                                     }
     1526  Void                   setScalingListPresentFlag( Bool b )                                             { m_scalingListPresentFlag  = b;                                       }
     1527
     1528  Void                   setScalingList( TComScalingList *scalingList);
     1529  TComScalingList&       getScalingList()                                                                { return m_scalingList;                                                }
     1530  const TComScalingList& getScalingList() const                                                          { return m_scalingList;                                                }
     1531  UInt                   getMaxDecPicBuffering(UInt tlayer) const                                        { return m_uiMaxDecPicBuffering[tlayer];                               }
     1532  Void                   setMaxDecPicBuffering( UInt ui, UInt tlayer )                                   { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui;    }
     1533  UInt                   getMaxLatencyIncrease(UInt tlayer) const                                        { return m_uiMaxLatencyIncrease[tlayer];                               }
     1534  Void                   setMaxLatencyIncrease( UInt ui , UInt tlayer)                                   { m_uiMaxLatencyIncrease[tlayer] = ui;                                 }
     1535
     1536  Void                   setUseStrongIntraSmoothing(Bool bVal)                                           { m_useStrongIntraSmoothing = bVal;                                    }
     1537  Bool                   getUseStrongIntraSmoothing() const                                              { return m_useStrongIntraSmoothing;                                    }
     1538
     1539  Bool                   getVuiParametersPresentFlag() const                                             { return m_vuiParametersPresentFlag;                                   }
     1540  Void                   setVuiParametersPresentFlag(Bool b)                                             { m_vuiParametersPresentFlag = b;                                      }
     1541  TComVUI*               getVuiParameters()                                                              { return &m_vuiParameters;                                             }
     1542  const TComVUI*         getVuiParameters() const                                                        { return &m_vuiParameters;                                             }
     1543  Void                   setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess );
     1544
     1545  const TComPTL*         getPTL() const                                                                  { return &m_pcPTL;                                                     }
     1546  TComPTL*               getPTL()                                                                        { return &m_pcPTL;                                                     }
    15011547
    15021548#if SVC_EXTENSION
    1503   Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; }
    1504 #else
    1505   Void setScalingList      ( TComScalingList *scalingList);
    1506 #endif
    1507   TComScalingList* getScalingList ()       { return m_scalingList; }               //!< get ScalingList class pointer in SPS
    1508   UInt getMaxDecPicBuffering  (UInt tlayer)            { return m_uiMaxDecPicBuffering[tlayer]; }
    1509   Void setMaxDecPicBuffering  ( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER);  m_uiMaxDecPicBuffering[tlayer] = ui;   }
    1510   UInt getMaxLatencyIncrease  (UInt tlayer)            { return m_uiMaxLatencyIncrease[tlayer];   }
    1511   Void setMaxLatencyIncrease  ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui;      }
    1512 
    1513   Void setUseStrongIntraSmoothing (Bool bVal)  {m_useStrongIntraSmoothing = bVal;}
    1514   Bool getUseStrongIntraSmoothing ()           {return m_useStrongIntraSmoothing;}
    1515 
    1516   Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; }
    1517   Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; }
    1518   TComVUI* getVuiParameters() { return &m_vuiParameters; }
    1519   Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess );
    1520 
    1521   TComPTL* getPTL()     { return &m_pcPTL; }
    1522 
    1523 #if SVC_EXTENSION
    1524   Void     setLayerId(UInt layerId)                 { m_layerId = layerId;           }
    1525   UInt     getLayerId()                             { return m_layerId;              }
    1526   Int      getExtensionFlag()                       { return m_extensionFlag;        }
    1527   Void     setExtensionFlag(Int n)                  { m_extensionFlag = n;           }
    1528   Bool     getMultiLayerExtSpsFlag()                { return m_multiLayerExtSpsFlag; }
    1529   Void     setMultiLayerExtSpsFlag(Bool flag)       { m_multiLayerExtSpsFlag = flag; }
     1549  Void                   setLayerId(UInt layerId)                                                        { m_layerId = layerId;                                                 }
     1550  UInt                   getLayerId() const                                                              { return m_layerId;                                                    }
     1551  Int                    getExtensionFlag() const                                                        { return m_extensionFlag;                                              }
     1552  Void                   setExtensionFlag(Int n)                                                         { m_extensionFlag = n;                                                 }
     1553  Bool                   getMultiLayerExtSpsFlag() const                                                 { return m_multiLayerExtSpsFlag;                                       }
     1554  Void                   setMultiLayerExtSpsFlag(Bool flag)                                              { m_multiLayerExtSpsFlag = flag;                                       }
    15301555
    15311556  //These two functions shall be used / called when the syntax element sps_ext_or_max_sub_layers_minus1 and V1CompatibleSPSFlag are implemented
    1532   Bool     getV1CompatibleSPSFlag()                 { return m_bV1CompatibleSPSFlag; }
    1533   Void     setV1CompatibleSPSFlag(Bool x)           { m_bV1CompatibleSPSFlag = x;    }
    1534 
    1535   Int      getNumDirectRefLayers()                  { return  m_NumDirectRefLayers;  }
    1536   Void     setNumDirectRefLayers(Int n)             {  m_NumDirectRefLayers = n;     }
    1537   Bool     getUpdateRepFormatFlag()                 { return m_updateRepFormatFlag;   }
    1538   Void     setUpdateRepFormatFlag(Bool x)           { m_updateRepFormatFlag = x;      }
    1539   Int      getUpdateRepFormatIndex()                { return m_updateRepFormatIndex;  }
    1540   Void     setUpdateRepFormatIndex(UInt index)      { m_updateRepFormatIndex = index; }
    1541   Bool     getInferScalingListFlag()                { return m_inferScalingListFlag;  }
    1542   UInt     getScalingListRefLayerId()               { return m_scalingListRefLayerId; }
    1543   Void     setInferScalingListFlag( Bool flag )     { m_inferScalingListFlag = flag;     }
    1544   Void     setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; }
     1557  Bool                   getV1CompatibleSPSFlag() const                                                  { return m_bV1CompatibleSPSFlag;                                      }
     1558  Void                   setV1CompatibleSPSFlag(Bool x)                                                  { m_bV1CompatibleSPSFlag = x;                                          }
     1559
     1560  Int                    getNumDirectRefLayers() const                                                   { return  m_NumDirectRefLayers;                                        }
     1561  Void                   setNumDirectRefLayers(Int n)                                                    {  m_NumDirectRefLayers = n;                                           }
     1562  Bool                   getUpdateRepFormatFlag() const                                                  { return m_updateRepFormatFlag;                                        }
     1563  Void                   setUpdateRepFormatFlag(Bool x)                                                  { m_updateRepFormatFlag = x;                                           }
     1564  Int                    getUpdateRepFormatIndex() const                                                 { return m_updateRepFormatIndex;                                       }
     1565  Void                   setUpdateRepFormatIndex(UInt index)                                             { m_updateRepFormatIndex = index;                                      }
     1566  Bool                   getInferScalingListFlag() const                                                 { return m_inferScalingListFlag;                                       }
     1567  UInt                   getScalingListRefLayerId() const                                                { return m_scalingListRefLayerId;                                      }
     1568  Void                   setInferScalingListFlag( Bool flag )                                            { m_inferScalingListFlag = flag;                                       }
     1569  Void                   setScalingListRefLayerId( UInt layerId )                                        { m_scalingListRefLayerId = layerId;                                  }
    15451570#endif //SVC_EXTENSION
    15461571};
     
    15511576{
    15521577private:
    1553   Bool      m_refPicListModificationFlagL0;
    1554   Bool      m_refPicListModificationFlagL1;
    1555   UInt      m_RefPicSetIdxL0[REF_PIC_LIST_NUM_IDX];
    1556   UInt      m_RefPicSetIdxL1[REF_PIC_LIST_NUM_IDX];
     1578  Bool m_refPicListModificationFlagL0;
     1579  Bool m_refPicListModificationFlagL1;
     1580  UInt m_RefPicSetIdxL0[REF_PIC_LIST_NUM_IDX];
     1581  UInt m_RefPicSetIdxL1[REF_PIC_LIST_NUM_IDX];
    15571582
    15581583public:
    1559   TComRefPicListModification();
     1584          TComRefPicListModification();
    15601585  virtual ~TComRefPicListModification();
    15611586
    1562   Void  create                    ();
    1563   Void  destroy                   ();
    1564 
    1565   Bool       getRefPicListModificationFlagL0() { return m_refPicListModificationFlagL0; }
    1566   Void       setRefPicListModificationFlagL0(Bool flag) { m_refPicListModificationFlagL0 = flag; }
    1567   Bool       getRefPicListModificationFlagL1() { return m_refPicListModificationFlagL1; }
    1568   Void       setRefPicListModificationFlagL1(Bool flag) { m_refPicListModificationFlagL1 = flag; }
    1569   Void       setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL0[idx] = refPicSetIdx; }
    1570   UInt       getRefPicSetIdxL0(UInt idx) { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[idx]; }
    1571   Void       setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; }
    1572   UInt       getRefPicSetIdxL1(UInt idx) { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[idx]; }
     1587  Void    create();
     1588  Void    destroy();
     1589
     1590  Bool    getRefPicListModificationFlagL0() const        { return m_refPicListModificationFlagL0;                                  }
     1591  Void    setRefPicListModificationFlagL0(Bool flag)     { m_refPicListModificationFlagL0 = flag;                                  }
     1592  Bool    getRefPicListModificationFlagL1() const        { return m_refPicListModificationFlagL1;                                  }
     1593  Void    setRefPicListModificationFlagL1(Bool flag)     { m_refPicListModificationFlagL1 = flag;                                  }
     1594  UInt    getRefPicSetIdxL0(UInt idx) const              { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[idx];        }
     1595  Void    setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL0[idx] = refPicSetIdx; }
     1596  UInt    getRefPicSetIdxL1(UInt idx) const              { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[idx];        }
     1597  Void    setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; }
    15731598};
     1599
    15741600
    15751601/// PPS class
     
    15771603{
    15781604private:
    1579   Int         m_PPSId;                    // pic_parameter_set_id
    1580   Int         m_SPSId;                    // seq_parameter_set_id
    1581   Int         m_picInitQPMinus26;
    1582   Bool        m_useDQP;
    1583   Bool        m_bConstrainedIntraPred;    // constrained_intra_pred_flag
    1584   Bool        m_bSliceChromaQpFlag;       // slicelevel_chroma_qp_flag
     1605  Int              m_PPSId;                    // pic_parameter_set_id
     1606  Int              m_SPSId;                    // seq_parameter_set_id
     1607  Int              m_picInitQPMinus26;
     1608  Bool             m_useDQP;
     1609  Bool             m_bConstrainedIntraPred;    // constrained_intra_pred_flag
     1610  Bool             m_bSliceChromaQpFlag;       // slicelevel_chroma_qp_flag
    15851611
    15861612  // access channel
    1587   TComSPS*    m_pcSPS;
    1588   UInt        m_uiMaxCuDQPDepth;
    1589   UInt        m_uiMinCuDQPSize;
    1590 
    1591   /* Chroma QP Adjustments*/
    1592   Int         m_MaxCuChromaQpAdjDepth;
    1593   Int         m_MinCuChromaQpAdjSize;
    1594   Int         m_ChromaQpAdjTableSize;
    1595   ChromaQpAdj m_ChromaQpAdjTable[7];
    1596 
    1597   Int         m_chromaCbQpOffset;
    1598   Int         m_chromaCrQpOffset;
    1599 
    1600   UInt        m_numRefIdxL0DefaultActive;
    1601   UInt        m_numRefIdxL1DefaultActive;
    1602 
    1603   Bool        m_bUseWeightPred;           // Use of Weighting Prediction (P_SLICE)
    1604   Bool        m_useWeightedBiPred;        // Use of Weighting Bi-Prediction (B_SLICE)
    1605   Bool        m_OutputFlagPresentFlag;   // Indicates the presence of output_flag in slice header
    1606   Bool        m_useCrossComponentPrediction;
    1607   UInt        m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE];
    1608   Bool        m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs.
    1609   Bool        m_useTransformSkip;
    1610   Int         m_transformSkipLog2MaxSize;
    1611   Bool        m_dependentSliceSegmentsEnabledFlag;     //!< Indicates the presence of dependent slices
    1612   Bool        m_tilesEnabledFlag;              //!< Indicates the presence of tiles
    1613   Bool        m_entropyCodingSyncEnabledFlag;  //!< Indicates the presence of wavefronts
     1613  UInt             m_uiMaxCuDQPDepth;
     1614
     1615  // Chroma QP Adjustments
     1616  Int              m_MaxCuChromaQpAdjDepth;
     1617  Int              m_ChromaQpAdjTableSize;
     1618  ChromaQpAdj      m_ChromaQpAdjTable[7];
     1619
     1620  Int              m_chromaCbQpOffset;
     1621  Int              m_chromaCrQpOffset;
     1622
     1623  UInt             m_numRefIdxL0DefaultActive;
     1624  UInt             m_numRefIdxL1DefaultActive;
     1625
     1626  Bool             m_bUseWeightPred;                    //!< Use of Weighting Prediction (P_SLICE)
     1627  Bool             m_useWeightedBiPred;                 //!< Use of Weighting Bi-Prediction (B_SLICE)
     1628  Bool             m_OutputFlagPresentFlag;             //!< Indicates the presence of output_flag in slice header
     1629  Bool             m_useCrossComponentPrediction;
     1630  UInt             m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE];
     1631  Bool             m_TransquantBypassEnableFlag;        //!< Indicates presence of cu_transquant_bypass_flag in CUs.
     1632  Bool             m_useTransformSkip;
     1633  Int              m_transformSkipLog2MaxSize;
     1634  Bool             m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices
     1635  Bool             m_tilesEnabledFlag;                  //!< Indicates the presence of tiles
     1636  Bool             m_entropyCodingSyncEnabledFlag;      //!< Indicates the presence of wavefronts
    16141637
    16151638  Bool             m_loopFilterAcrossTilesEnabledFlag;
     
    16201643  std::vector<Int> m_tileRowHeight;
    16211644
    1622   Int      m_numSubstreams;
    1623 
    1624   Bool     m_signHideFlag;
    1625 
    1626   Bool     m_cabacInitPresentFlag;
    1627   UInt     m_encCABACTableIdx;           // Used to transmit table selection across slices
    1628 
    1629   Bool     m_sliceHeaderExtensionPresentFlag;
    1630   Bool     m_loopFilterAcrossSlicesEnabledFlag;
    1631   Bool     m_deblockingFilterControlPresentFlag;
    1632   Bool     m_deblockingFilterOverrideEnabledFlag;
    1633   Bool     m_picDisableDeblockingFilterFlag;
    1634   Int      m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
    1635   Int      m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
    1636   Bool     m_scalingListPresentFlag;
    1637   TComScalingList*     m_scalingList;   //!< ScalingList class pointer
    1638   Bool     m_listsModificationPresentFlag;
    1639   UInt     m_log2ParallelMergeLevelMinus2;
    1640   Int      m_numExtraSliceHeaderBits;
     1645  Bool             m_signHideFlag;
     1646
     1647  Bool             m_cabacInitPresentFlag;
     1648
     1649  Bool             m_sliceHeaderExtensionPresentFlag;
     1650  Bool             m_loopFilterAcrossSlicesEnabledFlag;
     1651  Bool             m_deblockingFilterControlPresentFlag;
     1652  Bool             m_deblockingFilterOverrideEnabledFlag;
     1653  Bool             m_picDisableDeblockingFilterFlag;
     1654  Int              m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
     1655  Int              m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
     1656  Bool             m_scalingListPresentFlag;
     1657  TComScalingList  m_scalingList;                       //!< ScalingList class
     1658  Bool             m_listsModificationPresentFlag;
     1659  UInt             m_log2ParallelMergeLevelMinus2;
     1660  Int              m_numExtraSliceHeaderBits;
    16411661
    16421662#if SVC_EXTENSION
    1643   Bool     m_extensionFlag;
    1644   UInt     m_layerId;
    1645   Bool     m_inferScalingListFlag;
    1646   UInt     m_scalingListRefLayerId;
    1647   Bool     m_pocResetInfoPresentFlag;
    1648   UInt     m_numRefLayerLocationOffsets;
    1649   UInt     m_refLocationOffsetLayerId[MAX_LAYERS];
    1650   Window   m_scaledRefLayerWindow[MAX_LAYERS];
    1651   Window   m_refLayerWindow[MAX_LAYERS];
    1652   Bool     m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS];
    1653   Bool     m_refRegionOffsetPresentFlag[MAX_LAYERS];
    1654   Int      m_phaseHorLuma[MAX_LAYERS];
    1655   Int      m_phaseVerLuma[MAX_LAYERS];
    1656   Int      m_phaseHorChroma[MAX_LAYERS];
    1657   Int      m_phaseVerChroma[MAX_LAYERS];
    1658   Bool     m_resamplePhaseSetPresentFlag[MAX_LAYERS];
     1663  Bool             m_extensionFlag;
     1664  UInt             m_layerId;
     1665  Bool             m_inferScalingListFlag;
     1666  UInt             m_scalingListRefLayerId;
     1667  Bool             m_pocResetInfoPresentFlag;
     1668  UInt             m_numRefLayerLocationOffsets;
     1669  UInt             m_refLocationOffsetLayerId[MAX_LAYERS];
     1670  Window           m_scaledRefLayerWindow[MAX_LAYERS];
     1671  Window           m_refLayerWindow[MAX_LAYERS];
     1672  Bool             m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS];
     1673  Bool             m_refRegionOffsetPresentFlag[MAX_LAYERS];
     1674  ResamplingPhase  m_resamplingPhase[MAX_LAYERS];
    16591675#if CGS_3D_ASYMLUT
    1660   Int      m_nCGSFlag;
    1661   Int      m_nCGSOutputBitDepthY; // not for syntax
    1662   Int      m_nCGSOutputBitDepthC; // not for syntax
     1676  Int              m_nCGSFlag;
     1677  Int              m_nCGSOutputBitDepthY; // not for syntax
     1678  Int              m_nCGSOutputBitDepthC; // not for syntax
    16631679#endif
    16641680#endif
    16651681
    16661682public:
    1667   TComPPS();
    1668   virtual ~TComPPS();
    1669 
    1670   Int       getPPSId ()      { return m_PPSId; }
    1671   Void      setPPSId (Int i) { m_PPSId = i; }
    1672   Int       getSPSId ()      { return m_SPSId; }
    1673   Void      setSPSId (Int i) { m_SPSId = i; }
    1674 
    1675   Int       getPicInitQPMinus26 ()         { return  m_picInitQPMinus26; }
    1676   Void      setPicInitQPMinus26 ( Int i )  { m_picInitQPMinus26 = i;     }
    1677   Bool      getUseDQP ()                   { return m_useDQP;        }
    1678   Void      setUseDQP ( Bool b )           { m_useDQP   = b;         }
    1679   Bool      getConstrainedIntraPred ()         { return  m_bConstrainedIntraPred; }
    1680   Void      setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b;     }
    1681   Bool      getSliceChromaQpFlag ()         { return  m_bSliceChromaQpFlag; }
    1682   Void      setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b;     }
    1683 
    1684   Void      setSPS              ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    1685   TComSPS*  getSPS              ()         { return m_pcSPS;          }
    1686   Void      setMaxCuDQPDepth    ( UInt u ) { m_uiMaxCuDQPDepth = u;   }
    1687   UInt      getMaxCuDQPDepth    ()         { return m_uiMaxCuDQPDepth;}
    1688   Void      setMinCuDQPSize     ( UInt u ) { m_uiMinCuDQPSize = u;    }
    1689   UInt      getMinCuDQPSize     ()         { return m_uiMinCuDQPSize; }
    1690 
    1691   Void      setQpOffset(ComponentID compID, Int i ) { if (compID==COMPONENT_Cb) m_chromaCbQpOffset = i; else if (compID==COMPONENT_Cr) m_chromaCrQpOffset = i; else assert(0); }
    1692   Int       getQpOffset(ComponentID compID) const { return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset ); }
    1693 
    1694   Void      setMaxCuChromaQpAdjDepth ( UInt u ) { m_MaxCuChromaQpAdjDepth = u; }
    1695   UInt      getMaxCuChromaQpAdjDepth ()         { return m_MaxCuChromaQpAdjDepth; }
    1696   Void      setMinCuChromaQpAdjSize ( UInt u ) { m_MinCuChromaQpAdjSize = u; }
    1697   UInt      getMinCuChromaQpAdjSize ()         { return m_MinCuChromaQpAdjSize; }
    1698   Void      clearChromaQpAdjTable() { m_ChromaQpAdjTableSize = 0; }
    1699   Int       getChromaQpAdjTableSize() { return m_ChromaQpAdjTableSize; }
    1700   const ChromaQpAdj& getChromaQpAdjTableAt( Int idx ) const { return m_ChromaQpAdjTable[idx]; }
    1701   Void      setChromaQpAdjTableAt( Int idx, Int cbOffset, Int crOffset )
     1683                         TComPPS();
     1684  virtual                ~TComPPS();
     1685
     1686  Int                    getPPSId() const                                                 { return m_PPSId;                               }
     1687  Void                   setPPSId(Int i)                                                  { m_PPSId = i;                                  }
     1688  Int                    getSPSId() const                                                 { return m_SPSId;                               }
     1689  Void                   setSPSId(Int i)                                                  { m_SPSId = i;                                  }
     1690
     1691  Int                    getPicInitQPMinus26() const                                      { return  m_picInitQPMinus26;                   }
     1692  Void                   setPicInitQPMinus26( Int i )                                     { m_picInitQPMinus26 = i;                       }
     1693  Bool                   getUseDQP() const                                                { return m_useDQP;                              }
     1694  Void                   setUseDQP( Bool b )                                              { m_useDQP   = b;                               }
     1695  Bool                   getConstrainedIntraPred() const                                  { return  m_bConstrainedIntraPred;              }
     1696  Void                   setConstrainedIntraPred( Bool b )                                { m_bConstrainedIntraPred = b;                  }
     1697  Bool                   getSliceChromaQpFlag() const                                     { return  m_bSliceChromaQpFlag;                 }
     1698  Void                   setSliceChromaQpFlag( Bool b )                                   { m_bSliceChromaQpFlag = b;                     }
     1699
     1700  Void                   setMaxCuDQPDepth( UInt u )                                       { m_uiMaxCuDQPDepth = u;                        }
     1701  UInt                   getMaxCuDQPDepth() const                                         { return m_uiMaxCuDQPDepth;                     }
     1702
     1703  Void                   setQpOffset(ComponentID compID, Int i )
     1704  {
     1705    if      (compID==COMPONENT_Cb)
     1706    {
     1707      m_chromaCbQpOffset = i;
     1708    }
     1709    else if (compID==COMPONENT_Cr)
     1710    {
     1711      m_chromaCrQpOffset = i;
     1712    }
     1713    else
     1714    {
     1715      assert(0);
     1716    }
     1717  }
     1718  Int                    getQpOffset(ComponentID compID) const
     1719  {
     1720    return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset );
     1721  }
     1722
     1723  Void                   setMaxCuChromaQpAdjDepth ( UInt u )                              { m_MaxCuChromaQpAdjDepth = u;                  }
     1724  UInt                   getMaxCuChromaQpAdjDepth () const                                { return m_MaxCuChromaQpAdjDepth;               }
     1725  Void                   clearChromaQpAdjTable()                                          { m_ChromaQpAdjTableSize = 0;                   }
     1726  Int                    getChromaQpAdjTableSize() const                                  { return m_ChromaQpAdjTableSize;                }
     1727  const ChromaQpAdj&     getChromaQpAdjTableAt( Int idx ) const                           { return m_ChromaQpAdjTable[idx];               }
     1728  Void                   setChromaQpAdjTableAt( Int idx, Int cbOffset, Int crOffset )
    17021729  {
    17031730    m_ChromaQpAdjTable[idx].u.comp.CbOffset = cbOffset;
     
    17061733  }
    17071734
    1708   Void      setNumRefIdxL0DefaultActive(UInt ui)    { m_numRefIdxL0DefaultActive=ui;     }
    1709   UInt      getNumRefIdxL0DefaultActive()           { return m_numRefIdxL0DefaultActive; }
    1710   Void      setNumRefIdxL1DefaultActive(UInt ui)    { m_numRefIdxL1DefaultActive=ui;     }
    1711   UInt      getNumRefIdxL1DefaultActive()           { return m_numRefIdxL1DefaultActive; }
    1712 
    1713   Bool getUseWP                     ()          { return m_bUseWeightPred;  }
    1714   Bool getWPBiPred                  ()          { return m_useWeightedBiPred;     }
    1715   Void setUseWP                     ( Bool b )  { m_bUseWeightPred = b;     }
    1716   Void setWPBiPred                  ( Bool b )  { m_useWeightedBiPred = b;  }
    1717 
    1718   Bool      getUseCrossComponentPrediction()         const { return m_useCrossComponentPrediction;  }
    1719   Void      setUseCrossComponentPrediction(Bool value)     { m_useCrossComponentPrediction = value; }
    1720 
    1721   UInt      getSaoOffsetBitShift(ChannelType type) const            { return m_saoOffsetBitShift[type];       }
    1722   Void      setSaoOffsetBitShift(ChannelType type, UInt uiBitShift) { m_saoOffsetBitShift[type] = uiBitShift; }
    1723 
    1724   Void      setOutputFlagPresentFlag( Bool b )  { m_OutputFlagPresentFlag = b;    }
    1725   Bool      getOutputFlagPresentFlag()          { return m_OutputFlagPresentFlag; }
    1726   Void      setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; }
    1727   Bool      getTransquantBypassEnableFlag()         { return m_TransquantBypassEnableFlag; }
    1728 
    1729   Bool      getUseTransformSkip       ()         { return m_useTransformSkip;     }
    1730   Void      setUseTransformSkip       ( Bool b ) { m_useTransformSkip  = b;       }
    1731   UInt      getTransformSkipLog2MaxSize ()         { return m_transformSkipLog2MaxSize;     }
    1732   Void      setTransformSkipLog2MaxSize ( UInt u ) { m_transformSkipLog2MaxSize  = u;       }
    1733 
    1734   Void    setLoopFilterAcrossTilesEnabledFlag  (Bool b)    { m_loopFilterAcrossTilesEnabledFlag = b; }
    1735   Bool    getLoopFilterAcrossTilesEnabledFlag  ()          { return m_loopFilterAcrossTilesEnabledFlag;   }
    1736   Bool    getDependentSliceSegmentsEnabledFlag() const     { return m_dependentSliceSegmentsEnabledFlag; }
    1737   Void    setDependentSliceSegmentsEnabledFlag(Bool val)   { m_dependentSliceSegmentsEnabledFlag = val; }
    1738   Bool    getEntropyCodingSyncEnabledFlag() const          { return m_entropyCodingSyncEnabledFlag; }
    1739   Void    setEntropyCodingSyncEnabledFlag(Bool val)        { m_entropyCodingSyncEnabledFlag = val; }
    1740 
    1741   Void     setTilesEnabledFlag       (Bool val)                             { m_tilesEnabledFlag = val; }
    1742   Bool     getTilesEnabledFlag       () const                               { return m_tilesEnabledFlag; }
    1743   Void     setTileUniformSpacingFlag (Bool b)                               { m_uniformSpacingFlag = b; }
    1744   Bool     getTileUniformSpacingFlag () const                               { return m_uniformSpacingFlag; }
    1745   Void     setNumTileColumnsMinus1   (Int i)                                { m_numTileColumnsMinus1 = i; }
    1746   Int      getNumTileColumnsMinus1   () const                               { return m_numTileColumnsMinus1; }
    1747   Void     setTileColumnWidth        (const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; }
    1748   UInt     getTileColumnWidth        (UInt columnIdx) const                 { return  m_tileColumnWidth[columnIdx]; }
    1749   Void     setNumTileRowsMinus1      (Int i)                                { m_numTileRowsMinus1 = i; }
    1750   Int      getNumTileRowsMinus1      () const                               { return m_numTileRowsMinus1; }
    1751   Void     setTileRowHeight          (const std::vector<Int>& rowHeight)    { m_tileRowHeight = rowHeight;  }
    1752   UInt     getTileRowHeight          (UInt rowIdx) const                    { return m_tileRowHeight[rowIdx]; }
    1753 
    1754   Void     setNumSubstreams    (Int numSubstreams)                     { m_numSubstreams = numSubstreams; }
    1755   Int      getNumSubstreams    ()                                      { return m_numSubstreams; }
    1756 
    1757   Void      setSignHideFlag( Bool signHideFlag ) { m_signHideFlag = signHideFlag; }
    1758   Bool      getSignHideFlag()                    { return m_signHideFlag; }
    1759 
    1760   Void     setCabacInitPresentFlag( Bool flag )     { m_cabacInitPresentFlag = flag;    }
    1761   Void     setEncCABACTableIdx( Int idx )           { m_encCABACTableIdx = idx;         }
    1762   Bool     getCabacInitPresentFlag()                { return m_cabacInitPresentFlag;    }
    1763   UInt     getEncCABACTableIdx()                    { return m_encCABACTableIdx;        }
    1764   Void     setDeblockingFilterControlPresentFlag( Bool val )  { m_deblockingFilterControlPresentFlag = val; }
    1765   Bool     getDeblockingFilterControlPresentFlag()            { return m_deblockingFilterControlPresentFlag; }
    1766   Void     setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; }
    1767   Bool     getDeblockingFilterOverrideEnabledFlag()           { return m_deblockingFilterOverrideEnabledFlag; }
    1768   Void     setPicDisableDeblockingFilterFlag(Bool val)        { m_picDisableDeblockingFilterFlag = val; }       //!< set offset for deblocking filter disabled
    1769   Bool     getPicDisableDeblockingFilterFlag()                { return m_picDisableDeblockingFilterFlag; }      //!< get offset for deblocking filter disabled
    1770   Void     setDeblockingFilterBetaOffsetDiv2(Int val)         { m_deblockingFilterBetaOffsetDiv2 = val; }       //!< set beta offset for deblocking filter
    1771   Int      getDeblockingFilterBetaOffsetDiv2()                { return m_deblockingFilterBetaOffsetDiv2; }      //!< get beta offset for deblocking filter
    1772   Void     setDeblockingFilterTcOffsetDiv2(Int val)           { m_deblockingFilterTcOffsetDiv2 = val; }               //!< set tc offset for deblocking filter
    1773   Int      getDeblockingFilterTcOffsetDiv2()                  { return m_deblockingFilterTcOffsetDiv2; }              //!< get tc offset for deblocking filter
    1774   Bool     getScalingListPresentFlag()         { return m_scalingListPresentFlag;     }
    1775   Void     setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag  = b;       }
    1776 
     1735  Void                   setNumRefIdxL0DefaultActive(UInt ui)                             { m_numRefIdxL0DefaultActive=ui;                }
     1736  UInt                   getNumRefIdxL0DefaultActive() const                              { return m_numRefIdxL0DefaultActive;            }
     1737  Void                   setNumRefIdxL1DefaultActive(UInt ui)                             { m_numRefIdxL1DefaultActive=ui;                }
     1738  UInt                   getNumRefIdxL1DefaultActive() const                              { return m_numRefIdxL1DefaultActive;            }
     1739
     1740  Bool                   getUseWP() const                                                 { return m_bUseWeightPred;                      }
     1741  Bool                   getWPBiPred() const                                              { return m_useWeightedBiPred;                   }
     1742  Void                   setUseWP( Bool b )                                               { m_bUseWeightPred = b;                         }
     1743  Void                   setWPBiPred( Bool b )                                            { m_useWeightedBiPred = b;                      }
     1744
     1745  Bool                   getUseCrossComponentPrediction() const                           { return m_useCrossComponentPrediction;         }
     1746  Void                   setUseCrossComponentPrediction(Bool value)                       { m_useCrossComponentPrediction = value;        }
     1747
     1748  UInt                   getSaoOffsetBitShift(ChannelType type) const                     { return m_saoOffsetBitShift[type];             }
     1749  Void                   setSaoOffsetBitShift(ChannelType type, UInt uiBitShift)          { m_saoOffsetBitShift[type] = uiBitShift;       }
     1750
     1751  Void                   setOutputFlagPresentFlag( Bool b )                               { m_OutputFlagPresentFlag = b;                  }
     1752  Bool                   getOutputFlagPresentFlag() const                                 { return m_OutputFlagPresentFlag;               }
     1753  Void                   setTransquantBypassEnableFlag( Bool b )                          { m_TransquantBypassEnableFlag = b;             }
     1754  Bool                   getTransquantBypassEnableFlag() const                            { return m_TransquantBypassEnableFlag;          }
     1755
     1756  Bool                   getUseTransformSkip() const                                      { return m_useTransformSkip;                    }
     1757  Void                   setUseTransformSkip( Bool b )                                    { m_useTransformSkip  = b;                      }
     1758  UInt                   getTransformSkipLog2MaxSize() const                              { return m_transformSkipLog2MaxSize;            }
     1759  Void                   setTransformSkipLog2MaxSize( UInt u )                            { m_transformSkipLog2MaxSize  = u;              }
     1760
     1761  Void                   setLoopFilterAcrossTilesEnabledFlag(Bool b)                      { m_loopFilterAcrossTilesEnabledFlag = b;       }
     1762  Bool                   getLoopFilterAcrossTilesEnabledFlag() const                      { return m_loopFilterAcrossTilesEnabledFlag;    }
     1763  Bool                   getDependentSliceSegmentsEnabledFlag() const                     { return m_dependentSliceSegmentsEnabledFlag;   }
     1764  Void                   setDependentSliceSegmentsEnabledFlag(Bool val)                   { m_dependentSliceSegmentsEnabledFlag = val;    }
     1765  Bool                   getEntropyCodingSyncEnabledFlag() const                          { return m_entropyCodingSyncEnabledFlag;        }
     1766  Void                   setEntropyCodingSyncEnabledFlag(Bool val)                        { m_entropyCodingSyncEnabledFlag = val;         }
     1767
     1768  Void                   setTilesEnabledFlag(Bool val)                                    { m_tilesEnabledFlag = val;                     }
     1769  Bool                   getTilesEnabledFlag() const                                      { return m_tilesEnabledFlag;                    }
     1770  Void                   setTileUniformSpacingFlag(Bool b)                                { m_uniformSpacingFlag = b;                     }
     1771  Bool                   getTileUniformSpacingFlag() const                                { return m_uniformSpacingFlag;                  }
     1772  Void                   setNumTileColumnsMinus1(Int i)                                   { m_numTileColumnsMinus1 = i;                   }
     1773  Int                    getNumTileColumnsMinus1() const                                  { return m_numTileColumnsMinus1;                }
     1774  Void                   setTileColumnWidth(const std::vector<Int>& columnWidth )         { m_tileColumnWidth = columnWidth;              }
     1775  UInt                   getTileColumnWidth(UInt columnIdx) const                         { return  m_tileColumnWidth[columnIdx];         }
     1776  Void                   setNumTileRowsMinus1(Int i)                                      { m_numTileRowsMinus1 = i;                      }
     1777  Int                    getNumTileRowsMinus1() const                                     { return m_numTileRowsMinus1;                   }
     1778  Void                   setTileRowHeight(const std::vector<Int>& rowHeight)              { m_tileRowHeight = rowHeight;                  }
     1779  UInt                   getTileRowHeight(UInt rowIdx) const                              { return m_tileRowHeight[rowIdx];               }
     1780
     1781  Void                   setSignHideFlag( Bool signHideFlag )                             { m_signHideFlag = signHideFlag;                }
     1782  Bool                   getSignHideFlag() const                                          { return m_signHideFlag;                        }
     1783
     1784  Void                   setCabacInitPresentFlag( Bool flag )                             { m_cabacInitPresentFlag = flag;                }
     1785  Bool                   getCabacInitPresentFlag() const                                  { return m_cabacInitPresentFlag;                }
     1786  Void                   setDeblockingFilterControlPresentFlag( Bool val )                { m_deblockingFilterControlPresentFlag = val;   }
     1787  Bool                   getDeblockingFilterControlPresentFlag() const                    { return m_deblockingFilterControlPresentFlag;  }
     1788  Void                   setDeblockingFilterOverrideEnabledFlag( Bool val )               { m_deblockingFilterOverrideEnabledFlag = val;  }
     1789  Bool                   getDeblockingFilterOverrideEnabledFlag() const                   { return m_deblockingFilterOverrideEnabledFlag; }
     1790  Void                   setPicDisableDeblockingFilterFlag(Bool val)                      { m_picDisableDeblockingFilterFlag = val;       } //!< set offset for deblocking filter disabled
     1791  Bool                   getPicDisableDeblockingFilterFlag() const                        { return m_picDisableDeblockingFilterFlag;      } //!< get offset for deblocking filter disabled
     1792  Void                   setDeblockingFilterBetaOffsetDiv2(Int val)                       { m_deblockingFilterBetaOffsetDiv2 = val;       } //!< set beta offset for deblocking filter
     1793  Int                    getDeblockingFilterBetaOffsetDiv2() const                        { return m_deblockingFilterBetaOffsetDiv2;      } //!< get beta offset for deblocking filter
     1794  Void                   setDeblockingFilterTcOffsetDiv2(Int val)                         { m_deblockingFilterTcOffsetDiv2 = val;         } //!< set tc offset for deblocking filter
     1795  Int                    getDeblockingFilterTcOffsetDiv2() const                          { return m_deblockingFilterTcOffsetDiv2;        } //!< get tc offset for deblocking filter
     1796  Bool                   getScalingListPresentFlag() const                                { return m_scalingListPresentFlag;              }
     1797  Void                   setScalingListPresentFlag( Bool b )                              { m_scalingListPresentFlag  = b;                }
     1798
     1799  TComScalingList&       getScalingList()                                                 { return m_scalingList;                         }
     1800  const TComScalingList& getScalingList() const                                           { return m_scalingList;                         }
     1801  Bool                   getListsModificationPresentFlag() const                          { return m_listsModificationPresentFlag;        }
     1802  Void                   setListsModificationPresentFlag( Bool b )                        { m_listsModificationPresentFlag = b;           }
     1803  UInt                   getLog2ParallelMergeLevelMinus2() const                          { return m_log2ParallelMergeLevelMinus2;        }
     1804  Void                   setLog2ParallelMergeLevelMinus2(UInt mrgLevel)                   { m_log2ParallelMergeLevelMinus2 = mrgLevel;    }
     1805  Int                    getNumExtraSliceHeaderBits() const                               { return m_numExtraSliceHeaderBits;             }
     1806  Void                   setNumExtraSliceHeaderBits(Int i)                                { m_numExtraSliceHeaderBits = i;                }
     1807  Void                   setLoopFilterAcrossSlicesEnabledFlag( Bool bValue )              { m_loopFilterAcrossSlicesEnabledFlag = bValue; }
     1808  Bool                   getLoopFilterAcrossSlicesEnabledFlag() const                     { return m_loopFilterAcrossSlicesEnabledFlag;   }
     1809  Bool                   getSliceHeaderExtensionPresentFlag() const                       { return m_sliceHeaderExtensionPresentFlag;     }
     1810  Void                   setSliceHeaderExtensionPresentFlag(Bool val)                     { m_sliceHeaderExtensionPresentFlag = val;      }
    17771811#if SVC_EXTENSION
    1778   Void     setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; }
    1779 #else
    1780   Void     setScalingList      ( TComScalingList *scalingList);
    1781 #endif
    1782   TComScalingList* getScalingList ()          { return m_scalingList; }         //!< get ScalingList class pointer in PPS
    1783   Bool getListsModificationPresentFlag ()          { return m_listsModificationPresentFlag; }
    1784   Void setListsModificationPresentFlag ( Bool b )  { m_listsModificationPresentFlag = b;    }
    1785   UInt getLog2ParallelMergeLevelMinus2      ()                    { return m_log2ParallelMergeLevelMinus2; }
    1786   Void setLog2ParallelMergeLevelMinus2      (UInt mrgLevel)       { m_log2ParallelMergeLevelMinus2 = mrgLevel; }
    1787   Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; }
    1788   Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; }
    1789   Void      setLoopFilterAcrossSlicesEnabledFlag ( Bool   bValue  )    { m_loopFilterAcrossSlicesEnabledFlag = bValue; }
    1790   Bool      getLoopFilterAcrossSlicesEnabledFlag ()                    { return m_loopFilterAcrossSlicesEnabledFlag;   }
    1791     Bool getSliceHeaderExtensionPresentFlag   ()                    { return m_sliceHeaderExtensionPresentFlag; }
    1792   Void setSliceHeaderExtensionPresentFlag   (Bool val)            { m_sliceHeaderExtensionPresentFlag = val; }
    1793 #if SVC_EXTENSION
    1794   Int     getExtensionFlag()                                  { return m_extensionFlag;  }
    1795   Void    setExtensionFlag(Int n)                             { m_extensionFlag = n;     }
    1796   UInt     getLayerId()                                       { return m_layerId; }
    1797   Void     setLayerId( UInt layerId )                         { m_layerId = layerId;            }
    1798   Bool     getInferScalingListFlag()                          { return m_inferScalingListFlag;  }
    1799   UInt     getScalingListRefLayerId()                         { return m_scalingListRefLayerId; }
    1800   Void     setInferScalingListFlag( Bool flag )               { m_inferScalingListFlag = flag;     }
    1801   Void     setScalingListRefLayerId( UInt layerId )           { m_scalingListRefLayerId = layerId; }
    1802   Bool     getPocResetInfoPresentFlag()                       { return m_pocResetInfoPresentFlag; }
    1803   Void     setPocResetInfoPresentFlag(const Bool val)         { m_pocResetInfoPresentFlag = val;  }
    1804   UInt     getNumRefLayerLocationOffsets()                    { return m_numRefLayerLocationOffsets; }
    1805   Void     setNumRefLayerLocationOffsets(Int x)               { m_numRefLayerLocationOffsets = x;    }
    1806 
    1807   UInt     getRefLocationOffsetLayerId(Int x)                 { return m_refLocationOffsetLayerId[x]; }
    1808   Void     setRefLocationOffsetLayerId(Int x, UInt id)        { m_refLocationOffsetLayerId[x] = id;   }
    1809   Window&  getScaledRefLayerWindowForLayer( Int layerId );
    1810 
    1811   Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
    1812   Window&  getRefLayerWindowForLayer( Int layerId );
    1813   Window&  getRefLayerWindow( Int x )   { return m_refLayerWindow[x]; }
    1814   Bool getScaledRefLayerOffsetPresentFlag(Int x) { return m_scaledRefLayerOffsetPresentFlag[x]; }
    1815   Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; }
    1816   Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }
    1817   Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }
    1818   Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }
    1819   Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }
    1820   Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; }
    1821   Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; }
    1822   Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; }
    1823   Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; }
    1824   Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; }
    1825   Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; }
    1826   Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; }
    1827   Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }
    1828   Bool hasZeroResamplingPhase(Int refLayerId);
    1829   Void getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma);
     1812  Int                    getExtensionFlag() const                                         { return m_extensionFlag;                       }
     1813  Void                   setExtensionFlag(Int n)                                          { m_extensionFlag = n;                          }
     1814  UInt                   getLayerId() const                                               { return m_layerId;                             }
     1815  Void                   setLayerId( UInt layerId )                                       { m_layerId = layerId;                          }
     1816  Bool                   getInferScalingListFlag() const                                  { return m_inferScalingListFlag;                }
     1817  UInt                   getScalingListRefLayerId() const                                 { return m_scalingListRefLayerId;               }
     1818  Void                   setInferScalingListFlag( Bool flag )                             { m_inferScalingListFlag = flag;                }
     1819  Void                   setScalingListRefLayerId( UInt layerId )                         { m_scalingListRefLayerId = layerId;            }
     1820  Bool                   getPocResetInfoPresentFlag() const                               { return m_pocResetInfoPresentFlag;             }
     1821  Void                   setPocResetInfoPresentFlag(const Bool val)                       { m_pocResetInfoPresentFlag = val;              }
     1822  UInt                   getNumRefLayerLocationOffsets() const                            { return m_numRefLayerLocationOffsets;          }
     1823  Void                   setNumRefLayerLocationOffsets(Int x)                             { m_numRefLayerLocationOffsets = x;             }
     1824
     1825  UInt                   getRefLocationOffsetLayerId(Int x) const                         { return m_refLocationOffsetLayerId[x];         }
     1826  Void                   setRefLocationOffsetLayerId(Int x, UInt id)                      { m_refLocationOffsetLayerId[x] = id;           }
     1827  const Window&          getScaledRefLayerWindowForLayer( Int layerId ) const;
     1828
     1829  Window&                getScaledRefLayerWindow( Int x )                                 { return m_scaledRefLayerWindow[x];             }
     1830  const Window&          getScaledRefLayerWindow( Int x ) const                           { return m_scaledRefLayerWindow[x];             }
     1831  const Window&          getRefLayerWindowForLayer( Int layerId ) const;
     1832  Window&                getRefLayerWindow( Int x )                                       { return m_refLayerWindow[x];                   }
     1833  const Window&          getRefLayerWindow( Int x ) const                                 { return m_refLayerWindow[x];                   }
     1834  Bool                   getScaledRefLayerOffsetPresentFlag(Int x) const                  { return m_scaledRefLayerOffsetPresentFlag[x];  }
     1835  Void                   setScaledRefLayerOffsetPresentFlag(Int x, Bool b)                { m_scaledRefLayerOffsetPresentFlag[x] = b;     }
     1836  Bool                   getRefRegionOffsetPresentFlag(Int x) const                       { return m_refRegionOffsetPresentFlag[x];       }
     1837  Void                   setRefRegionOffsetPresentFlag(Int x, Bool b)                     { m_refRegionOffsetPresentFlag[x] = b;          }
     1838
     1839  Int                    getPhaseHorLuma(Int x) const                                     { return m_resamplingPhase[x].phaseHorLuma;     }
     1840  Int                    getPhaseVerLuma(Int x) const                                     { return m_resamplingPhase[x].phaseVerLuma;     }
     1841  Int                    getPhaseHorChroma(Int x) const                                   { return m_resamplingPhase[x].phaseHorChroma;   }
     1842  Int                    getPhaseVerChroma(Int x) const                                   { return m_resamplingPhase[x].phaseVerChroma;   }
     1843  Void                   setPhaseHorLuma(Int x, Int val)                                  { m_resamplingPhase[x].phaseHorLuma = val;      }
     1844  Void                   setPhaseVerLuma(Int x, Int val)                                  { m_resamplingPhase[x].phaseVerLuma = val;      }
     1845  Void                   setPhaseHorChroma(Int x, Int val)                                { m_resamplingPhase[x].phaseHorChroma = val;    }
     1846  Void                   setPhaseVerChroma(Int x, Int val)                                { m_resamplingPhase[x].phaseVerChroma = val;    }
     1847  Bool                   getResamplePhaseSetPresentFlag(Int x) const                      { return m_resamplingPhase[x].phasePresentFlag; }
     1848  Void                   setResamplePhaseSetPresentFlag(Int x, Bool b)                    { m_resamplingPhase[x].phasePresentFlag = b;    }
     1849
     1850  Bool                   hasZeroResamplingPhase(Int refLayerId) const;
     1851  const ResamplingPhase& getResamplingPhase(Int refLayerId) const;
    18301852#if CGS_3D_ASYMLUT
    1831   Int     getCGSFlag()                { return m_nCGSFlag;  }
    1832   Void    setCGSFlag(Int n)           { m_nCGSFlag = n;     }
    1833   Int     getCGSOutputBitDepthY()     { return m_nCGSOutputBitDepthY;  }
    1834   Void    setCGSOutputBitDepthY(Int n){ m_nCGSOutputBitDepthY = n;     }
    1835   Int     getCGSOutputBitDepthC()     { return m_nCGSOutputBitDepthC;  }
    1836   Void    setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n;     }
     1853  Int                    getCGSFlag() const                                               { return m_nCGSFlag;                            }
     1854  Void                   setCGSFlag(Int n)                                                { m_nCGSFlag = n;                               }
     1855  Int                    getCGSOutputBitDepthY() const                                    { return m_nCGSOutputBitDepthY;                 }
     1856  Void                   setCGSOutputBitDepthY(Int n)                                     { m_nCGSOutputBitDepthY = n;                    }
     1857  Int                    getCGSOutputBitDepthC() const                                    { return m_nCGSOutputBitDepthC;                 }
     1858  Void                   setCGSOutputBitDepthC(Int n)                                     { m_nCGSOutputBitDepthC = n;                    }
    18371859#endif
    18381860#endif //SVC_EXTENSION
     
    18681890class TComSlice
    18691891{
    1870  
     1892
    18711893private:
    18721894  //  Bitstream writing
    1873   Bool        m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE];
    1874   Int         m_iPPSId;               ///< picture parameter set ID
    1875   Bool        m_PicOutputFlag;        ///< pic_output_flag
    1876   Int         m_iPOC;
    1877   Int         m_iLastIDR;
    1878   Int         m_iAssociatedIRAP;
    1879   NalUnitType m_iAssociatedIRAPType;
    1880   static Int  m_prevTid0POC;
    1881   TComReferencePictureSet *m_pcRPS;
    1882   TComReferencePictureSet m_LocalRPS;
    1883   Int         m_iBDidx;
     1895  Bool                       m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE];
     1896  Int                        m_iPPSId;               ///< picture parameter set ID
     1897  Bool                       m_PicOutputFlag;        ///< pic_output_flag
     1898  Int                        m_iPOC;
     1899  Int                        m_iLastIDR;
     1900  Int                        m_iAssociatedIRAP;
     1901  NalUnitType                m_iAssociatedIRAPType;
     1902  static Int                 m_prevTid0POC;
     1903  TComReferencePictureSet*   m_pcRPS;
     1904  TComReferencePictureSet    m_LocalRPS;
     1905  Int                        m_iBDidx;
    18841906  TComRefPicListModification m_RefPicListModification;
    1885   NalUnitType m_eNalUnitType;         ///< Nal unit type for the slice
    1886   SliceType   m_eSliceType;
    1887   Int         m_iSliceQp;
    1888   Bool        m_dependentSliceSegmentFlag;
     1907  NalUnitType                m_eNalUnitType;         ///< Nal unit type for the slice
     1908  SliceType                  m_eSliceType;
     1909  Int                        m_iSliceQp;
     1910  Bool                       m_dependentSliceSegmentFlag;
    18891911#if ADAPTIVE_QP_SELECTION
    1890   Int         m_iSliceQpBase;
    1891 #endif
    1892   Bool        m_ChromaQpAdjEnabled;
    1893   Bool        m_deblockingFilterDisable;
    1894   Bool        m_deblockingFilterOverrideFlag;      //< offsets for deblocking filter inherit from PPS
    1895   Int         m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
    1896   Int         m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
    1897   Int         m_list1IdxToList0Idx[MAX_NUM_REF];
    1898   Int         m_aiNumRefIdx   [NUM_REF_PIC_LIST_01];    //  for multiple reference of current slice
    1899 
    1900   Bool        m_bCheckLDC;
     1912  Int                        m_iSliceQpBase;
     1913#endif
     1914  Bool                       m_ChromaQpAdjEnabled;
     1915  Bool                       m_deblockingFilterDisable;
     1916  Bool                       m_deblockingFilterOverrideFlag;      //< offsets for deblocking filter inherit from PPS
     1917  Int                        m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
     1918  Int                        m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
     1919  Int                        m_list1IdxToList0Idx[MAX_NUM_REF];
     1920  Int                        m_aiNumRefIdx   [NUM_REF_PIC_LIST_01];    //  for multiple reference of current slice
     1921
     1922  Bool                       m_bCheckLDC;
    19011923
    19021924  //  Data
    1903   Int         m_iSliceQpDelta;
    1904   Int         m_iSliceChromaQpDelta[MAX_NUM_COMPONENT];
    1905   TComPic*    m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
    1906   Int         m_aiRefPOCList  [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
    1907   Bool        m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
    1908   Int         m_iDepth;
     1925  Int                        m_iSliceQpDelta;
     1926  Int                        m_iSliceChromaQpDelta[MAX_NUM_COMPONENT];
     1927  TComPic*                   m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
     1928  Int                        m_aiRefPOCList  [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
     1929  Bool                       m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1];
     1930  Int                        m_iDepth;
    19091931
    19101932  // referenced slice?
    1911   Bool        m_bRefenced;
     1933  Bool                       m_bRefenced;
    19121934
    19131935  // access channel
    1914   TComVPS*    m_pcVPS;
    1915   TComSPS*    m_pcSPS;
    1916   TComPPS*    m_pcPPS;
    1917   TComPic*    m_pcPic;
     1936  const TComVPS*             m_pcVPS;
     1937  const TComSPS*             m_pcSPS;
     1938  const TComPPS*             m_pcPPS;
     1939  TComPic*                   m_pcPic;
    19181940#if ADAPTIVE_QP_SELECTION
    1919   TComTrQuant* m_pcTrQuant;
    1920 #endif
    1921   Bool        m_colFromL0Flag;  // collocated picture from List0 flag
    1922 
    1923   Bool        m_noOutputPriorPicsFlag;
    1924   Bool        m_noRaslOutputFlag;
    1925   Bool        m_handleCraAsBlaFlag;
    1926  
    1927   UInt        m_colRefIdx;
    1928   UInt        m_maxNumMergeCand;
    1929 
    1930   Double      m_lambdas[MAX_NUM_COMPONENT];
    1931 
    1932   Bool        m_abEqualRef  [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF];
    1933   UInt        m_uiTLayer;
    1934   Bool        m_bTLayerSwitchingFlag;
    1935 
    1936   SliceConstraint m_sliceMode;
    1937   UInt        m_sliceArgument;
    1938   UInt        m_sliceCurStartCtuTsAddr;
    1939   UInt        m_sliceCurEndCtuTsAddr;
    1940   UInt        m_sliceIdx;
    1941   SliceConstraint m_sliceSegmentMode;
    1942   UInt        m_sliceSegmentArgument;
    1943   UInt        m_sliceSegmentCurStartCtuTsAddr;
    1944   UInt        m_sliceSegmentCurEndCtuTsAddr;
    1945   Bool        m_nextSlice;
    1946   Bool        m_nextSliceSegment;
    1947   UInt        m_sliceBits;
    1948   UInt        m_sliceSegmentBits;
    1949   Bool        m_bFinalized;
    1950 
    1951   WPScalingParam  m_weightPredTable[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V]
    1952   WPACDCParam    m_weightACDCParam[MAX_NUM_COMPONENT];
    1953 
    1954   std::vector<UInt> m_substreamSizes;
    1955 
    1956   TComScalingList*     m_scalingList;                 //!< pointer of quantization matrix
    1957   Bool        m_cabacInitFlag;
    1958 
    1959   Bool       m_bLMvdL1Zero;
    1960   Bool       m_temporalLayerNonReferenceFlag;
    1961   Bool       m_LFCrossSliceBoundaryFlag;
    1962 
    1963   Bool       m_enableTMVPFlag;
     1941  TComTrQuant*               m_pcTrQuant;
     1942#endif
     1943  Bool                       m_colFromL0Flag;  // collocated picture from List0 flag
     1944
     1945  Bool                       m_noOutputPriorPicsFlag;
     1946  Bool                       m_noRaslOutputFlag;
     1947  Bool                       m_handleCraAsBlaFlag;
     1948
     1949  UInt                       m_colRefIdx;
     1950  UInt                       m_maxNumMergeCand;
     1951
     1952  Double                     m_lambdas[MAX_NUM_COMPONENT];
     1953
     1954  Bool                       m_abEqualRef  [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF];
     1955  UInt                       m_uiTLayer;
     1956  Bool                       m_bTLayerSwitchingFlag;
     1957
     1958  SliceConstraint            m_sliceMode;
     1959  UInt                       m_sliceArgument;
     1960  UInt                       m_sliceCurStartCtuTsAddr;
     1961  UInt                       m_sliceCurEndCtuTsAddr;
     1962  UInt                       m_sliceIdx;
     1963  SliceConstraint            m_sliceSegmentMode;
     1964  UInt                       m_sliceSegmentArgument;
     1965  UInt                       m_sliceSegmentCurStartCtuTsAddr;
     1966  UInt                       m_sliceSegmentCurEndCtuTsAddr;
     1967  Bool                       m_nextSlice;
     1968  Bool                       m_nextSliceSegment;
     1969  UInt                       m_sliceBits;
     1970  UInt                       m_sliceSegmentBits;
     1971  Bool                       m_bFinalized;
     1972
     1973  Bool                       m_bTestWeightPred;
     1974  Bool                       m_bTestWeightBiPred;
     1975  WPScalingParam             m_weightPredTable[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V]
     1976  WPACDCParam                m_weightACDCParam[MAX_NUM_COMPONENT];
     1977
     1978  std::vector<UInt>          m_substreamSizes;
     1979
     1980  Bool                       m_cabacInitFlag;
     1981
     1982  Bool                       m_bLMvdL1Zero;
     1983  Bool                       m_temporalLayerNonReferenceFlag;
     1984  Bool                       m_LFCrossSliceBoundaryFlag;
     1985
     1986  Bool                       m_enableTMVPFlag;
     1987
     1988  SliceType                  m_encCABACTableIdx;           // Used to transmit table selection across slices.
    19641989
    19651990#if SVC_EXTENSION
    1966   Int         m_associatedIrapPocBeforeReset;
    1967   Bool        m_firstSliceInPic;
    1968   Bool        m_availableForTMVPRefFlag;
    1969   UInt        m_layerId;
    1970   TComPic*    m_pcBaseColPic[MAX_LAYERS];
    1971   TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS];
    1972   Int         m_numMotionPredRefLayers;
    1973   Bool        m_bMFMEnabledFlag;
    1974   Int         m_colRefLayerIdx;
    1975   Bool        m_altColIndicationFlag;
    1976   TComPic*    m_pcIlpPic;
    1977 
    1978   Bool        m_interLayerPredEnabledFlag;
    1979   Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
    1980   Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_IDX_PLUS1];
    1981   Bool        m_bDiscardableFlag;
    1982   Bool        m_bCrossLayerBLAFlag;
    1983   Int         m_pocResetIdc;
    1984   Int         m_pocResetPeriodId;
    1985   Bool        m_fullPocResetFlag;
    1986   Int         m_pocLsbVal;
    1987   Int         m_pocMsbVal;
    1988   Bool        m_pocMsbValRequiredFlag;
    1989   Bool        m_pocMsbValPresentFlag;
    1990   Bool        m_pocMsbValNeeded;
    1991   Int         m_pocResetDeltaPoc;
    1992   Int         m_pocValueBeforeReset;
    1993   Int         m_picOrderCntLsb;
     1991  Int                        m_associatedIrapPocBeforeReset;
     1992  Bool                       m_firstSliceInPic;
     1993  Bool                       m_availableForTMVPRefFlag;
     1994  UInt                       m_layerId;
     1995  TComPic*                   m_pcBaseColPic[MAX_LAYERS];
     1996  TComPicYuv*                m_pcFullPelBaseRec[MAX_LAYERS];
     1997  Int                        m_numMotionPredRefLayers;
     1998  Bool                       m_bMFMEnabledFlag;
     1999  Int                        m_colRefLayerIdx;
     2000  Bool                       m_altColIndicationFlag;
     2001  TComPic*                   m_pcIlpPic;
     2002
     2003  Bool                       m_interLayerPredEnabledFlag;
     2004  Int                        m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
     2005  Int                        m_interLayerPredLayerIdc  [MAX_VPS_LAYER_IDX_PLUS1];
     2006  Bool                       m_bDiscardableFlag;
     2007  Bool                       m_bCrossLayerBLAFlag;
     2008  Int                        m_pocResetIdc;
     2009  Int                        m_pocResetPeriodId;
     2010  Bool                       m_fullPocResetFlag;
     2011  Int                        m_pocLsbVal;
     2012  Int                        m_pocMsbVal;
     2013  Bool                       m_pocMsbValRequiredFlag;
     2014  Bool                       m_pocMsbValPresentFlag;
     2015  Bool                       m_pocMsbValNeeded;
     2016  Int                        m_pocResetDeltaPoc;
     2017  Int                        m_pocValueBeforeReset;
     2018  Int                        m_picOrderCntLsb;
    19942019#if CGS_3D_ASYMLUT
    1995   Int        m_nCGSOverWritePPS;  // for optimization, not output to bitstream
     2020  Int                        m_nCGSOverWritePPS;  // for optimization, not output to bitstream
    19962021#endif
    19972022#endif //SVC_EXTENSION
    19982023
    19992024public:
    2000   TComSlice();
    2001   virtual ~TComSlice();
     2025                              TComSlice();
     2026  virtual                     ~TComSlice();
    20022027#if SVC_EXTENSION
    2003   Void      initSlice       ( UInt layerId );
     2028  Void                        initSlice( UInt layerId );
     2029  Void                        setVPS( const TComVPS* pcVPS )                         { m_pcVPS = pcVPS;                                              }
    20042030#else
    2005   Void      initSlice       ();
    2006 #endif
    2007   Void      initTiles();
    2008 
    2009   Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
    2010   TComVPS*  getVPS          () { return m_pcVPS; }
    2011   Void      setSPS          ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; }
    2012   TComSPS*  getSPS          () { return m_pcSPS; }
    2013   const TComSPS*  getSPS() const  { return m_pcSPS; }
    2014 
    2015   Void      setPPS          ( TComPPS* pcPPS )         { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); }
    2016   TComPPS*  getPPS          () { return m_pcPPS; }
    2017   const TComPPS*  getPPS() const { return m_pcPPS; }
     2031  Void                        initSlice();
     2032#endif
     2033
     2034  Void                        setVPS( TComVPS* pcVPS )                               { m_pcVPS = pcVPS;                                              }
     2035  const TComVPS*              getVPS() const                                         { return m_pcVPS;                                               }
     2036  Void                        setSPS( const TComSPS* pcSPS )                         { m_pcSPS = pcSPS;                                              }
     2037  const TComSPS*              getSPS() const                                         { return m_pcSPS;                                               }
     2038
     2039  Void                        setPPS( const TComPPS* pcPPS )                         { m_pcPPS = pcPPS; m_iPPSId = (pcPPS) ? pcPPS->getPPSId() : -1; }
     2040  const TComPPS*              getPPS() const                                         { return m_pcPPS;                                               }
    20182041
    20192042#if ADAPTIVE_QP_SELECTION
    2020   Void          setTrQuant          ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; }
    2021   TComTrQuant*  getTrQuant          () { return m_pcTrQuant; }
    2022 #endif
    2023 
    2024   Void      setPPSId        ( Int PPSId )         { m_iPPSId = PPSId; }
    2025   Int       getPPSId        () { return m_iPPSId; }
    2026   Void      setPicOutputFlag( Bool b )         { m_PicOutputFlag = b;    }
    2027   Bool      getPicOutputFlag()                 { return m_PicOutputFlag; }
    2028   Void      setSaoEnabledFlag(ChannelType chType, Bool s) {m_saoEnabledFlag[chType] =s; }
    2029   Bool      getSaoEnabledFlag(ChannelType chType) { return m_saoEnabledFlag[chType]; }
    2030   Void      setRPS          ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; }
    2031   TComReferencePictureSet*  getRPS          () { return m_pcRPS; }
    2032   TComReferencePictureSet*  getLocalRPS     () { return &m_LocalRPS; }
    2033 
    2034   Void      setRPSidx          ( Int iBDidx ) { m_iBDidx = iBDidx; }
    2035   Int       getRPSidx          () { return m_iBDidx; }
    2036   Int       getPrevTid0POC      ()                        { return  m_prevTid0POC;       }
    2037   TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; }
    2038   Void      setLastIDR(Int iIDRPOC)                       { m_iLastIDR = iIDRPOC; }
    2039   Int       getLastIDR()                                  { return m_iLastIDR; }
    2040   Void      setAssociatedIRAPPOC(Int iAssociatedIRAPPOC)             { m_iAssociatedIRAP = iAssociatedIRAPPOC; }
    2041   Int       getAssociatedIRAPPOC()                        { return m_iAssociatedIRAP; }
    2042   Void      setAssociatedIRAPType(NalUnitType associatedIRAPType)    { m_iAssociatedIRAPType = associatedIRAPType; }
    2043   NalUnitType getAssociatedIRAPType()                        { return m_iAssociatedIRAPType; }
    2044   SliceType getSliceType    ()                          { return  m_eSliceType;         }
    2045   Int       getPOC          ()                          { return  m_iPOC;           }
    2046   Int       getSliceQp      ()                          { return  m_iSliceQp;           }
    2047   Bool      getDependentSliceSegmentFlag()             const { return m_dependentSliceSegmentFlag; }
    2048   Void      setDependentSliceSegmentFlag(Bool val)           { m_dependentSliceSegmentFlag = val; }
     2043  Void                        setTrQuant( TComTrQuant* pcTrQuant )                   { m_pcTrQuant = pcTrQuant;                                      }
     2044  TComTrQuant*                getTrQuant()                                           { return m_pcTrQuant;                                           }
     2045  const TComTrQuant*          getTrQuant() const                                     { return m_pcTrQuant;                                           }
     2046#endif
     2047
     2048  Void                        setPPSId( Int PPSId )                                  { m_iPPSId = PPSId;                                             }
     2049  Int                         getPPSId() const                                       { return m_iPPSId;                                              }
     2050  Void                        setPicOutputFlag( Bool b   )                           { m_PicOutputFlag = b;                                          }
     2051  Bool                        getPicOutputFlag() const                               { return m_PicOutputFlag;                                       }
     2052  Void                        setSaoEnabledFlag(ChannelType chType, Bool s)          {m_saoEnabledFlag[chType] =s;                                   }
     2053  Bool                        getSaoEnabledFlag(ChannelType chType) const            { return m_saoEnabledFlag[chType];                              }
     2054  Void                        setRPS( TComReferencePictureSet *pcRPS )               { m_pcRPS = pcRPS;                                              }
     2055  TComReferencePictureSet*    getRPS()                                               { return m_pcRPS;                                               }
     2056  TComReferencePictureSet*    getLocalRPS()                                          { return &m_LocalRPS;                                           }
     2057
     2058  Void                        setRPSidx( Int iBDidx )                                { m_iBDidx = iBDidx;                                            }
     2059  Int                         getRPSidx() const                                      { return m_iBDidx;                                              }
     2060  Int                         getPrevTid0POC() const                                 { return m_prevTid0POC;                                         }
     2061  TComRefPicListModification* getRefPicListModification()                            { return &m_RefPicListModification;                             }
     2062  Void                        setLastIDR(Int iIDRPOC)                                { m_iLastIDR = iIDRPOC;                                         }
     2063  Int                         getLastIDR() const                                     { return m_iLastIDR;                                            }
     2064  Void                        setAssociatedIRAPPOC(Int iAssociatedIRAPPOC)           { m_iAssociatedIRAP = iAssociatedIRAPPOC;                       }
     2065  Int                         getAssociatedIRAPPOC() const                           { return m_iAssociatedIRAP;                                     }
     2066  Void                        setAssociatedIRAPType(NalUnitType associatedIRAPType)  { m_iAssociatedIRAPType = associatedIRAPType;                   }
     2067  NalUnitType                 getAssociatedIRAPType() const                          { return m_iAssociatedIRAPType;                                 }
     2068  SliceType                   getSliceType() const                                   { return m_eSliceType;                                          }
     2069  Int                         getPOC() const                                         { return m_iPOC;                                                }
     2070  Int                         getSliceQp() const                                     { return m_iSliceQp;                                            }
     2071  Bool                        getDependentSliceSegmentFlag() const                   { return m_dependentSliceSegmentFlag;                           }
     2072  Void                        setDependentSliceSegmentFlag(Bool val)                 { m_dependentSliceSegmentFlag = val;                            }
    20492073#if ADAPTIVE_QP_SELECTION
    2050   Int       getSliceQpBase  ()                         const { return  m_iSliceQpBase;       }
    2051 #endif
    2052   Int       getSliceQpDelta ()                         const { return  m_iSliceQpDelta;      }
    2053   Int       getSliceChromaQpDelta (ComponentID compID) const { return  isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID]; }
    2054   Bool      getUseChromaQpAdj()                        const { return m_ChromaQpAdjEnabled; }
    2055   Bool      getDeblockingFilterDisable()               const { return  m_deblockingFilterDisable; }
    2056   Bool      getDeblockingFilterOverrideFlag()          const { return  m_deblockingFilterOverrideFlag; }
    2057   Int       getDeblockingFilterBetaOffsetDiv2()        const { return  m_deblockingFilterBetaOffsetDiv2; }
    2058   Int       getDeblockingFilterTcOffsetDiv2()          const { return  m_deblockingFilterTcOffsetDiv2; }
    2059 
    2060   Int       getNumRefIdx        ( RefPicList e )       const    { return  m_aiNumRefIdx[e];             }
    2061   TComPic*  getPic              ()                              { return  m_pcPic;                      }
    2062   TComPic*  getRefPic           ( RefPicList e, Int iRefIdx)    { return  m_apcRefPicList[e][iRefIdx];  }
    2063   Int       getRefPOC           ( RefPicList e, Int iRefIdx)    { return  m_aiRefPOCList[e][iRefIdx];   }
    2064   Int       getDepth            ()                              { return  m_iDepth;                     }
    2065   Bool      getColFromL0Flag    ()                              { return  m_colFromL0Flag;              }
    2066   UInt      getColRefIdx        ()                              { return  m_colRefIdx;                  }
    2067   Void      checkColRefIdx      (UInt curSliceIdx, TComPic* pic);
    2068   Bool      getIsUsedAsLongTerm (Int i, Int j)                  { return m_bIsUsedAsLongTerm[i][j]; }
    2069   Void      setIsUsedAsLongTerm (Int i, Int j, Bool value)      { m_bIsUsedAsLongTerm[i][j] = value; }
    2070   Bool      getCheckLDC     ()                                  { return m_bCheckLDC; }
    2071   Bool      getMvdL1ZeroFlag ()                                 { return m_bLMvdL1Zero;    }
    2072   Int       getNumRpsCurrTempList();
    2073   Int       getList1IdxToList0Idx ( Int list1Idx )              { return m_list1IdxToList0Idx[list1Idx]; }
    2074   Void      setReferenced(Bool b)                               { m_bRefenced = b; }
    2075   Bool      isReferenced()                                      { return m_bRefenced; }
    2076   Bool      isReferenceNalu()                                   { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); }
    2077   Void      setPOC              ( Int i )                       { m_iPOC              = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} }
    2078   Void      setNalUnitType      ( NalUnitType e )               { m_eNalUnitType      = e;      }
    2079   NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
    2080   Bool      getRapPicFlag       ();
    2081   Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    2082   Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); }
    2083   Void      checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);
     2074  Int                         getSliceQpBase() const                                 { return m_iSliceQpBase;                                        }
     2075#endif
     2076  Int                         getSliceQpDelta() const                                { return m_iSliceQpDelta;                                       }
     2077  Int                         getSliceChromaQpDelta(ComponentID compID) const        { return isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID];    }
     2078  Bool                        getUseChromaQpAdj() const                              { return m_ChromaQpAdjEnabled;                                  }
     2079  Bool                        getDeblockingFilterDisable() const                     { return m_deblockingFilterDisable;                            }
     2080  Bool                        getDeblockingFilterOverrideFlag() const                { return m_deblockingFilterOverrideFlag;                        }
     2081  Int                         getDeblockingFilterBetaOffsetDiv2()const               { return m_deblockingFilterBetaOffsetDiv2;                      }
     2082  Int                         getDeblockingFilterTcOffsetDiv2() const                { return m_deblockingFilterTcOffsetDiv2;                        }
     2083
     2084  Int                         getNumRefIdx( RefPicList e ) const                     { return m_aiNumRefIdx[e];                                      }
     2085  TComPic*                    getPic()                                               { return m_pcPic;                                               }
     2086  TComPic*                    getRefPic( RefPicList e, Int iRefIdx)                  { return m_apcRefPicList[e][iRefIdx];                           }
     2087  Int                         getRefPOC( RefPicList e, Int iRefIdx)                  { return m_aiRefPOCList[e][iRefIdx];                            }
     2088  Int                         getDepth() const                                       { return m_iDepth;                                              }
     2089  Bool                        getColFromL0Flag() const                               { return m_colFromL0Flag;                                       }
     2090  UInt                        getColRefIdx() const                                   { return m_colRefIdx;                                           }
     2091  Void                        checkColRefIdx(UInt curSliceIdx, TComPic* pic);
     2092  Bool                        getIsUsedAsLongTerm(Int i, Int j) const                { return m_bIsUsedAsLongTerm[i][j];                            }
     2093  Void                        setIsUsedAsLongTerm(Int i, Int j, Bool value)          { m_bIsUsedAsLongTerm[i][j] = value;                            }
     2094  Bool                        getCheckLDC() const                                    { return m_bCheckLDC;                                          }
     2095  Bool                        getMvdL1ZeroFlag() const                               { return m_bLMvdL1Zero;                                         }
     2096  Int                         getNumRpsCurrTempList() const;
     2097  Int                         getList1IdxToList0Idx( Int list1Idx ) const            { return m_list1IdxToList0Idx[list1Idx];                        }
     2098  Void                        setReferenced(Bool b)                                  { m_bRefenced = b;                                              }
     2099  Bool                        isReferenced() const                                   { return m_bRefenced;                                          }
     2100  Bool                        isReferenceNalu() const                                { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); }
     2101  Void                        setPOC( Int i )                                        { m_iPOC              = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} }
     2102  Void                        setNalUnitType( NalUnitType e )                        { m_eNalUnitType      = e;                                      }
     2103  NalUnitType                 getNalUnitType() const                                 { return m_eNalUnitType;                                        }
     2104  Bool                        getRapPicFlag() const;
     2105  Bool                        getIdrPicFlag() const                                  { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
     2106  Bool                        isIRAP() const                                         { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); }
     2107  Void                        checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic);
    20842108#if NO_CLRAS_OUTPUT_FLAG
    2085   Void      decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 );
    2086   Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag);
     2109  Void                        decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 );
     2110  Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag);
    20872111#else
    2088   Void      decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
    2089 #endif
    2090   Void      setSliceType        ( SliceType e )                 { m_eSliceType        = e;      }
    2091   Void      setSliceQp          ( Int i )                       { m_iSliceQp          = i;      }
     2112  Void                        decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic);
     2113#endif
     2114  Void                        setSliceType( SliceType e )                            { m_eSliceType        = e;                                      }
     2115  Void                        setSliceQp( Int i )                                    { m_iSliceQp          = i;                                      }
    20922116#if ADAPTIVE_QP_SELECTION
    2093   Void      setSliceQpBase      ( Int i )                       { m_iSliceQpBase      = i;      }
    2094 #endif
    2095   Void      setSliceQpDelta     ( Int i )                       { m_iSliceQpDelta     = i;      }
    2096   Void      setSliceChromaQpDelta( ComponentID compID, Int i )  { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i;  }
    2097   Void      setUseChromaQpAdj   ( Bool b )                      { m_ChromaQpAdjEnabled = b;     }
    2098   Void      setDeblockingFilterDisable( Bool b )                { m_deblockingFilterDisable= b;      }
    2099   Void      setDeblockingFilterOverrideFlag( Bool b )           { m_deblockingFilterOverrideFlag = b; }
    2100   Void      setDeblockingFilterBetaOffsetDiv2( Int i )          { m_deblockingFilterBetaOffsetDiv2 = i; }
    2101   Void      setDeblockingFilterTcOffsetDiv2( Int i )            { m_deblockingFilterTcOffsetDiv2 = i; }
    2102 
    2103   Void      setRefPic           ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; }
    2104   Void      setRefPOC           ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
    2105   Void      setNumRefIdx        ( RefPicList e, Int i )         { m_aiNumRefIdx[e]    = i;      }
    2106   Void      setPic              ( TComPic* p )                  { m_pcPic             = p;      }
    2107   Void      setDepth            ( Int iDepth )                  { m_iDepth            = iDepth; }
     2117  Void                        setSliceQpBase( Int i )                                { m_iSliceQpBase      = i;                                      }
     2118#endif
     2119  Void                        setSliceQpDelta( Int i )                               { m_iSliceQpDelta     = i;                                      }
     2120  Void                        setSliceChromaQpDelta( ComponentID compID, Int i )     { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i;       }
     2121  Void                        setUseChromaQpAdj( Bool b )                            { m_ChromaQpAdjEnabled = b;                                     }
     2122  Void                        setDeblockingFilterDisable( Bool b )                   { m_deblockingFilterDisable= b;                                 }
     2123  Void                        setDeblockingFilterOverrideFlag( Bool b )              { m_deblockingFilterOverrideFlag = b;                          }
     2124  Void                        setDeblockingFilterBetaOffsetDiv2( Int i )             { m_deblockingFilterBetaOffsetDiv2 = i;                        }
     2125  Void                        setDeblockingFilterTcOffsetDiv2( Int i )               { m_deblockingFilterTcOffsetDiv2 = i;                          }
     2126
     2127  Void                        setRefPic( TComPic* p, RefPicList e, Int iRefIdx )     { m_apcRefPicList[e][iRefIdx] = p;                              }
     2128  Void                        setRefPOC( Int i, RefPicList e, Int iRefIdx )          { m_aiRefPOCList[e][iRefIdx] = i;                              }
     2129  Void                        setNumRefIdx( RefPicList e, Int i )                    { m_aiNumRefIdx[e]    = i;                                      }
     2130  Void                        setPic( TComPic* p )                                   { m_pcPic             = p;                                      }
     2131  Void                        setDepth( Int iDepth )                                 { m_iDepth            = iDepth;                                }
    21082132
    21092133#if SVC_EXTENSION
    2110   Void      setPrevTid0POC( Int x ) { m_prevTid0POC = x; }
    2111   Void      setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; }
    2112   Int       getAssociatedIrapPocBeforeReset(     ) { return m_associatedIrapPocBeforeReset; }
    2113 
    2114   Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL );
     2134  Void                        setPrevTid0POC( Int x )                                { m_prevTid0POC = x;                                            }
     2135  Void                        setAssociatedIrapPocBeforeReset(Int x)                 { m_associatedIrapPocBeforeReset = x;                          }
     2136  Int                         getAssociatedIrapPocBeforeReset(     )                 { return m_associatedIrapPocBeforeReset;                        }
     2137
     2138  Void                        setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL );
    21152139#if CGS_3D_ASYMLUT
    2116   Int       getCGSOverWritePPS()              { return m_nCGSOverWritePPS;    }
    2117   Void      setCGSOverWritePPS(Int n)         { m_nCGSOverWritePPS = n;       }
     2140  Int                         getCGSOverWritePPS()              { return m_nCGSOverWritePPS;    }
     2141  Void                        setCGSOverWritePPS(Int n)         { m_nCGSOverWritePPS = n;       }
    21182142#endif
    21192143#else
    2120   Void      setRefPicList       ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );
    2121 #endif
    2122   Void      setRefPOCList       ();
    2123   Void      setColFromL0Flag    ( Bool colFromL0 ) { m_colFromL0Flag = colFromL0; }
    2124   Void      setColRefIdx        ( UInt refIdx) { m_colRefIdx = refIdx; }
    2125   Void      setCheckLDC         ( Bool b )                      { m_bCheckLDC = b; }
    2126   Void      setMvdL1ZeroFlag     ( Bool b)                       { m_bLMvdL1Zero = b; }
    2127 
    2128   Bool      isIntra         ()                          { return  m_eSliceType == I_SLICE;  }
    2129   Bool      isInterB        ()                          { return  m_eSliceType == B_SLICE;  }
    2130   Bool      isInterP        ()                          { return  m_eSliceType == P_SLICE;  }
    2131 
    2132   Void      setLambdas ( const Double lambdas[MAX_NUM_COMPONENT] ) { for (Int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; }
    2133   const Double* getLambdas() const { return m_lambdas; }
    2134 
    2135   Void      initEqualRef();
    2136   Bool      isEqualRef  ( RefPicList e, Int iRefIdx1, Int iRefIdx2 )
     2144  Void                        setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false );
     2145#endif
     2146  Void                        setRefPOCList();
     2147  Void                        setColFromL0Flag( Bool colFromL0 )                     { m_colFromL0Flag = colFromL0;                                  }
     2148  Void                        setColRefIdx( UInt refIdx)                             { m_colRefIdx = refIdx;                                        }
     2149  Void                        setCheckLDC( Bool b )                                  { m_bCheckLDC = b;                                              }
     2150  Void                        setMvdL1ZeroFlag( Bool b)                              { m_bLMvdL1Zero = b;                                            }
     2151
     2152  Bool                        isIntra() const                                        { return m_eSliceType == I_SLICE;                               }
     2153  Bool                        isInterB() const                                       { return m_eSliceType == B_SLICE;                               }
     2154  Bool                        isInterP() const                                       { return m_eSliceType == P_SLICE;                               }
     2155
     2156  Void                        setLambdas( const Double lambdas[MAX_NUM_COMPONENT] ) { for (Int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; }
     2157  const Double*               getLambdas() const                                     { return m_lambdas;                                            }
     2158
     2159  Void                        initEqualRef();
     2160  Bool                        isEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2 )
    21372161  {
    21382162    assert(e<NUM_REF_PIC_LIST_01);
    2139     if (iRefIdx1 < 0 || iRefIdx2 < 0) return false;
    2140     return m_abEqualRef[e][iRefIdx1][iRefIdx2];
     2163    if (iRefIdx1 < 0 || iRefIdx2 < 0)
     2164    {
     2165      return false;
     2166    }
     2167    else
     2168    {
     2169      return m_abEqualRef[e][iRefIdx1][iRefIdx2];
     2170    }
    21412171  }
    21422172
    2143   Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b)
     2173  Void                        setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b)
    21442174  {
    21452175    assert(e<NUM_REF_PIC_LIST_01);
     
    21472177  }
    21482178
    2149   static Void      sortPicList         ( TComList<TComPic*>& rcListPic );
    2150   Void setList1IdxToList0Idx();
    2151 
    2152   UInt getTLayer             ()                            { return m_uiTLayer;                      }
    2153   Void setTLayer             ( UInt uiTLayer )             { m_uiTLayer = uiTLayer;                  }
    2154 
    2155   Void setTLayerInfo( UInt uiTLayer );
    2156   Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum );
     2179  static Void                 sortPicList( TComList<TComPic*>& rcListPic );
     2180  Void                        setList1IdxToList0Idx();
     2181
     2182  UInt                        getTLayer() const                                      { return m_uiTLayer;                                            }
     2183  Void                        setTLayer( UInt uiTLayer )                             { m_uiTLayer = uiTLayer;                                        }
     2184
     2185  Void                        setTLayerInfo( UInt uiTLayer );
     2186  Void                        decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum );
     2187
    21572188#if SVC_POC
    2158   Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false);
     2189  Void                        checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false);
    21592190#else
    2160   Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic );
    2161 #endif
    2162   Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
    2163   Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
    2164   Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
     2191  Void                        checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic );
     2192#endif
     2193  Void                        applyReferencePictureSet( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *RPSList);
     2194  Bool                        isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
     2195  Bool                        isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic );
    21652196#if ALLOW_RECOVERY_POINT_AS_RAP
    2166   Int  checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
    2167   Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2197  Int                         checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
     2198  Void                        createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false);
    21682199#else
    2169   Int  checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
    2170   Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
    2171 #endif
    2172   Void setMaxNumMergeCand               (UInt val )          { m_maxNumMergeCand = val;                 }
    2173   UInt getMaxNumMergeCand               ()                   { return m_maxNumMergeCand;                }
    2174 
    2175   Void setNoOutputPriorPicsFlag         ( Bool val )         { m_noOutputPriorPicsFlag = val;           }
    2176   Bool getNoOutputPriorPicsFlag         ()                   { return m_noOutputPriorPicsFlag;          }
    2177 
    2178   Void setNoRaslOutputFlag              ( Bool val )         { m_noRaslOutputFlag = val;                }
    2179   Bool getNoRaslOutputFlag              ()                   { return m_noRaslOutputFlag;               }
    2180 
    2181   Void setHandleCraAsBlaFlag            ( Bool val )         { m_handleCraAsBlaFlag = val;              }
    2182   Bool getHandleCraAsBlaFlag            ()                   { return m_handleCraAsBlaFlag;             }
    2183 
    2184   Void setSliceMode                     ( SliceConstraint mode ) { m_sliceMode = mode;                  }
    2185   SliceConstraint getSliceMode          () const            { return m_sliceMode;                       }
    2186   Void setSliceArgument                 ( UInt uiArgument ) { m_sliceArgument = uiArgument;             }
    2187   UInt getSliceArgument                 ()                  { return m_sliceArgument;                   }
    2188   Void setSliceCurStartCtuTsAddr        ( UInt ctuTsAddr )  { m_sliceCurStartCtuTsAddr = ctuTsAddr;     } // CTU Tile-scan address (as opposed to raster-scan)
    2189   UInt getSliceCurStartCtuTsAddr        () const            { return m_sliceCurStartCtuTsAddr;          } // CTU Tile-scan address (as opposed to raster-scan)
    2190   Void setSliceCurEndCtuTsAddr          ( UInt ctuTsAddr )  { m_sliceCurEndCtuTsAddr = ctuTsAddr;       } // CTU Tile-scan address (as opposed to raster-scan)
    2191   UInt getSliceCurEndCtuTsAddr          () const            { return m_sliceCurEndCtuTsAddr;            } // CTU Tile-scan address (as opposed to raster-scan)
    2192   Void setSliceIdx                      ( UInt i)           { m_sliceIdx = i;                           }
    2193   UInt getSliceIdx                      ()                  { return  m_sliceIdx;                       }
    2194   Void copySliceInfo                    (TComSlice *pcSliceSrc);
    2195   Void setSliceSegmentMode              ( SliceConstraint mode ) { m_sliceSegmentMode = mode;           }
    2196   SliceConstraint getSliceSegmentMode   () const            { return m_sliceSegmentMode;                }
    2197   Void setSliceSegmentArgument          ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument;      }
    2198   UInt getSliceSegmentArgument          ()                  { return m_sliceSegmentArgument;            }
    2199   Void setSliceSegmentCurStartCtuTsAddr ( UInt ctuTsAddr )  { m_sliceSegmentCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan)
    2200   UInt getSliceSegmentCurStartCtuTsAddr () const            { return m_sliceSegmentCurStartCtuTsAddr;      } // CTU Tile-scan address (as opposed to raster-scan)
    2201   Void setSliceSegmentCurEndCtuTsAddr   ( UInt ctuTsAddr )  { m_sliceSegmentCurEndCtuTsAddr = ctuTsAddr;   } // CTU Tile-scan address (as opposed to raster-scan)
    2202   UInt getSliceSegmentCurEndCtuTsAddr   () const            { return m_sliceSegmentCurEndCtuTsAddr;        } // CTU Tile-scan address (as opposed to raster-scan)
    2203   Void setSliceBits                     ( UInt uiVal )      { m_sliceBits = uiVal;                      }
    2204   UInt getSliceBits                     ()                  { return m_sliceBits;                       }
    2205   Void setSliceSegmentBits              ( UInt uiVal )      { m_sliceSegmentBits = uiVal;            }
    2206   UInt getSliceSegmentBits              ()                  { return m_sliceSegmentBits;             }
    2207   Void setFinalized                     ( Bool uiVal )      { m_bFinalized = uiVal;                       }
    2208   Bool getFinalized                     ()                  { return m_bFinalized;                        }
    2209   Void  setWpScaling    ( WPScalingParam  wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT] ) { memcpy(m_weightPredTable, wp, sizeof(WPScalingParam)*NUM_REF_PIC_LIST_01*MAX_NUM_REF*MAX_NUM_COMPONENT); }
    2210   Void  getWpScaling    ( RefPicList e, Int iRefIdx, WPScalingParam *&wp);
    2211 
    2212   Void  resetWpScaling  ();
    2213   Void  initWpScaling   ();
    2214   inline Bool applyWP   () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); }
    2215 
    2216   Void  setWpAcDcParam  ( WPACDCParam wp[MAX_NUM_COMPONENT] ) { memcpy(m_weightACDCParam, wp, sizeof(WPACDCParam)*MAX_NUM_COMPONENT); }
    2217   Void  getWpAcDcParam  ( WPACDCParam *&wp );
    2218   Void  initWpAcDcParam ();
    2219 
    2220   Void clearSubstreamSizes       ( )                        { return m_substreamSizes.clear();        }
    2221   UInt getNumberOfSubstreamSizes ( )                        { return (UInt) m_substreamSizes.size();  }
    2222   Void addSubstreamSize          ( UInt size )              { m_substreamSizes.push_back(size);       }
    2223   UInt getSubstreamSize          ( Int idx )                { assert(idx<getNumberOfSubstreamSizes()); return m_substreamSizes[idx]; }
    2224 
    2225   Void  setScalingList              ( TComScalingList* scalingList ) { m_scalingList = scalingList; }
    2226   TComScalingList*   getScalingList ()                               { return m_scalingList; }
    2227   Void  setDefaultScalingList       ();
    2228   Bool  checkDefaultScalingList     ();
    2229   Void      setCabacInitFlag  ( Bool val ) { m_cabacInitFlag = val;      }  //!< set CABAC initial flag
    2230   Bool      getCabacInitFlag  ()           { return m_cabacInitFlag;     }  //!< get CABAC initial flag
    2231   Bool      getTemporalLayerNonReferenceFlag()       { return m_temporalLayerNonReferenceFlag;}
    2232   Void      setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;}
    2233   Void      setLFCrossSliceBoundaryFlag     ( Bool   val )    { m_LFCrossSliceBoundaryFlag = val; }
    2234   Bool      getLFCrossSliceBoundaryFlag     ()                { return m_LFCrossSliceBoundaryFlag;}
    2235 
    2236   Void      setEnableTMVPFlag     ( Bool   b )    { m_enableTMVPFlag = b; }
    2237   Bool      getEnableTMVPFlag     ()              { return m_enableTMVPFlag;}
     2200  Int                         checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0);
     2201  Void                        createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP);
     2202#endif
     2203  Void                        setMaxNumMergeCand(UInt val )                          { m_maxNumMergeCand = val;                                      }
     2204  UInt                        getMaxNumMergeCand() const                             { return m_maxNumMergeCand;                                     }
     2205
     2206  Void                        setNoOutputPriorPicsFlag( Bool val )                   { m_noOutputPriorPicsFlag = val;                                }
     2207  Bool                        getNoOutputPriorPicsFlag() const                       { return m_noOutputPriorPicsFlag;                               }
     2208
     2209  Void                        setNoRaslOutputFlag( Bool val )                        { m_noRaslOutputFlag = val;                                     }
     2210  Bool                        getNoRaslOutputFlag() const                            { return m_noRaslOutputFlag;                                    }
     2211
     2212  Void                        setHandleCraAsBlaFlag( Bool val )                      { m_handleCraAsBlaFlag = val;                                   }
     2213  Bool                        getHandleCraAsBlaFlag() const                          { return m_handleCraAsBlaFlag;                                  }
     2214
     2215  Void                        setSliceMode( SliceConstraint mode )                   { m_sliceMode = mode;                                           }
     2216  SliceConstraint             getSliceMode() const                                   { return m_sliceMode;                                           }
     2217  Void                        setSliceArgument( UInt uiArgument )                    { m_sliceArgument = uiArgument;                                 }
     2218  UInt                        getSliceArgument() const                               { return m_sliceArgument;                                       }
     2219  Void                        setSliceCurStartCtuTsAddr( UInt ctuTsAddr )            { m_sliceCurStartCtuTsAddr = ctuTsAddr;                         } // CTU Tile-scan address (as opposed to raster-scan)
     2220  UInt                        getSliceCurStartCtuTsAddr() const                      { return m_sliceCurStartCtuTsAddr;                              } // CTU Tile-scan address (as opposed to raster-scan)
     2221  Void                        setSliceCurEndCtuTsAddr( UInt ctuTsAddr )              { m_sliceCurEndCtuTsAddr = ctuTsAddr;                           } // CTU Tile-scan address (as opposed to raster-scan)
     2222  UInt                        getSliceCurEndCtuTsAddr() const                        { return m_sliceCurEndCtuTsAddr;                                } // CTU Tile-scan address (as opposed to raster-scan)
     2223  Void                        setSliceIdx( UInt i)                                   { m_sliceIdx = i;                                               }
     2224  UInt                        getSliceIdx() const                                    { return  m_sliceIdx;                                           }
     2225  Void                        copySliceInfo(TComSlice *pcSliceSrc);
     2226  Void                        setSliceSegmentMode( SliceConstraint mode )            { m_sliceSegmentMode = mode;                                    }
     2227  SliceConstraint             getSliceSegmentMode() const                            { return m_sliceSegmentMode;                                    }
     2228  Void                        setSliceSegmentArgument( UInt uiArgument )             { m_sliceSegmentArgument = uiArgument;                          }
     2229  UInt                        getSliceSegmentArgument() const                        { return m_sliceSegmentArgument;                                }
     2230  Void                        setSliceSegmentCurStartCtuTsAddr( UInt ctuTsAddr )     { m_sliceSegmentCurStartCtuTsAddr = ctuTsAddr;                  } // CTU Tile-scan address (as opposed to raster-scan)
     2231  UInt                        getSliceSegmentCurStartCtuTsAddr() const               { return m_sliceSegmentCurStartCtuTsAddr;                       } // CTU Tile-scan address (as opposed to raster-scan)
     2232  Void                        setSliceSegmentCurEndCtuTsAddr( UInt ctuTsAddr )       { m_sliceSegmentCurEndCtuTsAddr = ctuTsAddr;                    } // CTU Tile-scan address (as opposed to raster-scan)
     2233  UInt                        getSliceSegmentCurEndCtuTsAddr() const                 { return m_sliceSegmentCurEndCtuTsAddr;                         } // CTU Tile-scan address (as opposed to raster-scan)
     2234  Void                        setSliceBits( UInt uiVal )                             { m_sliceBits = uiVal;                                          }
     2235  UInt                        getSliceBits() const                                   { return m_sliceBits;                                           }
     2236  Void                        setSliceSegmentBits( UInt uiVal )                      { m_sliceSegmentBits = uiVal;                                   }
     2237  UInt                        getSliceSegmentBits() const                            { return m_sliceSegmentBits;                                    }
     2238  Void                        setFinalized( Bool uiVal )                             { m_bFinalized = uiVal;                                         }
     2239  Bool                        getFinalized() const                                   { return m_bFinalized;                                          }
     2240  Bool                        testWeightPred( ) const                                { return m_bTestWeightPred;                                     }
     2241  Void                        setTestWeightPred( Bool bValue )                       { m_bTestWeightPred = bValue;                                   }
     2242  Bool                        testWeightBiPred( ) const                              { return m_bTestWeightBiPred;                                   }
     2243  Void                        setTestWeightBiPred( Bool bValue )                     { m_bTestWeightBiPred = bValue;                                 }
     2244  Void                        setWpScaling( WPScalingParam  wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT] )
     2245  {
     2246    memcpy(m_weightPredTable, wp, sizeof(WPScalingParam)*NUM_REF_PIC_LIST_01*MAX_NUM_REF*MAX_NUM_COMPONENT);
     2247  }
     2248
     2249  Void                        getWpScaling( RefPicList e, Int iRefIdx, WPScalingParam *&wp);
     2250
     2251  Void                        resetWpScaling();
     2252  Void                        initWpScaling(const TComSPS *sps);
     2253
     2254  Void                        setWpAcDcParam( WPACDCParam wp[MAX_NUM_COMPONENT] )
     2255  {
     2256    memcpy(m_weightACDCParam, wp, sizeof(WPACDCParam)*MAX_NUM_COMPONENT);
     2257  }
     2258
     2259  Void                        getWpAcDcParam( WPACDCParam *&wp );
     2260  Void                        initWpAcDcParam();
     2261
     2262  Void                        clearSubstreamSizes( )                                 { return m_substreamSizes.clear();                              }
     2263  UInt                        getNumberOfSubstreamSizes( )                           { return (UInt) m_substreamSizes.size();                        }
     2264  Void                        addSubstreamSize( UInt size )                          { m_substreamSizes.push_back(size);                             }
     2265  UInt                        getSubstreamSize( Int idx )                            { assert(idx<getNumberOfSubstreamSizes()); return m_substreamSizes[idx]; }
     2266
     2267  Void                        setCabacInitFlag( Bool val )                           { m_cabacInitFlag = val;                                        } //!< set CABAC initial flag
     2268  Bool                        getCabacInitFlag()                                     { return m_cabacInitFlag;                                       } //!< get CABAC initial flag
     2269  Bool                        getTemporalLayerNonReferenceFlag()                     { return m_temporalLayerNonReferenceFlag;                       }
     2270  Void                        setTemporalLayerNonReferenceFlag(Bool x)               { m_temporalLayerNonReferenceFlag = x;                          }
     2271  Void                        setLFCrossSliceBoundaryFlag( Bool   val )              { m_LFCrossSliceBoundaryFlag = val;                             }
     2272  Bool                        getLFCrossSliceBoundaryFlag()                          { return m_LFCrossSliceBoundaryFlag;                            }
     2273
     2274  Void                        setEnableTMVPFlag( Bool   b )                          { m_enableTMVPFlag = b;                                         }
     2275  Bool                        getEnableTMVPFlag()                                    { return m_enableTMVPFlag;                                      }
     2276
     2277  Void                        setEncCABACTableIdx( SliceType idx )                   { m_encCABACTableIdx = idx;                                     }
     2278  SliceType                   getEncCABACTableIdx() const                            { return m_encCABACTableIdx;                                    }
    22382279
    22392280#if SVC_EXTENSION
    2240   Void      setFirstSliceInPic               ( Bool val )        { m_firstSliceInPic = val;         }
    2241   Bool      getFirstSliceInPic               ()                  { return m_firstSliceInPic;        }
    2242   Void      setAvailableForTMVPRefFlag     ( Bool   b )          { m_availableForTMVPRefFlag = b;   }
    2243   Bool      getAvailableForTMVPRefFlag     ()                    { return m_availableForTMVPRefFlag;}
    2244   Bool      setBaseColPic       ( TComList<TComPic*>& rcListPic , UInt refLayerIdc );
    2245   Void      setBaseColPic       (UInt refLayerIdc, TComPic* p)    { m_pcBaseColPic[refLayerIdc] = p;    }
    2246   TComPic*  getBaseColPic       (UInt refLayerIdc)                { return m_pcBaseColPic[refLayerIdc]; }
    2247   TComPic** getBaseColPic       ()                                { return &m_pcBaseColPic[0];          }
    2248   TComPic*  getBaseColPic( TComList<TComPic*>& rcListPic );
    2249 
    2250   Void      setLayerId (UInt layerId)   { m_layerId = layerId; }
    2251   UInt      getLayerId ()               { return m_layerId;    }
    2252   UInt      getLayerIdx()               { return m_pcVPS->getLayerIdxInVps(m_layerId); }
    2253 
    2254   Void        setFullPelBaseRec   (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; }
    2255   TComPicYuv* getFullPelBaseRec   (UInt refLayerIdc)               { return  m_pcFullPelBaseRec[refLayerIdc];  }
    2256 
    2257   Void      setRefPicListModificationSvc();
    2258   Int       getNumILRRefIdx     ( )                     { return  m_pcVPS->getNumDirectRefLayers( m_layerId ); }
    2259 
    2260   Int       getActiveNumILRRefIdx     ( )               { return  m_activeNumILRRefIdx; }
    2261   Void      setActiveNumILRRefIdx     ( Int i )         { m_activeNumILRRefIdx = i;     } 
    2262 
    2263   Int       getInterLayerPredLayerIdc (UInt layerIdc)                        { return  m_interLayerPredLayerIdc[layerIdc];}
    2264   Void      setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdc)      { m_interLayerPredLayerIdc[layerIdc] = refLayerIdc;  }
    2265 
    2266   Void      setInterLayerPredEnabledFlag     ( Bool   val )    { m_interLayerPredEnabledFlag = val; }
    2267   Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
    2268 
    2269   Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
    2270   Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
    2271 
    2272   Void      setMFMEnabledFlag(Bool flag)                { m_bMFMEnabledFlag = flag; }
    2273   Bool      getMFMEnabledFlag()                         { return m_bMFMEnabledFlag; }
    2274 
    2275   TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); }
    2276 
    2277   Bool     isRADL()   { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); }
    2278   Bool     isRASL()   { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); }
    2279 
    2280   Bool     isIDR()    { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    2281                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP); }
    2282   Bool     isCRA()    { return m_eNalUnitType == NAL_UNIT_CODED_SLICE_CRA; }
    2283   Bool     isBLA()    { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP
    2284                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
    2285                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP ); }
    2286   Bool     isSLNR()   { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
    2287                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
    2288                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
    2289                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N
    2290                                   || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
    2291                                   || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N10
    2292                                   || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N12
    2293                                   || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); }
    2294 
    2295   Bool      getDiscardableFlag  ()                           { return m_bDiscardableFlag;    }
    2296   Void      setDiscardableFlag  (Bool b)                     { m_bDiscardableFlag = b;       }
    2297   Bool      getCrossLayerBLAFlag  ()                         { return m_bCrossLayerBLAFlag;  }
    2298   Void      setCrossLayerBLAFlag  (Bool b)                   { m_bCrossLayerBLAFlag = b;     }
    2299 
    2300   Int       getNumNegativeRpsCurrTempList();
    2301 
    2302   UInt getPicWidthInLumaSamples();
    2303   UInt getPicHeightInLumaSamples();
    2304 #if AUXILIARY_PICTURES
    2305   ChromaFormat getChromaFormatIdc();
    2306 #else
    2307   UInt getChromaFormatIdc();
    2308 #endif
    2309   UInt getBitDepthY();
    2310   UInt getBitDepthC();
    2311   Int  getQpBDOffsetY();
    2312   Int  getQpBDOffsetC();
    2313 
    2314   Window& getConformanceWindow();
    2315 
    2316   Void setILRPic(TComPic **pcIlpPic);
    2317 
    2318   Int       getPocResetIdc       ()                              { return m_pocResetIdc;       }
    2319   Void      setPocResetIdc       (Int b)                         { m_pocResetIdc = b;          }
    2320   Int       getPocResetPeriodId  ()                              { return m_pocResetPeriodId;       }
    2321   Void      setPocResetPeriodId  (Int b)                         { m_pocResetPeriodId = b;          }
    2322   Bool      getFullPocResetFlag  ()                              { return m_fullPocResetFlag;       }
    2323   Void      setFullPocResetFlag  (Bool b)                        { m_fullPocResetFlag = b;          }
    2324   Int       getPocLsbVal         ()                              { return m_pocLsbVal;       }
    2325   Void      setPocLsbVal       (Int b)                           { m_pocLsbVal = b;          }
    2326   Void      setPocMsbNeeded      (Bool x)                        { m_pocMsbValNeeded = x; }
    2327   Bool      getPocMsbNeeded      ()                              { return m_pocMsbValNeeded; }
    2328   Int       getPocResetDeltaPoc  ()                              { return m_pocResetDeltaPoc; }
    2329   Void      setPocResetDeltaPoc  (Int x)                         { m_pocResetDeltaPoc = x; }
    2330   Int       getPocMsbVal         ()                              { return m_pocMsbVal;       }
    2331   Void      setPocMsbVal       (Int b)                           { m_pocMsbVal = b;          }
    2332   Bool      getPocMsbValPresentFlag ()                           { return m_pocMsbValPresentFlag; }
    2333   Void      setPocMsbValPresentFlag (Bool x)                     { m_pocMsbValPresentFlag = x; }
    2334   Bool      getPocMsbValRequiredFlag ()                           { return m_pocMsbValRequiredFlag; }
    2335   Void      setPocMsbValRequiredFlag (Bool x)                     { m_pocMsbValRequiredFlag = x; }
    2336 
    2337   Bool      getBlaPicFlag       ();
    2338   Bool      getCraPicFlag       ();
    2339   Bool      getRaslPicFlag      ();
    2340   Bool      getRadlPicFlag      ();
    2341   Int       getPicOrderCntLsb() { return m_picOrderCntLsb; }
    2342   Void      setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; }
    2343 
    2344   Int       getPocValueBeforeReset ()                        { return m_pocValueBeforeReset; }
    2345   Void      setPocValueBeforeReset (Int x)                   { m_pocValueBeforeReset = x ;   }
    2346   Void      decrementRefPocValues(Int const decrementValue);
    2347   Int       getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal );
    2348 
    2349   Int       getReferenceLayerIdc( UInt refLayerId );
    2350 
     2281  Void                        setFirstSliceInPic( Bool val )                         { m_firstSliceInPic = val;                                      }
     2282  Bool                        getFirstSliceInPic()                                   { return m_firstSliceInPic;                                     }
     2283  Void                        setAvailableForTMVPRefFlag( Bool   b )                 { m_availableForTMVPRefFlag = b;                                }
     2284  Bool                        getAvailableForTMVPRefFlag()                           { return m_availableForTMVPRefFlag;                             }
     2285  Bool                        setBaseColPic( TComList<TComPic*>& rcListPic , UInt refLayerIdc );
     2286  Void                        setBaseColPic(UInt refLayerIdc, TComPic* p)            { m_pcBaseColPic[refLayerIdc] = p;                              }
     2287  TComPic*                    getBaseColPic(UInt refLayerIdc)                        { return m_pcBaseColPic[refLayerIdc];                           }
     2288  TComPic**                   getBaseColPic()                                        { return &m_pcBaseColPic[0];                                    }
     2289  TComPic*                    getBaseColPic( TComList<TComPic*>& rcListPic );
     2290
     2291  Void                        setLayerId(UInt layerId)                               { m_layerId = layerId;                                          }
     2292  UInt                        getLayerId()                                           { return m_layerId;                                             }
     2293  UInt                        getLayerIdx()                                          { return m_pcVPS->getLayerIdxInVps(m_layerId);                  }
     2294
     2295  Void                        setFullPelBaseRec( UInt refLayerIdc, TComPicYuv* p)    { m_pcFullPelBaseRec[refLayerIdc] = p;                          }
     2296  TComPicYuv*                 getFullPelBaseRec( UInt refLayerIdc)                   { return  m_pcFullPelBaseRec[refLayerIdc];                      }
     2297
     2298  Void                        setRefPicListModificationSvc();
     2299  Int                         getNumILRRefIdx()                                      { return  m_pcVPS->getNumDirectRefLayers( m_layerId );          }
     2300
     2301  Int                         getActiveNumILRRefIdx()                                { return  m_activeNumILRRefIdx;                                 }
     2302  Void                        setActiveNumILRRefIdx( Int i )                         { m_activeNumILRRefIdx = i;                                     } 
     2303   
     2304  Int                         getInterLayerPredLayerIdc(UInt layerIdc)                        { return  m_interLayerPredLayerIdc[layerIdc];          }
     2305  Void                        setInterLayerPredLayerIdc(UInt refLayerIdc, UInt layerIdc)      { m_interLayerPredLayerIdc[layerIdc] = refLayerIdc;    }
     2306
     2307  Void                        setInterLayerPredEnabledFlag( Bool   val )             { m_interLayerPredEnabledFlag = val;                            }
     2308  Bool                        getInterLayerPredEnabledFlag()                         { return m_interLayerPredEnabledFlag;                           }
     2309
     2310  Void                        setNumMotionPredRefLayers(Int i)                       { m_numMotionPredRefLayers = i;                                 }
     2311  Int                         getNumMotionPredRefLayers()                            { return m_numMotionPredRefLayers;                              }
     2312
     2313  Void                        setMFMEnabledFlag(Bool flag)                           { m_bMFMEnabledFlag = flag;                                     }
     2314  Bool                        getMFMEnabledFlag()                                    { return m_bMFMEnabledFlag;                                     }
     2315
     2316  TComPic*                    getRefPic(TComList<TComPic*>& rcListPic, Int poc)      { return xGetRefPic( rcListPic, poc );                          }
     2317
     2318  Bool                        isRADL()                                               { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); }
     2319  Bool                        isRASL()                                               { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); }
     2320
     2321  Bool                        isIDR()                                                { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP); }
     2322  Bool                        isCRA()                                                { return m_eNalUnitType == NAL_UNIT_CODED_SLICE_CRA; }
     2323  Bool                        isBLA()                                                { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP ); }
     2324  Bool                        isSLNR()
     2325  {
     2326    return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N
     2327         || m_eNalUnitType == NAL_UNIT_CODED_SLICE_TSA_N
     2328         || m_eNalUnitType == NAL_UNIT_CODED_SLICE_STSA_N
     2329         || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N
     2330         || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N
     2331         || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N10
     2332         || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N12
     2333         || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 );
     2334  }
     2335
     2336  Bool                        getDiscardableFlag  ()                                 { return m_bDiscardableFlag;                                    }
     2337  Void                        setDiscardableFlag  (Bool b)                           { m_bDiscardableFlag = b;                                       }
     2338  Bool                        getCrossLayerBLAFlag  ()                               { return m_bCrossLayerBLAFlag;                                  }
     2339  Void                        setCrossLayerBLAFlag  (Bool b)                         { m_bCrossLayerBLAFlag = b;                                     }
     2340
     2341  Int                         getNumNegativeRpsCurrTempList();
     2342
     2343  UInt                        getPicWidthInLumaSamples();
     2344  UInt                        getPicHeightInLumaSamples();
     2345  ChromaFormat                getChromaFormatIdc();
     2346  UInt                        getBitDepthY();
     2347  UInt                        getBitDepthC();
     2348  Int                         getQpBDOffsetY();
     2349  Int                         getQpBDOffsetC();
     2350
     2351  const Window&               getConformanceWindow() const;
     2352
     2353  Void                        setILRPic(TComPic **pcIlpPic);
     2354
     2355  Int                         getPocResetIdc()                                       { return m_pocResetIdc;                                         }
     2356  Void                        setPocResetIdc(Int b)                                  { m_pocResetIdc = b;                                            }
     2357  Int                         getPocResetPeriodId()                                  { return m_pocResetPeriodId;                                    }
     2358  Void                        setPocResetPeriodId(Int b)                             { m_pocResetPeriodId = b;                                       }
     2359  Bool                        getFullPocResetFlag()                                  { return m_fullPocResetFlag;                                    }
     2360  Void                        setFullPocResetFlag(Bool b)                            { m_fullPocResetFlag = b;                                       }
     2361  Int                         getPocLsbVal()                                         { return m_pocLsbVal;                                           }
     2362  Void                        setPocLsbVal(Int b)                                    { m_pocLsbVal = b;                                              }
     2363  Void                        setPocMsbNeeded(Bool x)                                { m_pocMsbValNeeded = x;                                        }
     2364  Bool                        getPocMsbNeeded()                                      { return m_pocMsbValNeeded;                                     }
     2365  Int                         getPocResetDeltaPoc()                                  { return m_pocResetDeltaPoc;                                    }
     2366  Void                        setPocResetDeltaPoc(Int x)                             { m_pocResetDeltaPoc = x;                                       }
     2367  Int                         getPocMsbVal()                                         { return m_pocMsbVal;                                           }
     2368  Void                        setPocMsbVal(Int b)                                    { m_pocMsbVal = b;                                              }
     2369  Bool                        getPocMsbValPresentFlag()                              { return m_pocMsbValPresentFlag;                                }
     2370  Void                        setPocMsbValPresentFlag(Bool x)                        { m_pocMsbValPresentFlag = x;                                   }
     2371  Bool                        getPocMsbValRequiredFlag()                             { return m_pocMsbValRequiredFlag;                               }
     2372  Void                        setPocMsbValRequiredFlag(Bool x)                       { m_pocMsbValRequiredFlag = x;                                  }
     2373
     2374  Bool                        getBlaPicFlag();
     2375  Bool                        getCraPicFlag();
     2376  Bool                        getRaslPicFlag();
     2377  Bool                        getRadlPicFlag();
     2378  Int                         getPicOrderCntLsb()                                    { return m_picOrderCntLsb;                                      }
     2379  Void                        setPicOrderCntLsb(Int x)                               { m_picOrderCntLsb = x;                                         }
     2380
     2381  Int                         getPocValueBeforeReset()                               { return m_pocValueBeforeReset;                                 }
     2382  Void                        setPocValueBeforeReset(Int x)                          { m_pocValueBeforeReset = x ;                                   }
     2383  Void                        decrementRefPocValues(Int const decrementValue);
     2384  Int                         getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal );
     2385
     2386  Int                         getReferenceLayerIdc( UInt refLayerId );
    23512387#endif //SVC_EXTENSION
    23522388
    23532389protected:
    2354   TComPic*  xGetRefPic        (TComList<TComPic*>& rcListPic, Int poc);
    2355   TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
     2390  TComPic*                    xGetRefPic        (TComList<TComPic*>& rcListPic, Int poc);
     2391  TComPic*                    xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
    23562392};// END CLASS DEFINITION TComSlice
    23572393
     2394Void calculateParameterSetChangedFlag(Bool &bChanged, const std::vector<UChar> *pOldData, const std::vector<UChar> *pNewData);
    23582395
    23592396template <class T> class ParameterSetMap
    23602397{
    23612398public:
     2399  template <class Tm>
     2400  struct MapData
     2401  {
     2402    Bool                  bChanged;
     2403    std::vector<UChar>   *pNaluData; // Can be null
     2404    Tm*                   parameterSet;
     2405  };
     2406
    23622407  ParameterSetMap(Int maxId)
    23632408  :m_maxId (maxId)
     
    23662411  ~ParameterSetMap()
    23672412  {
    2368     for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++)
     2413    for (typename std::map<Int,MapData<T> >::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++)
    23692414    {
    2370       delete (*i).second;
     2415      delete (*i).second.pNaluData;
     2416      delete (*i).second.parameterSet;
    23712417    }
    23722418  }
    23732419
    2374   Void storePS(Int psId, T *ps)
     2420  Void storePS(Int psId, T *ps, const std::vector<UChar> *pNaluData)
    23752421  {
    23762422    assert ( psId < m_maxId );
    23772423    if ( m_paramsetMap.find(psId) != m_paramsetMap.end() )
    23782424    {
    2379       delete m_paramsetMap[psId];
     2425      MapData<T> &mapData=m_paramsetMap[psId];
     2426
     2427      // work out changed flag
     2428      calculateParameterSetChangedFlag(mapData.bChanged, mapData.pNaluData, pNaluData);
     2429      delete m_paramsetMap[psId].pNaluData;
     2430      delete m_paramsetMap[psId].parameterSet;
     2431
     2432      m_paramsetMap[psId].parameterSet = ps;
    23802433    }
    2381     m_paramsetMap[psId] = ps;
     2434    else
     2435    {
     2436      m_paramsetMap[psId].parameterSet = ps;
     2437      m_paramsetMap[psId].bChanged = false;
     2438    }
     2439    if (pNaluData)
     2440    {
     2441      m_paramsetMap[psId].pNaluData=new std::vector<UChar>;
     2442      *(m_paramsetMap[psId].pNaluData) = *pNaluData;
     2443    }
     2444    else
     2445    {
     2446      m_paramsetMap[psId].pNaluData=0;
     2447    }
    23822448  }
    23832449
    2384   Void mergePSList(ParameterSetMap<T> &rPsList)
     2450  Void clearChangedFlag(Int psId)
    23852451  {
    2386     for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++)
     2452    if ( m_paramsetMap.find(psId) != m_paramsetMap.end() )
    23872453    {
    2388       storePS(i->first, i->second);
     2454      m_paramsetMap[psId].bChanged=false;
    23892455    }
    2390     rPsList.m_paramsetMap.clear();
    23912456  }
    23922457
     2458  Bool getChangedFlag(Int psId) const
     2459  {
     2460    const typename std::map<Int,MapData<T> >::const_iterator constit=m_paramsetMap.find(psId);
     2461    if ( constit != m_paramsetMap.end() )
     2462    {
     2463      return constit->second.bChanged;
     2464    }
     2465    return false;
     2466  }
    23932467
    23942468  T* getPS(Int psId)
    23952469  {
    2396     return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId];
     2470    return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId].parameterSet;
    23972471  }
    23982472
    23992473  T* getFirstPS()
    24002474  {
    2401     return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second;
     2475    return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second.parameterSet;
    24022476  }
    24032477
    24042478private:
    2405   std::map<Int,T *> m_paramsetMap;
    2406   Int               m_maxId;
     2479  std::map<Int,MapData<T> > m_paramsetMap;
     2480  Int                       m_maxId;
    24072481};
    24082482
     
    24102484{
    24112485public:
    2412   ParameterSetManager();
    2413   virtual ~ParameterSetManager();
     2486                 ParameterSetManager();
     2487  virtual        ~ParameterSetManager();
    24142488
    24152489  //! store sequence parameter set and take ownership of it
    2416   Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); };
     2490  Void           storeVPS(TComVPS *vps, const std::vector<UChar> *pNaluData) { m_vpsMap.storePS( vps->getVPSId(), vps, pNaluData); };
    24172491  //! get pointer to existing video parameter set
    2418   TComVPS* getVPS(Int vpsId)  { return m_vpsMap.getPS(vpsId); };
    2419   TComVPS* getFirstVPS()      { return m_vpsMap.getFirstPS(); };
     2492  TComVPS*       getVPS(Int vpsId)                                           { return m_vpsMap.getPS(vpsId); };
     2493  Bool           getVPSChangedFlag(Int vpsId) const                          { return m_vpsMap.getChangedFlag(vpsId); }
     2494  Void           clearVPSChangedFlag(Int vpsId)                              { m_vpsMap.clearChangedFlag(vpsId); }
     2495  TComVPS*       getFirstVPS()                                               { return m_vpsMap.getFirstPS(); };
    24202496
    24212497  //! store sequence parameter set and take ownership of it
    2422   Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); };
     2498  Void           storeSPS(TComSPS *sps, const std::vector<UChar> *pNaluData) { m_spsMap.storePS( sps->getSPSId(), sps, pNaluData); };
    24232499  //! get pointer to existing sequence parameter set
    2424   TComSPS* getSPS(Int spsId)  { return m_spsMap.getPS(spsId); };
    2425   TComSPS* getFirstSPS()      { return m_spsMap.getFirstPS(); };
     2500  TComSPS*       getSPS(Int spsId)                                           { return m_spsMap.getPS(spsId); };
     2501  Bool           getSPSChangedFlag(Int spsId) const                          { return m_spsMap.getChangedFlag(spsId); }
     2502  Void           clearSPSChangedFlag(Int spsId)                              { m_spsMap.clearChangedFlag(spsId); }
     2503  TComSPS*       getFirstSPS()                                               { return m_spsMap.getFirstPS(); };
    24262504
    24272505  //! store picture parameter set and take ownership of it
    2428   Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); };
     2506  Void           storePPS(TComPPS *pps, const std::vector<UChar> *pNaluData) { m_ppsMap.storePS( pps->getPPSId(), pps, pNaluData); };
    24292507  //! get pointer to existing picture parameter set
    2430   TComPPS* getPPS(Int ppsId)  { return m_ppsMap.getPS(ppsId); };
    2431   TComPPS* getFirstPPS()      { return m_ppsMap.getFirstPS(); };
     2508  TComPPS*       getPPS(Int ppsId)                                           { return m_ppsMap.getPS(ppsId); };
     2509  Bool           getPPSChangedFlag(Int ppsId) const                          { return m_ppsMap.getChangedFlag(ppsId); }
     2510  Void           clearPPSChangedFlag(Int ppsId)                              { m_ppsMap.clearChangedFlag(ppsId); }
     2511  TComPPS*       getFirstPPS()                                               { return m_ppsMap.getFirstPS(); };
    24322512
    24332513  //! activate a SPS from a active parameter sets SEI message
    24342514  //! \returns true, if activation is successful
    2435   Bool activateSPSWithSEI(Int SPSId);
     2515  Bool           activateSPSWithSEI(Int SPSId);
    24362516
    24372517  //! activate a PPS and depending on isIDR parameter also SPS and VPS
    24382518  //! \returns true, if activation is successful
    2439   Bool activatePPS(Int ppsId, Bool isIRAP);
    2440 
    2441   TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };
    2442   TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); };
    2443   TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); };
     2519  Bool           activatePPS(Int ppsId, Bool isIRAP);
     2520
     2521  const TComVPS* getActiveVPS()const { return &m_activeVPS; };
     2522  const TComSPS* getActiveSPS()const { return &m_activeSPS; };
     2523
     2524#if SVC_EXTENSION
     2525  const TComPPS* getActivePPS()const { return &m_activePPS; };
     2526#endif
    24442527
    24452528protected:
     
    24492532  static ParameterSetMap<TComSPS> m_spsMap;
    24502533  static ParameterSetMap<TComPPS> m_ppsMap;
     2534
     2535  TComPPS                  m_activePPS;
     2536  static TComVPS           m_activeVPS;
    24512537#else
    24522538  ParameterSetMap<TComVPS> m_vpsMap;
    24532539  ParameterSetMap<TComSPS> m_spsMap;
    24542540  ParameterSetMap<TComPPS> m_ppsMap;
    2455 #endif
    2456 
    2457 #if SVC_EXTENSION
    2458   static Int m_activeVPSId;
    2459 #else
    2460   Int m_activeVPSId;
    2461 #endif
    2462   Int m_activeSPSId;
    2463   Int m_activePPSId;
     2541
     2542  TComVPS                  m_activeVPS; // used for SEI message
     2543#endif
     2544
     2545  TComSPS                  m_activeSPS; // used for SEI message
    24642546};
    24652547
  • branches/SHM-dev/source/Lib/TLibCommon/TComTU.cpp

    r1029 r1235  
    5959    mpParent(NULL)
    6060{
    61   TComSPS *pSPS=pcCU->getSlice()->getSPS();
     61  const TComSPS *pSPS=pcCU->getSlice()->getSPS();
    6262  mLog2TrLumaSize = g_aucConvertToBit[pSPS->getMaxCUWidth() >> (mCuDepth+initTrDepthRelCU)]+2;
    6363
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.cpp

    r1203 r1235  
    29092909      {
    29102910        xSetScalingListEnc(scalingList,list,size,qp,format);
    2911         xSetScalingListDec(scalingList,list,size,qp,format);
     2911        xSetScalingListDec(*scalingList,list,size,qp,format);
    29122912        setErrScaleCoeff(list,size,qp);
    29132913      }
     
    29182918 * \param scalingList quantaized matrix address
    29192919 */
    2920 Void TComTrQuant::setScalingListDec(TComScalingList *scalingList, const ChromaFormat format)
     2920Void TComTrQuant::setScalingListDec(const TComScalingList &scalingList, const ChromaFormat format)
    29212921{
    29222922  const Int minimumQp = 0;
     
    29942994 * \param uiQP Quantization parameter
    29952995 */
    2996 Void TComTrQuant::xSetScalingListDec(TComScalingList *scalingList, UInt listId, UInt sizeId, Int qp, const ChromaFormat format)
     2996Void TComTrQuant::xSetScalingListDec(const TComScalingList &scalingList, UInt listId, UInt sizeId, Int qp, const ChromaFormat format)
    29972997{
    29982998  UInt width  = g_scalingListSizeX[sizeId];
     
    30003000  UInt ratio  = g_scalingListSizeX[sizeId]/min(MAX_MATRIX_SIZE_NUM,(Int)g_scalingListSizeX[sizeId]);
    30013001  Int *dequantcoeff;
    3002   Int *coeff  = scalingList->getScalingListAddress(sizeId,listId);
     3002  const Int *coeff  = scalingList.getScalingListAddress(sizeId,listId);
    30033003
    30043004  dequantcoeff = getDequantCoeff(listId, qp, sizeId);
     
    30113011                        height, width, ratio,
    30123012                        min(MAX_MATRIX_SIZE_NUM, (Int)g_scalingListSizeX[sizeId]),
    3013                         scalingList->getScalingListDC(sizeId,listId));
     3013                        scalingList.getScalingListDC(sizeId,listId));
    30143014}
    30153015
     
    30943094 * \param dc dc parameter
    30953095 */
    3096 Void TComTrQuant::processScalingListDec( Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc)
     3096Void TComTrQuant::processScalingListDec( const Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc)
    30973097{
    30983098  for(UInt j=0;j<height;j++)
  • branches/SHM-dev/source/Lib/TLibCommon/TComTrQuant.h

    r1029 r1235  
    182182  Void xsetFlatScalingList ( UInt list, UInt size, Int qp, const ChromaFormat format);
    183183  Void xSetScalingListEnc  ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format);
    184   Void xSetScalingListDec  ( TComScalingList *scalingList, UInt list, UInt size, Int qp, const ChromaFormat format);
     184  Void xSetScalingListDec  ( const TComScalingList &scalingList, UInt list, UInt size, Int qp, const ChromaFormat format);
    185185  Void setScalingList      ( TComScalingList *scalingList, const ChromaFormat format);
    186   Void setScalingListDec   ( TComScalingList *scalingList, const ChromaFormat format);
     186  Void setScalingListDec   ( const TComScalingList &scalingList, const ChromaFormat format);
    187187  Void processScalingListEnc( Int *coeff, Int *quantcoeff, Int quantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc);
    188   Void processScalingListDec( Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc);
     188  Void processScalingListDec( const Int *coeff, Int *dequantcoeff, Int invQuantScales, UInt height, UInt width, UInt ratio, Int sizuNum, UInt dc);
    189189#if ADAPTIVE_QP_SELECTION
    190190  Void    initSliceQpDelta() ;
  • branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r1212 r1235  
    7373  Int strideEL  = pcUsPic->getStride(COMPONENT_Y);
    7474
    75   Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
     75  ChromaFormat chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
    7676  Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
    7777  Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    78   Bool phaseSetPresentFlag;
    79   Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 
    80   currSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma );
    81 
    82   if( !phaseSetPresentFlag )
     78
     79  const ResamplingPhase &resamplingPhase = currSlice->getPPS()->getResamplingPhase( refLayerId );
     80  Int phaseVerChroma = resamplingPhase.phaseVerChroma;
     81
     82  if( !resamplingPhase.phasePresentFlag )
    8383  {
    8484    Int refRegionHeight = heightBL - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
     
    192192    pcBasePic->extendPicBorder(); // extend the border.
    193193
    194     Int   shiftX = 16;
    195     Int   shiftY = 16;
    196 
    197     Int phaseX = phaseHorLuma;
    198     Int phaseY = phaseVerLuma;
     194    Int shiftX = 16;
     195    Int shiftY = 16;
     196
     197    Int phaseX = resamplingPhase.phaseHorLuma;
     198    Int phaseY = resamplingPhase.phaseVerLuma;
    199199    Int addX = ( ( phaseX * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    200200    Int addY = ( ( phaseY * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
     
    207207    widthEL  = pcUsPic->getWidth ( COMPONENT_Y );
    208208    heightEL = pcUsPic->getHeight( COMPONENT_Y );
    209 
    210209    widthBL  = pcBasePic->getWidth ( COMPONENT_Y );
    211210    heightBL = min<Int>( pcBasePic->getHeight( COMPONENT_Y ), heightEL );
     
    256255
    257256    Int nShift = 20 - g_bitDepthLayer[CHANNEL_TYPE_LUMA][currLayerId];
    258 
    259257    Int iOffset = 1 << (nShift - 1);
    260258
     
    290288    widthEL  >>= 1;
    291289    heightEL >>= 1;
    292 
    293290    widthBL  >>= 1;
    294291    heightBL >>= 1;
     
    306303    shiftY = 16;
    307304
    308     addX = ( ( phaseHorChroma * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
     305    addX = ( ( resamplingPhase.phaseHorChroma * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    309306    addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
    310307    Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1227 r1235  
    307307
    308308#define MAX_NUM_LONG_TERM_REF_PICS                       33
     309#define NUM_LONG_TERM_REF_PIC_SPS                         0
    309310
    310311#define DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES  1
     
    342343
    343344#define MAX_TIMECODE_SEI_SETS                                                  3 ///< Maximum number of time sets
    344 
    345345
    346346//------------------------------------------------
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1218 r1235  
    106106 */
    107107#if LAYERS_NOT_PRESENT_SEI
    108 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    109 #else
    110 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     108Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     109#else
     110Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    111111#endif
    112112{
     
    133133#if O0164_MULTI_LAYER_HRD
    134134#if LAYERS_NOT_PRESENT_SEI
    135 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei)
    136 #else
    137 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei)
     135Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei)
     136#else
     137Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei)
    138138#endif
    139139#else
    140140#if LAYERS_NOT_PRESENT_SEI
    141 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    142 #else
    143 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     141Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     142#else
     143Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    144144#endif
    145145#endif
     
    557557
    558558#if SVC_EXTENSION
    559 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps,std::ostream *pDecodedMessageOutputStream)
    560 #else
    561 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     559Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
     560#else
     561Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    562562#endif
    563563{
     
    568568
    569569#if SVC_EXTENSION
    570   TComHRD *hrd;
     570  const TComHRD *hrd;
    571571  if( bspNestingSei )   // If DU info SEI contained inside a BSP nesting SEI message
    572572  {
     
    577577    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    578578    std::vector<Int> hrdIdx(maxValues, 0);
    579     std::vector<TComHRD *> hrdVec;
     579    std::vector<const TComHRD*> hrdVec;
    580580    std::vector<Int> syntaxElemLen(maxValues, 0);
    581581    for(Int i = 0; i < maxValues; i++)
     
    601601  else
    602602  {
    603     TComVUI *vui = sps->getVuiParameters();
     603    const TComVUI *vui = sps->getVuiParameters();
    604604    hrd = vui->getHrdParameters();
    605605  }
     
    621621  }
    622622#else
    623   TComVUI *vui = sps->getVuiParameters();
     623  const TComVUI *vui = sps->getVuiParameters();
    624624
    625625  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
     
    642642
    643643#if SVC_EXTENSION
    644 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
    645 #else
    646 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     644Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
     645#else
     646Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    647647#endif
    648648{
     
    651651
    652652#if SVC_EXTENSION
    653   TComHRD *pHRD;
     653  const TComHRD *pHRD;
    654654  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
    655655  {
     
    660660    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    661661    std::vector<Int> hrdIdx(maxValues, 0);
    662     std::vector<TComHRD *> hrdVec;
     662    std::vector<const TComHRD*> hrdVec;
    663663    std::vector<Int> syntaxElemLen(maxValues, 0);
    664664    for(i = 0; i < maxValues; i++)
     
    683683  else
    684684  {
    685     TComVUI *vui = sps->getVuiParameters();
     685    const TComVUI *vui = sps->getVuiParameters();
    686686    pHRD = vui->getHrdParameters();
    687687  }
    688688  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
    689689#else
    690   TComVUI *pVUI = sps->getVuiParameters();
    691   TComHRD *pHRD = pVUI->getHrdParameters();
     690  const TComVUI *pVUI = sps->getVuiParameters();
     691  const TComHRD *pHRD = pVUI->getHrdParameters();
    692692#endif
    693693
     
    746746
    747747#if SVC_EXTENSION
    748 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
    749 #else
    750 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     748Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
     749#else
     750Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    751751#endif
    752752{
     
    755755
    756756#if SVC_EXTENSION
    757   TComHRD *hrd;   
    758   TComVUI *vui = sps->getVuiParameters();
     757  const TComHRD *hrd;   
     758  const TComVUI *vui = sps->getVuiParameters();
    759759  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
    760760  {
     
    765765    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    766766    std::vector<Int> hrdIdx(maxValues, 0);
    767     std::vector<TComHRD *> hrdVec;
     767    std::vector<const TComHRD*> hrdVec;
    768768    std::vector<Int> syntaxElemLen(maxValues, 0);
    769769    for(i = 0; i < maxValues; i++)
     
    796796  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
    797797#else
    798   TComVUI *vui = sps->getVuiParameters();
    799   TComHRD *hrd = vui->getHrdParameters();
     798  const TComVUI *vui = sps->getVuiParameters();
     799  const TComHRD *hrd = vui->getHrdParameters();
    800800#endif
    801801  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
     
    10611061
    10621062#if LAYERS_NOT_PRESENT_SEI
    1063 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    1064 #else
    1065 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     1063Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
     1064#else
     1065Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)
    10661066#endif
    10671067{
     
    14231423#if SVC_EXTENSION
    14241424#if LAYERS_NOT_PRESENT_SEI
    1425 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
     1425Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
    14261426{
    14271427  UInt uiCode;
     
    14851485
    14861486#if SUB_BITSTREAM_PROPERTY_SEI
    1487 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
     1487Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
    14881488{
    14891489  UInt uiCode;
     
    15101510#if O0164_MULTI_LAYER_HRD
    15111511#if LAYERS_NOT_PRESENT_SEI
    1512 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)
    1513 #else
    1514 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)
     1512Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)
     1513#else
     1514Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)
    15151515#endif
    15161516{
     
    15371537}
    15381538
    1539 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream)
     1539Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream)
    15401540{
    15411541  assert(vps->getVpsVuiPresentFlag());
    15421542
    1543 #if SVC_EXTENSION
    15441543  UInt uiCode;
    15451544  Int psIdx         = bspNestingSei.m_seiPartitioningSchemeIdx;
     
    15481547  Int maxValues     = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    15491548  std::vector<Int> hrdIdx(0, maxValues);
    1550   std::vector<TComHRD *> hrdVec;
     1549  std::vector<const TComHRD*> hrdVec;
    15511550  std::vector<Int> syntaxElemLen;
    15521551  for(Int i = 0; i < maxValues; i++)
     
    15801579    }
    15811580  }
    1582 #else
    1583   UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);
    1584   UInt len;
    1585   UInt hrdIdx;
    1586   UInt uiCode;
    1587 
    1588   if (schedCombCnt > 0)
    1589   {
    1590     hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);
    1591   }
    1592   else
    1593   {
    1594     hrdIdx = 0;
    1595   }
    1596 
    1597   TComHRD *hrd = vps->getBspHrd(hrdIdx);
    1598 
    1599   if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())
    1600   {
    1601     len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;
    1602   }
    1603   else
    1604   {
    1605     len = 23 + 1;
    1606   }
    1607 
    1608   if (hrd->getNalHrdParametersPresentFlag())
    1609   {
    1610     for(UInt i = 0; i < schedCombCnt; i++)
    1611     {
    1612       sei_read_code( pDecodedMessageOutputStream, len, uiCode, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = uiCode;
    1613     }
    1614   }
    1615 #if BSP_INIT_ARRIVAL_SEI
    1616   if( hrd->getVclHrdParametersPresentFlag() )
    1617 #else
    1618   else
    1619 #endif
    1620   {
    1621     for(UInt i = 0; i < schedCombCnt; i++)
    1622     {
    1623       sei_read_code( pDecodedMessageOutputStream, len, uiCode, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = uiCode;
    1624     }
    1625   }
    1626 #endif
    16271581}
    16281582
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h

    r1218 r1235  
    5757  virtual ~SEIReader() {};
    5858#if LAYERS_NOT_PRESENT_SEI
    59   Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     59  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    6060#else
    61   Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     61  Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    6262#endif
    6363protected:
    6464#if O0164_MULTI_LAYER_HRD
    6565#if LAYERS_NOT_PRESENT_SEI
    66   Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL);
     66  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL);
    6767#else
    68   Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, , std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL);
     68  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL);
    6969#endif
    7070#else
    7171#if LAYERS_NOT_PRESENT_SEI
    72   Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     72  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    7373#else
    74   Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     74  Void xReadSEImessage                        (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    7575#endif
    7676#endif
    77   Void xParseSEIuserDataUnregistered          (SEIuserDataUnregistered &sei,          UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    78   Void xParseSEIActiveParameterSets           (SEIActiveParameterSets  &sei,          UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    79   Void xParseSEIDecodedPictureHash            (SEIDecodedPictureHash& sei,            UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
     77  Void xParseSEIuserDataUnregistered          (SEIuserDataUnregistered &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     78  Void xParseSEIActiveParameterSets           (SEIActiveParameterSets  &sei,          UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     79  Void xParseSEIDecodedPictureHash            (SEIDecodedPictureHash& sei,            UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    8080#if SVC_EXTENSION
    81   Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
    82   Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
    83   Void xParseSEIPictureTiming                 (SEIPictureTiming& sei,                 UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
     81  Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
     82  Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
     83  Void xParseSEIPictureTiming                 (SEIPictureTiming& sei,                 UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
    8484#else
    85   Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    86   Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    87   Void xParseSEIPictureTiming                 (SEIPictureTiming& sei,                 UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     85  Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     86  Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     87  Void xParseSEIPictureTiming                 (SEIPictureTiming& sei,                 UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    8888#endif
    89   Void xParseSEIRecoveryPoint                 (SEIRecoveryPoint& sei,                 UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    90   Void xParseSEIFramePacking                  (SEIFramePacking& sei,                  UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    91   Void xParseSEISegmentedRectFramePacking     (SEISegmentedRectFramePacking& sei,     UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    92   Void xParseSEIDisplayOrientation            (SEIDisplayOrientation &sei,            UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    93   Void xParseSEITemporalLevel0Index           (SEITemporalLevel0Index &sei,           UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    94   Void xParseSEIRegionRefreshInfo             (SEIGradualDecodingRefreshInfo &sei,    UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    95   Void xParseSEINoDisplay                     (SEINoDisplay &sei,                     UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    96   Void xParseSEIToneMappingInfo               (SEIToneMappingInfo& sei,               UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    97   Void xParseSEISOPDescription                (SEISOPDescription &sei,                UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
     89  Void xParseSEIRecoveryPoint                 (SEIRecoveryPoint& sei,                 UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     90  Void xParseSEIFramePacking                  (SEIFramePacking& sei,                  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     91  Void xParseSEISegmentedRectFramePacking     (SEISegmentedRectFramePacking& sei,     UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     92  Void xParseSEIDisplayOrientation            (SEIDisplayOrientation &sei,            UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     93  Void xParseSEITemporalLevel0Index           (SEITemporalLevel0Index &sei,           UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     94  Void xParseSEIRegionRefreshInfo             (SEIGradualDecodingRefreshInfo &sei,    UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     95  Void xParseSEINoDisplay                     (SEINoDisplay &sei,                     UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     96  Void xParseSEIToneMappingInfo               (SEIToneMappingInfo& sei,               UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     97  Void xParseSEISOPDescription                (SEISOPDescription &sei,                UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    9898#if !LAYERS_NOT_PRESENT_SEI
    99   Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     99  Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    100100#endif
    101   Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    102   Void xParseSEITimeCode                      (SEITimeCode& sei,                      UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    103   Void xParseSEIChromaSamplingFilterHint      (SEIChromaSamplingFilterHint& sei,      UInt payloadSize/*,TComSPS* */, std::ostream *pDecodedMessageOutputStream);
    104   Void xParseSEIKneeFunctionInfo              (SEIKneeFunctionInfo& sei,              UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
    105   Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
     101  Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     102  Void xParseSEITimeCode                      (SEITimeCode& sei,                      UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     103  Void xParseSEIChromaSamplingFilterHint      (SEIChromaSamplingFilterHint& sei,      UInt payloadSize/*,TComSPS* */,       std::ostream *pDecodedMessageOutputStream);
     104  Void xParseSEIKneeFunctionInfo              (SEIKneeFunctionInfo& sei,              UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
     105  Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    106106
    107107  Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const Char *pSymbolName);
     
    111111
    112112#if Q0074_COLOUR_REMAPPING_SEI
    113   Void xParseSEIColourRemappingInfo           (SEIColourRemappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     113  Void xParseSEIColourRemappingInfo           (SEIColourRemappingInfo& sei,           UInt payloadSize,                    std::ostream *pDecodedMessageOutputStream);
    114114#endif
    115115#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    116   Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     116  Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
    117117#endif
    118118#if SUB_BITSTREAM_PROPERTY_SEI
    119 Void   xParseSEISubBitstreamProperty          (SEISubBitstreamProperty &sei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
     119Void   xParseSEISubBitstreamProperty          (SEISubBitstreamProperty &sei,          const TComVPS *vps,                  std::ostream *pDecodedMessageOutputStream);
    120120#endif
    121121#if LAYERS_NOT_PRESENT_SEI
    122   Void xParseSEILayersNotPresent              (SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps ,std::ostream *pDecodedMessageOutputStream);
    123   Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
     122  Void xParseSEILayersNotPresent              (SEILayersNotPresent &sei,     UInt payloadSize, const TComVPS *vps,          std::ostream *pDecodedMessageOutputStream);
     123  Void xParseSEIScalableNesting               (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);
    124124#endif
    125125#if O0164_MULTI_LAYER_HRD
    126126#if LAYERS_NOT_PRESENT_SEI
    127   Void xParseSEIBspNesting                    (SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream);
     127  Void xParseSEIBspNesting                    (SEIBspNesting &sei, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream);
    128128#else
    129   Void xParseSEIBspNesting                    (SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei ,std::ostream *pDecodedMessageOutputStream);
     129  Void xParseSEIBspNesting                    (SEIBspNesting &sei, const NalUnitType nalUnitType, const TComSPS *sps, const SEIScalableNesting &nestingSei ,std::ostream *pDecodedMessageOutputStream);
    130130#endif
    131   Void xParseSEIBspInitialArrivalTime         (SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream);
    132   Void xParseHrdParameters                    (TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1, std::ostream *pDecodedMessageOutputStream);
     131  Void xParseSEIBspInitialArrivalTime         (SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream);
     132  Void xParseHrdParameters                    (TComHRD *hrd,   Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1,      std::ostream *pDecodedMessageOutputStream);
    133133#endif
    134134#if Q0189_TMVP_CONSTRAINTS
    135   Void xParseSEITMVPConstraints               (SEITMVPConstrains& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     135  Void xParseSEITMVPConstraints               (SEITMVPConstrains& sei,                UInt payloadSize,                    std::ostream *pDecodedMessageOutputStream);
    136136#endif
    137137#if Q0247_FRAME_FIELD_INFO
    138   Void xParseSEIFrameFieldInfo                (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     138  Void xParseSEIFrameFieldInfo                (SEIFrameFieldInfo& sei,                UInt payloadSize,                    std::ostream *pDecodedMessageOutputStream);
    139139#endif
    140140#if P0123_ALPHA_CHANNEL_SEI
    141   Void xParseSEIAlphaChannelInfo              (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     141  Void xParseSEIAlphaChannelInfo              (SEIAlphaChannelInfo& sei,              UInt payloadSize,                    std::ostream *pDecodedMessageOutputStream);
    142142#endif
    143143#if Q0096_OVERLAY_SEI
    144   Void xParseSEIOverlayInfo                   (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
     144  Void xParseSEIOverlayInfo                   (SEIOverlayInfo& sei,                   UInt payloadSize,                    std::ostream *pDecodedMessageOutputStream);
    145145#endif
    146146#if P0138_USE_ALT_CPB_PARAMS_FLAG
    147   Bool xPayloadExtensionPresent       ();
     147  Bool xPayloadExtensionPresent();
    148148#endif
    149149};
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1230 r1235  
    316316  if(pcPPS->getScalingListPresentFlag ())
    317317  {
    318     parseScalingList( pcPPS->getScalingList() );
     318    parseScalingList( &(pcPPS->getScalingList()) );
    319319  }
    320320
     
    379379                Int cbOffset;
    380380                Int crOffset;
    381                 READ_SVLC(cbOffset, "cb_qp_adjustnemt[i]");
    382                 READ_SVLC(crOffset, "cr_qp_adjustnemt[i]");
     381                READ_SVLC(cbOffset, "cb_qp_adjustment[i]");
     382                READ_SVLC(crOffset, "cr_qp_adjustment[i]");
    383383                pcPPS->setChromaQpAdjTableAt(chromaQpAdjustmentIndex, cbOffset, crOffset);
    384384              }
     
    879879    if(pcSPS->getScalingListPresentFlag ())
    880880    {
    881       parseScalingList( pcSPS->getScalingList() );
     881      parseScalingList( &(pcSPS->getScalingList()) );
    882882    }
    883883#if SVC_EXTENSION
     
    11411141}
    11421142
    1143 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManagerDecoder *parameterSetManager)
     1143Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager)
    11441144{
    11451145  UInt  uiCode;
     
    11651165  }
    11661166  READ_UVLC (    uiCode, "slice_pic_parameter_set_id" );  pcSlice->setPPSId(uiCode);
    1167   pps = parameterSetManager->getPrefetchedPPS(uiCode);
     1167  pps = parameterSetManager->getPPS(uiCode);
    11681168  //!KS: need to add error handling code here, if PPS is not available
    11691169  assert(pps!=0);
    1170   sps = parameterSetManager->getPrefetchedSPS(pps->getSPSId());
     1170  sps = parameterSetManager->getSPS(pps->getSPSId());
    11711171  //!KS: need to add error handling code here, if SPS is not available
    11721172  assert(sps!=0);
    11731173  pcSlice->setSPS(sps);
    11741174  pcSlice->setPPS(pps);
     1175
     1176#if SVC_EXTENSION
     1177  TComVPS* vps = parameterSetManager->getVPS(sps->getVPSId());
     1178  pcSlice->setVPS(vps);
     1179
     1180  Int iPOClsb = 0;
     1181#endif
    11751182
    11761183  const ChromaFormat chFmt = sps->getChromaFormatIdc();
     
    12121219  }
    12131220
    1214 #if SVC_EXTENSION
    1215   Int iPOClsb = 0;
    1216 #endif
    1217 
    12181221  if(!pcSlice->getDependentSliceSegmentFlag())
    12191222  {
    12201223#if SVC_EXTENSION
    12211224    Int iBits = 0;
    1222     if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
     1225    if(pps->getNumExtraSliceHeaderBits() > iBits)
    12231226    {
    12241227      READ_FLAG(uiCode, "discardable_flag");
     
    12371240    }
    12381241
    1239     if(pcSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)
     1242    if(pps->getNumExtraSliceHeaderBits() > iBits)
    12401243    {
    12411244      READ_FLAG(uiCode, "cross_layer_bla_flag");  pcSlice->setCrossLayerBLAFlag( uiCode ? true : false );
     
    12431246    }
    12441247
    1245     for ( ; iBits < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)
     1248    for ( ; iBits < pps->getNumExtraSliceHeaderBits(); iBits++)
    12461249    {
    12471250      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
    12481251    }
    12491252#else //SVC_EXTENSION
    1250     for (Int i = 0; i < pcSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)
     1253    for (Int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++)
    12511254    {
    12521255      READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored
     
    12761279
    12771280#if SVC_EXTENSION
    1278     if( ( pcSlice->getLayerId() > 0 && !pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() )
     1281    if( ( pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( vps->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() )
    12791282#else
    12801283    else
     
    13361339      {
    13371340        Int numBits = 0;
    1338         while ((1 << numBits) < pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets())
     1341        while ((1 << numBits) < sps->getRPSList()->getNumberOfReferencePictureSets())
    13391342        {
    13401343          numBits++;
     
    13561359        UInt numOfLtrp = 0;
    13571360        UInt numLtrpInSPS = 0;
    1358         if (pcSlice->getSPS()->getNumLongTermRefPicSPS() > 0)
     1361        if (sps->getNumLongTermRefPicSPS() > 0)
    13591362        {
    13601363          READ_UVLC( uiCode, "num_long_term_sps");
     
    13641367        }
    13651368        Int bitsForLtrpInSPS = 0;
    1366         while (pcSlice->getSPS()->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS))
     1369        while (sps->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS))
    13671370        {
    13681371          bitsForLtrpInSPS++;
     
    13711374        numOfLtrp += uiCode;
    13721375        rps->setNumberOfLongtermPictures(numOfLtrp);
    1373         Int maxPicOrderCntLSB = 1 << pcSlice->getSPS()->getBitsForPOC();
     1376        Int maxPicOrderCntLSB = 1 << sps->getBitsForPOC();
    13741377        Int prevDeltaMSB = 0, deltaPocMSBCycleLT = 0;
    13751378        for(Int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++)
     
    13831386              READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]");
    13841387            }
    1385             Bool usedByCurrFromSPS=pcSlice->getSPS()->getUsedByCurrPicLtSPSFlag(uiCode);
    1386 
    1387             pocLsbLt = pcSlice->getSPS()->getLtRefPicPocLsbSps(uiCode);
     1388            Bool usedByCurrFromSPS=sps->getUsedByCurrPicLtSPSFlag(uiCode);
     1389
     1390            pocLsbLt = sps->getLtRefPicPocLsbSps(uiCode);
    13881391            rps->setUsed(j,usedByCurrFromSPS);
    13891392          }
    13901393          else
    13911394          {
    1392             READ_CODE(pcSlice->getSPS()->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode;
     1395            READ_CODE(sps->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode;
    13931396            READ_FLAG( uiCode, "used_by_curr_pic_lt_flag");     rps->setUsed(j,uiCode);
    13941397          }
     
    14831486        pcSlice->setRPS(rps);
    14841487      }
    1485       if (pcSlice->getSPS()->getTMVPFlagsPresent())
     1488      if (sps->getTMVPFlagsPresent())
    14861489      {
    14871490        READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" );
     
    14961499#if SVC_EXTENSION
    14971500    pcSlice->setActiveNumILRRefIdx(0);
    1498     if((pcSlice->getLayerId() > 0) && !(pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )
     1501    if((pcSlice->getLayerId() > 0) && !(vps->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )
    14991502    {
    15001503      READ_FLAG(uiCode,"inter_layer_pred_enabled_flag");
     
    15091512            numBits++;
    15101513          }
    1511           if( !pcSlice->getVPS()->getMaxOneActiveRefLayerFlag())
     1514          if( !vps->getMaxOneActiveRefLayerFlag())
    15121515          {
    15131516            READ_CODE( numBits, uiCode,"num_inter_layer_ref_pics_minus1" );
     
    15181521            for( Int i = 0; i < pcSlice->getNumILRRefIdx(); i++ )
    15191522            {
    1520               if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
    1521                     pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >=  pcSlice->getTLayer() )
     1523              if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
     1524                    vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >=  pcSlice->getTLayer() )
    15221525              {         
    15231526                pcSlice->setActiveNumILRRefIdx(1);
     
    15451548        else
    15461549        {
    1547           Int refLayerId = pcSlice->getVPS()->getRefLayerId(pcSlice->getLayerId(), 0);
    1548           Int refLayerIdx = pcSlice->getVPS()->getLayerIdxInVps(refLayerId);
    1549 
    1550           if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(refLayerIdx, pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
    1551                 pcSlice->getVPS()->getMaxTSLayersMinus1(refLayerIdx) >=  pcSlice->getTLayer() )
     1550          Int refLayerId = vps->getRefLayerId(pcSlice->getLayerId(), 0);
     1551          Int refLayerIdx = vps->getLayerIdxInVps(refLayerId);
     1552
     1553          if( ( vps->getMaxTidIlRefPicsPlus1(refLayerIdx, pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
     1554                vps->getMaxTSLayersMinus1(refLayerIdx) >=  pcSlice->getTLayer() )
    15521555          {
    15531556            pcSlice->setActiveNumILRRefIdx(1);
     
    15571560      }
    15581561    }
    1559     else if( pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true &&  (pcSlice->getLayerId() > 0 ))
     1562    else if( vps->getIlpSshSignalingEnabledFlag() == true &&  (pcSlice->getLayerId() > 0 ))
    15601563    {
    15611564      pcSlice->setInterLayerPredEnabledFlag(true);
     
    15661569      for(i = 0, numRefLayerPics = 0;  i < pcSlice->getNumILRRefIdx(); i++ )
    15671570      {
    1568         if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
    1569               pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >=  pcSlice->getTLayer() )
     1571        if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&
     1572              vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >=  pcSlice->getTLayer() )
    15701573        {         
    15711574          refLayerPicIdc[ numRefLayerPics++ ] = i;
     
    15911594      else
    15921595      {
    1593         format = pcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : pcSlice->getVPS()->getVpsRepFormatIdx( pcSlice->getVPS()->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc();
     1596        format = vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx( vps->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc();
    15941597
    15951598        // conformance check
    1596         assert( (sps->getUpdateRepFormatFlag()==false && pcSlice->getVPS()->getVpsNumRepFormats()==1) || pcSlice->getVPS()->getVpsNumRepFormats() > 1 );
     1599        assert( (sps->getUpdateRepFormatFlag()==false && vps->getVpsNumRepFormats()==1) || vps->getVpsNumRepFormats() > 1 );
    15971600      }
    15981601      if (format != CHROMA_400)
     
    16331636      else
    16341637      {
    1635         pcSlice->setNumRefIdx(REF_PIC_LIST_0, pcSlice->getPPS()->getNumRefIdxL0DefaultActive());
     1638        pcSlice->setNumRefIdx(REF_PIC_LIST_0, pps->getNumRefIdxL0DefaultActive());
    16361639        if (pcSlice->isInterB())
    16371640        {
    1638           pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getPPS()->getNumRefIdxL1DefaultActive());
     1641          pcSlice->setNumRefIdx(REF_PIC_LIST_1, pps->getNumRefIdxL1DefaultActive());
    16391642        }
    16401643        else
     
    16481651    if(!pcSlice->isIntra())
    16491652    {
    1650       if( !pcSlice->getPPS()->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )
     1653      if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )
    16511654      {
    16521655        refPicListModification->setRefPicListModificationFlagL0( 0 );
     
    16911694    if(pcSlice->isInterB())
    16921695    {
    1693       if( !pcSlice->getPPS()->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )
     1696      if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )
    16941697      {
    16951698        refPicListModification->setRefPicListModificationFlagL1( 0 );
     
    17731776    if ( (pps->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) )
    17741777    {
    1775       xParsePredWeightTable(pcSlice);
    1776       pcSlice->initWpScaling();
     1778      xParsePredWeightTable(pcSlice, sps);
     1779      pcSlice->initWpScaling(sps);
    17771780    }
    17781781    if (!pcSlice->isIntra())
     
    17951798    assert( pcSlice->getSliceQp() <=  51 );
    17961799
    1797     if (pcSlice->getPPS()->getSliceChromaQpFlag())
     1800    if (pps->getSliceChromaQpFlag())
    17981801    {
    17991802      if (numValidComp>COMPONENT_Cb)
     
    18031806        assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) >= -12 );
    18041807        assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) <=  12 );
    1805         assert( (pcSlice->getPPS()->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) >= -12 );
    1806         assert( (pcSlice->getPPS()->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) <=  12 );
     1808        assert( (pps->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) >= -12 );
     1809        assert( (pps->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) <=  12 );
    18071810      }
    18081811
     
    18131816        assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) >= -12 );
    18141817        assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) <=  12 );
    1815         assert( (pcSlice->getPPS()->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >= -12 );
    1816         assert( (pcSlice->getPPS()->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) <=  12 );
    1817       }
    1818     }
    1819 
    1820     if (pcSlice->getPPS()->getChromaQpAdjTableSize() > 0)
     1818        assert( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >= -12 );
     1819        assert( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) <=  12 );
     1820      }
     1821    }
     1822
     1823    if (pps->getChromaQpAdjTableSize() > 0)
    18211824    {
    18221825      READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0);
     
    18241827    else pcSlice->setUseChromaQpAdj(false);
    18251828
    1826     if (pcSlice->getPPS()->getDeblockingFilterControlPresentFlag())
    1827     {
    1828       if(pcSlice->getPPS()->getDeblockingFilterOverrideEnabledFlag())
     1829    if (pps->getDeblockingFilterControlPresentFlag())
     1830    {
     1831      if(pps->getDeblockingFilterOverrideEnabledFlag())
    18291832      {
    18301833        READ_FLAG ( uiCode, "deblocking_filter_override_flag" );        pcSlice->setDeblockingFilterOverrideFlag(uiCode ? true : false);
     
    18491852      else
    18501853      {
    1851         pcSlice->setDeblockingFilterDisable   ( pcSlice->getPPS()->getPicDisableDeblockingFilterFlag() );
    1852         pcSlice->setDeblockingFilterBetaOffsetDiv2( pcSlice->getPPS()->getDeblockingFilterBetaOffsetDiv2() );
    1853         pcSlice->setDeblockingFilterTcOffsetDiv2  ( pcSlice->getPPS()->getDeblockingFilterTcOffsetDiv2() );
     1854        pcSlice->setDeblockingFilterDisable   ( pps->getPicDisableDeblockingFilterFlag() );
     1855        pcSlice->setDeblockingFilterBetaOffsetDiv2( pps->getDeblockingFilterBetaOffsetDiv2() );
     1856        pcSlice->setDeblockingFilterTcOffsetDiv2  ( pps->getDeblockingFilterTcOffsetDiv2() );
    18541857      }
    18551858    }
     
    18611864    }
    18621865
    1863     Bool isSAOEnabled = pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA)));
     1866    Bool isSAOEnabled = sps->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA)));
    18641867    Bool isDBFEnabled = (!pcSlice->getDeblockingFilterDisable());
    18651868
    1866     if(pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled ))
     1869    if(pps->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled ))
    18671870    {
    18681871      READ_FLAG( uiCode, "slice_loop_filter_across_slices_enabled_flag");
     
    18701873    else
    18711874    {
    1872       uiCode = pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()?1:0;
     1875      uiCode = pps->getLoopFilterAcrossSlicesEnabledFlag()?1:0;
    18731876    }
    18741877    pcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false);
     
    23792382* \returns Void
    23802383*/
    2381 Void TDecCavlc::xParsePredWeightTable( TComSlice* pcSlice )
     2384Void TDecCavlc::xParsePredWeightTable( TComSlice* pcSlice, const TComSPS *sps )
    23822385{
    23832386        WPScalingParam *wp;
    2384         TComSPS        *sps          = pcSlice->getSPS();
    23852387  const ChromaFormat    chFmt        = sps->getChromaFormatIdc();
    23862388  const Int             numValidComp = Int(getNumberValidComponents(chFmt));
     
    25262528        READ_FLAG( code, "scaling_list_pred_mode_flag");
    25272529        scalingListPredModeFlag = (code) ? true : false;
     2530        scalingList->setScalingListPredModeFlag(sizeId, listId, scalingListPredModeFlag);
    25282531        if(!scalingListPredModeFlag) //Copy Mode
    25292532        {
     
    37333736                }
    37343737
    3735                 READ_CODE(numBits, uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
     3738                READ_CODE(numBits, uiCode, "bsp_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
    37363739              }
    37373740
    3738               READ_UVLC(uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
     3741              READ_UVLC(uiCode, "bsp_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
    37393742            }
    37403743          }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h

    r1224 r1235  
    8585  Void  parseProfileTier    (ProfileTierLevel *ptl);
    8686  Void  parseHrdParameters  (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh);
    87   Void  parseSliceHeader    ( TComSlice* pcSlice, ParameterSetManagerDecoder *parameterSetManager);
     87  Void  parseSliceHeader    ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager);
    8888  Void  parseTerminatingBit ( UInt& ruiBit );
    8989  Void  parseRemainingBytes ( Bool noTrailingBytesExpected );
     
    117117  Void parseIPCMInfo        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth);
    118118
    119   Void xParsePredWeightTable ( TComSlice* pcSlice );
     119  Void xParsePredWeightTable ( TComSlice* pcSlice, const TComSPS *sps );
    120120  Void  parseScalingList     ( TComScalingList* scalingList );
    121121  Void xDecodeScalingList    ( TComScalingList *scalingList, UInt sizeId, UInt listId);
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp

    r1203 r1235  
    239239  {
    240240    UInt uiIdx = uiAbsPartIdx;
    241     if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
     241    if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
    242242    {
    243243      setdQPFlag(true);
     
    245245    }
    246246
    247     if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj() )
     247    if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() )
    248248    {
    249249      setIsChromaQpAdjCoded(true);
     
    270270      uiIdx += uiQNumParts;
    271271    }
    272     if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
     272    if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
    273273    {
    274274      if ( getdQPFlag() )
     
    281281  }
    282282
    283   if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
     283  if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
    284284  {
    285285    setdQPFlag(true);
     
    287287  }
    288288
    289   if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj() )
     289  if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() )
    290290  {
    291291    setIsChromaQpAdjCoded(true);
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h

    r1212 r1235  
    7777#endif
    7878
    79   virtual Void parseSliceHeader          ( TComSlice* pcSlice, ParameterSetManagerDecoder *parameterSetManager)       = 0;
     79  virtual Void parseSliceHeader          ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager)       = 0;
    8080
    8181  virtual Void parseTerminatingBit       ( UInt& ruilsLast )                                     = 0;
     
    150150  Void    decodePPS                   ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); }
    151151#endif
    152   Void    decodeSliceHeader           ( TComSlice* pcSlice, ParameterSetManagerDecoder *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager);         }
     152  Void    decodeSliceHeader           ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager)  { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager);         }
    153153
    154154  Void    decodeTerminatingBit        ( UInt& ruiIsLast )       { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast);     }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp

    r1230 r1235  
    584584    }
    585585    eMode = (PartSize) uiMode;
    586     if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     586    if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
    587587    {
    588588      if (eMode == SIZE_2NxN)
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h

    r1212 r1235  
    8585    ) {}
    8686
    87   Void  parseSliceHeader          ( TComSlice* /*pcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
     87  Void  parseSliceHeader          ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/) {}
    8888  Void  parseTerminatingBit       ( UInt& ruiBit );
    8989  Void  parseRemainingBytes       ( Bool noTrailingBytesExpected);
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp

    r1029 r1235  
    4040//! \ingroup TLibDecoder
    4141//! \{
    42 
    43 #if SVC_EXTENSION
    44 ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS);
    45 ParameterSetMap<TComSPS> ParameterSetManagerDecoder::m_spsBuffer(MAX_NUM_SPS);
    46 ParameterSetMap<TComPPS> ParameterSetManagerDecoder::m_ppsBuffer(MAX_NUM_PPS);
    47 #endif
    4842
    4943//////////////////////////////////////////////////////////////////////
     
    271265}
    272266
    273 ParameterSetManagerDecoder::ParameterSetManagerDecoder()
    274 #if !SVC_EXTENSION
    275 : m_vpsBuffer(MAX_NUM_VPS)
    276 , m_spsBuffer(MAX_NUM_SPS)
    277 , m_ppsBuffer(MAX_NUM_PPS)
    278 #endif
    279 {
    280 }
    281 
    282 ParameterSetManagerDecoder::~ParameterSetManagerDecoder()
    283 {
    284 
    285 }
    286 
    287 TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS  (Int vpsId)
    288 {
    289   if (m_vpsBuffer.getPS(vpsId) != NULL )
    290   {
    291     return m_vpsBuffer.getPS(vpsId);
    292   }
    293   else
    294   {
    295     return getVPS(vpsId);
    296   }
    297 }
    298 
    299 
    300 TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS  (Int spsId)
    301 {
    302   if (m_spsBuffer.getPS(spsId) != NULL )
    303   {
    304     return m_spsBuffer.getPS(spsId);
    305   }
    306   else
    307   {
    308     return getSPS(spsId);
    309   }
    310 }
    311 
    312 TComPPS* ParameterSetManagerDecoder::getPrefetchedPPS  (Int ppsId)
    313 {
    314   if (m_ppsBuffer.getPS(ppsId) != NULL )
    315   {
    316     return m_ppsBuffer.getPS(ppsId);
    317   }
    318   else
    319   {
    320     return getPPS(ppsId);
    321   }
    322 }
    323 
    324 Void     ParameterSetManagerDecoder::applyPrefetchedPS()
    325 {
    326   m_vpsMap.mergePSList(m_vpsBuffer);
    327   m_ppsMap.mergePSList(m_ppsBuffer);
    328   m_spsMap.mergePSList(m_spsBuffer);
    329 }
    330 
    331267//! \}
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.h

    r1029 r1235  
    8888};
    8989
    90 
    91 class ParameterSetManagerDecoder:public ParameterSetManager
    92 {
    93 public:
    94   ParameterSetManagerDecoder();
    95   virtual ~ParameterSetManagerDecoder();
    96   Void     storePrefetchedVPS(TComVPS *vps)  { m_vpsBuffer.storePS( vps->getVPSId(), vps); };
    97   TComVPS* getPrefetchedVPS  (Int vpsId);
    98   Void     storePrefetchedSPS(TComSPS *sps)  { m_spsBuffer.storePS( sps->getSPSId(), sps); };
    99   TComSPS* getPrefetchedSPS  (Int spsId);
    100   Void     storePrefetchedPPS(TComPPS *pps)  { m_ppsBuffer.storePS( pps->getPPSId(), pps); };
    101   TComPPS* getPrefetchedPPS  (Int ppsId);
    102   Void     applyPrefetchedPS();
    103 
    104 private:
    105 #if SVC_EXTENSION
    106   static ParameterSetMap<TComVPS> m_vpsBuffer;
    107   static ParameterSetMap<TComSPS> m_spsBuffer;
    108   static ParameterSetMap<TComPPS> m_ppsBuffer;
    109 #else
    110   ParameterSetMap<TComVPS> m_vpsBuffer;
    111   ParameterSetMap<TComSPS> m_spsBuffer;
    112   ParameterSetMap<TComPPS> m_ppsBuffer;
    113 #endif
    114 };
    115 
    116 
    11790//! \}
    11891
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1229 r1235  
    223223}
    224224
    225 Void TDecTop::xGetNewPicBuffer ( TComSlice* pcSlice, TComPic*& rpcPic )
    226 {
    227   Int  numReorderPics[MAX_TLAYER];
    228 #if SVC_EXTENSION
    229   Window &conformanceWindow = pcSlice->getConformanceWindow();
     225#if SVC_EXTENSION
     226Void TDecTop::xGetNewPicBuffer( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer )
    230227#else
    231   Window &conformanceWindow = pcSlice->getSPS()->getConformanceWindow();
    232 #endif
    233   Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window();
    234 
    235   for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++)
    236   {
    237 #if SVC_EXTENSION
    238     if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 )
    239     {
    240       assert( this->getLayerId() == 0 );
    241       numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer);
    242     }
    243     else
    244     {
    245       TComVPS *vps = pcSlice->getVPS();
    246       // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
    247       numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
    248     }
    249 #else
    250     numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer);
    251 #endif
    252   }
    253 
     228Void TDecTop::xGetNewPicBuffer ( const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer )
     229#endif
     230{
    254231#if SVC_EXTENSION
    255232  if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 )
    256233  {
    257     assert( this->getLayerId() == 0 );
    258     m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     234    assert( m_layerId == 0 );
     235    m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer);     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    259236  }
    260237  else
    261238  {
    262     m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), pcSlice->getVPS()->getLayerIdcForOls( pcSlice->getVPS()->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), pcSlice->getLayerId() ), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     239    m_iMaxRefPicNum = vps.getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), vps.getLayerIdcForOls( vps.getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), m_layerId ), temporalLayer ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    263240  }
    264241
    265242  m_iMaxRefPicNum += 1; // it should be updated if more than 1 resampling picture is used
    266243#else
    267   m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer());     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
     244  m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer);     // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
    268245#endif
    269246 
     
    275252    if(m_layerId > 0)
    276253    {
    277       xSetSpatialEnhLayerFlag( pcSlice, rpcPic );
    278     }
    279 
    280     rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    281                      conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     254      xSetSpatialEnhLayerFlag( vps, sps, pps, rpcPic );
     255    }
     256
     257    rpcPic->create( vps, sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId);
    282258#else //SVC_EXTENSION
    283     rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    284                      conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     259    rpcPic->create ( sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
    285260#endif //SVC_EXTENSION
    286261   
     
    326301  if( m_layerId > 0 )
    327302  {
    328     xSetSpatialEnhLayerFlag( pcSlice, rpcPic );
    329   }
    330 
    331   rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    332                    conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true);
     303    xSetSpatialEnhLayerFlag( vps, sps, pps, rpcPic );
     304  }
     305
     306  rpcPic->create( vps, sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId);
    333307#else  //SVC_EXTENSION
    334   rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth,
    335                    conformanceWindow, defaultDisplayWindow, numReorderPics, true);
     308  rpcPic->create ( sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true);
    336309#endif //SVC_EXTENSION
    337310}
     
    386359{
    387360  printf("\ninserting lost poc : %d\n",iLostPoc);
    388   TComSlice cFillSlice;
    389   cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    390   cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
    391 #if SVC_EXTENSION
    392   cFillSlice.setVPS( m_parameterSetManagerDecoder.getFirstVPS() );
    393   cFillSlice.initSlice( m_layerId );
    394 #else
    395   cFillSlice.initSlice();
    396 #endif
    397361  TComPic *cFillPic;
    398   xGetNewPicBuffer(&cFillSlice,cFillPic);
    399   cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() );
    400   cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() );
    401 #if SVC_EXTENSION
    402   cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder.getFirstVPS() );
     362#if SVC_EXTENSION
     363  xGetNewPicBuffer(*(m_parameterSetManager.getFirstVPS()), *(m_parameterSetManager.getFirstSPS()), *(m_parameterSetManager.getFirstPPS()), cFillPic, 0);
    403364  cFillPic->getSlice(0)->initSlice( m_layerId );
    404365#else
     366  xGetNewPicBuffer(*(m_parameterSetManager.getFirstSPS()), *(m_parameterSetManager.getFirstPPS()), cFillPic, 0);
    405367  cFillPic->getSlice(0)->initSlice();
    406368#endif
     
    445407Void TDecTop::xActivateParameterSets()
    446408{
    447   m_parameterSetManagerDecoder.applyPrefetchedPS();
    448 
    449   TComPPS *pps = m_parameterSetManagerDecoder.getPPS(m_apcSlicePilot->getPPSId());
    450   assert (pps != 0);
    451 
    452   TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId());
    453   assert (sps != 0);
    454 
    455   if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
    456   {
    457     printf ("Parameter set activation failed!");
    458     assert (0);
    459   }
    460 
    461 #if SVC_EXTENSION
    462   // scaling list settings and checks
    463   TComVPS *activeVPS = m_parameterSetManagerDecoder.getActiveVPS();
    464   TComSPS *activeSPS = m_parameterSetManagerDecoder.getActiveSPS();
    465   TComPPS *activePPS = m_parameterSetManagerDecoder.getActivePPS();
    466 
    467   if( activeSPS->getInferScalingListFlag() )
    468   {
    469     UInt refLayerId = activeSPS->getScalingListRefLayerId();
    470     TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL );
    471 
    472     // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
    473     if( activeVPS->getNonHEVCBaseLayerFlag() )
    474     {
    475       assert( refLayerId > 0 );
    476     }
    477 
    478     // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
    479     // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id
    480     assert( refSps->getInferScalingListFlag() == false );
    481 
    482     // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
    483     // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
    484     assert( activeVPS->getRecursiveRefLayerFlag( activeSPS->getLayerId(), refLayerId ) == true );
    485    
    486     if( activeSPS->getScalingList() != refSps->getScalingList() )
    487     {
    488       // delete created instance of scaling list since it will be inferred
    489       delete activeSPS->getScalingList();
    490 
    491       // infer scaling list
    492       activeSPS->setScalingList( refSps->getScalingList() );
    493     }
    494   }
    495 
    496   if( activePPS->getInferScalingListFlag() )
    497   {
    498     UInt refLayerId = activePPS->getScalingListRefLayerId();
    499     TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL );
    500 
    501     // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
    502     if( activeVPS->getNonHEVCBaseLayerFlag() )
    503     {
    504       assert( refLayerId > 0 );
    505     }
    506 
    507     // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
    508     // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id
    509     assert( refPps->getInferScalingListFlag() == false );
    510 
    511     // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
    512     // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
    513     assert( activeVPS->getRecursiveRefLayerFlag( activePPS->getLayerId(), refLayerId ) == true );
    514    
    515     if( activePPS->getScalingList() != refPps->getScalingList() )
    516     {
    517       // delete created instance of scaling list since it will be inferred
    518       delete activePPS->getScalingList();
    519 
    520       // infer scaling list
    521       activePPS->setScalingList( refPps->getScalingList() );
    522     }
    523 
    524   }
     409  if (m_bFirstSliceInPicture)
     410  {
     411    const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value
     412    assert (pps != 0);
     413
     414#if SVC_EXTENSION
     415    TComSPS *updateSPS = m_parameterSetManager.getSPS(pps->getSPSId());             // this is a temporary SPS object. Do not store this value
     416#endif
     417    const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId());             // this is a temporary SPS object. Do not store this value
     418    assert (sps != 0);
     419
     420    m_parameterSetManager.clearSPSChangedFlag(sps->getSPSId());
     421    m_parameterSetManager.clearPPSChangedFlag(pps->getPPSId());
     422
     423    if (false == m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP()))
     424    {
     425      printf ("Parameter set activation failed!");
     426      assert (0);
     427    }
     428
     429#if SVC_EXTENSION
     430    // scaling list settings and checks
     431    TComVPS *vps = m_parameterSetManager.getVPS(sps->getVPSId());
     432    assert (vps != 0);
     433
     434    m_parameterSetManager.clearVPSChangedFlag(sps->getVPSId());   
     435
     436    if( sps->getInferScalingListFlag() )
     437    {
     438      UInt refLayerId = sps->getScalingListRefLayerId();
     439      const TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL );
     440
     441      // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
     442      if( vps->getNonHEVCBaseLayerFlag() )
     443      {
     444        assert( refLayerId > 0 );
     445      }
     446
     447      // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
     448      // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id
     449      assert( refSps->getInferScalingListFlag() == false );
     450
     451      // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
     452      // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
     453      assert( vps->getRecursiveRefLayerFlag( sps->getLayerId(), refLayerId ) == true );
     454    }
     455
     456    if( pps->getInferScalingListFlag() )
     457    {
     458      UInt refLayerId = pps->getScalingListRefLayerId();
     459      const TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL );
     460
     461      // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0
     462      if( vps->getNonHEVCBaseLayerFlag() )
     463      {
     464        assert( refLayerId > 0 );
     465      }
     466
     467      // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and
     468      // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id
     469      assert( refPps->getInferScalingListFlag() == false );
     470
     471      // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB,
     472      // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB
     473      assert( vps->getRecursiveRefLayerFlag( pps->getLayerId(), refLayerId ) == true );
     474    }
    525475
    526476#if AVC_BASE
    527   if( activeVPS->getNonHEVCBaseLayerFlag() )
    528   {
    529     TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
    530     if( m_layerId > 0 && pBLPic->getPicYuvRec() == NULL )
    531     {
    532       UInt refLayerId = 0;
    533       RepFormat* repFormat = activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(refLayerId) );
    534 
    535       Int  numReorderPics[MAX_TLAYER];
    536       Window defaultDisplayWindow;
    537 
    538 #if AUXILIARY_PICTURES
    539       pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true);
     477    if( vps->getNonHEVCBaseLayerFlag() )
     478    {
     479      TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
     480      if( m_layerId > 0 && pBLPic->getPicYuvRec() == NULL )
     481      {
     482        UInt refLayerId = 0;
     483        const RepFormat* repFormat = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(refLayerId) );
     484
     485        pBLPic->create( *vps, *sps, *pps, sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), true, refLayerId);
     486
     487        // it is needed where the VPS is accessed through the slice
     488        pBLPic->getSlice(0)->setVPS( vps );
     489
     490        g_bitDepthLayer[CHANNEL_TYPE_LUMA][0] = repFormat->getBitDepthVpsLuma();
     491        g_bitDepthLayer[CHANNEL_TYPE_CHROMA][0] = repFormat->getBitDepthVpsChroma();
     492      }
     493    }
     494#endif
     495
     496    if( m_layerId > 0 )
     497    {
     498      // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1.
     499      updateSPS->setMaxTLayers( vps->getMaxTLayers() );
     500
     501      // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag
     502      updateSPS->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
     503
     504      // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0,
     505      // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS.
     506      for(UInt i=0; i < sps->getMaxTLayers(); i++)
     507      {
     508        // to avoid compiler warning "array subscript is above array bounds"
     509        assert( i < MAX_TLAYER );
     510
     511        // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive,
     512        // due to MultiLayerExtSpsFlag being equal to 1, for a layer that refers to the SPS and has nuh_layer_id equal to currLayerId,
     513        // the value of sps_max_dec_pic_buffering_minus1[ i ] is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOlsIdx ][ layerIdx ][ i ] of the active VPS,
     514        // where layerIdx is equal to the value such that LayerSetLayerIdList[ TargetDecLayerSetIdx ][ layerIdx ] is equal to currLayerId.
     515        if( sps->getMultiLayerExtSpsFlag() )
     516        {
     517          updateSPS->setMaxDecPicBuffering( vps->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), vps->getLayerIdcForOls( vps->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), m_layerId ), i) + 1, i);
     518        }
     519
     520        // The value of sps_max_dec_pic_buffering_minus1[ i ] shall be less than or equal to vps_max_dec_pic_buffering_minus1[ i ] for each value of i.
     521        assert( sps->getMaxDecPicBuffering(i) <= vps->getMaxDecPicBuffering(i) );     
     522      }
     523
     524      UInt layerIdx = vps->getLayerIdxInVps( m_layerId );
     525
     526      if( vps->getBaseLayerPSCompatibilityFlag(layerIdx) )
     527      {
     528        const RepFormat* repFormat = vps->getVpsRepFormat(vps->getVpsRepFormatIdx(layerIdx));
     529
     530        assert( pps->getLayerId() == 0 );
     531        assert( sps->getLayerId() == 0 );
     532        assert( repFormat->getChromaFormatVpsIdc() == sps->getChromaFormatIdc() );
     533        assert( repFormat->getSeparateColourPlaneVpsFlag() == 0 );
     534        assert( repFormat->getPicHeightVpsInLumaSamples() == sps->getPicHeightInLumaSamples() );
     535        assert( repFormat->getPicWidthVpsInLumaSamples()  == sps->getPicWidthInLumaSamples() );
     536        assert( repFormat->getBitDepthVpsLuma()   == sps->getBitDepth(CHANNEL_TYPE_LUMA) );
     537        assert( repFormat->getBitDepthVpsChroma() == sps->getBitDepth(CHANNEL_TYPE_CHROMA) );
     538        assert( repFormat->getConformanceWindowVps().getWindowLeftOffset()   == sps->getConformanceWindow().getWindowLeftOffset() );
     539        assert( repFormat->getConformanceWindowVps().getWindowRightOffset()  == sps->getConformanceWindow().getWindowRightOffset() );
     540        assert( repFormat->getConformanceWindowVps().getWindowTopOffset()    == sps->getConformanceWindow().getWindowTopOffset() );
     541        assert( repFormat->getConformanceWindowVps().getWindowBottomOffset() == sps->getConformanceWindow().getWindowBottomOffset() );
     542      }   
     543    }
     544
     545    //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer
     546    UInt layerIdx = vps->getLayerIdxInVps(m_apcSlicePilot->getLayerId());
     547
     548    if ( vps->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) )
     549    {
     550      assert( sps->getPicWidthInLumaSamples()        <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getPicWidthVpsInLumaSamples() );
     551      assert( sps->getPicHeightInLumaSamples()       <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getPicHeightVpsInLumaSamples() );
     552      assert( sps->getChromaFormatIdc()              <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getChromaFormatVpsIdc() );
     553      assert( sps->getBitDepth(CHANNEL_TYPE_LUMA)    <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsLuma() );
     554      assert( sps->getBitDepth(CHANNEL_TYPE_CHROMA)  <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsChroma() );
     555    }
     556    else if ( vps->getVpsExtensionFlag() == 1 )
     557    {
     558      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples()  <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples());
     559      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples());
     560      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc()        <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc());
     561      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma()           <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma());
     562      assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()         <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma());
     563    }
     564#endif //SVC_EXTENSION
     565
     566    // TODO: remove the use of the following globals:
     567    for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++)
     568    {
     569#if SVC_EXTENSION
     570      g_bitDepth[channel] = isLuma(ChannelType(channel)) ? vps->getBitDepthY(sps, m_apcSlicePilot->getLayerId()) : vps->getBitDepthC(sps, m_apcSlicePilot->getLayerId());
    540571#else
    541       pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true);
    542 #endif
    543       // it is needed where the VPS is accessed through the slice
    544       pBLPic->getSlice(0)->setVPS( activeVPS );
    545 
    546       g_bitDepthLayer[CHANNEL_TYPE_LUMA][0] = repFormat->getBitDepthVpsLuma();
    547       g_bitDepthLayer[CHANNEL_TYPE_CHROMA][0] = repFormat->getBitDepthVpsChroma();
    548     }
    549   }
    550 #endif
    551 
    552   if( m_layerId > 0 )
    553   {
    554     // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1.
    555     sps->setMaxTLayers( activeVPS->getMaxTLayers() );
    556 
    557     // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag
    558     sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? activeVPS->getTemporalNestingFlag() : true );
    559 
    560     // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0,
    561     // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS.
    562     for(UInt i=0; i < sps->getMaxTLayers(); i++)
    563     {
    564       // to avoid compiler warning "array subscript is above array bounds"
    565       assert( i < MAX_TLAYER );
    566 
    567       // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive,
    568       // due to MultiLayerExtSpsFlag being equal to 1, for a layer that refers to the SPS and has nuh_layer_id equal to currLayerId,
    569       // the value of sps_max_dec_pic_buffering_minus1[ i ] is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOlsIdx ][ layerIdx ][ i ] of the active VPS,
    570       // where layerIdx is equal to the value such that LayerSetLayerIdList[ TargetDecLayerSetIdx ][ layerIdx ] is equal to currLayerId.
    571       if( sps->getMultiLayerExtSpsFlag() )
    572       {
    573         sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), activeVPS->getLayerIdcForOls( activeVPS->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), m_layerId ), i) + 1, i);
    574       }
    575 
    576       // The value of sps_max_dec_pic_buffering_minus1[ i ] shall be less than or equal to vps_max_dec_pic_buffering_minus1[ i ] for each value of i.
    577       assert( sps->getMaxDecPicBuffering(i) <= activeVPS->getMaxDecPicBuffering(i) );     
    578     }
    579 
    580     UInt layerIdx = activeVPS->getLayerIdxInVps( m_layerId );
    581 
    582     if( activeVPS->getBaseLayerPSCompatibilityFlag(layerIdx) )
    583     {
    584       RepFormat* repFormat = activeVPS->getVpsRepFormat(activeVPS->getVpsRepFormatIdx(layerIdx));
    585 
    586       assert( pps->getLayerId() == 0 );
    587       assert( sps->getLayerId() == 0 );
    588       assert( repFormat->getChromaFormatVpsIdc() == sps->getChromaFormatIdc() );
    589       assert( repFormat->getSeparateColourPlaneVpsFlag() == 0 );
    590       assert( repFormat->getPicHeightVpsInLumaSamples() == sps->getPicHeightInLumaSamples() );
    591       assert( repFormat->getPicWidthVpsInLumaSamples()  == sps->getPicWidthInLumaSamples() );
    592       assert( repFormat->getBitDepthVpsLuma()   == sps->getBitDepth(CHANNEL_TYPE_LUMA) );
    593       assert( repFormat->getBitDepthVpsChroma() == sps->getBitDepth(CHANNEL_TYPE_CHROMA) );
    594       assert( repFormat->getConformanceWindowVps().getWindowLeftOffset()   == sps->getConformanceWindow().getWindowLeftOffset() );
    595       assert( repFormat->getConformanceWindowVps().getWindowRightOffset()  == sps->getConformanceWindow().getWindowRightOffset() );
    596       assert( repFormat->getConformanceWindowVps().getWindowTopOffset()    == sps->getConformanceWindow().getWindowTopOffset() );
    597       assert( repFormat->getConformanceWindowVps().getWindowBottomOffset() == sps->getConformanceWindow().getWindowBottomOffset() );
    598     }   
    599   }
    600 
    601   //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer
    602   UInt layerIdx = activeVPS->getLayerIdxInVps(m_apcSlicePilot->getLayerId());
    603 
    604   if ( activeVPS->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) )
    605   {
    606     assert( sps->getPicWidthInLumaSamples()        <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getPicWidthVpsInLumaSamples() );
    607     assert( sps->getPicHeightInLumaSamples()       <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getPicHeightVpsInLumaSamples() );
    608     assert( sps->getChromaFormatIdc()              <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getChromaFormatVpsIdc() );
    609     assert( sps->getBitDepth(CHANNEL_TYPE_LUMA)    <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsLuma() );
    610     assert( sps->getBitDepth(CHANNEL_TYPE_CHROMA)  <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsChroma() );
    611   }
    612   else if ( activeVPS->getVpsExtensionFlag() == 1 )
    613   {
    614     assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples()  <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples());
    615     assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples());
    616     assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc()        <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc());
    617     assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma()           <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma());
    618     assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()         <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma());
    619   }
    620 #endif //SVC_EXTENSION
    621 
    622   m_apcSlicePilot->setPPS(pps);
    623   m_apcSlicePilot->setSPS(sps);
    624   pps->setSPS(sps);
    625   pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumTileColumnsMinus1() + 1) : ((pps->getNumTileRowsMinus1() + 1)*(pps->getNumTileColumnsMinus1() + 1)));
    626   pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) );
    627   pps->setMinCuChromaQpAdjSize( sps->getMaxCUWidth() >> ( pps->getMaxCuChromaQpAdjDepth()) );
    628 
    629   for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++)
    630   {
    631 #if SVC_EXTENSION
    632     g_bitDepth[channel] = isLuma(ChannelType(channel)) ? m_apcSlicePilot->getBitDepthY() : m_apcSlicePilot->getBitDepthC();
     572      g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel));
     573#endif
     574      g_maxTrDynamicRange[channel] = (sps->getUseExtendedPrecision()) ? std::max<Int>(15, (g_bitDepth[channel] + 6)) : 15;
     575    }
     576    g_uiMaxCUWidth  = sps->getMaxCUWidth();
     577    g_uiMaxCUHeight = sps->getMaxCUHeight();
     578    g_uiMaxCUDepth  = sps->getMaxCUDepth();
     579#if SVC_EXTENSION
     580    g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(vps->getChromaFormatIdc(sps, m_apcSlicePilot->getLayerId()), sps->getQuadtreeTULog2MinSize()));
    633581#else
    634     g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel));
    635 #endif
    636 
    637     if (sps->getUseExtendedPrecision()) g_maxTrDynamicRange[channel] = std::max<Int>(15, (g_bitDepth[channel] + 6));
    638     else                                g_maxTrDynamicRange[channel] = 15;
    639   }
    640   g_uiMaxCUWidth  = sps->getMaxCUWidth();
    641   g_uiMaxCUHeight = sps->getMaxCUHeight();
    642   g_uiMaxCUDepth  = sps->getMaxCUDepth();
    643   g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize()));
    644 
    645   for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++)
    646   {
    647     sps->setAMPAcc( i, sps->getUseAMP() );
    648   }
    649 
    650   for (Int i = sps->getLog2DiffMaxMinCodingBlockSize(); i < sps->getMaxCUDepth(); i++)
    651   {
    652     sps->setAMPAcc( i, 0 );
    653   }
    654 
    655   m_cSAO.destroy();
    656 #if SVC_EXTENSION
    657   m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
     582    g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize()));
     583#endif
     584
     585    //  Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use.
     586#if SVC_EXTENSION
     587    xGetNewPicBuffer( *(vps), *(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer() );
    658588#else
    659   m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
    660 #endif
    661   m_cLoopFilter.create( sps->getMaxCUDepth() );
     589    xGetNewPicBuffer (*(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer());
     590#endif
     591
     592#if ALIGNED_BUMPING
     593    m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);
     594#else
     595    m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
     596#endif
     597
     598    // make the slice-pilot a real slice, and set up the slice-pilot for the next slice
     599    assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
     600    m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx);
     601
     602    // we now have a real slice:
     603    TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx);
     604
     605    // Update the PPS and SPS pointers with the ones of the picture.
     606    pps=pSlice->getPPS();
     607    sps=pSlice->getSPS();
     608
     609    // Initialise the various objects for the new set of settings
     610#if SVC_EXTENSION
     611    m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
     612#else
     613    m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) );
     614#endif
     615    m_cLoopFilter.create( sps->getMaxCUDepth() );
     616    m_cPrediction.initTempBuff(sps->getChromaFormatIdc());
     617
     618    Bool isField = false;
     619    Bool isTopField = false;
     620
     621    if(!m_SEIs.empty())
     622    {
     623      // Check if any new Picture Timing SEI has arrived
     624      SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING);
     625      if (pictureTimingSEIs.size()>0)
     626      {
     627        SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin());
     628        isField    = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12);
     629        isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11);
     630      }
     631     
     632#if Q0189_TMVP_CONSTRAINTS
     633      // Check if any new temporal motion vector prediction constraints SEI has arrived
     634      SEIMessages seiTMVPConstrainsList = extractSeisByType (m_SEIs, SEI::TMVP_CONSTRAINTS);
     635      if (seiTMVPConstrainsList.size() > 0)
     636      {
     637        assert ( m_pcPic->getTLayer() == 0 );  //this SEI can present only for AU with Tid equal to 0
     638        SEITMVPConstrains* tmvpConstraintSEI = (SEITMVPConstrains*) *(seiTMVPConstrainsList.begin());
     639        if ( tmvpConstraintSEI->prev_pics_not_used_flag == 1 )
     640        {
     641          //update all pics in the DPB such that they cannot be used for TMPV ref
     642          TComList<TComPic*>::iterator  iterRefPic = m_cListPic.begin(); 
     643          while( iterRefPic != m_cListPic.end() )
     644          {
     645            TComPic *refPic = *iterRefPic;
     646            if( ( refPic->getLayerId() == m_pcPic->getLayerId() ) && refPic->getReconMark() )
     647            {
     648              for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--)
     649              {
     650                TComSlice *refSlice = refPic->getSlice(i);
     651                refSlice->setAvailableForTMVPRefFlag( false );
     652              }
     653            }
     654            iterRefPic++;
     655          }
     656        }
     657      }
     658#endif
     659    }
     660
     661    //Set Field/Frame coding mode
     662    m_pcPic->setField(isField);
     663    m_pcPic->setTopField(isTopField);
     664
     665    // transfer any SEI messages that have been received to the picture
     666    m_pcPic->setSEIs(m_SEIs);
     667    m_SEIs.clear();
     668
     669    // Recursive structure
     670#if SVC_EXTENSION
     671    m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() );
     672    m_cCuDecoder.init   ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId );
     673#else
     674    m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() );
     675    m_cCuDecoder.init   ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
     676#endif
     677    m_cTrQuant.init     ( sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTrSize());
     678
     679    m_cSliceDecoder.create();
     680  }
     681  else
     682  {
     683    // make the slice-pilot a real slice, and set up the slice-pilot for the next slice
     684    m_pcPic->allocateNewSlice();
     685    assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
     686    m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx);
     687
     688    TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); // we now have a real slice.
     689
     690    const TComSPS *sps = pSlice->getSPS();
     691    const TComPPS *pps = pSlice->getPPS();
     692
     693    // check that the current active PPS has not changed...
     694    if (m_parameterSetManager.getSPSChangedFlag(sps->getSPSId()) )
     695    {
     696      printf("Error - a new SPS has been decoded while processing a picture\n");
     697      exit(1);
     698    }
     699    if (m_parameterSetManager.getPPSChangedFlag(pps->getPPSId()) )
     700    {
     701      printf("Error - a new PPS has been decoded while processing a picture\n");
     702      exit(1);
     703    }
     704
     705    // Check if any new SEI has arrived
     706    if(!m_SEIs.empty())
     707    {
     708      // Currently only decoding Unit SEI message occurring between VCL NALUs copied
     709      SEIMessages &picSEI = m_pcPic->getSEIs();
     710      SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO);
     711      picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end());
     712      deleteSEIs(m_SEIs);
     713    }
     714  }
     715
    662716}
    663717
     
    669723{
    670724#if SVC_EXTENSION
    671   m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) );
    672 
    673   // Following check should go wherever the VPS is activated
    674   if( !m_apcSlicePilot->getVPS()->getBaseLayerAvailableFlag() )
    675   {
    676     assert(nalu.m_layerId != 0);
    677     assert(m_apcSlicePilot->getVPS()->getNumAddLayerSets() > 0);
    678 
    679     if( m_commonDecoderParams->getTargetOutputLayerSetIdx() >= 0 )
    680     {
    681       UInt layerIdx = m_apcSlicePilot->getVPS()->getOutputLayerSetIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx());
    682       assert(layerIdx > m_apcSlicePilot->getVPS()->getVpsNumLayerSetsMinus1());
    683     }
    684   } 
    685 
    686725  m_apcSlicePilot->initSlice( nalu.m_layerId );
     726  m_apcSlicePilot->setTLayer( nalu.m_temporalId );
    687727#else //SVC_EXTENSION
    688   m_apcSlicePilot->initSlice();
     728  m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice
     729                                // it is not associated with picture, sps or pps structures.
    689730#endif
    690731
     
    700741
    701742  m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType);
    702 #if SVC_EXTENSION
    703   m_apcSlicePilot->setTLayer( nalu.m_temporalId );
    704 #endif
     743
    705744  Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N ||
    706745                           m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N   ||
     
    716755#endif
    717756
    718 #if SVC_EXTENSION
    719   setRefLayerParams(m_apcSlicePilot->getVPS());
     757  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager);
     758
     759#if SVC_EXTENSION
     760  const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId());
     761  assert (pps != 0);
     762  const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId());
     763  assert (sps != 0);
     764  const TComVPS *vps = m_parameterSetManager.getVPS(sps->getVPSId());
     765  assert (vps != 0);
     766
     767  // Following check should go wherever the VPS is activated
     768  if( !vps->getBaseLayerAvailableFlag() )
     769  {
     770    assert( nalu.m_layerId != 0 );
     771    assert( vps->getNumAddLayerSets() > 0 );
     772
     773    if( m_commonDecoderParams->getTargetOutputLayerSetIdx() >= 0 )
     774    {
     775      UInt layerIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() );
     776      assert( layerIdx > vps->getVpsNumLayerSetsMinus1() );
     777    }
     778  } 
     779
     780  setRefLayerParams(vps);
    720781  m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers);
    721782#endif
    722   m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
    723783
    724784  // set POC for dependent slices in skipped pictures
     
    779839  if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1
    780840  {
    781     Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
     841#if !SVC_EXTENSION
     842    TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId());
     843    assert (pps != 0);
     844    TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId());
     845    assert (sps != 0);
     846#endif
     847    Int iMaxPOClsb = 1 << sps->getBitsForPOC();
    782848    m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) );
    783849  }
     
    892958    if( m_apcSlicePilot->getPocResetIdc() != 0 )
    893959    {
    894       if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )
     960      if( vps->getVpsPocLsbAlignedFlag() )
    895961      {
    896962        m_pocResettingFlag = true;
     
    9561022  numAffectedLayers = 1;
    9571023
    958   if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )
    959   {
    960     for( UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ )
    961     {
    962       affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);
    963     }
    964     numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;
     1024  if( vps->getVpsPocLsbAlignedFlag() )
     1025  {
     1026    for( UInt j = 0; j < vps->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ )
     1027    {
     1028      affectedLayerList[j + 1] = vps->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);
     1029    }
     1030    numAffectedLayers = vps->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;
    9651031  }
    9661032
     
    11671233  m_apcSlicePilot->setAvailableForTMVPRefFlag( true );
    11681234
    1169   // actual decoding starts here
    1170   xActivateParameterSets();
    1171 
    11721235  // Initialize ILRP if needed, only for the current layer 
    11731236  // ILRP intialization should go along with activation of parameters sets,
     
    11751238  xInitILRP(m_apcSlicePilot);
    11761239
    1177   if (!m_apcSlicePilot->getDependentSliceSegmentFlag())
    1178   {
    1179     m_prevPOC = m_apcSlicePilot->getPOC();
    1180     curLayerId = m_layerId;
    1181     m_uiPrevLayerId = m_layerId;
    1182   }
    1183   m_bFirstSliceInSequence = false;
    1184   m_bFirstSliceInBitstream  = false;
    1185 
    11861240#else //SVC_EXTENSION
    11871241  //we should only get a different poc for a new picture (with CTU address==0)
     
    12051259    m_prevPOC = m_apcSlicePilot->getPOC();
    12061260  }
     1261#endif //SVC_EXTENSION
     1262
     1263  //detect lost reference picture and insert copy of earlier frame.
     1264  {
     1265    Int lostPoc;
     1266    while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0)
     1267    {
     1268      xCreateLostPicture(lostPoc-1);
     1269    }
     1270  }
     1271
     1272  if (!m_apcSlicePilot->getDependentSliceSegmentFlag())
     1273  {
     1274    m_prevPOC = m_apcSlicePilot->getPOC();
     1275#if SVC_EXTENSION
     1276    curLayerId = m_layerId;
     1277    m_uiPrevLayerId = m_layerId;
     1278#endif
     1279  }
    12071280
    12081281  // actual decoding starts here
    12091282  xActivateParameterSets();
    12101283
    1211   if (!m_apcSlicePilot->getDependentSliceSegmentFlag())
    1212   {
    1213     m_prevPOC = m_apcSlicePilot->getPOC();
    1214   }
    12151284  m_bFirstSliceInSequence = false;
    12161285  m_bFirstSliceInBitstream  = false;
    1217 #endif //SVC_EXTENSION
    1218 
    1219   //detect lost reference picture and insert copy of earlier frame.
    1220   Int lostPoc;
    1221   while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0)
    1222   {
    1223     xCreateLostPicture(lostPoc-1);
    1224   }
     1286
     1287  TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx);
     1288
     1289#if SVC_EXTENSION
    12251290  if (m_bFirstSliceInPicture)
    12261291  {
    1227 #if SVC_EXTENSION
    12281292#if AVC_BASE
    1229     if( m_layerId > 0 && m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getNonHEVCBaseLayerFlag() )
     1293    if( m_layerId > 0 && vps->getNonHEVCBaseLayerFlag() )
    12301294    {
    12311295      TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin());
     
    13361400    if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() )
    13371401    {
    1338       for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++)
     1402      for (UInt i = 0; i < vps->getMaxLayers(); i++)
    13391403      {
    13401404        m_ppcTDecTop[i]->setLayerInitializedFlag(false);
     
    13451409    xCheckLayerReset();
    13461410    xSetLayerInitializedFlag();
    1347 #endif
    1348 
    1349     // Buffer initialize for prediction.
    1350     m_cPrediction.initTempBuff(m_apcSlicePilot->getSPS()->getChromaFormatIdc());
    1351 #if ALIGNED_BUMPING
    1352     m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic);
    1353 #else
    1354     m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS());
    1355 #endif
    1356     //  Get a new picture buffer
    1357     xGetNewPicBuffer (m_apcSlicePilot, m_pcPic);
    1358 
     1411   
    13591412#if SVC_POC
    13601413    m_pcPic->setCurrAuFlag( true );
     
    13991452        else
    14001453        {
    1401           if( m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag())
     1454          if( vps->getBaseLayerInternalFlag())
    14021455          {
    14031456            /* When the picture with nuh_layer_id equal to 0 in an access unit is not an IDR picture
     
    14171470      and there is at least one other picture in the same access unit that is not an IRAP picture,
    14181471      the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */
    1419       if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )
     1472      if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && vps->getBaseLayerInternalFlag() )
    14201473      {
    14211474        assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 );
     
    14251478      vps_base_layer_internal_flag is equal to 1 and there is at least one non-IDR picture in the same access unit,
    14261479      the value of poc_reset_idc shall be equal to 2 for all pictures in the access unit. */
    1427       if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )
     1480      if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && vps->getBaseLayerInternalFlag() )
    14281481      {
    14291482        assert( m_apcSlicePilot->getPocResetIdc() == 2 );
     
    14431496    }
    14441497#endif
    1445 
    1446     Bool isField = false;
    1447     Bool isTopField = false;
    1448    
    1449     if(!m_SEIs.empty())
    1450     {
    1451       // Check if any new Picture Timing SEI has arrived
    1452       SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING);
    1453       if (pictureTimingSEIs.size()>0)
    1454       {
    1455         SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin());
    1456         isField    = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12);
    1457         isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11);
    1458       }
    1459 
    1460 #if Q0189_TMVP_CONSTRAINTS
    1461       // Check if any new temporal motion vector prediction constraints SEI has arrived
    1462       SEIMessages seiTMVPConstrainsList = extractSeisByType (m_SEIs, SEI::TMVP_CONSTRAINTS);
    1463       if (seiTMVPConstrainsList.size() > 0)
    1464       {
    1465         assert ( m_pcPic->getTLayer() == 0 );  //this SEI can present only for AU with Tid equal to 0
    1466         SEITMVPConstrains* tmvpConstraintSEI = (SEITMVPConstrains*) *(seiTMVPConstrainsList.begin());
    1467         if ( tmvpConstraintSEI->prev_pics_not_used_flag == 1 )
    1468         {
    1469           //update all pics in the DPB such that they cannot be used for TMPV ref
    1470           TComList<TComPic*>::iterator  iterRefPic = m_cListPic.begin(); 
    1471           while( iterRefPic != m_cListPic.end() )
    1472           {
    1473             TComPic *refPic = *iterRefPic;
    1474             if( ( refPic->getLayerId() == m_pcPic->getLayerId() ) && refPic->getReconMark() )
    1475             {
    1476               for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--)
    1477               {
    1478                 TComSlice *refSlice = refPic->getSlice(i);
    1479                 refSlice->setAvailableForTMVPRefFlag( false );
    1480               }
    1481             }
    1482             iterRefPic++;
    1483           }
    1484         }
    1485       }
    1486 #endif
    1487     }
    1488    
    1489     //Set Field/Frame coding mode
    1490     m_pcPic->setField(isField);
    1491     m_pcPic->setTopField(isTopField);
    1492 
    1493     // transfer any SEI messages that have been received to the picture
    1494     m_pcPic->setSEIs(m_SEIs);
    1495     m_SEIs.clear();
    1496 
    1497     // Recursive structure
    1498     m_cCuDecoder.create ( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getChromaFormatIdc() );
    1499 #if SVC_EXTENSION
    1500     m_cCuDecoder.init   ( m_ppcTDecTop,&m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, curLayerId );
    1501 #else
    1502     m_cCuDecoder.init   ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction );
    1503 #endif
    1504     m_cTrQuant.init     ( g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getMaxTrSize());
    1505 
    1506     m_cSliceDecoder.create();
    1507   }
    1508   else
    1509   {
    1510     // Check if any new SEI has arrived
    1511     if(!m_SEIs.empty())
    1512     {
    1513       // Currently only decoding Unit SEI message occurring between VCL NALUs copied
    1514       SEIMessages &picSEI = m_pcPic->getSEIs();
    1515       SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO);
    1516       picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end());
    1517       deleteSEIs(m_SEIs);
    1518     }
    1519   }
    1520 
    1521   //  Set picture slice pointer
    1522   TComSlice*  pcSlice = m_apcSlicePilot;
    1523 
    1524   m_pcPic->getPicSym()->initTiles(pcSlice->getPPS());
    1525   m_pcPic->getPicSym()->initCtuTsRsAddrMaps();
    1526 
     1498  }
     1499#endif //SVC_EXTENSION
     1500   
    15271501  // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses.
    15281502  // Now, having set up the maps, convert them to the correct form.
     
    15341508    pcSlice->setSliceCurEndCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr()));
    15351509  }
    1536 
    1537   if (m_bFirstSliceInPicture)
    1538   {
    1539     if(m_pcPic->getNumAllocatedSlice() != 1)
    1540     {
    1541       m_pcPic->clearSliceBuffer();
    1542     }
    1543   }
    1544   else
    1545   {
    1546     m_pcPic->allocateNewSlice();
    1547   }
    1548   assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1));
    1549   m_apcSlicePilot = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx);
    1550   m_pcPic->getPicSym()->setSlice(pcSlice, m_uiSliceIdx);
    1551 
     1510   
    15521511  m_pcPic->setTLayer(nalu.m_temporalId);
    15531512
     
    15771536        UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc);
    15781537#if AVC_BASE
    1579         if( refLayerId == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getNonHEVCBaseLayerFlag() )
     1538        if( refLayerId == 0 && m_parameterSetManager.getActiveVPS()->getNonHEVCBaseLayerFlag() )
    15801539        {         
    15811540          TComPic* pic = *m_ppcTDecTop[0]->getListPic()->begin();
     
    16191578
    16201579        // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
    1621         Bool phaseSetPresentFlag;
    1622         Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma;
    1623         pcSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma );
    1624 
    1625         assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
    1626              && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
     1580        const ResamplingPhase &resamplingPhase = pcSlice->getPPS()->getResamplingPhase( refLayerId );
     1581
     1582        assert( ( (widthEL  != widthBL)  || (resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0) )
     1583             && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) );
    16271584
    16281585        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     
    16731630        UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
    16741631#if AVC_BASE
    1675         if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getNonHEVCBaseLayerFlag() )
     1632        if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && pcSlice->getVPS()->getNonHEVCBaseLayerFlag() )
    16761633        {
    16771634          pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() );
     
    17921749  if(pcSlice->getSPS()->getScalingListFlag())
    17931750  {
    1794     pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList()  );
    1795 
    1796 #if SVC_EXTENSION
    1797     if( pcSlice->getPPS()->getScalingListPresentFlag() || pcSlice->getPPS()->getInferScalingListFlag() )
     1751    TComScalingList scalingList;
     1752
     1753#if SVC_EXTENSION
     1754    if( pcSlice->getPPS()->getInferScalingListFlag() )
     1755    {
     1756      const TComPPS *refPps = m_ppcTDecTop[pcSlice->getPPS()->getScalingListRefLayerId()]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL );
     1757      scalingList = refPps->getScalingList();
     1758    }
     1759    else
     1760#endif
     1761    if(pcSlice->getPPS()->getScalingListPresentFlag())
     1762    {
     1763      scalingList = pcSlice->getPPS()->getScalingList();
     1764    }
     1765#if SVC_EXTENSION
     1766    else if( pcSlice->getSPS()->getInferScalingListFlag() )
     1767    {
     1768      const TComSPS *refSps = m_ppcTDecTop[pcSlice->getSPS()->getScalingListRefLayerId()]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL );
     1769      scalingList = refSps->getScalingList();
     1770    }
     1771#endif
     1772    else if (pcSlice->getSPS()->getScalingListPresentFlag())
     1773    {
     1774      scalingList = pcSlice->getSPS()->getScalingList();
     1775    }
     1776    else
     1777    {
     1778      scalingList.setDefaultScalingList();
     1779    }
     1780#if SVC_EXTENSION
     1781    m_cTrQuant.setScalingListDec(scalingList, pcSlice->getChromaFormatIdc());
    17981782#else
    1799     if(pcSlice->getPPS()->getScalingListPresentFlag())
    1800 #endif
    1801     {
    1802       pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList()  );
    1803     }
    1804 
    1805 #if SVC_EXTENSION
    1806     if( m_layerId == 0 || ( m_layerId > 0 && !pcSlice->getPPS()->getInferScalingListFlag() && !pcSlice->getSPS()->getInferScalingListFlag() ) )
    1807 #endif
    1808     if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag())
    1809     {
    1810       pcSlice->setDefaultScalingList();
    1811     }
    1812     m_cTrQuant.setScalingListDec(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());
     1783    m_cTrQuant.setScalingListDec(scalingList, pcSlice->getSPS()->getChromaFormatIdc());
     1784#endif
    18131785    m_cTrQuant.setUseScalingList(true);
    18141786  }
    18151787  else
    18161788  {
     1789#if SVC_EXTENSION
     1790    m_cTrQuant.setFlatScalingList(pcSlice->getChromaFormatIdc());
     1791#else
    18171792    m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc());
     1793#endif
    18181794    m_cTrQuant.setUseScalingList(false);
    18191795  }
     
    18331809}
    18341810
    1835 Void TDecTop::xDecodeVPS()
     1811Void TDecTop::xDecodeVPS(const std::vector<UChar> *pNaluData)
    18361812{
    18371813  TComVPS* vps = new TComVPS();
    18381814
    18391815  m_cEntropyDecoder.decodeVPS( vps );
    1840   m_parameterSetManagerDecoder.storePrefetchedVPS(vps);
     1816  m_parameterSetManager.storeVPS(vps, pNaluData);
    18411817#if SVC_EXTENSION
    18421818  checkValueOfTargetOutputLayerSetIdx(vps);
    1843 #endif
    1844 }
    1845 
    1846 Void TDecTop::xDecodeSPS()
     1819
     1820#if AVC_BASE
     1821  if( vps->getNonHEVCBaseLayerFlag() )
     1822  {
     1823    if( !m_ppcTDecTop[0]->getBLReconFile()->good() )
     1824    {
     1825      printf( "Base layer YUV input reading error\n" );
     1826      exit(EXIT_FAILURE);
     1827    }       
     1828  }
     1829  else
     1830  {
     1831    TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic();
     1832    cListPic->clear();
     1833  }
     1834#endif
     1835
     1836  xDeriveSmallestLayerId(vps);
     1837#endif
     1838}
     1839
     1840Void TDecTop::xDecodeSPS(const std::vector<UChar> *pNaluData)
    18471841{
    18481842  TComSPS* sps = new TComSPS();
     
    18541848#endif
    18551849  m_cEntropyDecoder.decodeSPS( sps );
    1856   m_parameterSetManagerDecoder.storePrefetchedSPS(sps);
     1850  m_parameterSetManager.storeSPS(sps, pNaluData);
    18571851}
    18581852
    18591853#if CGS_3D_ASYMLUT
    1860 Void TDecTop::xDecodePPS( TCom3DAsymLUT * pc3DAsymLUT )
     1854Void TDecTop::xDecodePPS( const std::vector<UChar> *pNaluData, TCom3DAsymLUT * pc3DAsymLUT )
    18611855#else
    1862 Void TDecTop::xDecodePPS()
     1856Void TDecTop::xDecodePPS(const std::vector<UChar> *pNaluData)
    18631857#endif
    18641858{
     
    18731867  m_cEntropyDecoder.decodePPS( pps );
    18741868#endif
    1875   m_parameterSetManagerDecoder.storePrefetchedPPS( pps );
     1869  m_parameterSetManager.storePPS( pps, pNaluData);
    18761870}
    18771871
     
    18871881#endif
    18881882#if LAYERS_NOT_PRESENT_SEI
    1889     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream  );
     1883    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream  );
    18901884#else
    1891     m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream );
     1885    m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream );
    18921886#endif
    18931887  }
     
    18951889  {
    18961890#if LAYERS_NOT_PRESENT_SEI
    1897     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream  );
     1891    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream  );
    18981892#else
    1899     m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream );
     1893    m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream );
    19001894#endif
    19011895    SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS);
     
    19041898      SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin());
    19051899#if R0247_SEI_ACTIVE
    1906       getLayerDec(0)->m_parameterSetManagerDecoder.applyPrefetchedPS();
    19071900      assert(seiAps->activeSeqParameterSetId.size()>0);
    1908       if( !getLayerDec(0)->m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) )
     1901      if( !getLayerDec(0)->m_parameterSetManager.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) )
    19091902      {
    19101903        printf ("Warning SPS activation with Active parameter set SEI failed");
     
    19131906      {
    19141907        Int layerIdx = seiAps->layerSpsIdx[c];
    1915         getLayerDec(layerIdx)->m_parameterSetManagerDecoder.applyPrefetchedPS();
    1916         if( !getLayerDec(layerIdx)->m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[layerIdx] ) )
     1908        if( !getLayerDec(layerIdx)->m_parameterSetManager.activateSPSWithSEI( seiAps->activeSeqParameterSetId[layerIdx] ) )
    19171909        {
    19181910          printf ("Warning SPS activation with Active parameter set SEI failed");
     
    19201912      }
    19211913#else
    1922       m_parameterSetManagerDecoder.applyPrefetchedPS();
    19231914      assert(seiAps->activeSeqParameterSetId.size()>0);
    1924       if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))
     1915      if (! m_parameterSetManager.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))
    19251916      {
    19261917        printf ("Warning SPS activation with Active parameter set SEI failed");
     
    19541945      assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
    19551946#endif
    1956       xDecodeVPS();
     1947      xDecodeVPS(nalu.m_Bitstream->getFifo());
    19571948#if RExt__DECODER_DEBUG_BIT_STATISTICS
    19581949      TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0);
    19591950#endif
    19601951#if SVC_EXTENSION
    1961       m_isLastNALWasEos = false;
    1962 #if AVC_BASE
    1963       if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getNonHEVCBaseLayerFlag() )
    1964       {
    1965         if( !m_ppcTDecTop[0]->getBLReconFile()->good() )
    1966         {
    1967           printf( "Base layer YUV input reading error\n" );
    1968           exit(EXIT_FAILURE);
    1969         }       
    1970       }
    1971       else
    1972       {
    1973         TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic();
    1974         cListPic->clear();
    1975       }
    1976 #endif
    1977       xDeriveSmallestLayerId(m_parameterSetManagerDecoder.getPrefetchedVPS(0));
     1952      m_isLastNALWasEos = false;   
    19781953#endif
    19791954      return false;
    19801955
    19811956    case NAL_UNIT_SPS:
    1982       xDecodeSPS();
     1957      xDecodeSPS(nalu.m_Bitstream->getFifo());
    19831958#if RExt__DECODER_DEBUG_BIT_STATISTICS
    19841959      TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0);
     
    19871962
    19881963    case NAL_UNIT_PPS:
    1989       xDecodePPS(
    19901964#if CGS_3D_ASYMLUT
    1991         &m_c3DAsymLUTPPS
    1992 #endif
    1993         );
     1965      xDecodePPS( nalu.m_Bitstream->getFifo(), &m_c3DAsymLUTPPS );
     1966#else
     1967      xDecodePPS(nalu.m_Bitstream->getFifo());
     1968#endif
    19941969#if RExt__DECODER_DEBUG_BIT_STATISTICS
    19951970      TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0);
     
    22052180Void TDecTop::xInitILRP(TComSlice *slice)
    22062181{
    2207   TComSPS* pcSPS = slice->getSPS();
     2182  const TComVPS* vps  = slice->getVPS();
     2183  const TComSPS* sps  = slice->getSPS();
     2184
    22082185  Int bitDepthY   = slice->getBitDepthY();
    22092186  Int bitDepthC   = slice->getBitDepthC();
    2210   Int picWidth    = slice->getPicWidthInLumaSamples();
    2211   Int picHeight   = slice->getPicHeightInLumaSamples();
    22122187
    22132188  if( m_layerId > 0 )
     
    22162191    g_bitDepth[CHANNEL_TYPE_LUMA]     = bitDepthY;
    22172192    g_bitDepth[CHANNEL_TYPE_CHROMA]   = bitDepthC;
    2218     g_uiMaxCUWidth  = pcSPS->getMaxCUWidth();
    2219     g_uiMaxCUHeight = pcSPS->getMaxCUHeight();
    2220     g_uiMaxCUDepth  = pcSPS->getMaxCUDepth();
    2221     g_uiAddCUDepth  = max (0, pcSPS->getLog2MinCodingBlockSize() - (Int)pcSPS->getQuadtreeTULog2MinSize() );
     2193    g_uiMaxCUWidth  = sps->getMaxCUWidth();
     2194    g_uiMaxCUHeight = sps->getMaxCUHeight();
     2195    g_uiMaxCUDepth  = sps->getMaxCUDepth();
     2196    g_uiAddCUDepth  = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() );
    22222197
    22232198    Int  numReorderPics[MAX_TLAYER];
    2224     Window &conformanceWindow = slice->getConformanceWindow();
    2225     Window defaultDisplayWindow = pcSPS->getVuiParametersPresentFlag() ? pcSPS->getVuiParameters()->getDefaultDisplayWindow() : Window();
    22262199
    22272200    for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++ )
     
    22302203      {
    22312204        assert( this->getLayerId() == 0 );
    2232         numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer);
     2205        numReorderPics[temporalLayer] = sps->getNumReorderPics(temporalLayer);
    22332206      }
    22342207      else
    2235       {
    2236         TComVPS *vps = slice->getVPS();
     2208      {       
    22372209        // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures.
    22382210        numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer);
     
    22442216      for (Int j=0; j < m_numDirectRefLayers; j++)
    22452217      {
    2246 
    22472218        m_cIlpPic[j] = new  TComPic;
    22482219
    2249 #if AUXILIARY_PICTURES
    2250         m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true);
    2251 #else
    2252         m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true);
    2253 #endif
     2220        m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId);
     2221
    22542222        for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++)
    22552223        {
     
    22632231TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdx )
    22642232{
    2265   TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS();
     2233  const TComVPS* vps = m_parameterSetManager.getActiveVPS();
    22662234  if( vps->getNumDirectRefLayers( m_layerId ) <= 0 )
    22672235  {
     
    22722240}
    22732241
    2274 Void TDecTop::setRefLayerParams( TComVPS* vps )
     2242Void TDecTop::setRefLayerParams( const TComVPS* vps )
    22752243{
    22762244  for(UInt layerIdx = 0; layerIdx < m_numLayer; layerIdx++)
     
    24042372}
    24052373
    2406 Void TDecTop::markAllPicsAsNoCurrAu(TComVPS *vps)
     2374Void TDecTop::markAllPicsAsNoCurrAu( const TComVPS *vps )
    24072375{
    24082376  for(Int i = 0; i < MAX_LAYERS; i++)
    24092377  {
    2410     TComList<TComPic*>* listPic = this->getLayerDec(vps->getLayerIdInNuh(i))->getListPic();
     2378    TComList<TComPic*>* listPic = m_ppcTDecTop[vps->getLayerIdInNuh(i)]->getListPic();
    24112379    TComList<TComPic*>::iterator  iterPic = listPic->begin();
    24122380    while ( iterPic != listPic->end() )
     
    25702538}
    25712539
    2572 Void TDecTop::xSetSpatialEnhLayerFlag(TComSlice* slice, TComPic* pic)
    2573 {
    2574   for(UInt i = 0; i < slice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ )
    2575   {
    2576     const Window scalEL = slice->getPPS()->getScaledRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i));
    2577     const Window refEL = slice->getPPS()->getRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i));
     2540Void TDecTop::xSetSpatialEnhLayerFlag( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic* pic )
     2541{
     2542  for(UInt i = 0; i < vps.getNumDirectRefLayers( m_layerId ); i++ )
     2543  {
     2544    const Window scalEL = pps.getScaledRefLayerWindowForLayer(vps.getRefLayerId(m_layerId, i));
     2545    const Window refEL = pps.getRefLayerWindowForLayer(vps.getRefLayerId(m_layerId, i));
    25782546    Bool equalOffsets = scalEL.hasEqualOffset(refEL);
    2579     Bool zeroPhase = slice->getPPS()->hasZeroResamplingPhase(slice->getVPS()->getRefLayerId(m_layerId, i));
     2547    Bool zeroPhase = pps.hasZeroResamplingPhase(vps.getRefLayerId(m_layerId, i));
    25802548
    25812549    TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( i );
    2582     //TComPic*                      pcPic = *(pcTDecTopBase->getListPic()->begin());
    25832550    TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec();
    25842551
    2585     UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, i);
     2552    UInt refLayerId = vps.getRefLayerId(m_layerId, i);
    25862553    Bool sameBitDepths = ( g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId] );
    25872554
    2588     if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == slice->getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == slice->getPicHeightInLumaSamples() && equalOffsets && zeroPhase )
     2555    if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == vps.getPicWidthInLumaSamples(&sps, m_layerId) && pcPicYuvRecBase->getHeight(COMPONENT_Y) == vps.getPicHeightInLumaSamples(&sps, m_layerId) && equalOffsets && zeroPhase )
    25892556    {
    25902557      pic->setEqualPictureSizeAndOffsetFlag( i, true );
     
    25932560    if( !pic->equalPictureSizeAndOffsetFlag(i) || !sameBitDepths
    25942561#if CGS_3D_ASYMLUT
    2595       || slice->getPPS()->getCGSFlag() > 0
     2562      || pps.getCGSFlag() > 0
    25962563#endif
    25972564#if LAYER_CTB
     
    26032570
    26042571      //only for scalable extension
    2605       assert( slice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true );
     2572      assert( vps.getScalabilityMask( SCALABILITY_ID ) == true );
    26062573    }
    26072574  }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h

    r1223 r1235  
    7575
    7676  TComList<TComPic*>      m_cListPic;         //  Dynamic buffer
    77   ParameterSetManagerDecoder m_parameterSetManagerDecoder;  // storage for parameter sets
     77  ParameterSetManager     m_parameterSetManager;  // storage for parameter sets
    7878  TComSlice*              m_apcSlicePilot;
    7979
     
    152152  Int                     m_prevPicOrderCnt;
    153153#if CONFORMANCE_BITSTREAM_MODE
    154   Bool m_confModeFlag;
    155   std::vector<TComPic>   m_confListPic;         //  Dynamic buffer for storing pictures for conformance purposes
    156 #endif
    157   Bool m_isOutputLayerFlag;
     154  Bool                    m_confModeFlag;
     155  std::vector<TComPic>    m_confListPic;         //  Dynamic buffer for storing pictures for conformance purposes
     156#endif
     157  Bool                    m_isOutputLayerFlag;
    158158#endif //SVC_EXTENSION
    159159
    160160public:
    161161#if SVC_EXTENSION
    162   static Bool                    m_checkPocRestrictionsForCurrAu;
    163   static Int                     m_pocResetIdcOrCurrAu;
    164   static Bool                    m_baseLayerIdrFlag;
    165   static Bool                    m_baseLayerPicPresentFlag;
    166   static Bool                    m_baseLayerIrapFlag;
    167   static Bool                    m_nonBaseIdrPresentFlag;
    168   static Int                     m_nonBaseIdrType;
    169   static Bool                    m_picNonIdrWithRadlPresentFlag;
    170   static Bool                    m_picNonIdrNoLpPresentFlag;
    171   static Int                     m_crossLayerPocResetPeriodId;
    172   static Int                     m_crossLayerPocResetIdc;
     162  static Bool             m_checkPocRestrictionsForCurrAu;
     163  static Int              m_pocResetIdcOrCurrAu;
     164  static Bool             m_baseLayerIdrFlag;
     165  static Bool             m_baseLayerPicPresentFlag;
     166  static Bool             m_baseLayerIrapFlag;
     167  static Bool             m_nonBaseIdrPresentFlag;
     168  static Int              m_nonBaseIdrType;
     169  static Bool             m_picNonIdrWithRadlPresentFlag;
     170  static Bool             m_picNonIdrNoLpPresentFlag;
     171  static Int              m_crossLayerPocResetPeriodId;
     172  static Int              m_crossLayerPocResetIdc;
    173173#endif //SVC_EXTENSION
    174174
     
    189189 
    190190  Void  deletePicBuffer();
    191 
    192  
    193   TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }
    194 
    195191
    196192  Void  executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic);
     
    210206  Int       getParseIdc                     ()                              { return m_parseIdc;               }
    211207  Void      setParseIdc                     (Int x)                         { m_parseIdc = x;                  }
    212   Void      markAllPicsAsNoCurrAu           (TComVPS *vps);
     208  Void      markAllPicsAsNoCurrAu           ( const TComVPS *vps );
    213209
    214210  Int       getLastPocPeriodId              ()                              { return m_lastPocPeriodId;        }
     
    240236  Void      setNumMotionPredRefLayers       (Int num)                       { m_numMotionPredRefLayers = num;   }
    241237
    242   Void      setRefLayerParams( TComVPS* vps );
     238  Void      setRefLayerParams( const TComVPS* vps );
    243239
    244240#if AVC_BASE
     
    251247  Void      checkValueOfTargetOutputLayerSetIdx(TComVPS *vps);
    252248
    253   ParameterSetManagerDecoder* getParameterSetManager()                      { return &m_parameterSetManagerDecoder; }
     249  ParameterSetManager* getParameterSetManager()                             { return &m_parameterSetManager; }
    254250
    255251#if CONFORMANCE_BITSTREAM_MODE
    256252  std::vector<TComPic>* getConfListPic() {return &m_confListPic; }
    257   Bool const getConfModeFlag() { return m_confModeFlag; }
    258   Void setConfModeFlag(Bool x) { m_confModeFlag = x; }
     253  Bool      const getConfModeFlag() { return m_confModeFlag; }
     254  Void      setConfModeFlag(Bool x) { m_confModeFlag = x; }
    259255#endif
    260256#endif //SVC_EXTENSION
    261257
    262258protected:
    263   Void  xGetNewPicBuffer  (TComSlice* pcSlice, TComPic*& rpcPic);
    264   Void  xCreateLostPicture (Int iLostPOC);
     259#if SVC_EXTENSION
     260  Void      xGetNewPicBuffer  ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
     261#else
     262  Void      xGetNewPicBuffer  (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer);
     263#endif
     264  Void      xCreateLostPicture (Int iLostPOC);
    265265
    266266  Void      xActivateParameterSets();
    267267#if SVC_EXTENSION
    268268  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC);
    269   Void      xSetSpatialEnhLayerFlag(TComSlice* slice, TComPic* pic);
     269  Void      xSetSpatialEnhLayerFlag( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic* pic );
    270270#else
    271271  Bool      xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay);
    272272#endif
    273   Void      xDecodeVPS();
    274   Void      xDecodeSPS();
     273  Void      xDecodeVPS(const std::vector<UChar> *pNaluData);
     274  Void      xDecodeSPS(const std::vector<UChar> *pNaluData);
    275275#if CGS_3D_ASYMLUT
    276   Void      xDecodePPS( TCom3DAsymLUT * pc3DAsymLUT );
     276  Void      xDecodePPS(const std::vector<UChar> *pNaluData, TCom3DAsymLUT *pc3DAsymLUT);
    277277#else
    278   Void      xDecodePPS();
     278  Void      xDecodePPS(const std::vector<UChar> *pNaluData);
    279279#endif
    280280  Void      xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType );
     
    282282#if SVC_EXTENSION
    283283#if NO_CLRAS_OUTPUT_FLAG
    284   Int  getNoClrasOutputFlag()                { return m_noClrasOutputFlag;}
    285   Void setNoClrasOutputFlag(Bool x)          { m_noClrasOutputFlag = x;   }
    286   Int  getLayerInitializedFlag()             { return m_layerInitializedFlag;}
    287   Void setLayerInitializedFlag(Bool x)       { m_layerInitializedFlag = x;   }
    288   Int  getFirstPicInLayerDecodedFlag()       { return m_firstPicInLayerDecodedFlag;}
    289   Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x;   }
     284  Int       getNoClrasOutputFlag()                { return m_noClrasOutputFlag;}
     285  Void      setNoClrasOutputFlag(Bool x)          { m_noClrasOutputFlag = x;   }
     286  Int       getLayerInitializedFlag()             { return m_layerInitializedFlag;}
     287  Void      setLayerInitializedFlag(Bool x)       { m_layerInitializedFlag = x;   }
     288  Int       getFirstPicInLayerDecodedFlag()       { return m_firstPicInLayerDecodedFlag;}
     289  Void      setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x;   }
    290290#endif
    291291#if CGS_3D_ASYMLUT
    292   Void initAsymLut(TComSlice *pcSlice);
    293 #endif
    294   Void resetPocRestrictionCheckParameters();
    295   Void xCheckLayerReset();
    296   Void xSetNoRaslOutputFlag();
    297   Void xSetLayerInitializedFlag();
     292  Void     initAsymLut(TComSlice *pcSlice);
     293#endif
     294  Void     resetPocRestrictionCheckParameters();
     295  Void     xCheckLayerReset();
     296  Void     xSetNoRaslOutputFlag();
     297  Void     xSetLayerInitializedFlag();
    298298#endif
    299299};// END CLASS DEFINITION TDecTop
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp

    r1185 r1235  
    5555
    5656#if O0164_MULTI_LAYER_HRD
    57 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr)
     57Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr)
    5858#else
    59 Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)
     59Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps)
    6060#endif
    6161{
     
    215215 */
    216216#if O0164_MULTI_LAYER_HRD
    217 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)
     217Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei)
    218218#else
    219 Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps)
     219Void SEIWriter::writeSEImessage(TComBitIf& bs, const SEI& sei, const TComSPS *sps)
    220220#endif
    221221{
     
    341341
    342342#if SVC_EXTENSION
    343 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
    344 {
    345   TComHRD *hrd;
     343Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps)
     344{
     345  const TComHRD *hrd;
    346346  if( bspNestingSei )   // If DU info SEI contained inside a BSP nesting SEI message
    347347  {
     
    352352    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    353353    std::vector<Int> hrdIdx(maxValues, 0);
    354     std::vector<TComHRD *> hrdVec;
     354    std::vector<const TComHRD*> hrdVec;
    355355    std::vector<Int> syntaxElemLen(maxValues, 0);
    356356    for(Int i = 0; i < maxValues; i++)
     
    376376  else
    377377  {
    378     TComVUI *vui = sps->getVuiParameters();
     378    const TComVUI *vui = sps->getVuiParameters();
    379379    hrd = vui->getHrdParameters();
    380380  }
     
    392392}
    393393#else
    394 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)
    395 {
    396   TComVUI *vui = sps->getVuiParameters();
     394Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps)
     395{
     396  const TComVUI *vui = sps->getVuiParameters();
    397397  WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
    398398  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
     
    409409
    410410#if SVC_EXTENSION
    411 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
     411Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps)
    412412#else
    413 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps)
     413Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps)
    414414#endif
    415415{
    416416  Int i, nalOrVcl;
    417417#if SVC_EXTENSION
    418   TComHRD *hrd;
     418  const TComHRD *hrd;
    419419  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
    420420  {
     
    425425    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    426426    std::vector<Int> hrdIdx(maxValues, 0);
    427     std::vector<TComHRD *> hrdVec;
     427    std::vector<const TComHRD*> hrdVec;
    428428    std::vector<Int> syntaxElemLen(maxValues, 0);
    429429    for(i = 0; i < maxValues; i++)
     
    448448  else
    449449  {
    450     TComVUI *vui = sps->getVuiParameters();
     450    const TComVUI *vui = sps->getVuiParameters();
    451451    hrd = vui->getHrdParameters();
    452452  }
    453453  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
    454454#else
    455   TComVUI *vui = sps->getVuiParameters();
    456   TComHRD *hrd = vui->getHrdParameters();
     455  const TComVUI *vui = sps->getVuiParameters();
     456  const TComHRD *hrd = vui->getHrdParameters();
    457457#endif
    458458
     
    495495
    496496#if SVC_EXTENSION
    497 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei,  TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
     497Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps)
    498498#else
    499 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps)
     499Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps)
    500500#endif
    501501{
    502502  Int i;
    503503#if SVC_EXTENSION
    504   TComHRD *hrd;   
    505   TComVUI *vui = sps->getVuiParameters();
     504  const TComHRD *hrd;   
     505  const TComVUI *vui = sps->getVuiParameters();
    506506  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
    507507  {
     
    512512    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    513513    std::vector<Int> hrdIdx(maxValues, 0);
    514     std::vector<TComHRD *> hrdVec;
     514    std::vector<const TComHRD*> hrdVec;
    515515    std::vector<Int> syntaxElemLen(maxValues, 0);
    516516    for(i = 0; i < maxValues; i++)
     
    543543  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
    544544#else
    545   TComVUI *vui = sps->getVuiParameters();
    546   TComHRD *hrd = vui->getHrdParameters();
     545  const TComVUI *vui = sps->getVuiParameters();
     546  const TComHRD *hrd = vui->getHrdParameters();
    547547#endif
    548548
     
    752752
    753753#if O0164_MULTI_LAYER_HRD
    754 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps)
     754Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComVPS *vps, const TComSPS *sps)
    755755#else
    756 Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps)
     756Void SEIWriter::xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps)
    757757#endif
    758758{
     
    11301130
    11311131#if O0164_MULTI_LAYER_HRD
    1132 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei)
     1132Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei)
    11331133{
    11341134  WRITE_UVLC( sei.m_bspIdx, "bsp_idx" );
     
    11491149}
    11501150
    1151 Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei)
     1151Void SEIWriter::xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei)
    11521152{
    11531153  assert(vps->getVpsVuiPresentFlag());
    11541154
    1155 #if SVC_EXTENSION
    11561155  Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx;
    11571156  Int seiOlsIdx = bspNestingSei.m_seiOlsIdx;
     
    11591158  Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
    11601159  std::vector<Int> hrdIdx(maxValues, 0);
    1161   std::vector<TComHRD *> hrdVec;
     1160  std::vector<const TComHRD*> hrdVec;
    11621161  std::vector<Int> syntaxElemLen(maxValues, 0);
    11631162  for(Int i = 0; i < maxValues; i++)
     
    11911190    }
    11921191  }
    1193 #else
    1194   UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);
    1195   UInt len;
    1196   UInt hrdIdx;
    1197 
    1198   if (schedCombCnt > 0)
    1199   {
    1200     hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);
    1201   }
    1202   else
    1203   {
    1204     hrdIdx = 0;
    1205   }
    1206 
    1207   TComHRD *hrd = vps->getBspHrd(hrdIdx);
    1208 
    1209   if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())
    1210   {
    1211     len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;
    1212   }
    1213   else
    1214   {
    1215     len = 23 + 1;
    1216   }
    1217 
    1218   if (hrd->getNalHrdParametersPresentFlag())
    1219   {
    1220     for(UInt i = 0; i < schedCombCnt; i++)
    1221     {
    1222       WRITE_CODE( sei.m_nalInitialArrivalDelay[i], len, "nal_initial_arrival_delay" );
    1223     }
    1224   }
    1225 #if BSP_INIT_ARRIVAL_SEI
    1226   if( hrd->getVclHrdParametersPresentFlag() )
    1227 #else
    1228   else
    1229 #endif
    1230   {
    1231     for(UInt i = 0; i < schedCombCnt; i++)
    1232     {
    1233       WRITE_CODE( sei.m_vclInitialArrivalDelay[i], len, "vcl_initial_arrival_delay" );
    1234     }
    1235   }
    1236 #endif
    12371192}
    12381193
  • branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h

    r1185 r1235  
    5151
    5252#if O0164_MULTI_LAYER_HRD
    53   Void writeSEImessage(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);
     53  Void writeSEImessage(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei=NULL, const SEIBspNesting* bspNestingSei=NULL);
    5454#else
    55   Void writeSEImessage(TComBitIf& bs, const SEI& sei, TComSPS *sps);
     55  Void writeSEImessage(TComBitIf& bs, const SEI& sei, const TComSPS *sps);
    5656#endif
    5757
    5858protected:
    5959#if O0164_MULTI_LAYER_HRD
    60   Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);
     60  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);
    6161#else
    62   Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);
     62  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSPS *sps);
    6363#endif
    6464  Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei);
     
    6666  Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);
    6767#if SVC_EXTENSION
    68   Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
    69   Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
    70   Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
     68  Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps);
     69  Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps);
     70  Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps);
    7171#else
    72   Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps);
    73   Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps);
    74   Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps);
     72  Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, const TComSPS *sps);
     73  Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, const TComSPS *sps);
     74  Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, const TComSPS *sps);
    7575#endif
    7676  TComSPS *m_pSPS;
     
    8585  Void xWriteSEISOPDescription(const SEISOPDescription& sei);
    8686#if O0164_MULTI_LAYER_HRD
    87   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComVPS *vps, TComSPS *sps);
     87  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComVPS *vps, const TComSPS *sps);
    8888#else
    89   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
     89  Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps);
    9090#endif
    9191  Void xWriteSEITempMotionConstrainedTileSets(TComBitIf& bs, const SEITempMotionConstrainedTileSets& sei);
     
    110110#endif
    111111#if Q0189_TMVP_CONSTRAINTS
    112 Void xWriteSEITMVPConstraints (const SEITMVPConstrains &sei);
     112Void xWriteSEITMVPConstraints(const SEITMVPConstrains &sei);
    113113#endif
    114114#if Q0247_FRAME_FIELD_INFO
    115   Void xWriteSEIFrameFieldInfo  (const SEIFrameFieldInfo &sei);
     115  Void xWriteSEIFrameFieldInfo(const SEIFrameFieldInfo &sei);
    116116#endif
    117117#if O0164_MULTI_LAYER_HRD
    118   Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei);
    119   Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei);
     118  Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei);
     119  Void xWriteSEIBspInitialArrivalTime(const SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei);
    120120  Void xCodeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    121121#endif
  • branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp

    r1214 r1235  
    509509  TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx());
    510510  UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc);
    511   const Window &scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
     511  Window scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
    512512  TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec();
    513513  // borders of down-sampled picture
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1231 r1235  
    9696}
    9797
    98 Void TEncCavlc::codeShortTermRefPicSet( TComSPS* pcSPS, TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx)
     98Void TEncCavlc::codeShortTermRefPicSet( const TComReferencePictureSet* rps, Bool calledFromSliceHeader, Int idx)
    9999{
    100100#if PRINT_RPS_INFO
     
    153153
    154154
    155 Void TEncCavlc::codePPS( TComPPS* pcPPS
    156155#if CGS_3D_ASYMLUT
    157   , TEnc3DAsymLUT * pc3DAsymLUT
    158 #endif
    159   )
     156Void TEncCavlc::codePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT )
     157#else
     158Void TEncCavlc::codePPS( const TComPPS* pcPPS )
     159#endif
    160160{
    161161#if ENC_DEC_TRACE
    162162  xTracePPSHeader (pcPPS);
    163163#endif
    164 
    165   const UInt numberValidComponents = getNumberValidComponents(pcPPS->getSPS()->getChromaFormatIdc());
    166164
    167165  WRITE_UVLC( pcPPS->getPPSId(),                             "pps_pic_parameter_set_id" );
     
    184182  }
    185183
    186   WRITE_SVLC( COMPONENT_Cb<numberValidComponents ?  (pcPPS->getQpOffset(COMPONENT_Cb)) : 0, "pps_cb_qp_offset" );
    187   WRITE_SVLC( COMPONENT_Cr<numberValidComponents ?  (pcPPS->getQpOffset(COMPONENT_Cr)) : 0, "pps_cr_qp_offset" );
    188 
    189   assert(numberValidComponents <= 3); // if more than 3 components (eg 4:4:4:4), then additional offsets will have to go in extension area...
     184  WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" );
     185  WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" );
    190186
    191187  WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0,          "pps_slice_chroma_qp_offsets_present_flag" );
     
    232228  if( pcPPS->getScalingListPresentFlag() )
    233229  {
    234     codeScalingList( m_pcSlice->getScalingList() );
     230    codeScalingList( pcPPS->getScalingList() );
    235231  }
    236232  WRITE_FLAG( pcPPS->getListsModificationPresentFlag(), "lists_modification_present_flag");
     
    320316              WRITE_CODE( pcPPS->getRefLocationOffsetLayerId(k), 6, "ref_loc_offset_layer_id" );
    321317              WRITE_FLAG( pcPPS->getScaledRefLayerOffsetPresentFlag(k) ? 1 : 0, "scaled_ref_layer_offset_prsent_flag" );
    322               if (pcPPS->getScaledRefLayerOffsetPresentFlag(k))
     318              if( pcPPS->getScaledRefLayerOffsetPresentFlag(k) )
    323319              {
    324320                Window scaledWindow = pcPPS->getScaledRefLayerWindow(k);
     
    328324                WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
    329325              }
     326
    330327              WRITE_FLAG( pcPPS->getRefRegionOffsetPresentFlag(k) ? 1 : 0, "ref_region_offset_prsent_flag" );
    331               if (pcPPS->getRefRegionOffsetPresentFlag(k))
     328
     329              if( pcPPS->getRefRegionOffsetPresentFlag(k) )
    332330              {
    333                 Window refWindow = pcPPS->getRefLayerWindow(k);
     331                const Window refWindow = pcPPS->getRefLayerWindow(k);
    334332                WRITE_SVLC( refWindow.getWindowLeftOffset()   >> 1, "ref_region_left_offset" );
    335333                WRITE_SVLC( refWindow.getWindowTopOffset()    >> 1, "ref_region_top_offset" );
     
    337335                WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" );
    338336              }
     337
    339338              WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(k) ? 1 : 0, "resample_phase_set_present_flag" );
    340               if (pcPPS->getResamplePhaseSetPresentFlag(k))
     339
     340              if( pcPPS->getResamplePhaseSetPresentFlag(k) )
    341341              {
    342342                WRITE_UVLC( pcPPS->getPhaseHorLuma(k), "phase_hor_luma" );
     
    367367}
    368368
    369 Void TEncCavlc::codeVUI( TComVUI *pcVUI, TComSPS* pcSPS )
     369Void TEncCavlc::codeVUI( const TComVUI *pcVUI, const TComSPS* pcSPS )
    370370{
    371371#if ENC_DEC_TRACE
     
    421421    WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset()/ TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_bottom_offset");
    422422  }
    423   TimingInfo *timingInfo = pcVUI->getTimingInfo();
     423  const TimingInfo *timingInfo = pcVUI->getTimingInfo();
    424424  WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(),          "vui_timing_info_present_flag");
    425425  if(timingInfo->getTimingInfoPresentFlag())
     
    453453}
    454454
    455 Void TEncCavlc::codeHrdParameters( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 )
     455Void TEncCavlc::codeHrdParameters( const TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 )
    456456{
    457457  if( commonInfPresentFlag )
     
    484484  {
    485485    WRITE_FLAG( hrd->getFixedPicRateFlag( i ) ? 1 : 0,          "fixed_pic_rate_general_flag");
     486    Bool fixedPixRateWithinCvsFlag = true;
    486487    if( !hrd->getFixedPicRateFlag( i ) )
    487488    {
     489      fixedPixRateWithinCvsFlag = hrd->getFixedPicRateWithinCvsFlag( i );
    488490      WRITE_FLAG( hrd->getFixedPicRateWithinCvsFlag( i ) ? 1 : 0, "fixed_pic_rate_within_cvs_flag");
    489491    }
    490     else
    491     {
    492       hrd->setFixedPicRateWithinCvsFlag( i, true );
    493     }
    494     if( hrd->getFixedPicRateWithinCvsFlag( i ) )
     492    if( fixedPixRateWithinCvsFlag )
    495493    {
    496494      WRITE_UVLC( hrd->getPicDurationInTcMinus1( i ),           "elemental_duration_in_tc_minus1");
     
    526524}
    527525
    528 Void TEncCavlc::codeSPS( TComSPS* pcSPS )
     526Void TEncCavlc::codeSPS( const TComSPS* pcSPS )
    529527{
    530528#if SVC_EXTENSION
     
    662660    if(pcSPS->getScalingListPresentFlag())
    663661    {
    664       codeScalingList( m_pcSlice->getScalingList() );
     662      codeScalingList( pcSPS->getScalingList() );
    665663    }
    666664#if SVC_EXTENSION
     
    683681  assert( pcSPS->getMaxTLayers() > 0 );
    684682
    685   TComRPSList* rpsList = pcSPS->getRPSList();
    686   TComReferencePictureSet*      rps;
     683  const TComRPSList* rpsList = pcSPS->getRPSList();
    687684
    688685  WRITE_UVLC(rpsList->getNumberOfReferencePictureSets(), "num_short_term_ref_pic_sets" );
    689686  for(Int i=0; i < rpsList->getNumberOfReferencePictureSets(); i++)
    690687  {
    691     rps = rpsList->getReferencePictureSet(i);
    692     codeShortTermRefPicSet(pcSPS,rps,false, i);
     688    const TComReferencePictureSet*rps = rpsList->getReferencePictureSet(i);
     689    codeShortTermRefPicSet( rps,false, i);
    693690  }
    694691  WRITE_FLAG( pcSPS->getLongTermRefsPresent() ? 1 : 0,         "long_term_ref_pics_present_flag" );
     
    778775}
    779776
    780 Void TEncCavlc::codeVPS( TComVPS* pcVPS )
     777Void TEncCavlc::codeVPS( const TComVPS* pcVPS )
    781778{
    782779  WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
     
    824821  assert( pcVPS->getMaxNuhReservedZeroLayerId() < MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1 );
    825822  WRITE_CODE( pcVPS->getMaxNuhReservedZeroLayerId(), 6,     "vps_max_nuh_reserved_zero_layer_id" );
    826   pcVPS->setMaxOpSets(1);
    827823  WRITE_UVLC( pcVPS->getMaxOpSets() - 1,                    "vps_max_op_sets_minus1" );
    828824  for( UInt opsIdx = 1; opsIdx <= ( pcVPS->getMaxOpSets() - 1 ); opsIdx ++ )
     
    832828    {
    833829      // Only applicable for version 1
    834       pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );
     830      // pcVPS->setLayerIdIncludedFlag( true, opsIdx, i );
    835831#endif
    836832      WRITE_FLAG( pcVPS->getLayerIdIncludedFlag( opsIdx, i ) ? 1 : 0, "layer_id_included_flag[opsIdx][i]" );
     
    838834  }
    839835
    840   TimingInfo *timingInfo = pcVPS->getTimingInfo();
     836  const TimingInfo *timingInfo = pcVPS->getTimingInfo();
    841837  WRITE_FLAG(timingInfo->getTimingInfoPresentFlag(),          "vps_timing_info_present_flag");
    842838  if(timingInfo->getTimingInfoPresentFlag())
     
    849845      WRITE_UVLC(timingInfo->getNumTicksPocDiffOneMinus1(),   "vps_num_ticks_poc_diff_one_minus1");
    850846    }
    851     pcVPS->setNumHrdParameters( 0 );
    852847    WRITE_UVLC( pcVPS->getNumHrdParameters(),                 "vps_num_hrd_parameters" );
    853848
    854849    if( pcVPS->getNumHrdParameters() > 0 )
    855850    {
    856       pcVPS->createHrdParamBuffer();
    857     }
    858     for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ )
    859     {
    860       // Only applicable for version 1
    861       pcVPS->setHrdOpSetIdx( 0, i );
    862       WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ),                "hrd_op_set_idx" );
    863       if( i > 0 )
    864       {
    865         WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" );
    866       }
    867       codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
     851      for( UInt i = 0; i < pcVPS->getNumHrdParameters(); i ++ )
     852      {
     853        // Only applicable for version 1
     854        WRITE_UVLC( pcVPS->getHrdOpSetIdx( i ),                "hrd_op_set_idx" );
     855        if( i > 0 )
     856        {
     857          WRITE_FLAG( pcVPS->getCprmsPresentFlag( i ) ? 1 : 0, "cprms_present_flag[i]" );
     858        }
     859        codeHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
     860      }
    868861    }
    869862  }
     
    1004997    {
    1005998#endif
    1006       TComReferencePictureSet* rps = pcSlice->getRPS();
     999      const TComReferencePictureSet* rps = pcSlice->getRPS();
    10071000
    10081001      // check for bitstream restriction stating that:
     
    10231016      {
    10241017        WRITE_FLAG( 0, "short_term_ref_pic_set_sps_flag");
    1025         codeShortTermRefPicSet(pcSlice->getSPS(), rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets());
     1018        codeShortTermRefPicSet( rps, true, pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets());
    10261019      }
    10271020      else
     
    12471240      {
    12481241        SliceType sliceType   = pcSlice->getSliceType();
    1249         Int  encCABACTableIdx = pcSlice->getPPS()->getEncCABACTableIdx();
     1242        SliceType  encCABACTableIdx = pcSlice->getEncCABACTableIdx();
    12501243        Bool encCabacInitFlag = (sliceType!=encCABACTableIdx && encCABACTableIdx!=I_SLICE) ? true : false;
    12511244        pcSlice->setCabacInitFlag( encCabacInitFlag );
     
    13181311}
    13191312
    1320 Void TEncCavlc::codePTL( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1)
     1313Void TEncCavlc::codePTL( const TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1)
    13211314{
    13221315  if(profilePresentFlag)
     
    13641357  }
    13651358}
    1366 Void TEncCavlc::codeProfileTier( ProfileTierLevel* ptl )
     1359Void TEncCavlc::codeProfileTier( const ProfileTierLevel* ptl )
    13671360{
    13681361  WRITE_CODE( ptl->getProfileSpace(), 2 ,     "XXX_profile_space[]");
     
    17341727 *  \param scalingList quantization matrix information
    17351728 */
    1736 Void TEncCavlc::codeScalingList( TComScalingList* scalingList )
    1737 {
    1738   UInt listId,sizeId;
    1739   Bool scalingListPredModeFlag;
    1740 
     1729Void TEncCavlc::codeScalingList( const TComScalingList &scalingList )
     1730{
    17411731  //for each size
    1742   for(sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
    1743   {
    1744     Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
    1745 
    1746     for(listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)
    1747     {
    1748       scalingListPredModeFlag = scalingList->checkPredMode( sizeId, listId );
     1732  for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     1733  {
     1734    const Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
     1735
     1736    for(UInt listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)
     1737    {
     1738      Bool scalingListPredModeFlag = scalingList.getScalingListPredModeFlag(sizeId, listId);
    17491739      WRITE_FLAG( scalingListPredModeFlag, "scaling_list_pred_mode_flag" );
    17501740      if(!scalingListPredModeFlag)// Copy Mode
     
    17531743        {
    17541744          // adjust the code, to cope with the missing chroma entries
    1755           WRITE_UVLC( ((Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta");
     1745          WRITE_UVLC( ((Int)listId - (Int)scalingList.getRefMatrixId (sizeId,listId)) / (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES), "scaling_list_pred_matrix_id_delta");
    17561746        }
    17571747        else
    17581748        {
    1759           WRITE_UVLC( (Int)listId - (Int)scalingList->getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");
     1749          WRITE_UVLC( (Int)listId - (Int)scalingList.getRefMatrixId (sizeId,listId), "scaling_list_pred_matrix_id_delta");
    17601750        }
    17611751      }
    17621752      else// DPCM Mode
    17631753      {
    1764         xCodeScalingList(scalingList, sizeId, listId);
     1754        xCodeScalingList(&scalingList, sizeId, listId);
    17651755      }
    17661756    }
     
    17731763 * \param listIdc list index
    17741764 */
    1775 Void TEncCavlc::xCodeScalingList(TComScalingList* scalingList, UInt sizeId, UInt listId)
     1765Void TEncCavlc::xCodeScalingList(const TComScalingList* scalingList, UInt sizeId, UInt listId)
    17761766{
    17771767  Int coefNum = min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId]);
     
    17791769  Int nextCoef = SCALING_LIST_START_VALUE;
    17801770  Int data;
    1781   Int *src = scalingList->getScalingListAddress(sizeId, listId);
     1771  const Int *src = scalingList->getScalingListAddress(sizeId, listId);
    17821772    if( sizeId > SCALING_LIST_8x8 )
    17831773    {
     
    18141804  }
    18151805  return false;
    1816 }
    1817 Bool TComScalingList::checkPredMode(UInt sizeId, UInt listId)
    1818 {
    1819   Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
    1820 
    1821   for(Int predListIdx = (Int)listId ; predListIdx >= 0; predListIdx-=predListStep)
    1822   {
    1823     if( !memcmp(getScalingListAddress(sizeId,listId),((listId == predListIdx) ?
    1824       getScalingListDefaultAddress(sizeId, predListIdx): getScalingListAddress(sizeId, predListIdx)),sizeof(Int)*min(MAX_MATRIX_COEF_NUM,(Int)g_scalingListSize[sizeId])) // check value of matrix
    1825      && ((sizeId < SCALING_LIST_16x16) || (getScalingListDC(sizeId,listId) == getScalingListDC(sizeId,predListIdx)))) // check DC value
    1826     {
    1827       setRefMatrixId(sizeId, listId, predListIdx);
    1828       return false;
    1829     }
    1830   }
    1831   return true;
    18321806}
    18331807
     
    19471921}
    19481922
    1949 Void TEncCavlc::codeVPSExtension (TComVPS *vps)
     1923Void TEncCavlc::codeVPSExtension( const TComVPS *vps )
    19501924{
    19511925  Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1];
     
    20712045  for( Int idx = vps->getBaseLayerInternalFlag() ? 2 : 1; idx < vps->getNumProfileTierLevel(); idx++ )
    20722046  {
    2073     vps->setProfilePresentFlag(idx, true);
    2074 
    20752047    WRITE_FLAG( vps->getProfilePresentFlag(idx),       "vps_profile_present_flag[i]" );
    20762048
     
    22162188    WRITE_CODE(1, 8, "vps_non_vui_extension_data_byte");
    22172189  }
    2218 
    2219   vps->setVpsVuiPresentFlag(true);
     2190   
    22202191  WRITE_FLAG( vps->getVpsVuiPresentFlag() ? 1 : 0,                     "vps_vui_present_flag" );
    22212192
     
    22312202}
    22322203
    2233 Void  TEncCavlc::codeRepFormat( RepFormat *repFormat )
     2204Void  TEncCavlc::codeRepFormat( const RepFormat *repFormat )
    22342205{
    22352206  WRITE_CODE( repFormat->getPicWidthVpsInLumaSamples (), 16, "pic_width_vps_in_luma_samples" );   
     
    22642235}
    22652236
    2266 Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps)
     2237Void TEncCavlc::codeVpsDpbSizeTable( const TComVPS *vps )
    22672238{
    22682239  for( Int i = 1; i < vps->getNumOutputLayerSets(); i++ )
     
    22972268}
    22982269
    2299 Void TEncCavlc::codeVPSVUI (TComVPS *vps)
     2270Void TEncCavlc::codeVPSVUI( const TComVPS *vps )
    23002271{
    23012272  Int i,j;
    23022273  WRITE_FLAG(vps->getCrossLayerPictureTypeAlignFlag(), "cross_layer_pic_type_aligned_flag");
    2303   if (!vps->getCrossLayerPictureTypeAlignFlag())
     2274
     2275  if( !vps->getCrossLayerPictureTypeAlignFlag() )
    23042276  {
    23052277    WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
     
    23082280  {
    23092281    // When not present, the value of cross_layer_irap_aligned_flag is inferred to be equal to vps_vui_present_flag,
    2310     // i.e. it is true in this function
    2311     vps->setCrossLayerIrapAlignFlag( true );
     2282    assert( vps->getCrossLayerIrapAlignFlag() == true );
    23122283  }
    23132284
     
    24652436}
    24662437
    2467 Void TEncCavlc::codeSPSExtension( TComSPS* pcSPS )
     2438Void TEncCavlc::codeSPSExtension( const TComSPS* pcSPS )
    24682439{
    24692440  // more syntax elements to be written here
     
    24732444}
    24742445
    2475 Void TEncCavlc::codeVpsVuiBspHrdParams(TComVPS * const vps)
     2446Void TEncCavlc::codeVpsVuiBspHrdParams( const TComVPS* vps )
    24762447{
    24772448  WRITE_UVLC( vps->getVpsNumAddHrdParams(), "vps_num_add_hrd_params" );
     
    25282499                }
    25292500
    2530                 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_comb_hrd_idx[h][i][t][j][k]");
     2501                WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "bsp_hrd_idx[h][i][t][j][k]");
    25312502              }
    25322503
    2533               WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_comb_sched_idx[h][i][t][j][k]");
     2504              WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_sched_idx[h][i][t][j][k]");
    25342505            }
    25352506          }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h

    r1224 r1235  
    7575  TComSlice*    m_pcSlice;
    7676
    77   Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
     77  Void codeShortTermRefPicSet              ( const TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
    7878  Bool findMatchingLTRP ( TComSlice* pcSlice, UInt *ltrpsIndex, Int ltrpPOC, Bool usedFlag );
    7979
     
    8181
    8282  Void  resetEntropy          ();
    83   Void  determineCabacInitIdx  () {};
     83  SliceType determineCabacInitIdx  () { assert(0); return I_SLICE; };
    8484
    8585  Void  setBitstream          ( TComBitIf* p )  { m_pcBitIf = p;  }
     
    8787  Void  resetBits             ()                { m_pcBitIf->resetBits(); }
    8888  UInt  getNumberOfWrittenBits()                { return  m_pcBitIf->getNumberOfWrittenBits();  }
    89   Void  codeVPS                 ( TComVPS* pcVPS );
    90   Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
    91   Void  codeSPS                 ( TComSPS* pcSPS );
    92   Void  codePPS                 ( TComPPS* pcPPS
     89  Void  codeVPS                 ( const TComVPS* pcVPS );
     90  Void  codeVUI                 ( const TComVUI *pcVUI, const TComSPS* pcSPS );
     91  Void  codeSPS                 ( const TComSPS* pcSPS );
    9392#if CGS_3D_ASYMLUT
    94     , TEnc3DAsymLUT * pc3DAsymLUT
     93  Void  codePPS                 ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT );
     94#else
     95  Void  codePPS                 ( const TComPPS* pcPPS );
    9596#endif
    96     );
    9797  Void  codeSliceHeader         ( TComSlice* pcSlice );
    98   Void  codePTL                 ( TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);
    99   Void  codeProfileTier         ( ProfileTierLevel* ptl );
    100   Void  codeHrdParameters       ( TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
     98  Void  codePTL                 ( const TComPTL* pcPTL, Bool profilePresentFlag, Int maxNumSubLayersMinus1);
     99  Void  codeProfileTier         ( const ProfileTierLevel* ptl );
     100  Void  codeHrdParameters       ( const TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1 );
    101101  Void  codeTilesWPPEntryPoint( TComSlice* pSlice );
    102102  Void  codeTerminatingBit      ( UInt uilsLast );
     
    146146  Void xCodePredWeightTable          ( TComSlice* pcSlice );
    147147
    148   Void codeScalingList  ( TComScalingList* scalingList );
    149   Void xCodeScalingList ( TComScalingList* scalingList, UInt sizeId, UInt listId);
     148  Void codeScalingList  ( const TComScalingList &scalingList );
     149  Void xCodeScalingList ( const TComScalingList* scalingList, UInt sizeId, UInt listId);
    150150  Void codeDFFlag       ( UInt uiCode, const Char *pSymbolName );
    151151  Void codeDFSvlc       ( Int   iCode, const Char *pSymbolName );
     
    154154
    155155#if SVC_EXTENSION
    156   Void  codeSliceHeaderExtn  ( TComSlice* slice, Int shBitsWrittenTillNow );
    157   Void codeSPSExtension      ( TComSPS* pcSPS );
    158   Void codeVPSExtension      ( TComVPS* pcVPS );
    159   Void codeVPSVUI            ( TComVPS *vps  );
    160   Void codeRepFormat         ( RepFormat *repFormat );
    161   Void codeVpsDpbSizeTable   ( TComVPS *vps );
    162   Void codeVpsVuiBspHrdParams( TComVPS * const );
     156  Void codeSliceHeaderExtn   ( TComSlice* slice, Int shBitsWrittenTillNow );
     157  Void codeSPSExtension      ( const TComSPS* sps );
     158  Void codeVPSExtension      ( const TComVPS* vps );
     159  Void codeVPSVUI            ( const TComVPS* vps );
     160  Void codeRepFormat         ( const RepFormat *repFormat );
     161  Void codeVpsDpbSizeTable   ( const TComVPS *vps );
     162  Void codeVpsVuiBspHrdParams( const TComVPS * const );
    163163
    164164#if CGS_3D_ASYMLUT
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h

    r1230 r1235  
    702702  Void  setWaveFrontSynchro(Int iWaveFrontSynchro)                   { m_iWaveFrontSynchro = iWaveFrontSynchro; }
    703703  Int   getWaveFrontsynchro()                                        { return m_iWaveFrontSynchro; }
    704   Void  setWaveFrontSubstreams(Int iWaveFrontSubstreams)             { m_iWaveFrontSubstreams = iWaveFrontSubstreams; }
    705   Int   getWaveFrontSubstreams()                                     { return m_iWaveFrontSubstreams; }
    706704  Void  setDecodedPictureHashSEIEnabled(Int b)                       { m_decodedPictureHashSEIEnabled = b; }
    707705  Int   getDecodedPictureHashSEIEnabled()                            { return m_decodedPictureHashSEIEnabled; }
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCu.cpp

    r1203 r1235  
    407407  const UInt numberValidComponents = rpcBestCU->getPic()->getNumberValidComponents();
    408408
    409   if( (g_uiMaxCUWidth>>uiDepth) >= rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
     409  if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
    410410  {
    411411    Int idQP = m_pcEncCfg->getMaxDeltaQP();
     
    601601
    602602          //! Try AMP (SIZE_2NxnU, SIZE_2NxnD, SIZE_nLx2N, SIZE_nRx2N)
    603           if( pcPic->getSlice(0)->getSPS()->getAMPAcc(uiDepth) )
     603          if(pcSlice->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
    604604          {
    605605#if AMP_ENC_SPEEDUP
     
    805805  }
    806806
    807   if( (g_uiMaxCUWidth>>uiDepth) == rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
     807  if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
    808808  {
    809809    Int idQP = m_pcEncCfg->getMaxDeltaQP();
     
    816816#endif   
    817817  }
    818   else if( (g_uiMaxCUWidth>>uiDepth) > rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() )
     818  else if( (g_uiMaxCUWidth>>uiDepth) > (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
    819819  {
    820820    iMinQP = iBaseQP;
     
    909909      rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    910910
    911       if( (g_uiMaxCUWidth>>uiDepth) == rpcTempCU->getSlice()->getPPS()->getMinCuDQPSize() && rpcTempCU->getSlice()->getPPS()->getUseDQP())
     911      if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( rpcTempCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && rpcTempCU->getSlice()->getPPS()->getUseDQP())
    912912      {
    913913        Bool hasResidual = false;
     
    10791079  {
    10801080    UInt uiQNumParts = ( pcPic->getNumPartitionsInCtu() >> (uiDepth<<1) )>>2;
    1081     if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
     1081    if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
    10821082    {
    10831083      setdQPFlag(true);
    10841084    }
    10851085
    1086     if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj())
     1086    if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj())
    10871087    {
    10881088      setCodeChromaQpAdjFlag(true);
     
    11061106  }
    11071107
    1108   if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())
     1108  if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP())
    11091109  {
    11101110    setdQPFlag(true);
    11111111  }
    11121112
    1113   if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj())
     1113  if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj())
    11141114  {
    11151115    setCodeChromaQpAdjFlag(true);
     
    16591659  UInt uiDepth = pcCU->getDepth( 0 );
    16601660
    1661   if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() )
     1661  if( pcCU->getSlice()->getPPS()->getUseDQP() && (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) )
    16621662  {
    16631663    if ( pcCU->getQtRootCbf( 0) )
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.cpp

    r1212 r1235  
    7979
    8080#if CGS_3D_ASYMLUT
    81 Void TEncEntropy::encodePPS( TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT  )
     81Void TEncEntropy::encodePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT  )
    8282{
    8383  m_pcEntropyCoderIf->codePPS( pcPPS, pc3DAsymLUT );
     
    8585}
    8686#else
    87 Void TEncEntropy::encodePPS( TComPPS* pcPPS )
     87Void TEncEntropy::encodePPS( const TComPPS* pcPPS )
    8888{
    8989  m_pcEntropyCoderIf->codePPS( pcPPS );
     
    9292#endif
    9393
    94 Void TEncEntropy::encodeSPS( TComSPS* pcSPS )
     94Void TEncEntropy::encodeSPS( const TComSPS* pcSPS )
    9595{
    9696  m_pcEntropyCoderIf->codeSPS( pcSPS );
     
    107107}
    108108
    109 Void TEncEntropy::encodeVPS( TComVPS* pcVPS )
     109Void TEncEntropy::encodeVPS( const TComVPS* pcVPS )
    110110{
    111111  m_pcEntropyCoderIf->codeVPS( pcVPS );
     
    739739}
    740740
    741 /** encode quantization matrix
    742  * \param scalingList quantization matrix information
    743  */
    744 Void TEncEntropy::encodeScalingList( TComScalingList* scalingList )
    745 {
    746   m_pcEntropyCoderIf->codeScalingList( scalingList );
    747 }
    748 
    749741#if SVC_EXTENSION
    750742Void TEncEntropy::encodeSliceHeaderExtn( TComSlice* pSlice, Int shBitsWrittenTillNow )
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncEntropy.h

    r1212 r1235  
    6464public:
    6565  virtual Void  resetEntropy          ()                = 0;
    66   virtual Void determineCabacInitIdx ()                = 0;
     66  virtual SliceType determineCabacInitIdx ()                = 0;
    6767  virtual Void  setBitstream          ( TComBitIf* p )  = 0;
    6868  virtual Void  setSlice              ( TComSlice* p )  = 0;
     
    7070  virtual UInt  getNumberOfWrittenBits()                = 0;
    7171
    72   virtual Void  codeVPS                 ( TComVPS* pcVPS )                                      = 0;
    73   virtual Void  codeSPS                 ( TComSPS* pcSPS )                                      = 0;
    74   virtual Void  codePPS                 ( TComPPS* pcPPS
     72  virtual Void  codeVPS                 ( const TComVPS* pcVPS )                                      = 0;
     73  virtual Void  codeSPS                 ( const TComSPS* pcSPS )                                      = 0;
    7574#if CGS_3D_ASYMLUT
    76     , TEnc3DAsymLUT * pc3DAsymLUT
    77 #endif
    78     )                                      = 0;
     75  virtual Void  codePPS                 ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT )         = 0;
     76#else
     77  virtual Void  codePPS                 ( const TComPPS* pcPPS )                                      = 0;
     78#endif
    7979  virtual Void  codeSliceHeader         ( TComSlice* pcSlice )                                  = 0;
    8080
     
    8282  virtual Void  codeTerminatingBit      ( UInt uilsLast )                                       = 0;
    8383  virtual Void  codeSliceFinish         ()                                                      = 0;
    84   virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0;
    85   virtual Void codeScalingList   ( TComScalingList* scalingList )      = 0;
     84  virtual Void  codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0;
    8685
    8786public:
     
    140139  UInt    getNumberOfWrittenBits    ()                        { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); }
    141140  Void    resetEntropy              ()                        { m_pcEntropyCoderIf->resetEntropy();  }
    142   Void    determineCabacInitIdx     ()                        { m_pcEntropyCoderIf->determineCabacInitIdx(); }
     141  SliceType determineCabacInitIdx   ()                        { return m_pcEntropyCoderIf->determineCabacInitIdx(); }
    143142
    144143  Void    encodeSliceHeader         ( TComSlice* pcSlice );
     
    149148
    150149public:
    151   Void encodeVPS               ( TComVPS* pcVPS);
     150  Void encodeVPS               ( const TComVPS* pcVPS);
    152151  // SPS
    153   Void encodeSPS               ( TComSPS* pcSPS );
    154   Void encodePPS               ( TComPPS* pcPPS
     152  Void encodeSPS               ( const TComSPS* pcSPS );
    155153#if CGS_3D_ASYMLUT
    156     , TEnc3DAsymLUT * pc3DAsymLUT
    157 #endif
    158     );
     154  Void encodePPS               ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT );
     155#else
     156  Void encodePPS               ( const TComPPS* pcPPS );
     157#endif
    159158  Void encodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
    160159  Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     
    184183  Void encodeChromaQpAdjustment ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    185184
    186   Void encodeScalingList       ( TComScalingList* scalingList );
    187 
    188185  Void encodeCrossComponentPrediction( TComTU &rTu, ComponentID compID );
    189186
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1232 r1235  
    216216}
    217217
    218 SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets (TComSPS *sps)
     218SEIActiveParameterSets* TEncGOP::xCreateSEIActiveParameterSets (const TComSPS *sps)
    219219{
    220220  SEIActiveParameterSets *seiActiveParameterSets = new SEIActiveParameterSets();
     
    374374}
    375375
    376 SEITempMotionConstrainedTileSets* TEncGOP::xCreateSEITempMotionConstrainedTileSets ()
     376SEITempMotionConstrainedTileSets* TEncGOP::xCreateSEITempMotionConstrainedTileSets (const TComPPS *pps)
    377377{
    378   TComPPS *pps = m_pcEncTop->getPPS();
    379378  SEITempMotionConstrainedTileSets *sei = new SEITempMotionConstrainedTileSets();
    380379  if(pps->getTilesEnabledFlag())
     
    490489}
    491490
    492 Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps)
     491Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const TComSPS *sps, const TComPPS *pps)
    493492{
    494493  OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
     
    579578  if(m_pcCfg->getTMCTSSEIEnabled())
    580579  {
    581     SEITempMotionConstrainedTileSets *sei_tmcts = xCreateSEITempMotionConstrainedTileSets ();
     580    SEITempMotionConstrainedTileSets *sei_tmcts = xCreateSEITempMotionConstrainedTileSets (pps);
    582581
    583582    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
     
    11231122    //  Slice data initialization
    11241123    pcPic->clearSliceBuffer();
    1125     assert(pcPic->getNumAllocatedSlice() == 1);
     1124    pcPic->allocateNewSlice();
    11261125    m_pcSliceEncoder->setSliceIdx(0);
    11271126    pcPic->setCurrSliceIdx(0);
    11281127#if SVC_EXTENSION
    11291128    pcPic->setLayerId( m_layerId );
    1130     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), m_pcEncTop->getVPS(), isField );
    1131 #else
    1132     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, m_pcEncTop->getSPS(), m_pcEncTop->getPPS(), isField );
     1129    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, isField );
     1130#else
     1131    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iNumPicRcvd, iGOPid, pcSlice, &(pcPic->getPicSym()->getSPS()), &(pcPic->getPicSym()->getPPS()), isField );
    11331132#endif
    11341133
     
    12521251    //set default slice level flag to the same as SPS level flag
    12531252    pcSlice->setLFCrossSliceBoundaryFlag(  pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()  );
    1254     pcSlice->setScalingList ( m_pcEncTop->getScalingList()  );
    1255     if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_OFF)
    1256     {
    1257       m_pcEncTop->getTrQuant()->setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc());
    1258       m_pcEncTop->getTrQuant()->setUseScalingList(false);
    1259       m_pcEncTop->getSPS()->setScalingListPresentFlag(false);
    1260       m_pcEncTop->getPPS()->setScalingListPresentFlag(false);
    1261     }
    1262     else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_DEFAULT)
    1263     {
    1264 #if SVC_EXTENSION
    1265       // inferring of the scaling list can be moved to the config file
    1266       UInt refLayerId = 0;
    1267       if( m_layerId > 0 && !m_pcEncTop->getVPS()->getNonHEVCBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )
    1268       {
    1269         m_pcEncTop->getSPS()->setInferScalingListFlag( true );
    1270         m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );
    1271         m_pcEncTop->getSPS()->setScalingListPresentFlag( false );
    1272         m_pcEncTop->getPPS()->setInferScalingListFlag( false );
    1273         m_pcEncTop->getPPS()->setScalingListPresentFlag( false );
    1274 
    1275         // infer the scaling list from the reference layer
    1276         pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() );
    1277       }
    1278       else
    1279       {
    1280 #endif
    1281       pcSlice->setDefaultScalingList ();
    1282       m_pcEncTop->getSPS()->setScalingListPresentFlag(false);
    1283       m_pcEncTop->getPPS()->setScalingListPresentFlag(false);
    1284 
    1285 #if SVC_EXTENSION
    1286       }
    1287 #endif
    1288 
    1289       m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());
    1290       m_pcEncTop->getTrQuant()->setUseScalingList(true);
    1291     }
    1292     else if(m_pcEncTop->getUseScalingListId() == SCALING_LIST_FILE_READ)
    1293     {
    1294 #if SVC_EXTENSION
    1295       // inferring of the scaling list can be moved to the config file
    1296       UInt refLayerId = 0;
    1297       if( m_layerId > 0 && !m_pcEncTop->getVPS()->getNonHEVCBaseLayerFlag() && m_pcEncTop->getVPS()->getRecursiveRefLayerFlag( m_layerId, refLayerId ) )
    1298       {
    1299         m_pcEncTop->getSPS()->setInferScalingListFlag( true );
    1300         m_pcEncTop->getSPS()->setScalingListRefLayerId( refLayerId );
    1301         m_pcEncTop->getSPS()->setScalingListPresentFlag( false );
    1302         m_pcEncTop->getPPS()->setInferScalingListFlag( false );
    1303         m_pcEncTop->getPPS()->setScalingListPresentFlag( false );
    1304 
    1305         // infer the scaling list from the reference layer
    1306         pcSlice->setScalingList ( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(refLayerId)]->getScalingList() );
    1307       }
    1308       else
    1309       {
    1310 #endif
    1311       pcSlice->setDefaultScalingList ();
    1312       if(pcSlice->getScalingList()->xParseScalingList(m_pcCfg->getScalingListFile()))
    1313       {
    1314         Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string
    1315         assert(bParsedScalingList);
    1316         exit(1);
    1317       }
    1318       pcSlice->getScalingList()->checkDcOfMatrix();
    1319       m_pcEncTop->getSPS()->setScalingListPresentFlag(pcSlice->checkDefaultScalingList());
    1320       m_pcEncTop->getPPS()->setScalingListPresentFlag(false);
    1321 
    1322 #if SVC_EXTENSION
    1323     }
    1324 #endif
    1325 
    1326       m_pcEncTop->getTrQuant()->setScalingList(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc());
    1327       m_pcEncTop->getTrQuant()->setUseScalingList(true);
    1328     }
    1329     else
    1330     {
    1331       printf("error : ScalingList == %d no support\n",m_pcEncTop->getUseScalingListId());
    1332       assert(0);
    1333     }
    13341253
    13351254    if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='P')
     
    13811300
    13821301        // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
    1383         Bool phaseSetPresentFlag;
    1384         Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma;
    1385         pcSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma );
    1386 
    1387         assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
    1388              && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
     1302        const ResamplingPhase &resamplingPhase = pcSlice->getPPS()->getResamplingPhase( refLayerId );
     1303
     1304        assert( ( (widthEL  != widthBL)  || (resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0) )
     1305             && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) );
    13891306
    13901307        g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
     
    14181335          Bool bSignalPPS = m_bSeqFirst;
    14191336          bSignalPPS |= m_pcCfg->getGOPSize() > 1 ? pocCurr % m_pcCfg->getIntraPeriod() == 0 : pocCurr % m_pcCfg->getFrameRate() == 0;
    1420           xDetermin3DAsymLUT( pcSlice , pcPic , refLayerIdc , m_pcCfg , bSignalPPS );
     1337          xDetermin3DAsymLUT( pcSlice, pcPic, refLayerIdc, m_pcCfg, bSignalPPS );
     1338
     1339          // update PPS in TEncTop and TComPicSym classes
     1340          m_pcEncTop->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() );
     1341          m_pcEncTop->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() );
     1342          pcPic->getPicSym()->getPPSToUpdate()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() );
     1343          pcPic->getPicSym()->getPPSToUpdate()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() );
     1344
    14211345          m_Enc3DAsymLUTPPS.colorMapping( pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(),  m_pColorMappedPic );
    14221346          pBaseColRec = m_pColorMappedPic;
     
    16081532          if(lTid==pcSlice->getTLayer())
    16091533          {
    1610             TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);
     1534            const TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);
    16111535            for(Int jj=0;jj<nRPS->getNumberOfPictures();jj++)
    16121536            {
     
    17251649          if(lTid==pcSlice->getTLayer())
    17261650          {
    1727             TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);
     1651            const TComReferencePictureSet* nRPS = pcSlice->getSPS()->getRPSList()->getReferencePictureSet(ii);
    17281652            for(Int jj=0; jj<nRPS->getNumberOfPictures(); jj++)
    17291653            {
     
    18441768      pcSlice->setSliceType ( P_SLICE );
    18451769    }
     1770    pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx());
    18461771
    18471772    if (pcSlice->getSliceType() == B_SLICE)
     
    18941819        pcSlice->setEnableTMVPFlag(1);
    18951820      }
    1896       pcSlice->getSPS()->setTMVPFlagsPresent(1);
    18971821    }
    18981822    else if (m_pcEncTop->getTMVPModeId() == 1)
    18991823    {
    1900       pcSlice->getSPS()->setTMVPFlagsPresent(1);
    19011824#if SVC_EXTENSION
    19021825      if( pcSlice->getIdrPicFlag() )
     
    19101833    else
    19111834    {
    1912       pcSlice->getSPS()->setTMVPFlagsPresent(0);
    19131835      pcSlice->setEnableTMVPFlag(0);
    19141836    }
     
    20261948    pcPic->getSlice(pcSlice->getSliceIdx())->setMvdL1ZeroFlag(pcSlice->getMvdL1ZeroFlag());
    20271949
    2028     pcPic->getPicSym()->initTiles(pcSlice->getPPS());
    2029     pcPic->getPicSym()->initCtuTsRsAddrMaps();
    2030 
    20311950    Double lambda            = 0.0;
    20321951    Int actualHeadBits       = 0;
     
    21142033
    21152034    // Allocate some coders, now the number of tiles are known.
    2116     const Int numSubstreams = pcSlice->getPPS()->getNumSubstreams();
     2035    const Int numSubstreamsColumns = (pcSlice->getPPS()->getNumTileColumnsMinus1() + 1);
     2036    const Int numSubstreamRows     = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcPic->getFrameHeightInCtus() : (pcSlice->getPPS()->getNumTileRowsMinus1() + 1);
     2037    const Int numSubstreams        = numSubstreamRows * numSubstreamsColumns;
    21172038    std::vector<TComOutputBitstream> substreamsOut(numSubstreams);
    21182039
     
    21382059          m_pcSliceEncoder->setSliceIdx             ( uiNumSliceSegments   );
    21392060          pcSlice = pcPic->getSlice                 ( uiNumSliceSegments   );
     2061          assert(pcSlice->getPPS()!=0);
    21402062          pcSlice->copySliceInfo                    ( pcPic->getSlice(uiNumSliceSegments-1)  );
    21412063          pcSlice->setSliceIdx                      ( uiNumSliceSegments   );
     
    21512073          pcSlice->setDependentSliceSegmentFlag(bNextSegmentIsDependentSlice);
    21522074          pcSlice->setSliceSegmentCurStartCtuTsAddr ( curSliceSegmentEnd );
     2075          // TODO: optimise cabac_init during compress slice to improve multi-slice operation
     2076          // pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx());
    21532077          uiNumSliceSegments ++;
    21542078        }
     
    21772101    if ( m_pcCfg->getDeblockingFilterMetric() )
    21782102    {
    2179       dblMetric(pcPic, uiNumSliceSegments);
     2103      applyDeblockingFilterMetric(pcPic, uiNumSliceSegments);
    21802104    }
    21812105    m_pcLoopFilter->loopFilterPic( pcPic );
     
    21852109    m_pcEntropyCoder->setEntropyCoder   ( m_pcCavlcCoder, pcSlice );
    21862110
    2187     /* write various header sets. */
     2111    // write various header sets.
    21882112    if ( m_bSeqFirst )
    21892113    {
     
    22222146
    22232147      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    2224       if (m_bSeqFirst)
    2225       {
    2226         pcSlice->getSPS()->setNumLongTermRefPicSPS(m_numLongTermRefPicSPS);
    2227         assert (m_numLongTermRefPicSPS <= MAX_NUM_LONG_TERM_REF_PICS);
    2228         for (Int k = 0; k < m_numLongTermRefPicSPS; k++)
    2229         {
    2230           pcSlice->getSPS()->setLtRefPicPocLsbSps(k, m_ltRefPicPocLsbSps[k]);
    2231           pcSlice->getSPS()->setUsedByCurrPicLtSPSFlag(k, m_ltRefPicUsedByCurrPicFlag[k]);
    2232         }
    2233       }
    2234       if( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() )
    2235       {
    2236         UInt maxCU = m_pcCfg->getSliceArgument();
    2237         UInt numDU = ( m_pcCfg->getSliceMode() == FIXED_NUMBER_OF_CTU ) ? ( pcPic->getNumberOfCtusInFrame() / maxCU ) : ( 0 );
    2238         if( pcPic->getNumberOfCtusInFrame() % maxCU != 0 || numDU == 0 )
    2239         {
    2240           numDU ++;
    2241         }
    2242         pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->setNumDU( numDU );
    2243         pcSlice->getSPS()->setHrdParameters( m_pcCfg->getFrameRate(), numDU, m_pcCfg->getTargetBitrate(), ( m_pcCfg->getIntraPeriod() > 0 ) );
    2244       }
    2245       if( m_pcCfg->getBufferingPeriodSEIEnabled() || m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() )
    2246       {
    2247         pcSlice->getSPS()->getVuiParameters()->setHrdParametersPresentFlag( true );
    2248       }
    2249 
     2148     
    22502149#if SVC_EXTENSION
    22512150      // dependency constraint
     
    22852184      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    22862185
    2287       xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS());
     2186      xCreateLeadingSEIMessages(accessUnit, pcSlice->getSPS(), pcSlice->getPPS());
    22882187
    22892188#if O0164_MULTI_LAYER_HRD
     
    27762675      }
    27772676#endif
     2677
     2678      pcSlice->setEncCABACTableIdx(m_pcSliceEncoder->getEncCABACTableIdx());
    27782679
    27792680      tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits();
     
    30892990        || ( pcSlice->getSPS()->getVuiParameters()->getHrdParameters()->getVclHrdParametersPresentFlag() ) ) )
    30902991    {
    3091       TComVUI *vui = pcSlice->getSPS()->getVuiParameters();
    3092       TComHRD *hrd = vui->getHrdParameters();
     2992      const TComVUI *vui = pcSlice->getSPS()->getVuiParameters();
     2993      const TComHRD *hrd = vui->getHrdParameters();
    30932994
    30942995      if( hrd->getSubPicCpbParamsPresentFlag() )
     
    40943995}
    40953996
    4096 Void TEncGOP::dblMetric( TComPic* pcPic, UInt uiNumSlices )
     3997Void TEncGOP::applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices )
    40973998{
    40983999  TComPicYuv* pcPicYuvRec = pcPic->getPicYuvRec();
     
    48194720
    48204721#if CGS_3D_ASYMLUT
    4821 Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg , Bool bSignalPPS )
     4722Void TEncGOP::xDetermin3DAsymLUT( TComSlice * pSlice, TComPic * pCurPic, UInt refLayerIdc, TEncCfg * pCfg, Bool bSignalPPS )
    48224723{
    48234724  Int nCGSFlag = pSlice->getPPS()->getCGSFlag();
     
    48844785    }
    48854786  }
    4886   pSlice->getPPS()->setCGSOutputBitDepthY( m_Enc3DAsymLUTPPS.getOutputBitDepthY() );
    4887   pSlice->getPPS()->setCGSOutputBitDepthC( m_Enc3DAsymLUTPPS.getOutputBitDepthC() );
    48884787}
    48894788
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h

    r1212 r1235  
    236236  Double xCalculateRVM();
    237237
    238   SEIActiveParameterSets*           xCreateSEIActiveParameterSets (TComSPS *sps);
     238  SEIActiveParameterSets*           xCreateSEIActiveParameterSets (const TComSPS *sps);
    239239  SEIFramePacking*                  xCreateSEIFramePacking();
    240240  SEISegmentedRectFramePacking*     xCreateSEISegmentedRectFramePacking();
    241241  SEIDisplayOrientation*            xCreateSEIDisplayOrientation();
    242242  SEIToneMappingInfo*               xCreateSEIToneMappingInfo();
    243   SEITempMotionConstrainedTileSets* xCreateSEITempMotionConstrainedTileSets ();
     243  SEITempMotionConstrainedTileSets* xCreateSEITempMotionConstrainedTileSets (const TComPPS *pps);
    244244  SEIKneeFunctionInfo*              xCreateSEIKneeFunctionInfo();
    245245  SEIChromaSamplingFilterHint*      xCreateSEIChromaSamplingFilterHint(Bool bChromaLocInfoPresent, Int iHorFilterIndex, Int iVerFilterIdc);
    246246
    247   Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps);
     247  Void xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, const TComSPS *sps, const TComPPS *pps);
    248248  Int xGetFirstSeiLocation (AccessUnit &accessUnit);
    249249  Void xResetNonNestedSEIPresentFlags()
     
    258258    m_nestedPictureTimingSEIPresentInAU      = false;
    259259  }
    260   Void dblMetric( TComPic* pcPic, UInt uiNumSlices );
     260  Void applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices );
    261261
    262262#if Q0074_COLOUR_REMAPPING_SEI
     
    290290  Void downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest);
    291291  Void downScaleComponent2x2( const Pel* pSrc, Pel* pDest, const Int iSrcStride, const Int iDestStride, const Int iSrcWidth, const Int iSrcHeight, const Int inputBitDepth, const Int outputBitDepth );
    292   inline Short  xClip( Short x , Int bitdepth );
     292  inline Short xClip( Short x , Int bitdepth );
    293293  Void initDs(Int iWidth, Int iHeight, Int iType);
    294   Void filterImg(
    295     Pel           *src,
    296     Int           iSrcStride,
    297     Pel           *dst,
    298     Int           iDstStride,
    299     Int           height1, 
    300     Int           width1, 
    301     Int           shift,
    302     Int           plane);
     294  Void filterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height1, Int width1, Int shift, Int plane);
    303295
    304296  Int get_mem2DintWithPad(Int ***array2D, Int dim0, Int dim1, Int iPadY, Int iPadX);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.cpp

    r1029 r1235  
    128128
    129129#if SVC_EXTENSION
    130 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 
    131                       Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual )
     130Void TEncPic::create( const TComVPS& vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual, const UInt layerId )
    132131{
    133   TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, 
    134                    conformanceWindow, defaultDisplayWindow, numReorderPics, pcSps, bIsVirtual );
     132  TComPic::create( vps, sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual, layerId );
     133
     134  const Int iWidth  = vps.getPicWidthInLumaSamples(&sps, layerId);
     135  const Int iHeight = vps.getPicHeightInLumaSamples(&sps, layerId);
    135136#else
    136 Void TEncPic::create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,
    137                       Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual )
     137Void TEncPic::create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual )
    138138{
    139   TComPic::create( iWidth, iHeight, chromaFormat, uiMaxWidth, uiMaxHeight, uiMaxDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, bIsVirtual );
     139  TComPic::create( sps, pps, uiMaxWidth, uiMaxHeight, uiMaxDepth, bIsVirtual );
     140
     141  const Int iWidth  = sps.getPicWidthInLumaSamples();
     142  const Int iHeight = sps.getPicHeightInLumaSamples();
    140143#endif
    141144  m_uiMaxAQDepth = uiMaxAQDepth;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncPic.h

    r1029 r1235  
    106106
    107107#if SVC_EXTENSION
    108   Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, 
    109                       Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, TComSPS* pcSps, Bool bIsVirtual=false );
     108  Void          create( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/, const UInt layerId );
    110109#else  //SVC_EXTENSION
    111   Void          create( Int iWidth, Int iHeight, ChromaFormat chromaFormat, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth,
    112                           Window &conformanceWindow, Window &defaultDisplayWindow, Int *numReorderPics, Bool bIsVirtual = false );
     110  Void          create( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, UInt uiMaxAQDepth, Bool bIsVirtual /* = false*/ );
    113111#endif //SVC_EXTENSION
    114112
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.cpp

    r1230 r1235  
    109109  SliceType eSliceType  = m_pcSlice->getSliceType();
    110110
    111   Int  encCABACTableIdx = m_pcSlice->getPPS()->getEncCABACTableIdx();
     111  SliceType encCABACTableIdx = m_pcSlice->getEncCABACTableIdx();;
    112112  if (!m_pcSlice->isIntra() && (encCABACTableIdx==B_SLICE || encCABACTableIdx==P_SLICE) && m_pcSlice->getPPS()->getCabacInitPresentFlag())
    113113  {
    114     eSliceType = (SliceType) encCABACTableIdx;
     114    eSliceType = encCABACTableIdx;
    115115  }
    116116
     
    161161 * stores the index of the closest table.  This index is used for the next P/B slice when cabac_init_present_flag is true.
    162162 */
    163 Void TEncSbac::determineCabacInitIdx()
     163SliceType TEncSbac::determineCabacInitIdx()
    164164{
    165165  Int  qp              = m_pcSlice->getSliceQp();
     
    214214      }
    215215    }
    216     m_pcSlice->getPPS()->setEncCABACTableIdx( bestSliceType );
     216    return bestSliceType;
    217217  }
    218218  else
    219219  {
    220     m_pcSlice->getPPS()->setEncCABACTableIdx( I_SLICE );
    221   }
    222 }
    223 
    224 Void TEncSbac::codeVPS( TComVPS* pcVPS )
     220    return I_SLICE;
     221  }
     222}
     223
     224Void TEncSbac::codeVPS( const TComVPS* pcVPS )
    225225{
    226226  assert (0);
     
    228228}
    229229
    230 Void TEncSbac::codeSPS( TComSPS* pcSPS )
     230Void TEncSbac::codeSPS( const TComSPS* pcSPS )
    231231{
    232232  assert (0);
     
    234234}
    235235
    236 Void TEncSbac::codePPS( TComPPS* pcPPS
    237236#if CGS_3D_ASYMLUT
    238   , TEnc3DAsymLUT * pc3DAsymLUT
     237Void TEncSbac::codePPS( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT )
     238#else
     239Void TEncSbac::codePPS( const TComPPS* pcPPS )
    239240#endif
    240   )
    241241{
    242242  assert (0);
     
    459459      m_pcBinIf->encodeBin( 0, m_cCUPartSizeSCModel.get( 0, 0, 0) );
    460460      m_pcBinIf->encodeBin( 1, m_cCUPartSizeSCModel.get( 0, 0, 1) );
    461       if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     461      if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
    462462      {
    463463        if (eSize == SIZE_2NxN)
     
    485485      }
    486486
    487       if ( pcCU->getSlice()->getSPS()->getAMPAcc( uiDepth ) )
     487      if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth )
    488488      {
    489489        if (eSize == SIZE_Nx2N)
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSbac.h

    r1212 r1235  
    7575  //  Virtual list
    7676  Void  resetEntropy           ();
    77   Void determineCabacInitIdx  ();
     77  SliceType determineCabacInitIdx  ();
    7878  Void  setBitstream           ( TComBitIf* p )  { m_pcBitIf = p; m_pcBinIf->init( p ); }
    7979  Void  setSlice               ( TComSlice* p )  { m_pcSlice = p;                       }
     
    8787  //--SBAC RD
    8888
    89   Void  codeVPS                ( TComVPS* pcVPS );
    90   Void  codeSPS                ( TComSPS* pcSPS     );
    91   Void  codePPS                ( TComPPS* pcPPS     
     89  Void  codeVPS                ( const TComVPS* pcVPS );
     90  Void  codeSPS                ( const TComSPS* pcSPS     );
    9291#if CGS_3D_ASYMLUT
    93     , TEnc3DAsymLUT * pc3DAsymLUT
     92  Void  codePPS                ( const TComPPS* pcPPS, TEnc3DAsymLUT * pc3DAsymLUT     );
     93#else
     94  Void  codePPS                ( const TComPPS* pcPPS     );
    9495#endif
    95     );
    9696  Void  codeSliceHeader        ( TComSlice* pcSlice );
    9797  Void  codeTilesWPPEntryPoint ( TComSlice* pSlice );
     
    103103  Void  codeSaoUflc          ( UInt uiLength, UInt  uiCode );
    104104  Void  codeSAOSign          ( UInt  uiCode);  //<! code SAO offset sign
    105   Void  codeScalingList      ( TComScalingList* /*scalingList*/     ){ assert (0);  return;};
    106105
    107106#if SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSearch.cpp

    r1234 r1235  
    39453945#if SVC_EXTENSION
    39463946  // Check WP for B-slices
    3947   if ( pcCU->getSlice()->getPPS()->getUseWP())
     3947  if( pcCU->getSlice()->testWeightPred() )
    39483948#else
    3949   if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )
     3949  if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE )
    39503950#endif
    39513951  {
     
    39593959#if SVC_EXTENSION
    39603960  // Check WP for B-slices
    3961   if( pcCU->getSlice()->getPPS()->getUseWP())
     3961  if ( pcCU->getSlice()->testWeightPred() )
    39623962#else
    3963   if ( pcCU->getSlice()->getPPS()->getUseWP() && pcCU->getSlice()->getSliceType()==P_SLICE )
     3963  if ( pcCU->getSlice()->testWeightPred() && pcCU->getSlice()->getSliceType()==P_SLICE )
    39643964#endif
    39653965  {
     
    55845584  assert( pcCU->getDepth( 0 ) == pcCU->getDepth( uiAbsPartIdx ) );
    55855585  const UInt uiTrMode = pcCU->getTransformIdx( uiAbsPartIdx );
    5586   TComSPS *sps=pcCU->getSlice()->getSPS();
     5586  const TComSPS *sps=pcCU->getSlice()->getSPS();
    55875587
    55885588  if( uiCurrTrMode == uiTrMode )
     
    59735973
    59745974  TComSlice       *pcSlice  = pcCU->getSlice();
    5975   TComPPS         *pps      = pcCU->getSlice()->getPPS();
    59765975  WPScalingParam  *wp0 , *wp1;
    59775976
    5978   m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pps->getUseWP() ) || ( pcSlice->getSliceType()==B_SLICE && pps->getWPBiPred() ) ;
     5977  m_cDistParam.bApplyWeight = ( pcSlice->getSliceType()==P_SLICE && pcSlice->testWeightPred() ) || ( pcSlice->getSliceType()==B_SLICE && pcSlice->testWeightBiPred() ) ;
    59795978
    59805979  if ( !m_cDistParam.bApplyWeight ) return;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp

    r1203 r1235  
    4848
    4949TEncSlice::TEncSlice()
     50: m_encCABACTableIdx(I_SLICE)
    5051{
    5152  m_apcPicYuvPred = NULL;
     
    220221#if SVC_EXTENSION
    221222//\param vps          VPS associated with the slice
    222 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField )
    223 #else
    224 Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, Bool isField )
     223Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, Bool isField )
     224#else
     225Void TEncSlice::initEncSlice( TComPic* pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, const TComSPS* pSPS, const TComPPS *pPPS, Bool isField )
    225226#endif
    226227{
     
    229230
    230231  rpcSlice = pcPic->getSlice(0);
    231   rpcSlice->setSPS( pSPS );
    232   rpcSlice->setPPS( pPPS );
    233232  rpcSlice->setSliceBits(0);
    234233  rpcSlice->setPic( pcPic );
    235234#if SVC_EXTENSION
     235  const TComPPS* pPPS = &pcPic->getPicSym()->getPPS();
     236
    236237  UInt layerId = pcPic->getLayerId();
    237   rpcSlice->setVPS( vps );
    238238  rpcSlice->initSlice( layerId );
    239239#else
     
    501501  else if (rpcSlice->getPPS()->getDeblockingFilterControlPresentFlag())
    502502  {
    503     rpcSlice->getPPS()->setDeblockingFilterOverrideEnabledFlag( !m_pcCfg->getLoopFilterOffsetInPPS() );
    504     rpcSlice->setDeblockingFilterOverrideFlag( !m_pcCfg->getLoopFilterOffsetInPPS() );
    505     rpcSlice->getPPS()->setPicDisableDeblockingFilterFlag( m_pcCfg->getLoopFilterDisable() );
    506     rpcSlice->setDeblockingFilterDisable( m_pcCfg->getLoopFilterDisable() );
     503    rpcSlice->setDeblockingFilterOverrideFlag( rpcSlice->getPPS()->getDeblockingFilterOverrideEnabledFlag() );
     504    rpcSlice->setDeblockingFilterDisable( rpcSlice->getPPS()->getPicDisableDeblockingFilterFlag() );
    507505    if ( !rpcSlice->getDeblockingFilterDisable())
    508506    {
    509       if ( !m_pcCfg->getLoopFilterOffsetInPPS() && eSliceType!=I_SLICE)
    510       {
    511         rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset() );
    512         rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() );
     507      if ( rpcSlice->getDeblockingFilterOverrideFlag() && eSliceType!=I_SLICE)
     508      {
    513509        rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_betaOffsetDiv2 + m_pcCfg->getLoopFilterBetaOffset()  );
    514510        rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getGOPEntry(iGOPid).m_tcOffsetDiv2 + m_pcCfg->getLoopFilterTcOffset() );
     
    516512      else
    517513      {
    518         rpcSlice->getPPS()->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getLoopFilterBetaOffset() );
    519         rpcSlice->getPPS()->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getLoopFilterTcOffset() );
    520514        rpcSlice->setDeblockingFilterBetaOffsetDiv2( m_pcCfg->getLoopFilterBetaOffset() );
    521515        rpcSlice->setDeblockingFilterTcOffsetDiv2( m_pcCfg->getLoopFilterTcOffset() );
     
    558552#endif
    559553
    560   xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
    561 
    562554#if SVC_EXTENSION
    563555  if( layerId > 0 )
     
    792784
    793785    xEstimateWPParamSlice( pcSlice );
    794     pcSlice->initWpScaling();
     786    pcSlice->initWpScaling(pcSlice->getSPS());
    795787
    796788    // check WP on/off
     
    10101002    m_lastSliceSegmentEndContextState.loadContexts( m_pppcRDSbacCoder[0][CI_CURR_BEST] );//ctx end of dep.slice
    10111003  }
    1012   xRestoreWPparam( pcSlice );
    10131004
    10141005  // stop use of temporary bit counter object.
    10151006  m_pppcRDSbacCoder[0][CI_CURR_BEST]->setBitstream(NULL);
    10161007  m_pcRDGoOnSbacCoder->setBitstream(NULL); // stop use of tempBitCounter.
     1008
     1009  // TODO: optimise cabac_init during compress slice to improve multi-slice operation
     1010  //if (pcSlice->getPPS()->getCabacInitPresentFlag() && !pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag())
     1011  //{
     1012  //  m_encCABACTableIdx = m_pcEntropyCoder->determineCabacInitIdx();
     1013  //}
     1014  //else
     1015  //{
     1016  //  m_encCABACTableIdx = pcSlice->getSliceType();
     1017  //}
    10171018}
    10181019
     
    11981199#endif
    11991200
    1200   if (pcSlice->getPPS()->getCabacInitPresentFlag())
    1201   {
    1202     if (pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag())
    1203     {
    1204       pcSlice->getPPS()->setEncCABACTableIdx( pcSlice->getSliceType() );
    1205     }
    1206     else
    1207     {
    1208       m_pcEntropyCoder->determineCabacInitIdx();
    1209     }
    1210   }
     1201  if (pcSlice->getPPS()->getCabacInitPresentFlag() && !pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag())
     1202  {
     1203    m_encCABACTableIdx = m_pcEntropyCoder->determineCabacInitIdx();
     1204  }
     1205  else
     1206  {
     1207    m_encCABACTableIdx = pcSlice->getSliceType();
     1208  }
     1209 
    12111210  numBinsCoded = m_pcBinCABAC->getBinsCoded();
    12121211}
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.h

    r1201 r1235  
    9898  TEncSbac                m_lastSliceSegmentEndContextState;    ///< context storage for state at the end of the previous slice-segment (used for dependent slices only).
    9999  TEncSbac                m_entropyCodingSyncContextState;      ///< context storate for state of contexts at the wavefront/WPP/entropy-coding-sync second CTU of tile-row
     100  SliceType               m_encCABACTableIdx;
    100101
    101102#if SVC_EXTENSION && JCTVC_M0259_LAMBDAREFINEMENT
     
    120121  /// preparation of slice encoding (reference marking, QP and lambda)
    121122#if SVC_EXTENSION
    122   Void    initEncSlice        ( TComPic*  pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
    123                                 Int iGOPid,   TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, TComVPS *vps, Bool isField );
     123  Void    initEncSlice        ( TComPic*  pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd, Int iGOPid, TComSlice*& rpcSlice, Bool isField );
    124124  Void    estimateILWpParam   ( TComSlice* pcSlice );
    125125#else
    126126  Void    initEncSlice        ( TComPic*  pcPic, Int pocLast, Int pocCurr, Int iNumPicRcvd,
    127                                 Int iGOPid,   TComSlice*& rpcSlice, TComSPS* pSPS, TComPPS *pPPS, Bool isField );
     127                                Int iGOPid,   TComSlice*& rpcSlice, const TComSPS* pSPS, const TComPPS *pPPS, Bool isField );
    128128#endif
    129129
     
    143143  Void    setSliceIdx(UInt i)   { m_uiSliceIdx = i;                       }
    144144
     145  SliceType getEncCABACTableIdx() const           { return m_encCABACTableIdx;        }
     146
    145147private:
    146148  Double  xGetQPValueAccordingToLambda ( Double lambda );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp

    r1226 r1235  
    185185  m_cSliceEncoder.      destroy();
    186186  m_cCuEncoder.         destroy();
    187   if (m_cSPS.getUseSAO())
    188   {
    189     m_cEncSAO.destroyEncData();
    190     m_cEncSAO.destroy();
    191   }
     187  m_cEncSAO.            destroyEncData();
     188  m_cEncSAO.            destroy();
    192189  m_cLoopFilter.        destroy();
    193190  m_cRateCtrl.          destroy();
     
    232229  // initialize SPS
    233230  xInitSPS();
    234 
    235   // set the VPS profile information
    236 #if SVC_EXTENSION
    237   m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( true );
    238 #else
    239   *m_cVPS.getPTL() = *m_cSPS.getPTL();
    240   m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( false );
    241 #endif
     231  xInitVPS();
     232
    242233  m_cRdCost.setCostMode(m_costMode);
    243234
    244235  // initialize PPS
    245   m_cPPS.setSPS(&m_cSPS);
    246236  xInitPPS();
    247237  xInitRPS(isFieldCoding);
     
    271261
    272262  m_iMaxRefPicNum = 0;
     263
     264  xInitScalingLists();
     265
    273266#if SVC_EXTENSION
    274267  m_iSPSIdCnt ++;
     
    276269  xInitILRP();
    277270#endif
     271}
     272
     273Void TEncTop::xInitScalingLists()
     274{
     275  // Initialise scaling lists
     276  // The encoder will only use the SPS scaling lists. The PPS will never be marked present.
     277
     278  if(getUseScalingListId() == SCALING_LIST_OFF)
     279  {
     280#if SVC_EXTENSION
     281    getTrQuant()->setFlatScalingList(m_cVPS.getChromaFormatIdc(&m_cSPS, m_layerId));
     282#else
     283    getTrQuant()->setFlatScalingList(m_cSPS.getChromaFormatIdc());
     284#endif
     285    getTrQuant()->setUseScalingList(false);
     286    m_cSPS.setScalingListPresentFlag(false);
     287    m_cPPS.setScalingListPresentFlag(false);
     288  }
     289  else if(getUseScalingListId() == SCALING_LIST_DEFAULT)
     290  {
     291#if SVC_EXTENSION
     292    // inferring of the scaling list can be moved to the config file
     293    UInt refLayerId = 0;
     294    if( m_layerId > 0 && !m_cVPS.getNonHEVCBaseLayerFlag() && m_cVPS.getRecursiveRefLayerFlag( m_layerId, refLayerId ) )
     295    {
     296      m_cSPS.setInferScalingListFlag( true );
     297      m_cSPS.setScalingListRefLayerId( refLayerId );
     298      m_cSPS.setScalingListPresentFlag( false );
     299      m_cPPS.setInferScalingListFlag( false );
     300      m_cPPS.setScalingListPresentFlag( false );
     301
     302      // infer the scaling list from the reference layer
     303      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() );
     304    }
     305    else
     306    {
     307#endif
     308    m_cSPS.getScalingList().setDefaultScalingList ();
     309    m_cSPS.setScalingListPresentFlag(false);
     310    m_cPPS.setScalingListPresentFlag(false);
     311    getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc());
     312#if SVC_EXTENSION
     313    }
     314#endif
     315    getTrQuant()->setUseScalingList(true);
     316  }
     317  else if(getUseScalingListId() == SCALING_LIST_FILE_READ)
     318  {
     319#if SVC_EXTENSION
     320    // inferring of the scaling list can be moved to the config file
     321    UInt refLayerId = 0;
     322    if( m_layerId > 0 && !m_cVPS.getNonHEVCBaseLayerFlag() && m_cVPS.getRecursiveRefLayerFlag( m_layerId, refLayerId ) )
     323    {
     324      m_cSPS.setInferScalingListFlag( true );
     325      m_cSPS.setScalingListRefLayerId( refLayerId );
     326      m_cSPS.setScalingListPresentFlag( false );
     327      m_cPPS.setInferScalingListFlag( false );
     328      m_cPPS.setScalingListPresentFlag( false );
     329
     330      // infer the scaling list from the reference layer
     331      getTrQuant()->setScalingList( &m_ppcTEncTop[m_cVPS.getLayerIdxInVps(refLayerId)]->getSPS()->getScalingList(), m_cSPS.getChromaFormatIdc() );
     332    }
     333    else
     334    {
     335#endif
     336    m_cSPS.getScalingList().setDefaultScalingList ();
     337    if(m_cSPS.getScalingList().xParseScalingList(getScalingListFile()))
     338    {
     339      Bool bParsedScalingList=false; // Use of boolean so that assertion outputs useful string
     340      assert(bParsedScalingList);
     341      exit(1);
     342    }
     343    m_cSPS.getScalingList().checkDcOfMatrix();
     344    m_cSPS.setScalingListPresentFlag(m_cSPS.getScalingList().checkDefaultScalingList());
     345    m_cPPS.setScalingListPresentFlag(false);
     346    getTrQuant()->setScalingList(&(m_cSPS.getScalingList()), m_cSPS.getChromaFormatIdc());
     347#if SVC_EXTENSION
     348    }
     349#endif
     350    getTrQuant()->setUseScalingList(true);
     351  }
     352  else
     353  {
     354    printf("error : ScalingList == %d not supported\n",getUseScalingListId());
     355    assert(0);
     356  }
     357
     358  // Prepare delta's:
     359  for(UInt sizeId = 0; sizeId < SCALING_LIST_SIZE_NUM; sizeId++)
     360  {
     361    const Int predListStep = (sizeId == SCALING_LIST_32x32? (SCALING_LIST_NUM/NUMBER_OF_PREDICTION_MODES) : 1); // if 32x32, skip over chroma entries.
     362
     363    for(UInt listId = 0; listId < SCALING_LIST_NUM; listId+=predListStep)
     364    {
     365      m_cSPS.getScalingList().checkPredMode( sizeId, listId );
     366    }
     367  }
     368
    278369}
    279370
     
    585676Void TEncTop::xGetNewPicBuffer ( TComPic*& rpcPic )
    586677{
     678  // At this point, the SPS and PPS can be considered activated - they are copied to the new TComPic.
     679
    587680  TComSlice::sortPicList(m_cListPic);
    588681
     
    611704        for( UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
    612705        {
    613           const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    614           const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     706          const Window scalEL = m_cPPS.getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     707          const Window altRL = m_cPPS.getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    615708          Bool equalOffsets = scalEL.hasEqualOffset(altRL);
    616           Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
     709          Bool zeroPhase = m_cPPS.hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
    617710
    618711          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
     
    643736      }
    644737
    645       pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ,
    646                       m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS);
     738      pcEPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false, m_layerId);
    647739#else  //SVC_EXTENSION
    648       pcEPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics);
     740      pcEPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1, false);
    649741#endif //SVC_EXTENSION
    650742      rpcPic = pcEPic;
     
    659751        for( UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
    660752        {
    661           const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    662           const Window altRL = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     753          const Window scalEL = m_cPPS.getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
     754          const Window altRL = m_cPPS.getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
    663755          Bool equalOffsets = scalEL.hasEqualOffset(altRL);
    664           Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
     756          Bool zeroPhase = m_cPPS.hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
    665757
    666758          TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i );
     
    688780      }
    689781
    690       rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, &m_cSPS);
     782      rpcPic->create( m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false, m_layerId );
    691783#else  //SVC_EXTENSION
    692       rpcPic->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_conformanceWindow, m_defaultDisplayWindow, m_numReorderPics, false );
     784      rpcPic->create( m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, false );
    693785#endif //SVC_EXTENSION
    694786    }
     
    705797  rpcPic->getPicYuvRec()->setBorderExtension(false);
    706798}
     799
     800Void TEncTop::xInitVPS()
     801{
     802  // The SPS must have already been set up.
     803  // set the VPS profile information.
     804#if SVC_EXTENSION
     805  m_cVPS.setVpsVuiPresentFlag( true );
     806#else
     807  *m_cVPS.getPTL() = *m_cSPS.getPTL();
     808  m_cVPS.setMaxOpSets(1);
     809#endif
     810  m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( false );
     811  m_cVPS.setNumHrdParameters( 0 );
     812
     813  m_cVPS.createHrdParamBuffer();
     814  for( UInt i = 0; i < m_cVPS.getNumHrdParameters(); i ++ )
     815  {
     816    m_cVPS.setHrdOpSetIdx( 0, i );
     817    m_cVPS.setCprmsPresentFlag( false, i );
     818    // Set up HrdParameters here.
     819  }
     820}
     821
    707822
    708823Void TEncTop::xInitSPS()
     
    781896  m_cSPS.setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra    );
    782897
     898  m_cSPS.setTMVPFlagsPresent((getTMVPModeId() == 2 || getTMVPModeId() == 1));
     899
    783900  m_cSPS.setTMVPFlagsPresent(false);
    784901
    785902  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );
    786 
    787   Int i;
    788 
    789   for (i = 0; i < g_uiMaxCUDepth-g_uiAddCUDepth; i++ )
    790   {
    791     m_cSPS.setAMPAcc( i, m_useAMP );
    792     //m_cSPS.setAMPAcc( i, 1 );
    793   }
    794 
     903 
    795904  m_cSPS.setUseAMP ( m_useAMP );
    796 
    797   for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ )
    798   {
    799     m_cSPS.setAMPAcc(i, 0);
    800   }
    801 
    802905
    803906  for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     
    830933  m_cSPS.setTemporalIdNestingFlag( ( m_maxTempLayer == 1 ) ? true : false );
    831934
    832   for ( i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ )
     935  for ( Int i = 0; i < min(m_cSPS.getMaxTLayers(),(UInt) MAX_TLAYER); i++ )
    833936  {
    834937#if SVC_EXTENSION
     
    841944  m_cSPS.setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag );
    842945  m_cSPS.setDisableIntraReferenceSmoothing( m_disableIntraReferenceSmoothing );
    843   m_cSPS.setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 );
     946  m_cSPS.setScalingListFlag ( (m_useScalingListId == SCALING_LIST_OFF) ? 0 : 1 );
    844947  m_cSPS.setUseStrongIntraSmoothing( m_useStrongIntraSmoothing );
    845948  m_cSPS.setVuiParametersPresentFlag(getVuiParametersPresentFlag());
     
    880983    pcVUI->setLog2MaxMvLengthVertical(getLog2MaxMvLengthVertical());
    881984  }
     985  m_cSPS.setNumLongTermRefPicSPS(NUM_LONG_TERM_REF_PIC_SPS);
     986  assert (NUM_LONG_TERM_REF_PIC_SPS <= MAX_NUM_LONG_TERM_REF_PICS);
     987  for (Int k = 0; k < NUM_LONG_TERM_REF_PIC_SPS; k++)
     988  {
     989    m_cSPS.setLtRefPicPocLsbSps(k, 0);
     990    m_cSPS.setUsedByCurrPicLtSPSFlag(k, 0);
     991  }
     992  if( getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() )
     993  {
     994#if SVC_EXTENSION
     995    const UInt picWidth = m_cVPS.getPicWidthInLumaSamples(&m_cSPS, m_layerId);
     996    const UInt picHeight= m_cVPS.getPicWidthInLumaSamples(&m_cSPS, m_layerId);
     997#else
     998    const UInt picWidth = m_cSPS.getPicWidthInLumaSamples();
     999    const UInt picHeight= m_cSPS.getPicWidthInLumaSamples();
     1000#endif
     1001
     1002    const UInt frameWidthInCtus   = ( picWidth + g_uiMaxCUWidth -1 ) / g_uiMaxCUWidth;
     1003    const UInt frameHeightInCtus  = ( picHeight + g_uiMaxCUHeight - 1 ) / g_uiMaxCUHeight;
     1004    const UInt numCtusInFrame = frameWidthInCtus * frameHeightInCtus;
     1005
     1006    UInt maxCU = getSliceArgument();
     1007    UInt numDU = ( getSliceMode() == FIXED_NUMBER_OF_CTU ) ? ( numCtusInFrame / maxCU ) : ( 0 );
     1008    if( numCtusInFrame % maxCU != 0 || numDU == 0 )
     1009    {
     1010      numDU ++;
     1011    }
     1012    m_cSPS.getVuiParameters()->getHrdParameters()->setNumDU( numDU );
     1013    m_cSPS.setHrdParameters( getFrameRate(), numDU, getTargetBitrate(), ( getIntraPeriod() > 0 ) );
     1014  }
     1015  if( getBufferingPeriodSEIEnabled() || getPictureTimingSEIEnabled() || getDecodingUnitInfoSEIEnabled() )
     1016  {
     1017    m_cSPS.getVuiParameters()->setHrdParametersPresentFlag( true );
     1018  }
     1019
    8821020}
    8831021
     
    8921030  }
    8931031
    894   if (m_costMode==COST_SEQUENCE_LEVEL_LOSSLESS || m_costMode==COST_LOSSLESS_CODING) bUseDQP=false;
    895 
    896   if(bUseDQP)
     1032  if (m_costMode==COST_SEQUENCE_LEVEL_LOSSLESS || m_costMode==COST_LOSSLESS_CODING)
     1033  {
     1034    bUseDQP=false;
     1035  }
     1036
     1037
     1038  if ( m_RCEnableRateControl )
     1039  {
     1040    m_cPPS.setUseDQP(true);
     1041    m_cPPS.setMaxCuDQPDepth( 0 );
     1042  }
     1043  else if(bUseDQP)
    8971044  {
    8981045    m_cPPS.setUseDQP(true);
    8991046    m_cPPS.setMaxCuDQPDepth( m_iMaxCuDQPDepth );
    900     m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
    9011047  }
    9021048  else
     
    9041050    m_cPPS.setUseDQP(false);
    9051051    m_cPPS.setMaxCuDQPDepth( 0 );
    906     m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
    9071052  }
    9081053
     
    9191064  }
    9201065
    921   if ( m_RCEnableRateControl )
    922   {
    923     m_cPPS.setUseDQP(true);
    924     m_cPPS.setMaxCuDQPDepth( 0 );
    925     m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) );
    926   }
    927 
    928   m_cPPS.setMinCuChromaQpAdjSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuChromaQpAdjDepth()) );
    929 
    9301066  m_cPPS.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset );
    9311067  m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset );
    9321068
    933   m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams);
    9341069  m_cPPS.setEntropyCodingSyncEnabledFlag( m_iWaveFrontSynchro > 0 );
    9351070  m_cPPS.setTilesEnabledFlag( (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0) );
     
    9521087  {
    9531088    m_cPPS.setDeblockingFilterControlPresentFlag (m_DeblockingFilterControlPresent );
     1089
     1090    if (m_cPPS.getDeblockingFilterControlPresentFlag())
     1091    {
     1092      m_cPPS.setDeblockingFilterOverrideEnabledFlag( !getLoopFilterOffsetInPPS() );
     1093      m_cPPS.setPicDisableDeblockingFilterFlag( getLoopFilterDisable() );
     1094    }
     1095  }
     1096
     1097  if (m_cPPS.getDeblockingFilterControlPresentFlag() && ! m_cPPS.getPicDisableDeblockingFilterFlag())
     1098  {
     1099    m_cPPS.setDeblockingFilterBetaOffsetDiv2( getLoopFilterBetaOffset() );
     1100    m_cPPS.setDeblockingFilterTcOffsetDiv2( getLoopFilterTcOffset() );
    9541101  }
    9551102  m_cPPS.setLog2ParallelMergeLevelMinus2   (m_log2ParallelMergeLevelMinus2 );
     
    10761223    rps->setInterRPSPrediction(ge.m_interRPSPrediction > 0);  // not very clean, converting anything > 0 to true.
    10771224    rps->setDeltaRIdxMinus1(0);                               // index to the Reference RPS is always the previous one.
    1078     TComReferencePictureSet*     RPSRef = rpsList->getReferencePictureSet(i-1);  // get the reference RPS
     1225    TComReferencePictureSet*     RPSRef = i>0 ? rpsList->getReferencePictureSet(i-1): NULL;  // get the reference RPS
    10791226
    10801227    if (ge.m_interRPSPrediction == 2)  // Automatic generation of the inter RPS idc based on the RIdx provided.
    10811228    {
     1229      assert (RPSRef!=NULL);
    10821230      Int deltaRPS = getGOPEntry(i-1).m_POC - ge.m_POC;  // the ref POC - current POC
    10831231      Int numRefDeltaPOC = RPSRef->getNumberOfPictures();
     
    11081256    else if (ge.m_interRPSPrediction == 1)  // inter RPS idc based on the RefIdc values provided in config file.
    11091257    {
     1258      assert (RPSRef!=NULL);
    11101259      rps->setDeltaRPS(ge.m_deltaRPS);
    11111260      rps->setNumRefIdc(ge.m_numRefIdc);
     
    12661415  }
    12671416
    1268   slice->setRPS(getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx()));
     1417  TComReferencePictureSet *rps=slice->getLocalRPS();
     1418  (*rps) = *(slice->getSPS()->getRPSList()->getReferencePictureSet(slice->getRPSidx()));
     1419  slice->setRPS(rps);
    12691420  slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures());
    12701421}
     
    13131464
    13141465  // # substreams is "per tile" when tiles are independent.
    1315   if (m_iWaveFrontSynchro )
    1316   {
    1317     m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));
    1318   }
    1319   else
    1320   {
    1321     m_cPPS.setNumSubstreams((m_iNumRowsMinus1+1) * (m_iNumColumnsMinus1+1));
    1322   }
    13231466}
    13241467
     
    14041547  picHeight   = repFormat->getPicHeightVpsInLumaSamples();
    14051548 
    1406   if(m_layerId > 0)
     1549  if( m_layerId > 0 )
    14071550  {
    14081551    g_bitDepth[CHANNEL_TYPE_LUMA]   = bitDepthY;
     
    14131556    g_uiAddCUDepth  = max (0, m_cSPS.getLog2MinCodingBlockSize() - (Int)m_cSPS.getQuadtreeTULog2MinSize() );
    14141557
    1415     Int  numReorderPics[MAX_TLAYER];
    1416     Window &conformanceWindow = repFormat->getConformanceWindowVps();
    1417     Window defaultDisplayWindow = m_cSPS.getVuiParametersPresentFlag() ? m_cSPS.getVuiParameters()->getDefaultDisplayWindow() : Window();
    1418 
    14191558    if (m_cIlpPic[0] == NULL)
    14201559    {
     
    14221561      {
    14231562        m_cIlpPic[j] = new TComPic;
    1424 #if AUXILIARY_PICTURES
    1425         m_cIlpPic[j]->create(picWidth, picHeight, m_chromaFormatIDC, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
    1426 #else
    1427         m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, &m_cSPS, true);
    1428 #endif
     1563        m_cIlpPic[j]->create(m_cVPS, m_cSPS, m_cPPS, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId);
    14291564        for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++)
    14301565        {
     
    14621597}
    14631598
    1464 Window& TEncTop::getScaledRefLayerWindowForLayer(Int layerId)
    1465 {
    1466   static Window win;
    1467 
     1599Window TEncTop::getScaledRefLayerWindowForLayer(Int layerId)
     1600{
    14681601  for (Int i = 0; i < m_numRefLayerLocationOffsets; i++)
    14691602  {
     
    14741607  }
    14751608
    1476   win.resetWindow();  // scaled reference layer offsets are inferred to be zero when not present
    1477   return win;
    1478 }
    1479 
    1480 Window& TEncTop::getRefLayerWindowForLayer(Int layerId)
    1481 {
    1482   static Window win;
    1483 
     1609  return Window();
     1610}
     1611
     1612Window TEncTop::getRefLayerWindowForLayer(Int layerId)
     1613{
    14841614  for (Int i = 0; i < m_numRefLayerLocationOffsets; i++)
    14851615  {
     
    14901620  }
    14911621
    1492   win.resetWindow();  // reference offsets are inferred to be zero when not present
    1493   return win;
     1622  return Window();
    14941623}
    14951624#endif //SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h

    r1226 r1235  
    9393  TEncCu                  m_cCuEncoder;                   ///< CU encoder
    9494  // SPS
    95   TComSPS                 m_cSPS;                         ///< SPS
    96   TComPPS                 m_cPPS;                         ///< PPS
     95  TComSPS                 m_cSPS;                         ///< SPS. This is the base value. This is copied to TComPicSym
     96  TComPPS                 m_cPPS;                         ///< PPS. This is the base value. This is copied to TComPicSym
    9797  // RD cost computation
    9898  TComRdCost              m_cRdCost;                      ///< RD cost computation class
     
    110110  TEncPreanalyzer         m_cPreanalyzer;                 ///< image characteristics analyzer for TM5-step3-like adaptive QP
    111111
    112   TComScalingList         m_scalingList;                 ///< quantization matrix information
    113112  TEncRateCtrl            m_cRateCtrl;                    ///< Rate control class
    114113 
     
    148147protected:
    149148  Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
     149  Void  xInitVPS          ();                             ///< initialize VPS from encoder options
    150150  Void  xInitSPS          ();                             ///< initialize SPS from encoder options
    151151  Void  xInitPPS          ();                             ///< initialize PPS from encoder options
     152  Void  xInitScalingLists();                              ///< initialize scaling lists
    152153
    153154  Void  xInitPPSforTiles  ();
     
    187188  TEncSbac*               getRDGoOnSbacCoder    () { return  &m_cRDGoOnSbacCoder;     }
    188189  TEncRateCtrl*           getRateCtrl           () { return &m_cRateCtrl;             }
    189   TComSPS*                getSPS                () { return  &m_cSPS;                 }
    190   TComPPS*                getPPS                () { return  &m_cPPS;                 }
    191190  Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid );
    192191  Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid );
    193   TComScalingList*        getScalingList        () { return  &m_scalingList;         }
    194192  // -------------------------------------------------------------------------------------------------------------------
    195193  // encoder function
     
    198196  /// encode several number of pictures until end-of-sequence
    199197#if SVC_EXTENSION
     198  TComSPS*  getSPS()                                          { return &m_cSPS;                    }
     199#if CGS_3D_ASYMLUT
     200  TComPPS*  getPPS()                                          { return &m_cPPS;                    }
     201#endif
    200202  Void      setLayerEnc(TEncTop** p)                          { m_ppcTEncTop = p;                  }
    201203  TEncTop** getLayerEnc()                                     { return m_ppcTEncTop;               }
     
    203205  Int       getNumPicRcvd()                                   { return m_iNumPicRcvd;              }
    204206  Void      setNumPicRcvd( Int num )                          { m_iNumPicRcvd = num;               }
    205   Void      setNumRefLayerLocationOffsets(Int x)              { m_numRefLayerLocationOffsets = x;    }
    206   UInt      getNumRefLayerLocationOffsets()                   { return m_numRefLayerLocationOffsets; }
     207  Void      setNumRefLayerLocationOffsets(Int x)              { m_numRefLayerLocationOffsets = x;     }
     208  UInt      getNumRefLayerLocationOffsets()                   { return m_numRefLayerLocationOffsets;  }
    207209  Void      setRefLocationOffsetLayerId(Int x, UInt id)       { m_refLocationOffsetLayerId[x] = id;   }
    208210  UInt      getRefLocationOffsetLayerId(Int x)                { return m_refLocationOffsetLayerId[x]; }
    209   Window&   getScaledRefLayerWindowForLayer(Int layerId);
     211  Window    getScaledRefLayerWindowForLayer(Int layerId);
    210212  Window&   getScaledRefLayerWindow(Int x)                    { return m_scaledRefLayerWindow[x];  }
    211213  Void      setNumRefLayerOffsets(Int x)                      { m_numRefLayerOffsets = x;          }
     
    213215  Void      setRefLayerId(Int layerIdx, UInt layerId)         { m_refLayerId[layerIdx] = layerId;  }
    214216  UInt      getRefLayerId(Int layerIdx)                       { return m_refLayerId[layerIdx];     }
    215   Window&   getRefLayerWindowForLayer(Int layerId);
    216   Window&   getRefLayerWindow(Int x)                          { return m_refLayerWindow[x]; }
     217  Window    getRefLayerWindowForLayer(Int layerId);
     218  Window&   getRefLayerWindow(Int x)                          { return m_refLayerWindow[x];                  }
    217219  Bool      getScaledRefLayerOffsetPresentFlag(Int x)         { return m_scaledRefLayerOffsetPresentFlag[x]; }
    218   Void      setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; }
    219   Bool      getRefRegionOffsetPresentFlag(Int x)              { return m_refRegionOffsetPresentFlag[x]; }
    220   Void      setRefRegionOffsetPresentFlag(Int x, Bool b)      { m_refRegionOffsetPresentFlag[x] = b; }
    221   Int       getPhaseHorLuma(Int x)                            { return m_phaseHorLuma[x]; }
    222   Int       getPhaseVerLuma(Int x)                            { return m_phaseVerLuma[x]; }
    223   Int       getPhaseHorChroma(Int x)                          { return m_phaseHorChroma[x]; }
    224   Int       getPhaseVerChroma(Int x)                          { return m_phaseVerChroma[x]; }
    225   Void      setPhaseHorLuma(Int x, Int val)                   { m_phaseHorLuma[x] = val; }
    226   Void      setPhaseVerLuma(Int x, Int val)                   { m_phaseVerLuma[x] = val; }
    227   Void      setPhaseHorChroma(Int x, Int val)                 { m_phaseHorChroma[x] = val; }
    228   Void      setPhaseVerChroma(Int x, Int val)                 { m_phaseVerChroma[x] = val; }
     220  Void      setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b;    }
     221  Bool      getRefRegionOffsetPresentFlag(Int x)              { return m_refRegionOffsetPresentFlag[x];      }
     222  Void      setRefRegionOffsetPresentFlag(Int x, Bool b)      { m_refRegionOffsetPresentFlag[x] = b;         }
     223  Int       getPhaseHorLuma(Int x)                            { return m_phaseHorLuma[x];           }
     224  Int       getPhaseVerLuma(Int x)                            { return m_phaseVerLuma[x];           }
     225  Int       getPhaseHorChroma(Int x)                          { return m_phaseHorChroma[x];         }
     226  Int       getPhaseVerChroma(Int x)                          { return m_phaseVerChroma[x];         }
     227  Void      setPhaseHorLuma(Int x, Int val)                   { m_phaseHorLuma[x] = val;            }
     228  Void      setPhaseVerLuma(Int x, Int val)                   { m_phaseVerLuma[x] = val;            }
     229  Void      setPhaseHorChroma(Int x, Int val)                 { m_phaseHorChroma[x] = val;          }
     230  Void      setPhaseVerChroma(Int x, Int val)                 { m_phaseVerChroma[x] = val;          }
    229231  Bool      getResamplePhaseSetPresentFlag(Int x)             { return m_resamplePhaseSetPresentFlag[x]; }
    230   Void      setResamplePhaseSetPresentFlag(Int x, Bool b)     { m_resamplePhaseSetPresentFlag[x] = b; }
    231 
    232   TComPic** getIlpList()                                      { return m_cIlpPic; }
    233   Void      setMFMEnabledFlag(Bool flag)                      { m_bMFMEnabledFlag = flag; }
    234   Bool      getMFMEnabledFlag()                               { return m_bMFMEnabledFlag; }   
     232  Void      setResamplePhaseSetPresentFlag(Int x, Bool b)     { m_resamplePhaseSetPresentFlag[x] = b;    }
     233
     234  TComPic** getIlpList()                                      { return m_cIlpPic;                    }
     235  Void      setMFMEnabledFlag(Bool flag)                      { m_bMFMEnabledFlag = flag;            }
     236  Bool      getMFMEnabledFlag()                               { return m_bMFMEnabledFlag;            }   
    235237  Void      setInterLayerWeightedPredFlag(Bool flag)          { m_interLayerWeightedPredFlag = flag; }
    236238  Bool      getInterLayerWeightedPredFlag()                   { return m_interLayerWeightedPredFlag; }
  • branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.cpp

    r1202 r1235  
    4747WeightPredAnalysis::WeightPredAnalysis()
    4848{
    49   m_weighted_pred_flag = false;
    50   m_weighted_bipred_flag = false;
    51 
    5249  for ( UInt lst =0 ; lst<NUM_REF_PIC_LIST_01 ; lst++ )
    5350  {
     
    121118}
    122119
    123 
    124 /** store weighted_pred_flag and weighted_bipred_idc values
    125  * \param weighted_pred_flag
    126  * \param weighted_bipred_idc
    127  * \returns Void
    128  */
    129 Void  WeightPredAnalysis::xStoreWPparam(const Bool weighted_pred_flag, const Bool weighted_bipred_flag)
    130 {
    131   m_weighted_pred_flag   = weighted_pred_flag;
    132   m_weighted_bipred_flag = weighted_bipred_flag;
    133 }
    134 
    135 
    136 /** restore weighted_pred_flag and weighted_bipred_idc values
    137  * \param TComSlice *slice
    138  * \returns Void
    139  */
    140 Void  WeightPredAnalysis::xRestoreWPparam(TComSlice *const slice)
    141 {
    142   slice->getPPS()->setUseWP   (m_weighted_pred_flag);
    143   slice->getPPS()->setWPBiPred(m_weighted_bipred_flag);
    144 }
    145 
    146 
    147120/** check weighted pred or non-weighted pred
    148121 * \param TComSlice *slice
     
    168141  if(iPresentCnt==0)
    169142  {
    170     slice->getPPS()->setUseWP(false);
    171     slice->getPPS()->setWPBiPred(false);
     143    slice->setTestWeightPred(false);
     144    slice->setTestWeightBiPred(false);
    172145
    173146    for ( UInt lst=0 ; lst<NUM_REF_PIC_LIST_01 ; lst++ )
     
    188161    slice->setWpScaling( m_wp );
    189162  }
     163  else
     164  {
     165    slice->setTestWeightPred(slice->getPPS()->getUseWP());
     166    slice->setTestWeightBiPred(slice->getPPS()->getWPBiPred());
     167  }
    190168}
    191169
     
    213191  } while (validRangeFlag == false);
    214192
    215   // selecting whether WP is used, or not
     193  // selecting whether WP is used, or not (fast search)
     194  // NOTE: This is not operating on a slice, but the entire picture.
    216195  xSelectWP(slice, iDenom);
    217196
  • branches/SHM-dev/source/Lib/TLibEncoder/WeightPredAnalysis.h

    r1029 r1235  
    4646private:
    4747
    48   // member variables
    49   Bool            m_weighted_pred_flag;
    50   Bool            m_weighted_bipred_flag;
     48  // member variables 
    5149  WPScalingParam  m_wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT];
    5250
     
    7573  Void  xCalcACDCParamSlice  (TComSlice *const slice);
    7674  Void  xEstimateWPParamSlice(TComSlice *const slice);
    77   Void  xStoreWPparam        (const Bool weighted_pred_flag, const Bool weighted_bipred_flag);
    78   Void  xRestoreWPparam      (TComSlice *const slice);
    7975  Void  xCheckWPEnable       (TComSlice *const slice);
    8076};
Note: See TracChangeset for help on using the changeset viewer.