Newer
Older

Karsten Suehring
committed
#endif
("LumaLevelToDeltaQPMappingLuma", cfg_lumaLeveltoDQPMappingLuma, cfg_lumaLeveltoDQPMappingLuma, "Luma to Delta QP Mapping - luma thresholds")
("LumaLevelToDeltaQPMappingDQP", cfg_lumaLeveltoDQPMappingQP, cfg_lumaLeveltoDQPMappingQP, "Luma to Delta QP Mapping - DQP values")
#endif
Adarsh Krishnan Ramasubramonian
committed
("UseIdentityTableForNon420Chroma", m_useIdentityTableForNon420Chroma, true, "True: Indicates that 422/444 chroma uses identity chroma QP mapping tables; False: explicit Qp table may be specified in config")
("SameCQPTablesForAllChroma", m_chromaQpMappingTableParams.m_sameCQPTableForAllChromaFlag, true, "0: Different tables for Cb, Cr and joint Cb-Cr components, 1 (default): Same tables for all three chroma components")
Adarsh Krishnan Ramasubramonian
committed
("QpInValCb", cfg_qpInValCb, cfg_qpInValCb, "Input coordinates for the QP table for Cb component")
("QpOutValCb", cfg_qpOutValCb, cfg_qpOutValCb, "Output coordinates for the QP table for Cb component")
("QpInValCr", cfg_qpInValCr, cfg_qpInValCr, "Input coordinates for the QP table for Cr component")
("QpOutValCr", cfg_qpOutValCr, cfg_qpOutValCr, "Output coordinates for the QP table for Cr component")
("QpInValCbCr", cfg_qpInValCbCr, cfg_qpInValCbCr, "Input coordinates for the QP table for joint Cb-Cr component")
("QpOutValCbCr", cfg_qpOutValCbCr, cfg_qpOutValCbCr, "Output coordinates for the QP table for joint Cb-Cr component")

Karsten Suehring
committed
("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset")
("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset")

Christian Helmrich
committed
("CbQpOffsetDualTree", m_cbQpOffsetDualTree, 0, "Chroma Cb QP Offset for dual tree")
("CrQpOffsetDualTree", m_crQpOffsetDualTree, 0, "Chroma Cr QP Offset for dual tree")
("CbCrQpOffset,-cbcrqpofs", m_cbCrQpOffset, -1, "QP Offset for joint Cb-Cr mode")
("CbCrQpOffsetDualTree", m_cbCrQpOffsetDualTree, 0, "QP Offset for joint Cb-Cr mode in dual tree")

