Index: branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1327)
+++ branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1328)
@@ -223,4 +223,32 @@
 }
 
+
+#if NH_MV_SEI
+Void TAppEncCfg::xParseSeiCfg()
+{
+  for (Int i = 0; i < MAX_NUM_SEIS; i++)
+  {
+    if ( m_seiCfgFileNames[i] != NULL )
+    {
+      Int payloadType; 
+      po::Options opts;     
+      
+      opts.addOptions()("PayloadType", payloadType,-1, "Payload Type");
+      po::setDefaults(opts);      
+
+      po::ErrorReporter err;
+      err.output_on_unknow_parameter = false; 
+      po::parseConfigFile( opts, m_seiCfgFileNames[i], err );
+      SEI* sei = SEI::getNewSEIMessage( (SEI::PayloadType) payloadType ); 
+      assert( sei != NULL );
+
+      sei->setupFromCfgFile( m_seiCfgFileNames[i] ); 
+
+      m_seiMessages.push_back( sei );
+    }
+  }
+}
+#endif
+
 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry)     //input
 {
@@ -854,30 +882,29 @@
 #endif  
   ("DimensionIdLen",        m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
-  ("ViewOrderIndex",        m_viewOrderIndex     , std::vector<Int>(1,0), "View Order Index per layer")
-  ("ViewId",                m_viewId             , std::vector<Int>(1,0), "View Id per View Order Index")
-  ("AuxId",                 m_auxId              , std::vector<Int>(1,0), "AuxId per layer")
+  ("ViewOrderIndex",                 m_viewOrderIndex              , IntAry1d(1,0),                                 "View Order Index per layer")
+  ("ViewId",                         m_viewId                      , IntAry1d(1,0),                                 "View Id per View Order Index")
+  ("AuxId",                          m_auxId                       , IntAry1d(1,0),                                 "AuxId per layer")
 #if NH_3D
-  ("DepthFlag",             m_depthFlag          , std::vector<Int>(1,0), "Depth Flag")
-#endif
-  ("TargetEncLayerIdList",  m_targetEncLayerIdList, std::vector<Int>(0,0), "LayerIds in Nuh to be encoded")  
-  ("LayerIdInNuh",          m_layerIdInNuh        , std::vector<Int>(1,0), "LayerId in Nuh")  
+  ("DepthFlag",                      m_depthFlag                   , IntAry1d(1,0),                                 "Depth Flag")
+#endif
+  ("TargetEncLayerIdList",           m_targetEncLayerIdList        , IntAry1d(0,0),                                 "LayerIds in Nuh to be encoded")  
+  ("LayerIdInNuh",                   m_layerIdInNuh                , IntAry1d(1,0),                                 "LayerId in Nuh")  
   ("SplittingFlag",         m_splittingFlag       , false                , "Splitting Flag")    
 
   // Layer Sets + Output Layer Sets + Profile Tier Level
   ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")    
-  ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set")  
+  ("LayerIdsInSet_%d"              , m_layerIdsInSets              , IntAry1d(1,0) , MAX_VPS_OP_SETS_PLUS1      ,   "LayerIds of Layer set")  
   ("NumAddLayerSets"     , m_numAddLayerSets     , 0                                              , "NumAddLayerSets     ")
-  ("HighestLayerIdxPlus1_%d", m_highestLayerIdxPlus1, std::vector< Int  >(0,0)  ,MAX_VPS_NUM_ADD_LAYER_SETS, "HighestLayerIdxPlus1")
+  ("HighestLayerIdxPlus1_%d"       , m_highestLayerIdxPlus1        , IntAry1d(0,0) , MAX_VPS_NUM_ADD_LAYER_SETS ,   "HighestLayerIdxPlus1")
   ("DefaultTargetOutputLayerIdc"     , m_defaultOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
-  ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets")  
-
-  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set")  
-  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set")  
-  ("AltOutputLayerFlag",    m_altOutputLayerFlag , std::vector<Bool>(1,0), "Alt output layer flag")
+  ("OutputLayerSetIdx"             , m_outputLayerSetIdx           , IntAry1d(0,0)                              ,   "Indices of layer sets used as additional output layer sets")
+  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , IntAry1d(0,0) , MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set")  
+  ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet , IntAry1d(0,0) , MAX_VPS_OP_SETS_PLUS1,         "Indices in VPS of output layers in layer set")  
+  ("AltOutputLayerFlag"            , m_altOutputLayerFlag          , BoolAry1d(1,0),                                "Alt output layer flag")
   
-  ("ProfileTierLevelIdx_%d",  m_profileTierLevelIdx, std::vector<Int>(0), MAX_NUM_LAYERS, "Indices to profile level tier for ols")
+  ("ProfileTierLevelIdx_%d"        , m_profileTierLevelIdx         , IntAry1d(0)  , MAX_NUM_LAYERS,                  "Indices to profile level tier for ols")
   // Layer dependencies
-  ("DirectRefLayers_%d",    m_directRefLayers    , std::vector<Int>(0,0), MAX_NUM_LAYERS, "LayerIdx in VPS of direct reference layers")
-  ("DependencyTypes_%d",    m_dependencyTypes    , std::vector<Int>(0,0), MAX_NUM_LAYERS, "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion")
+  ("DirectRefLayers_%d"            , m_directRefLayers             , IntAry1d(0,0), MAX_NUM_LAYERS,                  "LayerIdx in VPS of direct reference layers")
+  ("DependencyTypes_%d"            , m_dependencyTypes             , IntAry1d(0,0), MAX_NUM_LAYERS,                  "Dependency types of direct reference layers, 0: Sample 1: Motion 2: Sample+Motion")
 #endif
   ("SourceWidth,-wdt",                                m_iSourceWidth,                                       0, "Source picture width")
@@ -1143,8 +1170,8 @@
   ("BitRatePresentFlag"          , m_bitRatePresentFlag          , BoolAry1d(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "BitRatePresentFlag per sub layer for the N-th layer set")
   ("PicRatePresentFlag"          , m_picRatePresentFlag          , BoolAry1d(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "PicRatePresentFlag per sub layer for the N-th layer set")
-  ("AvgBitRate"                  , m_avgBitRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "AvgBitRate         per sub layer for the N-th layer set")
-  ("MaxBitRate"                  , m_maxBitRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "MaxBitRate         per sub layer for the N-th layer set")
-  ("ConstantPicRateIdc"          , m_constantPicRateIdc          , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
-  ("AvgPicRate"                  , m_avgPicRate                  , std::vector< Int  >(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
+  ("AvgBitRate"                  , m_avgBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgBitRate         per sub layer for the N-th layer set")
+  ("MaxBitRate"                  , m_maxBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "MaxBitRate         per sub layer for the N-th layer set")
+  ("ConstantPicRateIdc"          , m_constantPicRateIdc           , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
+  ("AvgPicRate"                  , m_avgPicRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
   ("TilesNotInUseFlag"            , m_tilesNotInUseFlag            , true                                          , "TilesNotInUseFlag            ")
   ("TilesInUseFlag"               , m_tilesInUseFlag               , BoolAry1d(1,false)                   , "TilesInUseFlag               ")
@@ -1154,7 +1181,7 @@
   ("TileBoundariesAlignedFlag"   , m_tileBoundariesAlignedFlag   , BoolAry1d(1,0)  ,MAX_NUM_LAYERS       , "TileBoundariesAlignedFlag    per direct reference for the N-th layer")
   ("IlpRestrictedRefLayersFlag"  , m_ilpRestrictedRefLayersFlag  , false                                           , "IlpRestrictedRefLayersFlag")
-  ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1, std::vector< Int  >(1,0)  ,MAX_NUM_LAYERS       , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")
+  ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1 , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")
   ("CtuBasedOffsetEnabledFlag"   , m_ctuBasedOffsetEnabledFlag   , BoolAry1d(1,0)  ,MAX_NUM_LAYERS       , "CtuBasedOffsetEnabledFlag    per direct reference for the N-th layer")
-  ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1 , std::vector< Int  >(1,0)  ,MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
+  ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1  , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
   ("SingleLayerForNonIrapFlag", m_singleLayerForNonIrapFlag, false                                          , "SingleLayerForNonIrapFlag")
   ("HigherLayerIrapSkipFlag"  , m_higherLayerIrapSkipFlag  , false                                          , "HigherLayerIrapSkipFlag  ")
@@ -1305,12 +1332,15 @@
   ("SEIMasteringDisplayWhitePoint",                   cfg_DisplayWhitePointCode,     cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)")
 #if NH_MV
+#if !NH_MV_SEI
   ("SubBitstreamPropSEIEnabled",                      m_subBistreamPropSEIEnabled,    false                     ,"Enable signaling of sub-bitstream property SEI message")
   ("SEISubBitstreamNumAdditionalSubStreams",          m_sbPropNumAdditionalSubStreams,0                         ,"Number of substreams for which additional information is signalled")
-  ("SEISubBitstreamSubBitstreamMode",                 m_sbPropSubBitstreamMode,       std::vector< Int  >(1,0)  ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)")
-  ("SEISubBitstreamOutputLayerSetIdxToVps",           m_sbPropOutputLayerSetIdxToVps, std::vector< Int  >(1,0)  ,"Specifies output layer set index of the i-th sub-bitstream ")
-  ("SEISubBitstreamHighestSublayerId",                m_sbPropHighestSublayerId,      std::vector< Int  >(1,0)  ,"Specifies highest TemporalId of the i-th sub-bitstream")
-  ("SEISubBitstreamAvgBitRate",                       m_sbPropAvgBitRate,             std::vector< Int  >(1,0)  ,"Specifies average bit rate of the i-th sub-bitstream")
-  ("SEISubBitstreamMaxBitRate",                       m_sbPropMaxBitRate,             std::vector< Int  >(1,0)  ,"Specifies maximum bit rate of the i-th sub-bitstream")
-
+  ("SEISubBitstreamSubBitstreamMode",                 m_sbPropSubBitstreamMode,       IntAry1d (1,0)            ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)")
+  ("SEISubBitstreamOutputLayerSetIdxToVps",           m_sbPropOutputLayerSetIdxToVps, IntAry1d (1,0)            ,"Specifies output layer set index of the i-th sub-bitstream ")
+  ("SEISubBitstreamHighestSublayerId",                m_sbPropHighestSublayerId,      IntAry1d (1,0)            ,"Specifies highest TemporalId of the i-th sub-bitstream")
+  ("SEISubBitstreamAvgBitRate",                       m_sbPropAvgBitRate,             IntAry1d (1,0)            ,"Specifies average bit rate of the i-th sub-bitstream")
+  ("SEISubBitstreamMaxBitRate",                       m_sbPropMaxBitRate,             IntAry1d (1,0)            ,"Specifies maximum bit rate of the i-th sub-bitstream")
+#else
+  ("SeiCfgFileName_%d",                               m_seiCfgFileNames,             (Char *) 0 , MAX_NUM_SEIS , "SEI cfg file name %d")
+#endif
   ("OutputVpsInfo",                                   m_outputVpsInfo,                false                     ,"Output information about the layer dependencies and layer sets")
 #endif
@@ -1923,4 +1953,7 @@
   }
 
+#if NH_MV_SEI
+  xParseSeiCfg(); 
+#endif
   if( m_masteringDisplay.colourVolumeSEIEnabled )
   {
@@ -3295,4 +3328,5 @@
   }
   }
+#if !NH_MV_SEI
   // Check input parameters for Sub-bitstream property SEI message
   if( m_subBistreamPropSEIEnabled )
@@ -3312,4 +3346,5 @@
     }
   }
+#endif
 #endif
 
Index: branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.h	(revision 1327)
+++ branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncCfg.h	(revision 1328)
@@ -77,15 +77,15 @@
 // VPS specification
   IntAry2d m_dimIds;                   ///< dimension ids ( pointers to m_viewId and m_depthFlag 
-  std::vector<Int>       m_viewId;                            ///< view id
-  std::vector<Int>       m_viewOrderIndex;                    ///< view order index  
-  std::vector<Int>       m_auxId;                             ///< auxiliary id
+  IntAry1d               m_viewId;                            ///< view id
+  IntAry1d               m_viewOrderIndex;                    ///< view order index  
+  IntAry1d               m_auxId;                             ///< auxiliary id
 #if NH_3D
-  std::vector<Int>       m_depthFlag;                         ///< depth flag
-#endif
-  std::vector<Int>       m_targetEncLayerIdList;              ///< layer Ids in Nuh to be encoded
-  std::vector<Int>       m_layerIdInNuh;                      ///< layer Id in Nuh for each layer 
+  IntAry1d               m_depthFlag;                         ///< depth flag
+#endif
+  IntAry1d               m_targetEncLayerIdList;              ///< layer Ids in Nuh to be encoded
+  IntAry1d               m_layerIdInNuh;                      ///< layer Id in Nuh for each layer 
   Bool                   m_splittingFlag;                     ///< Splitting Flag
   Int                    m_scalabilityMask;                   ///< Mask indicating scalabilities, 1: texture; 3: texture + depth                                                                
-  std::vector<Int>       m_dimensionIdLen;                    ///< Length of scalability dimension s 
+  IntAry1d               m_dimensionIdLen;                    ///< Length of scalability dimension s 
   
 // layer sets   
@@ -95,9 +95,9 @@
   IntAry2d m_highestLayerIdxPlus1;      ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored)
   Int                    m_defaultOutputLayerIdc;             ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
-  std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets  
+  IntAry1d               m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets  
   IntAry2d m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
   IntAry2d m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
   IntAry2d               m_profileTierLevelIdx;      ///< Indices of of profile, per layer in layer set
-  std::vector<Bool>      m_altOutputLayerFlag;                ///< Alt output layer flag
+  BoolAry1d              m_altOutputLayerFlag;                ///< Alt output layer flag
 
   // Dependencies
@@ -112,10 +112,10 @@
   Bool m_bitRatePresentVpsFlag;
   Bool m_picRatePresentVpsFlag;
-  std::vector< std::vector<Bool > > m_bitRatePresentFlag;
-  std::vector< std::vector<Bool > > m_picRatePresentFlag;
-  std::vector< std::vector<Int  > > m_avgBitRate;
-  std::vector< std::vector<Int  > > m_maxBitRate;
-  std::vector< std::vector<Int  > > m_constantPicRateIdc;
-  std::vector< std::vector<Int  > > m_avgPicRate;
+  BoolAry2d              m_bitRatePresentFlag;
+  BoolAry2d              m_picRatePresentFlag;
+  IntAry2d               m_avgBitRate;
+  IntAry2d               m_maxBitRate;
+  IntAry2d               m_constantPicRateIdc;
+  IntAry2d               m_avgPicRate;
   Bool                              m_tilesNotInUseFlag; 
   BoolAry1d               m_tilesInUseFlag;
@@ -124,9 +124,9 @@
   BoolAry1d               m_wppInUseFlag;
 
-  std::vector< std::vector<Bool > > m_tileBoundariesAlignedFlag;  
+  BoolAry2d              m_tileBoundariesAlignedFlag;  
   Bool m_ilpRestrictedRefLayersFlag;
-  std::vector< std::vector<Int  > > m_minSpatialSegmentOffsetPlus1;
-  std::vector< std::vector<Bool > > m_ctuBasedOffsetEnabledFlag;
-  std::vector< std::vector<Int  > > m_minHorizontalCtuOffsetPlus1;
+  IntAry2d               m_minSpatialSegmentOffsetPlus1;
+  BoolAry2d              m_ctuBasedOffsetEnabledFlag;
+  IntAry2d               m_minHorizontalCtuOffsetPlus1;
   Bool m_singleLayerForNonIrapFlag;
   Bool m_higherLayerIrapSkipFlag;
@@ -195,5 +195,5 @@
   // coding structure
 #if NH_MV
-  std::vector<Int> m_iIntraPeriod;                            ///< period of I-slice (random access period)
+  IntAry1d  m_iIntraPeriod;                            ///< period of I-slice (random access period)
 #else
   Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
@@ -256,4 +256,8 @@
 #endif
   TComSEIMasteringDisplay m_masteringDisplay;
+#if NH_MV_SEI
+  std::vector<char*>     m_seiCfgFileNames;               ///< SEI message files.
+  SEIMessages            m_seiMessages;                       ///< Buffer for SEI messages. 
+#endif
 
   Bool      m_bUseAdaptiveQP;                                 ///< Flag for enabling QP adaptation based on a psycho-visual model
@@ -509,11 +513,13 @@
   UInt        m_summaryVerboseness;                           ///< Specifies the level of the verboseness of the text output.
 #if NH_MV
+#if !NH_MV_SEI
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_sbPropNumAdditionalSubStreams;
-  std::vector<Int>  m_sbPropSubBitstreamMode;
-  std::vector<Int>  m_sbPropOutputLayerSetIdxToVps;
-  std::vector<Int>  m_sbPropHighestSublayerId;
-  std::vector<Int>  m_sbPropAvgBitRate;
-  std::vector<Int>  m_sbPropMaxBitRate;
+  IntAry1d          m_sbPropSubBitstreamMode;
+  IntAry1d          m_sbPropOutputLayerSetIdxToVps;
+  IntAry1d          m_sbPropHighestSublayerId;
+  IntAry1d          m_sbPropAvgBitRate;
+  IntAry1d          m_sbPropMaxBitRate;
+#endif
   Bool              m_outputVpsInfo;
 #endif
@@ -654,4 +660,7 @@
   Void xPrintVectorElem( Double elem ) { printf(" %5.2f", elem            );};  
   Void xPrintVectorElem( Bool   elem ) { printf(" %d"   , ( elem ? 1 : 0 ));};
+#if NH_MV_SEI
+  Void xParseSeiCfg();
+#endif
 #endif
 #if NH_MV
Index: branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1327)
+++ branches/HTM-15.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1328)
@@ -591,4 +591,5 @@
   m_cTEncTop.setScalableNestingSEIEnabled                         ( m_scalableNestingSEIEnabled );
 #if NH_MV
+#if !NH_MV_SEI
   m_cTEncTop.setSubBitstreamPropSEIEnabled                        ( m_subBistreamPropSEIEnabled );
   if( m_subBistreamPropSEIEnabled )                               
@@ -601,4 +602,5 @@
     m_cTEncTop.setMaxBitRate                                      ( m_sbPropMaxBitRate );
   }
+#endif
 #endif
 
@@ -622,4 +624,8 @@
   m_cTEncTop.setKneeSEIOutputKneePoint                            ( m_kneeSEIOutputKneePoint );
   m_cTEncTop.setMasteringDisplaySEI                               ( m_masteringDisplay );
+
+#if NH_MV_SEI
+  m_cTEncTop.setSeiMessages                                       ( &m_seiMessages ); 
+#endif
 
   m_cTEncTop.setTileUniformSpacingFlag                            ( m_tileUniformSpacingFlag );
