Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1537)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1538)
@@ -1596,4 +1596,7 @@
   ("SEIMasteringDisplayPrimaries",                    cfg_DisplayPrimariesCode,       cfg_DisplayPrimariesCode, "Mastering display primaries for all three colour planes in CIE xy coordinates in increments of 1/50000 (results in the ranges 0 to 50000 inclusive)")
   ("SEIMasteringDisplayWhitePoint",                   cfg_DisplayWhitePointCode,     cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)")
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  ("SEIPreferredTransferCharacterisics",              m_preferredTransferCharacteristics,                   -1, "Value for the preferred_transfer_characteristics field of the Alternative transfer characteristics SEI which will override the corresponding entry in the VUI. If negative, do not produce the respective SEI message")
+#endif
 
 #if LAYERS_NOT_PRESENT_SEI
@@ -4050,4 +4053,8 @@
   }
 
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
+#endif
+
 #if SVC_EXTENSION
   xConfirmPara( (m_apcLayerCfg[0]->m_numSamplePredRefLayers != 0) && (m_apcLayerCfg[0]->m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" );
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1537)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1538)
@@ -441,4 +441,8 @@
   Int*      m_kneeSEIInputKneePoint;
   Int*      m_kneeSEIOutputKneePoint;
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  Int       m_preferredTransferCharacteristics;
+#endif
+
   // weighted prediction
   Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1537)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1538)
@@ -798,4 +798,8 @@
   m_cTEncTop.setColourRemapInfoSEIFileRoot                        ( m_colourRemapSEIFileRoot );
   m_cTEncTop.setMasteringDisplaySEI                               ( m_masteringDisplay );
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  m_cTEncTop.setSEIAlternativeTransferCharacteristicsSEIEnable    ( m_preferredTransferCharacteristics>=0     );
+  m_cTEncTop.setSEIPreferredTransferCharacteristics               ( UChar(m_preferredTransferCharacteristics) );
+#endif
 
   m_cTEncTop.setTileUniformSpacingFlag                            ( m_tileUniformSpacingFlag );
Index: branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp	(revision 1538)
@@ -150,4 +150,7 @@
     case SEI::CHROMA_RESAMPLING_FILTER_HINT:        return "Chroma sampling filter hint";
     case SEI::COLOUR_REMAPPING_INFO:                return "Colour remapping info";
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+    case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS: return "Alternative transfer characteristics";
+#endif
 #if SVC_EXTENSION
 #if LAYERS_NOT_PRESENT_SEI
Index: branches/SHM-dev/source/Lib/TLibCommon/SEI.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibCommon/SEI.h	(revision 1538)
@@ -92,4 +92,7 @@
     KNEE_FUNCTION_INFO                   = 141,
     COLOUR_REMAPPING_INFO                = 142,
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+    ALTERNATIVE_TRANSFER_CHARACTERISTICS = 182,
+#endif
 #if LAYERS_NOT_PRESENT_SEI
     LAYERS_NOT_PRESENT                   = 160,
@@ -632,4 +635,19 @@
 };
 
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+class SEIAlternativeTransferCharacteristics : public SEI
+{
+public:
+  PayloadType payloadType() const { return ALTERNATIVE_TRANSFER_CHARACTERISTICS; }
+
+  SEIAlternativeTransferCharacteristics() : m_preferredTransferCharacteristics(18)
+  { }
+
+  virtual ~SEIAlternativeTransferCharacteristics() {}
+
+  UInt m_preferredTransferCharacteristics;
+};
+#endif
+
 #if P0123_ALPHA_CHANNEL_SEI
 class SEIAlphaChannelInfo : public SEI
Index: branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1538)
@@ -170,4 +170,5 @@
 #define T0196_SELECTIVE_RDOQ                              1 ///< selective RDOQ
 #define U0040_MODIFIED_WEIGHTEDPREDICTION_WITH_BIPRED_AND_CLIPPING 1
+#define U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI    1 ///< Alternative transfer characteristics SEI message (JCTVC-U0033, with syntax naming from V1005)
 
 // ====================================================================================================================
Index: branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp	(revision 1538)
@@ -316,4 +316,11 @@
       xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream);
       break;
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+    case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS:
+      sei = new SEIAlternativeTransferCharacteristics;
+      xParseSEIAlternativeTransferCharacteristics((SEIAlternativeTransferCharacteristics&) *sei, payloadSize, pDecodedMessageOutputStream);
+      break;
+#endif
+
 #if SVC_EXTENSION
 #if LAYERS_NOT_PRESENT_SEI
@@ -1443,4 +1450,14 @@
   sei_read_code( pDecodedMessageOutputStream, 32, code, "min_display_mastering_luminance" ); sei.values.minLuminance = code;
 }
+
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+Void SEIReader::xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, UInt payloadSize, ostream* pDecodedMessageOutputStream)
+{
+  UInt code;
+  output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
+
+  sei_read_code(pDecodedMessageOutputStream, 8, code, "preferred_transfer_characteristics"); sei.m_preferredTransferCharacteristics = code;
+}
+#endif
 
 #if SVC_EXTENSION