Karsten Suehring
committed
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
#if ER_CHROMA_QP_WCG_PPS
("WCGPPSEnable", m_wcgChromaQpControl.enabled, false, "1: Enable the WCG PPS chroma modulation scheme. 0 (default) disabled")
("WCGPPSCbQpScale", m_wcgChromaQpControl.chromaCbQpScale, 1.0, "WCG PPS Chroma Cb QP Scale")
("WCGPPSCrQpScale", m_wcgChromaQpControl.chromaCrQpScale, 1.0, "WCG PPS Chroma Cr QP Scale")
("WCGPPSChromaQpScale", m_wcgChromaQpControl.chromaQpScale, 0.0, "WCG PPS Chroma QP Scale")
("WCGPPSChromaQpOffset", m_wcgChromaQpControl.chromaQpOffset, 0.0, "WCG PPS Chroma QP Offset")
#endif
#if W0038_CQP_ADJ
("SliceChromaQPOffsetPeriodicity", m_sliceChromaQpOffsetPeriodicity, 0u, "Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.")
("SliceCbQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[0], 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", m_sliceChromaQpOffsetIntraOrPeriodic[1], 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.")
#endif
("AdaptiveQP,-aq", m_bUseAdaptiveQP, false, "QP adaptation based on a psycho-visual model")
("MaxQPAdaptationRange,-aqr", m_iQPAdaptationRange, 6, "QP adaptation range")
#if ENABLE_QPA
("PerceptQPA,-qpa", m_bUsePerceptQPA, false, "perceptually motivated input-adaptive QP modification (default: 0 = off, ignored if -aq is set)")
("WPSNR,-wpsnr", m_bUseWPSNR, false, "output perceptually weighted peak SNR (WPSNR) instead of PSNR")
#endif
("dQPFile,m", m_dQPFileName, string(""), "dQP file name")
("RDOQ", m_useRDOQ, true)
("RDOQTS", m_useRDOQTS, true)
#if T0196_SELECTIVE_RDOQ
("SelectiveRDOQ", m_useSelectiveRDOQ, false, "Enable selective RDOQ")
#endif
("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disabled 1:RD-penalty 2:maximum RD-penalty")
// Deblocking filter parameters
("LoopFilterDisable", m_bLoopFilterDisable, false)
("LoopFilterOffsetInPPS", m_loopFilterOffsetInPPS, true)
("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0)
("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0)
("LoopFilterCbBetaOffset_div2", m_loopFilterCbBetaOffsetDiv2, 0)
("LoopFilterCbTcOffset_div2", m_loopFilterCbTcOffsetDiv2, 0)
("LoopFilterCrBetaOffset_div2", m_loopFilterCrBetaOffsetDiv2, 0)
("LoopFilterCrTcOffset_div2", m_loopFilterCrTcOffsetDiv2, 0)

Karsten Suehring
committed
#if W0038_DB_OPT
("DeblockingFilterMetric", m_deblockingFilterMetric, 0)
#else
("DeblockingFilterMetric", m_DeblockingFilterMetric, false)
#endif
// Coding tools
("ReconBasedCrossCPredictionEstimate", m_reconBasedCrossCPredictionEstimate, false, "When determining the alpha value for cross-component prediction, use the decoded residual rather than the pre-transform encoder-side residual")
("TransformSkip", m_useTransformSkip, false, "Intra transform skipping")
("TransformSkipFast", m_useTransformSkipFast, false, "Fast encoder search for transform skipping, winner takes it all mode.")
("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 5U, "Specify transform-skip maximum size. Minimum 2, Maximum 5. (not valid in V1 profiles)")
("ChromaTS", m_useChromaTS, false, "Enable encoder search of chromaTS")
Alican Nalci
committed
("BDPCM", m_useBDPCM, false, "BDPCM (0:off, 1:luma and chroma)")
Santiago de Luxán Hernández
committed
("ISPFast", m_useFastISP, false, "Fast encoder search for ISP")

Karsten Suehring
committed
("ImplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT], false, "Enable implicitly signalled residual DPCM for intra (also known as sample-adaptive intra predict) (not valid in V1 profiles)")
("ExplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT], false, "Enable explicitly signalled residual DPCM for inter (not valid in V1 profiles)")
("ResidualRotation", m_transformSkipRotationEnabledFlag, false, "Enable rotation of transform-skipped and transquant-bypassed TUs through 180 degrees prior to entropy coding (not valid in V1 profiles)")
("SingleSignificanceMapContext", m_transformSkipContextEnabledFlag, false, "Enable, for transform-skipped and transquant-bypassed TUs, the selection of a single significance map context variable for all coefficients (not valid in V1 profiles)")
("GolombRiceParameterAdaptation", m_persistentRiceAdaptationEnabledFlag, false, "Enable the adaptation of the Golomb-Rice parameter over the course of each slice")
("AlignCABACBeforeBypass", m_cabacBypassAlignmentEnabledFlag, false, "Align the CABAC engine to a defined fraction of a bit prior to coding bypass data. Must be 1 in high bit rate profile, 0 otherwise")
("SAO", m_bUseSAO, true, "Enable Sample Adaptive Offset")
("TestSAODisableAtPictureLevel", m_bTestSAODisableAtPictureLevel, false, "Enables the testing of disabling SAO at the picture level after having analysed all blocks")
("SaoEncodingRate", m_saoEncodingRate, 0.75, "When >0 SAO early picture termination is enabled for luma and chroma")
("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")
("SAOGreedyEnc", m_saoGreedyMergeEnc, false, "SAO greedy merge encoding algorithm")
("EnablePicPartitioning", m_picPartitionFlag, false, "Enable picture partitioning (0: single tile, single slice, 1: multiple tiles/slices can be used)")
("TileColumnWidthArray", cfgTileColumnWidth, cfgTileColumnWidth, "Tile column widths in units of CTUs. Last column width in list will be repeated uniformly to cover any remaining picture width")
("TileRowHeightArray", cfgTileRowHeight, cfgTileRowHeight, "Tile row heights in units of CTUs. Last row height in list will be repeated uniformly to cover any remaining picture height")
("RasterScanSlices", m_rasterSliceFlag, false, "Indicates if using raster-scan or rectangular slices (0: rectangular, 1: raster-scan)")
("RectSlicePositions", cfgRectSlicePos, cfgRectSlicePos, "Rectangular slice positions. List containing pairs of top-left CTU RS address followed by bottom-right CTU RS address")
("RectSliceFixedWidth", m_rectSliceFixedWidth, 0, "Fixed rectangular slice width in units of tiles (0: disable this feature and use RectSlicePositions instead)")
("RectSliceFixedHeight", m_rectSliceFixedHeight, 0, "Fixed rectangular slice height in units of tiles (0: disable this feature and use RectSlicePositions instead)")
("RasterSliceSizes", cfgRasterSliceSize, cfgRasterSliceSize, "Raster-scan slice sizes in units of tiles. Last size in list will be repeated uniformly to cover any remaining tiles in the picture")
("DisableLoopFilterAcrossTiles", m_disableLFCrossTileBoundaryFlag, false, "Loop filtering applied across tile boundaries or not (0: filter across tile boundaries 1: do not filter across tile boundaries)")
("DisableLoopFilterAcrossSlices", m_disableLFCrossSliceBoundaryFlag, false, "Loop filtering applied across slice boundaries or not (0: filter across slice boundaries 1: do not filter across slice boundaries)")

Karsten Suehring
committed
("FastUDIUseMPMEnabled", m_bFastUDIUseMPMEnabled, true, "If enabled, adapt intra direction search, accounting for MPM")
("FastMEForGenBLowDelayEnabled", m_bFastMEForGenBLowDelayEnabled, true, "If enabled use a fast ME for generalised B Low Delay slices")
("UseBLambdaForNonKeyLowDelayPictures", m_bUseBLambdaForNonKeyLowDelayPictures, true, "Enables use of B-Lambda for non-key low-delay pictures")
("IntraReferenceSmoothing", m_enableIntraReferenceSmoothing, true, "0: Disable use of intra reference smoothing (not valid in V1 profiles). 1: Enable use of intra reference smoothing (same as V1)")
("WeightedPredP,-wpP", m_useWeightedPred, false, "Use weighted prediction in P slices")
("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices")
("WeightedPredMethod,-wpM", tmpWeightedPredictionMethod, int(WP_PER_PICTURE_WITH_SIMPLE_DC_COMBINED_COMPONENT), "Weighted prediction method")
("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region")

Karsten Suehring
committed
("WaveFrontSynchro", m_entropyCodingSyncEnabledFlag, false, "0: entropy coding sync disabled; 1 entropy coding sync enabled")
("WaveFrontEntryPointsPresent", m_entropyCodingSyncEntryPointPresentFlag, false, "0: entry points for WPP is not present; 1 entry points for WPP may be present in slice header")

Karsten Suehring
committed
("ScalingList", m_useScalingListId, SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile")
("ScalingListFile", m_scalingListFileName, string(""), "Scaling list file name. Use an empty string to produce help.")
Adarsh Krishnan Ramasubramonian
committed
("DisableScalingMatrixForLFNST", m_disableScalingMatrixForLfnstBlks, true, "Disable scaling matrices, when enabled, for LFNST-coded blocks")
("DepQuant", m_depQuantEnabledFlag, true, "Enable dependent quantization (Default: 1)" )
("SignHideFlag,-SBH", m_signDataHidingEnabledFlag, false, "Enable sign hiding" )

Karsten Suehring
committed
("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates")
("MaxNumAffineMergeCand", m_maxNumAffineMergeCand, 5u, "Maximum number of affine merge candidates")
("MaxNumGeoCand", m_maxNumGeoCand, 5u, "Maximum number of geometric partitioning mode candidates")
("MaxNumIBCMergeCand", m_maxNumIBCMergeCand, 6u, "Maximum number of IBC merge candidates")
/* Misc. */

Karsten Suehring
committed
("SEIDecodedPictureHash,-dph", tmpDecodedPictureHashSEIMappedType, 0, "Control generation of decode picture hash SEI messages\n"
"\t3: checksum\n"
"\t2: CRC\n"
"\t1: use MD5\n"
"\t0: disable")
("TMVPMode", m_TMVPModeId, 1, "TMVP mode 0: TMVP disable for all slices. 1: TMVP enable for all slices (default) 2: TMVP enable for certain slices only")
("SliceLevelRpl", m_sliceLevelRpl, true, "Code reference picture lists in slice headers rather than picture header.")
("SliceLevelDblk", m_sliceLevelDblk, true, "Code deblocking filter parameters in slice headers rather than picture header.")
("SliceLevelSao", m_sliceLevelSao, true, "Code SAO parameters in slice headers rather than picture header.")
("SliceLevelAlf", m_sliceLevelAlf, true, "Code ALF parameters in slice headers rather than picture header.")
("SliceLevelWeightedPrediction", m_sliceLevelWp, true, "Code weighted prediction parameters in slice headers rather than picture header.")
("SliceLevelDeltaQp", m_sliceLevelDeltaQp, true, "Code delta Qp in slice headers rather than picture header.")

Karsten Suehring
committed
("FEN", tmpFastInterSearchMode, int(FASTINTERSEARCH_DISABLED), "fast encoder setting")
("ECU", m_bUseEarlyCU, false, "Early CU setting")
("FDM", m_useFastDecisionForMerge, true, "Fast decision for Merge RD Cost")
("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting")
("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting")
( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" )
( "TargetBitrate", m_RCTargetBitrate, 0, "Rate control: target bit-rate" )
( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, 0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" )
( "LCULevelRateControl", m_RCLCULevelRC, true, "Rate control: true: CTU level RC; false: picture level RC" )
( "RCLCUSeparateModel", m_RCUseLCUSeparateModel, true, "Rate control: use CTU level separate R-lambda model" )
( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" )
( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" )
#if U0132_TARGET_BITS_SATURATION
( "RCCpbSaturation", m_RCCpbSaturationEnabled, false, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" )
( "RCCpbSize", m_RCCpbSize, 0u, "Rate control: CPB size" )
( "RCInitialCpbFullness", m_RCInitialCpbFullness, 0.9, "Rate control: initial CPB fullness" )

Karsten Suehring
committed
("CostMode", m_costMode, COST_STANDARD_LOSSY, "Use alternative cost functions: choose between 'lossy', 'sequence_level_lossless', 'lossless' (which forces QP to " MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP) ") and 'mixed_lossless_lossy' (which used QP'=" MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME) " for pre-estimates of transquant-bypass blocks).")
("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case")
("HrdParametersPresent,-hrd", m_hrdParametersPresentFlag, false, "Enable generation of hrd_parameters()")
("VuiParametersPresent,-vui", m_vuiParametersPresentFlag, false, "Enable generation of vui_parameters()")
("AspectRatioInfoPresent", m_aspectRatioInfoPresentFlag, false, "Signals whether aspect_ratio_idc is present")
("AspectRatioIdc", m_aspectRatioIdc, 0, "aspect_ratio_idc")
("SarWidth", m_sarWidth, 0, "horizontal size of the sample aspect ratio")
("SarHeight", m_sarHeight, 0, "vertical size of the sample aspect ratio")
("ColourDescriptionPresent", m_colourDescriptionPresentFlag, false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present")
("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries")
("TransferCharacteristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source")
("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries")
("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present")
("ChromaSampleLocTypeTopField", m_chromaSampleLocTypeTopField, 0, "Specifies the location of chroma samples for top field")
("ChromaSampleLocTypeBottomField", m_chromaSampleLocTypeBottomField, 0, "Specifies the location of chroma samples for bottom field")
("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")
("VideoFullRange", m_videoFullRangeFlag, false, "Indicates the black level and range of luma and chroma signals");

Karsten Suehring
committed
opts.addOptions()
("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, false, "Control generation of buffering period SEI messages")
("SEIPictureTiming", m_pictureTimingSEIEnabled, false, "Control generation of picture timing SEI messages")
("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, false, "Control generation of decoding unit information SEI message.")
("SEIScalableNesting", m_scalableNestingSEIEnabled, false, "Control generation of scalable nesting SEI messages")
("SEIFrameFieldInfo", m_frameFieldInfoSEIEnabled, false, "Control generation of frame field information SEI messages")

Karsten Suehring
committed
("SEIFramePacking", m_framePackingSEIEnabled, false, "Control generation of frame packing SEI messages")
("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n"
"\t3: side by side - frames are displayed horizontally\n"
"\t4: top bottom - frames are displayed vertically\n"
"\t5: frame alternation - one frame is alternated with the other")
("SEIFramePackingId", m_framePackingSEIId, 0, "Id of frame packing SEI message for a given session")
("SEIFramePackingQuincunx", m_framePackingSEIQuincunx, 0, "Indicate the presence of a Quincunx type video frame")
("SEIFramePackingInterpretation", m_framePackingSEIInterpretation, 0, "Indicate the interpretation of the frame pair\n"
"\t0: unspecified\n"
"\t1: stereo pair, frame0 represents left view\n"
"\t2: stereo pair, frame0 represents right view")

Karsten Suehring
committed
("SEIMasteringDisplayColourVolume", m_masteringDisplay.colourVolumeSEIEnabled, false, "Control generation of mastering display colour volume SEI messages")
("SEIMasteringDisplayMaxLuminance", m_masteringDisplay.maxLuminance, 10000u, "Specifies the mastering display maximum luminance value in units of 1/10000 candela per square metre (32-bit code value)")
("SEIMasteringDisplayMinLuminance", m_masteringDisplay.minLuminance, 0u, "Specifies the mastering display minimum luminance value in units of 1/10000 candela per square metre (32-bit code value)")
("SEIMasteringDisplayPrimaries", cfg_DisplayPrimariesCode, cfg_DisplayPrimariesCode, "Mastering display primaries for all three colour planes in CIE xy coordinates in increments of 1/50000 (results in the ranges 0 to 50000 inclusive)")
("SEIMasteringDisplayWhitePoint", cfg_DisplayWhitePointCode, cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)")
#if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI
("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")
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
("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")
("SEIErpPersistenceFlag", m_erpSEIPersistenceFlag, false, "Specifies the persistence of the equirectangular projection SEI messages")
("SEIErpGuardBandFlag", m_erpSEIGuardBandFlag, false, "Indicate the existence of guard band areas in the constituent picture")
("SEIErpGuardBandType", m_erpSEIGuardBandType, 0u, "Indicate the type of the guard band")
("SEIErpLeftGuardBandWidth", m_erpSEILeftGuardBandWidth, 0u, "Indicate the width of the guard band on the left side of the constituent picture")
("SEIErpRightGuardBandWidth", m_erpSEIRightGuardBandWidth, 0u, "Indicate the width of the guard band on the right side of the constituent picture")
("SEISphereRotationEnabled", m_sphereRotationSEIEnabled, false, "Control generation of sphere rotation SEI messages")
("SEISphereRotationCancelFlag", m_sphereRotationSEICancelFlag, true, "Indicate that sphere rotation SEI message cancels the persistence or follows")
("SEISphereRotationPersistenceFlag", m_sphereRotationSEIPersistenceFlag, false, "Specifies the persistence of the sphere rotation SEI messages")
("SEISphereRotationYaw", m_sphereRotationSEIYaw, 0, "Specifies the value of the yaw rotation angle")
("SEISphereRotationPitch", m_sphereRotationSEIPitch, 0, "Specifies the value of the pitch rotation angle")
("SEISphereRotationRoll", m_sphereRotationSEIRoll, 0, "Specifies the value of the roll rotation angle")
("SEIOmniViewportEnabled", m_omniViewportSEIEnabled, false, "Control generation of omni viewport SEI messages")
("SEIOmniViewportId", m_omniViewportSEIId, 0u, "An identifying number that may be used to identify the purpose of the one or more recommended viewport regions")
("SEIOmniViewportCancelFlag", m_omniViewportSEICancelFlag, true, "Indicate that omni viewport SEI message cancels the persistence or follows")
("SEIOmniViewportPersistenceFlag", m_omniViewportSEIPersistenceFlag, false, "Specifies the persistence of the omni viewport SEI messages")
("SEIOmniViewportCntMinus1", m_omniViewportSEICntMinus1, 0u, "specifies the number of recommended viewport regions minus 1")
("SEIOmniViewportAzimuthCentre", cfg_omniViewportSEIAzimuthCentre, cfg_omniViewportSEIAzimuthCentre, "Indicate the centre of the i-th recommended viewport region")
("SEIOmniViewportElevationCentre", cfg_omniViewportSEIElevationCentre, cfg_omniViewportSEIElevationCentre, "Indicate the centre of the i-th recommended viewport region")
("SEIOmniViewportTiltCentre", cfg_omniViewportSEITiltCentre, cfg_omniViewportSEITiltCentre, "Indicates the tilt angle of the i-th recommended viewport region")
("SEIOmniViewportHorRange", cfg_omniViewportSEIHorRange, cfg_omniViewportSEIHorRange, "Indicates the azimuth range of the i-th recommended viewport region")
("SEIOmniViewportVerRange", cfg_omniViewportSEIVerRange, cfg_omniViewportSEIVerRange, "Indicates the elevation range of the i-th recommended viewport region")
("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.")
("SEIGcmpEnabled", m_gcmpSEIEnabled, false, "Control generation of generalized cubemap projection SEI messages")
("SEIGcmpCancelFlag", m_gcmpSEICancelFlag, true, "Indicate that generalized cubemap projection SEI message cancels the persistence or follows")
("SEIGcmpPersistenceFlag", m_gcmpSEIPersistenceFlag, false, "Specifies the persistence of the generalized cubemap projection SEI messages")
("SEIGcmpPackingType", m_gcmpSEIPackingType, 0u, "Specifies the packing type")
("SEIGcmpMappingFunctionType", m_gcmpSEIMappingFunctionType, 0u, "Specifies the mapping function used to adjust the sample locations of the cubemap projection")
("SEIGcmpFaceIndex", cfg_gcmpSEIFaceIndex, cfg_gcmpSEIFaceIndex, "Specifies the face index for the i-th face")
("SEIGcmpFaceRotation", cfg_gcmpSEIFaceRotation, cfg_gcmpSEIFaceRotation, "Specifies the rotation to be applied to the i-th face")
("SEIGcmpFunctionCoeffU", cfg_gcmpSEIFunctionCoeffU, cfg_gcmpSEIFunctionCoeffU, "Specifies the coefficient used in the cubemap mapping function of the u-axis of the i-th face")
("SEIGcmpFunctionUAffectedByVFlag", cfg_gcmpSEIFunctionUAffectedByVFlag, cfg_gcmpSEIFunctionUAffectedByVFlag, "Specifies whether the cubemap mapping function of the u-axis refers to the v position of the sample location")
("SEIGcmpFunctionCoeffV", cfg_gcmpSEIFunctionCoeffV, cfg_gcmpSEIFunctionCoeffV, "Specifies the coefficient used in the cubemap mapping function of the v-axis of the i-th face")
("SEIGcmpFunctionVAffectedByUFlag", cfg_gcmpSEIFunctionVAffectedByUFlag, cfg_gcmpSEIFunctionVAffectedByUFlag, "Specifies whether the cubemap mapping function of the v-axis refers to the u position of the sample location")
("SEIGcmpGuardBandFlag", m_gcmpSEIGuardBandFlag, false, "Indicate the existence of guard band areas in the picture")
("SEIGcmpGuardBandType", m_gcmpSEIGuardBandType, 0u, "Indicate the type of the guard bands")
("SEIGcmpGuardBandBoundaryExteriorFlag", m_gcmpSEIGuardBandBoundaryExteriorFlag, false, "Indicate whether face boundaries contain guard bands")
("SEIGcmpGuardBandSamplesMinus1", m_gcmpSEIGuardBandSamplesMinus1, 0u, "Specifies the number of guard band samples minus1 used in the cubemap projected picture")
("SEISubpicLevelInfoEnabled", m_cfgSubpictureLevelInfoSEI.m_enabled, false, "Control generation of Subpicture Level Information SEI messages")
("SEISubpicLevelInfoRefLevels", cfg_sliRefLevels, cfg_sliRefLevels, "List of reference levels for Subpicture Level Information SEI messages")
("SEISubpicLevelInfoExplicitFraction", m_cfgSubpictureLevelInfoSEI.m_explicitFraction, false, "Enable sending of explicit fractions in Subpicture Level Information SEI messages")
("SEISubpicLevelInfoNumSubpics", m_cfgSubpictureLevelInfoSEI.m_numSubpictures, 1, "Number of subpictures for Subpicture Level Information SEI messages")
("SEISubpicLevelInfoRefLevelFractions", cfg_sliFractions, cfg_sliFractions, "List of fractions for Subpicture Level Information SEI messages")
("SEISampleAspectRatioInfo", m_sampleAspectRatioInfoSEIEnabled, false, "Control generation of Sample Aspect Ratio Information SEI messages")
("SEISARICancelFlag", m_sariCancelFlag, false, "Indicates that Sample Aspect Ratio Information SEI message cancels the persistence or follows")
("SEISARIPersistenceFlag", m_sariPersistenceFlag, true, "Specifies the persistence of the Sample Aspect Ratio Information SEI message")
("SEISARIAspectRatioIdc", m_sariAspectRatioIdc, 0, "Specifies the Sample Aspect Ratio IDC of Sample Aspect Ratio Information SEI messages")
("SEISARISarWidth", m_sariSarWidth, 0, "Specifies the Sample Aspect Ratio Width of Sample Aspect Ratio Information SEI messages, if extended SAR is chosen.")
("SEISARISarHeight", m_sariSarHeight, 0, "Specifies the Sample Aspect Ratio Height of Sample Aspect Ratio Information SEI messages, if extended SAR is chosen.")
("MCTSEncConstraint", m_MCTSEncConstraint, false, "For MCTS, constrain motion vectors at tile boundaries")

Karsten Suehring
committed
#if ENABLE_TRACING
("TraceChannelsList", bTracingChannelsList, false, "List all available tracing channels")
("TraceRule", sTracingRule, string( "" ), "Tracing rule (ex: \"D_CABAC:poc==8\" or \"D_REC_CB_LUMA:poc==8\")")
("TraceFile", sTracingFile, string( "" ), "Tracing file")
#endif
// 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 presence of a distinct colour space description for the film grain characteristics 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 presence of film grain modelling on colour component 0.")
("SEIFGCCompModelPresentComp1", m_fgcSEICompModelPresent[1], false, "Specifies the presence of film grain modelling on colour component 1.")
("SEIFGCCompModelPresentComp2", m_fgcSEICompModelPresent[2], false, "Specifies the presence 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 environment 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 definition 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 definition in units of 1/50000 lux for the ambient viewing enviornment SEI message")
// content colour volume SEI
("SEICCVEnabled", m_ccvSEIEnabled, false, "Control generation of the Content Colour Volume SEI message")
("SEICCVCancelFlag", m_ccvSEICancelFlag, true, "Specifies the persistence of any previous content colour volume SEI message in output order.")
("SEICCVPersistenceFlag", m_ccvSEIPersistenceFlag, false, "Specifies the persistence of the content colour volume SEI message for the current layer.")
("SEICCVPrimariesPresent", m_ccvSEIPrimariesPresentFlag, true, "Specifies whether the CCV primaries are present in the content colour volume SEI message.")
("m_ccvSEIPrimariesX0", m_ccvSEIPrimariesX[0], 0.300, "Specifies the x coordinate of the first (green) primary for the content colour volume SEI message")
("m_ccvSEIPrimariesY0", m_ccvSEIPrimariesY[0], 0.600, "Specifies the y coordinate of the first (green) primary for the content colour volume SEI message")
("m_ccvSEIPrimariesX1", m_ccvSEIPrimariesX[1], 0.150, "Specifies the x coordinate of the second (blue) primary for the content colour volume SEI message")
("m_ccvSEIPrimariesY1", m_ccvSEIPrimariesY[1], 0.060, "Specifies the y coordinate of the second (blue) primary for the content colour volume SEI message")
("m_ccvSEIPrimariesX2", m_ccvSEIPrimariesX[2], 0.640, "Specifies the x coordinate of the third (red) primary for the content colour volume SEI message")
("m_ccvSEIPrimariesY2", m_ccvSEIPrimariesY[2], 0.330, "Specifies the y coordinate of the third (red) primary for the content colour volume SEI message")
("SEICCVMinLuminanceValuePresent", m_ccvSEIMinLuminanceValuePresentFlag, true, "Specifies whether the CCV min luminance value is present in the content colour volume SEI message")
("SEICCVMinLuminanceValue", m_ccvSEIMinLuminanceValue, 0.0, "specifies the CCV min luminance value in the content colour volume SEI message")
("SEICCVMaxLuminanceValuePresent", m_ccvSEIMaxLuminanceValuePresentFlag, true, "Specifies whether the CCV max luminance value is present in the content colour volume SEI message")
("SEICCVMaxLuminanceValue", m_ccvSEIMaxLuminanceValue, 0.1, "specifies the CCV max luminance value in the content colour volume SEI message")
("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")

Karsten Suehring
committed
("DebugBitstream", m_decodeBitstreams[0], string( "" ), "Assume the frames up to POC DebugPOC will be the same as in this bitstream. Load those frames from the bitstream instead of encoding them." )
("DebugPOC", m_switchPOC, -1, "If DebugBitstream is present, load frames up to this POC from this bitstream. Starting with DebugPOC, return to normal encoding." )
("DecodeBitstream1", m_decodeBitstreams[0], string( "" ), "Assume the frames up to POC DebugPOC will be the same as in this bitstream. Load those frames from the bitstream instead of encoding them." )
("DecodeBitstream2", m_decodeBitstreams[1], string( "" ), "Assume the frames up to POC DebugPOC will be the same as in this bitstream. Load those frames from the bitstream instead of encoding them." )
("SwitchPOC", m_switchPOC, -1, "If DebugBitstream is present, load frames up to this POC from this bitstream. Starting with DebugPOC, return to normal encoding." )
("SwitchDQP", m_switchDQP, 0, "delta QP applied to picture with switchPOC and subsequent pictures." )
("FastForwardToPOC", m_fastForwardToPOC, -1, "Get to encoding the specified POC as soon as possible by skipping temporal layers irrelevant for the specified POC." )
("StopAfterFFtoPOC", m_stopAfterFFtoPOC, false, "If using fast forward to POC, after the POC of interest has been hit, stop further encoding.")
("ForceDecodeBitstream1", m_forceDecodeBitstream1, false, "force decoding of bitstream 1 - use this only if you are realy sure about what you are doing ")
("DecodeBitstream2ModPOCAndType", m_bs2ModPOCAndType, false, "Modify POC and NALU-type of second input bitstream, to use second BS as closing I-slice")
("NumSplitThreads", m_numSplitThreads, 1, "Number of threads used to parallelize splitting")
("ForceSingleSplitThread", m_forceSplitSequential, false, "Force single thread execution even if taking the parallelized path")
("NumWppThreads", m_numWppThreads, 1, "Number of threads used to run WPP-style parallelization")
("NumWppExtraLines", m_numWppExtraLines, 0, "Number of additional wpp lines to switch when threads are blocked")
("DebugCTU", m_debugCTU, -1, "If DebugBitstream is present, load frames up to this POC from this bitstream. Starting with DebugPOC-frame at CTUline containin debug CTU.")

Karsten Suehring
committed
("EnsureWppBitEqual", m_ensureWppBitEqual, false, "Ensure the results are equal to results with WPP-style parallelism, even if WPP is off")
( "ALF", m_alf, true, "Adaptive Loop Filter\n" )
( "CCALF", m_ccalf, true, "Cross-component Adaptive Loop Filter" )
( "CCALFQpTh", m_ccalfQpThreshold, 37, "QP threshold above which encoder reduces CCALF usage")
( "ScalingRatioHor", m_scalingRatioHor, 1.0, "Scaling ratio in hor direction" )
( "ScalingRatioVer", m_scalingRatioVer, 1.0, "Scaling ratio in ver direction" )
( "FractionNumFrames", m_fractionOfFrames, 1.0, "Encode a fraction of the specified in FramesToBeEncoded frames" )
( "SwitchPocPeriod", m_switchPocPeriod, 0, "Switch POC period for RPR" )
( "UpscaledOutput", m_upscaledOutput, 0, "Output upscaled (2), decoded but in full resolution buffer (1) or decoded cropped (0, default) picture for RPR" )
( "TargetOutputLayerSet,p", m_targetOlsIdx, -1, "Target output layer set index" )
;
opts.addOptions()
( "MaxSublayers", m_maxSublayers, 1, "Max number of Sublayers")
( "AllLayersSameNumSublayersFlag", m_allLayersSameNumSublayersFlag, true, "All layers same num sublayersflag")
( "AllIndependentLayersFlag", m_allIndependentLayersFlag, true, "All layers are independent layer")
( "LayerId%d", m_layerId, 0, MAX_VPS_LAYERS, "Max number of Sublayers")
( "NumRefLayers%d", m_numRefLayers, 0, MAX_VPS_LAYERS, "Number of direct reference layer index of i-th layer")
( "RefLayerIdx%d", m_refLayerIdxStr, string(""), MAX_VPS_LAYERS, "Reference layer index(es)")
( "EachLayerIsAnOlsFlag", m_eachLayerIsAnOlsFlag, true, "Each layer is an OLS layer flag")
( "OlsModeIdc", m_olsModeIdc, 0, "Output layer set mode")
( "NumOutputLayerSets", m_numOutputLayerSets, 1, "Number of output layer sets")
( "OlsOutputLayer%d", m_olsOutputLayerStr, string(""), MAX_VPS_LAYERS, "Output layer index of i-th OLS")
( "NumPTLsInVPS", m_numPtlsInVps, 1, "Number of profile_tier_level structures in VPS" )

Karsten Suehring
committed
;
Rickard Sjöberg
committed
opts.addOptions()
("TemporalFilter", m_gopBasedTemporalFilterEnabled, false, "Enable GOP based temporal filter. Disabled per default")
("TemporalFilterFutureReference", m_gopBasedTemporalFilterFutureReference, true, "Enable referencing of future frames in the GOP based temporal filter. This is typically disabled for Low Delay configurations.")
("TemporalFilterStrengthFrame*", m_gopBasedTemporalFilterStrengths, std::map<int, double>(), "Strength for every * frame in GOP based temporal filter, where * is an integer."
" E.g. --TemporalFilterStrengthFrame8 0.95 will enable GOP based temporal filter at every 8th frame with strength 0.95");

Karsten Suehring
committed
#if EXTENSION_360_VIDEO
TExt360AppEncCfg::TExt360AppEncCfgContext ext360CfgContext;
m_ext360.addOptions(opts, ext360CfgContext);
#endif
for(int i=1; i<MAX_GOP+1; i++)
{
std::ostringstream cOSS;
cOSS<<"Frame"<<i;
opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry());
}
for(int i = 0; i < MAX_NUM_OLSS; i++)
{
std::ostringstream cOSS1;
cOSS1<<"LevelPTL"<<i;
opts.addOptions()(cOSS1.str(), m_levelPtl[i], Level::NONE);
std::ostringstream cOSS2;
cOSS2<<"OlsPTLIdx"<<i;
opts.addOptions()(cOSS2.str(), m_olsPtlIdx[i], 0);
}

Karsten Suehring
committed
po::setDefaults(opts);
po::ErrorReporter err;
const list<const char*>& argv_unhandled = po::scanArgv(opts, argc, (const char**) argv, err);
m_rprEnabled = m_scalingRatioHor != 1.0 || m_scalingRatioVer != 1.0;
if( m_fractionOfFrames != 1.0 )
m_framesToBeEncoded = int( m_framesToBeEncoded * m_fractionOfFrames );
}
if( m_rprEnabled && !m_switchPocPeriod )
{
m_switchPocPeriod = m_iFrameRate / 2 / m_iGOPSize * m_iGOPSize;
}
//Check the given value of intra period and decoding refresh type. If intra period is -1, set decoding refresh type to be equal to 0. And vice versa
if( m_iIntraPeriod == -1 )
{
m_iDecodingRefreshType = 0;
}
if( !m_iDecodingRefreshType )
{
m_iIntraPeriod = -1;
}
Yago Sanchez de la Fuente
committed
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
m_bpDeltasGOPStructure = false;
if(m_iGOPSize == 16)
{
if ((m_GOPList[0].m_POC == 16 && m_GOPList[0].m_temporalId == 0 )
&& (m_GOPList[1].m_POC == 8 && m_GOPList[1].m_temporalId == 1 )
&& (m_GOPList[2].m_POC == 4 && m_GOPList[2].m_temporalId == 2 )
&& (m_GOPList[3].m_POC == 2 && m_GOPList[3].m_temporalId == 3 )
&& (m_GOPList[4].m_POC == 1 && m_GOPList[4].m_temporalId == 4 )
&& (m_GOPList[5].m_POC == 3 && m_GOPList[5].m_temporalId == 4 )
&& (m_GOPList[6].m_POC == 6 && m_GOPList[6].m_temporalId == 3 )
&& (m_GOPList[7].m_POC == 5 && m_GOPList[7].m_temporalId == 4 )
&& (m_GOPList[8].m_POC == 7 && m_GOPList[8].m_temporalId == 4 )
&& (m_GOPList[9].m_POC == 12 && m_GOPList[9].m_temporalId == 2 )
&& (m_GOPList[10].m_POC == 10 && m_GOPList[10].m_temporalId == 3 )
&& (m_GOPList[11].m_POC == 9 && m_GOPList[11].m_temporalId == 4 )
&& (m_GOPList[12].m_POC == 11 && m_GOPList[12].m_temporalId == 4 )
&& (m_GOPList[13].m_POC == 14 && m_GOPList[13].m_temporalId == 3 )
&& (m_GOPList[14].m_POC == 13 && m_GOPList[14].m_temporalId == 4 )
&& (m_GOPList[15].m_POC == 15 && m_GOPList[15].m_temporalId == 4 ))
{
m_bpDeltasGOPStructure = true;
}
}
else if(m_iGOPSize == 8)
{
if ((m_GOPList[0].m_POC == 8 && m_GOPList[0].m_temporalId == 0 )
&& (m_GOPList[1].m_POC == 4 && m_GOPList[1].m_temporalId == 1 )
&& (m_GOPList[2].m_POC == 2 && m_GOPList[2].m_temporalId == 2 )
&& (m_GOPList[3].m_POC == 1 && m_GOPList[3].m_temporalId == 3 )
&& (m_GOPList[4].m_POC == 3 && m_GOPList[4].m_temporalId == 3 )
&& (m_GOPList[5].m_POC == 6 && m_GOPList[5].m_temporalId == 2 )
&& (m_GOPList[6].m_POC == 5 && m_GOPList[6].m_temporalId == 3 )
&& (m_GOPList[7].m_POC == 7 && m_GOPList[7].m_temporalId == 3 ))
{
m_bpDeltasGOPStructure = true;
}
}
else
{
m_bpDeltasGOPStructure = false;
}
for (int i = 0; m_GOPList[i].m_POC != -1 && i < MAX_GOP + 1; i++)
{
m_RPLList0[i].m_POC = m_RPLList1[i].m_POC = m_GOPList[i].m_POC;
m_RPLList0[i].m_temporalId = m_RPLList1[i].m_temporalId = m_GOPList[i].m_temporalId;
m_RPLList0[i].m_refPic = m_RPLList1[i].m_refPic = m_GOPList[i].m_refPic;
m_RPLList0[i].m_sliceType = m_RPLList1[i].m_sliceType = m_GOPList[i].m_sliceType;
m_RPLList0[i].m_isEncoded = m_RPLList1[i].m_isEncoded = m_GOPList[i].m_isEncoded;
m_RPLList0[i].m_numRefPicsActive = m_GOPList[i].m_numRefPicsActive0;
m_RPLList1[i].m_numRefPicsActive = m_GOPList[i].m_numRefPicsActive1;
m_RPLList0[i].m_numRefPics = m_GOPList[i].m_numRefPics0;
m_RPLList1[i].m_numRefPics = m_GOPList[i].m_numRefPics1;
Philip Cowan
committed
m_RPLList0[i].m_ltrp_in_slice_header_flag = m_GOPList[i].m_ltrp_in_slice_header_flag;
m_RPLList1[i].m_ltrp_in_slice_header_flag = m_GOPList[i].m_ltrp_in_slice_header_flag;
for (int j = 0; j < m_GOPList[i].m_numRefPics0; j++)
m_RPLList0[i].m_deltaRefPics[j] = m_GOPList[i].m_deltaRefPics0[j];
for (int j = 0; j < m_GOPList[i].m_numRefPics1; j++)
m_RPLList1[i].m_deltaRefPics[j] = m_GOPList[i].m_deltaRefPics1[j];
}
for (int i = 0; i < m_iGOPSize; i++)
{
m_GOPList[i].m_POC *= 2;
m_RPLList0[i].m_POC *= 2;
m_RPLList1[i].m_POC *= 2;
for (int j = 0; j < m_RPLList0[i].m_numRefPics; j++)
{
m_RPLList0[i].m_deltaRefPics[j] *= 2;
}
for (int j = 0; j < m_RPLList1[i].m_numRefPics; j++)
{
m_RPLList1[i].m_deltaRefPics[j] *= 2;
}
}
}

Karsten Suehring
committed
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
for (list<const char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
{
msg( ERROR, "Unhandled argument ignored: `%s'\n", *it);
}
if (argc == 1 || do_help)
{
/* argc == 1: no options have been specified */
po::doHelp(cout, opts);
return false;
}
if (err.is_errored)
{
if (!warnUnknowParameter)
{
/* error report has already been printed on stderr */
return false;
}
}
g_verbosity = MsgLevel( m_verbosity );
/*
* Set any derived parameters
*/
#if EXTENSION_360_VIDEO
m_inputFileWidth = m_iSourceWidth;
m_inputFileHeight = m_iSourceHeight;
m_ext360.setMaxCUInfo(m_uiCTUSize, 1 << MIN_CU_LOG2);
#endif
if (!inputPathPrefix.empty() && inputPathPrefix.back() != '/' && inputPathPrefix.back() != '\\' )
{
inputPathPrefix += "/";
}
m_inputFileName = inputPathPrefix + m_inputFileName;
if( m_temporalSubsampleRatio < 1)
{
EXIT ( "Error: TemporalSubsampleRatio must be greater than 0" );
}

Karsten Suehring
committed
m_framesToBeEncoded = ( m_framesToBeEncoded + m_temporalSubsampleRatio - 1 ) / m_temporalSubsampleRatio;
m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values;
if(m_isField)
{
//Frame height
m_iSourceHeightOrg = m_iSourceHeight;
//Field height
m_iSourceHeight = m_iSourceHeight >> 1;
//number of fields to encode
m_framesToBeEncoded *= 2;
}
Kui Fan
committed
if ( m_subPicInfoPresentFlag )
CHECK( m_numSubPics > MAX_NUM_SUB_PICS || m_numSubPics < 1, "Number of subpicture must be within 1 to 2^16" );
CHECK( cfg_subPicCtuTopLeftX.values.size() != m_numSubPics, "Number of SubPicCtuTopLeftX values must be equal to NumSubPics");
CHECK( cfg_subPicCtuTopLeftY.values.size() != m_numSubPics, "Number of SubPicCtuTopLeftY values must be equal to NumSubPics");
CHECK( cfg_subPicWidth.values.size() != m_numSubPics, "Number of SubPicWidth values must be equal to NumSubPics");
CHECK( cfg_subPicHeight.values.size() != m_numSubPics, "Number of SubPicHeight values must be equal to NumSubPics");
CHECK( cfg_subPicTreatedAsPicFlag.values.size() != m_numSubPics, "Number of SubPicTreatedAsPicFlag values must be equal to NumSubPics");
CHECK( cfg_loopFilterAcrossSubpicEnabledFlag.values.size() != m_numSubPics, "Number of LoopFilterAcrossSubpicEnabledFlag values must be equal to NumSubPics");
if (m_subPicIdMappingExplicitlySignalledFlag)
{
CHECK( cfg_subPicId.values.size() != m_numSubPics, "Number of SubPicId values must be equal to NumSubPics");
}
m_subPicCtuTopLeftX = cfg_subPicCtuTopLeftX.values;
m_subPicCtuTopLeftY = cfg_subPicCtuTopLeftY.values;
m_subPicWidth = cfg_subPicWidth.values;
m_subPicHeight = cfg_subPicHeight.values;
m_subPicTreatedAsPicFlag = cfg_subPicTreatedAsPicFlag.values;
m_loopFilterAcrossSubpicEnabledFlag = cfg_loopFilterAcrossSubpicEnabledFlag.values;
if (m_subPicIdMappingExplicitlySignalledFlag)
LI JINGYA
committed
{
for (int i=0; i < m_numSubPics; i++)
{
m_subPicId[i] = cfg_subPicId.values[i];
}
for(int i = 0; i < m_numSubPics; i++)
Kui Fan
committed
{
CHECK(m_subPicCtuTopLeftX[i] + m_subPicWidth[i] > (m_iSourceWidth + m_uiCTUSize - 1) / m_uiCTUSize, "Subpicture must not exceed picture boundary");
CHECK(m_subPicCtuTopLeftY[i] + m_subPicHeight[i] > (m_iSourceHeight + m_uiCTUSize - 1) / m_uiCTUSize, "Subpicture must not exceed picture boundary");
}
// automatically determine subpicture ID lenght in case it is not specified
if (m_subPicIdLen == 0)
LI JINGYA
committed
{
if (m_subPicIdMappingExplicitlySignalledFlag)
{
// use the heighest specified ID
auto maxIdVal = std::max_element(m_subPicId.begin(),m_subPicId.end());
m_subPicIdLen = ceilLog2(*maxIdVal);
}
else
LI JINGYA
committed
{
// use the number of subpictures
m_subPicIdLen = ceilLog2(m_numSubPics);
CHECK( m_subPicIdLen > 16, "SubPicIdLen must not exceed 16 bits" );
CHECK( m_rprEnabled, "RPR and subpictures cannot be enabled together" );
if (m_cfgSubpictureLevelInfoSEI.m_enabled)
{
CHECK (m_numSubPics != m_cfgSubpictureLevelInfoSEI.m_numSubpictures, "NumSubPics must be equal to SEISubpicLevelInfoNumSubpics" );
if (m_cfgSubpictureLevelInfoSEI.m_explicitFraction)
{
m_cfgSubpictureLevelInfoSEI.m_fractions = cfg_sliFractions.values;
m_cfgSubpictureLevelInfoSEI.m_refLevels = cfg_sliRefLevels.values;
CHECK (cfg_sliRefLevels.values.size() * m_cfgSubpictureLevelInfoSEI.m_numSubpictures != cfg_sliFractions.values.size(), "Number of subpicture level fractions must be equal to the numer of subpictures times the number of reference levels.");
}
}
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
if( m_picPartitionFlag )
{
// store tile column widths
m_tileColumnWidth.resize(cfgTileColumnWidth.values.size());
for(uint32_t i=0; i<cfgTileColumnWidth.values.size(); i++)
{
m_tileColumnWidth[i]=cfgTileColumnWidth.values[i];
}
// store tile row heights
m_tileRowHeight.resize(cfgTileRowHeight.values.size());
for(uint32_t i=0; i<cfgTileRowHeight.values.size(); i++)
{
m_tileRowHeight[i]=cfgTileRowHeight.values[i];
}
// store rectangular slice positions
if( !m_rasterSliceFlag )
{
m_rectSlicePos.resize(cfgRectSlicePos.values.size());
for(uint32_t i=0; i<cfgRectSlicePos.values.size(); i++)
{
m_rectSlicePos[i]=cfgRectSlicePos.values[i];
}
}
// store raster-scan slice sizes
else
{
m_rasterSliceSize.resize(cfgRasterSliceSize.values.size());
for(uint32_t i=0; i<cfgRasterSliceSize.values.size(); i++)
{
m_rasterSliceSize[i]=cfgRasterSliceSize.values[i];
}
}
}
else
{
m_tileColumnWidth.clear();
m_tileRowHeight.clear();
m_rectSlicePos.clear();
m_rasterSliceSize.clear();
m_rectSliceFixedWidth = 0;
m_rectSliceFixedHeight = 0;
}
m_numSubProfile = (uint8_t) cfg_SubProfile.values.size();
m_subProfile.resize(m_numSubProfile);
for (uint8_t i = 0; i < m_numSubProfile; ++i)
{
m_subProfile[i] = cfg_SubProfile.values[i];
}

Karsten Suehring
committed
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
/* rules for input, output and internal bitdepths as per help text */
if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] == 0)
{
m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] = m_inputBitDepth [CHANNEL_TYPE_LUMA ];
}
if (m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] == 0)
{
m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] = m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ];
}
if (m_internalBitDepth [CHANNEL_TYPE_LUMA ] == 0)
{
m_internalBitDepth [CHANNEL_TYPE_LUMA ] = m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ];
}
m_internalBitDepth [CHANNEL_TYPE_CHROMA] = m_internalBitDepth [CHANNEL_TYPE_LUMA ];
if (m_inputBitDepth [CHANNEL_TYPE_CHROMA] == 0)
{
m_inputBitDepth [CHANNEL_TYPE_CHROMA] = m_inputBitDepth [CHANNEL_TYPE_LUMA ];
}
if (m_outputBitDepth [CHANNEL_TYPE_LUMA ] == 0)
{
m_outputBitDepth [CHANNEL_TYPE_LUMA ] = m_internalBitDepth [CHANNEL_TYPE_LUMA ];
}
if (m_outputBitDepth [CHANNEL_TYPE_CHROMA] == 0)
{
m_outputBitDepth [CHANNEL_TYPE_CHROMA] = m_outputBitDepth [CHANNEL_TYPE_LUMA ];
}
if( !m_entropyCodingSyncEnabledFlag )
{
m_entropyCodingSyncEntryPointPresentFlag = false;
}

Karsten Suehring
committed
m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat);
m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
#if EXTENSION_360_VIDEO
m_ext360.processOptions(ext360CfgContext);
#endif
CHECK( !( tmpWeightedPredictionMethod >= 0 && tmpWeightedPredictionMethod <= WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION ), "Error in cfg" );
m_weightedPredictionMethod = WeightedPredictionMethod(tmpWeightedPredictionMethod);
CHECK( tmpFastInterSearchMode<0 || tmpFastInterSearchMode>FASTINTERSEARCH_MODE3, "Error in cfg" );
m_fastInterSearchMode = FastInterSearchMode(tmpFastInterSearchMode);
CHECK( tmpMotionEstimationSearchMethod < 0 || tmpMotionEstimationSearchMethod >= MESEARCH_NUMBER_OF_METHODS, "Error in cfg" );
m_motionEstimationSearchMethod=MESearchMethod(tmpMotionEstimationSearchMethod);
if (extendedProfile == ExtendedProfileName::AUTO)
{
if (xAutoDetermineProfile())
{
EXIT( "Unable to determine profile from configured settings");
}
}

Karsten Suehring
committed
else
{
m_profile = Profile::Name(extendedProfile);
}
{
m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? m_chromaFormatIDC : numberToChromaFormat(tmpConstraintChromaFormat);
if (m_bitDepthConstraint == 0)
{
if (m_profile == Profile::MAIN_10 || m_profile == Profile::MAIN_444_10)
{
m_bitDepthConstraint = 10;
}
else // m_profile == Profile::NONE
{
m_bitDepthConstraint = 8+15; // max value - unconstrained.
}
}
}

Karsten Suehring
committed
m_inputColourSpaceConvert = stringToInputColourSpaceConvert(inputColourSpaceConvert, true);
m_rgbFormat = (m_inputColourSpaceConvert == IPCOLOURSPACE_RGBtoGBR && m_chromaFormatIDC == CHROMA_444) ? true : false;

Karsten Suehring
committed
Jonatan Samuelsson-Allendes
committed
// Picture width and height must be multiples of 8 and minCuSize
const int minResolutionMultiple = std::max(8, 1 << m_log2MinCuSize);
CHECK(((m_iSourceWidth% minResolutionMultiple) || (m_iSourceHeight % minResolutionMultiple)) && m_conformanceWindowMode != 1, "Picture width or height is not a multiple of 8 or minCuSize, please use ConformanceMode 1!");

Karsten Suehring
committed
switch (m_conformanceWindowMode)
{
case 0:
{
// no conformance or padding
m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
m_aiPad[1] = m_aiPad[0] = 0;
break;
}
case 1:
{
// automatic padding to minimum CU size
Jonatan Samuelsson-Allendes
committed
if (m_iSourceWidth % minResolutionMultiple)
{
m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minResolutionMultiple) + 1) * minResolutionMultiple - m_iSourceWidth;
m_iSourceWidth += m_confWinRight;
}
if (m_iSourceHeight % minResolutionMultiple)
{
m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minResolutionMultiple) + 1) * minResolutionMultiple - m_iSourceHeight;

Karsten Suehring
committed
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
m_iSourceHeight += m_confWinBottom;
if ( m_isField )
{
m_iSourceHeightOrg += m_confWinBottom << 1;
m_aiPad[1] = m_confWinBottom << 1;
}
}
if (m_aiPad[0] % SPS::getWinUnitX(m_chromaFormatIDC) != 0)
{
EXIT( "Error: picture width is not an integer multiple of the specified chroma subsampling");
}
if (m_aiPad[1] % SPS::getWinUnitY(m_chromaFormatIDC) != 0)
{
EXIT( "Error: picture height is not an integer multiple of the specified chroma subsampling");
}
break;
}
case 2:
{
//padding
m_iSourceWidth += m_aiPad[0];
m_iSourceHeight += m_aiPad[1];
m_confWinRight = m_aiPad[0];
m_confWinBottom = m_aiPad[1];
break;
}
case 3:
{
// conformance
if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0))
{
msg( ERROR, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n");
}
if ((m_aiPad[1] != 0) || (m_aiPad[0]!=0))
{
msg( ERROR, "Warning: Conformance window enabled, padding parameters will be ignored\n");
}
m_aiPad[1] = m_aiPad[0] = 0;
break;
}
}

Karsten Suehring
committed
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
if (tmpDecodedPictureHashSEIMappedType<0 || tmpDecodedPictureHashSEIMappedType>=int(NUMBER_OF_HASHTYPES))
{
EXIT( "Error: bad checksum mode");
}
// Need to map values to match those of the SEI message:
if (tmpDecodedPictureHashSEIMappedType==0)
{
m_decodedPictureHashSEIType=HASHTYPE_NONE;
}
else
{
m_decodedPictureHashSEIType=HashType(tmpDecodedPictureHashSEIMappedType-1);
}
// allocate slice-based dQP values
m_aidQP = new int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
::memset( m_aidQP, 0, sizeof(int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) );
#if QP_SWITCHING_FOR_PARALLEL
if (m_qpIncrementAtSourceFrame.bPresent)
{
uint32_t switchingPOC = 0;
if (m_qpIncrementAtSourceFrame.value > m_FrameSkip)
{
// if switch source frame (ssf) = 10, and frame skip (fs)=2 and temporal subsample ratio (tsr) =1, then
// for this simulation switch at POC 8 (=10-2).
// if ssf=10, fs=2, tsr=2, then for this simulation, switch at POC 4 (=(10-2)/2): POC0=Src2, POC1=Src4, POC2=Src6, POC3=Src8, POC4=Src10
switchingPOC = (m_qpIncrementAtSourceFrame.value - m_FrameSkip) / m_temporalSubsampleRatio;
}
for (uint32_t i = switchingPOC; i<(m_framesToBeEncoded + m_iGOPSize + 1); i++)
{
m_aidQP[i] = 1;
}
}
#else
// handling of floating-point QP values
// if QP is not integer, sequence is split into two sections having QP and QP+1
m_iQP = (int)( m_fQP );
if ( m_iQP < m_fQP )
{
int iSwitchPOC = (int)( m_framesToBeEncoded - (m_fQP - m_iQP)*m_framesToBeEncoded + 0.5 );
iSwitchPOC = (int)( (double)iSwitchPOC / m_iGOPSize + 0.5 )*m_iGOPSize;
for ( int i=iSwitchPOC; i<m_framesToBeEncoded + m_iGOPSize + 1; i++ )
{
m_aidQP[i] = 1;
}
}
#endif
#if SHARP_LUMA_DELTA_QP
CHECK( lumaLevelToDeltaQPMode >= LUMALVL_TO_DQP_NUM_MODES, "Error in cfg" );
m_lumaLevelToDeltaQPMapping.mode=LumaLevelToDQPMode(lumaLevelToDeltaQPMode);
if (m_lumaLevelToDeltaQPMapping.mode)
{
CHECK( cfg_lumaLeveltoDQPMappingLuma.values.size() != cfg_lumaLeveltoDQPMappingQP.values.size(), "Error in cfg" );
m_lumaLevelToDeltaQPMapping.mapping.resize(cfg_lumaLeveltoDQPMappingLuma.values.size());
for(uint32_t i=0; i<cfg_lumaLeveltoDQPMappingLuma.values.size(); i++)
{
m_lumaLevelToDeltaQPMapping.mapping[i]=std::pair<int,int>(cfg_lumaLeveltoDQPMappingLuma.values[i], cfg_lumaLeveltoDQPMappingQP.values[i]);
}
}
#endif
Adarsh Krishnan Ramasubramonian
committed
CHECK(cfg_qpInValCb.values.size() != cfg_qpOutValCb.values.size(), "Chroma QP table for Cb is incomplete.");
CHECK(cfg_qpInValCr.values.size() != cfg_qpOutValCr.values.size(), "Chroma QP table for Cr is incomplete.");
CHECK(cfg_qpInValCbCr.values.size() != cfg_qpOutValCbCr.values.size(), "Chroma QP table for CbCr is incomplete.");

Christian Helmrich
committed
if (m_useIdentityTableForNon420Chroma && m_chromaFormatIDC != CHROMA_420)
Adarsh Krishnan Ramasubramonian
committed
{
m_chromaQpMappingTableParams.m_sameCQPTableForAllChromaFlag = true;
cfg_qpInValCb.values = { 26 };
cfg_qpInValCr.values = { 26 };
cfg_qpInValCbCr.values = { 26 };
cfg_qpOutValCb.values = { 26 };
cfg_qpOutValCr.values = { 26 };
cfg_qpOutValCbCr.values = { 26 };
Adarsh Krishnan Ramasubramonian
committed
}
// Need to have at least 2 points in the set. Add second one if only one given
if (cfg_qpInValCb.values.size() == 1)
{
cfg_qpInValCb.values.push_back(cfg_qpInValCb.values[0] + 1);
cfg_qpOutValCb.values.push_back(cfg_qpOutValCb.values[0] + 1);
}
if (cfg_qpInValCr.values.size() == 1)
{
cfg_qpInValCr.values.push_back(cfg_qpInValCr.values[0] + 1);
cfg_qpOutValCr.values.push_back(cfg_qpOutValCr.values[0] + 1);
}
if (cfg_qpInValCbCr.values.size() == 1)
{
cfg_qpInValCbCr.values.push_back(cfg_qpInValCbCr.values[0] + 1);
cfg_qpOutValCbCr.values.push_back(cfg_qpOutValCbCr.values[0] + 1);
}
int qpBdOffsetC = 6 * (m_internalBitDepth[CHANNEL_TYPE_CHROMA] - 8);
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[0].resize(cfg_qpInValCb.values.size());
m_chromaQpMappingTableParams.m_deltaQpOutVal[0].resize(cfg_qpOutValCb.values.size());
m_chromaQpMappingTableParams.m_numPtsInCQPTableMinus1[0] = (int) cfg_qpOutValCb.values.size() - 2;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] = -26 + cfg_qpInValCb.values[0];
CHECK(m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] < -26 - qpBdOffsetC || m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] > 36, "qpTableStartMinus26[0] is out of valid range of -26 -qpBdOffsetC to 36, inclusive.")
CHECK(cfg_qpInValCb.values[0] != cfg_qpOutValCb.values[0], "First qpInValCb value should be equal to first qpOutValCb value");
Tangi Poirier
committed
for (int i = 0; i < cfg_qpInValCb.values.size() - 1; i++)
Adarsh Krishnan Ramasubramonian
committed
{
CHECK(cfg_qpInValCb.values[i] < -qpBdOffsetC || cfg_qpInValCb.values[i] > MAX_QP, "Some entries cfg_qpInValCb are out of valid range of -qpBdOffsetC to 63, inclusive.");
CHECK(cfg_qpOutValCb.values[i] < -qpBdOffsetC || cfg_qpOutValCb.values[i] > MAX_QP, "Some entries cfg_qpOutValCb are out of valid range of -qpBdOffsetC to 63, inclusive.");
Tangi Poirier
committed
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[0][i] = cfg_qpInValCb.values[i + 1] - cfg_qpInValCb.values[i] - 1;
m_chromaQpMappingTableParams.m_deltaQpOutVal[0][i] = cfg_qpOutValCb.values[i + 1] - cfg_qpOutValCb.values[i];
Adarsh Krishnan Ramasubramonian
committed
}
if (!m_chromaQpMappingTableParams.m_sameCQPTableForAllChromaFlag)
Adarsh Krishnan Ramasubramonian
committed
{
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[1].resize(cfg_qpInValCr.values.size());
m_chromaQpMappingTableParams.m_deltaQpOutVal[1].resize(cfg_qpOutValCr.values.size());
m_chromaQpMappingTableParams.m_numPtsInCQPTableMinus1[1] = (int) cfg_qpOutValCr.values.size() - 2;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] = -26 + cfg_qpInValCr.values[0];
CHECK(m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] < -26 - qpBdOffsetC || m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] > 36, "qpTableStartMinus26[1] is out of valid range of -26 -qpBdOffsetC to 36, inclusive.")
CHECK(cfg_qpInValCr.values[0] != cfg_qpOutValCr.values[0], "First qpInValCr value should be equal to first qpOutValCr value");
Tangi Poirier
committed
for (int i = 0; i < cfg_qpInValCr.values.size() - 1; i++)
Adarsh Krishnan Ramasubramonian
committed
{
CHECK(cfg_qpInValCr.values[i] < -qpBdOffsetC || cfg_qpInValCr.values[i] > MAX_QP, "Some entries cfg_qpInValCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
CHECK(cfg_qpOutValCr.values[i] < -qpBdOffsetC || cfg_qpOutValCr.values[i] > MAX_QP, "Some entries cfg_qpOutValCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
Tangi Poirier
committed
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[1][i] = cfg_qpInValCr.values[i + 1] - cfg_qpInValCr.values[i] - 1;
m_chromaQpMappingTableParams.m_deltaQpOutVal[1][i] = cfg_qpOutValCr.values[i + 1] - cfg_qpOutValCr.values[i];
Adarsh Krishnan Ramasubramonian
committed
}
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[2].resize(cfg_qpInValCbCr.values.size());
m_chromaQpMappingTableParams.m_deltaQpOutVal[2].resize(cfg_qpOutValCbCr.values.size());
m_chromaQpMappingTableParams.m_numPtsInCQPTableMinus1[2] = (int) cfg_qpOutValCbCr.values.size() - 2;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] = -26 + cfg_qpInValCbCr.values[0];
CHECK(m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] < -26 - qpBdOffsetC || m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] > 36, "qpTableStartMinus26[2] is out of valid range of -26 -qpBdOffsetC to 36, inclusive.")
CHECK(cfg_qpInValCbCr.values[0] != cfg_qpInValCbCr.values[0], "First qpInValCbCr value should be equal to first qpOutValCbCr value");
Tangi Poirier
committed
for (int i = 0; i < cfg_qpInValCbCr.values.size() - 1; i++)
Adarsh Krishnan Ramasubramonian
committed
{
CHECK(cfg_qpInValCbCr.values[i] < -qpBdOffsetC || cfg_qpInValCbCr.values[i] > MAX_QP, "Some entries cfg_qpInValCbCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
CHECK(cfg_qpOutValCbCr.values[i] < -qpBdOffsetC || cfg_qpOutValCbCr.values[i] > MAX_QP, "Some entries cfg_qpOutValCbCr are out of valid range of -qpBdOffsetC to 63, inclusive.");
Tangi Poirier
committed
m_chromaQpMappingTableParams.m_deltaQpInValMinus1[2][i] = cfg_qpInValCbCr.values[i + 1] - cfg_qpInValCbCr.values[i] - 1;
m_chromaQpMappingTableParams.m_deltaQpOutVal[2][i] = cfg_qpInValCbCr.values[i + 1] - cfg_qpInValCbCr.values[i];
Adarsh Krishnan Ramasubramonian
committed
}
}

