Index: branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 761)
+++ branches/SHM-6-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 762)
@@ -2917,105 +2917,102 @@
 
   TimingInfo *timingInfo = vui->getTimingInfo();
-#if TIMING_INFO_NONZERO_LAYERID_SPS
-  if( getLayerId() > 0 )
+#if SVC_EXTENSION
+  if( m_layerId > 0 )
   {
     timingInfo->setTimingInfoPresentFlag( false );
+    return;
+  }
+#endif
+
+  timingInfo->setTimingInfoPresentFlag( true );
+  switch( frameRate )
+  {
+  case 24:
+    timingInfo->setNumUnitsInTick( 1125000 );    timingInfo->setTimeScale    ( 27000000 );
+    break;
+  case 25:
+    timingInfo->setNumUnitsInTick( 1080000 );    timingInfo->setTimeScale    ( 27000000 );
+    break;
+  case 30:
+    timingInfo->setNumUnitsInTick( 900900 );     timingInfo->setTimeScale    ( 27000000 );
+    break;
+  case 50:
+    timingInfo->setNumUnitsInTick( 540000 );     timingInfo->setTimeScale    ( 27000000 );
+    break;
+  case 60:
+    timingInfo->setNumUnitsInTick( 450450 );     timingInfo->setTimeScale    ( 27000000 );
+    break;
+  default:
+    timingInfo->setNumUnitsInTick( 1001 );       timingInfo->setTimeScale    ( 60000 );
+    break;
+  }
+
+  Bool rateCnt = ( bitRate > 0 );
+  hrd->setNalHrdParametersPresentFlag( rateCnt );
+  hrd->setVclHrdParametersPresentFlag( rateCnt );
+
+  hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) );
+
+  if( hrd->getSubPicCpbParamsPresentFlag() )
+  {
+    hrd->setTickDivisorMinus2( 100 - 2 );                          // 
+    hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
+    hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
+    hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
   }
   else
   {
-#endif
-    timingInfo->setTimingInfoPresentFlag( true );
-    switch( frameRate )
-    {
-    case 24:
-      timingInfo->setNumUnitsInTick( 1125000 );    timingInfo->setTimeScale    ( 27000000 );
-      break;
-    case 25:
-      timingInfo->setNumUnitsInTick( 1080000 );    timingInfo->setTimeScale    ( 27000000 );
-      break;
-    case 30:
-      timingInfo->setNumUnitsInTick( 900900 );     timingInfo->setTimeScale    ( 27000000 );
-      break;
-    case 50:
-      timingInfo->setNumUnitsInTick( 540000 );     timingInfo->setTimeScale    ( 27000000 );
-      break;
-    case 60:
-      timingInfo->setNumUnitsInTick( 450450 );     timingInfo->setTimeScale    ( 27000000 );
-      break;
-    default:
-      timingInfo->setNumUnitsInTick( 1001 );       timingInfo->setTimeScale    ( 60000 );
-      break;
-    }
-
-    Bool rateCnt = ( bitRate > 0 );
-    hrd->setNalHrdParametersPresentFlag( rateCnt );
-    hrd->setVclHrdParametersPresentFlag( rateCnt );
-
-    hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) );
-
-    if( hrd->getSubPicCpbParamsPresentFlag() )
-    {
-      hrd->setTickDivisorMinus2( 100 - 2 );                          // 
-      hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
-      hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
-      hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
-    }
-    else
-    {
-      hrd->setSubPicCpbParamsInPicTimingSEIFlag( false );  
-    }
-
-    hrd->setBitRateScale( 4 );                                       // in units of 2~( 6 + 4 ) = 1,024 bps
-    hrd->setCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
-    hrd->setDuCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
-  
-    hrd->setInitialCpbRemovalDelayLengthMinus1(15);                  // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit
-    if( randomAccess )
-    {
-      hrd->setCpbRemovalDelayLengthMinus1(5);                        // 32 = 2^5 (plus 1)
-      hrd->setDpbOutputDelayLengthMinus1 (5);                        // 32 + 3 = 2^6
-    }
-    else
-    {
-      hrd->setCpbRemovalDelayLengthMinus1(9);                        // max. 2^10
-      hrd->setDpbOutputDelayLengthMinus1 (9);                        // max. 2^10
-    }
-
-/*
-     Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.
-*/
-    Int i, j;
-    UInt birateValue, cpbSizeValue;
-    UInt ducpbSizeValue;
-    UInt duBitRateValue = 0;
-
-    for( i = 0; i < MAX_TLAYER; i ++ )
-    {
-      hrd->setFixedPicRateFlag( i, 1 );
-      hrd->setPicDurationInTcMinus1( i, 0 );
-      hrd->setLowDelayHrdFlag( i, 0 );
-      hrd->setCpbCntMinus1( i, 0 );
-
-      birateValue  = bitRate;
-      cpbSizeValue = bitRate;                                     // 1 second
-      ducpbSizeValue = bitRate/numDU;
-      duBitRateValue = bitRate;
-      for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
-      {
-        hrd->setBitRateValueMinus1( i, j, 0, ( birateValue  - 1 ) );
-        hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) );
-        hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) );
-        hrd->setCbrFlag( i, j, 0, ( j == 0 ) );
-
-        hrd->setBitRateValueMinus1( i, j, 1, ( birateValue  - 1) );
-        hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
-        hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
-        hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
-        hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
-      }
-    }
-#if TIMING_INFO_NONZERO_LAYERID_SPS
-  }
-#endif
+    hrd->setSubPicCpbParamsInPicTimingSEIFlag( false );  
+  }
+
+  hrd->setBitRateScale( 4 );                                       // in units of 2~( 6 + 4 ) = 1,024 bps
+  hrd->setCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
+  hrd->setDuCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
+
+  hrd->setInitialCpbRemovalDelayLengthMinus1(15);                  // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit
+  if( randomAccess )
+  {
+    hrd->setCpbRemovalDelayLengthMinus1(5);                        // 32 = 2^5 (plus 1)
+    hrd->setDpbOutputDelayLengthMinus1 (5);                        // 32 + 3 = 2^6
+  }
+  else
+  {
+    hrd->setCpbRemovalDelayLengthMinus1(9);                        // max. 2^10
+    hrd->setDpbOutputDelayLengthMinus1 (9);                        // max. 2^10
+  }
+
+  /*
+  Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.
+  */
+  Int i, j;
+  UInt birateValue, cpbSizeValue;
+  UInt ducpbSizeValue;
+  UInt duBitRateValue = 0;
+
+  for( i = 0; i < MAX_TLAYER; i ++ )
+  {
+    hrd->setFixedPicRateFlag( i, 1 );
+    hrd->setPicDurationInTcMinus1( i, 0 );
+    hrd->setLowDelayHrdFlag( i, 0 );
+    hrd->setCpbCntMinus1( i, 0 );
+
+    birateValue  = bitRate;
+    cpbSizeValue = bitRate;                                     // 1 second
+    ducpbSizeValue = bitRate/numDU;
+    duBitRateValue = bitRate;
+    for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
+    {
+      hrd->setBitRateValueMinus1( i, j, 0, ( birateValue  - 1 ) );
+      hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) );
+      hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) );
+      hrd->setCbrFlag( i, j, 0, ( j == 0 ) );
+
+      hrd->setBitRateValueMinus1( i, j, 1, ( birateValue  - 1) );
+      hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
+      hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
+      hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
+      hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
+    }
+  }
 }
 const Int TComSPS::m_winUnitX[]={1,2,2,1};
