Index: branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 529)
+++ branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 530)
@@ -615,6 +615,9 @@
   ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction")
 #endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  ("CrossLayerPictureTypeAlignFlag", m_crossLayerPictureTypeAlignFlag, true, "align picture type across layers" )  
+#endif
 #if N0147_IRAP_ALIGN_FLAG
-  ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" )  
+    ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" )  
 #endif
 #if AVC_BASE
@@ -2443,4 +2446,7 @@
   printf("Skip picture at ARC switch    : %d\n", m_skipPictureAtArcSwitch );
 #endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  printf("Cross layer picture type alignment    : %d\n", m_crossLayerPictureTypeAlignFlag );
+#endif
 #if N0147_IRAP_ALIGN_FLAG
   printf("Cross layer IRAP alignment    : %d\n", m_crossLayerIrapAlignFlag );
Index: branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 529)
+++ branches/SHM-4.1-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 530)
@@ -394,4 +394,7 @@
   Bool m_phaseAlignFlag;
 #endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  Bool m_crossLayerPictureTypeAlignFlag;
+#endif
 #if N0147_IRAP_ALIGN_FLAG
   Bool m_crossLayerIrapAlignFlag;
Index: branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 529)
+++ branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 530)
@@ -2092,4 +2092,7 @@
   ::memset(m_pocLsbNotPresentFlag, 0, sizeof(m_pocLsbNotPresentFlag));
 #endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  m_crossLayerPictureTypeAlignFlag = true;
+#endif 
 #if N0147_IRAP_ALIGN_FLAG
   m_crossLayerIrapAlignFlag = true;
@@ -2111,7 +2114,16 @@
   }
 #endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+   m_tilesNotInUseFlag = true;
+   ::memset(m_tilesInUseFlag,  0, sizeof(m_tilesInUseFlag));
+   ::memset(m_loopFilterNotAcrossTilesFlag,  0, sizeof(m_loopFilterNotAcrossTilesFlag));
+#endif
 #if TILE_BOUNDARY_ALIGNED_FLAG
    ::memset(m_tileBoundariesAlignedFlag,  0, sizeof(m_tileBoundariesAlignedFlag));
 #endif 
+#if VPS_VUI_WPP_NOT_IN_USE__FLAG
+   m_wppNotInUseFlag = true;
+   ::memset(m_wppInUseFlag,  0, sizeof(m_wppInUseFlag));
+#endif
 #if N0160_VUI_EXT_ILP_REF
    m_numIlpRestrictedRefLayers = false;
@@ -2231,5 +2243,42 @@
 }
 #endif
-
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+Void TComVPS::setTilesNotInUseFlag(Bool x)
+{
+  m_tilesNotInUseFlag = x;
+  if (m_tilesNotInUseFlag)
+  {
+    for (int i = 0; i < getMaxLayers(); i++)
+    {
+      m_tilesInUseFlag[i] = m_loopFilterNotAcrossTilesFlag[i] = m_tilesNotInUseFlag;
+    }
+  }
+#if TILE_BOUNDARY_ALIGNED_FLAG  
+  if (m_tilesNotInUseFlag)
+  {
+    for (int i = 1; i < getMaxLayers(); i++)
+    {
+      for(int j = 0; j < getNumDirectRefLayers(getLayerIdInNuh(i)); j++)
+      {
+        setTileBoundariesAlignedFlag(i, j, m_tilesNotInUseFlag);
+      }
+    }
+  }
+#endif
+}
+#endif
+#if VPS_VUI_WPP_NOT_IN_USE__FLAG
+Void TComVPS::setWppNotInUseFlag(Bool x)
+{
+  m_wppNotInUseFlag = x;
+  if (m_wppNotInUseFlag)
+  {
+    for (int i = 0; i < getMaxLayers(); i++)
+    {
+      m_wppInUseFlag[i] = m_wppNotInUseFlag;
+    }
+  }
+}
+#endif
 #if O0092_0094_DEPENDENCY_CONSTRAINT
 Void TComVPS::setRefLayersFlags(Int currLayerId)
Index: branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 529)
+++ branches/SHM-4.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 530)
@@ -548,4 +548,7 @@
   Bool       m_pocLsbNotPresentFlag[MAX_VPS_LAYER_ID_PLUS1];
 #endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  Bool       m_crossLayerPictureTypeAlignFlag;
+#endif
 #if N0147_IRAP_ALIGN_FLAG
   Bool       m_crossLayerIrapAlignFlag;
@@ -571,6 +574,15 @@
   Bool       m_higherLayerIrapSkipFlag;
 #endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+  Bool       m_tilesNotInUseFlag;
+  Bool       m_tilesInUseFlag[MAX_VPS_LAYER_ID_PLUS1];
+  Bool       m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_ID_PLUS1];
+#endif 
 #if TILE_BOUNDARY_ALIGNED_FLAG
   Bool       m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