Index: branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h	(revision 1538)
@@ -109,4 +109,7 @@
   Void xParseSEIMasteringDisplayColourVolume  (SEIMasteringDisplayColourVolume& sei,  UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
   Void xParseSEIColourRemappingInfo           (SEIColourRemappingInfo& sei,           UInt payloadSize,                     std::ostream *pDecodedMessageOutputStream);
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  Void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei,              UInt payLoadSize,                     std::ostream *pDecodedMessageOutputStream);
+#endif
 
   Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const TChar *pSymbolName);
Index: branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.cpp	(revision 1538)
@@ -670,4 +670,14 @@
 }
 
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+Void SEIEncoder::initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *seiAltTransCharacteristics)
+{
+  assert (m_isInitialized);
+  assert (seiAltTransCharacteristics!=NULL);
+  //  Set SEI message parameters read from command line options
+  seiAltTransCharacteristics->m_preferredTransferCharacteristics = m_pcCfg->getSEIPreferredTransferCharacteristics();
+}
+#endif
+
 #if LAYERS_NOT_PRESENT_SEI
 Void SEIEncoder::initSEILayersNotPresent(SEILayersNotPresent *seiLayersNotPresent)
Index: branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.h	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibEncoder/SEIEncoder.h	(revision 1538)
@@ -82,4 +82,7 @@
   Void initSEITimeCode(SEITimeCode *sei);
   Bool initSEIColourRemappingInfo(SEIColourRemappingInfo *sei, Int currPOC); // returns true on success, false on failure.
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  Void initSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics *sei);
+#endif
 
 #if LAYERS_NOT_PRESENT_SEI
Index: branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 1538)
@@ -158,4 +158,10 @@
     xWriteSEIMasteringDisplayColourVolume(*static_cast<const SEIMasteringDisplayColourVolume*>(&sei));
     break;
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS:
+    xWriteSEIAlternativeTransferCharacteristics(*static_cast<const SEIAlternativeTransferCharacteristics*>(&sei));
+    break;
+#endif
+
 #if SVC_EXTENSION
 #if LAYERS_NOT_PRESENT_SEI
@@ -1073,4 +1079,11 @@
 }
 
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+Void SEIWriter::xWriteSEIAlternativeTransferCharacteristics(const SEIAlternativeTransferCharacteristics& sei)
+{
+  WRITE_CODE(sei.m_preferredTransferCharacteristics, 8, "preferred_transfer_characteristics");
+}
+#endif
+
 #if SVC_EXTENSION
 #if LAYERS_NOT_PRESENT_SEI
Index: branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h	(revision 1538)
@@ -91,4 +91,7 @@
   Void xWriteSEIColourRemappingInfo(const SEIColourRemappingInfo& sei);
   Void xWriteSEIMasteringDisplayColourVolume( const SEIMasteringDisplayColourVolume& sei);
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  Void xWriteSEIAlternativeTransferCharacteristics(const SEIAlternativeTransferCharacteristics& sei);
+#endif
 
 #if O0164_MULTI_LAYER_HRD
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1538)
@@ -323,4 +323,8 @@
   std::string m_colourRemapSEIFileRoot;          ///< SEI Colour Remapping File (initialized from external file)
   TComSEIMasteringDisplay m_masteringDisplay;
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  Bool      m_alternativeTransferCharacteristicsSEIEnabled;
+  UChar     m_preferredTransferCharacteristics;
+#endif
   //====== Weighted Prediction ========
   Bool      m_useWeightedPred;       //< Use of Weighting Prediction (P_SLICE)
@@ -909,4 +913,10 @@
   const std::string &getColourRemapInfoSEIFileRoot() const           { return m_colourRemapSEIFileRoot; }
   Void  setMasteringDisplaySEI(const TComSEIMasteringDisplay &src)   { m_masteringDisplay = src; }
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  Void  setSEIAlternativeTransferCharacteristicsSEIEnable( Bool b)   { m_alternativeTransferCharacteristicsSEIEnabled = b;    }
+  Bool  getSEIAlternativeTransferCharacteristicsSEIEnable( ) const   { return m_alternativeTransferCharacteristicsSEIEnabled; }
+  Void  setSEIPreferredTransferCharacteristics(UChar v)              { m_preferredTransferCharacteristics = v;    }
+  UChar getSEIPreferredTransferCharacteristics() const               { return m_preferredTransferCharacteristics; }
+#endif
   const TComSEIMasteringDisplay &getMasteringDisplaySEI() const      { return m_masteringDisplay; }
   Void         setUseWP               ( Bool b )                     { m_useWeightedPred   = b;    }
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1537)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1538)
@@ -631,4 +631,12 @@
     seiMessages.push_back(seiChromaResamplingFilterHint);
   }
+#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
+  if(m_pcCfg->getSEIAlternativeTransferCharacteristicsSEIEnable())
+  {
+    SEIAlternativeTransferCharacteristics *seiAlternativeTransferCharacteristics = new SEIAlternativeTransferCharacteristics;
+    m_seiEncoder.initSEIAlternativeTransferCharacteristics(seiAlternativeTransferCharacteristics);
+    seiMessages.push_back(seiAlternativeTransferCharacteristics);
+  }
+#endif
 
 #if SVC_EXTENSION
