Index: trunk/source/Lib/TLibEncoder/SEIEncoder.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIEncoder.cpp	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/SEIEncoder.cpp	(revision 1356)
@@ -465,4 +465,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
 Void SEIEncoder::initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps)
 {
@@ -476,5 +477,37 @@
   seiSubBitstreamProperty->m_maxBitRate              = m_pcCfg->getMaxBitRate();  
 }
+#else
+Void SEIEncoder::createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice )
+{
+  const SEIMessages* seiMessageCfg = m_pcCfg->getSeiMessages(); 
+
+  for( SEIMessages::const_iterator itS = seiMessageCfg->begin(); itS != seiMessageCfg->end(); itS++ )    
+  {      
+    const SEI* curSei = (*itS); 
+    SEI* newSei; 
+    if ( curSei->insertSei( slice->getLayerId(), slice->getPOC(), slice->getTemporalId(), slice->getNalUnitType() ) )
+    {
+      newSei = curSei->getCopy( ) ;
+
+      if ( curSei->m_modifyByEncoder )
+      {
+        newSei->setupFromSlice  ( slice ); 
+      } 
+
+      if ( newSei   ->checkCfg( slice ) )
+      {
+        std::cout << "--> Omit sending SEI."  <<  std::endl; 
+        delete newSei; 
+      }
+      else
+      {
+        seiMessage.push_back(newSei); 
+      }
+
+    }
+  }
+}
 #endif
+#endif
 
 //! \}
Index: trunk/source/Lib/TLibEncoder/SEIEncoder.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIEncoder.h	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/SEIEncoder.h	(revision 1356)
@@ -86,5 +86,9 @@
   Void initTemporalLevel0IndexSEI(SEITemporalLevel0Index *sei, TComSlice *slice);
 #if NH_MV
+#if !NH_MV_SEI
   Void initSEISubBitstreamProperty(SEISubBitstreamProperty *seiSubBitstreamProperty, const TComSPS *sps);
+#else
+  Void createAnnexFGISeiMessages( SEIMessages& seiMessage, const TComSlice* slice );;
+#endif
 #endif
 private:
Index: trunk/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1356)
@@ -122,8 +122,69 @@
     break;
 #if NH_MV
+#if !NH_MV_SEI
    case SEI::SUB_BITSTREAM_PROPERTY:
    xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
    break;
 #endif
+#endif
+#if NH_MV_SEI
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+   case SEI::LAYERS_NOT_PRESENT:
+       xWriteSEILayersNotPresent(*static_cast<const SEILayersNotPresent*>(&sei));
+     break;
+#endif
+   case SEI::INTER_LAYER_CONSTRAINED_TILE_SETS:
+     xWriteSEIInterLayerConstrainedTileSets(*static_cast<const SEIInterLayerConstrainedTileSets*>(&sei));
+     break;
+#if NH_MV_SEI_TBD
+   case SEI::BSP_NESTING:
+     xWriteSEIBspNesting(*static_cast<const SEIBspNesting*>(&sei));
+     break;
+   case SEI::BSP_INITIAL_ARRIVAL_TIME:
+     xWriteSEIBspInitialArrivalTime(*static_cast<const SEIBspInitialArrivalTime*>(&sei));
+     break;
+#endif
+   case SEI::SUB_BITSTREAM_PROPERTY:
+     xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
+     break;
+   case SEI::ALPHA_CHANNEL_INFO:
+     xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
+     break;
+   case SEI::OVERLAY_INFO:
+     xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
+     break;
+   case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
+     xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei));
+     break;
+#if NH_MV_SEI_TBD
+   case SEI::FRAME_FIELD_INFO:
+     xWriteSEIFrameFieldInfo(*static_cast<const SEIFrameFieldInfo*>(&sei));
+     break;
+#endif
+   case SEI::THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO:
+     xWriteSEIThreeDimensionalReferenceDisplaysInfo(*static_cast<const SEIThreeDimensionalReferenceDisplaysInfo*>(&sei));
+     break;
+#if SEI_DRI_F0169
+   case SEI::DEPTH_REPRESENTATION_INFO:
+       xWriteSEIDepthRepresentationInfo(*static_cast<const SEIDepthRepresentationInfo*>(&sei));
+       break;
+#endif
+   case SEI::MULTIVIEW_SCENE_INFO:
+     xWriteSEIMultiviewSceneInfo(*static_cast<const SEIMultiviewSceneInfo*>(&sei));
+     break;
+   case SEI::MULTIVIEW_ACQUISITION_INFO:
+     xWriteSEIMultiviewAcquisitionInfo(*static_cast<const SEIMultiviewAcquisitionInfo*>(&sei));
+     break;
+
+   case SEI::MULTIVIEW_VIEW_POSITION:
+     xWriteSEIMultiviewViewPosition(*static_cast<const SEIMultiviewViewPosition*>(&sei));
+     break;
+#if NH_3D
+   case SEI::ALTERNATIVE_DEPTH_INFO:
+     xWriteSEIAlternativeDepthInfo(*static_cast<const SEIAlternativeDepthInfo*>(&sei));
+     break;
+#endif
+#endif
+
 
   default:
@@ -246,5 +307,5 @@
   for (Int i = 0; i < sei.activeSeqParameterSetId.size(); i++)
   {
-    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id"); 
+    WRITE_UVLC(sei.activeSeqParameterSetId[i], "active_seq_parameter_set_id");
   }
 }
