Newer
Older
("LMCSInitialCW", m_initialCW, 0u, "LMCS initial total codeword (0~1023) when LMCSAdpOption > 0")
("LMCSOffset", m_CSoffset, 0, "LMCS chroma residual scaling offset")
("IntraCMD", m_intraCMD, 0u, "IntraChroma MD: 0: none, 1:fixed to default wPSNR weight")

Karsten Suehring
committed
("LCTUFast", m_useFastLCTU, false, "Fast methods for large CTU")
("FastMrg", m_useFastMrg, false, "Fast methods for inter merge")
("PBIntraFast", m_usePbIntraFast, false, "Fast assertion if the intra mode is probable")
("AMaxBT", m_useAMaxBT, false, "Adaptive maximal BT-size")
("E0023FastEnc", m_e0023FastEnc, true, "Fast encoding setting for QTBT (proposal E0023)")
("ContentBasedFastQtbt", m_contentBasedFastQtbt, false, "Signal based QTBT speed-up")
("UseNonLinearAlfLuma", m_useNonLinearAlfLuma, true, "Non-linear adaptive loop filters for Luma Channel")
("UseNonLinearAlfChroma", m_useNonLinearAlfChroma, true, "Non-linear adaptive loop filters for Chroma Channels")
("MaxNumAlfAlternativesChroma", m_maxNumAlfAlternativesChroma,
(unsigned)MAX_NUM_ALF_ALTERNATIVES_CHROMA, std::string("Maximum number of alternative Chroma filters (1-") + std::to_string(MAX_NUM_ALF_ALTERNATIVES_CHROMA) + std::string (", inclusive)") )
("MRL", m_MRL, false, "Enable MRL (multiple reference line intra prediction)")
("MIP", m_MIP, true, "Enable MIP (matrix-based intra prediction)")
Philipp Merkle
committed
("FastMIP", m_useFastMIP, false, "Fast encoder search for MIP (matrix-based intra prediction)")
("FastLocalDualTreeMode", m_fastLocalDualTreeMode, 0, "Fast intra pass coding for local dual-tree in intra coding region, 0: off, 1: use threshold, 2: one intra mode only")

Karsten Suehring
committed
// Unit definition parameters
("MaxCUWidth", m_uiMaxCUWidth, 64u)
("MaxCUHeight", m_uiMaxCUHeight, 64u)
// todo: remove defaults from MaxCUSize
("MaxCUSize,s", m_uiMaxCUWidth, 64u, "Maximum CU size")
("MaxCUSize,s", m_uiMaxCUHeight, 64u, "Maximum CU size")
("MaxPartitionDepth,h", m_uiMaxCUDepth, 4u, "CU depth")
("Log2MaxTbSize", m_log2MaxTbSize, 6, "Maximum transform block size in logarithm base 2 (Default: 6)")

Karsten Suehring
committed
// Coding structure paramters
("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)")
("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)")
("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure")
("DRAPPeriod", m_drapPeriod, 0, "DRAP period in frames (0: disable Dependent RAP indication SEI messages)")
("ReWriteParamSets", m_rewriteParamSets, false, "Enable rewriting of Parameter sets before every (intra) random access point")
("IDRRefParamList", m_idrRefParamList, false, "Enable indication of reference picture list syntax elements in slice headers of IDR pictures")

