Index: branches/HTM-15.1-dev0-Disney/cfg/SEI/overlayInfoSei.cfg
===================================================================
--- branches/HTM-15.1-dev0-Disney/cfg/SEI/overlayInfoSei.cfg	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/cfg/SEI/overlayInfoSei.cfg	(revision 1342)
@@ -1,38 +1,34 @@
-
-PayloadType                     : TBD
+PayloadType                     : 166
 
 #======== Applicability  ==========    ( SEI is only send for pictures in intersection )
-ApplicableLayerIds              : TBD                            # LayerIds      of layers   to which the SEI is added. (all when empty)
-ApplicablePocs                  : TBD                            # POCs          of pictures to which the SEI is added. (all when empty)
-ApplicableTids                  : TBD                            # Tids          of pictures to which the SEI is added. (all when empty)
-ApplicableVclNaluTypes          : TBD                            # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
+ApplicableLayerIds              :                             # LayerIds      of layers   to which the SEI is added. (all when empty)
+ApplicablePocs                  :                             # POCs          of pictures to which the SEI is added. (all when empty)
+ApplicableTids                  :                             # Tids          of pictures to which the SEI is added. (all when empty)
+ApplicableVclNaluTypes          :                             # NaluUnitTypes of picture  to which the SEI is added. (all when empty)
 
 #======== Position in bit stream  ============
-SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added. 
+SeiNaluId                       : 0                              # Identifies to which NAL unit  the SEI is added.
 PositionInSeiNalu               : 0                              # Identifies the position within the NAL unit
 
 #======== Payload modification =============
-ModifyByEncoder                 : TBD                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
+ModifyByEncoder                 : 0                            #  0: Use payload as specified in cfg file   1: Modify SEI by encoder.
 
 #======== Payload specification =============
 OverlayInfoCancelFlag           : 0
-OverlayContentAuxIdMinus128     : 0
-OverlayLabelAuxIdMinus128       : 0
-OverlayAlphaAuxIdMinus128       : 0
+OverlayContentAuxIdMinus128     : 1
+OverlayLabelAuxIdMinus128       : 2
+OverlayAlphaAuxIdMinus128       : 3
 OverlayElementLabelValueLengthMinus8: 0
 NumOverlaysMinus1               : 0
-OverlayIdx                      : 0
-LanguageOverlayPresentFlag      : 0
-OverlayContentLayerId           : 0
-OverlayLabelPresentFlag         : 0
-OverlayLabelLayerId             : 0
+OverlayIdx                      : 5
+LanguageOverlayPresentFlag      : 1
+OverlayContentLayerId           : 10
+OverlayLabelPresentFlag         : 1
+OverlayLabelLayerId             : 20
 OverlayAlphaPresentFlag         : 0
-OverlayAlphaLayerId             : 0
-NumOverlayElementsMinus1        : 0
-OverlayElementLabelMin_0        : 0
-OverlayElementLabelMax_0        : 0
-OverlayZeroBit                  : 0
-OverlayLanguage                 : 0
-OverlayName                     : 0
-OverlayElementName_0            : 0
-OverlayInfoPersistenceFlag      : 0
+OverlayAlphaLayerId             : 30
+NumOverlayElementsMinus1        : 3
+OverlayElementLabelMin_0        : 40 100 170 230
+OverlayElementLabelMax_0        : 80 140 210 255
+OverlayInfoPersistenceFlag      : 1
+
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibCommon/SEI.cpp	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibCommon/SEI.cpp	(revision 1342)
@@ -234,7 +234,5 @@
   case SEI::SUB_BITSTREAM_PROPERTY                :               return new SEISubBitstreamProperty;
   case SEI::ALPHA_CHANNEL_INFO                    :               return new SEIAlphaChannelInfo;
-#if NH_MV_SEI_TBD
   case SEI::OVERLAY_INFO                          :               return new SEIOverlayInfo;
-#endif
   case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS    :               return new SEITemporalMvPredictionConstraints;
 #if NH_MV_SEI_TBD
@@ -740,61 +738,33 @@
 
 };
