Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1184)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1185)
@@ -1595,10 +1595,10 @@
   vps->setHigherLayerIrapSkipFlag(m_skipPictureAtArcSwitch);
 
-  for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++)
+  for( Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++ )
   {
     vps->setAltOuputLayerFlag( k, m_altOutputLayerFlag );
   }
 
-#if VPS_VUI_BSP_HRD_PARAMS
+  // VPS VUI BSP HRD parameters
   vps->setVpsVuiBspHrdPresentFlag(false);
   TEncTop *pcCfg = &m_acTEncTop[0];
@@ -1640,5 +1640,5 @@
 
     // Signalling of additional partitioning schemes
-    for(Int h = 1; h < vps->getNumOutputLayerSets(); h++)
+    for( Int h = 1; h < vps->getNumOutputLayerSets(); h++ )
     {
       Int lsIdx = vps->getOutputLayerSetIdx( h );
@@ -1678,72 +1678,4 @@
     }
   }
-#else
-
-#if O0164_MULTI_LAYER_HRD
-  vps->setVpsVuiBspHrdPresentFlag(false);
-  TEncTop *pcCfg = &m_acTEncTop[0];
-  if( pcCfg->getBufferingPeriodSEIEnabled() )
-  {
-    vps->setVpsVuiBspHrdPresentFlag(true);
-    vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1); 
-    vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1);
-    for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
-    {
-      vps->setBspCprmsPresentFlag(i, true);
-
-      UInt layerId = i + 1;
-      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;
-#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;
-#endif
-      UInt uiNumCUsInFrame   = uiWidthInCU * uiHeightInCU;
-
-#if LAYER_CTB
-      UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_acLayerCfg[layerId].m_uiMaxCUDepth << 1);
-#else
-      UInt maxCU = pcCfgLayer->getSliceArgument() >> ( m_uiMaxCUDepth << 1);
-#endif
-      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 ) );
-    }
-    for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
-    {
-      vps->setNumBitstreamPartitions(h, 1);
-      for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ )
-      {
-        for( UInt j = 0; j <= (vps->getMaxLayers()-1); j++ )
-        {
-          if (vps->getLayerIdIncludedFlag(h, j) && h == j)
-          {
-            vps->setLayerInBspFlag(h, i, j, true);
-          }
-        }
-      }
-      vps->setNumBspSchedCombinations(h, 1);
-      for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ )
-      {
-        for( UInt j = 0; j < vps->getNumBitstreamPartitions(h); j++ )
-        {
-          vps->setBspCombHrdIdx(h, i, j, 0);
-          vps->setBspCombSchedIdx(h, i, j, 0);
-        }
-      }
-    }
-  }
-#endif
-#endif
-
 #else //SVC_EXTENSION
   m_cTEncTop.init(isFieldCoding);
Index: /branches/SHM-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 1185)
@@ -848,8 +848,6 @@
   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.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1185)
@@ -395,5 +395,5 @@
   Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); }
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
 Void copyCommonInformation( TComHRD *refHrd )
 {
@@ -725,5 +725,4 @@
 #if O0164_MULTI_LAYER_HRD
   Bool       m_vpsVuiBspHrdPresentFlag;
-#if VPS_VUI_BSP_HRD_PARAMS
   Int                 m_vpsNumAddHrdParams;
   std::vector<Bool>   m_cprmsAddPresentFlag;
@@ -736,14 +735,4 @@
   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];
-  TComHRD    *m_bspHrd;
-  UInt       m_numBitstreamPartitions[MAX_VPS_LAYER_SETS_PLUS1];
-  Bool       m_layerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS];
-  UInt       m_numBspSchedCombinations[MAX_VPS_LAYER_SETS_PLUS1];
-  UInt       m_bspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
-  UInt       m_bspCombSchedIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
-#endif
 #endif
   UInt       m_baseLayerPSCompatibilityFlag[MAX_LAYERS];
@@ -822,13 +811,7 @@
   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() ];
   }
 #endif
@@ -836,9 +819,5 @@
   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
@@ -1058,52 +1037,34 @@
   Void   setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
 #if O0164_MULTI_LAYER_HRD
