Index: branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 612)
+++ branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 613)
@@ -654,4 +654,7 @@
   Bool       m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
 #endif
+#if SPS_DPB_PARAMS
+    Int         m_TolsIdx;
+#endif
 #if VPS_DPB_SIZE_TABLE
   Bool    m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];
@@ -745,4 +748,9 @@
   TComPTL* getPTL() { return &m_pcPTL; }
   TimingInfo* getTimingInfo() { return &m_timingInfo; }
+
+#if SPS_DPB_PARAMS
+    Int       getTolsIdx  ()             { return m_TolsIdx;   }
+    Void      setTolsIdx  ( Int value  ) { m_TolsIdx = value;  }
+#endif
 
 #if SVC_EXTENSION
Index: branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 612)
+++ branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 613)
@@ -228,4 +228,5 @@
 #endif
 #endif
+#define SPS_DPB_PARAMS                   1      ///< JCTVC-P0155 signaling & inferrence for sps dpb parameters for nuh_layer_id > 0
 
 #define NO_CLRAS_OUTPUT_FLAG             1
Index: branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 612)
+++ branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 613)
@@ -644,5 +644,8 @@
   assert(uiCode <= 12);
 
-  UInt subLayerOrderingInfoPresentFlag;
+#if SPS_DPB_PARAMS
+    if( pcSPS->getLayerId() == 0 )  {
+#endif
+    UInt subLayerOrderingInfoPresentFlag;
   READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
 
@@ -667,5 +670,14 @@
     }
   }
-
+#if SPS_DPB_PARAMS
+    }
+    else
+    {
+        for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
+        {
+            pcSPS->setMaxDecPicBuffering( parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getMaxVpsDecPicBufferingMinus1(  parameterSetManager->getPrefetchedVPS(pcSPS->getVPSId())->getTolsIdx(), pcSPS->getLayerId(), i)+1, i);
+        }
+    }
+#endif
   READ_UVLC( uiCode, "log2_min_coding_block_size_minus3" );
   Int log2MinCUSize = uiCode + 3;
Index: branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 612)
+++ branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 613)
@@ -315,4 +315,7 @@
 #else
     m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( getCommonDecoderParams()->getTargetOutputLayerSetIdx(), pcSlice->getLayerId(), pcSlice->getTLayer() ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded
+#endif
+#if SPS_DPB_PARAMS
+      pcSlice->getVPS()->setTolsIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx());
 #endif
   }
Index: branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 612)
+++ branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 613)
@@ -496,4 +496,7 @@
   WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
 
+#if SPS_DPB_PARAMS
+    if( pcSPS->getLayerId() == 0 )  {
+#endif
   const Bool subLayerOrderingInfoPresentFlag = 1;
   WRITE_FLAG(subLayerOrderingInfoPresentFlag,       "sps_sub_layer_ordering_info_present_flag");
@@ -508,4 +511,7 @@
     }
   }
+#if SPS_DPB_PARAMS
+    }
+#endif
   assert( pcSPS->getMaxCUWidth() == pcSPS->getMaxCUHeight() );
   