-#if NH_MV_SEI_TBD
-Void SEIOverlayInfo::setupFromSlice  ( const TComSlice* slice )
-{
-  sei.m_overlayInfoCancelFlag =  TBD ;
-  if( !sei.m_overlayInfoCancelFlag )
-  {
-    sei.m_overlayContentAuxIdMinus128 =  TBD ;
-    sei.m_overlayLabelAuxIdMinus128 =  TBD ;
-    sei.m_overlayAlphaAuxIdMinus128 =  TBD ;
-    sei.m_overlayElementLabelValueLengthMinus8 =  TBD ;
-    sei.m_numOverlaysMinus1 =  TBD ;
-    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
+
+SEIOverlayInfo::SEIOverlayInfo ( ) 
+  : m_numOverlaysMax(16)
+  , m_numOverlayElementsMax(256)
+  , m_numStringBytesMax(256) //incl. null termination byte
+{ };
+
+Void SEIOverlayInfo::initStringElements ( )  
+{
+  // Set some string values for syntax elements of declarator type st(v)
+  m_overlayLanguage.resize(m_numOverlaysMax);
+  m_overlayName.resize(m_numOverlaysMax);
+  m_overlayElementName.resize(m_numOverlaysMax);
+  char* cstr = new char[m_numStringBytesMax];
+  for ( Int i=0 ; i<m_numOverlaysMax ; i++ )
+  {
+    sprintf(cstr, "LanguageTag%02d", i);
+    m_overlayLanguage[i] = std::string(cstr);
+    sprintf(cstr, "Overlay%02dName", i);
+    m_overlayName[i] = std::string(cstr);
+
+    m_overlayElementName[i].resize(m_numOverlayElementsMax);
+    for ( Int j=0 ; j<m_numOverlayElementsMax ; j++ )
     {
-      sei.m_overlayIdx[i] =  TBD ;
-      sei.m_languageOverlayPresentFlag[i] =  TBD ;
-      sei.m_overlayContentLayerId[i] =  TBD ;
-      sei.m_overlayLabelPresentFlag[i] =  TBD ;
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        sei.m_overlayLabelLayerId[i] =  TBD ;
-      }
-      sei.m_overlayAlphaPresentFlag[i] =  TBD ;
-      if( sei.m_overlayAlphaPresentFlag( i ) )
-      {
-        sei.m_overlayAlphaLayerId[i] =  TBD ;
-      }
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        sei.m_numOverlayElementsMinus1[i] =  TBD ;
-        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
-        {
-          sei.m_overlayElementLabelMin[i][j] =  TBD ;
-          sei.m_overlayElementLabelMax[i][j] =  TBD ;
-        }
-      }
+      sprintf(cstr, "Overlay%02dElement%03dName", i, j);
+      m_overlayElementName[i][j] = std::string(cstr);
     }
-    while( !ByteaLigned(() ) );
-    {
-      sei.m_overlayZeroBit =  TBD ;
-    }
-    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
-    {
-      if( sei.m_languageOverlayPresentFlag( i ) )
-      {
-        sei.m_overlayLanguage[i] =  TBD ;
-      }
-      sei.m_overlayName[i] =  TBD ;
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
-        {
-          sei.m_overlayElementName[i][j] =  TBD ;
-        }
-      }
-    }
-    sei.m_overlayInfoPersistenceFlag =  TBD ;
-  }
+  }
+  delete [] cstr;
 };
 
@@ -804,13 +774,13 @@
   IntAry1d defAppLayerIds, defAppPocs, defAppTids, defAppVclNaluTypes; 
 
-  // TBD: Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
-  defAppLayerIds    .push_back( TBD );
-  defAppPocs        .push_back( TBD );
-  defAppTids        .push_back( TBD );
-  defAppVclNaluTypes.push_back( TBD );
+  // Add default values for which layers, POCS, Tids or Nalu types the SEI should be send. 
+  defAppLayerIds    .clear();
+  defAppPocs        .push_back( 0 );
+  defAppTids        .push_back( 0 );
+  defAppVclNaluTypes = IDR_NAL_UNIT_TYPES;
 
   Int      defSeiNaluId                  = 0; 
   Int      defPositionInSeiNalu          = 0; 
-  Bool     defModifyByEncoder            = TBD; 
+  Bool     defModifyByEncoder            = false; 
 
   // Setup config file options
@@ -819,26 +789,22 @@
 
   opts.addOptions()
