Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 893)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 894)
@@ -1734,4 +1734,83 @@
 #endif
 
+#if VPS_VUI_BSP_HRD_PARAMS
+  vps->setVpsVuiBspHrdPresentFlag(false);
+  TEncTop *pcCfg = &m_acTEncTop[0];
+  if( pcCfg->getBufferingPeriodSEIEnabled() )
+  {
+    vps->setVpsVuiBspHrdPresentFlag(true);
+    vps->setVpsNumAddHrdParams( vps->getMaxLayers() );
+    vps->createBspHrdParamBuffer(vps->getVpsNumAddHrdParams() + 1);
+    for(Int i = vps->getNumHrdParameters(), j = 0; i < vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams(); i++, j++)
+    {
+      vps->setCprmsAddPresentFlag( j, true );
+      vps->setNumSubLayerHrdMinus1( j, vps->getMaxTLayers() - 1 );
+
+      UInt layerId = j;
+      TEncTop *pcCfgLayer = &m_acTEncTop[layerId];
+
+      Int iPicWidth         = pcCfgLayer->getSourceWidth();
+      Int iPicHeight        = pcCfgLayer->getSourceHeight();
+#if LAYER_CTB
+      UInt uiWidthInCU       = ( iPicWidth  % m_acLayerCfg[layerId].m_uiMaxCUWidth  ) ? iPicWidth  / m_acLayerCfg[layerId].m_uiMaxCUWidth  + 1 : iPicWidth  / m_acLayerCfg[layerId].m_uiMaxCUWidth;
+      UInt uiHeightInCU      = ( iPicHeight % m_acLayerCfg[layerId].m_uiMaxCUHeight ) ? iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight + 1 : iPicHeight / m_acLayerCfg[layerId].m_uiMaxCUHeight;
+      UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId].m_uiMaxCUDepth << 1);
+#else
+      UInt uiWidthInCU       = ( iPicWidth %m_uiMaxCUWidth  ) ? iPicWidth /m_uiMaxCUWidth  + 1 : iPicWidth /m_uiMaxCUWidth;
+      UInt uiHeightInCU      = ( iPicHeight%m_uiMaxCUHeight ) ? iPicHeight/m_uiMaxCUHeight + 1 : iPicHeight/m_uiMaxCUHeight;
+      UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1);
+#endif
+      UInt uiNumCUsInFrame   = uiWidthInCU * uiHeightInCU;
+
+      UInt numDU = ( pcCfgLayer->getSliceMode() == 1 ) ? ( uiNumCUsInFrame / maxCU ) : ( 0 );
+      if( uiNumCUsInFrame % maxCU != 0 || numDU == 0 )
+      {
+        numDU ++;
+      }
+      vps->getBspHrd(i)->setNumDU( numDU );
+      vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) );
+    }
+
+    // Signalling of additional partitioning schemes
+    for(Int h = 1; h < vps->getNumOutputLayerSets(); h++)
+    {
+      Int lsIdx = vps->getOutputLayerSetIdx( h );
+      vps->setNumSignalledPartitioningSchemes(h, 1);  // Only the default per-layer partitioning scheme
+      for(Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h); j++)
+      {
+        // ToDo: Add code for additional partitioning schemes here
+        // ToDo: Initialize num_partitions_in_scheme_minus1 and layer_included_in_partition_flag
+      }
+
+      for(Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h); i++)
+      {
+        if( i == 0 )
+        {
+          for(Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1( lsIdx ); t++)
+          {
+            vps->setNumBspSchedulesMinus1( h, i, t, 0 );
+            for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
+            {
+              for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
+              {
+                // Only for the default partition
+                Int nuhlayerId = vps->getLayerSetLayerIdList( lsIdx, k);
+                Int layerIdxInVps = vps->getLayerIdInVps( nuhlayerId );
+                vps->setBspHrdIdx(h, i, t, j, k, layerIdxInVps + vps->getNumHrdParameters());
+
+                vps->setBspSchedIdx(h, i, t, j, k, 0);
+              }
+            }
+          }
+        }
+        else
+        {
+          assert(0);    // Need to add support for additional partitioning schemes.
+        }
+      }
+    }
+  }
+#else
+
 #if O0164_MULTI_LAYER_HRD
   vps->setVpsVuiBspHrdPresentFlag(false);
@@ -1805,4 +1884,5 @@
     }
   }
+#endif
 #endif
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 894)
@@ -592,4 +592,8 @@
   Bool  m_callerOwnsSEIs;
   SEIMessages m_nestedSEIs;
+#if VPS_VUI_BSP_HRD_PARAMS
+  Int  m_seiPartitioningSchemeIdx;
+  Int  m_seiOlsIdx;
+#endif
 };
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 894)
@@ -3175,4 +3175,5 @@
 }
 #endif
+
 #if RESOLUTION_BASED_DPB
 // RepFormat Assignment operator
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 894)
@@ -370,4 +370,23 @@
   UInt getNumDU                              ( )            { return m_numDU;          }
   Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); }
+
+#if VPS_VUI_BSP_HRD_PARAMS
+Void copyCommonInformation( TComHRD *refHrd )
+{
+  m_nalHrdParametersPresentFlag         = refHrd->getNalHrdParametersPresentFlag();
+  m_vclHrdParametersPresentFlag         = refHrd->getVclHrdParametersPresentFlag();
+  m_subPicCpbParamsPresentFlag          = refHrd->getSubPicCpbParamsPresentFlag();
+  m_tickDivisorMinus2                   = refHrd->getTickDivisorMinus2();
+  m_duCpbRemovalDelayLengthMinus1       = refHrd->getDuCpbRemovalDelayLengthMinus1();
+  m_subPicCpbParamsInPicTimingSEIFlag   = refHrd->getSubPicCpbParamsInPicTimingSEIFlag();
+  m_dpbOutputDelayDuLengthMinus1        = refHrd->getDpbOutputDelayDuLengthMinus1();
+  m_bitRateScale                        = refHrd->getBitRateScale();
+  m_cpbSizeScale                        = refHrd->getCpbSizeScale();
+  m_ducpbSizeScale                      = refHrd->getDuCpbSizeScale();
+  m_initialCpbRemovalDelayLengthMinus1  = refHrd->getInitialCpbRemovalDelayLengthMinus1();
+  m_cpbRemovalDelayLengthMinus1         = refHrd->getCpbRemovalDelayLengthMinus1();
+  m_dpbOutputDelayLengthMinus1          = refHrd->getDpbOutputDelayLengthMinus1();
+}
+#endif
 };
 
@@ -814,4 +833,16 @@
 #if O0164_MULTI_LAYER_HRD
   Bool       m_vpsVuiBspHrdPresentFlag;
