Index: branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1035)
+++ branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1037)
@@ -209,4 +209,9 @@
      break;
 #endif
+#if P0123_ALPHA_CHANNEL_SEI
+   case SEI::ALPHA_CHANNEL_INFO:
+     xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei));
+     break;
+#endif
 #if Q0096_OVERLAY_SEI
    case SEI::OVERLAY_INFO:
@@ -1417,4 +1422,25 @@
 #endif
 
+#if P0123_ALPHA_CHANNEL_SEI
+Void SEIWriter::xWriteSEIAlphaChannelInfo(const SEIAlphaChannelInfo &sei)
+{
+  WRITE_FLAG(sei.m_alphaChannelCancelFlag, "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, "alpha_channel_incr_flag");
+    WRITE_FLAG(sei.m_alphaChannelClipFlag, "alpha_channel_clip_flag");
+    if(sei.m_alphaChannelClipFlag)
+    {
+      WRITE_FLAG(sei.m_alphaChannelClipTypeFlag, "alpha_channel_clip_type_flag");
+    }
+  }
+  xWriteByteAlign();
+}
+#endif
+
 #if Q0096_OVERLAY_SEI
 Void SEIWriter::xWriteSEIOverlayInfo(const SEIOverlayInfo &sei)
Index: branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 1035)
+++ branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 1037)
@@ -131,4 +131,7 @@
   Void xWriteSEIVPSRewriting(const SEIVPSRewriting &sei);
 #endif
+#if P0123_ALPHA_CHANNEL_SEI
+  Void xWriteSEIAlphaChannelInfo(const SEIAlphaChannelInfo &sei);
+#endif
 #if Q0096_OVERLAY_SEI
   Void xWriteSEIOverlayInfo(const SEIOverlayInfo &sei);
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1035)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1037)
@@ -415,14 +415,25 @@
 #endif
 #if Q0048_CGS_3D_ASYMLUT
-  Int  m_nCGSFlag;
-  Int  m_nCGSMaxOctantDepth;
-  Int  m_nCGSMaxYPartNumLog2;
-  Int  m_nCGSLUTBit;
+  Int       m_nCGSFlag;
+  Int       m_nCGSMaxOctantDepth;
+  Int       m_nCGSMaxYPartNumLog2;
+  Int       m_nCGSLUTBit;
 #if R0151_CGS_3D_ASYMLUT_IMPROVE
-  Int  m_nCGSAdaptiveChroma;
+  Int       m_nCGSAdaptiveChroma;
 #endif
 #if R0179_ENC_OPT_3DLUT_SIZE
-  Int  m_nCGSLutSizeRDO;
-#endif
+  Int       m_nCGSLutSizeRDO;
+#endif
+#endif
+#if P0123_ALPHA_CHANNEL_SEI
+  Bool      m_alphaSEIEnabled;
+  Bool      m_alphaCancelFlag;
+  Int       m_alphaUseIdc;
+  Int       m_alphaBitDepthMinus8;
+  Int       m_alphaTransparentValue;
+  Int       m_alphaOpaqueValue;
+  Bool      m_alphaIncrementFlag;
+  Int       m_alphaClipFlag;
+  Int       m_alphaClipTypeFlag;
 #endif
 #if Q0096_OVERLAY_SEI
@@ -994,7 +1005,27 @@
 
 #if Q0189_TMVP_CONSTRAINTS
