Index: branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 970)
+++ branches/SHM-upgrade/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 972)
@@ -2309,10 +2309,8 @@
     READ_FLAG(    uiCode, "general_one_picture_only_constraint_flag");
     READ_FLAG(    uiCode, "general_lower_bit_rate_constraint_flag"); ptl->setLowerBitRateConstraintFlag(uiCode != 0);
-    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]");
-  }
 #if MULTIPLE_PTL_SUPPORT
-  else if (ptl->getProfileIdc() == Profile::SCALABLEMAIN )
+    READ_CODE(32, uiCode, "general_reserved_zero_34bits");  READ_CODE(2, uiCode, "general_reserved_zero_34bits");
+  }
+  else if( ptl->getProfileIdc() == Profile::SCALABLEMAIN )
   {
     READ_FLAG(    uiCode, "general_max_12bit_constraint_flag" ); assert (uiCode == 1);
@@ -2325,9 +2323,31 @@
     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(32, uiCode, "general_reserved_zero_34bits");  READ_CODE(2, uiCode, "general_reserved_zero_34bits");
+  }
+  else
+  {
+    ptl->setBitDepthConstraint((ptl->getProfileIdc() == Profile::MAIN10)?10:8);
+    ptl->setChromaFormatConstraint(CHROMA_420);
+    ptl->setIntraConstraintFlag(false);
+    ptl->setLowerBitRateConstraintFlag(true);
+    READ_CODE(32,  uiCode, "general_reserved_zero_43bits");  READ_CODE(11,  uiCode, "general_reserved_zero_43bits");
+  }
+
+  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 ) || 
+      ptl->getProfileCompatibilityFlag(1) || ptl->getProfileCompatibilityFlag(2) || 
+      ptl->getProfileCompatibilityFlag(3) || ptl->getProfileCompatibilityFlag(4) || 
+      ptl->getProfileCompatibilityFlag(5)                                           )
+  {
+    READ_FLAG(uiCode, "general_inbld_flag");
+  }
+  else
+  {
+    READ_FLAG(uiCode, "general_reserved_zero_bit");
+  }
+#else
     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
   {
@@ -2340,4 +2360,5 @@
     READ_CODE(12, uiCode, "XXX_reserved_zero_44bits[32..43]");
   }
+#endif
 }
 
Index: branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 970)
+++ branches/SHM-upgrade/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 972)
@@ -1524,25 +1524,41 @@
     WRITE_FLAG(0,                                    "general_one_picture_only_constraint_flag");
     WRITE_FLAG(ptl->getLowerBitRateConstraintFlag(), "general_lower_bit_rate_constraint_flag");
+#if MULTIPLE_PTL_SUPPORT
+    WRITE_CODE(0, 32,  "general_reserved_zero_34bits");  WRITE_CODE(0, 2,  "general_reserved_zero_34bits");
+  }
+  else if( ptl->getProfileIdc() == Profile::SCALABLEMAIN || ptl->getProfileIdc() == Profile::SCALABLEMAIN10 )      // at encoder side, scalable-main10 profile has a profile idc equal to 8, which is converted to 7 during signalling
+  {
+    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, 32,  "general_reserved_zero_34bits");  WRITE_CODE(0, 2,  "general_reserved_zero_34bits");
+  }
+  else
+  {
+    WRITE_CODE(0, 32,  "general_reserved_zero_43bits");  WRITE_CODE(0, 11,  "general_reserved_zero_43bits");
+  }
+
+  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 ) || 
+      ptl->getProfileCompatibilityFlag(1) || ptl->getProfileCompatibilityFlag(2) || 
+      ptl->getProfileCompatibilityFlag(3) || ptl->getProfileCompatibilityFlag(4) || 
+      ptl->getProfileCompatibilityFlag(5)                                           )
+  {
+    WRITE_FLAG(false, "general_inbld_flag");
+  }
+  else
+  {
+    WRITE_FLAG(false, "general_reserved_zero_bit");
+  }
+#else
     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]");
   }
-#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
   {
@@ -1551,4 +1567,5 @@
     WRITE_CODE(0x000  , 12, "XXX_reserved_zero_44bits[32..43]");
   }
+#endif
 }
 