+#if VPS_VUI_BSP_HRD_PARAMS
+  Int                 m_vpsNumAddHrdParams;
+  std::vector<Bool>   m_cprmsAddPresentFlag;
+  std::vector<Int>    m_numSubLayerHrdMinus1;
+  std::vector<TComHRD> m_bspHrd;
+  Int    m_numSignalledPartitioningSchemes[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
+  Int    m_numPartitionsInSchemeMinus1    [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16];
+  Int    m_layerIncludedInPartitionFlag   [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_LAYERS][MAX_LAYERS];
+  Int    m_numBspSchedulesMinus1          [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER];
+  Int    m_bspHrdIdx                      [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];
+  Int    m_bspSchedIdx                    [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS];
+#else
   UInt       m_vpsNumBspHrdParametersMinus1;
   Bool       m_bspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1];
@@ -823,4 +854,5 @@
   UInt       m_bspCombSchedIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
 #endif
+#endif
 
 #if P0182_VPS_VUI_PS_FLAG
@@ -867,5 +899,11 @@
   Void    createBspHrdParamBuffer(UInt numHrds)
   {
+#if VPS_VUI_BSP_HRD_PARAMS
+    m_bspHrd.resize( numHrds );
+    m_cprmsAddPresentFlag.resize( numHrds );
+    m_numSubLayerHrdMinus1.resize( numHrds );
+#else
     m_bspHrd    = new TComHRD[ numHrds ];
+#endif
 //    m_hrdOpSetIdx      = new UInt   [ getNumHrdParameters() ];
 //    m_cprmsPresentFlag = new Bool   [ getNumHrdParameters() ];
@@ -875,5 +913,9 @@
   Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl)
   {
+#if VPS_VUI_BSP_HRD_PARAMS
+    return m_bspHrd[i].getCpbCntMinus1(sl);
+#else
     return m_bspHrd->getCpbCntMinus1(sl);
+#endif
   }
 #endif
@@ -1196,4 +1238,34 @@
   Bool     getVpsVuiBspHrdPresentFlag()                         { return m_vpsVuiBspHrdPresentFlag;      }
   Void     setVpsVuiBspHrdPresentFlag(Bool x)                   { m_vpsVuiBspHrdPresentFlag = x;         }
+#if VPS_VUI_BSP_HRD_PARAMS
+  Int      getVpsNumAddHrdParams()                              { return m_vpsNumAddHrdParams; }
+  Void     setVpsNumAddHrdParams(Int  i)                   { m_vpsNumAddHrdParams = i;    }
+
+  Bool     getCprmsAddPresentFlag(Int i)                        { return m_cprmsAddPresentFlag[i];       }
+  Void     setCprmsAddPresentFlag(Int  i, Bool  val)  { m_cprmsAddPresentFlag[i] = val;        }
+
+  Int      getNumSubLayerHrdMinus1(Int i)           { return m_numSubLayerHrdMinus1[i]; }
+  Void     setNumSubLayerHrdMinus1(Int i, Int val)  { m_numSubLayerHrdMinus1[i] = val; }
+
+  TComHRD*  getBspHrd(Int i)           {return &m_bspHrd[i];}
+
+  Int      getNumSignalledPartitioningSchemes(Int  i)                    { return m_numSignalledPartitioningSchemes[i];    }
+  Void     setNumSignalledPartitioningSchemes(Int  i, Int  val)          { m_numSignalledPartitioningSchemes[i] = val;     }
+
+  Int      getNumPartitionsInSchemeMinus1(Int  i, Int j)  { return m_numPartitionsInSchemeMinus1[i][j];}
+  Void     setNumPartitionsInSchemeMinus1(Int i, Int j, Int val) { m_numPartitionsInSchemeMinus1[i][j] = val; }
+
+  Int      getLayerIncludedInPartitionFlag(Int  i, Int j, Int k, Int l)  { return m_layerIncludedInPartitionFlag[i][j][k][l];}
+  Void     setLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l, Int val) { m_layerIncludedInPartitionFlag[i][j][k][l] = val; }
+
+  Int      getNumBspSchedulesMinus1(Int  i, Int j, Int k)         { return m_numBspSchedulesMinus1[i][j][k];}
+  Void     setNumBspSchedulesMinus1(Int i, Int j, Int k, Int val) { m_numBspSchedulesMinus1[i][j][k] = val; }
+
+  Int      getBspSchedIdx(Int  i, Int j, Int k, Int l, Int m)  { return m_bspSchedIdx[i][j][k][l][m];}
+  Void     setBspSchedIdx(Int  i, Int j, Int k, Int l, Int m, Int val) { m_bspSchedIdx[i][j][k][l][m] = val; }
+
+  Int      getBspHrdIdx(Int  i, Int j, Int k, Int l, Int m)  { return m_bspHrdIdx[i][j][k][l][m];}
+  Void     setBspHrdIdx(Int  i, Int j, Int k, Int l, Int m, Int val) { m_bspHrdIdx[i][j][k][l][m] = val; }
+#else
   UInt     getVpsNumBspHrdParametersMinus1()                    { return m_vpsNumBspHrdParametersMinus1; }
   Void     setVpsNumBspHrdParametersMinus1(UInt i)              { m_vpsNumBspHrdParametersMinus1 = i;    }
@@ -1211,4 +1283,5 @@
   UInt     getBspCombSchedIdx(UInt h, UInt i, UInt j)           { return m_bspCombSchedIdx[h][i][j];     }
   Void     setBspCombSchedIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombSchedIdx[h][i][j] = val;      }
+#endif
 #endif
 #if P0182_VPS_VUI_PS_FLAG
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 894)
@@ -66,4 +66,5 @@
 #define BSP_INIT_ARRIVAL_SEI             1      ///< JCTVC-R0231: Make signalling of vcl_initial_arrival_delay independent of NalHrdBpPresentFlag
 #define SUB_LAYERS_IN_LAYER_SET          1      ///< Move calculation of MaxSubLayerInLayerSets to a separate function
+#define VPS_VUI_BSP_HRD_PARAMS           1      ///< JCTVC-R0231: Define the VPS VUI BSP hrd_params() as a separate function, and apply changes adopted.
 #define O0137_MAX_LAYERID                1      ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1
 
@@ -493,5 +494,4 @@
 typedef       double              Double;
 typedef       float               Float;
-
 // ====================================================================================================================
 // 64-bit integer type
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 894)
@@ -251,5 +251,9 @@
       {
         sei = new SEIDecodingUnitInfo; 
+#if VPS_VUI_BSP_HRD_PARAMS
+        xParseSEIDecodingUnitInfo((SEIDecodingUnitInfo&) *sei, payloadSize, sps, nestingSei, bspNestingSei, vps);
+#else
         xParseSEIDecodingUnitInfo((SEIDecodingUnitInfo&) *sei, payloadSize, sps);
+#endif
       }
       break; 