Karsten Suehring
committed
Shunsuke Iwamura
committed
#if LUMA_ADAPTIVE_DEBLOCKING_FILTER_QP_OFFSET
if ( m_LadfEnabed )
{
CHECK( m_LadfNumIntervals != cfg_LadfQpOffset.values.size(), "size of LadfQpOffset must be equal to LadfNumIntervals");
CHECK( m_LadfNumIntervals - 1 != cfg_LadfIntervalLowerBound.values.size(), "size of LadfIntervalLowerBound must be equal to LadfNumIntervals - 1");
m_LadfQpOffset = cfg_LadfQpOffset.values;
m_LadfIntervalLowerBound[0] = 0;
Shunsuke Iwamura
committed
for (int k = 1; k < m_LadfNumIntervals; k++)
{
m_LadfIntervalLowerBound[k] = cfg_LadfIntervalLowerBound.values[k - 1];
}
}
#endif
#if JVET_O0756_CONFIG_HDRMETRICS && !JVET_O0756_CALCULATE_HDRMETRICS
if ( m_calculateHdrMetrics == true)
{
printf ("Warning: Configuration enables HDR metric calculations. However, HDR metric support was not linked when compiling the VTM.\n");
m_calculateHdrMetrics = false;
}
#endif
m_virtualBoundariesEnabledFlag = 0;
if( m_numVerVirtualBoundaries > 0 || m_numHorVirtualBoundaries > 0 )
m_virtualBoundariesEnabledFlag = 1;
if( m_virtualBoundariesEnabledFlag )
Sheng-Yen Lin
committed
{
CHECK( m_subPicInfoPresentFlag && m_virtualBoundariesPresentFlag != 1, "When subpicture signalling is present, the signalling of virtual boundaries, if present, shall be in the SPS" );
if( m_virtualBoundariesPresentFlag )
Sheng-Yen Lin
committed
{
CHECK( m_numVerVirtualBoundaries > 3, "Number of vertical virtual boundaries must be comprised between 0 and 3 included" );
CHECK( m_numHorVirtualBoundaries > 3, "Number of horizontal virtual boundaries must be comprised between 0 and 3 included" );
CHECK( m_numVerVirtualBoundaries != cfg_virtualBoundariesPosX.values.size(), "Size of VirtualBoundariesPosX must be equal to NumVerVirtualBoundaries");
CHECK( m_numHorVirtualBoundaries != cfg_virtualBoundariesPosY.values.size(), "Size of VirtualBoundariesPosY must be equal to NumHorVirtualBoundaries");
m_virtualBoundariesPosX = cfg_virtualBoundariesPosX.values;
if (m_numVerVirtualBoundaries > 1)
Sheng-Yen Lin
committed
{
sort(m_virtualBoundariesPosX.begin(), m_virtualBoundariesPosX.end());
Sheng-Yen Lin
committed
}
for (unsigned i = 0; i < m_numVerVirtualBoundaries; i++)
Sheng-Yen Lin
committed
{
CHECK( m_virtualBoundariesPosX[i] == 0 || m_virtualBoundariesPosX[i] >= m_iSourceWidth, "The vertical virtual boundary must be within the picture" );
CHECK( m_virtualBoundariesPosX[i] % 8, "The vertical virtual boundary must be a multiple of 8 luma samples" );
if (i > 0)
{
CHECK( m_virtualBoundariesPosX[i] - m_virtualBoundariesPosX[i-1] < m_uiCTUSize, "The distance between any two vertical virtual boundaries shall be greater than or equal to the CTU size" );
}
}
m_virtualBoundariesPosY = cfg_virtualBoundariesPosY.values;
if (m_numHorVirtualBoundaries > 1)
{
sort(m_virtualBoundariesPosY.begin(), m_virtualBoundariesPosY.end());
}
for (unsigned i = 0; i < m_numHorVirtualBoundaries; i++)
{
CHECK( m_virtualBoundariesPosY[i] == 0 || m_virtualBoundariesPosY[i] >= m_iSourceHeight, "The horizontal virtual boundary must be within the picture" );
CHECK( m_virtualBoundariesPosY[i] % 8, "The horizontal virtual boundary must be a multiple of 8 luma samples" );
if (i > 0)
{