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

Merge branch 'AK1005' into 'master'

JCTVC-AK0026 / JCTVC-AL0023: shutter interval info SEI message

See merge request jct-vc/HM!20
parents df7973b2 42929e7c
Pipeline #4403 passed with stage
in 3 minutes and 52 seconds
#======== Ambient viewing environment SEI message =====================
SEIAVEEnabled : 1
SEIAVEAmbientIlluminance : 100000
SEIAVEAmbientLightX : 15635
SEIAVEAmbientLightY : 16450
#======== Content Light Level SEI message =====================
SEICLLEnabled : 1
SEICLLMaxContentLightLevel : 4000
SEICLLMaxPicAvgLightLevel : 0
#======== Film grain characteristics SEI message =====================
SEIFGCEnabled : 1
SEIFGCCancelFlag : 0
SEIFGCPersistenceFlag : 1
SEIFGCModelID : 0 # 0: frequency filtering; 1: auto-regression; 2-3 are reserved
SEIFGCSepColourDescPresentFlag : 0 # if not 0, need to specify separate colour description (not implemented in current encoder cmd line)
SEIFGCBlendingModeID : 0 # 0: additive; 1: multipliciative
SEIFGCLog2ScaleFactor : 0
SEIFGCCompModelPresentComp0 : 0 # if not 0, need to specify model for comp 0 (not implemented in current encoder cmd line)
SEIFGCCompModelPresentComp1 : 0 # if not 0, need to specify model for comp 1 (not implemented in current encoder cmd line)
SEIFGCCompModelPresentComp2 : 0 # if not 0, need to specify model for comp 2 (not implemented in current encoder cmd line)
#======== Shutter Interval Info SEI message =====================
SEIShutterIntervalEnabled : 1
SEISiiTimeScale : 27000000
SEISiiInputNumUnitsInShutterInterval : 1080000 # should have at least one entry. if only one entry, the value is assigned to sii_num_units_in_shutter_interval,
# if multiple entries, the values are set to sub_layer_num_units_in_shutter_interval[ ]
\ No newline at end of file
......@@ -2248,7 +2248,7 @@ The table below lists the SEI messages defined for Version 1 and Range-Extension
15 & Picture snapshot & (Not handled)\\
16 & Progressive refinement segment start & (Not handled)\\
17 & Progressive refinement segment end & (Not handled)\\
19 & Film grain characteristics & (Not handled)\\
19 & Film grain characteristics & Table \ref{tab:sei-film-grain} \\
22 & Post-filter hint & (Not handled)\\
23 & Tone mapping information & Table \ref{tab:sei-tone-mapping-info} \\
45 & Frame packing arrangement & Table \ref{tab:sei-frame-packing-arrangement} \\
......@@ -2270,12 +2270,17 @@ 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)\\
144 & Content light level info & Table \ref{tab:sei-content-light-level}\\
147 & Alternative transfer characteristics & Table \ref{tab:sei-alternative-transfer-characteristics}\\
148 & Ambient viewing environment & Table \ref{tab:sei-ambient-viewing-environment}\\
149 & Content colour volume & Table \ref{tab:sei-content-colour-volume}\\
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} \\
158 & Motion-constrained tile set extraction information & Table \ref{tab:sei-mcts-extract} \\
203 & Shutter interval information & Table \ref{tab:sei-sii}\\
\end{SEIListTable}
%%
%% SEI messages
......@@ -2314,6 +2319,61 @@ SEI messages.
\begin{OptionTableNoShorthand}{Film grain characteristics SEI message encoder parameters}{tab:sei-film-grain}
\Option{SEIFGCEnabled} &
\Default{0} &
Enables or disables the insertion of the film grain characteristics SEI message.
\\
\Option{SEIFGCCancelFlag} &
\Default{0} &
Specifies the persistence of any previous film grain characteristics SEI message in output order.
\\
\Option{SEIFGCPersistenceFlag} &
\Default{1} &
Specifies the persistence of the film grain characteristics SEI message for the current layer.
\\
\Option{SEIFGCModelID} &
\Default{0} &
Specifies the film grain simulation model.
\par
\begin{tabular}{cp{0.35\textwidth}}
0 & frequency filtering \\
1 & auto-regression \\
\end{tabular}
\\
\Option{SEIFGCSepColourDescPresentFlag} &
\Default{0} &
Specifies the presence of a distinct colour space description for the film grain characteristics specified in the SEI message.
\\
\Option{SEIFGCBlendingModeID} &
\Default{0} &
Specifies the blending mode used to blend the simulated film grain with the decoded images.
\par
\begin{tabular}{cp{0.35\textwidth}}
0 & additive \\
1 & multiplicative \\
\end{tabular}
\\
\Option{SEIFGCLog2ScaleFactor} &
\Default{0} &
Specifies a scale factor used in the film grain characterization equations.
\\
\Option{SEIFGCCompModelPresentComp0} &
\Default{0} &
Specifies the presence of film grain modelling on colour component 0.
\\
\Option{SEIFGCCompModelPresentComp1} &
\Default{0} &
Specifies the presence of film grain modelling on colour component 1.
\\
\Option{SEIFGCCompModelPresentComp2} &
\Default{0} &
Specifies the presence of film grain modelling on colour component 2.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Tone mapping information SEI message encoder parameters}{tab:sei-tone-mapping-info}
\Option{SEIToneMappingInfo} &
\Default{0} &
......@@ -2890,6 +2950,120 @@ An example file can be found in cfg/misc/example_colour_remapping_sei_encoder_0.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Content light level info SEI message encoder parameters}{tab:sei-content-light-level}
\Option{SEICLLEnabled} &
\Default{false} &
Enables or disables the insertion of the content light level SEI message.
\\
\Option{SEICLLMaxContentLightLevel} &
\Default{4000} &
When not equal to 0, specifies an upper bound on the maximum light level among all individual samples in a 4:4:4 representation of red, green, and blue colour primary intensities in the linear light domain for the pictures of the CLVS, in units of candelas per square metre. When equal to 0, no such upper bound is indicated.
\\
\Option{SEICLLMaxPicAvgLightLevel} &
\Default{0} &
When not equal to 0, specifies an upper bound on the maximum average light level among the samples in a 4:4:4 representation of red, green, and blue colour primary intensities in the linear light domain for any individual picture of the CLVS, in units of candelas per square metre. When equal to 0, no such upper bound is indicated.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Alternative transfer characteristics SEI message encoder parameters}{tab:sei-alternative-transfer-characteristics}
\Option{SEIPreferredTransferCharacteristics} &
\Default{18} &
Indicates a preferred alternative value for the transfer_characteristics syntax element that is indicated by the colour description syntax of VUI parameters.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Ambient viewing environment SEI message encoder parameters}{tab:sei-ambient-viewing-environment}
\Option{SEIAVEEnabled} &
\Default{false} &
Enables or disables the insertion of the ambient viewing environment SEI message.
\\
\Option{SEIAVEAmbientIlluminance} &
\Default{100000} &
Specifies the environmental illuminance of the ambient viewing environment in units of 1/10000 lux. The value shall not be 0.
\\
\Option{SEIAVEAmbientLightX} &
\Default{15635} &
Specifies the x chromaticity coordinate, according to the CIE 1931 definition, of the environmental ambient light in the nominal viewing environment in normalized increments of 1/50000. The value shall be in the range of 0 to 50,000, inclusive.
\\
\Option{SEIAVEAmbientLightY} &
\Default{16450} &
Specifies the y chromaticity coordinate, according to the CIE 1931 definition, of the environmental ambient light in the nominal viewing environment in normalized increments of 1/50000. The value shall be in the range of 0 to 50,000, inclusive.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Content colour volume SEI message encoder parameters}{tab:sei-content-colour-volume}
\Option{SEICCVEnabled} &
\Default{false} &
Enables or disables the insertion of the content colour volume SEI message.
\\
\Option{SEICCVCancelFlag} &
\Default{false} &
Specifies the persistence of any previous content colour volume SEI message in output order.
\\
\Option{SEICCVPersistenceFlag} &
\Default{true} &
Specifies the persistence of the content colour volume SEI message for the current layer.
\\
\Option{SEICCVPrimariesPresent} &
\Default{true} &
Specifies whether the CCV primaries are present in the content colour volume SEI message.
\\
\Option{m_ccvSEIPrimariesX0} &
\Default{0.300} &
Specifies the x coordinate, according to the CIE 1931 definition, of the first (green) colour primary component in normalized increments of 1/50000.
\\
\Option{m_ccvSEIPrimariesY0} &
\Default{0.600} &
Specifies the y coordinate, according to the CIE 1931 definition, of the first (green) colour primary component in normalized increments of 1/50000.
\\
\Option{m_ccvSEIPrimariesX1} &
\Default{0.150} &
Specifies the x coordinate, according to the CIE 1931 definition, of the second (blue) colour primary component in normalized increments of 1/50000.
\\
\Option{m_ccvSEIPrimariesY1} &
\Default{0.060} &
Specifies the y coordinate, according to the CIE 1931 definition, of the second (blue) colour primary component in normalized increments of 1/50000.
\\
\Option{m_ccvSEIPrimariesX2} &
\Default{0.640} &
Specifies the x coordinate, according to the CIE 1931 definition, of the third (red) colour primary component in normalized increments of 1/50000.
\\
\Option{m_ccvSEIPrimariesY2} &
\Default{0.330} &
Specifies the y coordinate, according to the CIE 1931 definition, of the third (red) colour primary component in normalized increments of 1/50000.
\\
\Option{SEICCVMinLuminanceValuePresent} &
\Default{true} &
Specifies whether the CCV min luminance value is present in the content colour volume SEI message.
\\
\Option{SEICCVMinLuminanceValue} &
\Default{0.0} &
specifies the CCV min luminance value in the content colour volume SEI message.
\\
\Option{SEICCVMaxLuminanceValuePresent} &
\Default{1} &
Specifies whether the CCV max luminance value is present in the content colour volume SEI message.
\\
\Option{SEICCVMaxLuminanceValue} &
\Default{0.1} &
specifies the CCV max luminance value in the content colour volume SEI message.
\\
\Option{SEICCVAvgLuminanceValuePresent} &
\Default{1} &
Specifies whether the CCV avg luminance value is present in the content colour volume SEI message.
\\
\Option{SEICCVAvgLuminanceValue} &
\Default{0.01} &
specifies the CCV avg luminance value in the content colour volume SEI message.
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Equirectangular Projection SEI message encoder parameters}{tab:sei-erp}
\Option{SEIErpEnabled} &
\Default{false} &
......@@ -3124,6 +3298,33 @@ When true (non-zero), generates example motion-constrained tile sets extraction
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Shutter interval info SEI message encoder parameters}{tab:sei-sii}
\Option{SEIShutterIntervalEnabled} &
\Default{false} &
Enables or disables the insertion of the shutter interval info SEI message.
\\
\Option{SEISiiNumUnitsInShutterInterval} &
\Default{1080000} &
Specifies the number of time units of a clock operating at the frequency sii_time_scale Hz that corresponds to one increment of an shutter clock tick counter.
\\
\Option{SEISiiTimeScale} &
\Default{27000000} &
Specifies the number of time units that pass in one second.
\\
\Option{SEISiiMaxSubLayersMinus1} &
\Default{0} &
The value plus 1 specifies the maximum number of temporal sub-layers that may be present in each CVS referring to the SPS. The value shall be in the range of 0 to 6.
\\
\Option{SEISiiFixedShutterIntervalWithinCVSFlag} &
\Default{true} &
Specifies if shutter interval info is the same for all temporal sub-layers in the CVS.
\\
\end{OptionTableNoShorthand}
%\Option{SEITimeCode} &
%\Default{false} &
%When true, generate time code SEI messages.
......
......@@ -770,6 +770,9 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
SMultiValueInput<UInt> cfg_fviSEIFisheyeNumPolynomialCoeffs (0, 8, 0, 4);
SMultiValueInput<Int> cfg_fviSEIFisheyePolynomialCoeff (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 4*8);
UInt cfg_fviSEIFisheyeNumActiveAreasMinus1=0;
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
SMultiValueInput<UInt> cfg_siiSEIInputNumUnitsInSI (0, MAX_UINT, 0, 7);
#endif
Int warnUnknowParameter = 0;
po::Options opts;
......@@ -1218,6 +1221,37 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("SEICCVAvgLuminanceValuePresent", m_ccvSEIAvgLuminanceValuePresentFlag, true, "Specifies whether the CCV avg luminance value is present in the content colour volume SEI message")
("SEICCVAvgLuminanceValue", m_ccvSEIAvgLuminanceValue, 0.01, "specifies the CCV avg luminance value in the content colour volume SEI message")
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
("SEIShutterIntervalEnabled", m_siiSEIEnabled, false, "Controls if shutter interval information SEI message is enabled")
("SEISiiTimeScale", m_siiSEITimeScale, 27000000u, "Specifies sii_time_scale")
("SEISiiInputNumUnitsInShutterInterval", cfg_siiSEIInputNumUnitsInSI, cfg_siiSEIInputNumUnitsInSI, "Specifies sub_layer_num_units_in_shutter_interval")
#endif
#if SEI_ENCODER_CONTROL
// film grain characteristics SEI
("SEIFGCEnabled", m_fgcSEIEnabled, false, "Control generation of the film grain characteristics SEI message")
("SEIFGCCancelFlag", m_fgcSEICancelFlag, true, "Specifies the persistence of any previous film grain characteristics SEI message in output order.")
("SEIFGCPersistenceFlag", m_fgcSEIPersistenceFlag, false, "Specifies the persistence of the film grain characteristics SEI message for the current layer.")
("SEIFGCModelID", m_fgcSEIModelID, 0u, "Specifies the film grain simulation model. 0: frequency filtering; 1: auto-regression.")
("SEIFGCSepColourDescPresentFlag", m_fgcSEISepColourDescPresentFlag, false, "Specifies the presense of a distinct colour space description for the film grain charactersitics specified in the SEI message.")
("SEIFGCBlendingModeID", m_fgcSEIBlendingModeID, 0u, "Specifies the blending mode used to blend the simulated film grain with the decoded images. 0: additive; 1: multiplicative.")
("SEIFGCLog2ScaleFactor", m_fgcSEILog2ScaleFactor, 0u, "Specifies a scale factor used in the film grain characterization equations.")
("SEIFGCCompModelPresentComp0", m_fgcSEICompModelPresent[0], false, "Specifies the presense of film grain modelling on colour component 0.")
("SEIFGCCompModelPresentComp1", m_fgcSEICompModelPresent[1], false, "Specifies the presense of film grain modelling on colour component 1.")
("SEIFGCCompModelPresentComp2", m_fgcSEICompModelPresent[2], false, "Specifies the presense of film grain modelling on colour component 2.")
// content light level SEI
("SEICLLEnabled", m_cllSEIEnabled, false, "Control generation of the content light level SEI message")
("SEICLLMaxContentLightLevel", m_cllSEIMaxContentLevel, 0u, "When not equal to 0, specifies an upper bound on the maximum light level among all individual samples in a 4:4:4 representation "
"of red, green, and blue colour primary intensities in the linear light domain for the pictures of the CLVS, "
"in units of candelas per square metre.When equal to 0, no such upper bound is indicated.")
("SEICLLMaxPicAvgLightLevel", m_cllSEIMaxPicAvgLevel, 0u, "When not equal to 0, specifies an upper bound on the maximum average light level among the samples in a 4:4:4 representation "
"of red, green, and blue colour primary intensities in the linear light domain for any individual picture of the CLVS, "
"in units of candelas per square metre.When equal to 0, no such upper bound is indicated.")
// ambient viewing environment SEI
("SEIAVEEnabled", m_aveSEIEnabled, false, "Control generation of the ambient viewing environment SEI message")
("SEIAVEAmbientIlluminance", m_aveSEIAmbientIlluminance, 100000u, "Specifies the environmental illluminance of the ambient viewing environment in units of 1/10000 lux for the ambient viewing enviornment SEI message")
("SEIAVEAmbientLightX", m_aveSEIAmbientLightX, 15635u, "Specifies the normalized x chromaticity coordinate of the environmental ambient light in the nominal viewing enviornment according to the CIE 1931 defination in units of 1/50000 lux for the ambient viewing enviornment SEI message")
("SEIAVEAmbientLightY", m_aveSEIAmbientLightY, 16450u, "Specifies the normalized y chromaticity coordinate of the environmental ambient light in the nominal viewing enviornment according to the CIE 1931 defination in units of 1/50000 lux for the ambient viewing enviornment SEI message")
#endif
#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")
......@@ -2024,6 +2058,28 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
}
}
}
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
if (m_siiSEIEnabled)
{
assert(m_siiSEITimeScale >= 0 && m_siiSEITimeScale <= MAX_UINT);
UInt arraySize = (UInt)cfg_siiSEIInputNumUnitsInSI.values.size();
assert(arraySize > 0);
if (arraySize > 1)
{
m_siiSEISubLayerNumUnitsInSI.resize(arraySize);
for (Int i = 0; i < arraySize; i++)
{
m_siiSEISubLayerNumUnitsInSI[i] = cfg_siiSEIInputNumUnitsInSI.values[i];
assert(m_siiSEISubLayerNumUnitsInSI[i] >= 0 && m_siiSEISubLayerNumUnitsInSI[i] <= MAX_UINT);
}
}
else
{
m_siiSEINumUnitsInShutterInterval = cfg_siiSEIInputNumUnitsInSI.values[0];
assert(m_siiSEINumUnitsInShutterInterval >= 0 && m_siiSEINumUnitsInShutterInterval <= MAX_UINT);
}
}
#endif
if(m_timeCodeSEIEnabled)
{
......
......@@ -512,7 +512,32 @@ protected:
#if RNSEI
std::string m_regionalNestingSEIFileRoot;
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
Bool m_siiSEIEnabled;
UInt m_siiSEINumUnitsInShutterInterval;
UInt m_siiSEITimeScale;
std::vector<UInt> m_siiSEISubLayerNumUnitsInSI;
#endif
#if SEI_ENCODER_CONTROL
// film grain characterstics sei
Bool m_fgcSEIEnabled;
Bool m_fgcSEICancelFlag;
Bool m_fgcSEIPersistenceFlag;
UInt m_fgcSEIModelID;
Bool m_fgcSEISepColourDescPresentFlag;
UInt m_fgcSEIBlendingModeID;
UInt m_fgcSEILog2ScaleFactor;
Bool m_fgcSEICompModelPresent[MAX_NUM_COMPONENT];
// content light level SEI
Bool m_cllSEIEnabled;
UInt m_cllSEIMaxContentLevel;
UInt m_cllSEIMaxPicAvgLevel;
// ambient viewing environment sei
Bool m_aveSEIEnabled;
UInt m_aveSEIAmbientIlluminance;
UInt m_aveSEIAmbientLightX;
UInt m_aveSEIAmbientLightY;
#endif
std::string m_summaryOutFilename; ///< filename to use for producing summary output file.
std::string m_summaryPicFilenameBase; ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended.
UInt m_summaryVerboseness; ///< Specifies the level of the verboseness of the text output.
......
......@@ -440,6 +440,34 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setRwpSEIRwpGuardBandNotUsedForPredFlag (m_rwpSEIRwpGuardBandNotUsedForPredFlag);
m_cTEncTop.setRwpSEIRwpGuardBandType (m_rwpSEIRwpGuardBandType);
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
m_cTEncTop.setSiiSEIEnabled (m_siiSEIEnabled);
m_cTEncTop.setSiiSEINumUnitsInShutterInterval (m_siiSEINumUnitsInShutterInterval);
m_cTEncTop.setSiiSEITimeScale (m_siiSEITimeScale);
m_cTEncTop.setSiiSEISubLayerNumUnitsInSI (m_siiSEISubLayerNumUnitsInSI);
#endif
#if SEI_ENCODER_CONTROL
// film grain charcteristics
m_cTEncTop.setFilmGrainCharactersticsSEIEnabled (m_fgcSEIEnabled);
m_cTEncTop.setFilmGrainCharactersticsSEICancelFlag (m_fgcSEICancelFlag);
m_cTEncTop.setFilmGrainCharactersticsSEIPersistenceFlag (m_fgcSEIPersistenceFlag);
m_cTEncTop.setFilmGrainCharactersticsSEIModelID ((UChar)m_fgcSEIModelID);
m_cTEncTop.setFilmGrainCharactersticsSEISepColourDescPresent (m_fgcSEISepColourDescPresentFlag);
m_cTEncTop.setFilmGrainCharactersticsSEIBlendingModeID ((UChar)m_fgcSEIBlendingModeID);
m_cTEncTop.setFilmGrainCharactersticsSEILog2ScaleFactor ((UChar)m_fgcSEILog2ScaleFactor);
for (Int i = 0; i < MAX_NUM_COMPONENT; i++) {
m_cTEncTop.setFGCSEICompModelPresent (m_fgcSEICompModelPresent[i], i);
}
// content light level
m_cTEncTop.setCLLSEIEnabled (m_cllSEIEnabled);
m_cTEncTop.setCLLSEIMaxContentLightLevel ((UShort)m_cllSEIMaxContentLevel);
m_cTEncTop.setCLLSEIMaxPicAvgLightLevel ((UShort)m_cllSEIMaxPicAvgLevel);
// ambient viewing enviornment
m_cTEncTop.setAmbientViewingEnvironmentSEIEnabled (m_aveSEIEnabled);
m_cTEncTop.setAmbientViewingEnvironmentSEIIlluminance (m_aveSEIAmbientIlluminance);
m_cTEncTop.setAmbientViewingEnvironmentSEIAmbientLightX ((UShort)m_aveSEIAmbientLightX);
m_cTEncTop.setAmbientViewingEnvironmentSEIAmbientLightY ((UShort)m_aveSEIAmbientLightY);
#endif
#if FVI_SEI_MESSAGE
if (m_fisheyeVIdeoInfoSEIEnabled)
{
......
......@@ -97,6 +97,9 @@ const std::vector<SEI::PayloadType> SEI::prefix_sei_messages({
#if RNSEI
, SEI::REGIONAL_NESTING
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
, SEI::SHUTTER_INTERVAL_INFO
#endif
});
const std::vector<SEI::PayloadType> SEI::suffix_sei_messages({
......@@ -332,6 +335,9 @@ const TChar *SEI::getSEIMessageString(SEI::PayloadType payloadType)
#endif
#if AR_SEI_MESSAGE
case SEI::ANNOTATED_REGIONS: return "Annotated Region";
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
case SEI::SHUTTER_INTERVAL_INFO: return "Shutter interval information";
#endif
default: return "Unknown";
}
......
......@@ -118,6 +118,9 @@ public:
#endif
#if AR_SEI_MESSAGE
ANNOTATED_REGIONS = 202,
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
SHUTTER_INTERVAL_INFO = 203,
#endif
};
......@@ -975,6 +978,23 @@ public:
};
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
class SEIShutterIntervalInfo : public SEI
{
public:
PayloadType payloadType() const { return SHUTTER_INTERVAL_INFO; }
SEIShutterIntervalInfo() {}
virtual ~SEIShutterIntervalInfo() {}
Bool m_siiEnabled;
UInt m_siiNumUnitsInShutterInterval;
UInt m_siiTimeScale;
UInt m_siiMaxSubLayersMinus1;
Bool m_siiFixedSIwithinCLVS;
std::vector<UInt> m_siiSubLayerNumUnitsInSI;
};
#endif
class SEIColourRemappingInfo : public SEI
{
public:
......
......@@ -113,6 +113,9 @@
#define AR_SEI_MESSAGE 1 ///< Annotated Region SEI message
#define SHUTTER_INTERVAL_SEI_MESSAGE 1 ///< support for shutter interval SEI message
#define SEI_ENCODER_CONTROL 1 ///< add encoder control for the following SEI: film grain characteristics, content light level, ambient viewing environment
#define FIXSAORESETAFTERIRAP 1 // Fix the reset mechanism for SAO after an IRAP for the case of IRAP period equal to gop size.
#define ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP 1 // Add support to reseting encoder decisions after IRAP, to enable independent/parallel coding of randomaccess configuration intra-periods.
......
......@@ -396,6 +396,12 @@ Void SEIReader::xReadSEIPayloadData(Int const payloadType, Int const payloadSize
sei = new SEIRegionalNesting;
xParseSEIRegionalNesting((SEIRegionalNesting&) *sei, payloadSize, sps, pDecodedMessageOutputStream);
break;
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
case SEI::SHUTTER_INTERVAL_INFO:
sei = new SEIShutterIntervalInfo;
xParseSEIShutterInterval((SEIShutterIntervalInfo&)*sei, payloadSize, pDecodedMessageOutputStream);
break;
#endif
default:
for (UInt i = 0; i < payloadSize; i++)
......@@ -1573,6 +1579,31 @@ Void SEIReader::xParseSEIContentColourVolume(SEIContentColourVolume& sei, UInt p
}
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
Void SEIReader::xParseSEIShutterInterval(SEIShutterIntervalInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
Int i;
UInt val;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
sei_read_code(pDecodedMessageOutputStream, 32, val, "sii_time_scale"); sei.m_siiTimeScale = val;
sei_read_flag(pDecodedMessageOutputStream, val, "fixed_shutter_interval_within_clvs_flag"); sei.m_siiFixedSIwithinCLVS = val;
if (sei.m_siiFixedSIwithinCLVS)
{
sei_read_code(pDecodedMessageOutputStream, 32, val, "sii_num_units_in_shutter_interval"); sei.m_siiNumUnitsInShutterInterval = val;
}
else
{
sei_read_code(pDecodedMessageOutputStream, 3, val, "sii_max_sub_layers_minus1 "); sei.m_siiMaxSubLayersMinus1 = val;
sei.m_siiSubLayerNumUnitsInSI.resize(sei.m_siiMaxSubLayersMinus1 + 1);
for (i = 0; i <= sei.m_siiMaxSubLayersMinus1; i++)
{
sei_read_code(pDecodedMessageOutputStream, 32, val, "sub_layer_num_units_in_shutter_interval[ i ]");
sei.m_siiSubLayerNumUnitsInSI[i] = val;
}
}
}
#endif
#if ERP_SR_OV_SEI_MESSAGE
Void SEIReader::xParseSEIEquirectangularProjection(SEIEquirectangularProjection& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
......
......@@ -123,6 +123,9 @@ protected:
Void xParseSEIAmbientViewingEnvironment (SEIAmbientViewingEnvironment& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream);
#if RNSEI
Void xParseSEIRegionalNesting ( SEIRegionalNesting& sei, UInt payloadSize, const TComSPS* sps, std::ostream *pDecodedMessageOutputStream );
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
Void xParseSEIShutterInterval (SEIShutterIntervalInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
Void sei_read_scode(std::ostream *pOS, UInt uiLength, Int& ruiCode, const TChar *pSymbolName);
Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const TChar *pSymbolName);
......
......@@ -554,6 +554,67 @@ Void SEIEncoder::initSEIContentColourVolume(SEIContentColourVolume *seiContentCo
}
#endif
#if SHUTTER_INTERVAL_SEI_MESSAGE
Void SEIEncoder::initSEIShutterIntervalInfo(SEIShutterIntervalInfo *seiShutterIntervalInfo)
{
assert(m_isInitialized);
assert(seiShutterIntervalInfo != NULL);
seiShutterIntervalInfo->m_siiTimeScale = m_pcCfg->getSiiSEITimeScale();
seiShutterIntervalInfo->m_siiFixedSIwithinCLVS = m_pcCfg->getSiiSEIFixedSIwithinCLVS();
if (seiShutterIntervalInfo->m_siiFixedSIwithinCLVS == true)
{
seiShutterIntervalInfo->m_siiNumUnitsInShutterInterval = m_pcCfg->getSiiSEINumUnitsInShutterInterval();
}
else
{
seiShutterIntervalInfo->m_siiMaxSubLayersMinus1 = m_pcCfg->getSiiSEIMaxSubLayersMinus1();
seiShutterIntervalInfo->m_siiSubLayerNumUnitsInSI.resize(seiShutterIntervalInfo->m_siiMaxSubLayersMinus1+1);
for (Int i = 0; i <= seiShutterIntervalInfo->m_siiMaxSubLayersMinus1; i++)
{
seiShutterIntervalInfo->m_siiSubLayerNumUnitsInSI[i] = m_pcCfg->getSiiSEISubLayerNumUnitsInSI(i);
}
}
}
#endif
#if SEI_ENCODER_CONTROL
Void SEIEncoder::initSEIFilmGrainCharacteristics(SEIFilmGrainCharacteristics *seiFilmGrain)
{
assert(m_isInitialized);
assert(seiFilmGrain != NULL);
// Set SEI message parameters read from command line options
seiFilmGrain->m_filmGrainCharacteristicsCancelFlag = m_pcCfg->getFilmGrainCharactersticsSEICancelFlag();
seiFilmGrain->m_filmGrainCharacteristicsPersistenceFlag = m_pcCfg->getFilmGrainCharactersticsSEIPersistenceFlag();
seiFilmGrain->m_filmGrainModelId = m_pcCfg->getFilmGrainCharactersticsSEIModelID();
seiFilmGrain->m_separateColourDescriptionPresentFlag = m_pcCfg->getFilmGrainCharactersticsSEISepColourDescPresent();
seiFilmGrain->m_blendingModeId = m_pcCfg->getFilmGrainCharactersticsSEIBlendingModeID();
seiFilmGrain->m_log2ScaleFactor = m_pcCfg->getFilmGrainCharactersticsSEILog2ScaleFactor();
for (int i = 0; i < MAX_NUM_COMPONENT; i++)
{
seiFilmGrain->m_compModel[i].bPresentFlag = m_pcCfg->getFGCSEICompModelPresent(i);
}
}
Void SEIEncoder::initSEIContentLightLevel(SEIContentLightLevelInfo *seiCLL)
{
assert(m_isInitialized);
assert(seiCLL != NULL);
// Set SEI message parameters read from command line options
seiCLL->m_maxContentLightLevel = m_pcCfg->getCLLSEIMaxContentLightLevel();
seiCLL->m_maxPicAverageLightLevel = m_pcCfg->getCLLSEIMaxPicAvgLightLevel();
}
Void SEIEncoder::initSEIAmbientViewingEnvironment(SEIAmbientViewingEnvironment *seiAmbViewEnvironment)
{
assert(m_isInitialized);