@@ -262,5 +266,9 @@
       {
         sei = new SEIBufferingPeriod;
+#if VPS_VUI_BSP_HRD_PARAMS
+        xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps, nestingSei, bspNestingSei, vps);
+#else
         xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps);
+#endif
       }
       break;
@@ -273,5 +281,9 @@
       {
         sei = new SEIPictureTiming;
+#if VPS_VUI_BSP_HRD_PARAMS
+        xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps, nestingSei, bspNestingSei, vps);
+#else
         xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps);
+#endif
       }
       break;
@@ -600,5 +612,9 @@
 }
 
+#if VPS_VUI_BSP_HRD_PARAMS
+Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
+#else
 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt /*payloadSize*/, TComSPS *sps)
+#endif
 {
   UInt val;
@@ -606,8 +622,48 @@
   sei.m_decodingUnitIdx = val;
 
+#if VPS_VUI_BSP_HRD_PARAMS
+  TComHRD *hrd;
+  if( bspNestingSei )   // If DU info SEI contained inside a BSP nesting SEI message
+  {
+    assert( nestingSei );
+    Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx;
+    Int seiOlsIdx = bspNestingSei->m_seiOlsIdx;
+    Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1;
+    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+    std::vector<Int> hrdIdx(maxValues, 0);
+    std::vector<TComHRD *> hrdVec;
+    std::vector<Int> syntaxElemLen(maxValues, 0);
+    for(Int i = 0; i < maxValues; i++)
+    {
+      hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx);
+      hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+      syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+      if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+      {
+        assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+      }
+      if( i > 0 )
+      {
+        assert( hrdVec[i]->getSubPicCpbParamsPresentFlag()    == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() );
+        assert( hrdVec[i]->getSubPicCpbParamsInPicTimingSEIFlag()   == hrdVec[i-1]->getSubPicCpbParamsInPicTimingSEIFlag() );
+        assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() );
+        // To be done: Check CpbDpbDelaysPresentFlag
+      }
+    }
+    hrd = hrdVec[0];
+  }
+  else
+  {
+    TComVUI *vui = sps->getVuiParameters();
+    hrd = vui->getHrdParameters();
+  }
+#else
   TComVUI *vui = sps->getVuiParameters();
-  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
-  {
-    READ_CODE( ( vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay");
+  TComHrd *hrd = vui->getHrdParameters();
+#endif
+  if(hrd->getSubPicCpbParamsInPicTimingSEIFlag())
+  {
+    READ_CODE( ( hrd->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay");
     sei.m_duSptCpbRemovalDelay = val;
   }
@@ -619,5 +675,5 @@
   if(sei.m_dpbOutputDuDelayPresentFlag)
   {
-    READ_CODE(vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay"); 
+    READ_CODE(hrd->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay"); 
     sei.m_picSptDpbOutputDuDelay = val;
   }
@@ -625,11 +681,54 @@
 }
 
+#if VPS_VUI_BSP_HRD_PARAMS
+Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
+#else
 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt /*payloadSize*/, TComSPS *sps)
+#endif
 {
   Int i, nalOrVcl;
   UInt code;
 
+#if VPS_VUI_BSP_HRD_PARAMS
+  TComHRD *pHRD;
+  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
+  {
+    assert( nestingSei );
+    Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx;
+    Int seiOlsIdx = bspNestingSei->m_seiOlsIdx;
+    Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1;
+    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+    std::vector<Int> hrdIdx(maxValues, 0);
+    std::vector<TComHRD *> hrdVec;
+    std::vector<Int> syntaxElemLen(maxValues, 0);
+    for(i = 0; i < maxValues; i++)
+    {
+      hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx);
+      hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+      syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+      if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+      {
+        assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+      }
+      if( i > 0 )
+      {
+        assert( hrdVec[i]->getCpbRemovalDelayLengthMinus1()   == hrdVec[i-1]->getCpbRemovalDelayLengthMinus1() );
+        assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() );
+        assert( hrdVec[i]->getSubPicCpbParamsPresentFlag()    == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() );
+      }
+    }
+    pHRD = hrdVec[i];
+  }
+  else
+  {
+    TComVUI *vui = sps->getVuiParameters();
+    pHRD = vui->getHrdParameters();
+  }
+  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
+#else
   TComVUI *pVUI = sps->getVuiParameters();
   TComHRD *pHRD = pVUI->getHrdParameters();
+#endif
 
   READ_UVLC( code, "bp_seq_parameter_set_id" );                         sei.m_bpSeqParameterSetId     = code;
@@ -683,11 +782,58 @@
   xParseByteAlign();
 }
+#if VPS_VUI_BSP_HRD_PARAMS
+Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
+#else
 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt /*payloadSize*/, TComSPS *sps)
+#endif
 {
   Int i;
   UInt code;
 
+#if VPS_VUI_BSP_HRD_PARAMS
+  TComHRD *hrd;    
+  TComVUI *vui = sps->getVuiParameters(); 
+  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
+  {
+    assert( nestingSei );
+    Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx;
+    Int seiOlsIdx = bspNestingSei->m_seiOlsIdx;
+    Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1;
+    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+    std::vector<Int> hrdIdx(maxValues, 0);
+    std::vector<TComHRD *> hrdVec;
+    std::vector<Int> syntaxElemLen(maxValues, 0);
+    for(i = 0; i < maxValues; i++)
+    {
+      hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx);
+      hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+      syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+      if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+      {
+        assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+      }
+      if( i > 0 )
+      {
+        assert( hrdVec[i]->getSubPicCpbParamsPresentFlag()    == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() );
+        assert( hrdVec[i]->getSubPicCpbParamsInPicTimingSEIFlag()   == hrdVec[i-1]->getSubPicCpbParamsInPicTimingSEIFlag() );
+        assert( hrdVec[i]->getCpbRemovalDelayLengthMinus1()  == hrdVec[i-1]->getCpbRemovalDelayLengthMinus1() );
+        assert( hrdVec[i]->getDpbOutputDelayLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayLengthMinus1() );
+        assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() );
+        assert( hrdVec[i]->getDuCpbRemovalDelayLengthMinus1()  == hrdVec[i-1]->getDuCpbRemovalDelayLengthMinus1() );
+        // To be done: Check CpbDpbDelaysPresentFlag
+      }
+    }
+    hrd = hrdVec[0];
+  }
+  else
+  {
+    hrd = vui->getHrdParameters();
+  }
+  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
+#else
   TComVUI *vui = sps->getVuiParameters();
   TComHRD *hrd = vui->getHrdParameters();
+#endif
 
   if( vui->getFrameFieldInfoPresentFlag() )
@@ -1264,4 +1410,44 @@
   assert(vps->getVpsVuiPresentFlag());
 
+#if VPS_VUI_BSP_HRD_PARAMS
+  UInt uiCode;
+  Int psIdx         = bspNestingSei.m_seiPartitioningSchemeIdx;
+  Int seiOlsIdx     = bspNestingSei.m_seiOlsIdx;
+  Int maxTemporalId = nestingSei.m_nestingMaxTemporalIdPlus1[0];
+  Int maxValues     = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+  std::vector<Int> hrdIdx(0, maxValues);
+  std::vector<TComHRD *> hrdVec;
+  std::vector<Int> syntaxElemLen;
+  for(Int i = 0; i < maxValues; i++)
+  {
+    hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei.m_bspIdx);
+    hrdVec[i] = vps->getBspHrd(hrdIdx[i]);
+    
+    syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+    if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+    {
+      assert( syntaxElemLen[i] == 24 ); // Default value of init_cpb_removal_delay_length_minus1 is 23
+    }
+    if( i > 0 )
+    {
+      assert( hrdVec[i]->getNalHrdParametersPresentFlag() == hrdVec[i-1]->getNalHrdParametersPresentFlag() );
+      assert( hrdVec[i]->getVclHrdParametersPresentFlag() == hrdVec[i-1]->getVclHrdParametersPresentFlag() );
+    }
+  }
+  if (hrdVec[0]->getNalHrdParametersPresentFlag())
+  {
+    for(UInt i = 0; i < maxValues; i++)
+    {
+      READ_CODE( syntaxElemLen[i], uiCode, "nal_initial_arrival_delay[i]" ); sei.m_nalInitialArrivalDelay[i] = uiCode;
+    }
+  }
+  if( hrdVec[0]->getVclHrdParametersPresentFlag() )
+  {
+    for(UInt i = 0; i < maxValues; i++)
+    {
+      READ_CODE( syntaxElemLen[i], uiCode, "vcl_initial_arrival_delay[i]" ); sei.m_vclInitialArrivalDelay[i] = uiCode;
+    }
+  }
+#else
   UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);
   UInt len;