Karsten Suehring
committed
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
// motion search options
("DisableIntraInInter", m_bDisableIntraPUsInInterSlices, false, "Flag to disable intra PUs in inter slices")
("FastSearch", tmpMotionEstimationSearchMethod, int(MESEARCH_DIAMOND), "0:Full search 1:Diamond 2:Selective 3:Enhanced Diamond")
("SearchRange,-sr", m_iSearchRange, 96, "Motion search range")
("BipredSearchRange", m_bipredSearchRange, 4, "Motion search range for bipred refinement")
("MinSearchWindow", m_minSearchWindow, 8, "Minimum motion search window size for the adaptive window ME")
("RestrictMESampling", m_bRestrictMESampling, false, "Restrict ME Sampling for selective inter motion search")
("ClipForBiPredMEEnabled", m_bClipForBiPredMeEnabled, false, "Enables clipping in the Bi-Pred ME. It is disabled to reduce encoder run-time")
("FastMEAssumingSmootherMVEnabled", m_bFastMEAssumingSmootherMVEnabled, true, "Enables fast ME assuming a smoother MV.")
("HadamardME", m_bUseHADME, true, "Hadamard ME for fractional-pel")
("ASR", m_bUseASR, false, "Adaptive motion search range");
opts.addOptions()
// Mode decision parameters
("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( double )1.0, "Lambda modifier for temporal layer 0. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( double )1.0, "Lambda modifier for temporal layer 1. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( double )1.0, "Lambda modifier for temporal layer 2. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( double )1.0, "Lambda modifier for temporal layer 3. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifier4,-LM4", m_adLambdaModifier[ 4 ], ( double )1.0, "Lambda modifier for temporal layer 4. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( double )1.0, "Lambda modifier for temporal layer 5. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( double )1.0, "Lambda modifier for temporal layer 6. If LambdaModifierI is used, this will not affect intra pictures")
("LambdaModifierI,-LMI", cfg_adIntraLambdaModifier, cfg_adIntraLambdaModifier, "Lambda modifiers for Intra pictures, comma separated, up to one the number of temporal layer. If entry for temporalLayer exists, then use it, else if some are specified, use the last, else use the standard LambdaModifiers.")
("IQPFactor,-IQF", m_dIntraQpFactor, -1.0, "Intra QP Factor for Lambda Computation. If negative, the default will scale lambda based on GOP size (unless LambdaFromQpEnable then IntraQPOffset is used instead)")
/* Quantization parameters */
#if QP_SWITCHING_FOR_PARALLEL
("QP,q", m_iQP, 30, "Qp value")
("QPIncrementFrame,-qpif", m_qpIncrementAtSourceFrame, OptionalValue<uint32_t>(), "If a source file frame number is specified, the internal QP will be incremented for all POCs associated with source frames >= frame number. If empty, do not increment.")

Karsten Suehring
committed
#else
("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding")
#endif
#if X0038_LAMBDA_FROM_QP_CAPABILITY
("IntraQPOffset", m_intraQPOffset, 0, "Qp offset value for intra slice, typically determined based on GOP size")
("LambdaFromQpEnable", m_lambdaFromQPEnable, false, "Enable flag for derivation of lambda from QP")
#endif
("DeltaQpRD,-dqr", m_uiDeltaQpRD, 0u, "max dQp offset for slice")
("MaxDeltaQP,d", m_iMaxDeltaQP, 0, "max dQp offset for block")
("MaxCuDQPSubdiv,-dqd", m_cuQpDeltaSubdiv, 0, "Maximum subdiv for CU luma Qp adjustment")
("MaxCuChromaQpOffsetSubdiv", m_cuChromaQpOffsetSubdiv, -1, "Maximum subdiv for CU chroma Qp adjustment - set less than 0 to disable")

Karsten Suehring
committed
("FastDeltaQP", m_bFastDeltaQP, false, "Fast Delta QP Algorithm")
#if SHARP_LUMA_DELTA_QP
("LumaLevelToDeltaQPMode", lumaLevelToDeltaQPMode, 0u, "Luma based Delta QP 0(default): not used. 1: Based on CTU average, 2: Based on Max luma in CTU")
#if !WCG_EXT
("LumaLevelToDeltaQPMaxValWeight", m_lumaLevelToDeltaQPMapping.maxMethodWeight, 1.0, "Weight of block max luma val when LumaLevelToDeltaQPMode = 2")
#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
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
#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)
#if JVET_Q0121_DEBLOCKING_CONTROL_PARAMETERS
("LoopFilterCbBetaOffset_div2", m_loopFilterCbBetaOffsetDiv2, 0)
("LoopFilterCbTcOffset_div2", m_loopFilterCbTcOffsetDiv2, 0)
("LoopFilterCrBetaOffset_div2", m_loopFilterCrBetaOffsetDiv2, 0)
("LoopFilterCrTcOffset_div2", m_loopFilterCrTcOffsetDiv2, 0)
#endif