-  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; }
+  Bool     getVpsVuiBspHrdPresentFlag()                                         { return m_vpsVuiBspHrdPresentFlag;      }
+  Void     setVpsVuiBspHrdPresentFlag(Bool x)                                   { m_vpsVuiBspHrdPresentFlag = x;         }
+  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];}
+  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;    }
-  Bool     getBspCprmsPresentFlag(UInt i)                       { return m_bspCprmsPresentFlag[i];       }
-  Void     setBspCprmsPresentFlag(UInt i, Bool val)             { m_bspCprmsPresentFlag[i] = val;        }
-  TComHRD* getBspHrd(UInt i)                                    { return &m_bspHrd[i];                    }
-  UInt     getNumBitstreamPartitions(UInt i)                    { return m_numBitstreamPartitions[i];    }
-  Void     setNumBitstreamPartitions(UInt i, UInt val)          { m_numBitstreamPartitions[i] = val;     }
-  UInt     getLayerInBspFlag(UInt h, UInt i, UInt j)            { return m_layerInBspFlag[h][i][j];      }
-  Void     setLayerInBspFlag(UInt h, UInt i, UInt j, UInt val)  { m_layerInBspFlag[h][i][j] = val;       }
-  UInt     getNumBspSchedCombinations(UInt i)                   { return m_numBspSchedCombinations[i];   }
-  Void     setNumBspSchedCombinations(UInt i, UInt val)         { m_numBspSchedCombinations[i] = val;    }
-  UInt     getBspCombHrdIdx(UInt h, UInt i, UInt j)             { return m_bspCombHrdIdx[h][i][j];       }
-  Void     setBspCombHrdIdx(UInt h, UInt i, UInt j, UInt val)   { m_bspCombHrdIdx[h][i][j] = val;        }
-  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
+  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; }
 #endif
   Void   setBaseLayerPSCompatibilityFlag (Int layer, int val)   { m_baseLayerPSCompatibilityFlag[layer] = val; }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1185)
@@ -51,8 +51,6 @@
 
 #define BSP_INIT_ARRIVAL_SEI             1      ///< JCTVC-R0231: Make signalling of vcl_initial_arrival_delay independent of NalHrdBpPresentFlag
-#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 R0226_SLICE_TMVP                 1      ///< JCTVC-R0226, Regarding slice_temporal_mvp_enabled_flag
-#define R0227_VUI_BSP_HRD_FLAG           1      ///< JCTVC-R0227, Conformance checking such that VPS VUI HRD only present if VPS timing info is signalled
 
 #define Q0108_TSA_STSA                   1      ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 1185)
@@ -199,5 +199,5 @@
       {
         sei = new SEIDecodingUnitInfo;
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
         xParseSEIDecodingUnitInfo((SEIDecodingUnitInfo&) *sei, payloadSize, sps, nestingSei, bspNestingSei, vps, pDecodedMessageOutputStream);
 #else        
@@ -214,5 +214,5 @@
       {
         sei = new SEIBufferingPeriod;
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
         xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps, nestingSei, bspNestingSei, vps, pDecodedMessageOutputStream);
 #else
@@ -229,5 +229,5 @@
       {
         sei = new SEIPictureTiming;
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
         xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps, nestingSei, bspNestingSei, vps, pDecodedMessageOutputStream);
 #else
@@ -560,5 +560,5 @@
 }
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps,std::ostream *pDecodedMessageOutputStream)
 #else
@@ -571,5 +571,5 @@
   sei.m_decodingUnitIdx = val;
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   TComHRD *hrd;
   if( bspNestingSei )   // If DU info SEI contained inside a BSP nesting SEI message
@@ -645,5 +645,5 @@
 }
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
 #else
@@ -654,5 +654,5 @@
   UInt code;
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   TComHRD *pHRD;
   if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
@@ -749,5 +749,5 @@
 }
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)
 #else
@@ -758,5 +758,5 @@
   UInt code;
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   TComHRD *hrd;    
   TComVUI *vui = sps->getVuiParameters(); 
@@ -1548,5 +1548,5 @@
   assert(vps->getVpsVuiPresentFlag());
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   UInt uiCode;
   Int psIdx         = bspNestingSei.m_seiPartitioningSchemeIdx;