@@ -1307,4 +1493,5 @@
     }
   }
+#endif
 }
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 894)
@@ -80,8 +80,14 @@
   Void xParseSEIuserDataUnregistered  (SEIuserDataUnregistered &sei, UInt payloadSize);
   Void xParseSEIActiveParameterSets   (SEIActiveParameterSets  &sei, UInt payloadSize);
+  Void xParseSEIDecodedPictureHash    (SEIDecodedPictureHash& sei, UInt payloadSize);
+#if VPS_VUI_BSP_HRD_PARAMS
+  Void xParseSEIDecodingUnitInfo      (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
+  Void xParseSEIBufferingPeriod       (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
+  Void xParseSEIPictureTiming         (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
+#else
   Void xParseSEIDecodingUnitInfo      (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps);
-  Void xParseSEIDecodedPictureHash    (SEIDecodedPictureHash& sei, UInt payloadSize);
   Void xParseSEIBufferingPeriod       (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps);
   Void xParseSEIPictureTiming         (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps);
+#endif
   Void xParseSEIRecoveryPoint         (SEIRecoveryPoint& sei, UInt payloadSize);
   Void xParseSEIFramePacking          (SEIFramePacking& sei, UInt payloadSize);
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 894)
@@ -578,4 +578,11 @@
       READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" );       hrd->setDpbOutputDelayLengthMinus1( uiCode );
     }
+#if VPS_VUI_BSP_HRD_PARAMS
+    else
+    {
+      hrd->setInitialCpbRemovalDelayLengthMinus1( 23 );
+      // Add inferred values for other syntax elements here.
+    }
+#endif
   }
   Int i, j, nalOrVcl;
@@ -2625,4 +2632,7 @@
   if (vps->getVpsVuiBspHrdPresentFlag())
   {
+#if VPS_VUI_BSP_HRD_PARAMS
+    parseVpsVuiBspHrdParams(vps);
+#else
 #if R0227_VUI_BSP_HRD_FLAG
     assert (vps->getTimingInfo()->getTimingInfoPresentFlag() == 1);
@@ -2703,7 +2713,7 @@
       }
     }
-  }
-#endif
-
+#endif
+  }
+#endif
 #if P0182_VPS_VUI_PS_FLAG
   for(i = 1; i < vps->getMaxLayers(); i++)
@@ -2721,4 +2731,5 @@
 #endif
 }
+
 #endif //SVC_EXTENSION
 
@@ -4487,4 +4498,80 @@
 }
 #endif
+#if VPS_VUI_BSP_HRD_PARAMS
+Void TDecCavlc::parseVpsVuiBspHrdParams( TComVPS *vps )
+{
+  UInt uiCode;
+  assert (vps->getTimingInfo()->getTimingInfoPresentFlag() == 1);
+  READ_UVLC( uiCode, "vps_num_add_hrd_params" ); vps->setVpsNumAddHrdParams(uiCode);
+  vps->createBspHrdParamBuffer(vps->getVpsNumAddHrdParams()); // Also allocates m_cprmsAddPresentFlag and m_numSubLayerHrdMinus
+
+  for( Int i = vps->getNumHrdParameters(), j = 0; i < vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams(); i++, j++ ) // j = i - vps->getNumHrdParameters()
+  {
+    if( i > 0 )
+    {
+      READ_FLAG( uiCode, "cprms_add_present_flag[i]" );   vps->setCprmsAddPresentFlag(j, uiCode ? true : false);
+    }
+    else
+    {
+      // i == 0
+      if( vps->getNumHrdParameters() == 0 )
+      {
+        vps->setCprmsAddPresentFlag(0, true);
+      }
+    }
+    READ_UVLC( uiCode, "num_sub_layer_hrd_minus1[i]" ); vps->setNumSubLayerHrdMinus1(j, uiCode );
+    assert( uiCode <= vps->getMaxTLayers() - 1 );
+    
+    parseHrdParameters( vps->getBspHrd(j), vps->getCprmsAddPresentFlag(j), vps->getNumSubLayerHrdMinus1(j) );
+    if( i > 0 && !vps->getCprmsAddPresentFlag(i) )
+    {
+      // Copy common information parameters
+      if( i == vps->getNumHrdParameters() )
+      {
+        vps->getBspHrd(j)->copyCommonInformation( vps->getHrdParameters( vps->getNumHrdParameters() - 1 ) );
+      }
+      else
+      {
+        vps->getBspHrd(j)->copyCommonInformation( vps->getBspHrd( j - 1 ) );
+      }
+    }
+  }
+  for (Int h = 1; h < vps->getNumOutputLayerSets(); h++)
+  {
+    Int lsIdx = vps->getOutputLayerSetIdx( h );
+    READ_UVLC( uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
+    for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ )
+    {
+      READ_UVLC( uiCode, "num_partitions_in_scheme_minus1[h][j]" ); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode);
+      for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ )
+      {
+        for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ )
+        {
+          READ_FLAG( uiCode, "layer_included_in_partition_flag[h][j][k][r]" ); vps->setLayerIncludedInPartitionFlag(h, j, k, r, uiCode ? true : false);
+        }
+      }
+    }
+    for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ )
+    {
+      for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ )
+      {
+        READ_UVLC( uiCode, "num_bsp_schedules_minus1[h][i][t]");              vps->setNumBspSchedulesMinus1(h, i, t, uiCode);
+        for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
+        {
+          for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
+          {
+            READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
+            READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
+          }
+        }
+      }
+    }
+
+    // To be done: Check each layer included in not more than one BSP in every partitioning scheme,
+    // and other related checks associated with layers in bitstream partitions.
+
+  }
+}
+#endif
 #endif
 //! \}
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 894)
@@ -86,4 +86,7 @@
   Void  parseVpsDpbSizeTable( TComVPS *vps );
 #endif