@@ -384,5 +445,5 @@
 {
   WRITE_FLAG( sei.m_arrangementCancelFlag,          "segmented_rect_frame_packing_arrangement_cancel_flag" );
-  if( sei.m_arrangementCancelFlag == 0 ) 
+  if( sei.m_arrangementCancelFlag == 0 )
   {
     WRITE_CODE( sei.m_contentInterpretationType, 2, "segmented_rect_content_interpretation_type" );
@@ -553,5 +614,5 @@
 {
   //UInt code;
-  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag"); 
+  WRITE_FLAG((sei.m_mc_all_tiles_exact_sample_value_match_flag ? 1 : 0), "mc_all_tiles_exact_sample_value_match_flag");
   WRITE_FLAG((sei.m_each_tile_one_tile_set_flag                ? 1 : 0), "each_tile_one_tile_set_flag"               );
 
@@ -568,19 +629,19 @@
 
         if(sei.m_limited_tile_set_display_flag)
-        { 
-          WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");  
-        }
-
-        WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1"); 
-        
+        {
+          WRITE_FLAG((sei.tileSetData(i).m_display_tile_set_flag ? 1 : 0), "display_tile_set_flag");
+        }
+
+        WRITE_UVLC((sei.tileSetData(i).getNumberOfTileRects() - 1), "num_tile_rects_in_set_minus1");
+
         for(Int j = 0; j < sei.tileSetData(i).getNumberOfTileRects(); j++)
         {
-          WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index");  
-          WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");  
+          WRITE_UVLC(sei.tileSetData(i).topLeftTileIndex    (j), "top_left_tile_index");
+          WRITE_UVLC(sei.tileSetData(i).bottomRightTileIndex(j), "bottom_right_tile_index");
         }
 
         if(!sei.m_mc_all_tiles_exact_sample_value_match_flag)
         {
-          WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");  
+          WRITE_FLAG((sei.tileSetData(i).m_exact_sample_value_match_flag ? 1 : 0), "exact_sample_value_match_flag");
         }
 
@@ -590,5 +651,5 @@
         {
           WRITE_FLAG((sei.tileSetData(i).m_mcts_tier_flag ? 1 : 0), "mcts_tier_flag");
-          WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc"); 
+          WRITE_CODE( sei.tileSetData(i).m_mcts_level_idc, 8,       "mcts_level_idc");
         }
       }
@@ -601,6 +662,6 @@
     if(sei.m_max_mcs_tier_level_idc_present_flag)
     {
-      WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");  
-      WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc"); 
+      WRITE_FLAG((sei.m_max_mcts_tier_flag ? 1 : 0), "max_mcts_tier_flag");
+      WRITE_CODE( sei.m_max_mcts_level_idc, 8,       "max_mcts_level_idc");
     }
   }
@@ -702,5 +763,5 @@
   userVerticalCoefficients[2][2] = 100;
   userVerticalCoefficients[2][3] = -10;
-  
+
   Int const iNumHorizontalFilters = 1;
   Int horizontalTapLength_minus1[iNumHorizontalFilters] = {3};
@@ -748,4 +809,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
 {
@@ -765,9 +827,10 @@
 }
 #endif
+#endif
 
 Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei)
 {
   WRITE_UVLC( sei.m_kneeId, "knee_function_id" );
-  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" ); 
+  WRITE_FLAG( sei.m_kneeCancelFlag, "knee_function_cancel_flag" );
   if ( !sei.m_kneeCancelFlag )
   {
@@ -800,5 +863,5 @@
   WRITE_CODE( sei.values.whitePoint[0],    16,  "white_point_x" );
   WRITE_CODE( sei.values.whitePoint[1],    16,  "white_point_y" );
-    
+
   WRITE_CODE( sei.values.maxLuminance,     32,  "max_display_mastering_luminance" );
   WRITE_CODE( sei.values.minLuminance,     32,  "min_display_mastering_luminance" );
@@ -818,3 +881,558 @@
 }
 
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+Void SEIWriter::xWriteSEILayersNotPresent(const SEILayersNotPresent& sei)
+{
+  WRITE_CODE( sei.m_lnpSeiActiveVpsId, 4, "lnp_sei_active_vps_id" );
+  for( Int i = 0; i  <  sei.m_lnpSeiMaxLayers; i++ )
+  {
+    WRITE_FLAG( ( sei.m_layerNotPresentFlag[i] ? 1 : 0 ), "layer_not_present_flag" );
+  }
+};
+#endif
+
+
+
+Void SEIWriter::xWriteSEIInterLayerConstrainedTileSets( const SEIInterLayerConstrainedTileSets& sei)
+{
+  WRITE_FLAG( ( sei.m_ilAllTilesExactSampleValueMatchFlag ? 1 : 0 ), "il_all_tiles_exact_sample_value_match_flag" );
+  WRITE_FLAG( ( sei.m_ilOneTilePerTileSetFlag ? 1 : 0 ),             "il_one_tile_per_tile_set_flag" );
+  if( !sei.m_ilOneTilePerTileSetFlag )
+  {
+    WRITE_UVLC( sei.m_ilNumSetsInMessageMinus1, "il_num_sets_in_message_minus1" );
+    if( sei.m_ilNumSetsInMessageMinus1 )
+    {
+      WRITE_FLAG( ( sei.m_skippedTileSetPresentFlag ? 1 : 0 ), "skipped_tile_set_present_flag" );
+    }
+    Int numSignificantSets = sei.m_ilNumSetsInMessageMinus1 - sei.m_skippedTileSetPresentFlag + 1;
+    for( Int i = 0; i < numSignificantSets; i++ )
+    {
+      WRITE_UVLC( sei.m_ilctsId[i],                   "ilcts_id" );
+      WRITE_UVLC( sei.m_ilNumTileRectsInSetMinus1[i], "il_num_tile_rects_in_set_minus1" );
+      for( Int j = 0; j  <= sei.m_ilNumTileRectsInSetMinus1[ i ]; j++ )
+      {
+        WRITE_UVLC( sei.m_ilTopLeftTileIndex[i][j],     "il_top_left_tile_index" );
+        WRITE_UVLC( sei.m_ilBottomRightTileIndex[i][j], "il_bottom_right_tile_index" );
+      }
+      WRITE_CODE( sei.m_ilcIdc[i], 2, "ilc_idc" );
+      if ( !sei.m_ilAllTilesExactSampleValueMatchFlag )
+      {
+        WRITE_FLAG( ( sei.m_ilExactSampleValueMatchFlag[i] ? 1 : 0 ), "il_exact_sample_value_match_flag" );
+      }
+    }
+  }
+  else
+  {
+    WRITE_CODE( sei.m_allTilesIlcIdc, 2, "all_tiles_ilc_idc" );
+  }
+};
+
+#if NH_MV_SEI_TBD
+Void SEIWriter::xWriteSEIBspNesting( const SEIBspNesting& sei)
+{
+  WRITE_UVLC( sei.m_seiOlsIdx, "sei_ols_idx" );
+  WRITE_UVLC( sei.m_seiPartitioningSchemeIdx, "sei_partitioning_scheme_idx" );
+  WRITE_UVLC( sei.m_bspIdx, "bsp_idx" );
+  while( !ByteaLigned(() ) );
+  {
+    WRITE_CODE( sei.m_bspNestingZeroBit, *equalto0*/u1, "bsp_nesting_zero_bit" );
+  }
+  WRITE_UVLC( sei.m_numSeisInBspMinus1, "num_seis_in_bsp_minus1" );
+  for( Int i = 0; i  <=  NumSeisInBspMinus1( ); i++ )
+  {
+    SeiMessage(() );
+  }
+};
+
+Void SEIWriter::xWriteSEIBspInitialArrivalTime( const SEIBspInitialArrivalTime& sei)
+{
+  psIdx = SeiPartitioningSchemeIdx();
+  if( nalInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      WRITE_CODE( sei.m_nalInitialArrivalDelay[i], getNalInitialArrivalDelayLen ), "nal_initial_arrival_delay" );
+    }
+  }
+  if( vclInitialArrivalDelayPresent )
+  {
+    for( Int i = 0; i < BspSchedCnt( SeiOlsIdx(), psIdx, MaxTemporalId( 0 ) ); i++ )
+    {
+      WRITE_CODE( sei.m_vclInitialArrivalDelay[i], getVclInitialArrivalDelayLen ), "vcl_initial_arrival_delay" );
+    }
+  }
+};
+#endif
+Void SEIWriter::xWriteSEISubBitstreamProperty( const SEISubBitstreamProperty& sei)
+{
+  WRITE_CODE( sei.m_sbPropertyActiveVpsId, 4,      "sb_property_active_vps_id"         );
+  WRITE_UVLC( sei.m_numAdditionalSubStreamsMinus1, "num_additional_sub_streams_minus1" );
+  for( Int i = 0; i  <=  sei.m_numAdditionalSubStreamsMinus1; i++ )
+  {
+    WRITE_CODE( sei.m_subBitstreamMode    [i], 2,  "sub_bitstream_mode"       );
+    WRITE_UVLC( sei.m_olsIdxToVps         [i],     "ols_idx_to_vps"           );
+    WRITE_CODE( sei.m_highestSublayerId   [i], 3,  "highest_sublayer_id"      );
+    WRITE_CODE( sei.m_avgSbPropertyBitRate[i], 16, "avg_sb_property_bit_rate" );
+    WRITE_CODE( sei.m_maxSbPropertyBitRate[i], 16, "max_sb_property_bit_rate" );
+  }
+};
+
+Void SEIWriter::xWriteSEIAlphaChannelInfo( const SEIAlphaChannelInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_alphaChannelCancelFlag ? 1 : 0 ), "alpha_channel_cancel_flag" );
+  if( !sei.m_alphaChannelCancelFlag )
+  {
+    WRITE_CODE( sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc" );
+    WRITE_CODE( sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8" );
+    WRITE_CODE( sei.m_alphaTransparentValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_transparent_value" );
+    WRITE_CODE( sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8+9, "alpha_opaque_value" );
+    WRITE_FLAG( ( sei.m_alphaChannelIncrFlag ? 1 : 0 ), "alpha_channel_incr_flag" );
+    WRITE_FLAG( ( sei.m_alphaChannelClipFlag ? 1 : 0 ), "alpha_channel_clip_flag" );
+    if( sei.m_alphaChannelClipFlag )
+    {
+      WRITE_FLAG( ( sei.m_alphaChannelClipTypeFlag ? 1 : 0 ), "alpha_channel_clip_type_flag" );
+    }
+  }
+};
+
+Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_overlayInfoCancelFlag ? 1 : 0 ), "overlay_info_cancel_flag" );
+  if( !sei.m_overlayInfoCancelFlag )
+  {
+    WRITE_UVLC( sei.m_overlayContentAuxIdMinus128, "overlay_content_aux_id_minus128" );
+    WRITE_UVLC( sei.m_overlayLabelAuxIdMinus128, "overlay_label_aux_id_minus128" );
+    WRITE_UVLC( sei.m_overlayAlphaAuxIdMinus128, "overlay_alpha_aux_id_minus128" );
+    WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" );
+    WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" );
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1 ; i++ )
+    {
+      WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" );
+      WRITE_FLAG( ( sei.m_languageOverlayPresentFlag[i] ? 1 : 0 ), "language_overlay_present_flag" );
+      WRITE_CODE( sei.m_overlayContentLayerId[i], 6, "overlay_content_layer_id" );
+      WRITE_FLAG( ( sei.m_overlayLabelPresentFlag[i] ? 1 : 0 ), "overlay_label_present_flag" );
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        WRITE_CODE( sei.m_overlayLabelLayerId[i], 6, "overlay_label_layer_id" );
+      }
+      WRITE_FLAG( ( sei.m_overlayAlphaPresentFlag[i] ? 1 : 0 ), "overlay_alpha_present_flag" );
+      if( sei.m_overlayAlphaPresentFlag[i] )
+      {
+        WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id" );
+      }
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        WRITE_UVLC( sei.m_numOverlayElementsMinus1[i], "num_overlay_elements_minus1" );
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          WRITE_CODE( sei.m_overlayElementLabelMin[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_min" );
+          WRITE_CODE( sei.m_overlayElementLabelMax[i][j], (sei.m_overlayElementLabelValueLengthMinus8 + 8), "overlay_element_label_max" );
+        }
+      }
+    }
+
+    // byte alignment
+    while ( m_pcBitIf->getNumberOfWrittenBits() % 8 != 0 )
+    {
+      WRITE_FLAG( 0, "overlay_zero_bit" );
+    }
+
+    UChar* stmp;
+    UInt ilength;
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
+    {
+      if( sei.m_languageOverlayPresentFlag[i] )
+      {
+        stmp = (UChar*) strdup( sei.m_overlayLanguage[i].c_str() );
+        ilength = (UInt) sei.m_overlayLanguage[i].size();
+        WRITE_STRING( stmp, ilength, "overlay_language" );
+        free(stmp);
+      }
+      stmp = (UChar*) strdup( sei.m_overlayName[i].c_str() );
+      ilength = (UInt) sei.m_overlayName[i].size();
+      WRITE_STRING( stmp, ilength, "overlay_name" );
+      free(stmp);
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          stmp = (UChar*) strdup( sei.m_overlayElementName[i][j].c_str() );
+          ilength = (UInt) sei.m_overlayElementName[i][j].size();
+          WRITE_STRING( stmp, ilength, "overlay_element_name" );
+          free(stmp);
+        }
+      }
+    }
+    WRITE_FLAG( ( sei.m_overlayInfoPersistenceFlag ? 1 : 0 ), "overlay_info_persistence_flag" );
+  }
+};
+
+Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei)
+{
+  WRITE_FLAG( ( sei.m_prevPicsNotUsedFlag    ? 1 : 0 ), "prev_pics_not_used_flag"     );
+  WRITE_FLAG( ( sei.m_noIntraLayerColPicFlag ? 1 : 0 ), "no_intra_layer_col_pic_flag" );
+};
+
+#if NH_MV_SEI_TBD
+Void SEIWriter::xWriteSEIFrameFieldInfo( const SEIFrameFieldInfo& sei)
+{
+  WRITE_CODE( sei.m_ffinfoPicStruct, 4, "ffinfo_pic_struct" );
+  WRITE_CODE( sei.m_ffinfoSourceScanType, 2, "ffinfo_source_scan_type" );
+  WRITE_FLAG( ( sei.m_ffinfoDuplicateFlag ? 1 : 0 ), "ffinfo_duplicate_flag" );
+};
+#endif
+
+Void SEIWriter::xWriteSEIThreeDimensionalReferenceDisplaysInfo( const SEIThreeDimensionalReferenceDisplaysInfo& sei)
+{
+  WRITE_UVLC( sei.m_precRefDisplayWidth, "prec_ref_display_width" );
+  WRITE_FLAG( ( sei.m_refViewingDistanceFlag ? 1 : 0 ), "ref_viewing_distance_flag" );
+  if( sei.m_refViewingDistanceFlag )
+  {
+    WRITE_UVLC( sei.m_precRefViewingDist, "prec_ref_viewing_dist" );
+  }
+  WRITE_UVLC( sei.m_numRefDisplaysMinus1, "num_ref_displays_minus1" );
+  for( Int i = 0; i  <=  sei.getNumRefDisplaysMinus1( ); i++ )
+  {
+    WRITE_UVLC( sei.m_leftViewId[i], "left_view_id" );
+    WRITE_UVLC( sei.m_rightViewId[i], "right_view_id" );
+    WRITE_CODE( sei.m_exponentRefDisplayWidth[i], 6, "exponent_ref_display_width" );
+    WRITE_CODE( sei.m_mantissaRefDisplayWidth[i], sei.getMantissaReferenceDisplayWidthLen(i) , "mantissa_ref_display_width" );
+    if( sei.m_refViewingDistanceFlag )
+    {
+      WRITE_CODE( sei.m_exponentRefViewingDistance[i], 6, "exponent_ref_viewing_distance" );
+      WRITE_CODE( sei.m_mantissaRefViewingDistance[i], sei.getMantissaReferenceViewingDistanceLen(i), "mantissa_ref_viewing_distance" );
+    }
+    WRITE_FLAG( ( sei.m_additionalShiftPresentFlag[i] ? 1 : 0 ), "additional_shift_present_flag" );
+    if( sei.m_additionalShiftPresentFlag[i] )
+    {
+      WRITE_CODE( sei.m_numSampleShiftPlus512[i], 10, "num_sample_shift_plus512" );
+    }
+  }
+  WRITE_FLAG( ( sei.m_threeDimensionalReferenceDisplaysExtensionFlag ? 1 : 0 ), "three_dimensional_reference_displays_extension_flag" );
+};
+
+#if SEI_DRI_F0169
+Void SEIWriter::xWriteSEIDepthRepresentationInfo( const SEIDepthRepresentationInfo& sei)
+{
+
+    assert(sei.m_currLayerID>=0);
+
+    WRITE_FLAG( ( sei.m_zNearFlag[sei.m_currLayerID] ? 1 : 0 ), "z_near_flag" );
+    WRITE_FLAG( ( sei.m_zFarFlag[sei.m_currLayerID] ? 1 : 0 ), "z_far_flag" );
+    WRITE_FLAG( ( sei.m_dMinFlag[sei.m_currLayerID] ? 1 : 0 ), "d_min_flag" );
+    WRITE_FLAG( ( sei.m_dMaxFlag[sei.m_currLayerID] ? 1 : 0 ), "d_max_flag" );
+    WRITE_UVLC( sei.m_depthRepresentationType[sei.m_currLayerID][0], "depth_representation_type" );
+    if( sei.m_dMinFlag[sei.m_currLayerID]  ||  sei.m_dMaxFlag[sei.m_currLayerID] )
+    {
+        WRITE_UVLC( sei.m_disparityRefViewId[sei.m_currLayerID][0], "disparity_ref_view_id" );
+    }
+    if( sei.m_zNearFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_zNear[sei.m_currLayerID][0]);
+    }
+    if( sei.m_zFarFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_zFar[sei.m_currLayerID][0]);
+    }
+    if( sei.m_dMinFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_dMin[sei.m_currLayerID][0]);
+    }
+    if( sei.m_dMaxFlag[sei.m_currLayerID] )
+    {
+        xWriteSEIDepthRepInfoElement(sei.m_dMax[sei.m_currLayerID][0]);
+    }
+
+    if (sei.m_depthRepresentationType[sei.m_currLayerID][0] == 3)
+    {
+        WRITE_UVLC( sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0], "depth_nonlinear_representation_num_minus1" );
+        for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1[sei.m_currLayerID][0] + 1; i++ )
+        {
+            WRITE_UVLC(sei.m_depth_nonlinear_representation_model[sei.m_currLayerID][i-1],"depth_nonlinear_representation_model[ i ]");
+        }
+    }
+}
+
+Void SEIWriter::xWriteSEIDepthRepInfoElement( double f)
+{
+    UInt x_sign, x_exp, x_mantissa,x_mantissa_len;
+    if (f < 0)
+    {
+        f = f * (-1);
+        x_sign = 1;
+    }
+    else
+    {
+        x_sign = 0;
+    }
+    int exponent=0;
+    if(f >= 1)
+    {
+        while(f>=2)
+        {
+            exponent++;
+            f = f/2;
+        }
+    }
+    else
+    {
+        while (f<1)
+        {
+            exponent++;
+            f = f*2;
+        }
+        exponent=-exponent;
+    }
+
+    int i;
+    f = f -1;
+    double s = 1;
+    char s_mantissa[32];
+    double thr=1.0/(4.0*(1<<30));
+
+    if (f>=thr)
+    {
+        for(i=0;i<32;i++)
+        {
+            s /= 2;
+            if(f>=s)
+            {
+                f = f-s;
+                s_mantissa[i]=1;
+
+                if (f<thr)
+                    break;
+            }
+            else
+            {
+                s_mantissa[i]=0;
+            }
+        }
+
+        if (i<32)
+            x_mantissa_len=i+1;
+        else
+            x_mantissa_len=32;
+
+        x_mantissa=0;
+
+        for(i=0;i<x_mantissa_len;i++)
+        {
+            if (s_mantissa[i]==1)
+                x_mantissa += (1u)<<(x_mantissa_len-1-i) ;
+        }
+
+    }
+    else
+    {
+        x_mantissa=0;
+        x_mantissa_len=1;
+    }
+
+    assert(exponent>=-31 && exponent<= (1<<7)-32);
+    x_exp=exponent+31;
+
+    WRITE_FLAG(  x_sign,                         "da_sign_flag" );
+    WRITE_CODE(  x_exp, 7 ,                      "da_exponent" );
+    WRITE_CODE( x_mantissa_len-1, 5 ,            "da_mantissa_len_minus1" );
+    WRITE_CODE( x_mantissa, x_mantissa_len ,     "da_mantissa" );
+
+};
+#endif
+Void SEIWriter::xWriteSEIMultiviewSceneInfo( const SEIMultiviewSceneInfo& sei)
+{
+  WRITE_SVLC( sei.m_minDisparity     , "min_disparity"       );
+  WRITE_UVLC( sei.m_maxDisparityRange, "max_disparity_range" );
+};
+
+
+Void SEIWriter::xWriteSEIMultiviewAcquisitionInfo( const SEIMultiviewAcquisitionInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_intrinsicParamFlag ? 1 : 0 ), "intrinsic_param_flag" );
+  WRITE_FLAG( ( sei.m_extrinsicParamFlag ? 1 : 0 ), "extrinsic_param_flag" );
+  if( sei.m_intrinsicParamFlag )
+  {
+    WRITE_FLAG( ( sei.m_intrinsicParamsEqualFlag ? 1 : 0 ), "intrinsic_params_equal_flag" );
+    WRITE_UVLC(   sei.m_precFocalLength                   , "prec_focal_length"           );
+    WRITE_UVLC(   sei.m_precPrincipalPoint                , "prec_principal_point"        );
+    WRITE_UVLC(   sei.m_precSkewFactor                    , "prec_skew_factor"            );
+
+    for( Int i = 0; i  <=  ( sei.m_intrinsicParamsEqualFlag ? 0 : sei.getNumViewsMinus1() ); i++ )
+    {
+      WRITE_FLAG( ( sei.m_signFocalLengthX       [i] ? 1 : 0 ),                                         "sign_focal_length_x"        );
+      WRITE_CODE(   sei.m_exponentFocalLengthX   [i]          , 6                                  ,    "exponent_focal_length_x"    );
+      WRITE_CODE(   sei.m_mantissaFocalLengthX   [i]          , sei.getMantissaFocalLengthXLen( i ),    "mantissa_focal_length_x"    );
+      WRITE_FLAG( ( sei.m_signFocalLengthY       [i] ? 1 : 0 ),                                         "sign_focal_length_y"        );
+      WRITE_CODE(   sei.m_exponentFocalLengthY   [i]          , 6                                  ,    "exponent_focal_length_y"    );
+      WRITE_CODE(   sei.m_mantissaFocalLengthY   [i]          , sei.getMantissaFocalLengthYLen( i ),    "mantissa_focal_length_y"    );
+      WRITE_FLAG( ( sei.m_signPrincipalPointX    [i] ? 1 : 0 ),                                         "sign_principal_point_x"     );
+      WRITE_CODE(   sei.m_exponentPrincipalPointX[i]          , 6,                                      "exponent_principal_point_x" );
+      WRITE_CODE(   sei.m_mantissaPrincipalPointX[i]          , sei.getMantissaPrincipalPointXLen( i ), "mantissa_principal_point_x" );
+      WRITE_FLAG( ( sei.m_signPrincipalPointY    [i] ? 1 : 0 ),                                         "sign_principal_point_y"     );
+      WRITE_CODE(   sei.m_exponentPrincipalPointY[i]          , 6,                                      "exponent_principal_point_y" );
+      WRITE_CODE(   sei.m_mantissaPrincipalPointY[i]          , sei.getMantissaPrincipalPointYLen( i ), "mantissa_principal_point_y" );
+      WRITE_FLAG( ( sei.m_signSkewFactor         [i] ? 1 : 0 ),                                         "sign_skew_factor"           );
+      WRITE_CODE(   sei.m_exponentSkewFactor     [i]          , 6,                                      "exponent_skew_factor"       );
+      WRITE_CODE(   sei.m_mantissaSkewFactor     [i]          , sei.getMantissaSkewFactorLen( i )  ,    "mantissa_skew_factor"       );
+    }
+  }
+  if( sei.m_extrinsicParamFlag )
+  {
+    WRITE_UVLC( sei.m_precRotationParam   , "prec_rotation_param"    );
+    WRITE_UVLC( sei.m_precTranslationParam, "prec_translation_param" );
+    for( Int i = 0; i  <=  sei.getNumViewsMinus1(); i++ )
+    {
+      for( Int j = 0; j  <=  2; j++ )  /* row */
+      {
+        for( Int k = 0; k  <=  2; k++ )  /* column */
+        {
+          WRITE_FLAG( ( sei.m_signR    [i][j][k] ? 1 : 0 ),                                "sign_r"     );
+          WRITE_CODE(   sei.m_exponentR[i][j][k]          , 6,                             "exponent_r" );
+          WRITE_CODE(   sei.m_mantissaR[i][j][k]          , sei.getMantissaRLen( i,j,k ) , "mantissa_r" );
+        }
+        WRITE_FLAG( ( sei.m_signT    [i][j] ? 1 : 0 ),                          "sign_t"     );
+        WRITE_CODE(   sei.m_exponentT[i][j]          , 6,                       "exponent_t" );
+        WRITE_CODE(   sei.m_mantissaT[i][j]          , sei.getMantissaTLen( i,j ),"mantissa_t" );
+      }
+    }
+  }
+};
+
+
+#if NH_MV_SEI
+Void SEIWriter::xWriteSEIMultiviewViewPosition( const SEIMultiviewViewPosition& sei)
+{
+  WRITE_UVLC( sei.m_numViewsMinus1, "num_views_minus1" );
+  for( Int i = 0; i  <=  sei.m_numViewsMinus1; i++ )
+  {
+    WRITE_UVLC( sei.m_viewPosition[i], "view_position" );
+  }
+};
+#endif
+
+#if NH_3D
+Void SEIWriter::xWriteSEIAlternativeDepthInfo( const SEIAlternativeDepthInfo& sei)
+{
+  WRITE_FLAG( ( sei.m_alternativeDepthInfoCancelFlag ? 1 : 0 ), "alternative_depth_info_cancel_flag" );
+  if( sei.m_alternativeDepthInfoCancelFlag  ==  0 )
+  {
+    WRITE_CODE( sei.m_depthType, 2, "depth_type" );
+
+    if( sei.m_depthType  ==  0 )
+    {
+      WRITE_UVLC( sei.m_numConstituentViewsGvdMinus1, "num_constituent_views_gvd_minus1" );
+      WRITE_FLAG( ( sei.m_depthPresentGvdFlag ? 1 : 0 ), "depth_present_gvd_flag" );
+      WRITE_FLAG( ( sei.m_zGvdFlag ? 1 : 0 ), "z_gvd_flag" );
+      WRITE_FLAG( ( sei.m_intrinsicParamGvdFlag ? 1 : 0 ), "intrinsic_param_gvd_flag" );
+      WRITE_FLAG( ( sei.m_rotationGvdFlag ? 1 : 0 ), "rotation_gvd_flag" );
+      WRITE_FLAG( ( sei.m_translationGvdFlag ? 1 : 0 ), "translation_gvd_flag" );
+      if( sei.m_zGvdFlag )
+      {
+        for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
+        {
+          WRITE_FLAG( ( sei.m_signGvdZNearFlag[i][j] ? 1 : 0 ), "sign_gvd_z_near_flag" );
+          WRITE_CODE( sei.m_expGvdZNear[i][j], 7, "exp_gvd_z_near" );
+          WRITE_CODE( sei.m_manLenGvdZNearMinus1[i][j], 5, "man_len_gvd_z_near_minus1" );
+          WRITE_CODE( sei.m_manGvdZNear[i][j], sei.m_manLenGvdZNearMinus1[i][j] + 1, "man_gvd_z_near" );
+          WRITE_FLAG( ( sei.m_signGvdZFarFlag[i][j] ? 1 : 0 ), "sign_gvd_z_far_flag" );
+          WRITE_CODE( sei.m_expGvdZFar[i][j], 7, "exp_gvd_z_far" );
+          WRITE_CODE( sei.m_manLenGvdZFarMinus1[i][j], 5, "man_len_gvd_z_far_minus1" );
+          WRITE_CODE( sei.m_manGvdZFar[i][j], sei.m_manLenGvdZFarMinus1[i][j] + 1, "man_gvd_z_far" );
+        }
+      }
+      if( sei.m_intrinsicParamGvdFlag )
+      {
+        WRITE_UVLC( sei.m_precGvdFocalLength, "prec_gvd_focal_length" );
+        WRITE_UVLC( sei.m_precGvdPrincipalPoint, "prec_gvd_principal_point" );
+      }
+      if( sei.m_rotationGvdFlag )
+      {
+        WRITE_UVLC( sei.m_precGvdRotationParam, "prec_gvd_rotation_param" );
+      }
+      if( sei.m_translationGvdFlag )
+      {
+        WRITE_UVLC( sei.m_precGvdTranslationParam, "prec_gvd_translation_param" );
+      }
+      for( Int i = 0, j = 0; j  <=  sei.m_numConstituentViewsGvdMinus1 + 1; j++ )
+      {
+        if( sei.m_intrinsicParamGvdFlag )
+        {
+          WRITE_FLAG( ( sei.m_signGvdFocalLengthX[i][j] ? 1 : 0 ), "sign_gvd_focal_length_x" );
+          WRITE_CODE( sei.m_expGvdFocalLengthX[i][j], 6, "exp_gvd_focal_length_x" );
+          WRITE_CODE( sei.m_manGvdFocalLengthX[i][j], sei.getManGvdFocalLengthXLen(i,j), "man_gvd_focal_length_x" );
+          WRITE_FLAG( ( sei.m_signGvdFocalLengthY[i][j] ? 1 : 0 ), "sign_gvd_focal_length_y" );
+          WRITE_CODE( sei.m_expGvdFocalLengthY[i][j], 6, "exp_gvd_focal_length_y" );
+          WRITE_CODE( sei.m_manGvdFocalLengthY[i][j], sei.getManGvdFocalLengthYLen(i,j), "man_gvd_focal_length_y" );
+          WRITE_FLAG( ( sei.m_signGvdPrincipalPointX[i][j] ? 1 : 0 ), "sign_gvd_principal_point_x" );
+          WRITE_CODE( sei.m_expGvdPrincipalPointX[i][j], 6, "exp_gvd_principal_point_x" );
+          WRITE_CODE( sei.m_manGvdPrincipalPointX[i][j], sei.getManGvdPrincipalPointXLen(i,j), "man_gvd_principal_point_x" );
+          WRITE_FLAG( ( sei.m_signGvdPrincipalPointY[i][j] ? 1 : 0 ), "sign_gvd_principal_point_y" );
+          WRITE_CODE( sei.m_expGvdPrincipalPointY[i][j], 6, "exp_gvd_principal_point_y" );
+          WRITE_CODE( sei.m_manGvdPrincipalPointY[i][j], sei.getManGvdPrincipalPointYLen(i,j), "man_gvd_principal_point_y" );
+        }
+        if( sei.m_rotationGvdFlag )
+        {
+          WRITE_FLAG( ( sei.m_signGvdR00[i][j] ? 1 : 0 ), "sign_gvd_r00" );
+          WRITE_CODE( sei.m_expGvdR00[i][j], 6, "exp_gvd_r00" );
+          WRITE_CODE( sei.m_manGvdR00[i][j], sei.m_precGvdRotationParam, "man_gvd_r00" );
+          WRITE_FLAG( ( sei.m_signGvdR01[i][j] ? 1 : 0 ), "sign_gvd_r01" );
+          WRITE_CODE( sei.m_expGvdR01[i][j], 6, "exp_gvd_r01" );
+          WRITE_CODE( sei.m_manGvdR01[i][j], sei.m_precGvdRotationParam, "man_gvd_r01" );
+          WRITE_FLAG( ( sei.m_signGvdR02[i][j] ? 1 : 0 ), "sign_gvd_r02" );
+          WRITE_CODE( sei.m_expGvdR02[i][j], 6, "exp_gvd_r02" );
+          WRITE_CODE( sei.m_manGvdR02[i][j], sei.m_precGvdRotationParam, "man_gvd_r02" );
+          WRITE_FLAG( ( sei.m_signGvdR10[i][j] ? 1 : 0 ), "sign_gvd_r10" );
+          WRITE_CODE( sei.m_expGvdR10[i][j], 6, "exp_gvd_r10" );
+          WRITE_CODE( sei.m_manGvdR10[i][j], sei.m_precGvdRotationParam, "man_gvd_r10" );
+          WRITE_FLAG( ( sei.m_signGvdR11[i][j] ? 1 : 0 ), "sign_gvd_r11" );
+          WRITE_CODE( sei.m_expGvdR11[i][j], 6, "exp_gvd_r11" );
+          WRITE_CODE( sei.m_manGvdR11[i][j], sei.m_precGvdRotationParam, "man_gvd_r11" );
+          WRITE_FLAG( ( sei.m_signGvdR12[i][j] ? 1 : 0 ), "sign_gvd_r12" );
+          WRITE_CODE( sei.m_expGvdR12[i][j], 6, "exp_gvd_r12" );
+          WRITE_CODE( sei.m_manGvdR12[i][j], sei.m_precGvdRotationParam, "man_gvd_r12" );
+          WRITE_FLAG( ( sei.m_signGvdR20[i][j] ? 1 : 0 ), "sign_gvd_r20" );
+          WRITE_CODE( sei.m_expGvdR20[i][j], 6, "exp_gvd_r20" );
+          WRITE_CODE( sei.m_manGvdR20[i][j], sei.m_precGvdRotationParam, "man_gvd_r20" );
+          WRITE_FLAG( ( sei.m_signGvdR21[i][j] ? 1 : 0 ), "sign_gvd_r21" );
+          WRITE_CODE( sei.m_expGvdR21[i][j], 6, "exp_gvd_r21" );
+          WRITE_CODE( sei.m_manGvdR21[i][j], sei.m_precGvdRotationParam, "man_gvd_r21" );
+          WRITE_FLAG( ( sei.m_signGvdR22[i][j] ? 1 : 0 ), "sign_gvd_r22" );
+          WRITE_CODE( sei.m_expGvdR22[i][j], 6, "exp_gvd_r22" );
+          WRITE_CODE( sei.m_manGvdR22[i][j], sei.m_precGvdRotationParam, "man_gvd_r22" );
+        }
+        if( sei.m_translationGvdFlag )
+        {
+          WRITE_FLAG( ( sei.m_signGvdTX[i][j] ? 1 : 0 ), "sign_gvd_t_x" );
+          WRITE_CODE( sei.m_expGvdTX[i][j], 6, "exp_gvd_t_x" );
+          WRITE_CODE( sei.m_manGvdTX[i][j], sei.getManGvdTXLen(i,j), "man_gvd_t_x" );
+        }
+      }
+    }
+
+    if( sei.m_depthType  ==  1 )
+    {
+      WRITE_SVLC( sei.m_minOffsetXInt, "min_offset_x_int" );
+      WRITE_CODE( sei.m_minOffsetXFrac, 8, "min_offset_x_frac" );
+      WRITE_SVLC( sei.m_maxOffsetXInt, "max_offset_x_int" );
+      WRITE_CODE( sei.m_maxOffsetXFrac, 8, "max_offset_x_frac" );
+      WRITE_FLAG( ( sei.m_offsetYPresentFlag ? 1 : 0 ), "offset_y_present_flag" );
+      if( sei.m_offsetYPresentFlag )
+      {
+        WRITE_SVLC( sei.m_minOffsetYInt, "min_offset_y_int" );
+        WRITE_CODE( sei.m_minOffsetYFrac, 8, "min_offset_y_frac" );
+        WRITE_SVLC( sei.m_maxOffsetYInt, "max_offset_y_int" );
+        WRITE_CODE( sei.m_maxOffsetYFrac, 8, "max_offset_y_frac" );
+      }
+      WRITE_FLAG( ( sei.m_warpMapSizePresentFlag ? 1 : 0 ), "warp_map_size_present_flag" );
+      if( sei.m_warpMapSizePresentFlag )
+      {
+        WRITE_UVLC( sei.m_warpMapWidthMinus2, "warp_map_width_minus2" );
+        WRITE_UVLC( sei.m_warpMapHeightMinus2, "warp_map_height_minus2" );
+      }
+    }
+  }
+};
+#endif
+
+
 //! \}
