Index: /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 778)
+++ /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 779)
@@ -984,5 +984,7 @@
   ("SEIKneeFunctionOutputKneePointValue", cfg_kneeSEIOutputKneePointValue,    string("100 250 450"), "Array of output knee point")
 #endif
-
+#if Q0189_TMVP_CONSTRAINTS
+  ("SEITemporalMotionVectorPredictionConstraints",             m_TMVPConstraintsSEIEnabled,              0, "Control generation of TMVP constrants SEI message")
+#endif
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
   ("AdaptiveResolutionChange",     m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)")
Index: /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 778)
+++ /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 779)
@@ -291,4 +291,7 @@
   Int       m_SOPDescriptionSEIEnabled;
   Int       m_scalableNestingSEIEnabled;
+#if Q0189_TMVP_CONSTRAINTS
+  Int       m_TMVPConstraintsSEIEnabled;
+#endif
   // weighted prediction
   Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
Index: /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 778)
+++ /branches/SHM-6-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 779)
@@ -516,4 +516,7 @@
     m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
     m_acTEncTop[layer].setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
+#if Q0189_TMVP_CONSTRAINTS
+    m_acTEncTop[layer].setTMVPConstraintsSEIEnabled( m_TMVPConstraintsSEIEnabled);           
+#endif
 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI
     m_acTEncTop[layer].setInterLayerConstrainedTileSetsSEIEnabled( m_interLayerConstrainedTileSetsSEIEnabled );
Index: /branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibCommon/SEI.h	(revision 779)
@@ -103,4 +103,7 @@
     VPS_REWRITING                        = 145,
 #endif
+#if Q0189_TMVP_CONSTRAINTS
+    TMVP_CONSTRAINTS                     = 146,
+#endif
   };
   
@@ -517,4 +520,23 @@
 #endif
 
+#if Q0189_TMVP_CONSTRAINTS
+class SEITMVPConstrains : public SEI
+{
+public:
+  PayloadType payloadType() const { return TMVP_CONSTRAINTS; }
+
+  SEITMVPConstrains()
+    : prev_pics_not_used_flag(0),no_intra_layer_col_pic_flag(0)
+    {}
+
+  virtual ~SEITMVPConstrains()
+  {
+  }
+
+  UInt prev_pics_not_used_flag;
+  UInt no_intra_layer_col_pic_flag;
+};
+#endif
+
 typedef std::list<SEI*> SEIMessages;
 
Index: /branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibCommon/TypeDef.h	(revision 779)
@@ -269,4 +269,5 @@
 #define DPB_CONSTRAINTS                  1      ///< JCTVC-Q0100 RPS DPB constraints
 #define P0050_KNEE_FUNCTION_SEI          1      ///< JCTVC-P0050: Knee function SEI
+#define Q0189_TMVP_CONSTRAINTS           1
 
 #if VIEW_ID_RELATED_SIGNALING
Index: /branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 779)
@@ -380,4 +380,10 @@
      break;
 #endif
+#if Q0189_TMVP_CONSTRAINTS
+   case SEI::TMVP_CONSTRAINTS:
+     sei =  new SEITMVPConstrains;
+     xParseSEITMVPConstraints((SEITMVPConstrains&) *sei, payloadSize);
+     break;
+#endif
 #endif //SVC_EXTENSION
       break;
@@ -1020,4 +1026,14 @@
 }
 
+#if Q0189_TMVP_CONSTRAINTS 
+Void SEIReader::xParseSEITMVPConstraints   (SEITMVPConstrains& sei, UInt payloadSize)
+{
+  UInt uiCode;
+  READ_UVLC( uiCode,           "prev_pics_not_used_flag"              ); sei.prev_pics_not_used_flag = uiCode;
+  READ_UVLC( uiCode,           "no_intra_layer_col_pic_flag"            ); sei.no_intra_layer_col_pic_flag = uiCode;
+  xParseByteAlign();
+}
+#endif
+
 #if LAYERS_NOT_PRESENT_SEI
 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps, TComSPS *sps)
Index: /branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.h	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.h	(revision 779)
@@ -127,4 +127,9 @@
   Void xParseSEIVPSRewriting(SEIVPSRewriting &sei);
 #endif
+
+#if Q0189_TMVP_CONSTRAINTS 
+  Void xParseSEITMVPConstraints    (SEITMVPConstrains& sei, UInt payloadSize);
+#endif
+
   Void xParseByteAlign();
 };