-    ("OverlayInfoCancelFlag"          , m_overlayInfoCancelFlag            , false                          , "OverlayInfoCancelFlag"            )
-    ("OverlayContentAuxIdMinus128"    , m_overlayContentAuxIdMinus128      , 0                              , "OverlayContentAuxIdMinus128"      )
-    ("OverlayLabelAuxIdMinus128"      , m_overlayLabelAuxIdMinus128        , 0                              , "OverlayLabelAuxIdMinus128"        )
-    ("OverlayAlphaAuxIdMinus128"      , m_overlayAlphaAuxIdMinus128        , 0                              , "OverlayAlphaAuxIdMinus128"        )
-    ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0                              , "OverlayElementLabelValueLengthMinus8")
-    ("NumOverlaysMinus1"              , m_numOverlaysMinus1                , 0                              , "NumOverlaysMinus1"                )
-    ("OverlayIdx"                     , m_overlayIdx                       , IntAry1d (1,0)                 , "OverlayIdx"                       )
-    ("LanguageOverlayPresentFlag"     , m_languageOverlayPresentFlag       , BoolAry1d(1,0)                 , "LanguageOverlayPresentFlag"       )
-    ("OverlayContentLayerId"          , m_overlayContentLayerId            , IntAry1d (1,0)                 , "OverlayContentLayerId"            )
-    ("OverlayLabelPresentFlag"        , m_overlayLabelPresentFlag          , BoolAry1d(1,0)                 , "OverlayLabelPresentFlag"          )
-    ("OverlayLabelLayerId"            , m_overlayLabelLayerId              , IntAry1d (1,0)                 , "OverlayLabelLayerId"              )
-    ("OverlayAlphaPresentFlag"        , m_overlayAlphaPresentFlag          , BoolAry1d(1,0)                 , "OverlayAlphaPresentFlag"          )
-    ("OverlayAlphaLayerId"            , m_overlayAlphaLayerId              , IntAry1d (1,0)                 , "OverlayAlphaLayerId"              )
-    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (1,0)                 , "NumOverlayElementsMinus1"         )
-    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMin"           )
-    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (1,0) ,ADDNUM         , "OverlayElementLabelMax"           )
-    ("OverlayZeroBit"                 , m_overlayZeroBit                   , 0                              , "OverlayZeroBit"                   )
-    ("OverlayLanguage"                , m_overlayLanguage                  , IntAry1d (1,0)                 , "OverlayLanguage"                  )
-    ("OverlayName"                    , m_overlayName                      , IntAry1d (1,0)                 , "OverlayName"                      )
-    ("OverlayElementName_%d"          , m_overlayElementName               , IntAry1d (1,0) ,ADDNUM         , "OverlayElementName"               )
-    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                          , "OverlayInfoPersistenceFlag"       )
-    ;
+    ("OverlayInfoCancelFlag"          , m_overlayInfoCancelFlag            , false                           , "OverlayInfoCancelFlag"            )
+    ("OverlayContentAuxIdMinus128"    , m_overlayContentAuxIdMinus128      , 0                               , "OverlayContentAuxIdMinus128"      )
+    ("OverlayLabelAuxIdMinus128"      , m_overlayLabelAuxIdMinus128        , 0                               , "OverlayLabelAuxIdMinus128"        )
+    ("OverlayAlphaAuxIdMinus128"      , m_overlayAlphaAuxIdMinus128        , 0                               , "OverlayAlphaAuxIdMinus128"        )
+    ("OverlayElementLabelValueLengthMinus8", m_overlayElementLabelValueLengthMinus8, 0                       , "OverlayElementLabelValueLengthMinus8")
+    ("NumOverlaysMinus1"              , m_numOverlaysMinus1                , 0                               , "NumOverlaysMinus1"                )
+    ("OverlayIdx"                     , m_overlayIdx                       , IntAry1d (16,0)                 , "OverlayIdx"                       )
+    ("LanguageOverlayPresentFlag"     , m_languageOverlayPresentFlag       , BoolAry1d(16,0)                 , "LanguageOverlayPresentFlag"       )
+    ("OverlayContentLayerId"          , m_overlayContentLayerId            , IntAry1d (16,0)                 , "OverlayContentLayerId"            )
+    ("OverlayLabelPresentFlag"        , m_overlayLabelPresentFlag          , BoolAry1d(16,0)                 , "OverlayLabelPresentFlag"          )
+    ("OverlayLabelLayerId"            , m_overlayLabelLayerId              , IntAry1d (16,0)                 , "OverlayLabelLayerId"              )
+    ("OverlayAlphaPresentFlag"        , m_overlayAlphaPresentFlag          , BoolAry1d(16,0)                 , "OverlayAlphaPresentFlag"          )
+    ("OverlayAlphaLayerId"            , m_overlayAlphaLayerId              , IntAry1d (16,0)                 , "OverlayAlphaLayerId"              )
+    ("NumOverlayElementsMinus1"       , m_numOverlayElementsMinus1         , IntAry1d (16,0)                 , "NumOverlayElementsMinus1"         )
+    ("OverlayElementLabelMin_%d"      , m_overlayElementLabelMin           , IntAry1d (256,0) ,16            , "OverlayElementLabelMin"           )
+    ("OverlayElementLabelMax_%d"      , m_overlayElementLabelMax           , IntAry1d (256,0) ,16            , "OverlayElementLabelMax"           )        
+    ("OverlayInfoPersistenceFlag"     , m_overlayInfoPersistenceFlag       , false                           , "OverlayInfoPersistenceFlag"       )
+    ; 
 
   po::setDefaults(opts);
@@ -847,42 +813,43 @@
   po::ErrorReporter err;
   po::parseConfigFile( opts, cfgFile, err );