Index: trunk/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 1356)
@@ -72,5 +72,7 @@
   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, const TComSPS *sps);
 #if NH_MV
+#if !NH_MV_SEI
   Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
+#endif
 #endif
   Void xWriteSEITempMotionConstrainedTileSets(const SEITempMotionConstrainedTileSets& sei);
@@ -81,6 +83,34 @@
   Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei);
 
+#if NH_MV_SEI
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  Void xWriteSEILayersNotPresent              ( const SEILayersNotPresent& sei);
+#endif
+  Void xWriteSEIInterLayerConstrainedTileSets ( const SEIInterLayerConstrainedTileSets& sei);
+#if NH_MV_SEI_TBD
+  Void xWriteSEIBspNesting                    ( const SEIBspNesting& sei);
+  Void xWriteSEIBspInitialArrivalTime         ( const SEIBspInitialArrivalTime& sei);
+#endif
+  Void xWriteSEISubBitstreamProperty          ( const SEISubBitstreamProperty& sei);
+  Void xWriteSEIAlphaChannelInfo              ( const SEIAlphaChannelInfo& sei);
+  Void xWriteSEIOverlayInfo                   ( const SEIOverlayInfo& sei);
+  Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei);
+#if NH_MV_SEI_TBD
+  Void xWriteSEIFrameFieldInfo                ( const SEIFrameFieldInfo& sei);
+#endif
+  Void xWriteSEIThreeDimensionalReferenceDisplaysInfo ( const SEIThreeDimensionalReferenceDisplaysInfo& sei);
+#if SEI_DRI_F0169
+  Void xWriteSEIDepthRepInfoElement           ( double f);
+  Void xWriteSEIDepthRepresentationInfo       ( const SEIDepthRepresentationInfo& sei);
+#endif
+  Void xWriteSEIMultiviewSceneInfo            ( const SEIMultiviewSceneInfo& sei);
+  Void xWriteSEIMultiviewAcquisitionInfo      ( const SEIMultiviewAcquisitionInfo& sei);
+  Void xWriteSEIMultiviewViewPosition         ( const SEIMultiviewViewPosition& sei);
+#if NH_3D
+  Void xWriteSEIAlternativeDepthInfo          ( const SEIAlternativeDepthInfo& sei);
+#endif
   Void xWriteByteAlign();
 };
