22 #ifndef AVCODEC_OPTIONS_TABLE_H
23 #define AVCODEC_OPTIONS_TABLE_H
33 #define OFFSET(x) offsetof(AVCodecContext,x)
34 #define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
36 #define V AV_OPT_FLAG_VIDEO_PARAM
37 #define A AV_OPT_FLAG_AUDIO_PARAM
38 #define S AV_OPT_FLAG_SUBTITLE_PARAM
39 #define E AV_OPT_FLAG_ENCODING_PARAM
40 #define D AV_OPT_FLAG_DECODING_PARAM
42 #define AV_CODEC_DEFAULT_BITRATE 200*1000
47 {
"bt",
"Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far "
48 "ratecontrol is willing to deviate from the target average bitrate value. This is not related "
49 "to minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality.",
57 {
"mv0",
"always try a mb with mv=<0,0>", 0,
AV_OPT_TYPE_CONST, {.i64 =
CODEC_FLAG_MV0 }, INT_MIN, INT_MAX,
V|
E,
"flags"},
71 #if FF_API_MPV_GLOBAL_OPTS
72 {
"cbp",
"Deprecated, use mpegvideo private options instead", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX,
V|
E,
"flags"},
73 {
"qprd",
"Deprecated, use mpegvideo private options instead", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX,
V|
E,
"flags"},
78 #if FF_API_MPV_GLOBAL_OPTS
79 {
"sgop",
"Deprecated, use mpegvideo private options instead", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX,
V|
E,
"flags2"},
92 {
"esa",
"esa motion estimation (alias for full)", 0,
AV_OPT_TYPE_CONST, {.i64 =
ME_FULL }, INT_MIN, INT_MAX,
V|
E,
"me_method" },
94 {
"dia",
"diamond motion estimation (alias for EPZS)", 0,
AV_OPT_TYPE_CONST, {.i64 =
ME_EPZS }, INT_MIN, INT_MAX,
V|
E,
"me_method" },
103 {
"g",
"set the group of picture (GOP) size",
OFFSET(gop_size),
AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX,
V|
E},
110 {
"qcomp",
"video quantizer scale compression (VBR). Constant of ratecontrol equation. "
111 "Recommended range for default rc_eq: 0.0-1.0",
116 {
"qdiff",
"maximum difference between the quantizer scales (VBR)",
OFFSET(max_qdiff),
AV_OPT_TYPE_INT, {.i64 = 3 }, INT_MIN, INT_MAX,
V|
E},
118 {
"b_qfactor",
"QP factor between P- and B-frames",
OFFSET(b_quant_factor),
AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX,
V|
E},
120 {
"b_strategy",
"strategy to choose between I/P/B-frames",
OFFSET(b_frame_strategy),
AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX,
V|
E},
147 {
"ms",
"work around various bugs in Microsoft's broken decoders", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_BUG_MS }, INT_MIN, INT_MAX,
V|
D,
"bug"},
149 #if FF_API_MPV_GLOBAL_OPTS
150 {
"lelim",
"single coefficient elimination threshold for luminance (negative values also consider DC coefficient)",
OFFSET(luma_elim_threshold),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E},
151 {
"celim",
"single coefficient elimination threshold for chrominance (negative values also consider DC coefficient)",
OFFSET(chroma_elim_threshold),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E},
159 {
"b_qoffset",
"QP offset between P- and B-frames",
OFFSET(b_quant_offset),
AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX,
V|
E},
165 {
"careful",
"consider things that violate the spec and have not been seen in the wild as errors", 0,
AV_OPT_TYPE_CONST, {.i64 =
AV_EF_CAREFUL }, INT_MIN, INT_MAX,
A|
V|
D,
"err_detect"},
171 {
"qsquish",
"how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)",
OFFSET(rc_qsquish),
AV_OPT_TYPE_FLOAT, {.dbl =
DEFAULT }, 0, 99,
V|
E},
175 {
"rc_eq",
"Set rate control equation. When computing the expression, besides the standard functions "
176 "defined in the section 'Expression Evaluation', the following functions are available: "
177 "bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv "
178 "fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.",
180 {
"maxrate",
"Set maximum bitrate tolerance (in bits/s). Requires bufsize to be set.",
OFFSET(rc_max_rate),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
A|
E},
181 {
"minrate",
"Set minimum bitrate tolerance (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise.",
184 {
"rc_buf_aggressivity",
"currently useless",
OFFSET(rc_buffer_aggressivity),
AV_OPT_TYPE_FLOAT, {.dbl = 1.0 }, -FLT_MAX, FLT_MAX,
V|
E},
185 {
"i_qfactor",
"QP factor between P- and I-frames",
OFFSET(i_quant_factor),
AV_OPT_TYPE_FLOAT, {.dbl = -0.8 }, -FLT_MAX, FLT_MAX,
V|
E},
186 {
"i_qoffset",
"QP offset between P- and I-frames",
OFFSET(i_quant_offset),
AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, -FLT_MAX, FLT_MAX,
V|
E},
195 {
"lumi_mask",
"compresses bright areas stronger than medium ones",
OFFSET(lumi_masking),
AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX,
V|
E},
196 {
"tcplx_mask",
"temporal complexity masking",
OFFSET(temporal_cplx_masking),
AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX,
V|
E},
197 {
"scplx_mask",
"spatial complexity masking",
OFFSET(spatial_cplx_masking),
AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX,
V|
E},
199 {
"dark_mask",
"compresses dark areas stronger than medium ones",
OFFSET(dark_masking),
AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX,
V|
E},
246 {
"vis_qp",
"visualize quantization parameter (QP), lower QP are tinted greener", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_DEBUG_VIS_QP }, INT_MIN, INT_MAX,
V|
D,
"debug"},
259 {
"last_pred",
"amount of motion predictors from the previous frame",
OFFSET(last_predictor_count),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E},
262 {
"sad",
"sum of absolute differences, fast (default)", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_CMP_SAD }, INT_MIN, INT_MAX,
V|
E,
"cmp_func"},
266 {
"psnr",
"sum of squared quantization errors (avoid, low quality)", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_CMP_PSNR }, INT_MIN, INT_MAX,
V|
E,
"cmp_func"},
268 {
"rd",
"rate distortion optimal, slow", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_CMP_RD }, INT_MIN, INT_MAX,
V|
E,
"cmp_func"},
273 #if CONFIG_SNOW_ENCODER
274 {
"w53",
"5/3 wavelet, only used in snow", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_CMP_W53 }, INT_MIN, INT_MAX,
V|
E,
"cmp_func"},
275 {
"w97",
"9/7 wavelet, only used in snow", 0,
AV_OPT_TYPE_CONST, {.i64 =
FF_CMP_W97 }, INT_MIN, INT_MAX,
V|
E,
"cmp_func"},
279 {
"pre_dia_size",
"diamond type & size for motion estimation pre-pass",
OFFSET(pre_dia_size),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E},
280 {
"subq",
"sub-pel motion estimation quality",
OFFSET(me_subpel_quality),
AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX,
V|
E},
285 #if FF_API_COLOR_TABLE_ID
298 {
"mbd",
"macroblock decision algorithm (high quality mode)",
OFFSET(mb_decision),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E,
"mbd"},
307 {
"rc_init_occupancy",
"number of bits which should be loaded into the rc buffer before decoding starts",
OFFSET(rc_initial_buffer_occupancy),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E},
308 #if FF_API_INTER_THRESHOLD
313 #if FF_API_MPV_GLOBAL_OPTS
314 {
"qns",
"deprecated, use mpegvideo private options instead",
OFFSET(quantizer_noise_shaping),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
E},
317 {
"auto",
"autodetect a suitable number of threads to use", 0,
AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX,
V|
E|
D,
"threads"},
322 {
"skip_top",
"number of macroblock rows at the top which are skipped",
OFFSET(skip_top),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
D},
323 {
"skip_bottom",
"number of macroblock rows at the bottom which are skipped",
OFFSET(skip_bottom),
AV_OPT_TYPE_INT, {.i64 =
DEFAULT }, INT_MIN, INT_MAX,
V|
D},
341 {
"lowres",
"decode at 1= 1/2, 2=1/4, 3=1/8 resolutions",
OFFSET(
lowres),
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX,
V|
A|
D},
346 {
"border_mask",
"increase the quantizer for macroblocks close to borders",
OFFSET(border_masking),
AV_OPT_TYPE_FLOAT, {.dbl =
DEFAULT }, -FLT_MAX, FLT_MAX,
V|
E},
349 {
"mepc",
"motion estimation bitrate penalty compensation (1.0 = 256)",
OFFSET(me_penalty_compensation),
AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX,
V|
E},
361 {
"keyint_min",
"minimum interval between IDR-frames",
OFFSET(keyint_min),
AV_OPT_TYPE_INT, {.i64 = 25 }, INT_MIN, INT_MAX,
V|
E},
362 {
"refs",
"reference frames to consider for motion compensation",
OFFSET(refs),
AV_OPT_TYPE_INT, {.i64 = 1 }, INT_MIN, INT_MAX,
V|
E},
365 #if FF_API_MPV_GLOBAL_OPTS
366 {
"skiprd",
"Deprecated, use mpegvideo private options instead", 0,
AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX,
V|
E,
"flags2"},
368 {
"sc_factor",
"multiplied by qscale for each frame and added to scene_change_score",
OFFSET(scenechange_factor),
AV_OPT_TYPE_INT, {.i64 = 6 }, 0, INT_MAX,
V|
E},
370 {
"b_sensitivity",
"adjust sensitivity of b_frame_strategy 1",
OFFSET(b_sensitivity),
AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX,
V|
E},
374 {
"timecode_frame_start",
"GOP timecode frame start number, in non-drop-frame format",
OFFSET(timecode_frame_start),
AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX,
V|
E},
375 #if FF_API_REQUEST_CHANNELS
389 {
"log_level_offset",
"set the log level offset",
OFFSET(log_level_offset),
AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX },
390 {
"slices",
"number of slices, used in parallelized encoding",
OFFSET(slices),
AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX,
V|
E},