Index: /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 1185)
@@ -78,5 +78,5 @@
   Void xParseSEIActiveParameterSets           (SEIActiveParameterSets  &sei,          UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
   Void xParseSEIDecodedPictureHash            (SEIDecodedPictureHash& sei,            UInt payloadSize,               std::ostream *pDecodedMessageOutputStream);
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   Void xParseSEIDecodingUnitInfo              (SEIDecodingUnitInfo& sei,              UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
   Void xParseSEIBufferingPeriod               (SEIBufferingPeriod& sei,               UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream);
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1185)
@@ -602,5 +602,5 @@
       READ_CODE( 5, uiCode, "dpb_output_delay_length_minus1" );       hrd->setDpbOutputDelayLengthMinus1( uiCode );
     }
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
     else
     {
@@ -3529,84 +3529,8 @@
 #if O0164_MULTI_LAYER_HRD
   READ_FLAG(uiCode, "vps_vui_bsp_hrd_present_flag" ); vps->setVpsVuiBspHrdPresentFlag(uiCode);
-  if (vps->getVpsVuiBspHrdPresentFlag())
-  {
-#if VPS_VUI_BSP_HRD_PARAMS
+
+  if( vps->getVpsVuiBspHrdPresentFlag() )
+  {
     parseVpsVuiBspHrdParams(vps);
-#else
-#if R0227_VUI_BSP_HRD_FLAG
-    assert (vps->getTimingInfo()->getTimingInfoPresentFlag() == 1);
-#endif
-    READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vps->setVpsNumBspHrdParametersMinus1(uiCode);
-    vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1);
-    for( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
-    {
-      if( i > 0 )
-      {
-        READ_FLAG( uiCode, "bsp_cprms_present_flag[i]" ); vps->setBspCprmsPresentFlag(i, uiCode);
-      }
-      parseHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
-    }
-    for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
-    {
-      READ_UVLC( uiCode, "num_bitstream_partitions[i]"); vps->setNumBitstreamPartitions(h, uiCode);
-#if HRD_BPB
-      Int chkPart=0;
-#endif
-      for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ )
-      {
-        for( j = 0; j <= (vps->getMaxLayers()-1); j++ )
-        {
-          if( vps->getLayerIdIncludedFlag(h, j) )
-          {
-            READ_FLAG( uiCode, "layer_in_bsp_flag[h][i][j]" ); vps->setLayerInBspFlag(h, i, j, uiCode);
-          }
-        }
-#if HRD_BPB
-        chkPart+=vps->getLayerInBspFlag(h, i, j);
-#endif
-      }
-#if HRD_BPB
-      assert(chkPart<=1);
-#endif
-#if HRD_BPB
-      if(vps->getNumBitstreamPartitions(h)==1)
-      {
-        Int chkPartition1=0; Int chkPartition2=0;
-        for( j = 0; j <= (vps->getMaxLayers()-1); j++ )
-        {
-          if( vps->getLayerIdIncludedFlag(h, j) )
-          {
-            chkPartition1+=vps->getLayerInBspFlag(h, 0, j);
-            chkPartition2++;
-          }
-        }
-        assert(chkPartition1!=chkPartition2);
-      }
-#endif
-      if (vps->getNumBitstreamPartitions(h))
-      {
-#if Q0182_MULTI_LAYER_HRD_UPDATE
-        READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1[h]"); vps->setNumBspSchedCombinations(h, uiCode + 1);
-#else
-        READ_UVLC( uiCode, "num_bsp_sched_combinations[h]"); vps->setNumBspSchedCombinations(h, uiCode);
-#endif
-        for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ )
-        {
-          for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ )
-          {
-            READ_UVLC( uiCode, "bsp_comb_hrd_idx[h][i][j]"); vps->setBspCombHrdIdx(h, i, j, uiCode);
-#if HRD_BPB
-            assert(uiCode <= vps->getVpsNumBspHrdParametersMinus1());
-#endif
-
-            READ_UVLC( uiCode, "bsp_comb_sched_idx[h][i][j]"); vps->setBspCombSchedIdx(h, i, j, uiCode);
-#if HRD_BPB
-            assert(uiCode <= vps->getBspHrdParamBufferCpbCntMinus1(uiCode,vps->getMaxTLayers()-1));
-#endif
-          }
-        }
-      }
-    }
-#endif
   }
 #endif
@@ -3635,5 +3559,4 @@
   assert( uiCode == 0 );
 }
-#endif
 
 #if Q0048_CGS_3D_ASYMLUT
@@ -3846,5 +3769,6 @@
 }
 #endif
-#if VPS_VUI_BSP_HRD_PARAMS
+#endif
+
 Void TDecCavlc::parseVpsVuiBspHrdParams( TComVPS *vps )
 {
@@ -3868,8 +3792,10 @@
       }
     }
+
     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) )
     {
@@ -3885,4 +3811,5 @@
     }
   }
+
   if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0 )
   {
@@ -3891,10 +3818,12 @@
       Int lsIdx = vps->getOutputLayerSetIdx(h);
       READ_UVLC(uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
+
       for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; 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++)
+
+        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);
@@ -3902,10 +3831,12 @@
         }
       }
-      for (Int i = 0; i < vps->getNumSignalledPartitioningSchemes(h) + 1; i++)
-      {
-        for (Int t = 0; t <= vps->getMaxSLayersInLayerSetMinus1(lsIdx); t++)
+
+      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 j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++)
           {
             for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
@@ -3914,10 +3845,13 @@
               {
                 Int numBits = 1;
-                while ((1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams()))
+
+                while( (1 << numBits) < (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams()) )
                 {
                   numBits++;
                 }
+
                 READ_CODE(numBits, 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);
             }
@@ -3932,6 +3866,5 @@
   }
 }