+#endif 
+#if VPS_VUI_WPP_NOT_IN_USE__FLAG
+  Bool       m_wppNotInUseFlag;
+  Bool       m_wppInUseFlag[MAX_VPS_LAYER_ID_PLUS1];
 #endif 
 #if N0160_VUI_EXT_ILP_REF    
@@ -812,4 +824,8 @@
   Void   setPocLsbNotPresentFlag(Int i, Bool x)                                 { m_pocLsbNotPresentFlag[i] = x;    }
 #endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  Bool   getCrossLayerPictureTypeAlignFlag()                                    { return m_crossLayerPictureTypeAlignFlag;                      }
+  Void   setCrossLayerPictureTypeAlignFlag(Bool x)                              { m_crossLayerPictureTypeAlignFlag = x;                         }
+#endif 
 #if N0147_IRAP_ALIGN_FLAG
   Bool   getCrossLayerIrapAlignFlag()                                           { return m_crossLayerIrapAlignFlag;                      }
@@ -843,7 +859,21 @@
   Void   setHigherLayerIrapSkipFlag(Bool x)                       { m_higherLayerIrapSkipFlag = x;    }
 #endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG  
+  Bool   getTilesNotInUseFlag()         { return m_tilesNotInUseFlag; }
+  Void   setTilesNotInUseFlag(Bool x); 
+  Bool   getTilesInUseFlag(Int currLayerId)    { return m_tilesInUseFlag[currLayerId]; }
+  Void   setTilesInUseFlag(Int currLayerId, Bool x)    { m_tilesInUseFlag[currLayerId] = x; } 
+  Bool   getLoopFilterNotAcrossTilesFlag(Int currLayerId)    { return m_loopFilterNotAcrossTilesFlag[currLayerId]; }
+  Void   setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x)    { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } 
+#endif 
 #if TILE_BOUNDARY_ALIGNED_FLAG  
   Bool   getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId)           { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; }
   Void   setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x)   { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } 
+#endif 
+#if VPS_VUI_WPP_NOT_IN_USE__FLAG  
+  Bool   getWppNotInUseFlag()         { return m_wppNotInUseFlag; }
+  Void   setWppNotInUseFlag(Bool x); 
+  Bool   getWppInUseFlag(Int currLayerId)    { return m_wppInUseFlag[currLayerId]; }
+  Void   setWppInUseFlag(Int currLayerId, Bool x)    { m_wppInUseFlag[currLayerId] = x; } 
 #endif 
 #if N0160_VUI_EXT_ILP_REF  
Index: branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 529)
+++ branches/SHM-4.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 530)
@@ -96,4 +96,6 @@
 
 #if VPS_VUI
+#define VPS_VUI_TILES_NOT_IN_USE__FLAG    1      ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use
+#define VPS_VUI_WPP_NOT_IN_USE__FLAG    1      ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use
 #define TILE_BOUNDARY_ALIGNED_FLAG       1      ///< JCTVC-N0160/JCTVC-N0199 proposal 2 variant 2: VPS VUI flag to indicate tile boundary alignment
 #define N0160_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
@@ -157,4 +159,6 @@
 #define M0457_IL_SAMPLE_PRED_ONLY_FLAG   0      ///< shall be 0, JCTVC-N0107
 #endif
+
+#define O0223_PICTURE_TYPES_ALIGN_FLAG   1  ///< a flag to indicatate whether picture types are aligned across layers.
 
 #define N0147_IRAP_ALIGN_FLAG            1      ///< a flag to indicatate whether IRAPs are aligned across layers
Index: branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 529)
+++ branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 530)
@@ -1479,7 +1479,20 @@
   UInt i,j;
   UInt uiCode;
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  READ_FLAG(uiCode, "cross_layer_pic_type_aligned_flag" );
+  vps->setCrossLayerPictureTypeAlignFlag(uiCode);
+  if (!uiCode) 
+  {
+#endif
 #if IRAP_ALIGN_FLAG_IN_VPS_VUI
-  READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" );
-  vps->setCrossLayerIrapAlignFlag(uiCode);
+    READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" );
+    vps->setCrossLayerIrapAlignFlag(uiCode);
+#endif
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  }
+  else
+  {
+    vps->setCrossLayerIrapAlignFlag(true);
+  }
 #endif
 #if VPS_VUI_BITRATE_PICRATE
@@ -1533,10 +1546,48 @@
   }
 #endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+  UInt layerIdx;
