Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1127)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1128)
@@ -1169,7 +1169,5 @@
   ("CrossLayerPictureTypeAlignFlag",                 m_crossLayerPictureTypeAlignFlag,                   true, "align picture type across layers" )  
   ("CrossLayerIrapAlignFlag",                        m_crossLayerIrapAlignFlag,                          true, "align IRAP across layers" )  
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
   ("CrossLayerAlignedIdrOnlyFlag",                   m_crossLayerAlignedIdrOnlyFlag,                     true, "only idr for IRAP across layers" )  
-#endif
 #if O0194_WEIGHTED_PREDICTION_CGS
   ("InterLayerWeightedPred",                          m_useInterLayerWeightedPred,                       false, "enable IL WP parameters estimation at encoder" )  
@@ -1694,7 +1692,5 @@
   ("LayerSwitchOffEnd%d", cfg_layerSwitchOffEnd, 0, MAX_LAYERS, "Switch layer %d on at given poc")
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   ("SkipPictureAtArcSwitch",     m_skipPictureAtArcSwitch, false, "Code the higher layer picture in ARC up-switching as a skip picture. (0: disable)")
-#endif
 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI
   ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message")
@@ -4360,5 +4356,5 @@
   }
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
+
   if (m_adaptiveResolutionChange > 0)
   {
@@ -4369,5 +4365,5 @@
     xConfirmPara(m_adaptiveResolutionChange <= 0, "Skip picture at ARC switching only works when Adaptive Resolution Change is active (AdaptiveResolutionChange > 0)");
   }
-#endif
+
   if( layerIdx < MAX_LAYERS-1 )
   {
@@ -4504,12 +4500,8 @@
   printf("Adaptive Resolution Change        : %d\n", m_adaptiveResolutionChange );
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   printf("Skip picture at ARC switch        : %d\n", m_skipPictureAtArcSwitch );
-#endif
   printf("Align picture type                : %d\n", m_crossLayerPictureTypeAlignFlag );
   printf("Cross layer IRAP alignment        : %d\n", m_crossLayerIrapAlignFlag );
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
   printf("IDR only for IRAP                 : %d\n", m_crossLayerAlignedIdrOnlyFlag );
-#endif
 #if O0194_WEIGHTED_PREDICTION_CGS
   printf("InterLayerWeightedPred            : %d\n", m_useInterLayerWeightedPred );
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1127)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1128)
@@ -476,7 +476,5 @@
   Int       m_adaptiveResolutionChange;                       ///< Indicate adaptive resolution change frame
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   Bool      m_skipPictureAtArcSwitch;                         ///< Indicates that when ARC up-switching is performed the higher layer picture is a skip picture
-#endif
 #if REPN_FORMAT_IN_VPS
   RepFormatCfg m_repFormatCfg[16];                            ///< Rep_format structures
@@ -515,7 +513,5 @@
   Bool                                m_overlayInfoPersistenceFlag;
 #endif
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
   Bool      m_crossLayerAlignedIdrOnlyFlag;
-#endif
 #if O0149_CROSS_LAYER_BLA_FLAG
   Bool      m_crossLayerBLAFlag;
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1127)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1128)
@@ -188,7 +188,5 @@
                                                                             m_acLayerCfg[mapIdxToLayer[idx]].m_confWinBottom );
 
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
     m_acTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch             ( m_skipPictureAtArcSwitch );
-#endif
   }
   delete [] mapIdxToLayer;
@@ -1755,7 +1753,5 @@
 #endif
     vps->setCrossLayerPictureTypeAlignFlag( m_crossLayerPictureTypeAlignFlag );
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
     vps->setCrossLayerAlignedIdrOnlyFlag( m_crossLayerAlignedIdrOnlyFlag );
-#endif
     vps->setCrossLayerIrapAlignFlag( m_crossLayerIrapAlignFlag );
     for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
@@ -1776,7 +1772,5 @@
   vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false);
 #endif 
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   vps->setHigherLayerIrapSkipFlag(m_skipPictureAtArcSwitch);
-#endif
 
   for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++)
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1128)
@@ -2052,7 +2052,5 @@
   m_crossLayerPictureTypeAlignFlag = true;
   m_crossLayerIrapAlignFlag = true;
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
   m_crossLayerAlignedIdrOnlyFlag = false;
-#endif
   m_maxTidRefPresentFlag = true;
   for( Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1 - 1; i++)
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1128)
@@ -699,7 +699,5 @@
   Bool       m_crossLayerPictureTypeAlignFlag;
   Bool       m_crossLayerIrapAlignFlag;
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
   Bool       m_crossLayerAlignedIdrOnlyFlag;