+#endif
 
 //! \}
Index: trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1356)
@@ -127,4 +127,14 @@
 }
 
+Void  SyntaxElementWriter::xWriteStringTr( UChar* value, UInt length, const Char *pSymbolName)
+{
+  xWriteString(value, length);
+  if( g_HLSTraceEnable )
+  {
+    fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+    fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, length, value ); 
+  }
+}
+
 #endif
 
@@ -166,4 +176,14 @@
 }
 
+Void  SyntaxElementWriter::xWriteString( UChar* sCode, UInt uiLength)
+{
+  assert(m_pcBitIf->getNumberOfWrittenBits() % 8 == 0 );
+  for (Int i=0 ; i<uiLength; i++)
+  {
+    m_pcBitIf->write( sCode[i], 8 );
+  }
+  m_pcBitIf->write( 0, 8 ); //zero-termination byte
+}
+
 Void SyntaxElementWriter::xWriteRbspTrailingBits()
 {
Index: trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h
===================================================================
--- trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1356)
@@ -56,4 +56,5 @@
 #define WRITE_SVLC( value,         name)    xWriteSvlcTr ( value,         name )
 #define WRITE_FLAG( value,         name)    xWriteFlagTr ( value,         name )
+#define WRITE_STRING( value, length, name)   xWriteStringTr( value, length, name )
 
 #else
@@ -63,4 +64,5 @@
 #define WRITE_SVLC( value,         name)     xWriteSvlc ( value )
 #define WRITE_FLAG( value,         name)     xWriteFlag ( value )
+#define WRITE_STRING( value, length, name)   xWriteString( value, length )
 
 #endif
@@ -82,4 +84,5 @@
   Void  xWriteSvlc            ( Int  iCode   );
   Void  xWriteFlag            ( UInt uiCode );
+  Void  xWriteString          ( UChar* sCode, UInt uiLength);
 #if ENC_DEC_TRACE
   Void  xWriteCodeTr          ( UInt value, UInt  length, const Char *pSymbolName);
@@ -87,4 +90,5 @@
   Void  xWriteSvlcTr          ( Int  value,               const Char *pSymbolName);
   Void  xWriteFlagTr          ( UInt value,               const Char *pSymbolName);
+  Void  xWriteStringTr        ( UChar* value, UInt length, const Char *pSymbolName);
 #endif
   Void xWriteRbspTrailingBits();
Index: trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1356)
@@ -49,4 +49,8 @@
 #include "TAppCommon/TAppComCamPara.h"
 #include "TLibRenderer/TRenModSetupStrParser.h"
+#endif
+
+#if NH_MV
+#include "TLibCommon/SEI.h"
 #endif
 
