Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h	(revision 1059)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComRom.h	(revision 1060)
@@ -239,5 +239,5 @@
 
 #ifndef ENC_DEC_TRACE
-#define ENC_DEC_TRACE   0
+#define ENC_DEC_TRACE   1
 #endif
 
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp	(revision 1059)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.cpp	(revision 1060)
@@ -1915,5 +1915,9 @@
     {
 #if H_MV_HLS10_PTL
+#if H_MV_HLS10_PTL_FIX
+      m_profileTierLevelIdx[i][j] = -1; 
+#else
       m_profileTierLevelIdx[i][j] = false; 
+#endif
 #endif
       m_outputLayerFlag[i][j] = false; 
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h	(revision 1059)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TComSlice.h	(revision 1060)
@@ -1216,4 +1216,25 @@
   Void    setProfileTierLevelIdx( Int i, Int j, Int val )                  { m_profileTierLevelIdx[ i ][ j ] = val; }
   Int     getProfileTierLevelIdx( Int i, Int j )                           { return m_profileTierLevelIdx[ i ][ j ]; } 
+#if H_MV_HLS10_PTL
+  Int     inferProfileTierLevelIdx( Int i, Int j )
+  {
+    Bool inferZero        = ( i == 0 && j == 0 &&  getVpsBaseLayerInternalFlag() );
+    Bool inferGreaterZero = getNecessaryLayerFlag(i,j) && ( getVpsNumProfileTierLevelMinus1() == 0 ); 
+    assert( inferZero || inferGreaterZero );
+
+    Bool ptlIdx = 0; // inference for greaterZero
+    if ( inferZero )
+    {
+      ptlIdx = getMaxLayersMinus1() > 0 ? 1 : 0; 
+      if ( inferGreaterZero )
+      {
+        assert( ptlIdx == 0 );  
+        // This should never happen since :
+        // When vps_max_layers_minus1 is greater than 0, the value of vps_num_profile_tier_level_minus1 shall be greater than or equal to 1.
+      }
+    }
+    return ptlIdx;     
+  }
+#endif
 #else
   Void    setProfileLevelTierIdx( Int outLayerSetIdx, Int val )            { m_profileLevelTierIdx[ outLayerSetIdx ] = val; }
@@ -1282,4 +1303,8 @@
 
   Int     getViewIndex    ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }    
+#if H_MV_HLS10_AUX
+  Int     getAuxId        ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), AUX_ID  ); }    
+  Int     getDependencyId ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPENDENCY_ID  ); }    
+#endif
   Int     getNumViews();
 
@@ -1460,8 +1485,28 @@
     vector<Int> fullArray;
     vector<Int> range; 
+
+#if H_3D
+    vector<Int> depthId; 
+#endif
+
+#if H_MV_HLS10_AUX
+    vector<Int> viewOrderIndex;
+    vector<Int> auxId;
+    vector<Int> dependencyId; 
+    vector<Int> viewId; 
+#endif
     for (Int i = 0; i <= getMaxLayersMinus1(); i++ )
     {
       fullArray.push_back( getMaxLayersMinus1() + 1 ); 
       range.push_back( i ); 
+#if H_MV_HLS10_AUX      
+      viewOrderIndex.push_back( getViewIndex   ( i ) );
+      dependencyId  .push_back( getDependencyId( i ) );
+      auxId         .push_back( getAuxId       ( i ) );      
+      viewId        .push_back( getViewId      ( getLayerIdInNuh( i ) ) );
+#if H_3D  
+      depthId.push_back( getDepthId( i ) );
+#endif
+#endif
     }
     std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Layer Dependencies" << std::endl; 
@@ -1475,4 +1520,46 @@
 
   };