-  Void  setTMVPConstraintsSEIEnabled(Int b)                { m_TMVPConstraintsSEIEnabled = b; }
-  Int   getTMVPConstraintsSEIEnabled()                {  return m_TMVPConstraintsSEIEnabled; }
-
+  Void  setTMVPConstraintsSEIEnabled(Int b)                  { m_TMVPConstraintsSEIEnabled = b; }
+  Int   getTMVPConstraintsSEIEnabled()                       {  return m_TMVPConstraintsSEIEnabled; }
+
+#endif
+#if P0123_ALPHA_CHANNEL_SEI
+  Void  setAlphaSEIEnabled(Bool b)                           { m_alphaSEIEnabled       = b; }
+  Bool  getAlphaSEIEnabled()                                 { return m_alphaSEIEnabled; }
+  Void  setAlphaCancelFlag(Bool b)                           { m_alphaCancelFlag       = b; }
+  Bool  getAlphaCancelFlag()                                 { return m_alphaCancelFlag; }
+  Void  setAlphaUseIdc(Int idc)                              { m_alphaUseIdc           = idc; }
+  Int   getAlphaUseIdc()                                     { return m_alphaUseIdc; }
+  Void  setAlphaBitDepthMinus8(Int d)                        { m_alphaBitDepthMinus8   = d; }
+  Int   getAlphaBitDepthMinus8()                             { return m_alphaBitDepthMinus8; }
+  Void  setAlphaTransparentValue(Int v)                      { m_alphaTransparentValue = v; }
+  Int   getAlphaTransparentValue()                           { return m_alphaTransparentValue; }
+  Void  setAlphaOpaqueValue(Int v)                           { m_alphaOpaqueValue      = v; }
+  Int   getAlphaOpaqueValue()                                { return m_alphaOpaqueValue; }
+  Void  setAlphaIncrementFlag(Bool b)                        { m_alphaIncrementFlag    = b; }
+  Int   getAlphaIncrementFlag()                              { return m_alphaIncrementFlag; }
+  Void  setAlphaClipFlag(Bool b)                             { m_alphaClipFlag         = b; }
+  Bool  getAlphaClipFlag()                                   { return m_alphaClipFlag; }
+  Void  setAlphaClipTypeFlag(Bool b)                         { m_alphaClipTypeFlag     = b; }
+  Bool  getAlphaClipTypeFlag()                               { return m_alphaClipTypeFlag; }
 #endif
 #if Q0074_COLOUR_REMAPPING_SEI
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1035)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1037)
@@ -684,4 +684,20 @@
 #else
     m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 
+#endif
+    writeRBSPTrailingBits(nalu.m_Bitstream);
+    accessUnit.push_back(new NALUnitEBSP(nalu));
+    delete sei;
+  }
+#endif
+
+#if P0123_ALPHA_CHANNEL_SEI
+  if( m_pcCfg->getAlphaSEIEnabled() && m_pcEncTop->getVPS()->getScalabilityId(m_layerId, AUX_ID) && m_pcEncTop->getVPS()->getDimensionId(m_layerId, m_pcEncTop->getVPS()->getNumScalabilityTypes() - 1) == AUX_ALPHA )
+  {
+    SEIAlphaChannelInfo *sei = xCreateSEIAlphaChannelInfo();
+    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
+#if O0164_MULTI_LAYER_HRD
+    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps);
+#else
+    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
 #endif
     writeRBSPTrailingBits(nalu.m_Bitstream);
@@ -4364,4 +4380,22 @@
 }
 
+#if P0123_ALPHA_CHANNEL_SEI
+SEIAlphaChannelInfo* TEncGOP::xCreateSEIAlphaChannelInfo()
+{
+  SEIAlphaChannelInfo *sei = new SEIAlphaChannelInfo();
+  sei->m_alphaChannelCancelFlag = m_pcCfg->getAlphaCancelFlag();
+  if(!sei->m_alphaChannelCancelFlag)
+  {
+    sei->m_alphaChannelUseIdc = m_pcCfg->getAlphaUseIdc();
+    sei->m_alphaChannelBitDepthMinus8 = m_pcCfg->getAlphaBitDepthMinus8();
+    sei->m_alphaTransparentValue = m_pcCfg->getAlphaTransparentValue();
+    sei->m_alphaOpaqueValue = m_pcCfg->getAlphaOpaqueValue();
+    sei->m_alphaChannelIncrFlag = m_pcCfg->getAlphaIncrementFlag();
+    sei->m_alphaChannelClipFlag = m_pcCfg->getAlphaClipFlag();
+    sei->m_alphaChannelClipTypeFlag = m_pcCfg->getAlphaClipTypeFlag();
+  }
+  return sei;
+}
+#endif
 #if Q0096_OVERLAY_SEI
 SEIOverlayInfo* TEncGOP::xCreateSEIOverlayInfo()
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1035)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h	(revision 1037)
@@ -262,4 +262,7 @@
 #endif
 #endif
+#if P0123_ALPHA_CHANNEL_SEI
+  SEIAlphaChannelInfo* xCreateSEIAlphaChannelInfo();
+#endif
 #if Q0096_OVERLAY_SEI
   SEIOverlayInfo* xCreateSEIOverlayInfo();