-};
+
+  // Initialize some values for syntax elements with declaration type st(v) (i.e. string type syntax elements)
+  initStringElements();
+};
+
 
 Bool SEIOverlayInfo::checkCfg( const TComSlice* slice )
 { 
   // Check config values
-  Bool wrongConfig = false; 
-
-  // TBD: Add constraints on presence of SEI here. 
-  xCheckCfg     ( wrongConfig, TBD , "TBD" );
-  xCheckCfg     ( wrongConfig, TBD , "TBD" );
-
-  // TBD: Modify constraints according to the SEI semantics.   
-  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , MINVAL , MAXVAL, "overlay_info_cancel_flag"         );
-  xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128    , MINVAL , MAXVAL, "overlay_content_aux_id_minus128"  );
-  xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128      , MINVAL , MAXVAL, "overlay_label_aux_id_minus128"    );
-  xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128      , MINVAL , MAXVAL, "overlay_alpha_aux_id_minus128"    );
-  xCheckCfgRange( wrongConfig, m_overlayElementLabelValueLengthMinus8, MINVAL , MAXVAL, "overlay_element_label_value_length_minus8");
-  xCheckCfgRange( wrongConfig, m_numOverlaysMinus1              , MINVAL , MAXVAL, "num_overlays_minus1"  );
-  xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , MINVAL , MAXVAL, "overlay_idx"          );
-  xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , MINVAL , MAXVAL, "language_overlay_present_flag"    );
-  xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , MINVAL , MAXVAL, "overlay_content_layer_id"         );
-  xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , MINVAL , MAXVAL, "overlay_label_present_flag"       );
-  xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , MINVAL , MAXVAL, "overlay_label_layer_id"           );
-  xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , MINVAL , MAXVAL, "overlay_alpha_present_flag"       );
-  xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , MINVAL , MAXVAL, "overlay_alpha_layer_id"           );
-  xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , MINVAL , MAXVAL, "num_overlay_elements_minus1"       );
-  xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j]   , MINVAL , MAXVAL, "overlay_element_label_min"        );
-  xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j]   , MINVAL , MAXVAL, "overlay_element_label_max"        );
-  xCheckCfgRange( wrongConfig, m_overlayZeroBit                 , MINVAL , MAXVAL, "overlay_zero_bit"                 );
-  xCheckCfgRange( wrongConfig, m_overlayLanguage[i]             , MINVAL , MAXVAL, "overlay_language"                 );
-  xCheckCfgRange( wrongConfig, m_overlayName[i]                 , MINVAL , MAXVAL, "overlay_name"                     );
-  xCheckCfgRange( wrongConfig, m_overlayElementName[i][j]       , MINVAL , MAXVAL, "overlay_element_name"             );
-  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , MINVAL , MAXVAL, "overlay_info_persistence_flag"    );
+  Bool wrongConfig = false;   
+
+  xCheckCfgRange( wrongConfig, m_overlayInfoCancelFlag          , 0 ,   1, "overlay_info_cancel_flag"         );
+  xCheckCfgRange( wrongConfig, m_overlayContentAuxIdMinus128    , 0 ,  31, "overlay_content_aux_id_minus128"  );
+  xCheckCfgRange( wrongConfig, m_overlayLabelAuxIdMinus128      , 0 ,  31, "overlay_label_aux_id_minus128"    );
+  xCheckCfgRange( wrongConfig, m_overlayAlphaAuxIdMinus128      , 0 ,  31, "overlay_alpha_aux_id_minus128"    );
+  xCheckCfgRange( wrongConfig, m_numOverlaysMinus1              , 0 ,  m_numOverlaysMax-1, "num_overlays_minus1"  );
+  for (Int i=0 ; i<=m_numOverlaysMinus1 ; ++i)
+  {
+    xCheckCfgRange( wrongConfig, m_overlayIdx[i]                  , 0 , 255, "overlay_idx"          );
+    xCheckCfgRange( wrongConfig, m_languageOverlayPresentFlag[i]  , 0 ,   1, "language_overlay_present_flag"    );
+    xCheckCfgRange( wrongConfig, m_overlayLabelPresentFlag[i]     , 0 ,   1, "overlay_label_present_flag"       );  
+    xCheckCfgRange( wrongConfig, m_overlayAlphaPresentFlag[i]     , 0 ,   1, "overlay_alpha_present_flag"       );
+    xCheckCfgRange( wrongConfig, m_overlayContentLayerId[i]       , 0 ,   63, "overlay_content_layer_id"    );
+    xCheckCfgRange( wrongConfig, m_overlayLabelLayerId[i]         , 0 ,   63, "overlay_label_layer_id"    );
+    xCheckCfgRange( wrongConfig, m_overlayAlphaLayerId[i]         , 0 ,   63, "overlay_alpha_layer_id"    );    
+    xCheckCfgRange( wrongConfig, m_numOverlayElementsMinus1[i]    , 0 , m_numOverlayElementsMax-1, "num_overlay_elements_minus1"       );     
+    for (Int j=0 ; j<=m_numOverlayElementsMinus1[i] ; ++j)
+    {      
+      Int maxLabelMinMaxValue = ( 1 << ( m_overlayElementLabelValueLengthMinus8 + 8 ) )-1;
+      xCheckCfgRange( wrongConfig, m_overlayElementLabelMin[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_min"    );
+      xCheckCfgRange( wrongConfig, m_overlayElementLabelMax[i][j] , 0 , maxLabelMinMaxValue , "overlay_element_label_max"    );        
+    }        
+  }  
+  xCheckCfgRange( wrongConfig, m_overlayInfoPersistenceFlag     , 0 ,   1, "overlay_info_persistence_flag"    );
 
   return wrongConfig; 
 
 };
-#endif
+
 
 Void SEITemporalMvPredictionConstraints::setupFromCfgFile(const Char* cfgFile)
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibCommon/SEI.h
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibCommon/SEI.h	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibCommon/SEI.h	(revision 1342)
@@ -803,17 +803,20 @@
 };
 