@@ -350,4 +354,7 @@
   Int*      m_kneeSEIOutputKneePoint;
   TComSEIMasteringDisplay m_masteringDisplay;
+#if NH_MV_SEI
+  SEIMessages* m_seiMessages; 
+#endif
   //====== Weighted Prediction ========
   Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
@@ -432,4 +439,5 @@
 
 #if NH_MV
+#if !NH_MV_SEI
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_numAdditionalSubStreams;
@@ -439,4 +447,5 @@
   std::vector<Int>  m_avgBitRate;
   std::vector<Int>  m_maxBitRate;
+#endif
 #endif
 
@@ -933,4 +942,8 @@
   const TComSEIMasteringDisplay &getMasteringDisplaySEI() const      { return m_masteringDisplay; }
 #if NH_MV
+#if NH_MV_SEI
+  Void setSeiMessages(SEIMessages *p)                                { m_seiMessages = p;    }
+  const SEIMessages*  getSeiMessages()                               { return m_seiMessages; }
+#else
   Bool   getSubBitstreamPropSEIEnabled()                             { return m_subBistreamPropSEIEnabled;}
   Void   setSubBitstreamPropSEIEnabled(Bool x)                       { m_subBistreamPropSEIEnabled = x;}
@@ -958,5 +971,5 @@
   Int   getMaxBitRate(Int idx)                                       { return m_maxBitRate[idx];}
   Void  setMaxBitRate(std::vector<Int> &x)                           { m_maxBitRate = x;}
-
+#endif
 #endif
 
Index: trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1321)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1356)
@@ -100,7 +100,7 @@
   m_layerId      = 0;
   m_viewId       = 0;
-  m_pocLastCoded = -1; 
+  m_pocLastCoded = -1;
 #if NH_3D
-  m_viewIndex  =   0; 
+  m_viewIndex  =   0;
   m_isDepth = false;
 #endif
@@ -147,5 +147,5 @@
 
 #if NH_MV
-  m_ivPicLists           = pcTEncTop->getIvPicLists(); 
+  m_ivPicLists           = pcTEncTop->getIvPicLists();
   m_layerId              = pcTEncTop->getLayerId();
   m_viewId               = pcTEncTop->getViewId();
@@ -156,6 +156,6 @@
 #endif
 #if NH_3D_IC
-  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
-  m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
+  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate();
+  m_aICEnableNum         = pcTEncTop->getICEnableNum();
 #endif
 #if KWU_FIX_URQ
@@ -207,5 +207,5 @@
 #if NH_MV
   if ( getLayerId() == 0 )
-  {  
+  {
     actualTotalBits += xWriteVPS(accessUnit, m_pcEncTop->getVPS());
   }
@@ -277,5 +277,5 @@
 
   while ( (itNalu!=accessUnit.end())&&
-    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER 
+    ( (*itNalu)->m_nalUnitType==NAL_UNIT_ACCESS_UNIT_DELIMITER
     || (*itNalu)->m_nalUnitType==NAL_UNIT_VPS
     || (*itNalu)->m_nalUnitType==NAL_UNIT_SPS
@@ -288,5 +288,5 @@
   SEIMessages localMessages = seiMessages;
   SEIMessages currentMessages;
-  
+
 #if ENC_DEC_TRACE
   g_HLSTraceEnable = !testWrite;
@@ -299,5 +299,5 @@
   xWriteSEI(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(currentMessages, !testWrite);
-  
+
   // Buffering period SEI must always be following active parameter sets
   currentMessages = extractSeisByType(localMessages, SEI::BUFFERING_PERIOD);
@@ -328,4 +328,11 @@
   xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
   xClearSEIs(currentMessages, !testWrite);
+
+#if NH_MV_LAYERS_NOT_PRESENT_SEI
+  // Layers not present SEI message
+  currentMessages = extractSeisByType(localMessages, SEI::LAYERS_NOT_PRESENT);
+  xWriteSEISeparately(NAL_UNIT_PREFIX_SEI, currentMessages, accessUnit, itNalu, temporalId, sps);
+  xClearSEIs(currentMessages, !testWrite);
+#endif
 
   // And finally everything else one by one
@@ -412,9 +419,6 @@
 Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TComSPS *sps, const TComPPS *pps)
 {
-#if NH_MV
-  OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI, 0, getLayerId());
-#else
   OutputNALUnit nalu(NAL_UNIT_PREFIX_SEI);
-#endif
+
   if(m_pcCfg->getActiveParameterSetsSEIEnabled())
   {
@@ -472,5 +476,5 @@
     seiMessages.push_back(sei);
   }
-    
+
   if(m_pcCfg->getMasteringDisplaySEI().colourVolumeSEIEnabled)
   {
@@ -482,10 +486,12 @@
 
 #if NH_MV
+#if !NH_MV_SEI
   if( m_pcCfg->getSubBitstreamPropSEIEnabled() && ( getLayerId() == 0 ) )
   {
     SEISubBitstreamProperty *sei = new SEISubBitstreamProperty;
-    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );   
+    m_seiEncoder.initSEISubBitstreamProperty( sei, sps );
     seiMessages.push_back(sei);
   }
+#endif
 #endif
 }
@@ -679,5 +685,5 @@
       }
     }