Index: /branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 779)
@@ -245,4 +245,9 @@
      break;
 #endif
+#if Q0189_TMVP_CONSTRAINTS
+   case SEI::TMVP_CONSTRAINTS:
+     xWriteSEITMVPConstraints(*static_cast<const SEITMVPConstrains*>(&sei));
+     break;
+#endif
 #endif //SVC_EXTENSION
   default:
@@ -863,4 +868,13 @@
 #endif
 
+#if Q0189_TMVP_CONSTRAINTS 
+Void SEIWriter::xWriteSEITMVPConstraints (const SEITMVPConstrains &sei)
+{
+  WRITE_UVLC( sei.prev_pics_not_used_flag ,    "prev_pics_not_used_flag"  );
+  WRITE_UVLC( sei.no_intra_layer_col_pic_flag ,    "no_intra_layer_col_pic_flag"  ); 
+  xWriteByteAlign();
+}
+#endif
+
 #if O0164_MULTI_LAYER_HRD
 Void SEIWriter::xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei)
Index: /branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 779)
@@ -95,4 +95,7 @@
   Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
 #endif
+#if Q0189_TMVP_CONSTRAINTS 
+Void xWriteSEITMVPConstraints (const SEITMVPConstrains &sei);
+#endif
 #if O0164_MULTI_LAYER_HRD
   Void xWriteSEIBspNesting(TComBitIf& bs, const SEIBspNesting &sei, TComVPS *vps, TComSPS *sps, const SEIScalableNesting &nestingSei);
Index: /branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 779)
@@ -276,4 +276,7 @@
   Int       m_SOPDescriptionSEIEnabled;
   Int       m_scalableNestingSEIEnabled;
+#if Q0189_TMVP_CONSTRAINTS
+  Int       m_TMVPConstraintsSEIEnabled;
+#endif
   //====== Weighted Prediction ========
   Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
@@ -733,5 +736,11 @@
   Int   getSOPDescriptionSEIEnabled()                     { return m_SOPDescriptionSEIEnabled; }
   Void  setScalableNestingSEIEnabled(Int b)                { m_scalableNestingSEIEnabled = b; }
+#if Q0189_TMVP_CONSTRAINTS
+  void setTMVPConstraintsSEIEnabled(Int b)                { m_TMVPConstraintsSEIEnabled = b; }
+#endif
   Int   getScalableNestingSEIEnabled()                     { return m_scalableNestingSEIEnabled; }
+#if Q0189_TMVP_CONSTRAINTS
+  Int   getTMVPConstraintsSEIEnabled()                {  return m_TMVPConstraintsSEIEnabled; }
+#endif
   Void      setUseWP               ( Bool b )    { m_useWeightedPred   = b;    }
   Void      setWPBiPred            ( Bool b )    { m_useWeightedBiPred = b;    }
Index: /branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 778)
+++ /branches/SHM-6-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 779)
@@ -2316,4 +2316,25 @@
       writeSOP = false;
     }
+#if Q0189_TMVP_CONSTRAINTS
+   if( m_pcEncTop->getTMVPConstraintsSEIEnabled() == 1 &&
+      (m_pcEncTop->getTMVPModeId() == 1 || m_pcEncTop->getTMVPModeId() == 2) &&
+      pcSlice->getLayerId() >0 && 
+      (pcSlice->getNalUnitType() ==  NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcSlice->getNalUnitType() ==  NAL_UNIT_CODED_SLICE_IDR_N_LP))
+   {
+      OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
+      SEITMVPConstrains seiTMVPConstrains;
+      m_pcEntropyCoder->setEntropyCoder(m_pcCavlcCoder, pcSlice);
+      m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
+      seiTMVPConstrains.no_intra_layer_col_pic_flag = 1;
+      seiTMVPConstrains.prev_pics_not_used_flag = 1;
+#if   O0164_MULTI_LAYER_HRD
+      m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiTMVPConstrains, m_pcEncTop->getVPS(), pcSlice->getSPS() );
+#else
+      m_seiWriter.writeSEImessage( nalu.m_Bitstream, seiTMVPConstrains, pcSlice->getSPS() );
+#endif
+      writeRBSPTrailingBits(nalu.m_Bitstream);
+      accessUnit.push_back(new NALUnitEBSP(nalu));
+   }
+#endif
 
     if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