-#if NH_MV_SEI_TBD
 class SEIOverlayInfo : public SEI
 {
 public:
   PayloadType payloadType( ) const { return OVERLAY_INFO; }
-  SEIOverlayInfo ( ) { };
+  SEIOverlayInfo ( );  
   ~SEIOverlayInfo( ) { };
   SEI* getCopy( ) const { return new SEIOverlayInfo(*this); }; 
 
-  Void setupFromCfgFile( const Char*      cfgFile );
-  Void setupFromSlice  ( const TComSlice* slice   );
-  Bool checkCfg        ( const TComSlice* slice   );
-
+  Void setupFromCfgFile( const Char*      cfgFile );  
+  Bool checkCfg        ( const TComSlice* slice   );
+  Void initStringElements ( );
+
+  const Int m_numOverlaysMax; 
+  const Int m_numOverlayElementsMax; 
+  const Int m_numStringBytesMax;  //incl. null termination byte
+  
   Bool      m_overlayInfoCancelFlag;
   Int       m_overlayContentAuxIdMinus128;
@@ -831,13 +834,10 @@
   IntAry1d  m_numOverlayElementsMinus1;
   IntAry2d  m_overlayElementLabelMin;
-  IntAry2d  m_overlayElementLabelMax;
-  Int       m_overlayZeroBit;
-  IntAry1d  m_overlayLanguage;
-  IntAry1d  m_overlayName;
-  IntAry2d  m_overlayElementName;
+  IntAry2d  m_overlayElementLabelMax;  
+  std::vector< std::string >  m_overlayLanguage;
+  std::vector< std::string >  m_overlayName;
+  std::vector< std::vector< std::string > >  m_overlayElementName;
   Bool      m_overlayInfoPersistenceFlag;
 };
-
-#endif
 
 class SEITemporalMvPredictionConstraints : public SEI
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SEIread.cpp	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SEIread.cpp	(revision 1342)
@@ -99,4 +99,13 @@
 }
 
+Void SEIReader::sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName)
+{  
+  READ_STRING(uiBufSize, pucCode, ruiLength, pSymbolName);
+  if (pOS)
+  {
+    (*pOS) << "  " << pSymbolName << ": " << (const char*) pucCode << "\n";
+  }
+}
+
 #if NH_MV_SEI
 inline Void SEIReader::output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize)