-    
+
     if( m_pcCfg->getPictureTimingSEIEnabled() )
     {
@@ -715,5 +721,5 @@
     return;
   }
-  // fix first 
+  // fix first
   UInt numNalUnits = (UInt)testAU.size();
   UInt numRBSPBytes = 0;
@@ -927,5 +933,5 @@
           IRAPGOPid = iGOPid;
           IRAPtoReorder = true;
-          swapIRAPForward = true; 
+          swapIRAPForward = true;
           break;
         }
@@ -935,5 +941,5 @@
           IRAPGOPid = iGOPid;
           IRAPtoReorder = true;
-          swapIRAPForward = false; 
+          swapIRAPForward = false;
           break;
         }
@@ -1066,6 +1072,6 @@
 #endif
 #if NH_MV
-Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, 
-                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP, 
+Void TEncGOP::compressPicInGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic,
+                                TComList<TComPicYuv*>& rcListPicYuvRecOut,  std::list<AccessUnit>& accessUnitsInGOP,
                                 Bool isField, Bool isTff, const InputColourSpaceConversion snr_conversion, const Bool printFrameMSE, Int iGOPid )
 #else
@@ -1170,5 +1176,5 @@
     pcPic->setCurrSliceIdx(0);
 #if NH_MV
-    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );     
+    m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, m_pcEncTop->getVPS(), getLayerId(), isField  );
 #else
     m_pcSliceEncoder->initEncSlice ( pcPic, iPOCLast, pocCurr, iGOPid, pcSlice, isField );
@@ -1181,17 +1187,17 @@
     pcSlice->setSliceIdx(0);
 #if NH_MV
-    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 ); 
+    pcSlice->setRefPicSetInterLayer ( &m_refPicSetInterLayer0, &m_refPicSetInterLayer1 );
     pcPic  ->setLayerId     ( getLayerId()   );
-    pcPic  ->setViewId      ( getViewId()    );    
+    pcPic  ->setViewId      ( getViewId()    );
 #if !NH_3D
     pcSlice->setLayerId     ( getLayerId() );
-    pcSlice->setViewId      ( getViewId()  );    
+    pcSlice->setViewId      ( getViewId()  );
     pcSlice->setVPS         ( m_pcEncTop->getVPS() );
 #else
-    pcPic  ->setViewIndex   ( getViewIndex() ); 
+    pcPic  ->setViewIndex   ( getViewIndex() );
     pcPic  ->setIsDepth( getIsDepth() );
-    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );    
-#endif
-#endif 
+    pcSlice->setCamparaSlice( pcPic->getCodedScale(), pcPic->getCodedOffset() );
+#endif
+#endif
     //set default slice level flag to the same as SPS level flag
     pcSlice->setLFCrossSliceBoundaryFlag(  pcSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()  );
@@ -1201,6 +1207,6 @@
     if( pcSlice->getSliceType() == B_SLICE )
     {
-      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
-      { 
+      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
+      {
         pcSlice->setSliceType( P_SLICE );
       }
@@ -1210,6 +1216,6 @@
     if( pcSlice->getSliceType() == B_SLICE )
     {
-      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' ) 
-      { 
+      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' )
+      {
         pcSlice->setSliceType( I_SLICE );
       }
@@ -1225,5 +1231,5 @@
       pcSlice->setSliceType(I_SLICE);
     }
-    
+
     // Set the nal unit type
     pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
@@ -1279,5 +1285,5 @@
     pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     }
-    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP()) 
+    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false, m_iLastRecoveryPicPOC, m_pcCfg->getDecodingRefreshType() == 3) != 0) || (pcSlice->isIRAP())
       || (m_pcCfg->getEfficientFieldIRAPEnabled() && isField && pcSlice->getAssociatedIRAPType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getAssociatedIRAPType() <= NAL_UNIT_CODED_SLICE_CRA && pcSlice->getAssociatedIRAPPOC() == pcSlice->getPOC()+1)
       )
@@ -1288,5 +1294,5 @@
     pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
 
-    if(pcSlice->getTLayer() > 0 
+    if(pcSlice->getTLayer() > 0
       &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
           || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
@@ -1358,34 +1364,34 @@
     if ( pcSlice->getPPS()->getNumExtraSliceHeaderBits() > 0 )
     {
-      // Some more sophisticated algorithm to determine discardable_flag might be added here. 
-      pcSlice->setDiscardableFlag           ( false );     
-    }    
-
-    const TComVPS*           vps = pcSlice->getVPS();     
+      // Some more sophisticated algorithm to determine discardable_flag might be added here.
+      pcSlice->setDiscardableFlag           ( false );
+    }
+
+    const TComVPS*           vps = pcSlice->getVPS();
 #if NH_3D
-    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() ); 
+    Int numDirectRefLayers = vps    ->getNumRefListLayers( getLayerId() );
 #else
-    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() ); 
+    Int numDirectRefLayers = vps    ->getNumDirectRefLayers( getLayerId() );
 #endif
 #if NH_3D
-    pcSlice->setIvPicLists( m_ivPicLists );         
+    pcSlice->setIvPicLists( m_ivPicLists );
 
     Int gopNum = (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid;
-    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );     
+    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( gopNum );
 #else
-    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );     
-#endif
-
-
-    
-    Bool interLayerPredLayerIdcPresentFlag = false; 
+    GOPEntry gopEntry      = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && getLayerId() > 0) ? MAX_GOP : iGOPid );
+#endif
+
+
+
+    Bool interLayerPredLayerIdcPresentFlag = false;
     if ( getLayerId() > 0 && !vps->getAllRefLayersActiveFlag() && numDirectRefLayers > 0 )
-    {         
-      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );     
+    {
+      pcSlice->setInterLayerPredEnabledFlag ( gopEntry.m_numActiveRefLayerPics > 0 );
       if ( pcSlice->getInterLayerPredEnabledFlag() && numDirectRefLayers > 1 )
       {
         if ( !vps->getMaxOneActiveRefLayerFlag() )
-        {    
-          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 ); 
+        {
+          pcSlice->setNumInterLayerRefPicsMinus1( gopEntry.m_numActiveRefLayerPics - 1 );
         }
 #if NH_3D
@@ -1394,9 +1400,9 @@
         if ( gopEntry.m_numActiveRefLayerPics != vps->getNumDirectRefLayers( getLayerId() ) )
 #endif
-        {        
-          interLayerPredLayerIdcPresentFlag = true; 
+        {
+          interLayerPredLayerIdcPresentFlag = true;
           for (Int i = 0; i < gopEntry.m_numActiveRefLayerPics; i++ )
           {
-            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] ); 
+            pcSlice->setInterLayerPredLayerIdc( i, gopEntry.m_interLayerPredLayerIdc[ i ] );
           }
         }
@@ -1405,5 +1411,5 @@
     if ( !interLayerPredLayerIdcPresentFlag )
     {
-      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )   
+      for( Int i = 0; i < pcSlice->getNumActiveRefLayerPics(); i++ )
       {
         pcSlice->setInterLayerPredLayerIdc(i, pcSlice->getRefLayerPicIdc( i ) );
@@ -1412,13 +1418,13 @@
 
 
-    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics ); 
-    
+    assert( pcSlice->getNumActiveRefLayerPics() == gopEntry.m_numActiveRefLayerPics );
+
 #if NH_3D
     if ( m_pcEncTop->decProcAnnexI() )
-    {    
-      pcSlice->deriveInCmpPredAndCpAvailFlag( ); 
+    {
+      pcSlice->deriveInCmpPredAndCpAvailFlag( );
       if ( pcSlice->getInCmpPredAvailFlag() )
-      {      
-        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag ); 
+      {
+        pcSlice->setInCompPredFlag( gopEntry.m_interCompPredFlag );
       }
       else
@@ -1434,11 +1440,11 @@
             printf( "\nError: Frame%d_l%d cannot enable inter-component prediction on slice level. All reference layers need to be available and at least one tool using inter-component prediction must be enabled in the SPS. \n", gopNum, pcSlice->getVPS()->getLayerIdInVps( getLayerId() ) );
           }
-          
+
           exit(EXIT_FAILURE);
         }
       }