Index: branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h	(revision 761)
+++ branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h	(revision 762)
@@ -119,5 +119,4 @@
 #define REPN_FORMAT_CONTROL_FLAG         1      ///< JCTVC-O0179: Add control flag in representation format to control sending of chroma and bitdepth parameters
 #endif 
-#define TIMING_INFO_NONZERO_LAYERID_SPS  1      ///< JCTVC-N0085: Semantics of vui_timing_info_present_flag to always set that flag to zero for non-zero layer ID SPS 
 #define RPL_INIT_N0316_N0082             1      ///< JCTVC-N0316, JCTVC-N0082: initial reference picture list construction 
 
Index: branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 761)
+++ branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 762)
@@ -461,5 +461,5 @@
   TimingInfo *timingInfo = pcVUI->getTimingInfo();
   READ_FLAG(       uiCode, "vui_timing_info_present_flag");         timingInfo->setTimingInfoPresentFlag      (uiCode ? true : false);
-#if TIMING_INFO_NONZERO_LAYERID_SPS
+#if SVC_EXTENSION
   if( pcSPS->getLayerId() > 0 )
   {
Index: branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 761)
+++ branches/SHM-6-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 762)
@@ -1072,8 +1072,4 @@
 Void TEncTop::xInitPPS()
 {
-#if SCALINGLIST_INFERRING
-  m_cPPS.setLayerId( m_layerId );
-#endif
-
   m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred );
   Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false;
@@ -1171,4 +1167,8 @@
   }
 #if SVC_EXTENSION
+#if SCALINGLIST_INFERRING
+  m_cPPS.setLayerId( m_layerId );
+#endif
+
   if( m_layerId > 0 )
   {