-#endif
-#endif
+#endif //SVC_EXTENSION
 //! \}
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1185)
@@ -138,7 +138,5 @@
   Void  parseVpsDpbSizeTable( TComVPS *vps );
 #endif
-#if VPS_VUI_BSP_HRD_PARAMS
   Void  parseVpsVuiBspHrdParams( TComVPS *vps );
-#endif
   Void  parseSPSExtension    ( TComSPS* pcSPS );
 #if Q0048_CGS_3D_ASYMLUT
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1185)
@@ -55,14 +55,10 @@
 
 #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
+#if SVC_EXTENSION
   SEIScalableNesting nestingSei;
   SEIBspNesting      bspNestingSei;
@@ -87,5 +83,5 @@
     xWriteSEIDecodedPictureHash(*static_cast<const SEIDecodedPictureHash*>(&sei));
     break;
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   case SEI::DECODING_UNIT_INFO:
     xWriteSEIDecodingUnitInfo(*static_cast<const SEIDecodingUnitInfo*>(& sei), sps, nestingSeiPtr, bspNestingSeiPtr, vps);
@@ -236,9 +232,5 @@
 #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);
@@ -279,9 +271,5 @@
 
 #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);
@@ -352,11 +340,7 @@
 }
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
 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
@@ -406,5 +390,8 @@
     WRITE_CODE(sei.m_picSptDpbOutputDuDelay, hrd->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
   }
+}
 #else
+Void SEIWriter::xWriteSEIDecodingUnitInfo(const SEIDecodingUnitInfo& sei, TComSPS *sps)
+{
   TComVUI *vui = sps->getVuiParameters();
   WRITE_UVLC(sei.m_decodingUnitIdx, "decoding_unit_idx");
@@ -418,8 +405,8 @@
     WRITE_CODE(sei.m_picSptDpbOutputDuDelay, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, "pic_spt_dpb_output_du_delay");
   }
-#endif
-}
-
-#if VPS_VUI_BSP_HRD_PARAMS
+}
+#endif
+
+#if SVC_EXTENSION
 Void SEIWriter::xWriteSEIBufferingPeriod(const SEIBufferingPeriod& sei, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
 #else
@@ -428,5 +415,5 @@
 {
   Int i, nalOrVcl;
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   TComHRD *hrd;
   if( bspNestingSei )   // If BP SEI contained inside a BSP nesting SEI message
@@ -506,5 +493,6 @@
 #endif
 }
-#if VPS_VUI_BSP_HRD_PARAMS
+
+#if SVC_EXTENSION
 Void SEIWriter::xWriteSEIPictureTiming(const SEIPictureTiming& sei,  TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps)
 #else
@@ -513,5 +501,5 @@
 {
   Int i;
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   TComHRD *hrd;    
   TComVUI *vui = sps->getVuiParameters(); 
@@ -1165,5 +1153,5 @@
   assert(vps->getVpsVuiPresentFlag());
 
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx;
   Int seiOlsIdx = bspNestingSei.m_seiOlsIdx;
Index: /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 1185)
@@ -58,9 +58,5 @@
 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);
@@ -69,5 +65,5 @@
   Void xWriteSEIActiveParameterSets(const SEIActiveParameterSets& sei);
   Void xWriteSEIDecodedPictureHash(const SEIDecodedPictureHash& sei);
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   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);
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1185)
@@ -2496,60 +2496,19 @@
 
 #if O0164_MULTI_LAYER_HRD
