Index: branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 577)
+++ branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 578)
@@ -1447,37 +1447,7 @@
 
 #if VPS_DPB_SIZE_TABLE
-  vps->deriveNumberOfSubDpbs();
-  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
-  {
-    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
-    for(j = 0; j < vps->getMaxTLayers(); j++)
-    {
-      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
-      {
-        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
-      }
-      else
-      {
-        if( j == 0 )  // Always signal for the first sub-layer
-        {
-          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
-        }
-        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
-        {
-          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
-        }
-      }
-      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
-      {
-        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
-        {
-          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
-        }
-        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
-        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
-      }
-    }
-  }
-#endif
+  parseVpsDpbSizeTable(vps);
+#endif
+
 #if VPS_EXTN_DIRECT_REF_LAYERS
   READ_UVLC( uiCode,           "direct_dep_type_len_minus2"); vps->setDirectDepTypeLen(uiCode+2);
@@ -1611,4 +1581,42 @@
   READ_CODE( 4, uiCode, "bit_depth_chroma_minus8" );         repFormat->setBitDepthVpsChroma( uiCode + 8 );
 #endif 
+}
+#endif
+#if VPS_DPB_SIZE_TABLE
+Void TDecCavlc::parseVpsDpbSizeTable( TComVPS *vps )
+{
+  UInt uiCode;
+  vps->deriveNumberOfSubDpbs();
+  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
+  {
+    READ_FLAG( uiCode, "sub_layer_flag_info_present_flag[i]");  vps->setSubLayerFlagInfoPresentFlag( i, uiCode ? true : false );
+    for(Int j = 0; j < vps->getMaxTLayers(); j++)
+    {
+      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
+      {
+        READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag[i]");  vps->setSubLayerDpbInfoPresentFlag( i, j, uiCode ? true : false);
+      }
+      else
+      {
+        if( j == 0 )  // Always signal for the first sub-layer
+        {
+          vps->setSubLayerDpbInfoPresentFlag( i, j, true );
+        }
+        else // if (j != 0) && !vps->getSubLayerFlagInfoPresentFlag(i)
+        {
+          vps->setSubLayerDpbInfoPresentFlag( i, j, false );
+        }
+      }
+      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )  // If sub-layer DPB information is present
+      {
+        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
+        {
+          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
+        }
+        READ_UVLC( uiCode, "max_vps_num_reorder_pics[i][j]" );              vps->setMaxVpsNumReorderPics( i, j, uiCode);
+        READ_UVLC( uiCode, "max_vps_latency_increase_plus1[i][j]" );        vps->setMaxVpsLatencyIncreasePlus1( i, j, uiCode);
+      }
+    }
+  }
 }
 #endif
Index: branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 577)
+++ branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 578)
@@ -83,4 +83,7 @@
   Void  parseRepFormat      ( RepFormat *repFormat );
 #endif
+#if VPS_DPB_SIZE_TABLE
+  Void  parseVpsDpbSizeTable( TComVPS *vps );
+#endif
   Void  parseSPS            ( TComSPS* pcSPS, ParameterSetManagerDecoder *parameterSetManager );
   Void  parseSPSExtension    ( TComSPS* pcSPS );
Index: branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 577)
+++ branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 578)
@@ -1075,24 +1075,5 @@
 #endif 
 #if VPS_DPB_SIZE_TABLE
-  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
-  {
-    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]");  
-    for(j = 0; j < vps->getMaxTLayers(); j++)
-    {
-      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
-      {
-        WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]");  
-      }
-      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
-      {
-        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
-        {
-          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" ); 
-        }
-        WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );              
-        WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );        
-      }
-    }
-  }
+  codeVpsDpbSizeTable(vps);
 #endif
 #if VPS_EXTN_DIRECT_REF_LAYERS
@@ -1230,4 +1211,29 @@
 #endif 
 
+}
+#endif
+#if VPS_DPB_SIZE_TABLE
+Void TEncCavlc::codeVpsDpbSizeTable(TComVPS *vps)
+{
+  for(Int i = 1; i < vps->getNumOutputLayerSets(); i++)
+  {
+    WRITE_FLAG( vps->getSubLayerFlagInfoPresentFlag( i ), "sub_layer_flag_info_present_flag[i]");  
+    for(Int j = 0; j < vps->getMaxTLayers(); j++)
+    {
+      if( j > 0 && vps->getSubLayerFlagInfoPresentFlag(i) )
+      {
+        WRITE_FLAG( vps->getSubLayerDpbInfoPresentFlag( i, j), "sub_layer_dpb_info_present_flag[i]");  
+      }
+      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
+      {
+        for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
+        {
+          WRITE_UVLC( vps->getMaxVpsDecPicBufferingMinus1( i, k, j), "max_vps_dec_pic_buffering_minus1[i][k][j]" ); 
+        }
+        WRITE_UVLC( vps->getMaxVpsNumReorderPics( i, j), "max_vps_num_reorder_pics[i][j]" );              
+        WRITE_UVLC( vps->getMaxVpsLatencyIncreasePlus1( i, j), "max_vps_latency_increase_plus1[i][j]" );        
+      }
+    }
+  }
 }
 #endif
Index: branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 577)
+++ branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 578)
@@ -98,4 +98,7 @@
   Void  codeRepFormat           ( RepFormat *repFormat );
 #endif
+#if VPS_DPB_SIZE_TABLE
+  Void  codeVpsDpbSizeTable      (TComVPS *vps);
+#endif
   Void  codeVUI                 ( TComVUI *pcVUI, TComSPS* pcSPS );
   Void  codeSPS                 ( TComSPS* pcSPS );