-#endif
   UInt       m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_IDX_PLUS1 - 1][MAX_VPS_LAYER_IDX_PLUS1];
   Bool       m_maxTidRefPresentFlag;
@@ -711,7 +709,5 @@
   Bool       m_singleLayerForNonIrapFlag;
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   Bool       m_higherLayerIrapSkipFlag;
-#endif
 #if VPS_VUI_TILES_NOT_IN_USE__FLAG
   Bool       m_tilesNotInUseFlag;
@@ -1106,22 +1102,20 @@
   Void   setProfileLevelTierIdx(Int i, Int x)                 { m_profileLevelTierIdx[i] = x   ; }
 #endif
-  Bool   getMaxOneActiveRefLayerFlag()                                          { return m_maxOneActiveRefLayerFlag;                      }
-  Void   setMaxOneActiveRefLayerFlag(Bool x)                                    { m_maxOneActiveRefLayerFlag = x;                         }
+  Bool   getMaxOneActiveRefLayerFlag()                                          { return m_maxOneActiveRefLayerFlag;             }
+  Void   setMaxOneActiveRefLayerFlag(Bool x)                                    { m_maxOneActiveRefLayerFlag = x;                }
 #if O0062_POC_LSB_NOT_PRESENT_FLAG
-  UInt   getPocLsbNotPresentFlag(Int i)                                         { return m_pocLsbNotPresentFlag[i]; }
-  Void   setPocLsbNotPresentFlag(Int i, Bool x)                                 { m_pocLsbNotPresentFlag[i] = x;    }
+  UInt   getPocLsbNotPresentFlag(Int i)                                         { return m_pocLsbNotPresentFlag[i];              }
+  Void   setPocLsbNotPresentFlag(Int i, Bool x)                                 { m_pocLsbNotPresentFlag[i] = x;                 }
 #endif
 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
-  Bool   getVpsPocLsbAlignedFlag()                                              { return m_vpsPocLsbAlignedFlag; }
-  Void   setVpsPocLsbAlignedFlag(Bool x)                                        { m_vpsPocLsbAlignedFlag = x; }
-#endif
-  Bool   getCrossLayerPictureTypeAlignFlag()                                    { return m_crossLayerPictureTypeAlignFlag;                      }
-  Void   setCrossLayerPictureTypeAlignFlag(Bool x)                              { m_crossLayerPictureTypeAlignFlag = x;                         }
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
-  Bool   getCrossLayerAlignedIdrOnlyFlag()                                    { return m_crossLayerAlignedIdrOnlyFlag;                      }
-  Void   setCrossLayerAlignedIdrOnlyFlag(Bool x)                              { m_crossLayerAlignedIdrOnlyFlag = x;                         }
-#endif 
-  Bool   getCrossLayerIrapAlignFlag()                                           { return m_crossLayerIrapAlignFlag;                      }
-  Void   setCrossLayerIrapAlignFlag(Bool x)                                     { m_crossLayerIrapAlignFlag = x;                         }
+  Bool   getVpsPocLsbAlignedFlag()                                              { return m_vpsPocLsbAlignedFlag;                 }
+  Void   setVpsPocLsbAlignedFlag(Bool x)                                        { m_vpsPocLsbAlignedFlag = x;                    }
+#endif
+  Bool   getCrossLayerPictureTypeAlignFlag()                                    { return m_crossLayerPictureTypeAlignFlag;       }
+  Void   setCrossLayerPictureTypeAlignFlag(Bool x)                              { m_crossLayerPictureTypeAlignFlag = x;          }
+  Bool   getCrossLayerAlignedIdrOnlyFlag()                                      { return m_crossLayerAlignedIdrOnlyFlag;         }
+  Void   setCrossLayerAlignedIdrOnlyFlag(Bool x)                                { m_crossLayerAlignedIdrOnlyFlag = x;            }
+  Bool   getCrossLayerIrapAlignFlag()                                           { return m_crossLayerIrapAlignFlag;              }
+  Void   setCrossLayerIrapAlignFlag(Bool x)                                     { m_crossLayerIrapAlignFlag = x;                 }
   UInt   getMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx)                     { return m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx];           }
   Void   setMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx, UInt maxSublayer)   { m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx] = maxSublayer;    }
