Index: /branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 601)
+++ /branches/SHM-5.1-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 602)
@@ -1327,6 +1327,13 @@
 #endif
 
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+  for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++)
+  {
+    vps->setAltOuputLayerFlag( k, m_altOutputLayerFlag );
+  }
+#else
 #if O0153_ALT_OUTPUT_LAYER_FLAG
   vps->setAltOuputLayerFlag( m_altOutputLayerFlag );
+#endif
 #endif
 
Index: /branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 601)
+++ /branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 602)
@@ -624,6 +624,10 @@
   Int         m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
 #endif
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+  Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1];
+#else
 #if O0153_ALT_OUTPUT_LAYER_FLAG
   Bool       m_altOutputLayerFlag;
+#endif
 #endif
 #if REPN_FORMAT_IN_VPS
@@ -975,7 +979,12 @@
   Void setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
 #endif
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+  Bool   getAltOuputLayerFlag(Int idx)         { return m_altOutputLayerFlag[idx]; }
+  Void   setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x;    }
+#else
 #if O0153_ALT_OUTPUT_LAYER_FLAG
   Bool   getAltOuputLayerFlag()             { return m_altOutputLayerFlag; }
   Void   setAltOuputLayerFlag(Bool x)       { m_altOutputLayerFlag = x;    }
+#endif
 #endif
 #if REPN_FORMAT_IN_VPS
Index: /branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 601)
+++ /branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 602)
@@ -216,4 +216,5 @@
 
 #define O0153_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-O0153: alt output layer flag
+#define P0300_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-P0300: alt output layer flag
 
 #define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
Index: /branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 601)
+++ /branches/SHM-5.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 602)
@@ -970,4 +970,8 @@
   UInt uiCode;
   // ... More syntax elements to be parsed here
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+  Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1];
+  Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1];
+#endif
 #if VPS_EXTN_MASK_AND_DIM_INFO
   UInt numScalabilityTypes = 0, i = 0, j = 0;
@@ -1269,4 +1273,21 @@
     }
     READ_CODE( numBits, uiCode, "profile_level_tier_idx[i]" );     vps->setProfileLevelTierIdx(i, uiCode);
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+    NumOutputLayersInOutputLayerSet[i] = 0;
+    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
+    for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++)
+    {
+      NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j);
+      if (vps->getOutputLayerFlag(i, j))
+      {
+        OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j);
+      }
+    }
+    if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0)
+    {
+      READ_FLAG(uiCode, "alt_output_layer_flag[i]");
+      vps->setAltOuputLayerFlag(i, uiCode ? true : false);
+    }
+#endif
   }
 #else
@@ -1354,4 +1375,5 @@
 #endif
 
+#if !P0300_ALT_OUTPUT_LAYER_FLAG
 #if O0153_ALT_OUTPUT_LAYER_FLAG
   if( vps->getMaxLayers() > 1 )
@@ -1360,4 +1382,5 @@
     vps->setAltOuputLayerFlag( uiCode ? true : false );
   }
+#endif
 #endif
 
Index: /branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 601)
+++ /branches/SHM-5.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 602)
@@ -776,4 +776,8 @@
 {
   // ... More syntax elements to be written here
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+  Int NumOutputLayersInOutputLayerSet[MAX_VPS_LAYER_SETS_PLUS1];
+  Int OlsHighestOutputLayerId[MAX_VPS_LAYER_SETS_PLUS1];
+#endif
 #if VPS_EXTN_MASK_AND_DIM_INFO
   UInt i = 0, j = 0;
@@ -1004,6 +1008,23 @@
     }
     WRITE_CODE( vps->getProfileLevelTierIdx(i), numBits, "profile_level_tier_idx[i]" );     
-  }
-
+#if P0300_ALT_OUTPUT_LAYER_FLAG
+    NumOutputLayersInOutputLayerSet[i] = 0;
+    Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
+    for (j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet); j++)
+    {
+      NumOutputLayersInOutputLayerSet[i] += vps->getOutputLayerFlag(i, j);
+      if (vps->getOutputLayerFlag(i, j))
+      {
+        OlsHighestOutputLayerId[i] = vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, j);
+      }
+    }
+    if (NumOutputLayersInOutputLayerSet[i] == 1 && vps->getNumDirectRefLayers(OlsHighestOutputLayerId[i]) > 0)
+    {
+      WRITE_FLAG(vps->getAltOuputLayerFlag(i), "alt_output_layer_flag[i]");
+    }
+#endif
+  }
+
+#if !P0300_ALT_OUTPUT_LAYER_FLAG
 #if O0153_ALT_OUTPUT_LAYER_FLAG
   if( vps->getMaxLayers() > 1 )
@@ -1011,4 +1032,5 @@
     WRITE_FLAG( vps->getAltOuputLayerFlag(), "alt_output_layer_flag" );   
   }
+#endif
 #endif
 