-      pcSlice->init3dToolParameters(); 
-      pcSlice->checkInCompPredRefLayers(); 
-    }   
+      pcSlice->init3dToolParameters();
+      pcSlice->checkInCompPredRefLayers();
+    }
 #if NH_3D_IV_MERGE
     // This needs to be done after initialization of 3D tool parameters.
@@ -1447,5 +1453,5 @@
 #endif
 
-    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 
+    pcSlice->createInterLayerReferencePictureSet( m_ivPicLists, m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
     pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
     pcSlice->setNumRefIdx(REF_PIC_LIST_1,min(gopEntry.m_numRefPicsActive,( pcSlice->getRPS()->getNumberOfPictures() + (Int) m_refPicSetInterLayer0.size() + (Int) m_refPicSetInterLayer1.size()) ) );
@@ -1456,7 +1462,7 @@
 
     pcSlice->getTempRefPicLists( rcListPic, m_refPicSetInterLayer0, m_refPicSetInterLayer1, tempRefPicLists, usedAsLongTerm, numPocTotalCurr, true );
-    
-
-    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );    
+
+
+    xSetRefPicListModificationsMv( tempRefPicLists, pcSlice, iGOPid );
 #else
     pcSlice->setNumRefIdx(REF_PIC_LIST_0,min(m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive,pcSlice->getRPS()->getNumberOfPictures()));
@@ -1464,6 +1470,6 @@
 #endif
     //  Set reference list
-#if NH_MV    
-    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr ); 
+#if NH_MV
+    pcSlice->setRefPicList( tempRefPicLists, usedAsLongTerm, numPocTotalCurr );
 #else
     pcSlice->setRefPicList ( rcListPic );
@@ -1477,6 +1483,6 @@
 #endif
 #if NH_3D_IC
-    pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
-    pcSlice->setICEnableNum( m_aICEnableNum );         
+    pcSlice->setICEnableCandidate( m_aICEnableCandidate );
+    pcSlice->setICEnableNum( m_aICEnableNum );
 #endif
 
@@ -1485,7 +1491,7 @@
     if ( pcSlice->getSliceType() == B_SLICE )
     {
-      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' ) 
-      { 
-        pcSlice->setSliceType( P_SLICE ); 
+      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() == true && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'P' )
+      {
+        pcSlice->setSliceType( P_SLICE );
       }
     }
@@ -1566,8 +1572,8 @@
 
 #if NH_3D_VSO
-  // Should be moved to TEncTop !!! 
+  // Should be moved to TEncTop !!!
   Bool bUseVSO = m_pcEncTop->getUseVSO();
-  
-  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();   
+
+  TComRdCost* pcRdCost = m_pcEncTop->getRdCost();
 
   pcRdCost->setUseVSO( bUseVSO );
@@ -1725,5 +1731,5 @@
 #endif
 #if NH_3D
-      pcSlice->setDepthToDisparityLUTs(); 
+      pcSlice->setDepthToDisparityLUTs();
 
 #endif
@@ -1835,4 +1841,8 @@
     xCreatePerPictureSEIMessages(iGOPid, leadingSeiMessages, nestedSeiMessages, pcSlice);
 
+#if NH_MV_SEI
+    m_seiEncoder.createAnnexFGISeiMessages( leadingSeiMessages, pcSlice );
+#endif
+
     /* use the main bitstream buffer for storing the marshalled picture */
     m_pcEntropyCoder->setBitstream(NULL);
@@ -1980,5 +1990,5 @@
     cabac_zero_word_padding(pcSlice, pcPic, binCountsInNalUnits, numBytesInVclNalUnits, accessUnit.back()->m_nalUnitData, m_pcCfg->getCabacZeroWordPaddingEnabled());
 #if NH_3D
-      pcPic->compressMotion(2); 
+      pcPic->compressMotion(2);
 #else
     pcPic->compressMotion();
@@ -2055,7 +2065,7 @@
     pcPic->setReconMark   ( true );
 #if NH_MV
-      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );  
-      std::vector<Int> temp; 
-      TComSlice::markCurrPic( pcPic ); 
+      TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 );
+      std::vector<Int> temp;
+      TComSlice::markCurrPic( pcPic );
 #endif
     m_bFirst = false;
@@ -2094,5 +2104,5 @@
   //-- all
 #if NH_MV
-  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );   
+  printf( "\n\nSUMMARY -------------------------------------------- LayerId %2d\n", getLayerId() );
 #else
   printf( "\n\nSUMMARY --------------------------------------------------------\n" );
@@ -2402,6 +2412,6 @@
 #if H_3D_VSO_SYNTH_DIST_OUT
 }
-#endif 
-#endif  
+#endif
+#endif
   /* calculate the size of the access unit, excluding:
    *  - any AnnexB contributions (start_code_prefix, zero_byte, etc.,)
@@ -2526,5 +2536,5 @@
 
 #if  NH_MV
-  assert( 0 ); // Field coding and MV need to be aligned. 
+  assert( 0 ); // Field coding and MV need to be aligned.
 #else
 
@@ -2969,21 +2979,21 @@
 #if NH_MV
 Void TEncGOP::xSetRefPicListModificationsMv( std::vector<TComPic*> tempPicLists[2], TComSlice* pcSlice, UInt iGOPid )
-{ 
-  
+{
+
   if( pcSlice->getSliceType() == I_SLICE || !(pcSlice->getPPS()->getListsModificationPresentFlag()) || pcSlice->getNumActiveRefLayerPics() == 0 )
   {
     return;
   }
-  
+
   GOPEntry ge = m_pcCfg->getGOPEntry( (pcSlice->getRapPicFlag() && ( pcSlice->getLayerId( ) > 0) ) ? MAX_GOP : iGOPid );
-  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() ); 
-
-  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();  
-
-  // GT: check if SliceType should be checked here. 
+  assert( ge.m_numActiveRefLayerPics == pcSlice->getNumActiveRefLayerPics() );
+
+  Int numPicsInTempList     = pcSlice->getNumRpsCurrTempList();
+
+  // GT: check if SliceType should be checked here.
   for (Int li = 0; li < 2; li ++) // Loop over lists L0 and L1
   {
-    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 ); 
-            
+    Int numPicsInFinalRefList = pcSlice->getNumRefIdx( ( li == 0 ) ? REF_PIC_LIST_0 : REF_PIC_LIST_1 );
+
     Int finalIdxToTempIdxMap[16];
     for( Int k = 0; k < 16; k++ )
@@ -2999,38 +3009,38 @@
         // get position in temp. list
         Int refPicLayerId = pcSlice->getRefPicLayerId(k);
-        Int idxInTempList = 0; 
+        Int idxInTempList = 0;
         for (; idxInTempList < numPicsInTempList; idxInTempList++)
         {
           if ( (tempPicLists[li][idxInTempList])->getLayerId() == refPicLayerId )
           {
-            break; 
+            break;
           }
         }
 
         Int idxInFinalList = ge.m_interViewRefPosL[ li ][ k ];
-        
-        // Add negative from behind 
-        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList; 
-        
+
+        // Add negative from behind
+        idxInFinalList = ( idxInFinalList < 0 )? ( numPicsInTempList + idxInFinalList ) : idxInFinalList;
+
         Bool curIsModified = ( idxInFinalList != idxInTempList ) && ( ( idxInTempList < numPicsInFinalRefList ) || ( idxInFinalList < numPicsInFinalRefList ) ) ;
         if ( curIsModified )
         {
-          isModified = true; 
+          isModified = true;
           assert( finalIdxToTempIdxMap[ idxInFinalList ] == -1 ); // Assert when two inter layer reference pictures are sorted to the same position
         }
-        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;              
+        finalIdxToTempIdxMap[ idxInFinalList ] = idxInTempList;
       }
     }
 
     TComRefPicListModification* refPicListModification = pcSlice->getRefPicListModification();
-    refPicListModification->setRefPicListModificationFlagL( li, isModified );  
+    refPicListModification->setRefPicListModificationFlagL( li, isModified );
 
     if( isModified )
     {
       Int refIdx = 0;
-      
+
       for( Int i = 0; i < numPicsInFinalRefList; i++ )
       {
-        if( finalIdxToTempIdxMap[i] >= 0 ) 
+        if( finalIdxToTempIdxMap[i] >= 0 )
         {
           refPicListModification->setRefPicSetIdxL( li, i, finalIdxToTempIdxMap[i] );
@@ -3042,5 +3052,5 @@
           while( ( refIdx < numPicsInTempList ) && ( tempPicLists[li][refIdx]->getLayerId() != getLayerId())  )
           {
-            refIdx++; 
+            refIdx++;
           }
           refPicListModification->setRefPicSetIdxL( li, i, refIdx );
