Commit 70fe4f14 authored by Frank Bossen's avatar Frank Bossen

Merge branch 'vui-cleanup' into 'master'

Align VUI with specification and clean up SW manual

See merge request jvet/VVCSoftware_VTM!1220
parents 4b5420a0 7365059f
VuiParametersPresent: 1 // enable VUI
AspectRatioInfoPresent: 1 // enable presence of sample aspect ratio information
AspectRatioIdc: 1 // sample aspect ratio pre-defined types according to Rec. ITU-T H.273 | ISO/IEC 23091-2
SarWidth: 1 // sample aspect ratio width, if AspectRatioIdc is equal to 255
SarHeight: 1 // sample aspect ratio height, if AspectRatioIdc is equal to 255
ColourDescriptionPresent: 1 // enable presence of colour description information
ColourPrimaries: 1 // the source colour primaries according to Rec. ITU-T H.273 | ISO/IEC 23091-2
TransferCharacteristics: 1 // transfer characteristics function according to Rec. ITU-T H.273 | ISO/IEC 23091-2
MatrixCoefficients: 1 // the formulae used in deriving luma and chroma signals acc. to Rec. ITU-T H.273 | ISO/IEC 23091-2
VideoFullRange: 0 // scaling and offset values applied according to Rec. ITU-T H.273 | ISO/IEC 23091-2
ChromaLocInfoPresent: 1 // enable presence of chroma location information
ChromaSampleLocTypeTopField: 0 // the location of chroma sample top field
ChromaSampleLocTypeBottomField: 0 // the location of chroma sample bottom field
ChromaSampleLocType: 0 // the location of chroma sample frame
OverscanInfoPresent: 1 // enable presence of overscan information
OverscanAppropriate: 0 // indicates if the cropped decoded pictures output are suitable for display using overscan
VuiParametersPresent: 1 // enable VUI
AspectRatioInfoPresent: 1 // enable presence of sample aspect ratio information
AspectRatioIdc: 1 // sample aspect ratio pre-defined types according to Rec. ITU-T H.273 | ISO/IEC 23091-2
SarWidth: 1 // sample aspect ratio width, if AspectRatioIdc is equal to 255
SarHeight: 1 // sample aspect ratio height, if AspectRatioIdc is equal to 255
ColourDescriptionPresent: 1 // enable presence of colour description information
ColourPrimaries: 9 // the source colour primaries according to Rec. ITU-T H.273 | ISO/IEC 23091-2
TransferCharacteristics: 16 // transfer characteristics function according to Rec. ITU-T H.273 | ISO/IEC 23091-2
MatrixCoefficients: 9 // the formulae used in deriving luma and chroma signals acc. to Rec. ITU-T H.273 | ISO/IEC 23091-2
VideoFullRange: 0 // scaling and offset values applied according to Rec. ITU-T H.273 | ISO/IEC 23091-2
ChromaLocInfoPresent: 1 // enable presence of chroma location information
ChromaSampleLocTypeTopField: 2 // the location of chroma sample top field
ChromaSampleLocTypeBottomField: 2 // the location of chroma sample bottom field
ChromaSampleLocType: 2 // the location of chroma sample frame
OverscanInfoPresent: 1 // enable presence of overscan information
OverscanAppropriate: 0 // indicates if the cropped decoded pictures output are suitable for display using overscan
......@@ -2450,26 +2450,13 @@ Indicates whether cropped decoded pictures are suitable for display using oversc
1 & Indicates that the decoded pictures may be displayed using overscan. \\
\end{tabular}
\\
\Option{VideoSignalTypePresent} &
\Default{false} &
Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present.
\\
\Option{VideoFormat} &
\Default{5} &
Indicates representation of pictures.
\\
\Option{VideoFullRange} &
\Default{false} &
Indicates the black level and range of luma and chroma signals.
\par
\begin{tabular}{cp{0.45\textwidth}}
0 & Indicates that the luma and chroma signals are to be scaled prior to display. \\
1 & Indicates that the luma and chroma signals are not to be scaled prior to display. \\
\end{tabular}
\\
\Option{ColourDescriptionPresent} &
\Default{false} &
Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present.
Signals whether colour_primaries, transfer_characteristics, matrix_coefficients and video_full_range_flag are present.
\\
\Option{ColourPrimaries} &
\Default{2} &
......@@ -2483,6 +2470,15 @@ Indicates the opto-electronic transfer characteristics of the source.
\Default{2} &
Describes the matrix coefficients used in deriving luma and chroma from RGB primaries.
\\
\Option{VideoFullRange} &
\Default{false} &
Indicates the black level and range of luma and chroma signals.
\par
\begin{tabular}{cp{0.45\textwidth}}
0 & Indicates that the luma and chroma signals are to be scaled prior to display. \\
1 & Indicates that the luma and chroma signals are not to be scaled prior to display. \\
\end{tabular}
\\
\Option{ChromaLocInfoPresent} &
\Default{false} &
Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present.
......
......@@ -935,7 +935,6 @@ void EncApp::xInitLibCfg()
m_cEncLib.setChromaSampleLocType ( m_chromaSampleLocType );
m_cEncLib.setOverscanInfoPresentFlag ( m_overscanInfoPresentFlag );
m_cEncLib.setOverscanAppropriateFlag ( m_overscanAppropriateFlag );
m_cEncLib.setVideoSignalTypePresentFlag ( m_videoSignalTypePresentFlag );
m_cEncLib.setVideoFullRangeFlag ( m_videoFullRangeFlag );
m_cEncLib.setEfficientFieldIRAPEnabled ( m_bEfficientFieldIRAPEnabled );
m_cEncLib.setHarmonizeGopFirstFieldCoupleEnabled ( m_bHarmonizeGopFirstFieldCoupleEnabled );
......
......@@ -1464,7 +1464,6 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("ChromaSampleLocType", m_chromaSampleLocType, 0, "Specifies the location of chroma samples for progressive content")
("OverscanInfoPresent", m_overscanInfoPresentFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
("OverscanAppropriate", m_overscanAppropriateFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
("VideoSignalTypePresent", m_videoSignalTypePresentFlag, false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present")
("VideoFullRange", m_videoFullRangeFlag, false, "Indicates the black level and range of luma and chroma signals");
opts.addOptions()
#if HEVC_SEI
......
......@@ -792,7 +792,6 @@ protected:
int m_chromaSampleLocType; ///< Specifies the location of chroma samples for progressive content
bool m_overscanInfoPresentFlag; ///< Signals whether overscan_appropriate_flag is present
bool m_overscanAppropriateFlag; ///< Indicates whether conformant decoded pictures are suitable for display using overscan
bool m_videoSignalTypePresentFlag; ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
bool m_videoFullRangeFlag; ///< Indicates the black level and range of luma and chroma signals
int m_ImvMode; ///< imv mode
int m_Imv4PelFast; ///< imv 4-Pel fast mode
......
......@@ -909,6 +909,7 @@ class VUI
{
private:
bool m_aspectRatioInfoPresentFlag;
bool m_aspectRatioConstantFlag;
int m_aspectRatioIdc;
int m_sarWidth;
int m_sarHeight;
......@@ -923,12 +924,12 @@ private:
int m_chromaSampleLocType;
bool m_overscanInfoPresentFlag;
bool m_overscanAppropriateFlag;
bool m_videoSignalTypePresentFlag;
bool m_videoFullRangeFlag;
public:
VUI()
: m_aspectRatioInfoPresentFlag (false) //TODO: This initialiser list contains magic numbers
, m_aspectRatioConstantFlag (true)
, m_aspectRatioIdc (0)
, m_sarWidth (0)
, m_sarHeight (0)
......@@ -943,7 +944,6 @@ public:
, m_chromaSampleLocType (0)
, m_overscanInfoPresentFlag (false)
, m_overscanAppropriateFlag (false)
, m_videoSignalTypePresentFlag (false)
, m_videoFullRangeFlag (false)
{}
......@@ -951,6 +951,8 @@ public:
bool getAspectRatioInfoPresentFlag() const { return m_aspectRatioInfoPresentFlag; }
void setAspectRatioInfoPresentFlag(bool i) { m_aspectRatioInfoPresentFlag = i; }
bool getAspectRatioConstantFlag() const { return m_aspectRatioConstantFlag; }
void setAspectRatioConstantFlag(bool b) { m_aspectRatioConstantFlag = b; }
int getAspectRatioIdc() const { return m_aspectRatioIdc; }
void setAspectRatioIdc(int i) { m_aspectRatioIdc = i; }
......@@ -994,9 +996,6 @@ public:
bool getOverscanAppropriateFlag() const { return m_overscanAppropriateFlag; }
void setOverscanAppropriateFlag(bool i) { m_overscanAppropriateFlag = i; }
bool getVideoSignalTypePresentFlag() const { return m_videoSignalTypePresentFlag; }
void setVideoSignalTypePresentFlag(bool i) { m_videoSignalTypePresentFlag = i; }
bool getVideoFullRangeFlag() const { return m_videoFullRangeFlag; }
void setVideoFullRangeFlag(bool i) { m_videoFullRangeFlag = i; }
......
......@@ -1313,6 +1313,7 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS)
READ_FLAG( symbol, "aspect_ratio_info_present_flag"); pcVUI->setAspectRatioInfoPresentFlag(symbol);
if (pcVUI->getAspectRatioInfoPresentFlag())
{
READ_FLAG( symbol, "aspect_ratio_constant_flag"); pcVUI->setAspectRatioConstantFlag(symbol);
READ_CODE(8, symbol, "aspect_ratio_idc"); pcVUI->setAspectRatioIdc(symbol);
if (pcVUI->getAspectRatioIdc() == 255)
{
......@@ -1327,6 +1328,7 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS)
READ_CODE(8, symbol, "colour_primaries"); pcVUI->setColourPrimaries(symbol);
READ_CODE(8, symbol, "transfer_characteristics"); pcVUI->setTransferCharacteristics(symbol);
READ_CODE(8, symbol, "matrix_coeffs"); pcVUI->setMatrixCoefficients(symbol);
READ_FLAG( symbol, "video_full_range_flag"); pcVUI->setVideoFullRangeFlag(symbol);
}
READ_FLAG( symbol, "field_seq_flag"); pcVUI->setFieldSeqFlag(symbol);
......@@ -1350,13 +1352,6 @@ void HLSyntaxReader::parseVUI(VUI* pcVUI, SPS *pcSPS)
{
READ_FLAG( symbol, "overscan_appropriate_flag"); pcVUI->setOverscanAppropriateFlag(symbol);
}
READ_FLAG( symbol, "video_signal_type_present_flag"); pcVUI->setVideoSignalTypePresentFlag(symbol);
if (pcVUI->getVideoSignalTypePresentFlag())
{
READ_FLAG( symbol, "video_full_range_flag"); pcVUI->setVideoFullRangeFlag(symbol);
}
}
void HLSyntaxReader::parseHrdParameters(HRDParameters *hrd, uint32_t firstSubLayer, uint32_t maxNumSubLayersMinus1)
......
......@@ -836,7 +836,6 @@ protected:
int m_chromaSampleLocType; ///< Specifies the location of chroma samples for progressive content
bool m_overscanInfoPresentFlag; ///< Signals whether overscan_appropriate_flag is present
bool m_overscanAppropriateFlag; ///< Indicates whether conformant decoded pictures are suitable for display using overscan
bool m_videoSignalTypePresentFlag; ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present
bool m_videoFullRangeFlag; ///< Indicates the black level and range of luma and chroma signals
bool m_bEfficientFieldIRAPEnabled; ///< enable to code fields in a specific, potentially more efficient, order.
......@@ -2137,8 +2136,6 @@ public:
void setOverscanInfoPresentFlag(bool i) { m_overscanInfoPresentFlag = i; }
bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; }
void setOverscanAppropriateFlag(bool i) { m_overscanAppropriateFlag = i; }
bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; }
void setVideoSignalTypePresentFlag(bool i) { m_videoSignalTypePresentFlag = i; }
bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; }
void setVideoFullRangeFlag(bool i) { m_videoFullRangeFlag = i; }
......
......@@ -1679,6 +1679,7 @@ void EncLib::xInitSPS(SPS &sps)
{
VUI* pcVUI = sps.getVuiParameters();
pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioInfoPresentFlag());
pcVUI->setAspectRatioConstantFlag(!getSampleAspectRatioInfoSEIEnabled());
pcVUI->setAspectRatioIdc(getAspectRatioIdc());
pcVUI->setSarWidth(getSarWidth());
pcVUI->setSarHeight(getSarHeight());
......@@ -1693,7 +1694,6 @@ void EncLib::xInitSPS(SPS &sps)
pcVUI->setChromaSampleLocType(getChromaSampleLocType());
pcVUI->setOverscanInfoPresentFlag(getOverscanInfoPresentFlag());
pcVUI->setOverscanAppropriateFlag(getOverscanAppropriateFlag());
pcVUI->setVideoSignalTypePresentFlag(getVideoSignalTypePresentFlag());
pcVUI->setVideoFullRangeFlag(getVideoFullRangeFlag());
}
......
......@@ -803,6 +803,7 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS )
WRITE_FLAG(pcVUI->getAspectRatioInfoPresentFlag(), "aspect_ratio_info_present_flag");
if (pcVUI->getAspectRatioInfoPresentFlag())
{
WRITE_FLAG(pcVUI->getAspectRatioConstantFlag(), "aspect_ratio_constant_flag");
WRITE_CODE(pcVUI->getAspectRatioIdc(), 8, "aspect_ratio_idc" );
if (pcVUI->getAspectRatioIdc() == 255)
{
......@@ -816,6 +817,7 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS )
WRITE_CODE(pcVUI->getColourPrimaries(), 8, "colour_primaries");
WRITE_CODE(pcVUI->getTransferCharacteristics(), 8, "transfer_characteristics");
WRITE_CODE(pcVUI->getMatrixCoefficients(), 8, "matrix_coeffs");
WRITE_FLAG(pcVUI->getVideoFullRangeFlag(), "video_full_range_flag");
}
WRITE_FLAG(pcVUI->getFieldSeqFlag(), "field_seq_flag");
WRITE_FLAG(pcVUI->getChromaLocInfoPresentFlag(), "chroma_loc_info_present_flag");
......@@ -836,12 +838,6 @@ void HLSWriter::codeVUI( const VUI *pcVUI, const SPS* pcSPS )
{
WRITE_FLAG(pcVUI->getOverscanAppropriateFlag(), "overscan_appropriate_flag");
}
WRITE_FLAG(pcVUI->getVideoSignalTypePresentFlag(), "video_signal_type_present_flag");
if (pcVUI->getVideoSignalTypePresentFlag())
{
WRITE_FLAG(pcVUI->getVideoFullRangeFlag(), "video_full_range_flag");
}
}
void HLSWriter::codeHrdParameters( const HRDParameters *hrd, const uint32_t firstSubLayer, const uint32_t maxNumSubLayersMinus1)
......
Markdown is supported
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