Commit 98b5bced authored by Karsten Suehring's avatar Karsten Suehring
Browse files

Region Wise Packing SEI


Patch-By: Alireza Zare's avatarAlireza Zare <alireza.zare@nokia.com>
parent 872645ad
#======== File I/O =====================
BitstreamFile : str.bin
ReconFile : rec.yuv
#======== Profile ================
Profile : main
#======== Unit definition ================
MaxCUWidth : 64 # Maximum coding unit width in pixel
MaxCUHeight : 64 # Maximum coding unit height in pixel
MaxPartitionDepth : 4 # Maximum coding unit depth
QuadtreeTULog2MaxSize : 5 # Log2 of maximum transform size for
# quadtree-based TU coding (2...6)
QuadtreeTULog2MinSize : 2 # Log2 of minimum transform size for
# quadtree-based TU coding (2...6)
QuadtreeTUMaxDepthInter : 3
QuadtreeTUMaxDepthIntra : 3
#======== Coding Structure =============
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
# Type POC QPoffset QPOffsetModelOff QPOffsetModelScale CbQPoffset CrQPoffset QPfactor tcOffsetDiv2 betaOffsetDiv2 temporal_id #ref_pics_active #ref_pics reference pictures predict deltaRPS #ref_idcs reference idcs
Frame1: B 16 1 0.0 0.0 0 0 1.0 0 0 0 2 3 -16 -24 -32 0
Frame2: B 8 1 -4.8848 0.2061 0 0 1.0 0 0 1 2 3 -8 -16 8 1 8 4 1 1 0 1
Frame3: B 4 4 -5.7476 0.2286 0 0 1.0 0 0 2 2 4 -4 -12 4 12 1 4 4 1 1 1 1
Frame4: B 2 5 -5.90 0.2333 0 0 1.0 0 0 3 2 5 -2 -10 2 6 14 1 2 5 1 1 1 1 1
Frame5: B 1 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 1 3 7 15 1 1 6 1 0 1 1 1 1
Frame6: B 3 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -3 1 5 13 1 -2 6 1 1 1 1 1 0
Frame7: B 6 5 -5.90 0.2333 0 0 1.0 0 0 3 2 4 -2 -6 2 10 1 -3 6 0 1 1 1 1 0
Frame8: B 5 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -5 1 3 11 1 1 5 1 1 1 1 1
Frame9: B 7 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -3 -7 1 9 1 -2 6 1 1 1 1 1 0
Frame10: B 12 4 -5.7476 0.2286 0 0 1.0 0 0 2 2 3 -4 -12 4 1 -5 6 0 0 1 1 1 0
Frame11: B 10 5 -5.90 0.2333 0 0 1.0 0 0 3 2 4 -2 -10 2 6 1 2 4 1 1 1 1
Frame12: B 9 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -9 1 3 7 1 1 5 1 1 1 1 1
Frame13: B 11 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -3 -11 1 5 1 -2 6 1 1 1 1 1 0
Frame14: B 14 5 -5.90 0.2333 0 0 1.0 0 0 3 2 4 -2 -6 -14 2 1 -3 6 0 1 1 1 1 0
Frame15: B 13 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -5 -13 1 3 1 1 5 1 1 1 1 1
Frame16: B 15 6 -7.1444 0.3 0 0 1.0 0 0 4 2 5 -1 -3 -7 -15 1 1 -2 6 1 1 1 1 1 0
#=========== Motion Search =============
FastSearch : 1 # 0:Full search 1:TZ search
SearchRange : 384 # (0: Search range is a Full frame)
ASR : 1 # Adaptive motion search range
MinSearchWindow : 96 # Minimum motion search window size for the adaptive window ME
BipredSearchRange : 4 # Search range for bi-prediction refinement
HadamardME : 1 # Use of hadamard measure for fractional ME
FEN : 1 # Fast encoder decision
FDM : 1 # Fast Decision for Merge RD cost
#======== Quantization =============
QP : 32 # Quantization parameter(0-51)
MaxDeltaQP : 0 # CU-based multi-QP optimization
MaxCuDQPDepth : 0 # Max depth of a minimum CuDQP for sub-LCU-level delta QP
DeltaQpRD : 0 # Slice-based multi-QP optimization
RDOQ : 1 # RDOQ
RDOQTS : 1 # RDOQ for transform skip
SliceChromaQPOffsetPeriodicity: 0 # Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.
SliceCbQpOffsetIntraOrPeriodic: 0 # Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.
SliceCrQpOffsetIntraOrPeriodic: 0 # Chroma Cr QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.
#=========== Deblock Filter ============
LoopFilterOffsetInPPS : 1 # Dbl params: 0=varying params in SliceHeader, param = base_param + GOP_offset_param; 1 (default) =constant params in PPS, param = base_param)
LoopFilterDisable : 0 # Disable deblocking filter (0=Filter, 1=No Filter)
LoopFilterBetaOffset_div2 : 0 # base_param: -6 ~ 6
LoopFilterTcOffset_div2 : 0 # base_param: -6 ~ 6
DeblockingFilterMetric : 0 # blockiness metric (automatically configures deblocking parameters in bitstream). Applies slice-level loop filter offsets (LoopFilterOffsetInPPS and LoopFilterDisable must be 0)
#=========== Misc. ============
InternalBitDepth : 8 # codec operating bit-depth
#=========== Coding Tools =================
SAO : 1 # Sample adaptive offset (0: OFF, 1: ON)
AMP : 1 # Asymmetric motion partitions (0: OFF, 1: ON)
TransformSkip : 1 # Transform skipping (0: OFF, 1: ON)
TransformSkipFast : 1 # Fast Transform skipping (0: OFF, 1: ON)
SAOLcuBoundary : 0 # SAOLcuBoundary using non-deblocked pixels (0: OFF, 1: ON)
#============ Slices ================
SliceMode : 0 # 0: Disable all slice options.
# 1: Enforce maximum number of LCU in an slice,
# 2: Enforce maximum number of bytes in an 'slice'
# 3: Enforce maximum number of tiles in a slice
SliceArgument : 1500 # Argument for 'SliceMode'.
# If SliceMode==1 it represents max. SliceGranularity-sized blocks per slice.
# If SliceMode==2 it represents max. bytes per slice.
# If SliceMode==3 it represents max. tiles per slice.
LFCrossSliceBoundaryFlag : 1 # In-loop filtering, including ALF and DB, is across or not across slice boundary.
# 0:not across, 1: across
#============ PCM ================
PCMEnabledFlag : 0 # 0: No PCM mode
PCMLog2MaxSize : 5 # Log2 of maximum PCM block size.
PCMLog2MinSize : 3 # Log2 of minimum PCM block size.
PCMInputBitDepthFlag : 1 # 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
PCMFilterDisableFlag : 0 # 0: Enable loop filtering on I_PCM samples. 1: Disable loop filtering on I_PCM samples.
#============ Tiles ================
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 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
#============ WaveFront ================
WaveFrontSynchro : 0 # 0: No WaveFront synchronisation (WaveFrontSubstreams must be 1 in this case).
# >0: WaveFront synchronises with the LCU above and to the right by this many LCUs.
#=========== Quantization Matrix =================
ScalingList : 0 # ScalingList 0 : off, 1 : default, 2 : file read
ScalingListFile : scaling_list.txt # Scaling List file name. If file is not exist, use Default Matrix.
#============ Lossless ================
TransquantBypassEnableFlag : 0 # Value of PPS flag.
CUTransquantBypassFlagForce: 0 # Force transquant bypass mode, when transquant_bypass_enable_flag is enabled
#============ Rate Control ======================
RateControl : 0 # Rate control: enable rate control
TargetBitrate : 1000000 # Rate control: target bitrate, in bps
KeepHierarchicalBit : 2 # Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
LCULevelRateControl : 1 # Rate control: 1: LCU level RC; 0: picture level RC
RCLCUSeparateModel : 1 # Rate control: use LCU level separate R-lambda model
InitialQP : 0 # Rate control: initial QP
RCForceIntraQP : 0 # Rate control: force intra QP to be equal to initial QP
#======== Region-wise packing SEI message =====================
SEIRwpEnabled : 1
SEIRwpCancelFlag : 0
SEIRwpPersistenceFlag : 1
SEIRwpConstituentPictureMatchingFlag : 1
SEIRwpNumPackedRegions : 6
SEIRwpProjPictureWidth : 2048
SEIRwpProjPictureHeight : 1024
SEIRwpPackedPictureWidth : 1536
SEIRwpPackedPictureHeight : 768
SEIRwpTransformType : 0 1 2 3 4 5
SEIRwpGuardBandFlag : 1 1 1 1 1 1
SEIRwpProjRegionWidth : 512 512 512 512 512 512
SEIRwpProjRegionHeight : 128 128 128 128 128 128
SEIRwpProjRegionTop : 256 256 256 256 256 256
SEIRwpProjRegionLeft : 0 256 512 768 1024 1280
SEIRwpPackedRegionWidth : 512 512 512 384 384 384
SEIRwpPackedRegionHeight : 128 128 128 192 192 192
SEIRwpPackedRegionTop : 64 64 64 64 64 64
SEIRwpPackedRegionLeft : 32 32 32 32 32 32
SEIRwpLeftGuardBandWidth : 64 64 64 64 64 64
SEIRwpRightGuardBandWidth : 128 128 128 128 128 128
SEIRwpTopGuardBandHeight : 192 192 192 192 192 192
SEIRwpBottomGuardBandHeight : 255 255 255 255 255 255
SEIRwpGuardBandNotUsedForPredFlag : 1 1 1 1 1 1
SEIRwpGuardBandType : 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 0 0 0 0 1 1 1 1
### DO NOT ADD ANYTHING BELOW THIS LINE ###
### DO NOT DELETE THE EMPTY LINE BELOW ###
\ No newline at end of file
......@@ -699,8 +699,25 @@ 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 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());
SMultiValueInput<UInt> cfg_rwpSEIProjRegionWidth (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIProjRegionHeight (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIRwpSEIProjRegionTop (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIProjRegionLeft (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIPackedRegionWidth (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIPackedRegionHeight (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIPackedRegionTop (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIPackedRegionLeft (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIRwpLeftGuardBandWidth (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIRwpRightGuardBandWidth (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIRwpTopGuardBandHeight (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIRwpBottomGuardBandHeight (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
SMultiValueInput<Bool> cfg_rwpSEIRwpGuardBandNotUsedForPredFlag (0, 1, 0, std::numeric_limits<UChar>::max());
SMultiValueInput<UInt> cfg_rwpSEIRwpGuardBandType (0, 7, 0, 4*std::numeric_limits<UChar>::max());
#endif
Int warnUnknowParameter = 0;
po::Options opts;
opts.addOptions()
("help", do_help, false, "this help text")
......@@ -1114,6 +1131,33 @@ 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 RWP_SEI_MESSAGE
("SEIRwpEnabled", m_rwpSEIEnabled, false, "Controls if region-wise packing SEI message enabled")
("SEIRwpCancelFlag", m_rwpSEIRwpCancelFlag, true, "Specifies the persistence of any previous region-wise packing SEI message in output order.")
("SEIRwpPersistenceFlag", m_rwpSEIRwpPersistenceFlag, false, "Specifies the persistence of the region-wise packing SEI message for the current layer.")
("SEIRwpConstituentPictureMatchingFlag", m_rwpSEIConstituentPictureMatchingFlag, false, "Specifies the information in the SEI message apply individually to each constituent picture or to the projected picture.")
("SEIRwpNumPackedRegions", m_rwpSEINumPackedRegions, 0, "specifies the number of packed regions when constituent picture matching flag is equal to 0.")
("SEIRwpProjPictureWidth", m_rwpSEIProjPictureWidth, 0, "Specifies the width of the projected picture.")
("SEIRwpProjPictureHeight", m_rwpSEIProjPictureHeight, 0, "Specifies the height of the projected picture.")
("SEIRwpPackedPictureWidth", m_rwpSEIPackedPictureWidth, 0, "specifies the width of the packed picture.")
("SEIRwpPackedPictureHeight", m_rwpSEIPackedPictureHeight, 0, "Specifies the height of the packed picture.")
("SEIRwpTransformType", cfg_rwpSEIRwpTransformType, cfg_rwpSEIRwpTransformType, "specifies the rotation and mirroring to be applied to the i-th packed region.")
("SEIRwpGuardBandFlag", cfg_rwpSEIRwpGuardBandFlag, cfg_rwpSEIRwpGuardBandFlag, "specifies the existence of guard band in the i-th packed region.")
("SEIRwpProjRegionWidth", cfg_rwpSEIProjRegionWidth, cfg_rwpSEIProjRegionWidth, "specifies the width of the i-th projected region.")
("SEIRwpProjRegionHeight", cfg_rwpSEIProjRegionHeight, cfg_rwpSEIProjRegionHeight, "specifies the height of the i-th projected region.")
("SEIRwpProjRegionTop", cfg_rwpSEIRwpSEIProjRegionTop, cfg_rwpSEIRwpSEIProjRegionTop, "specifies the top sample row of the i-th projected region.")
("SEIRwpProjRegionLeft", cfg_rwpSEIProjRegionLeft, cfg_rwpSEIProjRegionLeft, "specifies the left-most sample column of the i-th projected region.")
("SEIRwpPackedRegionWidth", cfg_rwpSEIPackedRegionWidth, cfg_rwpSEIPackedRegionWidth, "specifies the width of the i-th packed region.")
("SEIRwpPackedRegionHeight", cfg_rwpSEIPackedRegionHeight, cfg_rwpSEIPackedRegionHeight, "specifies the height of the i-th packed region.")
("SEIRwpPackedRegionTop", cfg_rwpSEIPackedRegionTop, cfg_rwpSEIPackedRegionTop, "specifies the top luma sample row of the i-th packed region.")
("SEIRwpPackedRegionLeft", cfg_rwpSEIPackedRegionLeft, cfg_rwpSEIPackedRegionLeft, "specifies the left-most luma sample column of the i-th packed region.")
("SEIRwpLeftGuardBandWidth", cfg_rwpSEIRwpLeftGuardBandWidth, cfg_rwpSEIRwpLeftGuardBandWidth, "specifies the width of the guard band on the left side of the i-th packed region.")
("SEIRwpRightGuardBandWidth", cfg_rwpSEIRwpRightGuardBandWidth, cfg_rwpSEIRwpRightGuardBandWidth, "specifies the width of the guard band on the right side of the i-th packed region.")
("SEIRwpTopGuardBandHeight", cfg_rwpSEIRwpTopGuardBandHeight, cfg_rwpSEIRwpTopGuardBandHeight, "specifies the height of the guard band above the i-th packed region.")
("SEIRwpBottomGuardBandHeight", cfg_rwpSEIRwpBottomGuardBandHeight, cfg_rwpSEIRwpBottomGuardBandHeight, "specifies the height of the guard band below the i-th packed region.")
("SEIRwpGuardBandNotUsedForPredFlag", cfg_rwpSEIRwpGuardBandNotUsedForPredFlag, cfg_rwpSEIRwpGuardBandNotUsedForPredFlag, "Specifies if the guard bands is used in the inter prediction process.")
("SEIRwpGuardBandType", cfg_rwpSEIRwpGuardBandType, cfg_rwpSEIRwpGuardBandType, "Specifies the type of the guard bands for the i-th packed region.")
#endif
;
#if EXTENSION_360_VIDEO
......@@ -1686,6 +1730,60 @@ Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
}
}
#if RWP_SEI_MESSAGE
if(!m_rwpSEIRwpCancelFlag && m_rwpSEIEnabled)
{
assert ( m_rwpSEINumPackedRegions > 0 && m_rwpSEINumPackedRegions <= std::numeric_limits<UChar>::max() );
assert (cfg_rwpSEIRwpTransformType.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIRwpGuardBandFlag.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIProjRegionWidth.values.size() == m_rwpSEINumPackedRegions &&
cfg_rwpSEIProjRegionHeight.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIRwpSEIProjRegionTop.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIProjRegionLeft.values.size() == m_rwpSEINumPackedRegions &&
cfg_rwpSEIPackedRegionWidth.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIPackedRegionHeight.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIPackedRegionTop.values.size() == m_rwpSEINumPackedRegions &&
cfg_rwpSEIPackedRegionLeft.values.size() == m_rwpSEINumPackedRegions);
m_rwpSEIRwpTransformType.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpGuardBandFlag.resize(m_rwpSEINumPackedRegions);
m_rwpSEIProjRegionWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIProjRegionHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpSEIProjRegionTop.resize(m_rwpSEINumPackedRegions);
m_rwpSEIProjRegionLeft.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionTop.resize(m_rwpSEINumPackedRegions);
m_rwpSEIPackedRegionLeft.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpLeftGuardBandWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpRightGuardBandWidth.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpTopGuardBandHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpBottomGuardBandHeight.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpGuardBandNotUsedForPredFlag.resize(m_rwpSEINumPackedRegions);
m_rwpSEIRwpGuardBandType.resize(4*m_rwpSEINumPackedRegions);
for( Int i=0; i < m_rwpSEINumPackedRegions; i++ )
{
m_rwpSEIRwpTransformType[i] = cfg_rwpSEIRwpTransformType.values[i];
assert ( m_rwpSEIRwpTransformType[i] >= 0 && m_rwpSEIRwpTransformType[i] <= 7 );
m_rwpSEIRwpGuardBandFlag[i] = cfg_rwpSEIRwpGuardBandFlag.values[i];
m_rwpSEIProjRegionWidth[i] = cfg_rwpSEIProjRegionWidth.values[i];
m_rwpSEIProjRegionHeight[i] = cfg_rwpSEIProjRegionHeight.values[i];
m_rwpSEIRwpSEIProjRegionTop[i] = cfg_rwpSEIRwpSEIProjRegionTop.values[i];
m_rwpSEIProjRegionLeft[i] = cfg_rwpSEIProjRegionLeft.values[i];
m_rwpSEIPackedRegionWidth[i] = cfg_rwpSEIPackedRegionWidth.values[i];
m_rwpSEIPackedRegionHeight[i] = cfg_rwpSEIPackedRegionHeight.values[i];
m_rwpSEIPackedRegionTop[i] = cfg_rwpSEIPackedRegionTop.values[i];
m_rwpSEIPackedRegionLeft[i] = cfg_rwpSEIPackedRegionLeft.values[i];
if( m_rwpSEIRwpGuardBandFlag[i] )
{
m_rwpSEIRwpLeftGuardBandWidth[i] = cfg_rwpSEIRwpLeftGuardBandWidth.values[i];
m_rwpSEIRwpRightGuardBandWidth[i] = cfg_rwpSEIRwpRightGuardBandWidth.values[i];
m_rwpSEIRwpTopGuardBandHeight[i] = cfg_rwpSEIRwpTopGuardBandHeight.values[i];
m_rwpSEIRwpBottomGuardBandHeight[i] = cfg_rwpSEIRwpBottomGuardBandHeight.values[i];
assert ( m_rwpSEIRwpLeftGuardBandWidth[i] > 0 || m_rwpSEIRwpRightGuardBandWidth[i] > 0 || m_rwpSEIRwpTopGuardBandHeight[i] >0 || m_rwpSEIRwpBottomGuardBandHeight[i] >0 );
m_rwpSEIRwpGuardBandNotUsedForPredFlag[i] = cfg_rwpSEIRwpGuardBandNotUsedForPredFlag.values[i];
for( Int j=0; j < 4; j++ )
{
m_rwpSEIRwpGuardBandType[i*4 + j] = cfg_rwpSEIRwpGuardBandType.values[i*4 + j];
}
}
}
}
#endif
if(m_timeCodeSEIEnabled)
{
for(Int i = 0; i < m_timeCodeSEINumTs && i < MAX_TIMECODE_SEI_SETS; i++)
......
......@@ -350,7 +350,33 @@ protected:
Int m_preferredTransferCharacteristics;
UInt m_greenMetadataType;
UInt m_xsdMetricType;
#if RWP_SEI_MESSAGE
Bool m_rwpSEIEnabled;
Bool m_rwpSEIRwpCancelFlag;
Bool m_rwpSEIRwpPersistenceFlag;
Bool m_rwpSEIConstituentPictureMatchingFlag;
Int m_rwpSEINumPackedRegions;
Int m_rwpSEIProjPictureWidth;
Int m_rwpSEIProjPictureHeight;
Int m_rwpSEIPackedPictureWidth;
Int m_rwpSEIPackedPictureHeight;
std::vector<UChar> m_rwpSEIRwpTransformType;
std::vector<Bool> m_rwpSEIRwpGuardBandFlag;
std::vector<UInt> m_rwpSEIProjRegionWidth;
std::vector<UInt> m_rwpSEIProjRegionHeight;
std::vector<UInt> m_rwpSEIRwpSEIProjRegionTop;
std::vector<UInt> m_rwpSEIProjRegionLeft;
std::vector<UShort> m_rwpSEIPackedRegionWidth;
std::vector<UShort> m_rwpSEIPackedRegionHeight;
std::vector<UShort> m_rwpSEIPackedRegionTop;
std::vector<UShort> m_rwpSEIPackedRegionLeft;
std::vector<UChar> m_rwpSEIRwpLeftGuardBandWidth;
std::vector<UChar> m_rwpSEIRwpRightGuardBandWidth;
std::vector<UChar> m_rwpSEIRwpTopGuardBandHeight;
std::vector<UChar> m_rwpSEIRwpBottomGuardBandHeight;
std::vector<Bool> m_rwpSEIRwpGuardBandNotUsedForPredFlag;
std::vector<UChar> m_rwpSEIRwpGuardBandType;
#endif
// weighted prediction
Bool m_useWeightedPred; ///< Use of weighted prediction in P slices
Bool m_useWeightedBiPred; ///< Use of bi-directional weighted prediction in B slices
......
......@@ -353,6 +353,33 @@ Void TAppEncTop::xInitLibCfg()
m_cTEncTop.setKneeSEINumKneePointsMinus1 ( m_kneeSEINumKneePointsMinus1 );
m_cTEncTop.setKneeSEIInputKneePoint ( m_kneeSEIInputKneePoint );
m_cTEncTop.setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint );
#if RWP_SEI_MESSAGE
m_cTEncTop.setRwpSEIEnabled (m_rwpSEIEnabled);
m_cTEncTop.setRwpSEIRwpCancelFlag (m_rwpSEIRwpCancelFlag);
m_cTEncTop.setRwpSEIRwpPersistenceFlag (m_rwpSEIRwpPersistenceFlag);
m_cTEncTop.setRwpSEIConstituentPictureMatchingFlag (m_rwpSEIConstituentPictureMatchingFlag);
m_cTEncTop.setRwpSEINumPackedRegions (m_rwpSEINumPackedRegions);
m_cTEncTop.setRwpSEIProjPictureWidth (m_rwpSEIProjPictureWidth);
m_cTEncTop.setRwpSEIProjPictureHeight (m_rwpSEIProjPictureHeight);
m_cTEncTop.setRwpSEIPackedPictureWidth (m_rwpSEIPackedPictureWidth);
m_cTEncTop.setRwpSEIPackedPictureHeight (m_rwpSEIPackedPictureHeight);
m_cTEncTop.setRwpSEIRwpTransformType (m_rwpSEIRwpTransformType);
m_cTEncTop.setRwpSEIRwpGuardBandFlag (m_rwpSEIRwpGuardBandFlag);
m_cTEncTop.setRwpSEIProjRegionWidth (m_rwpSEIProjRegionWidth);
m_cTEncTop.setRwpSEIProjRegionHeight (m_rwpSEIProjRegionHeight);
m_cTEncTop.setRwpSEIRwpSEIProjRegionTop (m_rwpSEIRwpSEIProjRegionTop);
m_cTEncTop.setRwpSEIProjRegionLeft (m_rwpSEIProjRegionLeft);
m_cTEncTop.setRwpSEIPackedRegionWidth (m_rwpSEIPackedRegionWidth);
m_cTEncTop.setRwpSEIPackedRegionHeight (m_rwpSEIPackedRegionHeight);
m_cTEncTop.setRwpSEIPackedRegionTop (m_rwpSEIPackedRegionTop);
m_cTEncTop.setRwpSEIPackedRegionLeft (m_rwpSEIPackedRegionLeft);
m_cTEncTop.setRwpSEIRwpLeftGuardBandWidth (m_rwpSEIRwpLeftGuardBandWidth);
m_cTEncTop.setRwpSEIRwpRightGuardBandWidth (m_rwpSEIRwpRightGuardBandWidth);
m_cTEncTop.setRwpSEIRwpTopGuardBandHeight (m_rwpSEIRwpTopGuardBandHeight);
m_cTEncTop.setRwpSEIRwpBottomGuardBandHeight (m_rwpSEIRwpBottomGuardBandHeight);
m_cTEncTop.setRwpSEIRwpGuardBandNotUsedForPredFlag (m_rwpSEIRwpGuardBandNotUsedForPredFlag);
m_cTEncTop.setRwpSEIRwpGuardBandType (m_rwpSEIRwpGuardBandType);
#endif
m_cTEncTop.setColourRemapInfoSEIFileRoot ( m_colourRemapSEIFileRoot );
m_cTEncTop.setMasteringDisplaySEI ( m_masteringDisplay );
m_cTEncTop.setSEIAlternativeTransferCharacteristicsSEIEnable ( m_preferredTransferCharacteristics>=0 );
......
......@@ -156,6 +156,9 @@ 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 RWP_SEI_MESSAGE
case SEI::REGION_WISE_PACKING: return "Region wise packing information";
#endif
default: return "Unknown";
}
}
......@@ -92,6 +92,9 @@ 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 RWP_SEI_MESSAGE
REGION_WISE_PACKING = 155,
#endif
};
SEI() {}
......@@ -743,6 +746,39 @@ public:
std::vector<Int> m_kneeOutputKneePoint;
};
#if RWP_SEI_MESSAGE
class SEIRegionWisePacking : public SEI
{
public:
PayloadType payloadType() const { return REGION_WISE_PACKING; }
SEIRegionWisePacking() {}
virtual ~SEIRegionWisePacking() {}
Bool m_rwpCancelFlag;
Bool m_rwpPersistenceFlag;
Bool m_constituentPictureMatchingFlag;
Int m_numPackedRegions;
Int m_projPictureWidth;
Int m_projPictureHeight;
Int m_packedPictureWidth;
Int m_packedPictureHeight;
std::vector<UChar> m_rwpTransformType;
std::vector<Bool> m_rwpGuardBandFlag;
std::vector<UInt> m_projRegionWidth;
std::vector<UInt> m_projRegionHeight;
std::vector<UInt> m_rwpProjRegionTop;
std::vector<UInt> m_projRegionLeft;
std::vector<UShort> m_packedRegionWidth;
std::vector<UShort> m_packedRegionHeight;
std::vector<UShort> m_packedRegionTop;
std::vector<UShort> m_packedRegionLeft;
std::vector<UChar> m_rwpLeftGuardBandWidth;
std::vector<UChar> m_rwpRightGuardBandWidth;
std::vector<UChar> m_rwpTopGuardBandHeight;
std::vector<UChar> m_rwpBottomGuardBandHeight;
std::vector<Bool> m_rwpGuardBandNotUsedForPredFlag;
std::vector<UChar> m_rwpGuardBandType;
};
#endif
class SEIColourRemappingInfo : public SEI
{
......
......@@ -94,7 +94,7 @@
#endif
#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
// ====================================================================================================================
// Tool Switches
// ====================================================================================================================
......
......@@ -350,6 +350,12 @@ Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType
sei = new SEIAmbientViewingEnvironment;
xParseSEIAmbientViewingEnvironment((SEIAmbientViewingEnvironment&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#if RWP_SEI_MESSAGE
case SEI::REGION_WISE_PACKING:
sei = new SEIRegionWisePacking;
xParseSEIRegionWisePacking((SEIRegionWisePacking&) *sei, payloadSize, pDecodedMessageOutputStream);
break;
#endif
default:
for (UInt i = 0; i < payloadSize; i++)
{
......@@ -1383,6 +1389,71 @@ Void SEIReader::xParseSEIKneeFunctionInfo(SEIKneeFunctionInfo& sei, UInt payload
}
}
#if RWP_SEI_MESSAGE
Void SEIReader::xParseSEIRegionWisePacking(SEIRegionWisePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
UInt val;
sei_read_flag( pDecodedMessageOutputStream, val, "rwp_cancel_flag" ); sei.m_rwpCancelFlag = val;
if (!sei.m_rwpCancelFlag)
{
sei_read_flag( pDecodedMessageOutputStream, val, "rwp_persistence_flag" ); sei.m_rwpPersistenceFlag = val;
sei_read_flag( pDecodedMessageOutputStream, val, "constituent_picture_matching_flag" ); sei.m_constituentPictureMatchingFlag = val;
sei_read_code( pDecodedMessageOutputStream, 5, val, "rwp_reserved_zero_5bits" );
sei_read_code( pDecodedMessageOutputStream, 8, val, "num_packed_regions" ); sei.m_numPackedRegions = val;
sei_read_code( pDecodedMessageOutputStream, 32, val, "proj_picture_width" ); sei.m_projPictureWidth = val;
sei_read_code( pDecodedMessageOutputStream, 32, val, "proj_picture_height" ); sei.m_projPictureHeight = val;
sei_read_code( pDecodedMessageOutputStream, 16, val, "packed_picture_width" ); sei.m_packedPictureWidth = val;
sei_read_code( pDecodedMessageOutputStream, 16, val, "packed_picture_height" ); sei.m_packedPictureHeight = val;
sei.m_rwpTransformType.resize(sei.m_numPackedRegions);
sei.m_rwpGuardBandFlag.resize(sei.m_numPackedRegions);
sei.m_projRegionWidth.resize(sei.m_numPackedRegions);
sei.m_projRegionHeight.resize(sei.m_numPackedRegions);
sei.m_rwpProjRegionTop.resize(sei.m_numPackedRegions);
sei.m_projRegionLeft.resize(sei.m_numPackedRegions);
sei.m_packedRegionWidth.resize(sei.m_numPackedRegions);
sei.m_packedRegionHeight.resize(sei.m_numPackedRegions);
sei.m_packedRegionTop.resize(sei.m_numPackedRegions);
sei.m_packedRegionLeft.resize(sei.m_numPackedRegions);
sei.m_rwpLeftGuardBandWidth.resize(sei.m_numPackedRegions);
sei.m_rwpRightGuardBandWidth.resize(sei.m_numPackedRegions);
sei.m_rwpTopGuardBandHeight.resize(sei.m_numPackedRegions);
sei.m_rwpBottomGuardBandHeight.resize(sei.m_numPackedRegions);
sei.m_rwpGuardBandNotUsedForPredFlag.resize(sei.m_numPackedRegions);
sei.m_rwpGuardBandType.resize(4*sei.m_numPackedRegions);
for( Int i=0; i < sei.m_numPackedRegions; i++ )
{
sei_read_code( pDecodedMessageOutputStream, 4, val, "rwp_reserved_zero_4bits" );
sei_read_code( pDecodedMessageOutputStream, 3, val, "rwp_tTransform_type" ); sei.m_rwpTransformType[i] = val;
sei_read_flag( pDecodedMessageOutputStream, val, "rwp_guard_band_flag" ); sei.m_rwpGuardBandFlag[i] = val;
sei_read_code( pDecodedMessageOutputStream, 32, val, "proj_region_width" ); sei.m_projRegionWidth[i] = val;
sei_read_code( pDecodedMessageOutputStream, 32, val, "proj_region_height" ); sei.m_projRegionHeight[i] = val;
sei_read_code( pDecodedMessageOutputStream, 32, val, "rwp_proj_regionTop" ); sei.m_rwpProjRegionTop[i] = val;
sei_read_code( pDecodedMessageOutputStream, 32, val, "proj_region_left" ); sei.m_projRegionLeft[i] = val;
sei_read_code( pDecodedMessageOutputStream, 16, val, "packed_region_width" ); sei.m_packedRegionWidth[i] = val;
sei_read_code( pDecodedMessageOutputStream, 16, val, "packed_region_height" ); sei.m_packedRegionHeight[i] = val;
sei_read_code( pDecodedMessageOutputStream, 16, val, "packed_region_top" ); sei.m_packedRegionTop[i] = val;
sei_read_code( pDecodedMessageOutputStream, 16, val, "packed_region_left" ); sei.m_packedRegionLeft[i] = val;
if( sei.m_rwpGuardBandFlag[i] )
{
sei_read_code( pDecodedMessageOutputStream, 8, val, "rwp_left_guard_band_width" ); sei.m_rwpLeftGuardBandWidth[i] = val;
sei_read_code( pDecodedMessageOutputStream, 8, val, "rwp_right_guard_band_width" ); sei.m_rwpRightGuardBandWidth[i] = val;
sei_read_code( pDecodedMessageOutputStream, 8, val, "rwp_top_guard_band_height" ); sei.m_rwpTopGuardBandHeight[i] = val;
sei_read_code( pDecodedMessageOutputStream, 8, val, "rwp_bottom_guard_band_height" ); sei. m_rwpBottomGuardBandHeight[i] = val;
sei_read_flag( pDecodedMessageOutputStream, val, "rwp_guard_band_not_used_forPred_flag" ); sei.m_rwpGuardBandNotUsedForPredFlag[i] = val;
for( Int j=0; j < 4; j++ )
{
sei_read_code( pDecodedMessageOutputStream, 3, val, "rwp_guard_band_type" ); sei.m_rwpGuardBandType[i*4 + j] = val;
}
sei_read_code( pDecodedMessageOutputStream, 3, val, "rwp_guard_band_reserved_zero_3bits" );
}
}
}
}
#endif
Void SEIReader::xParseSEIColourRemappingInfo(SEIColourRemappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
{
......
......@@ -90,6 +90,9 @@ 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 RWP_SEI_MESSAGE
Void xParseSEIRegionWisePacking (SEIRegionWisePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
#endif
Void xParseSEIColourRemappingInfo (SEIColourRemappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEIDeinterlaceFieldIdentification(SEIDeinterlaceFieldIdentification& sei,UInt payLoadSize, std::ostream *pDecodedMessageOutputStream);
Void xParseSEIContentLightLevelInfo (SEIContentLightLevelInfo& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream);
......
......@@ -417,6 +417,63 @@ Void SEIEncoder::initSEIKneeFunctionInfo(SEIKneeFunctionInfo *seiKneeFunctionInf
}
}
#if RWP_SEI_MESSAGE
Void SEIEncoder::initSEIRegionWisePacking(SEIRegionWisePacking *seiRegionWisePacking)
{
assert (m_isInitialized);
assert (seiRegionWisePacking!=NULL);
seiRegionWisePacking->m_rwpCancelFlag = m_pcCfg->getRwpSEIRwpCancelFlag();
seiRegionWisePacking->m_rwpPersistenceFlag = m_pcCfg->getRwpSEIRwpPersistenceFlag();
seiRegionWisePacking->m_constituentPictureMatchingFlag = m_pcCfg->getRwpSEIConstituentPictureMatchingFlag();
seiRegionWisePacking->m_numPackedRegions = m_pcCfg->getRwpSEINumPackedRegions();
seiRegionWisePacking->m_projPictureWidth = m_pcCfg->getRwpSEIProjPictureWidth();
seiRegionWisePacking->m_projPictureHeight = m_pcCfg->getRwpSEIProjPictureHeight();
seiRegionWisePacking->m_packedPictureWidth = m_pcCfg->getRwpSEIPackedPictureWidth();
seiRegionWisePacking->m_packedPictureHeight = m_pcCfg->getRwpSEIPackedPictureHeight();
seiRegionWisePacking->m_rwpTransformType.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpGuardBandFlag.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_projRegionWidth.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_projRegionHeight.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpProjRegionTop.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_projRegionLeft.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_packedRegionWidth.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_packedRegionHeight.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_packedRegionTop.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_packedRegionLeft.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpLeftGuardBandWidth.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpRightGuardBandWidth.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpTopGuardBandHeight.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpBottomGuardBandHeight.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpGuardBandNotUsedForPredFlag.resize(seiRegionWisePacking->m_numPackedRegions);
seiRegionWisePacking->m_rwpGuardBandType.resize(4*seiRegionWisePacking->m_numPackedRegions);
for( Int i=0; i < seiRegionWisePacking->m_numPackedRegions; i++ )
{
seiRegionWisePacking->m_rwpTransformType[i] = m_pcCfg->getRwpSEIRwpTransformType(i);
seiRegionWisePacking->m_rwpGuardBandFlag[i] = m_pcCfg->getRwpSEIRwpGuardBandFlag(i);
seiRegionWisePacking->m_projRegionWidth[i] = m_pcCfg->getRwpSEIProjRegionWidth(i);
seiRegionWisePacking->m_projRegionHeight[i] = m_pcCfg->getRwpSEIProjRegionHeight(i);
seiRegionWisePacking->m_rwpProjRegionTop[i] = m_pcCfg->getRwpSEIRwpSEIProjRegionTop(i);
seiRegionWisePacking->m_projRegionLeft[i] = m_pcCfg->getRwpSEIProjRegionLeft(i);
seiRegionWisePacking->m_packedRegionWidth[i] = m_pcCfg->getRwpSEIPackedRegionWidth(i);
seiRegionWisePacking->m_packedRegionHeight[i] = m_pcCfg->getRwpSEIPackedRegionHeight(i);
seiRegionWisePacking->m_packedRegionTop[i] = m_pcCfg->getRwpSEIPackedRegionTop(i);
seiRegionWisePacking->m_packedRegionLeft[i] = m_pcCfg->getRwpSEIPackedRegionLeft(i);
if( seiRegionWisePacking->m_rwpGuardBandFlag[i] )
{
seiRegionWisePacking->m_rwpLeftGuardBandWidth[i] = m_pcCfg->getRwpSEIRwpLeftGuardBandWidth(i);