+#if VPS_VUI_BSP_HRD_PARAMS
+  Void  parseVpsVuiBspHrdParams( TComVPS *vps );
+#endif
 #if SPS_DPB_PARAMS
   Void  parseSPS            ( TComSPS* pcSPS ); // it should be removed after macro clean up
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 894)
@@ -149,9 +149,25 @@
 
 #if O0164_MULTI_LAYER_HRD
+#if VPS_VUI_BSP_HRD_PARAMS
+void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSeiPtr, const SEIBspNesting* bspNestingSeiPtr)
+#else
 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei)
+#endif
 #else
 void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps)
 #endif
 {
+#if VPS_VUI_BSP_HRD_PARAMS
+  SEIScalableNesting nestingSei;
+  SEIBspNesting      bspNestingSei;
+  if( nestingSeiPtr )
+  {
+    nestingSei = *nestingSeiPtr;
+  }
+  if( bspNestingSeiPtr )
+  {
+    bspNestingSei = *bspNestingSeiPtr;
+  }
+#endif
   switch (sei.payloadType())
   {
@@ -162,10 +178,21 @@
     xWriteSEIActiveParameterSets(*static_cast<const SEIActiveParameterSets*>(& sei)); 
     break; 
+  case SEI::DECODED_PICTURE_HASH:
+    xWriteSEIDecodedPictureHash(*static_cast<const SEIDecodedPictureHash*>(&sei));
+    break;
+#if VPS_VUI_BSP_HRD_PARAMS
+  case SEI::DECODING_UNIT_INFO:
+    xWriteSEIDecodingUnitInfo(*static_cast<const SEIDecodingUnitInfo*>(& sei), sps, nestingSeiPtr, bspNestingSeiPtr, vps);
+    break;
+  case SEI::BUFFERING_PERIOD:
+    xWriteSEIBufferingPeriod(*static_cast<const SEIBufferingPeriod*>(&sei), sps, nestingSeiPtr, bspNestingSeiPtr, vps);
+    break;
+  case SEI::PICTURE_TIMING:
+    xWriteSEIPictureTiming(*static_cast<const SEIPictureTiming*>(&sei), sps, nestingSeiPtr, bspNestingSeiPtr, vps);
+    break;
+#else
   case SEI::DECODING_UNIT_INFO:
     xWriteSEIDecodingUnitInfo(*static_cast<const SEIDecodingUnitInfo*>(& sei), sps);
     break;
-  case SEI::DECODED_PICTURE_HASH:
-    xWriteSEIDecodedPictureHash(*static_cast<const SEIDecodedPictureHash*>(&sei));
-    break;
   case SEI::BUFFERING_PERIOD:
     xWriteSEIBufferingPeriod(*static_cast<const SEIBufferingPeriod*>(&sei), sps);
@@ -174,4 +201,5 @@
     xWriteSEIPictureTiming(*static_cast<const SEIPictureTiming*>(&sei), sps);
     break;
+#endif
   case SEI::RECOVERY_POINT:
     xWriteSEIRecoveryPoint(*static_cast<const SEIRecoveryPoint*>(&sei));
@@ -287,5 +315,9 @@
 #endif
 #if O0164_MULTI_LAYER_HRD
+#if VPS_VUI_BSP_HRD_PARAMS
+  xWriteSEIpayloadData(bs_count, sei, vps, sps, nestingSei, bspNestingSei);
+#else
   xWriteSEIpayloadData(bs_count, sei, vps, sps, *nestingSei, *bspNestingSei);
+#endif
 #else
   xWriteSEIpayloadData(bs_count, sei, sps);
@@ -326,5 +358,9 @@
 
 #if O0164_MULTI_LAYER_HRD
+#if VPS_VUI_BSP_HRD_PARAMS
+  xWriteSEIpayloadData(bs, sei, vps, sps, nestingSei, bspNestingSei);
+#else
   xWriteSEIpayloadData(bs, sei, vps, sps, *nestingSei, *bspNestingSei);
+#endif
 #else
   xWriteSEIpayloadData(bs, sei, sps);
@@ -403,25 +439,112 @@
 }
 
+#if VPS_VUI_BSP_HRD_PARAMS
+Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
+#else
 Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)
-{
+#endif
+{
+#if VPS_VUI_BSP_HRD_PARAMS
+  TComHRD *hrd;
+  if( bspNestingSei )   // If DU info SEI contained inside a BSP nesting SEI message
+  {
+    assert( nestingSei );
+    Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx;
+    Int seiOlsIdx = bspNestingSei->m_seiOlsIdx;
+    Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1;
+    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+    std::vector<Int> hrdIdx(maxValues, 0);
+    std::vector<TComHRD *> hrdVec;
+    std::vector<Int> syntaxElemLen(maxValues, 0);
+    for(Int i = 0; i < maxValues; i++)
+    {
+      hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx);
+      hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+      syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+      if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+      {
+        assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+      }
+      if( i > 0 )
+      {
+        assert( hrdVec[i]->getSubPicCpbParamsPresentFlag()    == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() );
+        assert( hrdVec[i]->getSubPicCpbParamsInPicTimingSEIFlag()   == hrdVec[i-1]->getSubPicCpbParamsInPicTimingSEIFlag() );
+        assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() );
+        // To be done: Check CpbDpbDelaysPresentFlag
+      }
+    }
+    hrd = hrdVec[0];
+  }
+  else
+  {
+    TComVUI *vui = sps->getVuiParameters();
+    hrd = vui->getHrdParameters();
+  }
+#else
   TComVUI *vui = sps->getVuiParameters();
