Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1336)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1356)
@@ -74,5 +74,6 @@
   // The enumeration indicates the bit-depth constraint in the bottom 2 digits
   //                           the chroma format in the next digit
-  //                           the intra constraint in the top digit
+  //                           the intra constraint in the next digit
+  //                           If it is a RExt still picture, there is a '1' for the top digit.
   MONOCHROME_8      = 1008,
   MONOCHROME_12     = 1012,
@@ -93,5 +94,7 @@
   MAIN_444_10_INTRA = 2310,
   MAIN_444_12_INTRA = 2312,
-  MAIN_444_16_INTRA = 2316
+  MAIN_444_16_INTRA = 2316,
+  MAIN_444_STILL_PICTURE = 11308,
+  MAIN_444_16_STILL_PICTURE = 12316
 };
 
@@ -309,33 +312,42 @@
 strToExtendedProfile[] =
 {
-    {"none",               NONE             },
-    {"main",               MAIN             },
-    {"main10",             MAIN10           },
-    {"main-still-picture", MAINSTILLPICTURE },
-    {"main-RExt",          MAINREXT         },
-    {"high-throughput-RExt", HIGHTHROUGHPUTREXT },
-    {"monochrome",         MONOCHROME_8     },
-    {"monochrome12",       MONOCHROME_12    },
-    {"monochrome16",       MONOCHROME_16    },
-    {"main12",             MAIN_12          },
-    {"main_422_10",        MAIN_422_10      },
-    {"main_422_12",        MAIN_422_12      },
-    {"main_444",           MAIN_444         },
-    {"main_444_10",        MAIN_444_10      },
-    {"main_444_12",        MAIN_444_12      },
-    {"main_444_16",        MAIN_444_16      },
-    {"main_intra",         MAIN_INTRA       },
-    {"main_10_intra",      MAIN_10_INTRA    },
-    {"main_12_intra",      MAIN_12_INTRA    },
-    {"main_422_10_intra",  MAIN_422_10_INTRA},
-    {"main_422_12_intra",  MAIN_422_12_INTRA},
-    {"main_444_intra",     MAIN_444_INTRA   },
-    {"main_444_10_intra",  MAIN_444_10_INTRA},
-    {"main_444_12_intra",  MAIN_444_12_INTRA},
-    {"main_444_16_intra",  MAIN_444_16_INTRA},
+    {"none",                      NONE             },
+    {"main",                      MAIN             },
+    {"main10",                    MAIN10           },
+    {"main_still_picture",        MAINSTILLPICTURE },
+    {"main-still-picture",        MAINSTILLPICTURE },
+    {"main_RExt",                 MAINREXT         },
+    {"main-RExt",                 MAINREXT         },
+    {"main_rext",                 MAINREXT         },
+    {"main-rext",                 MAINREXT         },
+    {"high_throughput_RExt",      HIGHTHROUGHPUTREXT },
+    {"high-throughput-RExt",      HIGHTHROUGHPUTREXT },
+    {"high_throughput_rext",      HIGHTHROUGHPUTREXT },
+    {"high-throughput-rext",      HIGHTHROUGHPUTREXT },
+    {"monochrome",                MONOCHROME_8     },
+    {"monochrome12",              MONOCHROME_12    },
+    {"monochrome16",              MONOCHROME_16    },
+    {"main12",                    MAIN_12          },
+    {"main_422_10",               MAIN_422_10      },
+    {"main_422_12",               MAIN_422_12      },
+    {"main_444",                  MAIN_444         },
+    {"main_444_10",               MAIN_444_10      },
+    {"main_444_12",               MAIN_444_12      },
+    {"main_444_16",               MAIN_444_16      },
+    {"main_intra",                MAIN_INTRA       },
+    {"main_10_intra",             MAIN_10_INTRA    },
+    {"main_12_intra",             MAIN_12_INTRA    },
+    {"main_422_10_intra",         MAIN_422_10_INTRA},
+    {"main_422_12_intra",         MAIN_422_12_INTRA},
+    {"main_444_intra",            MAIN_444_INTRA   },
+    {"main_444_still_picture",    MAIN_444_STILL_PICTURE },
+    {"main_444_10_intra",         MAIN_444_10_INTRA},
+    {"main_444_12_intra",         MAIN_444_12_INTRA},
+    {"main_444_16_intra",         MAIN_444_16_INTRA},
+    {"main_444_16_still_picture", MAIN_444_16_STILL_PICTURE },
 #if SVC_EXTENSION
-    {"multiview-main",     MULTIVIEWMAIN    },
-    {"scalable-main",      SCALABLEMAIN     },
-    {"scalable-main10",    SCALABLEMAIN10   },
+    {"multiview-main",            MULTIVIEWMAIN    },
+    {"scalable-main",             SCALABLEMAIN     },
+    {"scalable-main10",           SCALABLEMAIN10   },
 #endif
 };
