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

Equirectangular, Sphere rotation and Omnidirectional recommended viewport


Patch-by: default avatarXu, Qian Z <qian.z.xu@intel.com>
parent cebf1905
#======== Equirectangular Projection SEI message =====================
SEIErpEnabled : 1
SEIErpCancelFlag : 0
SEIErpPersistenceFlag : 1
SEIErpGuardBandFlag : 1
SEIErpGuardBandType : 0
SEIErpLeftGuardBandWidth : 254
SEIErpRightGuardBandWidth : 254
#======== Omni Viewport SEI message =====================
SEIOmniViewportEnabled : 1
SEIOmniViewportId : 0
SEIOmniViewportCancelFlag : 0
SEIOmniViewportPersistenceFlag : 1
SEIOmniViewportCntMinus1 : 2
SEIOmniViewportAzimuthCentre : -5898240 5898240 0
SEIOmniViewportElevationCentre : -5898240 5898240 0
SEIOmniViewportTiltCentre : -11796480 5898240 0
SEIOmniViewportHorRange : 2949120 2949120 2949120
SEIOmniViewportVerRange : 2949120 2949120 2949120
#======== Sphere Rotation SEI message =====================
SEISphereRotationEnabled : 1
SEISphereRotationCancelFlag : 0
SEISphereRotationPersistenceFlag : 1
SEISphereRotationYaw : -5898240
SEISphereRotationPitch : -5898240
SEISphereRotationRoll : -11796480
......@@ -2209,8 +2209,11 @@ 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)\\
150 & Equirectangular projection & Table \ref{tab:sei-erp} \\
151 & Cubemap projection & Table \ref{tab:sei-cmp} \\
154 & Sphere rotation & Table \ref{tab:sei-sphere-rotation} \\
155 & Region-wise packing & Table \ref{tab:sei-rwp} \\
156 & Omni viewport & Table \ref{tab:sei-omni-viewport} \\
\end{SEIListTable}
%%
%% SEI messages
......@@ -2825,6 +2828,36 @@ An example file can be found in cfg/misc/example_colour_remapping_sei_encoder_0.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Equirectangular Projection SEI message encoder parameters}{tab:sei-erp}
\Option{SEIErpEnabled} &
\Default{false} &
Enables (true) or disables (false) the insertion of equirectangular projection SEI message.
\\
\Option{SEIErpCancelFlag} &
\Default{true} &
Indicates that equirectangular projection SEI message cancels the persistence (true) or follows (false).
\\
\Option{SEIErpPersistenceFlag} &
\Default{false} &
Specifies the persistence of the equirectangular projection SEI message.
\\
\Option{SEIErpGuardBandFlag} &
\Default{false} &
Indicates the existence of guard band areas in the constituent picture.
\\
\Option{SEIErpGuardBandType} &
\Default{0} &
Indicates the type of the guard bands.
\\
\Option{SEIErpLeftGuardBandWidth} &
\Default{0} &
Inicates the width of the guard band on the left side of the onstituent picture.
\\
\Option{SEIErpRightGuardBandWidth} &
\Default{0} &
Inicates the width of the guard band on the right side of the onstituent picture.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Cubemap Projection SEI message encoder parameters}{tab:sei-cmp}
\Option{SEICmpEnabled} &
......@@ -2841,6 +2874,32 @@ Specifies the persistence of the Cubemap Projection SEI message.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Sphere Rotation SEI message encoder parameters}{tab:sei-sphere-rotation}
\Option{SEISphereRotationEnabled} &
\Default{false} &
Enables (true) or disables (false) the insertion of sphere rotation SEI message.
\\
\Option{SEISphereRotationCancelFlag} &
\Default{true} &
Indicates that the sphere rotation SEI message cancels the persistence (true) or follows (false).
\\
\Option{SEISphereRotationPersistenceFlag} &
\Default{false} &
Specifies the persistence of the sphere rotation SEI message.
\\
\Option{SEISphereRotationYawRotation} &
\Default{0} &
Specifies the value of the yaw rotation angle.
\\
\Option{SEISphereRotationPitchRotation} &
\Default{0} &
Specifies the value of the pitch rotation angle.
\\
\Option{SEISphereRotationRollRotation} &
\Default{0} &
Specifies the value of the roll rotation angle.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Region-wise packing SEI message encoder parameters}{tab:sei-rwp}
\Option{SEIRwpEnabled} &
......@@ -2949,6 +3008,49 @@ An array that specifies the type of the guard bands for the packed regions.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Omni Viewport SEI message encoder parameters}{tab:sei-omni-viewport}
\Option{SEIOmniViewportEnabled} &
\Default{false} &
Enables (true) or disables (false) the insertion of omni viewport SEI message.
\\
\Option{SEIOmniViewportId} &
\Default{0} &
Contains an identifying number that may be used to identify the purpose of the one or more recommended viewport regions.
\\
\Option{SEIOmniViewportCancelFlag} &
\Default{true} &
Indicates that the omni viewport SEI message cancels the persistence (true) or follows (false).
\\
\Option{SEIOmniViewportPersistenceFlag} &
\Default{false} &
Specifies the persistence of the omni viewport SEI message.
\\
\Option{SEIOmniViewportCntMinus1} &
\Default{0} &
Specifies the number of recommended viewport regions minus 1.
\\
\Option{SEIOmniViewportAzimuthCentre} &
\Default{} &
An array that indicates the centre of the i-th recommended viewport region.
\\
\Option{SEIOmniViewportElevationCentre} &
\Default{} &
An array that indicates the centre of the i-th recommended viewport region.
\\
\Option{SEIOmniViewportTiltCentre} &
\Default{} &
An array that indicates the tilt angle of the i-th recommended viewport region.
\\
\Option{SEIOmniViewportHorRange} &
\Default{} &
An array that indicates the azimuth range of the i-th recommended viewport region.
\\
\Option{SEIOmniViewportVerRange} &
\Default{} &
An array that indicates the elevation range of the i-th recommended viewport region.
\\
\end{OptionTableNoShorthand}
%\Option{SEITimeCode} &
%\Default{false} &
%When true, generate time code SEI messages.
......
......@@ -699,6 +699,13 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
SMultiValueInput<Bool> cfg_timeCodeSeiHoursFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<Int> cfg_timeCodeSeiTimeOffsetLength (0, 31, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<Int> cfg_timeCodeSeiTimeOffsetValue (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, MAX_TIMECODE_SEI_SETS);
#if ERP_SR_OV_SEI_MESSAGE
SMultiValueInput<Int> cfg_omniViewportSEIAzimuthCentre (-11796480, 11796479, 0, 15);
SMultiValueInput<Int> cfg_omniViewportSEIElevationCentre ( -5898240, 5898240, 0, 15);
SMultiValueInput<Int> cfg_omniViewportSEITiltCentre (-11796480, 11796479, 0, 15);
SMultiValueInput<UInt> cfg_omniViewportSEIHorRange ( 1, 23592960, 0, 15);
SMultiValueInput<UInt> cfg_omniViewportSEIVerRange ( 1, 11796480, 0, 15);
#endif
#if RWP_SEI_MESSAGE
SMultiValueInput<UInt> cfg_rwpSEIRwpTransformType (0, 7, 0, std::numeric_limits<UChar>::max());
SMultiValueInput<Bool> cfg_rwpSEIRwpGuardBandFlag (0, 1, 0, std::numeric_limits<UChar>::max());
......@@ -1131,6 +1138,31 @@ 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 ERP_SR_OV_SEI_MESSAGE
("SEIErpEnabled", m_erpSEIEnabled, false, "Control generation of equirectangular projection SEI messages")
("SEIErpCancelFlag", m_erpSEICancelFlag, true, "Indicate that equirectangular projection SEI message cancels the persistence or follows")
("SEIErpPersistenceFlag", m_erpSEIPersistenceFlag, false, "Specifies the persistence of the equirectangular projection SEI messages")
("SEIErpGuardBandFlag", m_erpSEIGuardBandFlag, false, "Indicate the existence of guard band areas in the constituent picture")
("SEIErpGuardBandType", m_erpSEIGuardBandType, 0u, "Indicate the type of the guard band")
("SEIErpLeftGuardBandWidth", m_erpSEILeftGuardBandWidth, 0u, "Indicate the width of the guard band on the left side of the constituent picture")
("SEIErpRightGuardBandWidth", m_erpSEIRightGuardBandWidth, 0u, "Indicate the width of the guard band on the right side of the constituent picture")
("SEISphereRotationEnabled", m_sphereRotationSEIEnabled, false, "Control generation of sphere rotation SEI messages")
("SEISphereRotationCancelFlag", m_sphereRotationSEICancelFlag, true, "Indicate that sphere rotation SEI message cancels the persistence or follows")
("SEISphereRotationPersistenceFlag", m_sphereRotationSEIPersistenceFlag, false, "Specifies the persistence of the sphere rotation SEI messages")
("SEISphereRotationYaw", m_sphereRotationSEIYaw, 0, "Specifies the value of the yaw rotation angle")
("SEISphereRotationPitch", m_sphereRotationSEIPitch, 0, "Specifies the value of the pitch rotation angle")
("SEISphereRotationRoll", m_sphereRotationSEIRoll, 0, "Specifies the value of the roll rotation angle")
("SEIOmniViewportEnabled", m_omniViewportSEIEnabled, false, "Control generation of omni viewport SEI messages")
("SEIOmniViewportId", m_omniViewportSEIId, 0u, "An identifying number that may be used to identify the purpose of the one or more recommended viewport regions")
("SEIOmniViewportCancelFlag", m_omniViewportSEICancelFlag, true, "Indicate that omni viewport SEI message cancels the persistence or follows")
("SEIOmniViewportPersistenceFlag", m_omniViewportSEIPersistenceFlag, false, "Specifies the persistence of the omni viewport SEI messages")
("SEIOmniViewportCntMinus1", m_omniViewportSEICntMinus1, 0u, "specifies the number of recommended viewport regions minus 1")
("SEIOmniViewportAzimuthCentre", cfg_omniViewportSEIAzimuthCentre, cfg_omniViewportSEIAzimuthCentre, "Indicate the centre of the i-th recommended viewport region")
("SEIOmniViewportElevationCentre", cfg_omniViewportSEIElevationCentre, cfg_omniViewportSEIElevationCentre, "Indicate the centre of the i-th recommended viewport region")
("SEIOmniViewportTiltCentre", cfg_omniViewportSEITiltCentre, cfg_omniViewportSEITiltCentre, "Indicates the tilt angle of the i-th recommended viewport region")
("SEIOmniViewportHorRange", cfg_omniViewportSEIHorRange, cfg_omniViewportSEIHorRange, "Indicates the azimuth range of the i-th recommended viewport region")
("SEIOmniViewportVerRange", cfg_omniViewportSEIVerRange, cfg_omniViewportSEIVerRange, "Indicates the elevation range of the i-th recommended viewport region")
#endif
#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.")
......@@ -1735,6 +1767,26 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
}
}
#if ERP_SR_OV_SEI_MESSAGE
if ( m_omniViewportSEIEnabled && !m_omniViewportSEICancelFlag )
{
assert ( m_omniViewportSEICntMinus1 >= 0 && m_omniViewportSEICntMinus1 < 16 );
m_omniViewportSEIAzimuthCentre.resize (m_omniViewportSEICntMinus1+1);
m_omniViewportSEIElevationCentre.resize(m_omniViewportSEICntMinus1+1);
m_omniViewportSEITiltCentre.resize (m_omniViewportSEICntMinus1+1);
m_omniViewportSEIHorRange.resize (m_omniViewportSEICntMinus1+1);
m_omniViewportSEIVerRange.resize (m_omniViewportSEICntMinus1+1);
for(Int i=0; i<(m_omniViewportSEICntMinus1+1); i++)
{
m_omniViewportSEIAzimuthCentre[i] = cfg_omniViewportSEIAzimuthCentre .values.size() > i ? cfg_omniViewportSEIAzimuthCentre .values[i] : 0;
m_omniViewportSEIElevationCentre[i] = cfg_omniViewportSEIElevationCentre.values.size() > i ? cfg_omniViewportSEIElevationCentre.values[i] : 0;
m_omniViewportSEITiltCentre[i] = cfg_omniViewportSEITiltCentre .values.size() > i ? cfg_omniViewportSEITiltCentre .values[i] : 0;
m_omniViewportSEIHorRange[i] = cfg_omniViewportSEIHorRange .values.size() > i ? cfg_omniViewportSEIHorRange .values[i] : 0;
m_omniViewportSEIVerRange[i] = cfg_omniViewportSEIVerRange .values.size() > i ? cfg_omniViewportSEIVerRange .values[i] : 0;
}
}
#endif
#if RWP_SEI_MESSAGE
if(!m_rwpSEIRwpCancelFlag && m_rwpSEIEnabled)
{
......@@ -2662,6 +2714,37 @@ Void TAppEncCfg::xCheckParameter()
xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
#if ERP_SR_OV_SEI_MESSAGE
if( m_erpSEIEnabled && !m_erpSEICancelFlag )
{
xConfirmPara( m_erpSEIGuardBandType < 0 || m_erpSEIGuardBandType > 8, "SEIEquirectangularprojectionGuardBandType must be in the range of 0 to 7");
xConfirmPara( (m_chromaFormatIDC == CHROMA_420 || m_chromaFormatIDC == CHROMA_422) && (m_erpSEILeftGuardBandWidth%2 == 1), "SEIEquirectangularprojectionLeftGuardBandWidth must be an even number for 4:2:0 or 4:2:2 chroma format");
xConfirmPara( (m_chromaFormatIDC == CHROMA_420 || m_chromaFormatIDC == CHROMA_422) && (m_erpSEIRightGuardBandWidth%2 == 1), "SEIEquirectangularprojectionRightGuardBandWidth must be an even number for 4:2:0 or 4:2:2 chroma format");
}
if( m_sphereRotationSEIEnabled && !m_sphereRotationSEICancelFlag )
{
xConfirmPara( m_sphereRotationSEIYaw < -(180<<16) || m_sphereRotationSEIYaw > (180<<16)-1, "SEISphereRotationYaw must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_sphereRotationSEIPitch < -(90<<16) || m_sphereRotationSEIYaw > (90<<16), "SEISphereRotationPitch must be in the range of -5 898 240 to 5 898 240");
xConfirmPara( m_sphereRotationSEIRoll < -(180<<16) || m_sphereRotationSEIYaw > (180<<16)-1, "SEISphereRotationRoll must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_erpSEICancelFlag == 1 && m_cmpSEICmpCancelFlag == 1, "erp_cancel_flag equal to 0 or cmp_cancel_flag equal to 0 must be present");
}
if ( m_omniViewportSEIEnabled && !m_omniViewportSEICancelFlag )
{
xConfirmPara( m_omniViewportSEIId < 0 || m_omniViewportSEIId > 1023, "SEIomniViewportId must be in the range of 0 to 1023");
xConfirmPara( m_omniViewportSEICntMinus1 < 0 || m_omniViewportSEICntMinus1 > 15, "SEIomniViewportCntMinus1 must be in the range of 0 to 15");
for ( UInt i=0; i<=m_omniViewportSEICntMinus1; i++ )
{
xConfirmPara( m_omniViewportSEIAzimuthCentre[i] < -(180<<16) || m_omniViewportSEIAzimuthCentre[i] > (180<<16)-1, "SEIOmniViewportAzimuthCentre must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_omniViewportSEIElevationCentre[i] < -(90<<16) || m_omniViewportSEIElevationCentre[i] > (90<<16), "SEIOmniViewportSEIElevationCentre must be in the range of -5 898 240 to 5 898 240");
xConfirmPara( m_omniViewportSEITiltCentre[i] < -(180<<16) || m_omniViewportSEITiltCentre[i] > (180<<16)-1, "SEIOmniViewportTiltCentre must be in the range of -11 796 480 to 11 796 479");
xConfirmPara( m_omniViewportSEIHorRange[i] < 1 || m_omniViewportSEIHorRange[i] > (360<<16), "SEIOmniViewportHorRange must be in the range of 1 to 360*2^16");
xConfirmPara( m_omniViewportSEIVerRange[i] < 1 || m_omniViewportSEIVerRange[i] > (180<<16), "SEIOmniViewportVerRange must be in the range of 1 to 180*2^16");
}
}
#endif
#if EXTENSION_360_VIDEO
check_failed |= m_ext360.verifyParameters();
#endif
......
......@@ -350,6 +350,33 @@ protected:
Int m_preferredTransferCharacteristics;
UInt m_greenMetadataType;
UInt m_xsdMetricType;
#if ERP_SR_OV_SEI_MESSAGE
Bool m_erpSEIEnabled;
Bool m_erpSEICancelFlag;
Bool m_erpSEIPersistenceFlag;
Bool m_erpSEIGuardBandFlag;
UInt m_erpSEIGuardBandType;
UInt m_erpSEILeftGuardBandWidth;
UInt m_erpSEIRightGuardBandWidth;
Bool m_sphereRotationSEIEnabled;
Bool m_sphereRotationSEICancelFlag;
Bool m_sphereRotationSEIPersistenceFlag;
Int m_sphereRotationSEIYaw;
Int m_sphereRotationSEIPitch;
Int m_sphereRotationSEIRoll;
Bool m_omniViewportSEIEnabled;
UInt m_omniViewportSEIId;
Bool m_omniViewportSEICancelFlag;
Bool m_omniViewportSEIPersistenceFlag;
UInt m_omniViewportSEICntMinus1;
std::vector<Int> m_omniViewportSEIAzimuthCentre;
std::vector<Int> m_omniViewportSEIElevationCentre;
std::vector<Int> m_omniViewportSEITiltCentre;
std::vector<UInt> m_omniViewportSEIHorRange;
std::vector<UInt> m_omniViewportSEIVerRange;
#endif
#if CMP_SEI_MESSAGE
Bool m_cmpSEIEnabled;
Bool m_cmpSEICmpCancelFlag;
......
......@@ -353,6 +353,31 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 );
m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint );
m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint );
#if ERP_SR_OV_SEI_MESSAGE
m_cTEncTop.setErpSEIEnabled ( m_erpSEIEnabled );
m_cTEncTop.setErpSEICancelFlag ( m_erpSEICancelFlag );
m_cTEncTop.setErpSEIPersistenceFlag ( m_erpSEIPersistenceFlag );
m_cTEncTop.setErpSEIGuardBandFlag ( m_erpSEIGuardBandFlag );
m_cTEncTop.setErpSEIGuardBandType ( m_erpSEIGuardBandType );
m_cTEncTop.setErpSEILeftGuardBandWidth ( m_erpSEILeftGuardBandWidth );
m_cTEncTop.setErpSEIRightGuardBandWidth ( m_erpSEIRightGuardBandWidth );
m_cTEncTop.setSphereRotationSEIEnabled ( m_sphereRotationSEIEnabled );
m_cTEncTop.setSphereRotationSEICancelFlag ( m_sphereRotationSEICancelFlag );
m_cTEncTop.setSphereRotationSEIPersistenceFlag ( m_sphereRotationSEIPersistenceFlag );
m_cTEncTop.setSphereRotationSEIYaw ( m_sphereRotationSEIYaw );
m_cTEncTop.setSphereRotationSEIPitch ( m_sphereRotationSEIPitch );
m_cTEncTop.setSphereRotationSEIRoll ( m_sphereRotationSEIRoll );
m_cTEncTop.setOmniViewportSEIEnabled ( m_omniViewportSEIEnabled );
m_cTEncTop.setOmniViewportSEIId ( m_omniViewportSEIId );
m_cTEncTop.setOmniViewportSEICancelFlag ( m_omniViewportSEICancelFlag );
m_cTEncTop.setOmniViewportSEIPersistenceFlag ( m_omniViewportSEIPersistenceFlag );
m_cTEncTop.setOmniViewportSEICntMinus1 ( m_omniViewportSEICntMinus1 );
m_cTEncTop.setOmniViewportSEIAzimuthCentre ( m_omniViewportSEIAzimuthCentre );
m_cTEncTop.setOmniViewportSEIElevationCentre ( m_omniViewportSEIElevationCentre );
m_cTEncTop.setOmniViewportSEITiltCentre ( m_omniViewportSEITiltCentre );
m_cTEncTop.setOmniViewportSEIHorRange ( m_omniViewportSEIHorRange );
m_cTEncTop.setOmniViewportSEIVerRange ( m_omniViewportSEIVerRange );
#endif
#if CMP_SEI_MESSAGE
m_cTEncTop.setCmpSEIEnabled (m_cmpSEIEnabled);
m_cTEncTop.setCmpSEICmpCancelFlag (m_cmpSEICmpCancelFlag);
......
......@@ -156,6 +156,11 @@ 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 ERP_SR_OV_SEI_MESSAGE
case SEI::EQUIRECTANGULAR_PROJECTION: return "Equirectangular projection";
case SEI::SPHERE_ROTATION: return "Sphere rotation";
case SEI::OMNI_VIEWPORT: return "Omni viewport";
#endif
#if CMP_SEI_MESSAGE
case SEI::CUBEMAP_PROJECTION: return "Cubemap projection";
#endif
......
......@@ -92,6 +92,11 @@ 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 ERP_SR_OV_SEI_MESSAGE
EQUIRECTANGULAR_PROJECTION = 150,
SPHERE_ROTATION = 154,
OMNI_VIEWPORT = 156,
#endif
#if CMP_SEI_MESSAGE
CUBEMAP_PROJECTION = 151,
#endif
......@@ -749,6 +754,62 @@ public:
std::vector<Int> m_kneeOutputKneePoint;
};
#if ERP_SR_OV_SEI_MESSAGE
class SEIEquirectangularProjection : public SEI
{
public:
PayloadType payloadType() const { return EQUIRECTANGULAR_PROJECTION; }
SEIEquirectangularProjection() {}
virtual ~SEIEquirectangularProjection() {}
Bool m_erpCancelFlag;
Bool m_erpPersistenceFlag;
Bool m_erpGuardBandFlag;
UChar m_erpGuardBandType;
UChar m_erpLeftGuardBandWidth;
UChar m_erpRightGuardBandWidth;
};
class SEISphereRotation : public SEI
{
public:
PayloadType payloadType() const { return SPHERE_ROTATION; }
SEISphereRotation() {}
virtual ~SEISphereRotation() {}
Bool m_sphereRotationCancelFlag;
Bool m_sphereRotationPersistenceFlag;
Int m_sphereRotationYaw;
Int m_sphereRotationPitch;
Int m_sphereRotationRoll;
};
class SEIOmniViewport : public SEI
{
public:
PayloadType payloadType() const { return OMNI_VIEWPORT; }
SEIOmniViewport() {}
virtual ~SEIOmniViewport() {}
struct OmniViewport
{
Int azimuthCentre;
Int elevationCentre;
Int tiltCentre;
UInt horRange;
UInt verRange;
};
UInt m_omniViewportId;
Bool m_omniViewportCancelFlag;
Bool m_omniViewportPersistenceFlag;
UChar m_omniViewportCntMinus1;
std::vector<OmniViewport> m_omniViewportRegions;
};
#endif
#if CMP_SEI_MESSAGE
class SEICubemapProjection : public SEI
......
......@@ -96,6 +96,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
#define ERP_SR_OV_SEI_MESSAGE 1 //equirectangular projection, sphere rotation, and omni viewport SEI message
// ====================================================================================================================
// Tool Switches
// ====================================================================================================================
......
......@@ -350,6 +350,20 @@ Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType
sei = new SEIAmbientViewingEnvironment;
xParseSEIAmbientViewingEnvironment((SEIAmbientViewingEnvironment&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#if ERP_SR_OV_SEI_MESSAGE
case SEI::EQUIRECTANGULAR_PROJECTION:
sei = new SEIEquirectangularProjection;
xParseSEIEquirectangularProjection((SEIEquirectangularProjection&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
case SEI::SPHERE_ROTATION:
sei = new SEISphereRotation;
xParseSEISphereRotation((SEISphereRotation&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
case SEI::OMNI_VIEWPORT:
sei = new SEIOmniViewport;
xParseSEIOmniViewport((SEIOmniViewport&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#endif
#if CMP_SEI_MESSAGE
case SEI::CUBEMAP_PROJECTION:
sei = new SEICubemapProjection;
......@@ -1395,6 +1409,118 @@ Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt payload
}
}
#if ERP_SR_OV_SEI_MESSAGE
Void SEIReader::xParseSEIEquirectangularProjection(SEIEquirectangularProjection& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
UInt val;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
sei_read_flag( pDecodedMessageOutputStream, val, "erp_cancel_flag" ); sei.m_erpCancelFlag = val;
if( !sei.m_erpCancelFlag )
{
sei_read_flag( pDecodedMessageOutputStream, val, "erp_persistence_flag" ); sei.m_erpPersistenceFlag = val;
sei_read_flag( pDecodedMessageOutputStream, val, "erp_guard_band_flag" ); sei.m_erpGuardBandFlag = val;
sei_read_code( pDecodedMessageOutputStream, 2, val, "erp_reserved_zero_2bits" );
if ( sei.m_erpGuardBandFlag == 1)
{
sei_read_code( pDecodedMessageOutputStream, 3, val, "erp_guard_band_type" ); sei.m_erpGuardBandType = val;
sei_read_code( pDecodedMessageOutputStream, 8, val, "erp_left_guard_band_width" ); sei.m_erpLeftGuardBandWidth = val;
sei_read_code( pDecodedMessageOutputStream, 8, val, "erp_right_guard_band_width"); sei.m_erpRightGuardBandWidth = val;
}
}
}
Void SEIReader::xParseSEISphereRotation(SEISphereRotation& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
UInt val;
UChar n = 32;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
sei_read_flag( pDecodedMessageOutputStream, val, "sphere_rotation_cancel_flag" ); sei.m_sphereRotationCancelFlag = val;
if( !sei.m_sphereRotationCancelFlag )
{
sei_read_flag( pDecodedMessageOutputStream, val, "sphere_rotation_persistence_flag" ); sei.m_sphereRotationPersistenceFlag = val;
sei_read_code( pDecodedMessageOutputStream, 6, val, "sphere_rotation_reserved_zero_6bits" );
sei_read_code( pDecodedMessageOutputStream, n, val, "sphere_rotation_yaw" );
if((val & (1 << (n-1))) == 0)
{
sei.m_sphereRotationYaw = val;
}
else
{
val &= (1<< (n-1)) - 1;
sei.m_sphereRotationYaw = ~val + 1;
}
sei_read_code( pDecodedMessageOutputStream, n, val, "sphere_rotation_pitch" );
if ((val && (1 << (n-1))) == 0)
sei.m_sphereRotationPitch = val;
else
{
val &= (1 << (n-1)) - 1;
sei.m_sphereRotationPitch = ~val + 1;
}
sei_read_code( pDecodedMessageOutputStream, n, val, "sphere_rotation_roll" );
if ((val && (1 << (n-1))) == 0)
sei.m_sphereRotationRoll = val;
else
{
val &= (1 << (n-1)) - 1;
sei.m_sphereRotationRoll = ~val + 1;
}
}
}
Void SEIReader::xParseSEIOmniViewport(SEIOmniViewport& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
UInt code;
UChar n = 32;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
sei_read_code( pDecodedMessageOutputStream, 10, code, "omni_viewport_id" ); sei.m_omniViewportId = code;
sei_read_flag( pDecodedMessageOutputStream, code, "omni_viewport_cancel_flag" ); sei.m_omniViewportCancelFlag = code;
if (!sei.m_omniViewportCancelFlag)
{
UInt numRegions;
sei_read_flag( pDecodedMessageOutputStream, code, "omni_viewport_persistence_flag" ); sei.m_omniViewportPersistenceFlag = code;
sei_read_code( pDecodedMessageOutputStream, 4, numRegions, "omni_viewport_cnt_minus1" ); numRegions++;
sei.m_omniViewportRegions.resize(numRegions);
for(UInt region=0; region<numRegions; region++)
{
SEIOmniViewport::OmniViewport &viewport = sei.m_omniViewportRegions[region];
sei_read_code( pDecodedMessageOutputStream, n, code, "omni_viewport_azimuth_centre" );
if ((code && (1 << (n-1))) == 0)
viewport.azimuthCentre = code;
else
{
code &= (1 << (n-1)) - 1;
viewport.azimuthCentre = ~code + 1;
}
sei_read_code( pDecodedMessageOutputStream, n, code, "omni_viewport_elevation_centre" );
if ((code && (1 << (n-1))) == 0)
viewport.elevationCentre = code;
else
{
code &= (1 << (n-1)) - 1;
viewport.elevationCentre = ~code + 1;
}
sei_read_code( pDecodedMessageOutputStream, n, code, "omni_viewport_tilt_centre" );
if ((code && (1 << (n-1))) == 0)
viewport.tiltCentre = code;
else
{
code &= (1 << (n-1)) - 1;
viewport.tiltCentre = ~code + 1;
}
sei_read_code( pDecodedMessageOutputStream, 32, code, "omni_viewport_hor_range" ); viewport.horRange = code;
sei_read_code( pDecodedMessageOutputStream, 32, code, "omni_viewport_ver_range" ); viewport.verRange = code;
}
}
else
{
sei.m_omniViewportRegions.clear();
sei.m_omniViewportPersistenceFlag=false;
}
}
#endif
#if CMP_SEI_MESSAGE
Void SEIReader::xParseSEICubemapProjection(SEICubemapProjection& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
......
......@@ -90,6 +90,11 @@ 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 ERP_SR_OV_SEI_MESSAGE
Void xParseSEIEquirectangularProjection (SEIEquirectangularProjection &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEISphereRotation (SEISphereRotation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEIOmniViewport (SEIOmniViewport& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
#if CMP_SEI_MESSAGE
Void xParseSEICubemapProjection (SEICubemapProjection& sei, UInt payload