+
+#if H_MV_HLS10_AUX
+  Void    printScalabilityId() 
+  {    
+    vector<Int> layerIdxInVps; 
+
+#if H_3D
+    vector<Int> depthId; 
+#endif
+
+    vector<Int> viewOrderIndex;
+    vector<Int> auxId;
+    vector<Int> dependencyId; 
+    vector<Int> viewId; 
+
+    for (Int i = 0; i <= getMaxLayersMinus1(); i++ )
+    {
+      Int layerIdInNuh = getLayerIdInNuh( i );
+      layerIdxInVps  .push_back( i ); 
+      viewOrderIndex.push_back( getViewIndex   ( layerIdInNuh ) );
+      dependencyId  .push_back( getDependencyId( layerIdInNuh ) );
+      auxId         .push_back( getAuxId       ( layerIdInNuh ) );      
+      viewId        .push_back( getViewId      ( layerIdInNuh ) );
+#if H_3D  
+      depthId       .push_back( getDepthId     ( layerIdInNuh ) );
+#endif
+    }
+
+    std::cout << std::right << std::setw(60) << std::setfill('-') << " " << std::setfill(' ') << std::endl << "Scalability Ids" << std::endl; 
+    xPrintArray( "layerIdxInVps"  , getMaxLayersMinus1()+1, layerIdxInVps,          false );
+    xPrintArray( "layer_id_in_nuh", getMaxLayersMinus1()+1, m_layerIdInNuh, false );     
+    
+    xPrintArray( "ViewOrderIndex", getMaxLayersMinus1()+1, viewOrderIndex, false );     
+    xPrintArray( "DependencyId"  , getMaxLayersMinus1()+1, dependencyId  , false );     
+    xPrintArray( "AuxId"         , getMaxLayersMinus1()+1, auxId         , false );     
+    xPrintArray( "ViewId"        , getMaxLayersMinus1()+1, viewId        , false );     
+
+    std::cout << std::endl; 
+  };
+#endif
+
+
 
   Void    printLayerSets() 
Index: branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h	(revision 1059)
+++ branches/HTM-12.0-dev1/source/Lib/TLibCommon/TypeDef.h	(revision 1060)
@@ -403,4 +403,5 @@
 #define H_MV_HLS10_GEN                       0  // General changes (not tested)
 
+#define H_MV_HLS10_AUX                       1 // Auxiliary pictures
 #define H_MV_HLS10_GEN_FIX                   1
 
@@ -413,4 +414,5 @@
 #define H_MV_HLS10_MAXNUMPICS                1  // constraint on number of pictures in rps  
 #define H_MV_HLS10_PTL                       1  // profile tier level
+#define H_MV_HLS10_PTL_FIX                   1  // profile tier level
 #define H_MV_HLS10_MULTILAYERSPS             1  // multilayer SPS extension 
 #define H_MV_HLS10_VPS_VUI                   1  // vsp vui
@@ -1062,4 +1064,8 @@
 #endif    
     VIEW_ORDER_INDEX  = 1,
+#if H_MV_HLS10_AUX
+    DEPENDENCY_ID = 2,
+    AUX_ID = 3,
+#endif    
   };
 #endif
Index: branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1059)
+++ branches/HTM-12.0-dev1/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1060)
@@ -1457,4 +1457,10 @@
   pcVPS->deriveTargetLayerIdList( 0 ); 
 
+#if H_MV_HLS10_PTL_FIX
+  if (pcVPS->getVpsBaseLayerInternalFlag() )
+  {  
+    pcVPS->setProfileTierLevelIdx(0,0, pcVPS->inferProfileTierLevelIdx(0,0) );
+  }
+#endif
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
@@ -1494,4 +1500,10 @@
         READ_CODE( pcVPS->getProfileTierLevelIdxLen(), uiCode,"profile_tier_level_idx[ i ][ j ]" );   pcVPS->setProfileTierLevelIdx( i, j, uiCode ); 
       }
+#if H_MV_HLS10_PTL_FIX
+      if (pcVPS->getNecessaryLayerFlag( i, j ) && pcVPS->getVpsNumProfileTierLevelMinus1() == 0 )
+      {
+        pcVPS->setProfileTierLevelIdx( i , j, pcVPS->inferProfileTierLevelIdx( i, j) );
+      }
+#endif
     }
 #else
Index: branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1059)
+++ branches/HTM-12.0-dev1/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1060)
@@ -1241,4 +1241,10 @@
 
 
+#if H_MV_HLS10_PTL_FIX
+  if (pcVPS->getVpsBaseLayerInternalFlag() )
+  {  
+    assert( pcVPS->getProfileTierLevelIdx(0,0) == pcVPS->inferProfileTierLevelIdx(0,0) );
+  }
+#endif
 
 
@@ -1276,4 +1282,11 @@
         WRITE_CODE( pcVPS->getProfileTierLevelIdx( i, j ), pcVPS->getProfileTierLevelIdxLen() ,"profile_tier_level_idx[ i ][ j ]" );   
       }
+#if H_MV_HLS10_PTL_FIX
+      if (pcVPS->getNecessaryLayerFlag( i, j ) && pcVPS->getVpsNumProfileTierLevelMinus1() == 0 )
+      {
+        assert( pcVPS->getProfileTierLevelIdx( i , j ) == pcVPS->inferProfileTierLevelIdx( i, j ) );
+      }
+#endif
+
     }
 #else