@@ -340,10 +349,8 @@
       xParseSEIAlphaChannelInfo((SEIAlphaChannelInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
       break;
-#if NH_MV_SEI_TBD
     case SEI::OVERLAY_INFO:
       sei = new SEIOverlayInfo;
       xParseSEIOverlayInfo((SEIOverlayInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
       break;
-#endif
     case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
       sei = new SEITemporalMvPredictionConstraints;
@@ -1357,5 +1364,4 @@
 };
 
-#if NH_MV_SEI_TBD
 Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
 {
@@ -1366,57 +1372,83 @@
   if( !sei.m_overlayInfoCancelFlag )
   {
-    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_content_aux_id_minus128" ); sei.m_overlayContentAuxIdMinus128 = code;
-    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_label_aux_id_minus128" ); sei.m_overlayLabelAuxIdMinus128 = code;
-    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_alpha_aux_id_minus128" ); sei.m_overlayAlphaAuxIdMinus128 = code;
-    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_element_label_value_length_minus8" ); sei.m_overlayElementLabelValueLengthMinus8 = code;
-    sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlays_minus1" ); sei.m_numOverlaysMinus1 = code;
-    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
-    {
-      sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_idx" ); sei.m_overlayIdx[i] = code;
-      sei_read_flag( pDecodedMessageOutputStream, code, "language_overlay_present_flag" ); sei.m_languageOverlayPresentFlag[i] = (code == 1);
-      sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_content_layer_id" ); sei.m_overlayContentLayerId[i] = code;
-      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_label_present_flag" ); sei.m_overlayLabelPresentFlag[i] = (code == 1);
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_label_layer_id" ); sei.m_overlayLabelLayerId[i] = code;
-      }
-      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_alpha_present_flag" ); sei.m_overlayAlphaPresentFlag[i] = (code == 1);
-      if( sei.m_overlayAlphaPresentFlag( i ) )
-      {
-        sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_alpha_layer_id" ); sei.m_overlayAlphaLayerId[i] = code;
-      }
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlay_elements_minus1" ); sei.m_numOverlayElementsMinus1[i] = code;
-        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
-        {
-          sei_read_code( pDecodedMessageOutputStream, getOverlayElementLabelMinLen ), code, "overlay_element_label_min" ); sei.m_overlayElementLabelMin[i][j] = code;
-          sei_read_code( pDecodedMessageOutputStream, getOverlayElementLabelMaxLen ), code, "overlay_element_label_max" ); sei.m_overlayElementLabelMax[i][j] = code;
-        }
-      }
-    }
-    while( !ByteaLigned(() ) );
-    {
-      sei_read_code( pDecodedMessageOutputStream, *equalto0*/f1, code, "overlay_zero_bit" ); sei.m_overlayZeroBit = code;
-    }
-    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
-    {
-      if( sei.m_languageOverlayPresentFlag( i ) )
-      {
-        sei_read_code( pDecodedMessageOutputStream, tv, code, "overlay_language" ); sei.m_overlayLanguage[i] = code;
-      }
-      sei_read_code( pDecodedMessageOutputStream, tv, code, "overlay_name" ); sei.m_overlayName[i] = code;
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
-        {
-          sei_read_code( pDecodedMessageOutputStream, tv, code, "overlay_element_name" ); sei.m_overlayElementName[i][j] = code;
-        }
-      }
-    }
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_content_aux_id_minus128" );            sei.m_overlayContentAuxIdMinus128 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_label_aux_id_minus128" );              sei.m_overlayLabelAuxIdMinus128 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_alpha_aux_id_minus128" );              sei.m_overlayAlphaAuxIdMinus128 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_element_label_value_length_minus8" );  sei.m_overlayElementLabelValueLengthMinus8 = code;
+    sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlays_minus1" );                        sei.m_numOverlaysMinus1 = code;
+
+    sei.m_overlayIdx.resize( sei.m_numOverlaysMinus1+1 );
+    sei.m_languageOverlayPresentFlag.resize( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayContentLayerId.resize     ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayLabelPresentFlag.resize   ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayLabelLayerId.resize       ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayAlphaPresentFlag.resize   ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayAlphaLayerId.resize       ( sei.m_numOverlaysMinus1+1 );
+    sei.m_numOverlayElementsMinus1.resize  ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayElementLabelMin.resize    ( sei.m_numOverlaysMinus1+1 );
+    sei.m_overlayElementLabelMax.resize    ( sei.m_numOverlaysMinus1+1 );
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
+    {
+      sei_read_uvlc( pDecodedMessageOutputStream, code, "overlay_idx" );                    sei.m_overlayIdx[i]                 = code;
+      sei_read_flag( pDecodedMessageOutputStream, code, "language_overlay_present_flag" );  sei.m_languageOverlayPresentFlag[i] = (code == 1);
+      sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_content_layer_id" );    sei.m_overlayContentLayerId[i]      = code;
+      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_label_present_flag" );     sei.m_overlayLabelPresentFlag[i]    = (code == 1);
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_label_layer_id" );     sei.m_overlayLabelLayerId[i]       = code;
+      }
+      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_alpha_present_flag" );      sei.m_overlayAlphaPresentFlag[i]   = (code == 1);
+      if( sei.m_overlayAlphaPresentFlag[i] )
+      {
+        sei_read_code( pDecodedMessageOutputStream, 6, code, "overlay_alpha_layer_id" );     sei.m_overlayAlphaLayerId[i]       = code;
+      }
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        sei_read_uvlc( pDecodedMessageOutputStream, code, "num_overlay_elements_minus1" );   sei.m_numOverlayElementsMinus1[i]  = code;
+        sei.m_overlayElementLabelMin[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
+        sei.m_overlayElementLabelMax[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          sei_read_code( pDecodedMessageOutputStream, sei.m_overlayElementLabelValueLengthMinus8 + 8, code, "overlay_element_label_min" ); sei.m_overlayElementLabelMin[i][j] = code;
+          sei_read_code( pDecodedMessageOutputStream, sei.m_overlayElementLabelValueLengthMinus8 + 8, code, "overlay_element_label_max" ); sei.m_overlayElementLabelMax[i][j] = code;
+        }
+      }
+    }
+
+    // byte alignment
+    while ( m_pcBitstream->getNumBitsRead() % 8 != 0 )
+    {
+      sei_read_flag( pDecodedMessageOutputStream, code, "overlay_zero_bit" ); 
+      assert( code==0 );      
+    }
+   
+    UChar* sval = new UChar[sei.m_numStringBytesMax];
+    UInt slen;    
+    sei.m_overlayLanguage.resize( sei.m_numOverlaysMinus1 + 1 );    
+    sei.m_overlayName.resize( sei.m_numOverlaysMinus1 + 1 );    
+    sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1 + 1 );    
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1; i++ )
+    {
+      if( sei.m_languageOverlayPresentFlag[i] )
+      {        
+        sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_language");
+        sei.m_overlayLanguage[i] = std::string((const char*) sval);        
+      }
+      sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_name");
+      sei.m_overlayName[i] = std::string((const char*) sval);       
+      if( sei.m_overlayLabelPresentFlag[i] )
+      {
+        sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1 );        
+        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1[i]; j++ )
+        {
+          sei_read_string(pDecodedMessageOutputStream, sei.m_numStringBytesMax, sval, slen, "overlay_element_name");
+          sei.m_overlayElementName[i][j] = std::string((const char*) sval);            
+        }
+      }
+    }
+    delete [] sval;
     sei_read_flag( pDecodedMessageOutputStream, code, "overlay_info_persistence_flag" ); sei.m_overlayInfoPersistenceFlag = (code == 1);