Karsten Suehring
committed
#if W0038_DB_OPT
("DeblockingFilterMetric", m_deblockingFilterMetric, 0)
#else
("DeblockingFilterMetric", m_DeblockingFilterMetric, false)
#endif
// Coding tools
("CrossComponentPrediction", m_crossComponentPredictionEnabledFlag, false, "Enable the use of cross-component prediction (not valid in V1 profiles)")
("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")
("SaoLumaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_LUMA], 0, "Specify the luma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
("SaoChromaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_CHROMA], 0, "Specify the chroma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
("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
#if JVET_Q0089_SLICE_LOSSLESS_CODING_CHROMA_BDPCM
("BDPCM", m_useBDPCM, false, "BDPCM (0:off, 1:luma and chroma)")
#else
("BDPCM", m_useBDPCM, 0, "BDPCM (0:off, 1:lumaonly, 2:lumachroma")
Alican Nalci
committed
#endif
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)")
("EnableSubPicPartitioning", m_subPicPartitionFlag, true, "Enable Sub-Picture partitioning (0: single slice per sub-picture, 1: multiple slices per sub-picture can be used)")

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")
#if JVET_Q0297_MER
("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region")
#endif

Karsten Suehring
committed
("WaveFrontSynchro", m_entropyCodingSyncEnabledFlag, false, "0: entropy coding sync disabled; 1 entropy coding sync enabled")
("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")
#if !JVET_Q0806
("MaxNumTriangleCand", m_maxNumTriangleCand, 5u, "Maximum number of triangle candidates")
#else
("MaxNumGeoCand", m_maxNumGeoCand, 5u, "Maximum number of geometric partitioning mode candidates")
#endif
("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")
("PPSorSliceMode", m_PPSorSliceMode, 0, "Enable signalling certain parameters either in PPS or per slice\n"
Martin Pettersson
committed
"\tmode 0: Always per slice (default), 1: RA settings, 2: LDB settings, 3: LDP settings")
("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")
#if HEVC_SEI

Karsten Suehring
committed
("SEIActiveParameterSets", m_activeParameterSetsSEIEnabled, 0, "Enable generation of active parameter sets SEI messages");
opts.addOptions()
#endif
("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()
#if HEVC_SEI

Karsten Suehring
committed
("SEIColourRemappingInfoFileRoot,-cri", m_colourRemapSEIFileRoot, string(""), "Colour Remapping Information SEI parameters root file name (wo num ext)")
("SEIRecoveryPoint", m_recoveryPointSEIEnabled, false, "Control generation of recovery point SEI messages")
#endif

Karsten Suehring
committed
("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.")
("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")
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
("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")
("SEIGcmpGuardBandBoundaryType", m_gcmpSEIGuardBandBoundaryType, false, "Indicate which face boundaries contain guard bands")
("SEIGcmpGuardBandSamplesMinus1", m_gcmpSEIGuardBandSamplesMinus1, 0u, "Specifies the number of guard band samples minus1 used in the cubemap projected picture")
("SEISubpicureLevelInfo", m_subpicureLevelInfoSEIEnabled, false, "Control generation of 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" )
#if JVET_Q0795_CCALF
( "CCALF", m_ccalf, true, "Cross-component Adaptive Loop Filter" )
( "CCALFQpTh", m_ccalfQpThreshold, 37, "QP threshold above which encoder reduces CCALF usage")
#endif
( "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" )
#if JVET_Q0814_DPB
( "TargetOutputLayerSet,p", m_targetOlsIdx, -1, "Target output layer set index" )
#endif
;
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")

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());
}

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;
}
Yago Sanchez de la Fuente
committed
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
1521
1522
1523
1524
1525
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
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
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 JVET_Q0119_CLEANUPS
if ( m_subPicInfoPresentFlag )
#else
Kui Fan
committed
#endif
{
CHECK( m_numSubPics > 255 || m_numSubPics < 1, "Number of subpicture must be within 1 to 255" );
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;
m_subPicId = cfg_subPicId.values;
LI JINGYA
committed
for(int i = 0; i < m_numSubPics; i++)
{
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");
}
Kui Fan
committed
#if JVET_Q0119_CLEANUPS
if (m_subPicIdMappingExplicitlySignalledFlag)
Kui Fan
committed
{
if (m_subPicIdMappingInSpsFlag)
#else
LI JINGYA
committed
if (m_subPicIdPresentFlag)
{
if (m_subPicIdSignallingPresentFlag)
Kui Fan
committed
#endif
LI JINGYA
committed
{
CHECK( m_subPicIdLen > 16, "sibpic ID length must not exceed 16 bits" );
}
}
#if JVET_Q0043_RPR_and_Subpics
CHECK( m_rprEnabled, "RPR and subpictures cannot be enabled together" );
#endif
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
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];
}
if (m_subPicPartitionFlag)
{
m_singleSlicePerSubPicFlag = false;
}
else
{
m_singleSlicePerSubPicFlag = true;
}

