Commit 6f1f1f22 authored by Karsten Suehring's avatar Karsten Suehring
Browse files

apply patch for MCTS Extraction SEI


Patch-by: Robert Skupin's avatarRobert Skupin <robert.skupin@hhi.fraunhofer.de>
parent 1458dc5e
......@@ -19,6 +19,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppDecoderAnalyser", "vc20
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TLibDecoderAnalyser", "vc2015\TLibDecoderAnalyser_vc2015.vcxproj", "{68C1251A-55D8-47C9-9052-62F785BD437A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TAppMctsExtractor", "vc2015\TAppMCTSExtractor_vc2015.vcxproj", "{9BF48911-8901-425A-9329-C843C6FCBAB8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
......@@ -99,6 +101,14 @@ Global
{68C1251A-55D8-47C9-9052-62F785BD437A}.Release|Win32.Build.0 = Release|Win32
{68C1251A-55D8-47C9-9052-62F785BD437A}.Release|x64.ActiveCfg = Release|x64
{68C1251A-55D8-47C9-9052-62F785BD437A}.Release|x64.Build.0 = Release|x64
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Debug|Win32.ActiveCfg = Debug|Win32
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Debug|Win32.Build.0 = Debug|Win32
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Debug|x64.ActiveCfg = Debug|x64
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Debug|x64.Build.0 = Debug|x64
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Release|Win32.ActiveCfg = Release|Win32
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Release|Win32.Build.0 = Release|Win32
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Release|x64.ActiveCfg = Release|x64
{9BF48911-8901-425A-9329-C843C6FCBAB8}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
......@@ -19,6 +19,7 @@ all:
fi
$(MAKE) -C app/TAppDecoder MM32=$(M32)
$(MAKE) -C app/TAppEncoder MM32=$(M32)
$(MAKE) -C app/TAppMCTSExtractor MM32=$(M32)
$(MAKE) -C utils/annexBbytecount MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser MM32=$(M32)
......@@ -37,6 +38,7 @@ debug:
fi
$(MAKE) -C app/TAppDecoder debug MM32=$(M32)
$(MAKE) -C app/TAppEncoder debug MM32=$(M32)
$(MAKE) -C app/TAppMCTSExtractor debug MM32=$(M32)
$(MAKE) -C utils/annexBbytecount debug MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr debug MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser debug MM32=$(M32)
......@@ -55,6 +57,7 @@ release:
fi
$(MAKE) -C app/TAppDecoder release MM32=$(M32)
$(MAKE) -C app/TAppEncoder release MM32=$(M32)
$(MAKE) -C app/TAppMCTSExtractor release MM32=$(M32)
$(MAKE) -C utils/annexBbytecount release MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr release MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser release MM32=$(M32)
......@@ -73,6 +76,7 @@ clean: clean_highbitdepth
fi
$(MAKE) -C app/TAppDecoder clean MM32=$(M32)
$(MAKE) -C app/TAppEncoder clean MM32=$(M32)
$(MAKE) -C app/TAppMCTSExtractor clean MM32=$(M32)
$(MAKE) -C utils/annexBbytecount clean MM32=$(M32)
$(MAKE) -C utils/convert_NtoMbit_YCbCr clean MM32=$(M32)
$(MAKE) -C lib/TLibDecoderAnalyser clean MM32=$(M32)
......@@ -91,6 +95,7 @@ all_highbitdepth:
fi
$(MAKE) -C app/TAppDecoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppMCTSExtractor MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser MM32=$(M32) HIGHBITDEPTH=1
......@@ -107,6 +112,7 @@ debug_highbitdepth:
fi
$(MAKE) -C app/TAppDecoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppMCTSExtractor debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser debug MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser debug MM32=$(M32) HIGHBITDEPTH=1
......@@ -123,6 +129,7 @@ release_highbitdepth:
fi
$(MAKE) -C app/TAppDecoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppMCTSExtractor release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser release MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser release MM32=$(M32) HIGHBITDEPTH=1
......@@ -139,6 +146,7 @@ clean_highbitdepth:
fi
$(MAKE) -C app/TAppDecoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppEncoder clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppMCTSExtractor clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C lib/TLibDecoderAnalyser clean MM32=$(M32) HIGHBITDEPTH=1
$(MAKE) -C app/TAppDecoderAnalyser clean MM32=$(M32) HIGHBITDEPTH=1
......
......@@ -2220,6 +2220,7 @@ The table below lists the SEI messages defined for Version 1 and Range-Extension
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} \\
\end{SEIListTable}
%%
%% SEI messages
......@@ -3057,6 +3058,17 @@ An array that indicates the elevation range of the i-th recommended viewport reg
\\
\end{OptionTableNoShorthand}
\begin{OptionTableNoShorthand}{Motion-constrained tile sets extraction information sets SEI message encoder parameters}{tab:sei-mcts-extract}
\Option{SEIMctsExtractInfoSet} &
\Default{false} &
When true (non-zero), generates example motion-constrained tile sets extraction information sets SEI message. with the following settings:
\begin{itemize}
\item SliceMode will be set to 0 and SliceArgument will be set to 1 (Enforcing one slice per tile).
\item Extraction Info will be generated applying to each individual MCTS in the bitstream.
\end{itemize}
\\
\end{OptionTableNoShorthand}
%\Option{SEITimeCode} &
%\Default{false} &
%When true, generate time code SEI messages.
......@@ -3295,4 +3307,52 @@ If the decoder is compiled with the macro RExt__DECODER_DEBUG_BIT_STATISTICS def
The Linux makefile will compile both the analyser and standard version when the `all' or `everything' target is used (where the latter will also build high-bit-depth executables).
%%
%%
%%
\clearpage
\section{Using additional tools}
\subsection{MCTS extractor application}
\subsubsection{General}
\begin{verbatim}
TAppMCTSExtractor -i str_in.bin -b str_in.bin [options]
\end{verbatim}
\begin{OptionTableNoShorthand}{MCTS Extractor options}{tab:mcts-extractor-options}
\Option{(--help)} &
%\ShortOption{\None} &
\Default{\None} &
Prints usage information.
\\
\Option{InputBitstreamFile (-i)} &
%\ShortOption{-i} &
\Default{\NotSet} &
Defines the input bitstream file name.
\\
\Option{OutputBitstreamFile (-b)} &
%\ShortOption{-b} &
\Default{\NotSet} &
Defines the output sub-bitstream file name.
\\
\Option{TargetMCTSIdx (-d)} &
%\ShortOption{-d} &
\Default{0} &
Target MCTS index to be extracted from input bitstream to output sub-bitstream.
\\
\end{OptionTableNoShorthand}
\subsubsection{Usage example}
The MCTS extractor application allows extraction of MCTS sub-bitstreams from bitstreams containing the Temporal motion-constrained tile sets SEI message syntax and the Motion-constrained tile sets extraction information sets SEI message. In order to generate such a bitstream with TAppEncoder, the following parameters need to be set.
\begin{verbatim}
--SEITempMotionConstrainedTileSets=1
--SEITMCTSTileConstraint=1
--SEITMCTSExtractionInfo=1
\end{verbatim}
\end{document}
......@@ -922,7 +922,11 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("SaoEncodingRateChroma", m_saoEncodingRateChroma, 0.5, "The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma")
("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)")
("SAOLcuBoundary", m_saoCtuBoundary, false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
("ResetEncoderStateAfterIRAP", m_resetEncoderStateAfterIRAP, false, "When true, resets the encoder's decisions after an IRAP (POC order). Disabled by default.")
#else
("SAOResetEncoderStateAfterIRAP", m_saoResetEncoderStateAfterIRAP, false, "When true, resets the encoder's SAO state after an IRAP (POC order). Disabled by default.")
#endif
("SliceMode", tmpSliceMode, Int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:"
"\t1: max number of CTUs per slice"
......@@ -1104,6 +1108,9 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("SEITempMotionConstrainedTileSets", m_tmctsSEIEnabled, false, "Control generation of temporal motion constrained tile sets SEI message")
#if MCTS_ENC_CHECK
("SEITMCTSTileConstraint", m_tmctsSEITileConstraint, false, "Constrain motion vectors at tile boundaries")
#endif
#if MCTS_EXTRACTION
("SEITMCTSExtractionInfo", m_tmctsExtractionSEIEnabled, false, "Control generation of MCTS extraction info SEI messages")
#endif
("SEITimeCodeEnabled", m_timeCodeSEIEnabled, false, "Control generation of time code information SEI message")
("SEITimeCodeNumClockTs", m_timeCodeSEINumTs, 0, "Number of clock time sets [0..3]")
......@@ -2141,10 +2148,14 @@ Void TAppEncCfg::xCheckParameter()
{
xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures");
}
#if !ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
#if !FIXSAORESETAFTERIRAP
if (m_saoResetEncoderStateAfterIRAP)
{
xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size when SAOResetEncoderStateAfterIRAP is enabled");
}
#endif
#endif
xConfirmPara( m_uiMaxCUDepth < 1, "MaxPartitionDepth must be greater than zero");
xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8");
xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8");
......@@ -2735,6 +2746,15 @@ Void TAppEncCfg::xCheckParameter()
}
#endif
#if MCTS_EXTRACTION
if ((m_tmctsSEIEnabled) && (m_tmctsSEITileConstraint) && (m_tmctsExtractionSEIEnabled) && (m_sliceSegmentMode != 3) && (m_sliceSegmentArgument != 1) )
{
printf("Warning: SEITMCTSExtractionInfo is enabled. Enabling segmentation with one slice per tile.");
m_sliceMode = FIXED_NUMBER_OF_TILES;
m_sliceArgument = 1;
}
#endif
if(m_timeCodeSEIEnabled)
{
xConfirmPara(m_timeCodeSEINumTs > MAX_TIMECODE_SEI_SETS, "Number of time sets cannot exceed 3");
......
......@@ -226,7 +226,11 @@ protected:
Double m_saoEncodingRateChroma; ///< The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma.
Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture
Bool m_saoCtuBoundary; ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
Bool m_resetEncoderStateAfterIRAP; ///< When true, encoder state will be reset following an IRAP.
#else
Bool m_saoResetEncoderStateAfterIRAP; ///< When true, SAO encoder state will be reset following an IRAP.
#endif
// coding tools (loop filter)
Bool m_bLoopFilterDisable; ///< flag for using deblocking filter
Bool m_loopFilterOffsetInPPS; ///< offset for deblocking filter in 0 = slice header, 1 = PPS
......@@ -332,6 +336,9 @@ protected:
Bool m_tmctsSEIEnabled;
#if MCTS_ENC_CHECK
Bool m_tmctsSEITileConstraint;
#endif
#if MCTS_EXTRACTION
Bool m_tmctsExtractionSEIEnabled;
#endif
Bool m_timeCodeSEIEnabled;
Int m_timeCodeSEINumTs;
......
......@@ -277,7 +277,11 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setMaxNumOffsetsPerPic ( m_maxNumOffsetsPerPic);
m_cTEncTop.setSaoCtuBoundary ( m_saoCtuBoundary);
#if ADD_RESET_ENCODER_DECISIONS_AFTER_IRAP
m_cTEncTop.setResetEncoderStateAfterIRAP ( m_resetEncoderStateAfterIRAP );
#else
m_cTEncTop.setSaoResetEncoderStateAfterIRAP ( m_saoResetEncoderStateAfterIRAP);
#endif
m_cTEncTop.setPCMInputBitDepthFlag ( m_bPCMInputBitDepthFlag);
m_cTEncTop.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag);
......@@ -335,6 +339,9 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setTMCTSSEIEnabled ( m_tmctsSEIEnabled );
#if MCTS_ENC_CHECK
m_cTEncTop.setTMCTSSEITileConstraint ( m_tmctsSEITileConstraint );
#endif
#if MCTS_EXTRACTION
m_cTEncTop.setTMCTSExtractionSEIEnabled ( m_tmctsExtractionSEIEnabled);
#endif
m_cTEncTop.setTimeCodeSEIEnabled ( m_timeCodeSEIEnabled );
m_cTEncTop.setNumberOfTimeSets ( m_timeCodeSEINumTs );
......
......@@ -320,6 +320,9 @@ const TChar *SEI::getSEIMessageString(SEI::PayloadType payloadType)
#endif
#if RNSEI
case SEI::REGIONAL_NESTING: return "Regional nesting";
#endif
#if MCTS_EXTRACTION
case SEI::MCTS_EXTRACTION_INFO_SET: return "MCTS extraction information";
#endif
default: return "Unknown";
}
......
......@@ -108,6 +108,9 @@ public:
#endif
#if RNSEI
REGIONAL_NESTING = 157,
#endif
#if MCTS_EXTRACTION
MCTS_EXTRACTION_INFO_SET = 158,
#endif
};
......@@ -1005,6 +1008,31 @@ public:
UShort m_ambientLightX;
UShort m_ambientLightY;
};
#if MCTS_EXTRACTION
class SEIMCTSExtractionInfoSet : public SEI
{
public:
struct MCTSExtractionInfo
{
std::vector< std::vector<UInt> > m_idxOfMctsInSet;
Bool m_sliceReorderingEnabledFlag;
std::vector<UInt> m_outputSliceSegmentAddress;
std::vector<UInt> m_vpsRbspDataLength;
std::vector<UInt> m_spsRbspDataLength;
std::vector<UInt> m_ppsNuhTemporalIdPlus1;
std::vector<UInt> m_ppsRbspDataLength;
std::vector< std::vector<uint8_t> > m_vpsRbspData;
std::vector< std::vector<uint8_t> > m_spsRbspData;
std::vector< std::vector<uint8_t> > m_ppsRbspData;
UInt mctsWidth;
UInt mctsHeight;
};
PayloadType payloadType() const { return MCTS_EXTRACTION_INFO_SET; }
SEIMCTSExtractionInfoSet() { }
virtual ~SEIMCTSExtractionInfoSet() { }
std::vector<MCTSExtractionInfo> m_MCTSExtractionInfoSets;
};
#endif
#endif
#if RNSEI
......
......@@ -107,6 +107,9 @@ private:
#if REDUCED_ENCODER_MEMORY
public:
#if MCTS_EXTRACTION
friend class MctsExtractorTComPicSym;
#endif
struct DPBPerCtuData
{
Bool isInter(const UInt absPartAddr) const { return m_pePredMode[absPartAddr] == MODE_INTER; }
......@@ -193,6 +196,16 @@ protected:
};// END CLASS DEFINITION TComPicSym
#if MCTS_EXTRACTION
// Mcts Extractor helper class
class MctsExtractorTComPicSym {
public:
Void setNumberOfCtusInFrame(TComPicSym *picsym, UInt numOfCtusInFrame) { picsym->m_numCtusInFrame = numOfCtusInFrame; } ///< allows setting numOfCtusInFrame which controls memory allocations of several variables in TComPic, TComPicSym, TComLoopFilter and others. Make sure to have equal values of numOfCtusInFrame at time of creation and destruction of an object lifetime to avoid memory leaks.
};
#endif
//! \}
#if MCTS_ENC_CHECK
......
......@@ -76,6 +76,7 @@
#define PRINT_RPS_INFO 0 ///< Enable/disable the printing of bits used to send the RPS.
#define MCTS_EXTRACTION 1 ///< Additional project for MCTS Extraction as in JCTVC-AC1005
// ====================================================================================================================
// Tool Switches - transitory (these macros are likely to be removed in future revisions)
// ====================================================================================================================
......@@ -101,6 +102,10 @@
#define ERP_SR_OV_SEI_MESSAGE 1 // equirectangular projection, sphere rotation, and omni viewport SEI message
#define RNSEI 1 ///< Support for signalling regional nesting SEI message
#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.
// ====================================================================================================================
// Tool Switches
// ====================================================================================================================
......
......@@ -304,6 +304,12 @@ Void SEIReader::xReadSEIPayloadData(Int const payloadType, Int const payloadSize
sei = new SEITempMotionConstrainedTileSets;
xParseSEITempMotionConstraintsTileSets((SEITempMotionConstrainedTileSets&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#if MCTS_EXTRACTION
case SEI::MCTS_EXTRACTION_INFO_SET:
sei = new SEIMCTSExtractionInfoSet;
xParseSEIMCTSExtractionInfoSet((SEIMCTSExtractionInfoSet&)*sei, payloadSize, pDecodedMessageOutputStream);
break;
#endif
case SEI::CHROMA_RESAMPLING_FILTER_HINT:
sei = new SEIChromaResamplingFilterHint;
xParseSEIChromaResamplingFilterHint((SEIChromaResamplingFilterHint&) *sei, payloadSize, pDecodedMessageOutputStream);
......@@ -1343,6 +1349,99 @@ Void SEIReader::xParseSEITempMotionConstraintsTileSets(SEITempMotionConstrainedT
}
}
#if MCTS_EXTRACTION
Void SEIReader::xParseSEIMCTSExtractionInfoSet(SEIMCTSExtractionInfoSet& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
UInt code;
UInt numInfoSetsMinus1;
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_sets_in_message_minus1"); numInfoSetsMinus1 = code;
for (Int i = 0; i <= numInfoSetsMinus1; i++)
{
SEIMCTSExtractionInfoSet::MCTSExtractionInfo EIS;
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_mcts_sets_minus1[ i ]");
EIS.m_idxOfMctsInSet.resize(code + 1);
for (Int j = 0; j < EIS.m_idxOfMctsInSet.size(); j++)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_mcts_in_set_minus1[ i ][ j ]");
EIS.m_idxOfMctsInSet[j].resize(code + 1);
for (Int k = 0; k < EIS.m_idxOfMctsInSet[j].size(); k++)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "idx_of_mcts_in_set[ i ][ j ][ k ]"); EIS.m_idxOfMctsInSet[j][k] = code;
}
}
sei_read_flag(pDecodedMessageOutputStream, code, "slice_reordering_enabled_flag[ i ]"); EIS.m_sliceReorderingEnabledFlag = (code != 0);
if (EIS.m_sliceReorderingEnabledFlag)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_slice_segments_minus1[ i ]");
EIS.m_outputSliceSegmentAddress.resize(code + 1);
for (Int j = 0; j < EIS.m_outputSliceSegmentAddress.size(); j++)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "output_slice_segment_address[ i ][ j ]"); EIS.m_outputSliceSegmentAddress[j] = code;
}
}
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_vps_in_info_set_minus1[i]");
EIS.m_vpsRbspData.resize(code + 1);
EIS.m_vpsRbspDataLength.resize(code + 1);
for (Int j = 0; j < EIS.m_vpsRbspDataLength.size(); j++)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "vps_rbsp_data_length[i][j]"); EIS.m_vpsRbspDataLength[j] = code;
}
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_sps_in_info_set_minus1[i]");
EIS.m_spsRbspData.resize(code + 1);
EIS.m_spsRbspDataLength.resize(code + 1);
for (Int j = 0; j < EIS.m_spsRbspDataLength.size(); j++)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "sps_rbsp_data_length[i][j]"); EIS.m_spsRbspDataLength[j] = code;
}
sei_read_uvlc(pDecodedMessageOutputStream, code, "num_pps_in_info_set_minus1[i]");
EIS.m_ppsRbspData.resize(code + 1);
EIS.m_ppsNuhTemporalIdPlus1.resize(code + 1);
EIS.m_ppsRbspDataLength.resize(code + 1);
for (Int j = 0; j < EIS.m_ppsRbspDataLength.size(); j++)
{
sei_read_uvlc(pDecodedMessageOutputStream, code, "pps_nuh_temporal_id_plus1[i][j]"); EIS.m_ppsNuhTemporalIdPlus1[j] = code;
sei_read_uvlc(pDecodedMessageOutputStream, code, "sps_rbsp_data_length[i][j]"); EIS.m_ppsRbspDataLength[j] = code;
}
// byte alignment
while (m_pcBitstream->getNumBitsRead() % 8 != 0)
{
sei_read_flag(pDecodedMessageOutputStream, code, "mcts_alignment_bit_equal_to_zero");
}
for (Int j = 0; j < EIS.m_vpsRbspData.size(); j++)
{
EIS.m_vpsRbspData[j].resize(EIS.m_vpsRbspDataLength[j]);
for (Int k = 0; k < EIS.m_vpsRbspDataLength[j]; k++)
{
sei_read_code(pDecodedMessageOutputStream, 8, code, "vps_rbsp_data_byte[ i ][ j ][ k ]"); EIS.m_vpsRbspData[j][k] = code;
}
}
for (Int j = 0; j < EIS.m_spsRbspData.size(); j++)
{
EIS.m_spsRbspData[j].resize(EIS.m_spsRbspDataLength[j]);
for (Int k = 0; k < EIS.m_spsRbspDataLength[j]; k++)
{
sei_read_code(pDecodedMessageOutputStream, 8, code, "sps_rbsp_data_byte[ i ][ j ][ k ]"); EIS.m_spsRbspData[j][k] = code;
}
}
for (Int j = 0; j < EIS.m_ppsRbspData.size(); j++)
{
EIS.m_ppsRbspData[j].resize(EIS.m_ppsRbspDataLength[j]);
for (Int k = 0; k < EIS.m_ppsRbspDataLength[j]; k++)
{
sei_read_code(pDecodedMessageOutputStream, 8, code, "pps_rbsp_data_byte[ i ][ j ][ k ]"); EIS.m_ppsRbspData[j][k] = code;
}
}
sei.m_MCTSExtractionInfoSets.push_back(EIS);
}
}
#endif
Void SEIReader::xParseSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
......
......@@ -89,6 +89,9 @@ protected:
Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#if MCTS_EXTRACTION
Void xParseSEIMCTSExtractionInfoSet (SEIMCTSExtractionInfoSet& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
Void xParseSEIChromaResamplingFilterHint (SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#if CCV_SEI_MESSAGE
......
......@@ -48,23 +48,38 @@
//! \{
#if ENC_DEC_TRACE
Void xTraceVPSHeader ()
#if MCTS_EXTRACTION
Void xTraceVPSHeaderDec ()
#else
Void xTraceVPSHeader()
#endif
{
fprintf( g_hTrace, "=========== Video Parameter Set ===========\n" );
}
Void xTraceSPSHeader ()
#if MCTS_EXTRACTION
Void xTraceSPSHeaderDec()
#else
Void xTraceSPSHeader()
#endif
{
fprintf( g_hTrace, "=========== Sequence Parameter Set ===========\n" );
}
Void xTracePPSHeader ()
#if MCTS_EXTRACTION
Void xTracePPSHeaderDec()
#else
Void xTracePPSHeader()
#endif
{
fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n");
}
Void xTraceSliceHeader ()
#if MCTS_EXTRACTION
Void xTraceSliceHeaderDec()
#else
Void xTraceSliceHeader()
#endif
{
fprintf( g_hTrace, "=========== Slice ===========\n");
}
......@@ -113,6 +128,9 @@ Void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComReferencePictureSet*
{
code = 0;
}
#if MCTS_EXTRACTION
rps->setDeltaRIdxMinus1(code); // when -1, reference picture set explicitly signalled in slice header, otherwise identify the PPS RPS; added for MCTS extraction
#endif
assert(code <= idx-1); // delta_idx_minus1 shall not be larger than idx-1, otherwise we will predict from a negative row position that does not exist. When idx equals 0 there is no legal value and interRPSPred must be zero. See J0185-r2
Int rIdx = idx - 1 - code;
assert (rIdx <= idx-1 && rIdx >= 0); // Made assert tighter; if rIdx = idx then prediction is done from itself. rIdx must belong to range 0, idx-1, inclusive, see J0185-r2
......@@ -121,6 +139,9 @@ Void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComReferencePictureSet*
READ_CODE(1, bit, "delta_rps_sign"); // delta_RPS_sign
READ_UVLC(code, "abs_delta_rps_minus1"); // absolute delta RPS minus 1
Int deltaRPS = (1 - 2 * bit) * (code + 1); // delta_RPS
#if MCTS_EXTRACTION
rps->setDeltaRPS(deltaRPS); // when -1, reference picture set explicitly signalled in slice header, otherwise identify the PPS RPS; added for MCTS extraction
#endif
for(Int j=0 ; j <= rpsRef->getNumberOfPictures(); j++)
{
READ_CODE(1, bit, "used_by_curr_pic_flag" ); //first bit is "1" if Idc is 1
......@@ -187,7 +208,11 @@ Void TDecCavlc::parseShortTermRefPicSet( TComSPS* sps, TComReferencePictureSet*
Void TDecCavlc::parsePPS(TComPPS* pcPPS)
{
#if ENC_DEC_TRACE
xTracePPSHeader ();
#if MCTS_EXTRACTION
xTracePPSHeaderDec ();
#else
xTracePPSHeader();
#endif
#endif
UInt uiCode;
......@@ -590,7 +615,11 @@ Void TDecCavlc::parseHrdParameters(TComHRD *hrd, Bool commonInfPresentFlag, UInt
Void TDecCavlc::parseSPS(TComSPS* pcSPS)
{
#if ENC_DEC_TRACE
#if MCTS_EXTRACTION
xTraceSPSHeaderDec ();
#else
xTraceSPSHeader ();
#endif
#endif
UInt uiCode;
......@@ -862,7 +891,11 @@ Void TDecCavlc::parseSPS(TComSPS* pcSPS)
Void TDecCavlc::parseVPS(TComVPS* pcVPS)
{
#if ENC_DEC_TRACE
xTraceVPSHeader ();
#if MCTS_EXTRACTION
xTraceVPSHeaderDec ();
#else
xTraceVPSHeader();
#endif
#endif
UInt uiCode;
......@@ -960,7 +993,11 @@ Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *param
Int iCode;
#if ENC_DEC_TRACE
#if MCTS_EXTRACTION
xTraceSliceHeaderDec();
#else
xTraceSliceHeader();
#endif
#endif
TComPPS* pps = NULL;
TComSPS* sps = NULL;
......@@ -1081,6 +1118,9 @@ Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *param
if(uiCode == 0) // use short-term reference picture set explicitly signalled in slice header
{
parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
#if MCTS_EXTRACTION
pcSlice->setRPSidx(-1); // when -1, reference picture set explicitly signalled in slice header, otherwise identify the PPS RPS; added for MCTS extraction
#endif
}
else // use reference to short-term reference picture set in PPS
{
......@@ -1092,6 +1132,9 @@ Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *param
if (numBits > 0)
{
READ_CODE( numBits, uiCode, "short_term_ref_pic_set_idx");
#if MCTS_EXTRACTION
pcSlice->setRPSidx(uiCode); // when -1, reference picture set explicitly signalled in slice header, otherwise identify the PPS RPS; added for MCTS extraction
#endif