-  }
+  }  
 };
-#endif
 
 Void SEIReader::xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SEIread.h	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SEIread.h	(revision 1342)
@@ -112,7 +112,5 @@
   Void xParseSEISubBitstreamProperty          (SEISubBitstreamProperty& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
   Void xParseSEIAlphaChannelInfo              (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
-#if NH_MV_SEI_TBD
   Void xParseSEIOverlayInfo                   (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
-#endif
   Void xParseSEITemporalMvPredictionConstraints(SEITemporalMvPredictionConstraints& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
 #if NH_MV_SEI_TBD
@@ -139,4 +137,5 @@
   Void sei_read_svlc(std::ostream *pOS,                Int&  ruiCode, const Char *pSymbolName);
   Void sei_read_flag(std::ostream *pOS,                UInt& ruiCode, const Char *pSymbolName);
+  Void sei_read_string(std::ostream *pOS, UInt uiBufSize, UChar* pucCode, UInt& ruiLength, const Char *pSymbolName);
 #if NH_MV_SEI
   inline Void output_sei_message_header(SEI &sei, std::ostream *pDecodedMessageOutputStream, UInt payloadSize);
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SyntaxElementParser.cpp
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SyntaxElementParser.cpp	(revision 1342)
@@ -152,4 +152,16 @@
 }
 
+Void  SyntaxElementParser::xReadStringTr        (UInt buSize, UChar *pValue, UInt& rLength, const Char *pSymbolName)
+{
+#if RExt__DECODER_DEBUG_BIT_STATISTICS
+  xReadString (buSize, pValue, rLength, pSymbolName);
+#else
+  xReadString(buSize, pValue, rLength);
+#endif  
+  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
+  fprintf( g_hTrace, "%-50s st(v=%d)  : %s\n", pSymbolName, rLength, pValue ); 
+  fflush ( g_hTrace );
+}
+
 Void  xTraceAccessUnitDelimiter ()
 {
@@ -269,4 +281,26 @@
 }
 
+#if RExt__DECODER_DEBUG_BIT_STATISTICS
+Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength, const Char *pSymbolName)
+#else
+Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength)
+#endif
+{
+  assert( m_pcBitstream->getNumBitsRead() % 8 == 0 ); //always start reading at a byte-aligned position  
+  UInt val;
+  UInt i;
+  for (i=0 ; i<bufSize ; ++i ) 
+  {
+    m_pcBitstream->readByte( val );
+    pVal[i] = val;
+    if ( val == 0)
+    {
+      break;
+    }
+  }
+  rLength = i;
+  assert( pVal[rLength] == 0 );  
+}
+
 Void SyntaxElementParser::xReadRbspTrailingBits()
 {
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SyntaxElementParser.h
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SyntaxElementParser.h	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibDecoder/SyntaxElementParser.h	(revision 1342)
@@ -49,4 +49,5 @@
 #define READ_SVLC(        code, name)     xReadSvlcTr (         code, name )
 #define READ_FLAG(        code, name)     xReadFlagTr (         code, name )
+#define READ_STRING(bufSize, code, length, name)   xReadStringTr ( bufSize, code, length, name )
 
 #else
@@ -58,4 +59,5 @@
 #define READ_SVLC(        code, name)     xReadSvlc (         code, name )
 #define READ_FLAG(        code, name)     xReadFlag (         code, name )
+#define READ_STRING(bufSize, code, length, name)   xReadString ( bufSize, code, length, name )
 
 #else
@@ -65,4 +67,5 @@
 #define READ_SVLC(        code, name)     xReadSvlc (         code )
 #define READ_FLAG(        code, name)     xReadFlag (         code )
+#define READ_STRING(bufSize, code, length, name)   xReadString ( bufSize, code, length )
 
 #endif
@@ -92,4 +95,5 @@
   Void  xReadSvlc    ( Int&   val, const Char *pSymbolName );
   Void  xReadFlag    ( UInt&  val, const Char *pSymbolName );
+  Void  xReadString  ( UInt bufSize, UChar *val, UInt& length, const Char *pSymbolName);
 #else
   Void  xReadCode    ( UInt   length, UInt& val );
@@ -97,4 +101,5 @@
   Void  xReadSvlc    ( Int&   val );
   Void  xReadFlag    ( UInt&  val );
+  Void  xReadString  ( UInt bufSize, UChar *val, UInt& length);
 #endif
 #if ENC_DEC_TRACE
@@ -103,4 +108,5 @@
   Void  xReadSvlcTr  (               Int& rValue, const Char *pSymbolName);
   Void  xReadFlagTr  (              UInt& rValue, const Char *pSymbolName);
+  Void  xReadStringTr(UInt bufSize, UChar *pValue, UInt& rLength, const Char *pSymbolName);
 #endif
 public:
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1342)
@@ -151,9 +151,7 @@
      xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
      break;
-#if NH_MV_SEI_TBD
    case SEI::OVERLAY_INFO:
      xWriteSEIOverlayInfo(*static_cast<const SEIOverlayInfo*>(&sei));
      break; 
-#endif
    case SEI::TEMPORAL_MV_PREDICTION_CONSTRAINTS:
      xWriteSEITemporalMvPredictionConstraints(*static_cast<const SEITemporalMvPredictionConstraints*>(&sei));
@@ -998,5 +996,4 @@
 };
 
