Commit 400795d3 authored by Karsten Suehring's avatar Karsten Suehring
Browse files

* Add the ability to enable repetition of VPS/SPS/PPS for every IRAP

* Enable parameter set repetition for all CTC configurations
* AI: Switch to CRA pictures (from TRAIL Intra)
parent f8899334
......@@ -20,8 +20,9 @@ QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : 1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CDR, 2:IDR
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 1 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
# Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures
#=========== Motion Search =============
......@@ -77,12 +78,12 @@ PCMInputBitDepthFlag : 1 # 0: PCM bit-depth is int
PCMFilterDisableFlag : 0 # 0: Enable loop filtering on I_PCM samples. 1: Disable loop filtering on I_PCM samples.
#============ Tiles ================
UniformSpacingIdc : 0 # 0: the column boundaries are indicated by ColumnWidth array, the row boundaries are indicated by RowHeight array
TileUniformSpacing : 0 # 0: the column boundaries are indicated by TileColumnWidth array, the row boundaries are indicated by TileRowHeight array
# 1: the column and row boundaries are distributed uniformly
NumTileColumnsMinus1 : 0 # Number of columns in a picture minus 1
ColumnWidthArray : 2 3 # Array containing ColumnWidth values in units of LCU (from left to right in picture)
NumTileRowsMinus1 : 0 # Number of rows in a picture minus 1
RowHeightArray : 2 # Array containing RowHeight values in units of LCU (from top to bottom in picture)
NumTileColumnsMinus1 : 0 # Number of tile columns in a picture minus 1
TileColumnWidthArray : 2 3 # Array containing tile column width values in units of CTU (from left to right in picture)
NumTileRowsMinus1 : 0 # Number of tile rows in a picture minus 1
TileRowHeightArray : 2 # Array containing tile row height values in units of CTU (from top to bottom in picture)
LFCrossTileBoundaryFlag : 1 # In-loop filtering is across or not across tile boundary.
# 0:not across, 1: across
......
......@@ -18,8 +18,9 @@ QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : 1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 1 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
# Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures
#=========== Motion Search =============
......
......@@ -18,8 +18,9 @@ QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : 1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 1 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
# Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures
#=========== Motion Search =============
......
......@@ -19,8 +19,9 @@ QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
IntraPeriod : 1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 1 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
# Type POC QPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures
#=========== Motion Search =============
......
......@@ -20,6 +20,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 4 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -20,6 +20,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 4 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -20,6 +20,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 4 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -20,6 +20,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 4 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -21,6 +21,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : -1 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 0 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 4 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -1
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -20,6 +20,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : 32 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 16 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -3
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -20,6 +20,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : 32 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 16 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -3
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -21,6 +21,7 @@ QuadtreeTUMaxDepthIntra : 3
IntraPeriod : 32 # Period of I-Frame ( -1 = only first)
DecodingRefreshType : 1 # Random Accesss 0:none, 1:CRA, 2:IDR, 3:Recovery Point SEI
GOPSize : 16 # GOP Size (number of B slice = GOPSize-1)
ReWriteParamSetsFlag : 1 # Write parameter sets with every IRAP
IntraQPOffset : -3
LambdaFromQpEnable : 1 # see JCTVC-X0038 for suitable parameters for IntraQPOffset, QPoffset, QPOffsetModelOff, QPOffsetModelScale when enabled
......
......@@ -1011,6 +1011,12 @@ picture.
Specifies the size of the cyclic GOP structure.
\\
\Option{ReWriteParamSetsFlag} &
%\ShortOption{\None} &
\Default{0} &
When enabled, VPS, SPS and PPS are repeated in front of every IRAP picture.
\\
\Option{Frame\emph{N}} &
%\ShortOption{\None} &
\Default{\NotSet} &
......
......@@ -751,6 +751,9 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)")
("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)")
("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure")
#if JCTVC_Y0038_PARAMS
("ReWriteParamSetsFlag", m_bReWriteParamSetsFlag, true, "Enable rewriting of Parameter sets before every (intra) random access point")
#endif
// motion search options
("DisableIntraInInter", m_bDisableIntraPUsInInterSlices, false, "Flag to disable intra PUs in inter slices")
......
......@@ -116,6 +116,9 @@ protected:
Int m_iIntraPeriod; ///< period of I-slice (random access period)
Int m_iDecodingRefreshType; ///< random access type
Int m_iGOPSize; ///< GOP size of hierarchical structure
#if JCTVC_Y0038_PARAMS
Bool m_bReWriteParamSetsFlag; ///< Flag to enable rewriting of parameter sets at random access points
#endif
Int m_extraRPSs; ///< extra RPSs added to handle CRA
GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file
Int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures
......
......@@ -112,6 +112,9 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setIntraPeriod ( m_iIntraPeriod );
m_cTEncTop.setDecodingRefreshType ( m_iDecodingRefreshType );
m_cTEncTop.setGOPSize ( m_iGOPSize );
#if JCTVC_Y0038_PARAMS
m_cTEncTop.setReWriteParamSetsFlag ( m_bReWriteParamSetsFlag );
#endif
m_cTEncTop.setGopList ( m_GOPList );
m_cTEncTop.setExtraRPSs ( m_extraRPSs );
for(Int i = 0; i < MAX_TLAYER; i++)
......
......@@ -82,6 +82,7 @@
#define DECODER_CHECK_SUBSTREAM_AND_SLICE_TRAILING_BYTES 1 ///< TODO: integrate this macro into a broader conformance checking system.
#define X0038_LAMBDA_FROM_QP_CAPABILITY 1 ///< This approach derives lambda from QP+QPoffset+QPoffset2. QPoffset2 is derived from QP+QPoffset using a linear model that is clipped between 0 and 3.
// To use this capability enable config parameter LambdaFromQpEnable
#define JCTVC_Y0038_PARAMS 1
// ====================================================================================================================
// Tool Switches
......
......@@ -145,6 +145,9 @@ protected:
//====== Coding Structure ========
UInt m_uiIntraPeriod; // TODO: make this an Int - it can be -1!
UInt m_uiDecodingRefreshType; ///< the type of decoding refresh employed for the random access.
#if JCTVC_Y0038_PARAMS
Bool m_bReWriteParamSetsFlag;
#endif
Int m_iGOPSize;
GOPEntry m_GOPList[MAX_GOP];
Int m_extraRPSs;
......@@ -458,6 +461,9 @@ public:
//====== Coding Structure ========
Void setIntraPeriod ( Int i ) { m_uiIntraPeriod = (UInt)i; }
Void setDecodingRefreshType ( Int i ) { m_uiDecodingRefreshType = (UInt)i; }
#if JCTVC_Y0038_PARAMS
Void setReWriteParamSetsFlag ( Bool b ) { m_bReWriteParamSetsFlag = b; }
#endif
Void setGOPSize ( Int i ) { m_iGOPSize = i; }
Void setGopList ( const GOPEntry GOPList[MAX_GOP] ) { for ( Int i = 0; i < MAX_GOP; i++ ) m_GOPList[i] = GOPList[i]; }
Void setExtraRPSs ( Int i ) { m_extraRPSs = i; }
......@@ -562,6 +568,9 @@ public:
//==== Coding Structure ========
UInt getIntraPeriod () { return m_uiIntraPeriod; }
UInt getDecodingRefreshType () { return m_uiDecodingRefreshType; }
#if JCTVC_Y0038_PARAMS
Bool getReWriteParamSetsFlag () { return m_bReWriteParamSetsFlag; }
#endif
Int getGOPSize () { return m_iGOPSize; }
Int getMaxDecPicBuffering (UInt tlayer) { return m_maxDecPicBuffering[tlayer]; }
Int getNumReorderPics (UInt tlayer) { return m_numReorderPics[tlayer]; }
......
......@@ -1620,11 +1620,22 @@ Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rc
m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder );
// write various parameter sets
#if JCTVC_Y0038_PARAMS
//bool writePS = m_bSeqFirst || (m_pcCfg->getReWriteParamSetsFlag() && (pcPic->getSlice(0)->getSliceType() == I_SLICE));
bool writePS = m_bSeqFirst || (m_pcCfg->getReWriteParamSetsFlag() && (pcSlice->isIRAP()));
if (writePS)
{
m_pcEncTop->setParamSetChanged(pcSlice->getSPS()->getSPSId(), pcSlice->getPPS()->getPPSId());
}
actualTotalBits += xWriteParameterSets(accessUnit, pcSlice, writePS);
if (writePS)
#else
actualTotalBits += xWriteParameterSets(accessUnit, pcSlice, m_bSeqFirst);
if ( m_bSeqFirst )
#endif
{
// create prefix SEI messages at the beginning of the sequence
assert(leadingSeiMessages.empty());
xCreateIRAPLeadingSEIMessages(leadingSeiMessages, pcSlice->getSPS(), pcSlice->getPPS());
......
......@@ -1367,6 +1367,14 @@ Void TEncCfg::xCheckGSParameters()
}
}
#if JCTVC_Y0038_PARAMS
Void TEncTop::setParamSetChanged(Int spsId, Int ppsId)
{
m_ppsMap.setChangedFlag(ppsId);
m_spsMap.setChangedFlag(spsId);
}
#endif
Bool TEncTop::PPSNeedsWriting(Int ppsId)
{
Bool bChanged=m_ppsMap.getChangedFlag(ppsId);
......
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