@@ -1138,8 +1132,6 @@
   Void   setSingleLayerForNonIrapFlag(Bool x)                       { m_singleLayerForNonIrapFlag = x;    }
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   Bool   getHigherLayerIrapSkipFlag()                             { return m_higherLayerIrapSkipFlag; }
   Void   setHigherLayerIrapSkipFlag(Bool x)                       { m_higherLayerIrapSkipFlag = x;    }
-#endif
 #if VPS_VUI_TILES_NOT_IN_USE__FLAG  
   Bool   getTilesNotInUseFlag()         { return m_tilesNotInUseFlag; }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1128)
@@ -144,7 +144,5 @@
 #define VPS_VUI_WPP_NOT_IN_USE__FLAG     1      ///< JCTVC-O0226: VPS VUI flag to indicate tile not in use
 #define N0160_VUI_EXT_ILP_REF            1      ///< VUI extension inter-layer dependency offset signalling
-#if M0040_ADAPTIVE_RESOLUTION_CHANGE
-#define HIGHER_LAYER_IRAP_SKIP_FLAG      1      ///< JCTVC-O0199: Indication that higher layer IRAP picture uses skip blocks only
-#endif
+
 #define VPS_VUI_VIDEO_SIGNAL             1      ///< JCTVC-O0118 video signal information
 #if VPS_VUI_VIDEO_SIGNAL
@@ -168,6 +166,4 @@
 #define P0079_DERIVE_NUMACTIVE_REF_PICS  1      ///< JCTVC-P0079 Modification of derivation of variable NumActiveRefLayerPics
 #define Q0060_MAX_TID_REF_EQUAL_TO_ZERO  1      ///< JCTVC-Q0060 handling the case max_tid_il_ref_pics_plus1 is equal to 0.
-
-#define P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG   1  ///< a flag to indicatate whether picture types for IRAP are IDR across layers.
 
 #define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id and view_id_val
@@ -248,4 +244,7 @@
 #define JCTVC_M0259_LAMBDAREFINEMENT     1      ///< JCTVC-M0259: lambda refinement (encoder only optimization)
 #define ENCODER_FAST_MODE                1      ///< JCTVC-L0174: enable encoder fast mode. TestMethod 1 is enabled by setting to 1 and TestMethod 2 is enable by setting to 2. By default it is set to 1.
+#if M0040_ADAPTIVE_RESOLUTION_CHANGE
+#define HIGHER_LAYER_IRAP_SKIP_FLAG      1      ///< JCTVC-O0199: Indication that higher layer IRAP picture uses skip blocks only
+#endif
 #define LAYER_CTB                        0      ///< enable layer-specific CTB structure
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1128)
@@ -3468,8 +3468,6 @@
 #endif
 
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   // When higher_layer_irap_skip_flag is not present it is inferred to be equal to 0
   vps->setHigherLayerIrapSkipFlag( false );
-#endif
 }
 
@@ -3662,5 +3660,6 @@
   READ_FLAG(uiCode, "cross_layer_pic_type_aligned_flag" );
   vps->setCrossLayerPictureTypeAlignFlag(uiCode);
-  if (!uiCode) 
+
+  if( !uiCode ) 
   {
     READ_FLAG(uiCode, "cross_layer_irap_aligned_flag" );
@@ -3672,11 +3671,9 @@
   }
 
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
-  if( uiCode )
+  if( vps->getCrossLayerIrapAlignFlag() )
   {
     READ_FLAG( uiCode, "all_layers_idr_aligned_flag" );
     vps->setCrossLayerAlignedIdrOnlyFlag(uiCode);
   }
-#endif
 
   READ_FLAG( uiCode,        "bit_rate_present_vps_flag" );  vps->setBitRatePresentVpsFlag( uiCode ? true : false );
@@ -3840,5 +3837,4 @@
   READ_FLAG(uiCode, "single_layer_for_non_irap_flag" ); vps->setSingleLayerForNonIrapFlag(uiCode == 1 ? true : false);
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   READ_FLAG(uiCode, "higher_layer_irap_skip_flag" ); vps->setHigherLayerIrapSkipFlag(uiCode == 1 ? true : false);
 
@@ -3848,5 +3844,4 @@
     assert( !vps->getHigherLayerIrapSkipFlag() );
   }