+  TComHrd *hrd = vui->getHrdParameters();
+#endif
   WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
-  if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())
-  {
-    WRITE_CODE( sei.m_duSptCpbRemovalDelay, (vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay");
+  if(hrd->getSubPicCpbParamsInPicTimingSEIFlag())
+  {
+    WRITE_CODE( sei.m_duSptCpbRemovalDelay, (hrd->getDuCpbRemovalDelayLengthMinus1() + 1), "du_spt_cpb_removal_delay");
   }
   WRITE_FLAG( sei.m_dpbOutputDuDelayPresentFlag, "dpb_output_du_delay_present_flag");
   if(sei.m_dpbOutputDuDelayPresentFlag)
   {
-    WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
-  }
-  xWriteByteAlign();
-}
-
+    WRITE_CODE(sei.m_picSptDpbOutputDuDelay,hrd->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
+  }
+  xWriteByteAlign();
+}
+
+#if VPS_VUI_BSP_HRD_PARAMS
+Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
+#else
 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps)
+#endif
 {
   Int i, nalOrVcl;
+#if VPS_VUI_BSP_HRD_PARAMS
+  TComHRD *hrd;
+  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
+  {
+    assert( nestingSei );
+    Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx;
+    Int seiOlsIdx = bspNestingSei->m_seiOlsIdx;
+    Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1;
+    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+    std::vector<Int> hrdIdx(maxValues, 0);
+    std::vector<TComHRD *> hrdVec;
+    std::vector<Int> syntaxElemLen(maxValues, 0);
+    for(i = 0; i < maxValues; i++)
+    {
+      hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx);
+      hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+      syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+      if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+      {
+        assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+      }
+      if( i > 0 )
+      {
+        assert( hrdVec[i]->getCpbRemovalDelayLengthMinus1()   == hrdVec[i-1]->getCpbRemovalDelayLengthMinus1() );
+        assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() );
+        assert( hrdVec[i]->getSubPicCpbParamsPresentFlag()    == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() );
+      }
+    }
+    hrd = hrdVec[i];
+  }
+  else
+  {
+    TComVUI *vui = sps->getVuiParameters();
+    hrd = vui->getHrdParameters();
+  }
+  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
+#else
   TComVUI *vui = sps->getVuiParameters();
   TComHRD *hrd = vui->getHrdParameters();
+#endif
 
   WRITE_UVLC( sei.m_bpSeqParameterSetId, "bp_seq_parameter_set_id" );
@@ -462,11 +585,58 @@
   xWriteByteAlign();
 }
+#if VPS_VUI_BSP_HRD_PARAMS
+Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei,  TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
+#else
 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei,  TComSPS *sps)
+#endif
 {
   Int i;
+#if VPS_VUI_BSP_HRD_PARAMS
+  TComHRD *hrd;    
+  TComVUI *vui = sps->getVuiParameters(); 
+  if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
+  {
+    assert( nestingSei );
+    Int psIdx = bspNestingSei->m_seiPartitioningSchemeIdx;
+    Int seiOlsIdx = bspNestingSei->m_seiOlsIdx;
+    Int maxTemporalId = nestingSei->m_nestingMaxTemporalIdPlus1[0] - 1;
+    Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+    std::vector<Int> hrdIdx(maxValues, 0);
+    std::vector<TComHRD *> hrdVec;
+    std::vector<Int> syntaxElemLen(maxValues, 0);
+    for(i = 0; i < maxValues; i++)
+    {
+      hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei->m_bspIdx);
+      hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+      syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+      if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+      {
+        assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+      }
+      if( i > 0 )
+      {
+        assert( hrdVec[i]->getSubPicCpbParamsPresentFlag()    == hrdVec[i-1]->getSubPicCpbParamsPresentFlag() );
+        assert( hrdVec[i]->getSubPicCpbParamsInPicTimingSEIFlag()   == hrdVec[i-1]->getSubPicCpbParamsInPicTimingSEIFlag() );
+        assert( hrdVec[i]->getCpbRemovalDelayLengthMinus1()  == hrdVec[i-1]->getCpbRemovalDelayLengthMinus1() );
+        assert( hrdVec[i]->getDpbOutputDelayLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayLengthMinus1() );
+        assert( hrdVec[i]->getDpbOutputDelayDuLengthMinus1()  == hrdVec[i-1]->getDpbOutputDelayDuLengthMinus1() );
+        assert( hrdVec[i]->getDuCpbRemovalDelayLengthMinus1()  == hrdVec[i-1]->getDuCpbRemovalDelayLengthMinus1() );
+        // To be done: Check CpbDpbDelaysPresentFlag
+      }
+    }
+    hrd = hrdVec[0];
+  }
+  else
+  {
+    hrd = vui->getHrdParameters();
+  }
+  // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently.
+#else
   TComVUI *vui = sps->getVuiParameters();
   TComHRD *hrd = vui->getHrdParameters();
-
-  if( vui->getFrameFieldInfoPresentFlag() )
+#endif
+
+  if( vui->getFrameFieldInfoPresentFlag() ) // To be done: Check whether this is the correct invocation of vui when PT SEI contained in BSP nesting SEI
   {
     WRITE_CODE( sei.m_picStruct, 4,              "pic_struct" );
@@ -754,9 +924,8 @@
   {
     WRITE_FLAG( sei.m_defaultOpFlag,                 "default_op_flag"               );
-    WRITE_UVLC( sei.m_nestingNumOpsMinus1,           "nesting_num_ops"               );
+    WRITE_UVLC( sei.m_nestingNumOpsMinus1,           "nesting_num_ops_minus1"        );
     for (UInt i = (sei.m_defaultOpFlag ? 1 : 0); i <= sei.m_nestingNumOpsMinus1; i++)
     {
-      WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );
-      WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3,  "nesting_max_temporal_id"       );
+      WRITE_CODE( sei.m_nestingMaxTemporalIdPlus1[i], 3,  "nesting_max_temporal_id_plus1" );
       WRITE_UVLC( sei.m_nestingOpIdx[i],                  "nesting_op_idx"                );
     }