+  READ_FLAG( uiCode, "tiles_not_in_use_flag" ); vps->setTilesNotInUseFlag(uiCode == 1);
+  if (!uiCode)
+  {
+    for(i = 0; i < vps->getMaxLayers(); i++)
+    {
+      READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1));
+      if (uiCode)
+      {
+        READ_FLAG( uiCode, "loop_filter_not_across_tiles_flag[ i ]" ); vps->setLoopFilterNotAcrossTilesFlag(i, (uiCode == 1));
+      }
+      else
+      {
+        vps->setLoopFilterNotAcrossTilesFlag(i, false);
+      }
+    }
+#endif
 #if TILE_BOUNDARY_ALIGNED_FLAG
-  for(i = 1; i < vps->getMaxLayers(); i++)
-  {
-    for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
-    {
-      READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1));
+    for(i = 1; i < vps->getMaxLayers(); i++)
+    {
+      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
+      {
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+        layerIdx = vps->getLayerIdInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j));
+        if (vps->getTilesInUseFlag(i) && vps->getTilesInUseFlag(layerIdx)) {
+          READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1));
+        }
+#else
+        READ_FLAG( uiCode, "tile_boundaries_aligned_flag[i][j]" ); vps->setTileBoundariesAlignedFlag(i,j,(uiCode == 1));
+#endif
+      }
+    }
+#endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+  }
+#endif
+#if VPS_VUI_WPP_NOT_IN_USE__FLAG
+  READ_FLAG( uiCode, "wpp_not_in_use_flag" ); vps->setWppNotInUseFlag(uiCode == 1);
+  if (!uiCode)
+  {
+    for(i = 0; i < vps->getMaxLayers(); i++)
+    {
+      READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1));
     }
   }
Index: branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 529)
+++ branches/SHM-4.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 530)
@@ -1148,7 +1148,15 @@
 {
   Int i,j;
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  WRITE_FLAG(vps->getCrossLayerPictureTypeAlignFlag(), "cross_layer_pic_type_aligned_flag");
+  if (!vps->getCrossLayerPictureTypeAlignFlag())
+  {
+#endif 
 #if IRAP_ALIGN_FLAG_IN_VPS_VUI
-      WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
+    WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
 #endif 
+#if O0223_PICTURE_TYPES_ALIGN_FLAG
+  }
+#endif
 #if VPS_VUI_BITRATE_PICRATE
   WRITE_FLAG( vps->getBitRatePresentVpsFlag(),        "bit_rate_present_vps_flag" );
@@ -1183,13 +1191,47 @@
   }
 #endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+  UInt layerIdx;
+  WRITE_FLAG( vps->getTilesNotInUseFlag() ? 1 : 0 , "tiles_not_in_use_flag" );
+  if (!vps->getTilesNotInUseFlag())
+  {
+    for(i = 0; i < vps->getMaxLayers(); i++)
+    {
+      WRITE_FLAG( vps->getTilesInUseFlag(i) ? 1 : 0 , "tiles_in_use_flag[ i ]" );
+      if (vps->getTilesInUseFlag(i))
+      {
+        WRITE_FLAG( vps->getLoopFilterNotAcrossTilesFlag(i) ? 1 : 0 , "loop_filter_not_across_tiles_flag[ i ]" );
+      }
+    }
+#endif
 #if TILE_BOUNDARY_ALIGNED_FLAG
-  for(i = 1; i < vps->getMaxLayers(); i++)
-  {
-    for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
-    {
-      WRITE_FLAG( vps->getTileBoundariesAlignedFlag(i,j) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" );
-    }
-  }  
-#endif 
+    for(i = 1; i < vps->getMaxLayers(); i++)
+    {
+      for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
+      {
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+        layerIdx = vps->getLayerIdInVps(vps->getRefLayerId(vps->getLayerIdInNuh(i), j));
+        if (vps->getTilesInUseFlag(i) && vps->getTilesInUseFlag(layerIdx)) {
+          WRITE_FLAG( vps->getTileBoundariesAlignedFlag(i,j) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" );
+        }
+#else
+        WRITE_FLAG( vps->getTileBoundariesAlignedFlag(i,j) ? 1 : 0 , "tile_boundaries_aligned_flag[i][j]" );
+#endif
+      }
+    }  
+#endif
+#if VPS_VUI_TILES_NOT_IN_USE__FLAG
+  }
+#endif
+#if VPS_VUI_WPP_NOT_IN_USE__FLAG
+  WRITE_FLAG( vps->getWppNotInUseFlag() ? 1 : 0 , "wpp_not_in_use_flag" );
+  if (!vps->getWppNotInUseFlag())
+  {
+    for(i = 0; i < vps->getMaxLayers(); i++)
+    {
+      WRITE_FLAG( vps->getWppInUseFlag(i) ? 1 : 0 , "wpp_in_use_flag[ i ]" );
+    }
+  }
+#endif
 #if N0160_VUI_EXT_ILP_REF
   WRITE_FLAG( vps->getNumIlpRestrictedRefLayers() ? 1 : 0 , "num_ilp_restricted_ref_layers" );    