@@ -849,8 +861,4 @@
   Int*    cfg_layerSwitchOffBegin[MAX_LAYERS];
   Int*    cfg_layerSwitchOffEnd[MAX_LAYERS];
-
-  Bool    tmpIntraConstraintFlag;
-  Bool    tmpLowerBitRateConstraintFlag;
-  UInt    tmpBitDepthConstraint;
   Int*    cfg_layerPTLIdx[MAX_VPS_LAYER_IDX_PLUS1];
 
@@ -1215,9 +1223,11 @@
   ("Level%d",                                         m_levelList,       Level::NONE, (MAX_NUM_LAYER_IDS + 1), "Level limit to be used, eg 5.1, or none")
   ("Tier%d",                                          m_levelTierList,   Level::MAIN, (MAX_NUM_LAYER_IDS + 1), "Tier to use for interpretation of --Level (main or high only)")
-  ("MaxBitDepthConstraint",                           tmpBitDepthConstraint,                               0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
+#endif
+  ("MaxBitDepthConstraint",                           m_bitDepthConstraint,                                0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
   ("MaxChromaFormatConstraint",                       tmpConstraintChromaFormat,                            0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
-  ("IntraConstraintFlag",                             tmpIntraConstraintFlag,                           false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
-  ("LowerBitRateConstraintFlag",                      tmpLowerBitRateConstraintFlag,                     true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles")
-
+  ("IntraConstraintFlag",                             m_intraConstraintFlag,                            false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
+  ("OnePictureOnlyConstraintFlag",                    m_onePictureOnlyConstraintFlag,                   false, "Value of general_one_picture_only_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
+  ("LowerBitRateConstraintFlag",                      m_lowerBitRateConstraintFlag,                      true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles")
+#if SVC_EXTENSION
   ("ProfileCompatibility%d",                          m_profileCompatibility, Profile::NONE, (MAX_NUM_LAYER_IDS + 1), "Compatible profile to be used when encoding")
   ("ProgressiveSource%d",                             m_progressiveSourceFlagList,   false, (MAX_NUM_LAYER_IDS + 1), "Indicate that source is progressive")
@@ -1245,9 +1255,5 @@
   ("Profile",                                         extendedProfile,                                   NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none")
   ("Level",                                           m_level,                                    Level::NONE, "Level limit to be used, eg 5.1, or none")
-  ("Tier",                                            m_levelTier,                                Level::MAIN, "Tier to use for interpretation of --Level (main or high only)")
-  ("MaxBitDepthConstraint",                           m_bitDepthConstraint,                                0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
-  ("MaxChromaFormatConstraint",                       tmpConstraintChromaFormat,                            0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
-  ("IntraConstraintFlag",                             m_intraConstraintFlag,                            false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
-  ("LowerBitRateConstraintFlag",                      m_lowerBitRateConstraintFlag,                      true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles")
+  ("Tier",                                            m_levelTier,                                Level::MAIN, "Tier to use for interpretation of --Level (main or high only)")  
 
   ("ProgressiveSource",                               m_progressiveSourceFlag,                          false, "Indicate that source is progressive")
@@ -1886,7 +1892,7 @@
     }
 
-    m_acLayerCfg[layer].m_bitDepthConstraint = tmpBitDepthConstraint;
-    m_acLayerCfg[layer].m_intraConstraintFlag = tmpIntraConstraintFlag;
-    m_acLayerCfg[layer].m_lowerBitRateConstraintFlag = tmpLowerBitRateConstraintFlag;    
+    m_acLayerCfg[layer].m_bitDepthConstraint = m_bitDepthConstraint;
+    m_acLayerCfg[layer].m_intraConstraintFlag = m_intraConstraintFlag;
+    m_acLayerCfg[layer].m_lowerBitRateConstraintFlag = m_lowerBitRateConstraintFlag;    
 
     for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
@@ -2005,5 +2011,5 @@
   m_chromaFormatIDC      = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
 
-  if (extendedProfile >= 1000 && extendedProfile <= 2316)
+  if (extendedProfile >= 1000 && extendedProfile <= 12316)
   {
     m_profile = Profile::MAINREXT;
@@ -2013,6 +2019,7 @@
       exit(EXIT_FAILURE);
     }
-    m_bitDepthConstraint     = (extendedProfile%100);
-    m_intraConstraintFlag    = (extendedProfile>=2000);
+    m_bitDepthConstraint           = (extendedProfile%100);
+    m_intraConstraintFlag          = ((extendedProfile%10000)>=2000);
+    m_onePictureOnlyConstraintFlag = (extendedProfile >= 10000);
     switch ((extendedProfile/100)%10)
     {
@@ -2050,13 +2057,27 @@
       const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0;
       const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag;
-      m_chromaFormatConstraint = NUM_CHROMA_FORMAT;
-      automaticallySelectRExtProfile(bUsingGeneralRExtTools,
-                                     bUsingChromaQPAdjustment,
-                                     bUsingExtendedPrecision,
-                                     m_intraConstraintFlag,
-                                     m_bitDepthConstraint,
-                                     m_chromaFormatConstraint,
-                                     m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]),
-                                     m_chromaFormatIDC);
+      if (m_onePictureOnlyConstraintFlag)
+      {
+        m_chromaFormatConstraint = CHROMA_444;
+        if (m_intraConstraintFlag != true)
+        {
+          fprintf(stderr, "Error: Intra constraint flag must be true when one_picture_only_constraint_flag is true\n");
+          exit(EXIT_FAILURE);
+        }
+        const Int maxBitDepth = m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
+        m_bitDepthConstraint = maxBitDepth>8 ? 16:8;
+      }
+      else
+      {
+        m_chromaFormatConstraint = NUM_CHROMA_FORMAT;
+        automaticallySelectRExtProfile(bUsingGeneralRExtTools,
+                                       bUsingChromaQPAdjustment,
+                                       bUsingExtendedPrecision,
+                                       m_intraConstraintFlag,
+                                       m_bitDepthConstraint,
+                                       m_chromaFormatConstraint,
+                                       m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]),
+                                       m_chromaFormatIDC);
+      }
     }
     else if (m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0)
@@ -3028,4 +3049,8 @@
         xConfirmPara(bUsingGeneralRExtTools, "Combination of tools and profiles are not possible in the specified RExt profile.");
       }
+      xConfirmPara( m_onePictureOnlyConstraintFlag && m_chromaFormatConstraint!=CHROMA_444, "chroma format constraint must be 4:4:4 when one-picture-only constraint flag is 1");
+      xConfirmPara( m_onePictureOnlyConstraintFlag && m_bitDepthConstraint != 8 && m_bitDepthConstraint != 16, "bit depth constraint must be 8 or 16 when one-picture-only constraint flag is 1");
+      xConfirmPara( m_onePictureOnlyConstraintFlag && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when one-picture-only constraint flag is 1.");
+
       if (!m_intraConstraintFlag && m_bitDepthConstraint==16 && m_chromaFormatConstraint==CHROMA_444)
       {
@@ -3052,4 +3077,5 @@
     xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt profiles.");
     xConfirmPara(m_lowerBitRateConstraintFlag==false, "LowerBitrateConstraintFlag must be true for non main-RExt profiles.");
+    xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used.");
 
     xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt profiles.");
@@ -4333,8 +4359,16 @@
   if (m_profile == Profile::MAINREXT)
   {
-    const UInt intraIdx = m_intraConstraintFlag ? 1:0;
-    const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
-    const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint);
-    const ExtendedProfileName validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx];
+    ExtendedProfileName validProfileName;
+    if (m_onePictureOnlyConstraintFlag)
+    {
+      validProfileName = m_bitDepthConstraint == 8 ? MAIN_444_STILL_PICTURE : (m_bitDepthConstraint == 16 ? MAIN_444_16_STILL_PICTURE : NONE);
+    }
+    else
+    {
+      const UInt intraIdx = m_intraConstraintFlag ? 1:0;
+      const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
+      const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint);
+      validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx];
+    }
     std::string rextSubProfile;
     if (validProfileName!=NONE)
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1336)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1356)
@@ -144,8 +144,11 @@
   Level::Tier   m_levelTier;
   Level::Name   m_level;
+#endif
   UInt          m_bitDepthConstraint;
   ChromaFormat  m_chromaFormatConstraint;
   Bool          m_intraConstraintFlag;
+  Bool          m_onePictureOnlyConstraintFlag;
   Bool          m_lowerBitRateConstraintFlag;
+#if !SVC_EXTENSION
   Bool m_progressiveSourceFlag;
   Bool m_interlacedSourceFlag;
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1336)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1356)
@@ -229,4 +229,5 @@
     m_acTEncTop[layer].setChromaFormatConstraintValue                     ( m_acLayerCfg[layer].m_chromaFormatConstraint );
     m_acTEncTop[layer].setIntraConstraintFlag                             ( m_acLayerCfg[layer].m_intraConstraintFlag );
+    m_acTEncTop[layer].setOnePictureOnlyConstraintFlag                    ( m_onePictureOnlyConstraintFlag );
     m_acTEncTop[layer].setLowerBitRateConstraintFlag                      ( m_acLayerCfg[layer].m_lowerBitRateConstraintFlag );
 
@@ -809,4 +810,5 @@
   m_cTEncTop.setChromaFormatConstraintValue                       ( m_chromaFormatConstraint );
   m_cTEncTop.setIntraConstraintFlag                               ( m_intraConstraintFlag );
+  m_cTEncTop.setOnePictureOnlyConstraintFlag                      ( m_onePictureOnlyConstraintFlag );
   m_cTEncTop.setLowerBitRateConstraintFlag                        ( m_lowerBitRateConstraintFlag );
 
