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();