-    WRITE_FLAG(vps->getVpsVuiBspHrdPresentFlag(), "vps_vui_bsp_hrd_present_flag" );
-    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++ )
-      {
-        if( i > 0 )
-        {
-          WRITE_FLAG( vps->getBspCprmsPresentFlag(i), "bsp_cprms_present_flag[i]" );
-        }
-        codeHrdParameters(vps->getBspHrd(i), i==0 ? 1 : vps->getBspCprmsPresentFlag(i), vps->getMaxTLayers()-1);
-      }
-      for( UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++ )
-      {
-        WRITE_UVLC( vps->getNumBitstreamPartitions(h), "num_bitstream_partitions[i]");
-        for( i = 0; i < vps->getNumBitstreamPartitions(h); i++ )
-        {
-          for( j = 0; j <= (vps->getMaxLayers()-1); j++ )
-          {
-            if (vps->getLayerIdIncludedFlag(h, j))
-            {
-              WRITE_FLAG( vps->getLayerInBspFlag(h, i, j), "layer_in_bsp_flag[h][i][j]" );
-            }
-          }
-        }
-        if (vps->getNumBitstreamPartitions(h))
-        {
-#if Q0182_MULTI_LAYER_HRD_UPDATE
-          WRITE_UVLC(vps->getNumBspSchedCombinations(h) - 1, "num_bsp_sched_combinations_minus1[h]");
-#else
-          WRITE_UVLC( vps->getNumBspSchedCombinations(h), "num_bsp_sched_combinations[h]");
-#endif
-          for( i = 0; i < vps->getNumBspSchedCombinations(h); i++ )
-          {
-            for( j = 0; j < vps->getNumBitstreamPartitions(h); j++ )
-            {
-              WRITE_UVLC( vps->getBspCombHrdIdx(h, i, j), "bsp_comb_hrd_idx[h][i][j]");
-              WRITE_UVLC( vps->getBspCombSchedIdx(h, i, j), "bsp_comb_sched_idx[h][i][j]");
-            }
-          }
-        }
-      }
-#endif
-    }
-#endif
-
-    for( i = 1; i < vps->getMaxLayers(); i++ )
-    {
-      if( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0 ) 
-      {
-        WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" );
-      }
-    }
+  WRITE_FLAG(vps->getVpsVuiBspHrdPresentFlag(), "vps_vui_bsp_hrd_present_flag" );
+
+  if( vps->getVpsVuiBspHrdPresentFlag() )
+  {
+    codeVpsVuiBspHrdParams(vps);
+  }
+#endif
+
+  for( i = 1; i < vps->getMaxLayers(); i++ )
+  {
+    if( vps->getNumRefLayers(vps->getLayerIdInNuh(i)) == 0 ) 
+    {
+      WRITE_FLAG(vps->getBaseLayerPSCompatibilityFlag(i), "base_layer_parameter_set_compatibility_flag" );
+    }
+  }
 }
 
@@ -2561,5 +2520,4 @@
   WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
 }
-#endif //SVC_EXTENSION
 
 #if Q0048_CGS_3D_ASYMLUT
@@ -2791,8 +2749,10 @@
 }
 #endif
-#if VPS_VUI_BSP_HRD_PARAMS
+#endif
+
 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()
   {
@@ -2801,5 +2761,7 @@
       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));
   }
@@ -2810,4 +2772,5 @@
     {
       Int lsIdx = vps->getOutputLayerSetIdx( h );
+
       WRITE_UVLC( vps->getNumSignalledPartitioningSchemes(h), "num_signalled_partitioning_schemes[h]");
 
@@ -2815,4 +2778,5 @@
       {
         WRITE_UVLC( vps->getNumPartitionsInSchemeMinus1(h, j), "num_partitions_in_scheme_minus1[h][j]" );
+
         for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, j); k++ )
         {
@@ -2832,7 +2796,7 @@
           for( Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++ )
           {
-            for (Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++)
+            for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
             {
-              if (vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1)
+              if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1 )
               {
                 Int numBits = 1;
@@ -2841,6 +2805,8 @@
                   numBits++;
                 }
+
                 WRITE_CODE(vps->getBspHrdIdx(h, i, t, j, k), numBits, "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]");
             }
@@ -2851,5 +2817,5 @@
   }
 }
-#endif
-#endif
+
+#endif //SVC_EXTENSION
 //! \}
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1185)
@@ -166,7 +166,5 @@
   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 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1185)
@@ -2448,21 +2448,16 @@
       {
         Int j;
-#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 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++)
+            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);
@@ -2473,15 +2468,16 @@
                 + 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++)
+
+              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
@@ -4958,9 +4954,5 @@
 
 #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();
@@ -4975,10 +4967,6 @@
   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
@@ -5026,9 +5014,7 @@
   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 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1185)
@@ -282,9 +282,5 @@
 #endif
 #if O0164_MULTI_LAYER_HRD
-#if VPS_VUI_BSP_HRD_PARAMS
   SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice, Int olsIdx, Int partitioningSchemeIdx, Int bspIdx);
-#else
-  SEIScalableNesting* xCreateBspNestingSEI(TComSlice *pcSlice);
-#endif
 #endif
 #if P0123_ALPHA_CHANNEL_SEI
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1184)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1185)
@@ -240,5 +240,5 @@
 
   // set the VPS profile information
-#if VPS_VUI_BSP_HRD_PARAMS
+#if SVC_EXTENSION
   m_cVPS.getTimingInfo()->setTimingInfoPresentFlag       ( true );
 #else
