Index: /branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 555)
+++ /branches/SHM-5.0-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 556)
@@ -1657,5 +1657,5 @@
       {
         OutputNALUnit nalu(NAL_UNIT_EOB);
-        nalu.m_layerId = 1;
+        nalu.m_layerId = 0;
 
         AccessUnit& accessUnit = outputAccessUnits.back();
Index: /branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 555)
+++ /branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 556)
@@ -2058,6 +2058,11 @@
 #endif
 #endif
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
 , m_vpsVuiOffset (0)
+#endif
+#endif
+#if P0307_VPS_NON_VUI_EXTENSION
+, m_vpsNonVuiExtLength (0)
 #endif
 {
Index: /branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 555)
+++ /branches/SHM-5.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 556)
@@ -658,6 +658,11 @@
 
 #endif //SVC_EXTENSION
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
   Int     m_vpsVuiOffset;
+#endif
+#endif
+#if P0307_VPS_NON_VUI_EXTENSION
+  Int     m_vpsNonVuiExtLength;
 #endif
 public:
@@ -1021,7 +1026,13 @@
 #endif
 
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
   Int     getVpsVuiOffset()         { return m_vpsVuiOffset; }
   Void    setVpsVuiOffset(Int x)    { m_vpsVuiOffset = x; }
+#endif
+#endif
+#if P0307_VPS_NON_VUI_EXTENSION
+  Int     getVpsNonVuiExtLength()         { return m_vpsNonVuiExtLength; }
+  Void    setVpsNonVuiExtLength(Int x)    { m_vpsNonVuiExtLength = x; }
 #endif
 #endif //SVC_EXTENSION
Index: /branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 555)
+++ /branches/SHM-5.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 556)
@@ -52,4 +52,6 @@
 
 #define P0130_EOB                        1      ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0
+#define P0307_REMOVE_VPS_VUI_OFFSET      1      ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling
+#define P0307_VPS_NON_VUI_EXTENSION      1      ///< JCTVC-P0307, implementation related to NON VUI VPS Extension signalling
 
 #define O0109_O0199_FLAGS_TO_VUI         1      ///< JCTVC-O0109, O0199: move single_layer_for_non_irap_flag and higher_layer_flag to vps_vui
Index: /branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 555)
+++ /branches/SHM-5.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 556)
@@ -995,4 +995,5 @@
   READ_FLAG( uiCode, "avc_base_layer_flag" ); vps->setAvcBaseLayerFlag(uiCode ? true : false);
 
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if O0109_MOVE_VPS_VUI_FLAG
   READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
@@ -1005,4 +1006,5 @@
 #if O0109_MOVE_VPS_VUI_FLAG
   }
+#endif
 #endif
   READ_FLAG( uiCode, "splitting_flag" ); vps->setSplittingFlag(uiCode ? true : false);
@@ -1475,4 +1477,12 @@
 #endif
 
+#if P0307_VPS_NON_VUI_EXTENSION
+  READ_UVLC( uiCode,           "vps_non_vui_extension_length"); vps->setVpsNonVuiExtLength((Int)uiCode);
+  if ( vps->getVpsNonVuiExtLength() > 0 )
+  {
+    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
+  }
+#endif
+
 #if !O0109_O0199_FLAGS_TO_VUI
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
@@ -1482,4 +1492,8 @@
   READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
 #endif
+#endif
+
+#if P0307_REMOVE_VPS_VUI_OFFSET
+  READ_FLAG( uiCode, "vps_vui_present_flag"); vps->setVpsVuiPresentFlag(uiCode ? true : false);
 #endif
 
Index: /branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 555)
+++ /branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 556)
@@ -669,6 +669,8 @@
   UInt numBytesInVps = this->m_pcBitIf->getNumberOfWrittenBits();
 #endif
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
    m_vpsVuiCounter = this->m_pcBitIf->getNumberOfWrittenBits();
+#endif
 #endif
   WRITE_CODE( pcVPS->getVPSId(),                    4,        "vps_video_parameter_set_id" );
@@ -798,4 +800,5 @@
 
   WRITE_FLAG( vps->getAvcBaseLayerFlag(),              "avc_base_layer_flag" );
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if O0109_MOVE_VPS_VUI_FLAG
 #if !VPS_VUI
@@ -819,4 +822,6 @@
   WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
 #endif // O0109_MOVE_VPS_VUI_FLAG
+#endif
+  WRITE_FLAG( vps->getSplittingFlag(),                 "splitting_flag" );
 
   for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
@@ -1128,4 +1133,12 @@
 #endif
 
+#if P0307_VPS_NON_VUI_EXTENSION
+  WRITE_UVLC( vps->getVpsNonVuiExtLength(), "vps_non_vui_extension_length" );
+  if ( vps->getVpsNonVuiExtLength() > 0 )
+  {
+    printf("\n\nUp to the current spec, the value of vps_non_vui_extension_length is supposed to be 0\n");
+  }
+#endif
+
 #if !O0109_MOVE_VPS_VUI_FLAG
 #if !VPS_VUI
@@ -1148,4 +1161,8 @@
 #endif 
 #else
+#if P0307_REMOVE_VPS_VUI_OFFSET
+  WRITE_FLAG( 1,                     "vps_vui_present_flag" );
+  vps->setVpsVuiPresentFlag(true);
+#endif
   if(vps->getVpsVuiPresentFlag())   // Should be conditioned on the value of vps_vui_present_flag
   {
@@ -1154,8 +1171,10 @@
       WRITE_FLAG(1,                  "vps_vui_alignment_bit_equal_to_one");
     }
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
     Int vpsVuiOffsetValeInBits = this->m_pcBitIf->getNumberOfWrittenBits() - m_vpsVuiCounter + 16; // 2 bytes for NUH
     assert( vpsVuiOffsetValeInBits % 8 == 0 );
     vps->setVpsVuiOffset( vpsVuiOffsetValeInBits >> 3 );
+#endif
 #endif
     codeVPSVUI(vps);  
Index: /branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- /branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 555)
+++ /branches/SHM-5.0-dev/source/Lib/TLibEncoder/TEncCavlc.h	(revision 556)
@@ -68,6 +68,8 @@
   TComSlice*    m_pcSlice;
   UInt          m_uiCoeffCost;
+#if !P0307_REMOVE_VPS_VUI_OFFSET
 #if VPS_VUI_OFFSET
   Int m_vpsVuiCounter;
+#endif
 #endif
   Void codeShortTermRefPicSet              ( TComSPS* pcSPS, TComReferencePictureSet* pcRPS, Bool calledFromSliceHeader, Int idx );
