Commit cebf1905 authored by Karsten Suehring's avatar Karsten Suehring
Browse files

Cube Map Projection SEI


Patch-by: Robert Skupin's avatarRobert Skupin <robert.skupin@hhi.fraunhofer.de>
parent dfe44894
......@@ -2209,6 +2209,7 @@ The table below lists the SEI messages defined for Version 1 and Range-Extension
141 & Knee function information & Table \ref{tab:sei-knee-function} \\
142 & Colour remapping information & Table \ref{tab:sei-colour-remapping}\\
143 & Deinterlaced field identification & (Not handled)\\
151 & Cubemap projection & Table \ref{tab:sei-cmp} \\
155 & Region-wise packing & Table \ref{tab:sei-rwp} \\
\end{SEIListTable}
%%
......@@ -2825,6 +2826,22 @@ An example file can be found in cfg/misc/example_colour_remapping_sei_encoder_0.
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Cubemap Projection SEI message encoder parameters}{tab:sei-cmp}
\Option{SEICmpEnabled} &
\Default{false} &
Enables (true) or disables (false) the insertion of cubemap projection SEI message.
\\
\Option{SEICmpCancelFlag} &
\Default{true} &
Indicates that cubemap projection SEI message cancels the persistence (true) or follows (false).
\\
\Option{SEICmpPersistenceFlag} &
\Default{false} &
Specifies the persistence of the Cubemap Projection SEI message.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Region-wise packing SEI message encoder parameters}{tab:sei-rwp}
\Option{SEIRwpEnabled} &
\Default{false} &
......
......@@ -1131,6 +1131,11 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("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")
("SEIGreenMetadataType", m_greenMetadataType, 0u, "Value for the green_metadata_type specifies the type of metadata that is present in the SEI message. If green_metadata_type is 1, then metadata enabling quality recovery after low-power encoding is present")
("SEIXSDMetricType", m_xsdMetricType, 0u, "Value for the xsd_metric_type indicates the type of the objective quality metric. PSNR is the only type currently supported")
#if CMP_SEI_MESSAGE
("SEICmpEnabled", m_cmpSEIEnabled, false, "Controls generation of cubemap projection SEI message")
("SEICmpCancelFlag", m_cmpSEICmpCancelFlag, true, "Specifies the persistence of any previous cubemap projection SEI message in output order.")
("SEICmpPersistenceFlag", m_cmpSEICmpPersistenceFlag, false, "Specifies the persistence of the cubemap projection SEI message for the current layer.")
#endif
#if RWP_SEI_MESSAGE
("SEIRwpEnabled", m_rwpSEIEnabled, false, "Controls if region-wise packing SEI message enabled")
("SEIRwpCancelFlag", m_rwpSEIRwpCancelFlag, true, "Specifies the persistence of any previous region-wise packing SEI message in output order.")
......
......@@ -350,6 +350,11 @@ protected:
Int m_preferredTransferCharacteristics;
UInt m_greenMetadataType;
UInt m_xsdMetricType;
#if CMP_SEI_MESSAGE
Bool m_cmpSEIEnabled;
Bool m_cmpSEICmpCancelFlag;
Bool m_cmpSEICmpPersistenceFlag;
#endif
#if RWP_SEI_MESSAGE
Bool m_rwpSEIEnabled;
Bool m_rwpSEIRwpCancelFlag;
......
......@@ -353,6 +353,11 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 );
m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint );
m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint );
#if CMP_SEI_MESSAGE
m_cTEncTop.setCmpSEIEnabled (m_cmpSEIEnabled);
m_cTEncTop.setCmpSEICmpCancelFlag (m_cmpSEICmpCancelFlag);
m_cTEncTop.setCmpSEICmpPersistenceFlag (m_cmpSEICmpPersistenceFlag);
#endif
#if RWP_SEI_MESSAGE
m_cTEncTop.setRwpSEIEnabled (m_rwpSEIEnabled);
m_cTEncTop.setRwpSEIRwpCancelFlag (m_rwpSEIRwpCancelFlag);
......
......@@ -156,6 +156,9 @@ const TChar *SEI::getSEIMessageString(SEI::PayloadType payloadType)
case SEI::CODED_REGION_COMPLETION: return "Coded region completion";
case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS: return "Alternative transfer characteristics";
case SEI::AMBIENT_VIEWING_ENVIRONMENT: return "Ambient viewing environment";
#if CMP_SEI_MESSAGE
case SEI::CUBEMAP_PROJECTION: return "Cubemap projection";
#endif
#if RWP_SEI_MESSAGE
case SEI::REGION_WISE_PACKING: return "Region wise packing information";
#endif
......
......@@ -92,6 +92,9 @@ public:
CODED_REGION_COMPLETION = 146, // TODO: add encoder command line control to create these messages
ALTERNATIVE_TRANSFER_CHARACTERISTICS = 147,
AMBIENT_VIEWING_ENVIRONMENT = 148, // TODO: add encoder command line control to create these messages
#if CMP_SEI_MESSAGE
CUBEMAP_PROJECTION = 151,
#endif
#if RWP_SEI_MESSAGE
REGION_WISE_PACKING = 155,
#endif
......@@ -746,6 +749,19 @@ public:
std::vector<Int> m_kneeOutputKneePoint;
};
#if CMP_SEI_MESSAGE
class SEICubemapProjection : public SEI
{
public:
PayloadType payloadType() const { return CUBEMAP_PROJECTION; }
SEICubemapProjection() {}
virtual ~SEICubemapProjection() {}
Bool m_cmpCancelFlag;
Bool m_cmpPersistenceFlag;
};
#endif
#if RWP_SEI_MESSAGE
class SEIRegionWisePacking : public SEI
{
......
......@@ -95,6 +95,7 @@
#define MCTS_ENC_CHECK 1 ///< Temporal MCTS encoder constraint and decoder checks. Also requires SEITMCTSTileConstraint to be enabled to enforce constraint
#define RWP_SEI_MESSAGE 1 // region-wise SEI message
#define CMP_SEI_MESSAGE 1 // cubemap projection SEI message
// ====================================================================================================================
// Tool Switches
// ====================================================================================================================
......
......@@ -350,6 +350,12 @@ Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType
sei = new SEIAmbientViewingEnvironment;
xParseSEIAmbientViewingEnvironment((SEIAmbientViewingEnvironment&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#if CMP_SEI_MESSAGE
case SEI::CUBEMAP_PROJECTION:
sei = new SEICubemapProjection;
xParseSEICubemapProjection((SEICubemapProjection&)*sei, payloadSize, pDecodedMessageOutputStream);
break;
#endif
#if RWP_SEI_MESSAGE
case SEI::REGION_WISE_PACKING:
sei = new SEIRegionWisePacking;
......@@ -1389,6 +1395,22 @@ Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt payload
}
}
#if CMP_SEI_MESSAGE
Void SEIReader::xParseSEICubemapProjection(SEICubemapProjection& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
UInt val;
sei_read_flag(pDecodedMessageOutputStream, val, "cmp_cancel_flag"); sei.m_cmpCancelFlag = val;
if (!sei.m_cmpCancelFlag)
{
sei_read_flag(pDecodedMessageOutputStream, val, "cmp_persistence_flag"); sei.m_cmpPersistenceFlag = val;
}
}
#endif
#if RWP_SEI_MESSAGE
Void SEIReader::xParseSEIRegionWisePacking(SEIRegionWisePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
......
......@@ -90,6 +90,9 @@ protected:
Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEIChromaResamplingFilterHint (SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#if CMP_SEI_MESSAGE
Void xParseSEICubemapProjection (SEICubemapProjection& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
#if RWP_SEI_MESSAGE
Void xParseSEIRegionWisePacking (SEIRegionWisePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
......
......@@ -417,6 +417,16 @@ Void SEIEncoder::initSEIKneeFunctionInfo(SEIKneeFunctionInfo *seiKneeFunctionInf
}
}
#if CMP_SEI_MESSAGE
Void SEIEncoder::initSEICubemapProjection(SEICubemapProjection *seiCubemapProjection)
{
assert(m_isInitialized);
assert(seiCubemapProjection != NULL);
seiCubemapProjection->m_cmpCancelFlag = m_pcCfg->getCmpSEICmpCancelFlag();
seiCubemapProjection->m_cmpPersistenceFlag = m_pcCfg->getCmpSEICmpPersistenceFlag();
}
#endif
#if RWP_SEI_MESSAGE
Void SEIEncoder::initSEIRegionWisePacking(SEIRegionWisePacking *seiRegionWisePacking)
{
......
......@@ -78,6 +78,9 @@ public:
Void initSEISegmentedRectFramePacking(SEISegmentedRectFramePacking *sei);
Void initSEITempMotionConstrainedTileSets (SEITempMotionConstrainedTileSets *sei, const TComPPS *pps);
Void initSEIKneeFunctionInfo(SEIKneeFunctionInfo *sei);
#if CMP_SEI_MESSAGE
Void initSEICubemapProjection(SEICubemapProjection *sei);
#endif
#if RWP_SEI_MESSAGE
Void initSEIRegionWisePacking(SEIRegionWisePacking *sei);
#endif
......
......@@ -171,6 +171,11 @@ Void SEIWriter::xWriteSEIpayloadData(TComBitIf& bs, const SEI& sei, const TComSP
case SEI::AMBIENT_VIEWING_ENVIRONMENT:
xWriteSEIAmbientViewingEnvironment(*static_cast<const SEIAmbientViewingEnvironment*>(&sei));
break;
#if CMP_SEI_MESSAGE
case SEI::CUBEMAP_PROJECTION:
xWriteSEICubemapProjection(*static_cast<const SEICubemapProjection*>(&sei));
break;
#endif
#if RWP_SEI_MESSAGE
case SEI::REGION_WISE_PACKING:
xWriteSEIRegionWisePacking(*static_cast<const SEIRegionWisePacking*>(&sei));
......@@ -971,6 +976,16 @@ Void SEIWriter::xWriteSEIKneeFunctionInfo(const SEIKneeFunctionInfo &sei)
}
}
}
#if CMP_SEI_MESSAGE
Void SEIWriter::xWriteSEICubemapProjection(const SEICubemapProjection &sei)
{
WRITE_FLAG(sei.m_cmpCancelFlag, "cmp_cancel_flag");
if (!sei.m_cmpCancelFlag)
{
WRITE_FLAG(sei.m_cmpPersistenceFlag, "cmp_persistence_flag");
}
}
#endif
#if RWP_SEI_MESSAGE
Void SEIWriter::xWriteSEIRegionWisePacking(const SEIRegionWisePacking &sei)
{
......
......@@ -83,6 +83,9 @@ protected:
Void xWriteSEITempMotionConstrainedTileSets (const SEITempMotionConstrainedTileSets& sei);
Void xWriteSEIChromaResamplingFilterHint (const SEIChromaResamplingFilterHint& sei);
Void xWriteSEIKneeFunctionInfo (const SEIKneeFunctionInfo &sei);
#if CMP_SEI_MESSAGE
Void xWriteSEICubemapProjection(const SEICubemapProjection &sei);
#endif
#if RWP_SEI_MESSAGE
Void xWriteSEIRegionWisePacking(const SEIRegionWisePacking &sei);
#endif
......
......@@ -356,6 +356,11 @@ protected:
Bool m_greenMetadataInfoSEIEnabled;
UChar m_greenMetadataType;
UChar m_xsdMetricType;
#if CMP_SEI_MESSAGE
Bool m_cmpSEIEnabled;
Bool m_cmpSEICmpCancelFlag;
Bool m_cmpSEICmpPersistenceFlag;
#endif
#if RWP_SEI_MESSAGE
Bool m_rwpSEIEnabled;
Bool m_rwpSEIRwpCancelFlag;
......@@ -904,6 +909,14 @@ public:
Int* getKneeSEIInputKneePoint() { return m_kneeSEIInputKneePoint; }
Void setKneeSEIOutputKneePoint(Int *p) { m_kneeSEIOutputKneePoint = p; }
Int* getKneeSEIOutputKneePoint() { return m_kneeSEIOutputKneePoint; }
#if CMP_SEI_MESSAGE
Void setCmpSEIEnabled(Bool b) { m_cmpSEIEnabled = b; }
Bool getCmpSEIEnabled() { return m_cmpSEIEnabled; }
Void setCmpSEICmpCancelFlag(Bool b) { m_cmpSEICmpCancelFlag = b; }
Bool getCmpSEICmpCancelFlag() { return m_cmpSEICmpCancelFlag; }
Void setCmpSEICmpPersistenceFlag(Bool b) { m_cmpSEICmpPersistenceFlag = b; }
Bool getCmpSEICmpPersistenceFlag() { return m_cmpSEICmpPersistenceFlag; }
#endif
#if RWP_SEI_MESSAGE
Void setRwpSEIEnabled(Bool b) { m_rwpSEIEnabled = b; }
Bool getRwpSEIEnabled() { return m_rwpSEIEnabled; }
......
......@@ -448,6 +448,14 @@ Void TEncGOP::xCreateIRAPLeadingSEIMessages (SEIMessages& seiMessages, const TCo
m_seiEncoder.initSEIKneeFunctionInfo(sei);
seiMessages.push_back(sei);
}
#if CMP_SEI_MESSAGE
if (m_pcCfg->getCmpSEIEnabled())
{
SEICubemapProjection *seiCubemapProjection = new SEICubemapProjection;
m_seiEncoder.initSEICubemapProjection(seiCubemapProjection);
seiMessages.push_back(seiCubemapProjection);
}
#endif
#if RWP_SEI_MESSAGE
if (m_pcCfg->getRwpSEIEnabled())
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment