Index: branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 963)
+++ branches/SHM-upgrade/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 965)
@@ -68,5 +68,5 @@
   MULTIVIEWMAIN = 6,
   SCALABLEMAIN = 7,
-  SCALABLEMAIN10 = 7,
+  SCALABLEMAIN10 = 8,
 #endif
   // The following are RExt profiles, which would map to the MAINREXT profile idc.
Index: branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h	(revision 963)
+++ branches/SHM-upgrade/source/Lib/TLibCommon/TypeDef.h	(revision 965)
@@ -935,5 +935,5 @@
     MULTIVIEWMAIN = 6,
     SCALABLEMAIN = 7,
-    SCALABLEMAIN10 = 7,
+    SCALABLEMAIN10 = 8,
 #endif
   };
Index: branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 963)
+++ branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 965)
@@ -2313,4 +2313,21 @@
     READ_CODE(3,  uiCode, "XXX_reserved_zero_35bits[32..34]");
   }
+#if MULTIPLE_PTL_SUPPORT
+  else if (ptl->getProfileIdc() == Profile::SCALABLEMAIN )
+  {
+    READ_FLAG(    uiCode, "general_max_12bit_constraint_flag" ); assert (uiCode == 1);
+    READ_FLAG(    uiCode, "general_max_10bit_constraint_flag" ); assert (uiCode == 1);
+    READ_FLAG(    uiCode, "general_max_8bit_constraint_flag"  ); ptl->setProfileIdc  ((uiCode) ? Profile::SCALABLEMAIN : Profile::SCALABLEMAIN10);
+    READ_FLAG(    uiCode, "general_max_422chroma_constraint_flag"  ); assert (uiCode == 1);
+    READ_FLAG(    uiCode, "general_max_420chroma_constraint_flag"  ); assert (uiCode == 1);
+    READ_FLAG(    uiCode, "general_max_monochrome_constraint_flag" ); assert (uiCode == 0);
+    READ_FLAG(    uiCode, "general_intra_constraint_flag"); assert (uiCode == 0);
+    READ_FLAG(    uiCode, "general_one_picture_only_constraint_flag"); assert (uiCode == 0);
+    READ_FLAG(    uiCode, "general_lower_bit_rate_constraint_flag"); assert (uiCode == 1);
+    READ_CODE(16, uiCode, "XXX_reserved_zero_35bits[0..15]");
+    READ_CODE(16, uiCode, "XXX_reserved_zero_35bits[16..31]");
+    READ_CODE(3,  uiCode, "XXX_reserved_zero_35bits[32..34]");
+  }
+#endif
   else
   {
Index: branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 963)
+++ branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 965)
@@ -1496,5 +1496,9 @@
   WRITE_CODE( ptl->getProfileSpace(), 2 ,     "XXX_profile_space[]");
   WRITE_FLAG( ptl->getTierFlag()==Level::HIGH, "XXX_tier_flag[]"    );
+#if MULTIPLE_PTL_SUPPORT
+  WRITE_CODE( (ptl->getProfileIdc() == Profile::SCALABLEMAIN || ptl->getProfileIdc() == Profile::SCALABLEMAIN10) ? 7 : Int(ptl->getProfileIdc()), 5 ,  "XXX_profile_idc[]"  );
+#else
   WRITE_CODE( Int(ptl->getProfileIdc()), 5 ,  "XXX_profile_idc[]"  );
+#endif
   for(Int j = 0; j < 32; j++)
   {
@@ -1524,4 +1528,21 @@
     WRITE_CODE(0 ,  3, "XXX_reserved_zero_35bits[32..34]");
   }
+#if MULTIPLE_PTL_SUPPORT
+  else if (ptl->getProfileIdc() == Profile::SCALABLEMAIN || ptl->getProfileIdc() == Profile::SCALABLEMAIN10)
+  {
+    WRITE_FLAG(true, "general_max_12bit_constraint_flag");
+    WRITE_FLAG(true, "general_max_10bit_constraint_flag");
+    WRITE_FLAG((ptl->getProfileIdc() == Profile::SCALABLEMAIN) ? true : false, "general_max_8bit_constraint_flag");
+    WRITE_FLAG(true, "general_max_422chroma_constraint_flag");
+    WRITE_FLAG(true, "general_max_420chroma_constraint_flag");
+    WRITE_FLAG(false, "general_max_monochrome_constraint_flag");
+    WRITE_FLAG(false, "general_intra_constraint_flag");
+    WRITE_FLAG(false, "general_one_picture_only_constraint_flag");
+    WRITE_FLAG(true, "general_lower_bit_rate_constraint_flag");
+    WRITE_CODE(0 , 16, "XXX_reserved_zero_35bits[0..15]");
+    WRITE_CODE(0 , 16, "XXX_reserved_zero_35bits[16..31]");
+    WRITE_CODE(0 ,  3, "XXX_reserved_zero_35bits[32..34]");
+  }
+#endif
   else
   {