@@ -767,6 +936,6 @@
     if (!sei.m_allLayersFlag)
     {
-      WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id" );
-      WRITE_UVLC( sei.m_nestingNumLayersMinus1,           "nesting_num_layers"            );
+      WRITE_CODE( sei.m_nestingNoOpMaxTemporalIdPlus1, 3, "nesting_no_op_max_temporal_id_plus1" );
+      WRITE_UVLC( sei.m_nestingNumLayersMinus1,           "nesting_num_layers"                  );
       for (UInt i = 0; i <= sei.m_nestingNumLayersMinus1; i++)
       {
@@ -917,4 +1086,43 @@
   assert(vps->getVpsVuiPresentFlag());
 
+#if VPS_VUI_BSP_HRD_PARAMS
+  Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx;
+  Int seiOlsIdx = bspNestingSei.m_seiOlsIdx;
+  Int maxTemporalId = nestingSei.m_nestingMaxTemporalIdPlus1[0] - 1;
+  Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1;
+  std::vector<Int> hrdIdx(maxValues, 0);
+  std::vector<TComHRD *> hrdVec;
+  std::vector<Int> syntaxElemLen(maxValues, 0);
+  for(Int i = 0; i < maxValues; i++)
+  {
+    hrdIdx[i] = vps->getBspHrdIdx( seiOlsIdx, psIdx, maxTemporalId, i, bspNestingSei.m_bspIdx);
+    hrdVec.push_back(vps->getBspHrd(hrdIdx[i]));
+    
+    syntaxElemLen[i] = hrdVec[i]->getInitialCpbRemovalDelayLengthMinus1() + 1;
+    if ( !(hrdVec[i]->getNalHrdParametersPresentFlag() || hrdVec[i]->getVclHrdParametersPresentFlag()) )
+    {
+      assert( syntaxElemLen[i] == 24 ); // Default of value init_cpb_removal_delay_length_minus1 is 23
+    }
+    if( i > 0 )
+    {
+      assert( hrdVec[i]->getNalHrdParametersPresentFlag() == hrdVec[i-1]->getNalHrdParametersPresentFlag() );
+      assert( hrdVec[i]->getVclHrdParametersPresentFlag() == hrdVec[i-1]->getVclHrdParametersPresentFlag() );
+    }
+  }
+  if (hrdVec[0]->getNalHrdParametersPresentFlag())
+  {
+    for(UInt i = 0; i < maxValues; i++)
+    {
+      WRITE_CODE( sei.m_nalInitialArrivalDelay[i], syntaxElemLen[i], "nal_initial_arrival_delay[i]" );
+    }
+  }
+  if( hrdVec[0]->getVclHrdParametersPresentFlag() )
+  {
+    for(UInt i = 0; i < maxValues; i++)
+    {
+      WRITE_CODE( sei.m_vclInitialArrivalDelay[i], syntaxElemLen[i], "vcl_initial_arrival_delay[i]" );
+    }
+  }
+#else
   UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);
   UInt len;
@@ -959,4 +1167,5 @@
     }
   }
+#endif
 }
 
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 894)
@@ -55,5 +55,9 @@
 protected:
 #if O0164_MULTI_LAYER_HRD
+#if VPS_VUI_BSP_HRD_PARAMS
+  Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei);
+#else
   Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting& nestingSei, const SEIBspNesting& bspNestingSei);
+#endif
 #else
   Void xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, TComSPS *sps);
@@ -61,8 +65,14 @@
   Void xWriteSEIuserDataUnregistered(const SEIuserDataUnregistered &sei);
   Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei);
+  Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);
+#if VPS_VUI_BSP_HRD_PARAMS
+  Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
+  Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
+  Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps);
+#else
   Void xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps);
-  Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);
   Void xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps);
   Void xWriteSEIPictureTiming(const SEIPictureTiming& sei, TComSPS *sps);
+#endif
   TComSPS *m_pSPS;
   Void xWriteSEIRecoveryPoint(const SEIRecoveryPoint& sei);
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 894)
@@ -1813,4 +1813,7 @@
     if (vps->getVpsVuiBspHrdPresentFlag())
     {
+#if VPS_VUI_BSP_HRD_PARAMS
+      codeVpsVuiBspHrdParams(vps);
+#else
       WRITE_UVLC( vps->getVpsNumBspHrdParametersMinus1(), "vps_num_bsp_hrd_parameters_minus1" );
       for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
@@ -1856,4 +1859,5 @@
         }
       }
+#endif
     }
 #endif
@@ -3188,5 +3192,50 @@
 }
 #endif
-
+#if VPS_VUI_BSP_HRD_PARAMS
+Void TEncCavlc::codeVpsVuiBspHrdParams(TComVPS * const vps)
+{
+  WRITE_UVLC( vps->getVpsNumAddHrdParams(), "vps_num_add_hrd_params" );
+  for( Int i = vps->getNumHrdParameters(), j = 0; i < vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams(); i++, j++ ) // j = i - vps->getNumHrdParameters()
+  {
+    if( i > 0 )
+    {
+      WRITE_FLAG( vps->getCprmsAddPresentFlag(j), "cprms_add_present_flag[i]" );
+    }
+    WRITE_UVLC( vps->getNumSubLayerHrdMinus1(j), "num_sub_layer_hrd_minus1[i]" );
+    codeHrdParameters(vps->getBspHrd(j), i == 0 ? true : vps->getCprmsAddPresentFlag(j), vps->getNumSubLayerHrdMinus1(j));
+  }
+  for( Int h = 1; h < vps->getNumOutputLayerSets(); h++ )
+  {
+    Int lsIdx = vps->getOutputLayerSetIdx( h );
+    WRITE_UVLC( vps->getNumSignalledPartitioningSchemes(h), "num_signalled_partitioning_schemes[h]");
+    for( Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++ )
+    {
+      WRITE_UVLC( vps->getNumPartitionsInSchemeMinus1(h, j), "num_partitions_in_scheme_minus1[h][j]" );
+      for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ )
+      {
+        for( Int r = 0; r < vps->getNumLayersInIdList( lsIdx ); r++ )
+        {
+          WRITE_FLAG( vps->getLayerIncludedInPartitionFlag(h, j, k, r), "layer_included_in_partition_flag[h][j][k][r]" );
+        }
+      }
+    }
+    for( Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++ )
+    {
+      for( Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++ )
+      {
+        WRITE_UVLC(vps->getNumBspSchedulesMinus1(h, i, t), "num_bsp_schedules_minus1[h][i][t]");
+        for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
+        {
+          for( Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
+          {
+            WRITE_UVLC( vps->getBspHrdIdx(h, i, t, j, k),   "bsp_comb_hrd_idx[h][i][t][j][k]");
+            WRITE_UVLC( vps->getBspSchedIdx(h, i, t, j, k), "bsp_comb_sched_idx[h][i][t][j][k]");
+          }
+        }
+      }
+    }
+  }
+}
+#endif
 #endif
 //! \}
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 894)
@@ -169,4 +169,7 @@
   Void  codeVpsDpbSizeTable    (TComVPS *vps);
 #endif