-#endif
 #if N0160_VUI_EXT_ILP_REF
   READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); vps->setIlpRestrictedRefLayersFlag( uiCode == 1 );
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1128)
@@ -302,6 +302,7 @@
   }
  
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
-  if (pcCU->getSlice()->getVPS()->getHigherLayerIrapSkipFlag() && pcCU->getSlice()->getVPS()->getSingleLayerForNonIrapFlag() && pcCU->getLayerId() > 0)
+#if SVC_EXTENSION
+  // Check CU skip for higher layer IRAP skip flag
+  if( pcCU->getSlice()->getVPS()->getHigherLayerIrapSkipFlag() && pcCU->getSlice()->getVPS()->getSingleLayerForNonIrapFlag() && pcCU->getLayerId() > 0 )
   {
     Bool lowerLayerExist = false;
@@ -313,7 +314,8 @@
       }
     }
-    if(lowerLayerExist)
-    {
-      assert(pcCU->isSkipped(uiAbsPartIdx));
+
+    if( lowerLayerExist && !pcCU->isSkipped(uiAbsPartIdx) )
+    {
+      printf( "Warning: CU is not skipped with enabled higher layer IRAP skip flag\n" );
     }
   }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1128)
@@ -2518,13 +2518,13 @@
   else
   {
-    vps->setCrossLayerIrapAlignFlag(vps->getVpsVuiPresentFlag()); // When not present, the value of cross_layer_irap_aligned_flag is inferred to be equal to vps_vui_present_flag
-  }
-
-#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
-  if(vps->getCrossLayerIrapAlignFlag())
+    // When not present, the value of cross_layer_irap_aligned_flag is inferred to be equal to vps_vui_present_flag,
+    // i.e. it is true in this function
+    vps->setCrossLayerIrapAlignFlag( true ); 
+  }
+
+  if( vps->getCrossLayerIrapAlignFlag() )
   {
     WRITE_FLAG(vps->getCrossLayerAlignedIdrOnlyFlag(), "all_layers_idr_aligned_flag");
   }
-#endif
 
   WRITE_FLAG( vps->getBitRatePresentVpsFlag(),        "bit_rate_present_vps_flag" );
@@ -2645,5 +2645,5 @@
   WRITE_FLAG(vps->getSingleLayerForNonIrapFlag(), "single_layer_for_non_irap_flag" );
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
+
   // When single_layer_for_non_irap_flag is equal to 0, higher_layer_irap_skip_flag shall be equal to 0
   if( !vps->getSingleLayerForNonIrapFlag() )
@@ -2653,5 +2653,5 @@
 
   WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
-#endif
+
 #if N0160_VUI_EXT_ILP_REF
   WRITE_FLAG( vps->getIlpRestrictedRefLayersFlag() ? 1 : 0 , "ilp_restricted_ref_layers_flag" );    
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1128)
@@ -378,7 +378,5 @@
 #endif
   Bool      m_altOutputLayerFlag;
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   Int       m_skipPictureAtArcSwitch;
-#endif
 #if O0149_CROSS_LAYER_BLA_FLAG
   Bool      m_crossLayerBLAFlag;
@@ -1026,8 +1024,6 @@
   Int       getLayerSwitchOffEnd()           { return m_layerSwitchOffEnd;   }
 #endif
-#if HIGHER_LAYER_IRAP_SKIP_FLAG
   Void      setSkipPictureAtArcSwitch(Int x) { m_skipPictureAtArcSwitch = x;    }
   Int       getSkipPictureAtArcSwitch()      { return m_skipPictureAtArcSwitch; }
-#endif
 #if AUXILIARY_PICTURES
   Void         setChromaFormatIDC(ChromaFormat x) { m_chromaFormatIDC = x;    }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1127)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 1128)
@@ -550,10 +550,12 @@
   rpcSlice->setSliceSegmentArgument ( m_pcCfg->getSliceSegmentArgument() );
   rpcSlice->setMaxNumMergeCand        ( m_pcCfg->getMaxNumMergeCand()        );
+
 #if HIGHER_LAYER_IRAP_SKIP_FLAG
-  if (m_pcCfg->getSkipPictureAtArcSwitch() && m_pcCfg->getAdaptiveResolutionChange() > 0 && rpcSlice->getLayerId() == 1 && rpcSlice->getPOC() == m_pcCfg->getAdaptiveResolutionChange())
+  if( m_pcCfg->getSkipPictureAtArcSwitch() && m_pcCfg->getAdaptiveResolutionChange() > 0 && rpcSlice->getLayerId() == 1 && rpcSlice->getPOC() == m_pcCfg->getAdaptiveResolutionChange() )
   {
     rpcSlice->setMaxNumMergeCand        ( 1 );
   }
 #endif
+
   xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
 