-#if NH_MV_SEI_TBD
 Void SEIWriter::xWriteSEIOverlayInfo( const SEIOverlayInfo& sei)
 {
@@ -1009,5 +1006,5 @@
     WRITE_UVLC( sei.m_overlayElementLabelValueLengthMinus8, "overlay_element_label_value_length_minus8" );
     WRITE_UVLC( sei.m_numOverlaysMinus1, "num_overlays_minus1" );
-    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
+    for( Int i = 0; i  <=  sei.m_numOverlaysMinus1 ; i++ )
     {
       WRITE_UVLC( sei.m_overlayIdx[i], "overlay_idx" );
@@ -1015,46 +1012,59 @@
       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 ) )
+      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 ) )
+      if( sei.m_overlayAlphaPresentFlag[i] )
       {
         WRITE_CODE( sei.m_overlayAlphaLayerId[i], 6, "overlay_alpha_layer_id" );
       }
-      if( sei.m_overlayLabelPresentFlag( i ) )
+      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], getOverlayElementLabelMinLen ), "overlay_element_label_min" );
-          WRITE_CODE( sei.m_overlayElementLabelMax[i][j], getOverlayElementLabelMaxLen ), "overlay_element_label_max" );
-        }
-      }
-    }
-    while( !ByteaLigned(() ) );
-    {
-      WRITE_CODE( sei.m_overlayZeroBit, *equalto0*/f1, "overlay_zero_bit" );
-    }
-    for( Int i = 0; i  <=  NumOverlaysMinus1( ); i++ )
-    {
-      if( sei.m_languageOverlayPresentFlag( i ) )
-      {
-        WRITE_CODE( sei.m_overlayLanguage[i], tv, "overlay_language" );
-      }
-      WRITE_CODE( sei.m_overlayName[i], tv, "overlay_name" );
-      if( sei.m_overlayLabelPresentFlag( i ) )
-      {
-        for( Int j = 0; j  <=  sei.m_numOverlayElementsMinus1( i ); j++ )
-        {
-          WRITE_CODE( sei.m_overlayElementName[i][j], tv, "overlay_element_name" );
+        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" );
-  }
+  }  
 };
-#endif
 
 Void SEIWriter::xWriteSEITemporalMvPredictionConstraints( const SEITemporalMvPredictionConstraints& sei)
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SEIwrite.h	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SEIwrite.h	(revision 1342)
@@ -94,7 +94,5 @@
   Void xWriteSEISubBitstreamProperty          ( const SEISubBitstreamProperty& sei);
   Void xWriteSEIAlphaChannelInfo              ( const SEIAlphaChannelInfo& sei);
-#if NH_MV_SEI_TBD
   Void xWriteSEIOverlayInfo                   ( const SEIOverlayInfo& sei);
-#endif
   Void xWriteSEITemporalMvPredictionConstraints ( const SEITemporalMvPredictionConstraints& sei);
 #if NH_MV_SEI_TBD
Index: branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SyntaxElementWriter.cpp
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SyntaxElementWriter.cpp	(revision 1342)
@@ -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: branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SyntaxElementWriter.h
===================================================================
--- branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1341)
+++ branches/HTM-15.1-dev0-Disney/source/Lib/TLibEncoder/SyntaxElementWriter.h	(revision 1342)
@@ -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();