+#if VPS_VUI_BSP_HRD_PARAMS
+  Void  codeVpsVuiBspHrdParams  (TComVPS * const);
+#endif
 #if Q0048_CGS_3D_ASYMLUT
 #if R0179_ENC_OPT_3DLUT_SIZE
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 894)
@@ -2361,22 +2361,40 @@
       if (pcSlice->getLayerId() == 0 && m_pcEncTop->getVPS()->getVpsVuiBspHrdPresentFlag())
       {
-        nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, 1);
-        m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
-        m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
-        SEIScalableNesting *scalableBspNestingSei = xCreateBspNestingSEI(pcSlice);
-        m_seiWriter.writeSEImessage(nalu.m_Bitstream, *scalableBspNestingSei, m_pcEncTop->getVPS(), pcSlice->getSPS());
-        writeRBSPTrailingBits(nalu.m_Bitstream);
-
-        UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
-        UInt offsetPosition = m_activeParameterSetSEIPresentInAU 
-          + m_bufferingPeriodSEIPresentInAU 
-          + m_pictureTimingSEIPresentInAU
-          + m_nestedPictureTimingSEIPresentInAU;  // Insert SEI after APS, BP and PT SEI
-        AccessUnit::iterator it;
-        for(j = 0, it = accessUnit.begin(); j < seiPositionInAu + offsetPosition; j++)
-        {
-          it++;
-        }
-        accessUnit.insert(it, new NALUnitEBSP(nalu));
+#if VPS_VUI_BSP_HRD_PARAMS
+        TComVPS *vps = m_pcEncTop->getVPS();
+        for(Int i = 0; i < vps->getNumOutputLayerSets(); i++)
+        {
+          for(Int k = 0; k < vps->getNumSignalledPartitioningSchemes(i); k++)
+          {
+            for(Int l = 0; l < vps->getNumPartitionsInSchemeMinus1(i, k)+1; l++)
+            {
+#endif
+              nalu = NALUnit(NAL_UNIT_PREFIX_SEI, 0, 1);
+              m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
+              m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
+#if VPS_VUI_BSP_HRD_PARAMS
+              SEIScalableNesting *scalableBspNestingSei = xCreateBspNestingSEI(pcSlice, i, k, l);
+#else
+              SEIScalableNesting *scalableBspNestingSei = xCreateBspNestingSEI(pcSlice);
+#endif
+              m_seiWriter.writeSEImessage(nalu.m_Bitstream, *scalableBspNestingSei, m_pcEncTop->getVPS(), pcSlice->getSPS());
+              writeRBSPTrailingBits(nalu.m_Bitstream);
+
+              UInt seiPositionInAu = xGetFirstSeiLocation(accessUnit);
+              UInt offsetPosition = m_activeParameterSetSEIPresentInAU 
+                + m_bufferingPeriodSEIPresentInAU 
+                + m_pictureTimingSEIPresentInAU
+                + m_nestedPictureTimingSEIPresentInAU;  // Insert SEI after APS, BP and PT SEI
+              AccessUnit::iterator it;
+              for(j = 0, it = accessUnit.begin(); j < seiPositionInAu + offsetPosition; j++)
+              {
+                it++;
+              }
+              accessUnit.insert(it, new NALUnitEBSP(nalu));
+#if VPS_VUI_BSP_HRD_PARAMS
+            }
+          }
+        }
+#endif
       }
 #endif
@@ -4746,5 +4764,9 @@
 
 #if O0164_MULTI_LAYER_HRD
+#if VPS_VUI_BSP_HRD_PARAMS
+SEIScalableNesting* TEncGOP::xCreateBspNestingSEI(TComSlice *pcSlice, Int olsIdx, Int partitioningSchemeIdx, Int bspIdx)
+#else
 SEIScalableNesting* TEncGOP::xCreateBspNestingSEI(TComSlice *pcSlice)
+#endif
 {
   SEIScalableNesting *seiScalableNesting = new SEIScalableNesting();
@@ -4759,5 +4781,10 @@
   seiScalableNesting->m_defaultOpFlag                 = 0;
   seiScalableNesting->m_nestingNumOpsMinus1           = 0;      //nesting_num_ops_minus1
+#if VPS_VUI_BSP_HRD_PARAMS
+  seiScalableNesting->m_nestingOpIdx[0]               = pcSlice->getVPS()->getOutputLayerSetIdx(olsIdx);
+  seiScalableNesting->m_nestingMaxTemporalIdPlus1[0]  = 6 + 1;
+#else
   seiScalableNesting->m_nestingOpIdx[0]               = 1;
+#endif
   seiScalableNesting->m_allLayersFlag                 = 0;
   seiScalableNesting->m_nestingNoOpMaxTemporalIdPlus1 = 6 + 1;  //nesting_no_op_max_temporal_id_plus1
@@ -4805,4 +4832,9 @@
   seiBspNesting->m_nestedSEIs.push_back(seiBufferingPeriod);
   seiBspNesting->m_nestedSEIs.push_back(seiBspInitialArrivalTime);
+#if VPS_VUI_BSP_HRD_PARAMS
+  seiBspNesting->m_bspIdx = bspIdx;
+  seiBspNesting->m_seiOlsIdx = olsIdx;
+  seiBspNesting->m_seiPartitioningSchemeIdx = partitioningSchemeIdx;
+#endif
   seiScalableNesting->m_nestedSEIs.push_back(seiBspNesting); // BSP nesting SEI is contained in scalable nesting SEI
 
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 894)
@@ -253,5 +253,9 @@
 #endif
 #if O0164_MULTI_LAYER_HRD
+#if VPS_VUI_BSP_HRD_PARAMS
+  SEIScalableNesting* TEncGOP::xCreateBspNestingSEI(TComSlice *pcSlice, Int olsIdx, Int partitioningSchemeIdx, Int bspIdx);
+#else
   SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice);
+#endif
 #endif
 #if Q0048_CGS_3D_ASYMLUT
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 893)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 894)
@@ -323,5 +323,9 @@
   /* set the VPS profile information */
   *m_cVPS.getPTL() = *m_cSPS.getPTL();
+#if VPS_VUI_BSP_HRD_PARAMS
+  m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( true );
+#else
   m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( false );
+#endif
   // initialize PPS
   m_cPPS.setSPS(&m_cSPS);