Karsten Suehring
committed
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
/* 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 ];
}
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
1787
1788
1789
1790
1791
1792
1793
1794
1795
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
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
int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);
if (m_iSourceWidth % minCuSize)
{
m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
m_iSourceWidth += m_confWinRight;
}
if (m_iSourceHeight % minCuSize)
{
m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
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
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
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
for(uint32_t ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
{
if (saoOffsetBitShift[ch]<0)
{
if (m_internalBitDepth[ch]>10)
{
m_log2SaoOffsetScale[ch]=uint32_t(Clip3<int>(0, m_internalBitDepth[ch]-10, int(m_internalBitDepth[ch]-10 + 0.165*m_iQP - 3.22 + 0.5) ) );
}
else
{
m_log2SaoOffsetScale[ch]=0;
}
}
else
{
m_log2SaoOffsetScale[ch]=uint32_t(saoOffsetBitShift[ch]);
}
}
#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;
Adarsh Krishnan Ramasubramonian
committed
cfg_qpInValCb.values = { 0 };
cfg_qpInValCr.values = { 0 };
cfg_qpInValCbCr.values = { 0 };
Adarsh Krishnan Ramasubramonian
committed
cfg_qpOutValCb.values = { 0 };
cfg_qpOutValCr.values = { 0 };
cfg_qpOutValCbCr.values = { 0 };
Adarsh Krishnan Ramasubramonian
committed
}
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] = (cfg_qpOutValCb.values.size() > 1) ? (int)cfg_qpOutValCb.values.size() - 2 : 0;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[0] = (cfg_qpOutValCb.values.size() > 1) ? -26 + cfg_qpInValCb.values[0] : 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] = (cfg_qpOutValCr.values.size() > 1) ? (int)cfg_qpOutValCr.values.size() - 2 : 0;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[1] = (cfg_qpOutValCr.values.size() > 1) ? -26 + cfg_qpInValCr.values[0] : 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] = (cfg_qpOutValCbCr.values.size() > 1) ? (int)cfg_qpOutValCbCr.values.size() - 2 : 0;
m_chromaQpMappingTableParams.m_qpTableStartMinus26[2] = (cfg_qpOutValCbCr.values.size() > 1) ? -26 + cfg_qpInValCbCr.values[0] : 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;