· 7 years ago · Jul 27, 2018, 12:14 PM
1/***************************************************
2 ** Description by [DA2K]:
3 **
4 ** This is a header from the x265 source code of
5 ** the latest stable release v2.8 (21 May 2018).
6 ** It includes all the available user options
7 ** (encoder settings) for expert video users,
8 ** aswell as a common documentation.
9 **
10 ** I cleaned the source a little bit, and most
11 ** of it is nerdy as hell but self-explanatory ;)
12 ** Options and their parameters are usually
13 ** stored in plaintext inside the header of
14 ** .mp4 and .mkv video+audio container files,
15 ** so it's useful for research in finding the
16 ** optimal settings for best video outputs,
17 ** some of which I have already found...
18 **
19 ** Encoder Settings for 4K BluRay .mkv videos:
20 ** https://pastebin.com/3dY3r919
21 **
22 ** All information about the x265 video codec:
23 **
24 ** x265 wiki -- https://en.wikipedia.org/wiki/X265
25 ** x265 sourcecode website ------ http://x265.org/
26 ** x265 commercial website ----- https://x265.com/
27 ***************************************************/
28
29/*------------------------------ PASTE BEGIN -------------------------------*/
30
31/*****************************************************************************
32 * Copyright (C) 2013-2017 MulticoreWare, Inc
33 *
34 * Authors: Steve Borho <steve@borho.org>
35 * Min Chen <chenm003@163.com>
36 *
37 * This program is free software; you can redistribute it and/or modify
38 * it under the terms of the GNU General Public License as published by
39 * the Free Software Foundation; either version 2 of the License, or
40 * (at your option) any later version.
41 *
42 * This program is distributed in the hope that it will be useful,
43 * but WITHOUT ANY WARRANTY; without even the implied warranty of
44 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45 * GNU General Public License for more details.
46 *
47 * You should have received a copy of the GNU General Public License
48 * along with this program; if not, write to the Free Software
49 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
50 *
51 * This program is also available under a commercial proprietary license.
52 * For more information, contact us at license @ x265.com.
53 *****************************************************************************/
54
55#ifndef X265CLI_H
56#define X265CLI_H 1
57
58#include "common.h"
59#include "param.h"
60
61#include <getopt.h>
62
63#ifdef __cplusplus
64namespace X265_NS {
65#endif
66
67static const char short_options[] = "o:D:P:p:f:F:r:I:i:b:s:t:q:m:hwV?";
68static const struct option long_options[] =
69{
70 { "help", no_argument, NULL, 'h' },
71 { "fullhelp", no_argument, NULL, 0 },
72 { "version", no_argument, NULL, 'V' },
73 { "asm", required_argument, NULL, 0 },
74 { "no-asm", no_argument, NULL, 0 },
75 { "pools", required_argument, NULL, 0 },
76 { "numa-pools", required_argument, NULL, 0 },
77 { "preset", required_argument, NULL, 'p' },
78 { "tune", required_argument, NULL, 't' },
79 { "frame-threads", required_argument, NULL, 'F' },
80 { "no-pmode", no_argument, NULL, 0 },
81 { "pmode", no_argument, NULL, 0 },
82 { "no-pme", no_argument, NULL, 0 },
83 { "pme", no_argument, NULL, 0 },
84 { "log-level", required_argument, NULL, 0 },
85 { "profile", required_argument, NULL, 'P' },
86 { "level-idc", required_argument, NULL, 0 },
87 { "high-tier", no_argument, NULL, 0 },
88 { "uhd-bd", no_argument, NULL, 0 },
89 { "no-high-tier", no_argument, NULL, 0 },
90 { "allow-non-conformance", no_argument, NULL, 0 },
91 { "no-allow-non-conformance",no_argument, NULL, 0 },
92 { "csv", required_argument, NULL, 0 },
93 { "csv-log-level", required_argument, NULL, 0 },
94 { "no-cu-stats", no_argument, NULL, 0 },
95 { "cu-stats", no_argument, NULL, 0 },
96 { "y4m", no_argument, NULL, 0 },
97 { "no-progress", no_argument, NULL, 0 },
98 { "output", required_argument, NULL, 'o' },
99 { "output-depth", required_argument, NULL, 'D' },
100 { "input", required_argument, NULL, 0 },
101 { "input-depth", required_argument, NULL, 0 },
102 { "input-res", required_argument, NULL, 0 },
103 { "input-csp", required_argument, NULL, 0 },
104 { "interlace", required_argument, NULL, 0 },
105 { "no-interlace", no_argument, NULL, 0 },
106 { "fps", required_argument, NULL, 0 },
107 { "seek", required_argument, NULL, 0 },
108 { "frame-skip", required_argument, NULL, 0 },
109 { "frames", required_argument, NULL, 'f' },
110 { "recon", required_argument, NULL, 'r' },
111 { "recon-depth", required_argument, NULL, 0 },
112 { "no-wpp", no_argument, NULL, 0 },
113 { "wpp", no_argument, NULL, 0 },
114 { "ctu", required_argument, NULL, 's' },
115 { "min-cu-size", required_argument, NULL, 0 },
116 { "max-tu-size", required_argument, NULL, 0 },
117 { "tu-intra-depth", required_argument, NULL, 0 },
118 { "tu-inter-depth", required_argument, NULL, 0 },
119 { "limit-tu", required_argument, NULL, 0 },
120 { "me", required_argument, NULL, 0 },
121 { "subme", required_argument, NULL, 'm' },
122 { "merange", required_argument, NULL, 0 },
123 { "max-merge", required_argument, NULL, 0 },
124 { "no-temporal-mvp", no_argument, NULL, 0 },
125 { "temporal-mvp", no_argument, NULL, 0 },
126 { "rdpenalty", required_argument, NULL, 0 },
127 { "no-rect", no_argument, NULL, 0 },
128 { "rect", no_argument, NULL, 0 },
129 { "no-amp", no_argument, NULL, 0 },
130 { "amp", no_argument, NULL, 0 },
131 { "no-early-skip", no_argument, NULL, 0 },
132 { "early-skip", no_argument, NULL, 0 },
133 { "no-rskip", no_argument, NULL, 0 },
134 { "rskip", no_argument, NULL, 0 },
135 { "no-fast-cbf", no_argument, NULL, 0 },
136 { "fast-cbf", no_argument, NULL, 0 },
137 { "no-tskip", no_argument, NULL, 0 },
138 { "tskip", no_argument, NULL, 0 },
139 { "no-tskip-fast", no_argument, NULL, 0 },
140 { "tskip-fast", no_argument, NULL, 0 },
141 { "cu-lossless", no_argument, NULL, 0 },
142 { "no-cu-lossless", no_argument, NULL, 0 },
143 { "no-constrained-intra", no_argument, NULL, 0 },
144 { "constrained-intra", no_argument, NULL, 0 },
145 { "cip", no_argument, NULL, 0 },
146 { "no-cip", no_argument, NULL, 0 },
147 { "fast-intra", no_argument, NULL, 0 },
148 { "no-fast-intra", no_argument, NULL, 0 },
149 { "no-open-gop", no_argument, NULL, 0 },
150 { "open-gop", no_argument, NULL, 0 },
151 { "keyint", required_argument, NULL, 'I' },
152 { "min-keyint", required_argument, NULL, 'i' },
153 { "gop-lookahead", required_argument, NULL, 0 },
154 { "scenecut", required_argument, NULL, 0 },
155 { "no-scenecut", no_argument, NULL, 0 },
156 { "scenecut-bias", required_argument, NULL, 0 },
157 { "radl", required_argument, NULL, 0 },
158 { "ctu-info", required_argument, NULL, 0 },
159 { "intra-refresh", no_argument, NULL, 0 },
160 { "rc-lookahead", required_argument, NULL, 0 },
161 { "lookahead-slices", required_argument, NULL, 0 },
162 { "lookahead-threads", required_argument, NULL, 0 },
163 { "bframes", required_argument, NULL, 'b' },
164 { "bframe-bias", required_argument, NULL, 0 },
165 { "b-adapt", required_argument, NULL, 0 },
166 { "no-b-adapt", no_argument, NULL, 0 },
167 { "no-b-pyramid", no_argument, NULL, 0 },
168 { "b-pyramid", no_argument, NULL, 0 },
169 { "ref", required_argument, NULL, 0 },
170 { "limit-refs", required_argument, NULL, 0 },
171 { "no-limit-modes", no_argument, NULL, 0 },
172 { "limit-modes", no_argument, NULL, 0 },
173 { "no-weightp", no_argument, NULL, 0 },
174 { "weightp", no_argument, NULL, 'w' },
175 { "no-weightb", no_argument, NULL, 0 },
176 { "weightb", no_argument, NULL, 0 },
177 { "crf", required_argument, NULL, 0 },
178 { "crf-max", required_argument, NULL, 0 },
179 { "crf-min", required_argument, NULL, 0 },
180 { "vbv-maxrate", required_argument, NULL, 0 },
181 { "vbv-bufsize", required_argument, NULL, 0 },
182 { "vbv-init", required_argument, NULL, 0 },
183 { "vbv-end", required_argument, NULL, 0 },
184 { "vbv-end-fr-adj", required_argument, NULL, 0 },
185 { "bitrate", required_argument, NULL, 0 },
186 { "qp", required_argument, NULL, 'q' },
187 { "aq-mode", required_argument, NULL, 0 },
188 { "aq-strength", required_argument, NULL, 0 },
189 { "rc-grain", no_argument, NULL, 0 },
190 { "no-rc-grain", no_argument, NULL, 0 },
191 { "ipratio", required_argument, NULL, 0 },
192 { "pbratio", required_argument, NULL, 0 },
193 { "qcomp", required_argument, NULL, 0 },
194 { "qpstep", required_argument, NULL, 0 },
195 { "qpmin", required_argument, NULL, 0 },
196 { "qpmax", required_argument, NULL, 0 },
197 { "const-vbv", no_argument, NULL, 0 },
198 { "no-const-vbv", no_argument, NULL, 0 },
199 { "ratetol", required_argument, NULL, 0 },
200 { "cplxblur", required_argument, NULL, 0 },
201 { "qblur", required_argument, NULL, 0 },
202 { "cbqpoffs", required_argument, NULL, 0 },
203 { "crqpoffs", required_argument, NULL, 0 },
204 { "rd", required_argument, NULL, 0 },
205 { "rdoq-level", required_argument, NULL, 0 },
206 { "no-rdoq-level", no_argument, NULL, 0 },
207 { "dynamic-rd", required_argument, NULL, 0 },
208 { "psy-rd", required_argument, NULL, 0 },
209 { "psy-rdoq", required_argument, NULL, 0 },
210 { "no-psy-rd", no_argument, NULL, 0 },
211 { "no-psy-rdoq", no_argument, NULL, 0 },
212 { "rd-refine", no_argument, NULL, 0 },
213 { "no-rd-refine", no_argument, NULL, 0 },
214 { "scaling-list", required_argument, NULL, 0 },
215 { "lossless", no_argument, NULL, 0 },
216 { "no-lossless", no_argument, NULL, 0 },
217 { "no-signhide", no_argument, NULL, 0 },
218 { "signhide", no_argument, NULL, 0 },
219 { "no-lft", no_argument, NULL, 0 }, /* DEPRECATED */
220 { "lft", no_argument, NULL, 0 }, /* DEPRECATED */
221 { "no-deblock", no_argument, NULL, 0 },
222 { "deblock", required_argument, NULL, 0 },
223 { "no-sao", no_argument, NULL, 0 },
224 { "sao", no_argument, NULL, 0 },
225 { "no-sao-non-deblock", no_argument, NULL, 0 },
226 { "sao-non-deblock", no_argument, NULL, 0 },
227 { "no-ssim", no_argument, NULL, 0 },
228 { "ssim", no_argument, NULL, 0 },
229 { "no-psnr", no_argument, NULL, 0 },
230 { "psnr", no_argument, NULL, 0 },
231 { "hash", required_argument, NULL, 0 },
232 { "no-strong-intra-smoothing", no_argument, NULL, 0 },
233 { "strong-intra-smoothing", no_argument, NULL, 0 },
234 { "no-cutree", no_argument, NULL, 0 },
235 { "cutree", no_argument, NULL, 0 },
236 { "no-hrd", no_argument, NULL, 0 },
237 { "hrd", no_argument, NULL, 0 },
238 { "sar", required_argument, NULL, 0 },
239 { "overscan", required_argument, NULL, 0 },
240 { "videoformat", required_argument, NULL, 0 },
241 { "range", required_argument, NULL, 0 },
242 { "colorprim", required_argument, NULL, 0 },
243 { "transfer", required_argument, NULL, 0 },
244 { "colormatrix", required_argument, NULL, 0 },
245 { "chromaloc", required_argument, NULL, 0 },
246 { "display-window", required_argument, NULL, 0 },
247 { "crop-rect", required_argument, NULL, 0 }, /* DEPRECATED */
248 { "master-display", required_argument, NULL, 0 },
249 { "max-cll", required_argument, NULL, 0 },
250 { "min-luma", required_argument, NULL, 0 },
251 { "max-luma", required_argument, NULL, 0 },
252 { "log2-max-poc-lsb", required_argument, NULL, 8 },
253 { "vui-timing-info", no_argument, NULL, 0 },
254 { "no-vui-timing-info", no_argument, NULL, 0 },
255 { "vui-hrd-info", no_argument, NULL, 0 },
256 { "no-vui-hrd-info", no_argument, NULL, 0 },
257 { "opt-qp-pps", no_argument, NULL, 0 },
258 { "no-opt-qp-pps", no_argument, NULL, 0 },
259 { "opt-ref-list-length-pps", no_argument, NULL, 0 },
260 { "no-opt-ref-list-length-pps",no_argument, NULL, 0 },
261 { "opt-cu-delta-qp", no_argument, NULL, 0 },
262 { "no-opt-cu-delta-qp", no_argument, NULL, 0 },
263 { "no-dither", no_argument, NULL, 0 },
264 { "dither", no_argument, NULL, 0 },
265 { "no-repeat-headers", no_argument, NULL, 0 },
266 { "repeat-headers", no_argument, NULL, 0 },
267 { "aud", no_argument, NULL, 0 },
268 { "no-aud", no_argument, NULL, 0 },
269 { "info", no_argument, NULL, 0 },
270 { "no-info", no_argument, NULL, 0 },
271 { "zones", required_argument, NULL, 0 },
272 { "qpfile", required_argument, NULL, 0 },
273 { "lambda-file", required_argument, NULL, 0 },
274 { "b-intra", no_argument, NULL, 0 },
275 { "no-b-intra", no_argument, NULL, 0 },
276 { "nr-intra", required_argument, NULL, 0 },
277 { "nr-inter", required_argument, NULL, 0 },
278 { "stats", required_argument, NULL, 0 },
279 { "pass", required_argument, NULL, 0 },
280 { "multi-pass-opt-analysis", no_argument, NULL, 0 },
281 { "no-multi-pass-opt-analysis",no_argument, NULL, 0 },
282 { "multi-pass-opt-distortion", no_argument, NULL, 0 },
283 { "no-multi-pass-opt-distortion",no_argument, NULL, 0 },
284 { "slow-firstpass", no_argument, NULL, 0 },
285 { "no-slow-firstpass", no_argument, NULL, 0 },
286 { "multi-pass-opt-rps", no_argument, NULL, 0 },
287 { "no-multi-pass-opt-rps", no_argument, NULL, 0 },
288 { "analysis-reuse-mode", required_argument, NULL, 0 }, /* DEPRECATED */
289 { "analysis-reuse-file", required_argument, NULL, 0 },
290 { "analysis-reuse-level", required_argument, NULL, 0 },
291 { "analysis-save", required_argument, NULL, 0 },
292 { "analysis-load", required_argument, NULL, 0 },
293 { "scale-factor", required_argument, NULL, 0 },
294 { "refine-intra", required_argument, NULL, 0 },
295 { "refine-inter", required_argument, NULL, 0 },
296 { "dynamic-refine", no_argument, NULL, 0 },
297 { "no-dynamic-refine", no_argument, NULL, 0 },
298 { "strict-cbr", no_argument, NULL, 0 },
299 { "temporal-layers", no_argument, NULL, 0 },
300 { "no-temporal-layers", no_argument, NULL, 0 },
301 { "qg-size", required_argument, NULL, 0 },
302 { "recon-y4m-exec", required_argument, NULL, 0 },
303 { "analyze-src-pics", no_argument, NULL, 0 },
304 { "no-analyze-src-pics", no_argument, NULL, 0 },
305 { "slices", required_argument, NULL, 0 },
306 { "aq-motion", no_argument, NULL, 0 },
307 { "no-aq-motion", no_argument, NULL, 0 },
308 { "ssim-rd", no_argument, NULL, 0 },
309 { "no-ssim-rd", no_argument, NULL, 0 },
310 { "hdr", no_argument, NULL, 0 },
311 { "no-hdr", no_argument, NULL, 0 },
312 { "hdr-opt", no_argument, NULL, 0 },
313 { "no-hdr-opt", no_argument, NULL, 0 },
314 { "limit-sao", no_argument, NULL, 0 },
315 { "no-limit-sao", no_argument, NULL, 0 },
316 { "dhdr10-info", required_argument, NULL, 0 },
317 { "dhdr10-opt", no_argument, NULL, 0},
318 { "no-dhdr10-opt", no_argument, NULL, 0},
319 { "refine-mv", no_argument, NULL, 0 },
320 { "no-refine-mv", no_argument, NULL, 0 },
321 { "force-flush", required_argument, NULL, 0 },
322 { "splitrd-skip", no_argument, NULL, 0 },
323 { "no-splitrd-skip", no_argument, NULL, 0 },
324 { "lowpass-dct", no_argument, NULL, 0 },
325 { "refine-mv-type", required_argument, NULL, 0 },
326 { "copy-pic", no_argument, NULL, 0 },
327 { "no-copy-pic", no_argument, NULL, 0 },
328 { "max-ausize-factor", required_argument, NULL, 0 },
329 { "idr-recovery-sei", no_argument, NULL, 0 },
330 { "no-idr-recovery-sei", no_argument, NULL, 0 },
331 { "single-sei", no_argument, NULL, 0 },
332 { "no-single-sei", no_argument, NULL, 0 },
333 { "atc-sei", required_argument, NULL, 0 },
334 { "pic-struct", required_argument, NULL, 0 },
335 { 0, 0, 0, 0 },
336 { 0, 0, 0, 0 },
337 { 0, 0, 0, 0 },
338 { 0, 0, 0, 0 },
339 { 0, 0, 0, 0 }
340};
341
342static void printVersion(x265_param *param, const x265_api* api)
343{
344 x265_log(param, X265_LOG_INFO, "HEVC encoder version %s\n", api->version_str);
345 x265_log(param, X265_LOG_INFO, "build info %s\n", api->build_info_str);
346}
347
348static void showHelp(x265_param *param)
349{
350 int level = param->logLevel;
351
352#define OPT(value) (value ? "enabled" : "disabled")
353#define H0 printf
354#define H1 if (level >= X265_LOG_DEBUG) printf
355
356 H0("\nSyntax: x265 [options] infile [-o] outfile\n");
357 H0(" infile can be YUV or Y4M\n");
358 H0(" outfile is raw HEVC bitstream\n");
359 H0("\nExecutable Options:\n");
360 H0("-h/--help Show this help text and exit\n");
361 H0(" --fullhelp Show all options and exit\n");
362 H0("-V/--version Show version info and exit\n");
363 H0("\nOutput Options:\n");
364 H0("-o/--output <filename> Bitstream output file name\n");
365 H0("-D/--output-depth 8|10|12 Output bit depth (also internal bit depth). Default %d\n", param->internalBitDepth);
366 H0(" --log-level <string> Logging level: none error warning info debug full. Default %s\n", X265_NS::logLevelNames[param->logLevel + 1]);
367 H0(" --no-progress Disable CLI progress reports\n");
368 H0(" --csv <filename> Comma separated log file, if csv-log-level > 0 frame level statistics, else one line per run\n");
369 H0(" --csv-log-level <integer> Level of csv logging, if csv-log-level > 0 frame level statistics, else one line per run: 0-2\n");
370 H0("\nInput Options:\n");
371 H0(" --input <filename> Raw YUV or Y4M input file name. `-` for stdin\n");
372 H1(" --y4m Force parsing of input stream as YUV4MPEG2 regardless of file extension\n");
373 H0(" --fps <float|rational> Source frame rate (float or num/denom), auto-detected if Y4M\n");
374 H0(" --input-res WxH Source picture size [w x h], auto-detected if Y4M\n");
375 H1(" --input-depth <integer> Bit-depth of input file. Default 8\n");
376 H1(" --input-csp <string> Chroma subsampling, auto-detected if Y4M\n");
377 H1(" 0 - i400 (4:0:0 monochrome)\n");
378 H1(" 1 - i420 (4:2:0 default)\n");
379 H1(" 2 - i422 (4:2:2)\n");
380 H1(" 3 - i444 (4:4:4)\n");
381#if ENABLE_HDR10_PLUS
382 H0(" --dhdr10-info <filename> JSON file containing the Creative Intent Metadata to be encoded as Dynamic Tone Mapping\n");
383 H0(" --[no-]dhdr10-opt Insert tone mapping SEI only for IDR frames and when the tone mapping information changes. Default disabled\n");
384#endif
385 H0("-f/--frames <integer> Maximum number of frames to encode. Default all\n");
386 H0(" --seek <integer> First frame to encode\n");
387 H1(" --[no-]interlace <bff|tff> Indicate input pictures are interlace fields in temporal order. Default progressive\n");
388 H1(" --dither Enable dither if downscaling to 8 bit pixels. Default disabled\n");
389 H0(" --[no-]copy-pic Copy buffers of input picture in frame. Default %s\n", OPT(param->bCopyPicToFrame));
390 H0("\nQuality reporting metrics:\n");
391 H0(" --[no-]ssim Enable reporting SSIM metric scores. Default %s\n", OPT(param->bEnableSsim));
392 H0(" --[no-]psnr Enable reporting PSNR metric scores. Default %s\n", OPT(param->bEnablePsnr));
393 H0("\nProfile, Level, Tier:\n");
394 H0("-P/--profile <string> Enforce an encode profile: main, main10, mainstillpicture\n");
395 H0(" --level-idc <integer|float> Force a minimum required decoder level (as '5.0' or '50')\n");
396 H0(" --[no-]high-tier If a decoder level is specified, this modifier selects High tier of that level\n");
397 H0(" --uhd-bd Enable UHD Bluray compatibility support\n");
398 H0(" --[no-]allow-non-conformance Allow the encoder to generate profile NONE bitstreams. Default %s\n", OPT(param->bAllowNonConformance));
399 H0("\nThreading, performance:\n");
400 H0(" --pools <integer,...> Comma separated thread count per thread pool (pool per NUMA node)\n");
401 H0(" '-' implies no threads on node, '+' implies one thread per core on node\n");
402 H0("-F/--frame-threads <integer> Number of concurrently encoded frames. 0: auto-determined by core count\n");
403 H0(" --[no-]wpp Enable Wavefront Parallel Processing. Default %s\n", OPT(param->bEnableWavefront));
404 H0(" --[no-]slices <integer> Enable Multiple Slices feature. Default %d\n", param->maxSlices);
405 H0(" --[no-]pmode Parallel mode analysis. Default %s\n", OPT(param->bDistributeModeAnalysis));
406 H0(" --[no-]pme Parallel motion estimation. Default %s\n", OPT(param->bDistributeMotionEstimation));
407 H0(" --[no-]asm <bool|int|string> Override CPU detection. Default: auto\n");
408 H0("\nPresets:\n");
409 H0("-p/--preset <string> Trade off performance for compression efficiency. Default medium\n");
410 H0(" ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, or placebo\n");
411 H0("-t/--tune <string> Tune the settings for a particular type of source or situation:\n");
412 H0(" psnr, ssim, grain, zerolatency, fastdecode\n");
413 H0("\nQuad-Tree size and depth:\n");
414 H0("-s/--ctu <64|32|16> Maximum CU size (WxH). Default %d\n", param->maxCUSize);
415 H0(" --min-cu-size <64|32|16|8> Minimum CU size (WxH). Default %d\n", param->minCUSize);
416 H0(" --max-tu-size <32|16|8|4> Maximum TU size (WxH). Default %d\n", param->maxTUSize);
417 H0(" --tu-intra-depth <integer> Max TU recursive depth for intra CUs. Default %d\n", param->tuQTMaxIntraDepth);
418 H0(" --tu-inter-depth <integer> Max TU recursive depth for inter CUs. Default %d\n", param->tuQTMaxInterDepth);
419 H0(" --limit-tu <0..4> Enable early exit from TU recursion for inter coded blocks. Default %d\n", param->limitTU);
420 H0("\nAnalysis:\n");
421 H0(" --rd <1..6> Level of RDO in mode decision 1:least....6:full RDO. Default %d\n", param->rdLevel);
422 H0(" --[no-]psy-rd <0..5.0> Strength of psycho-visual rate distortion optimization, 0 to disable. Default %.1f\n", param->psyRd);
423 H0(" --[no-]rdoq-level <0|1|2> Level of RDO in quantization 0:none, 1:levels, 2:levels & coding groups. Default %d\n", param->rdoqLevel);
424 H0(" --[no-]psy-rdoq <0..50.0> Strength of psycho-visual optimization in RDO quantization, 0 to disable. Default %.1f\n", param->psyRdoq);
425 H0(" --dynamic-rd <0..4.0> Strength of dynamic RD, 0 to disable. Default %.2f\n", param->dynamicRd);
426 H0(" --[no-]ssim-rd Enable ssim rate distortion optimization, 0 to disable. Default %s\n", OPT(param->bSsimRd));
427 H0(" --[no-]rd-refine Enable QP based RD refinement for rd levels 5 and 6. Default %s\n", OPT(param->bEnableRdRefine));
428 H0(" --[no-]early-skip Enable early SKIP detection. Default %s\n", OPT(param->bEnableEarlySkip));
429 H0(" --[no-]rskip Enable early exit from recursion. Default %s\n", OPT(param->bEnableRecursionSkip));
430 H1(" --[no-]tskip-fast Enable fast intra transform skipping. Default %s\n", OPT(param->bEnableTSkipFast));
431 H1(" --[no-]splitrd-skip Enable skipping split RD analysis when sum of split CU rdCost larger than none split CU rdCost for Intra CU. Default %s\n", OPT(param->bEnableSplitRdSkip));
432 H1(" --nr-intra <integer> An integer value in range of 0 to 2000, which denotes strength of noise reduction in intra CUs. Default 0\n");
433 H1(" --nr-inter <integer> An integer value in range of 0 to 2000, which denotes strength of noise reduction in inter CUs. Default 0\n");
434 H0(" --ctu-info <integer> Enable receiving ctu information asynchronously and determine reaction to the CTU information (0, 1, 2, 4, 6) Default 0\n"
435 " - 1: force the partitions if CTU information is present\n"
436 " - 2: functionality of (1) and reduce qp if CTU information has changed\n"
437 " - 4: functionality of (1) and force Inter modes when CTU Information has changed, merge/skip otherwise\n"
438 " Enable this option only when planning to invoke the API function x265_encoder_ctu_info to copy ctu-info asynchronously\n");
439 H0("\nCoding tools:\n");
440 H0("-w/--[no-]weightp Enable weighted prediction in P slices. Default %s\n", OPT(param->bEnableWeightedPred));
441 H0(" --[no-]weightb Enable weighted prediction in B slices. Default %s\n", OPT(param->bEnableWeightedBiPred));
442 H0(" --[no-]cu-lossless Consider lossless mode in CU RDO decisions. Default %s\n", OPT(param->bCULossless));
443 H0(" --[no-]signhide Hide sign bit of one coeff per TU (rdo). Default %s\n", OPT(param->bEnableSignHiding));
444 H1(" --[no-]tskip Enable intra 4x4 transform skipping. Default %s\n", OPT(param->bEnableTransformSkip));
445 H0("\nTemporal / motion search options:\n");
446 H0(" --max-merge <1..5> Maximum number of merge candidates. Default %d\n", param->maxNumMergeCand);
447 H0(" --ref <integer> max number of L0 references to be allowed (1 .. 16) Default %d\n", param->maxNumReferences);
448 H0(" --limit-refs <0|1|2|3> Limit references per depth (1) or CU (2) or both (3). Default %d\n", param->limitReferences);
449 H0(" --me <string> Motion search method dia hex umh star full. Default %d\n", param->searchMethod);
450 H0("-m/--subme <integer> Amount of subpel refinement to perform (0:least .. 7:most). Default %d \n", param->subpelRefine);
451 H0(" --merange <integer> Motion search range. Default %d\n", param->searchRange);
452 H0(" --[no-]rect Enable rectangular motion partitions Nx2N and 2NxN. Default %s\n", OPT(param->bEnableRectInter));
453 H0(" --[no-]amp Enable asymmetric motion partitions, requires --rect. Default %s\n", OPT(param->bEnableAMP));
454 H0(" --[no-]limit-modes Limit rectangular and asymmetric motion predictions. Default %d\n", param->limitModes);
455 H1(" --[no-]temporal-mvp Enable temporal MV predictors. Default %s\n", OPT(param->bEnableTemporalMvp));
456 H0("\nSpatial / intra options:\n");
457 H0(" --[no-]strong-intra-smoothing Enable strong intra smoothing for 32x32 blocks. Default %s\n", OPT(param->bEnableStrongIntraSmoothing));
458 H0(" --[no-]constrained-intra Constrained intra prediction (use only intra coded reference pixels) Default %s\n", OPT(param->bEnableConstrainedIntra));
459 H0(" --[no-]b-intra Enable intra in B frames in veryslow presets. Default %s\n", OPT(param->bIntraInBFrames));
460 H0(" --[no-]fast-intra Enable faster search method for angular intra predictions. Default %s\n", OPT(param->bEnableFastIntra));
461 H0(" --rdpenalty <0..2> penalty for 32x32 intra TU in non-I slices. 0:disabled 1:RD-penalty 2:maximum. Default %d\n", param->rdPenalty);
462 H0("\nSlice decision options:\n");
463 H0(" --[no-]open-gop Enable open-GOP, allows I slices to be non-IDR. Default %s\n", OPT(param->bOpenGOP));
464 H0("-I/--keyint <integer> Max IDR period in frames. -1 for infinite-gop. Default %d\n", param->keyframeMax);
465 H0("-i/--min-keyint <integer> Scenecuts closer together than this are coded as I, not IDR. Default: auto\n");
466 H0(" --gop-lookahead <integer> Extends gop boundary if a scenecut is found within this from keyint boundary. Default 0\n");
467 H0(" --no-scenecut Disable adaptive I-frame decision\n");
468 H0(" --scenecut <integer> How aggressively to insert extra I-frames. Default %d\n", param->scenecutThreshold);
469 H1(" --scenecut-bias <0..100.0> Bias for scenecut detection. Default %.2f\n", param->scenecutBias);
470 H0(" --radl <integer> Number of RADL pictures allowed in front of IDR. Default %d\n", param->radl);
471 H0(" --intra-refresh Use Periodic Intra Refresh instead of IDR frames\n");
472 H0(" --rc-lookahead <integer> Number of frames for frame-type lookahead (determines encoder latency) Default %d\n", param->lookaheadDepth);
473 H1(" --lookahead-slices <0..16> Number of slices to use per lookahead cost estimate. Default %d\n", param->lookaheadSlices);
474 H0(" --lookahead-threads <integer> Number of threads to be dedicated to perform lookahead only. Default %d\n", param->lookaheadThreads);
475 H0("-b/--bframes <0..16> Maximum number of consecutive b-frames. Default %d\n", param->bframes);
476 H1(" --bframe-bias <integer> Bias towards B frame decisions. Default %d\n", param->bFrameBias);
477 H0(" --b-adapt <0..2> 0 - none, 1 - fast, 2 - full (trellis) adaptive B frame scheduling. Default %d\n", param->bFrameAdaptive);
478 H0(" --[no-]b-pyramid Use B-frames as references. Default %s\n", OPT(param->bBPyramid));
479 H1(" --qpfile <string> Force frametypes and QPs for some or all frames\n");
480 H1(" Format of each line: framenumber frametype QP\n");
481 H1(" QP is optional (none lets x265 choose). Frametypes: I,i,K,P,B,b.\n");
482 H1(" QPs are restricted by qpmin/qpmax.\n");
483 H1(" --force-flush <integer> Force the encoder to flush frames. Default %d\n", param->forceFlush);
484 H1(" 0 - flush the encoder only when all the input pictures are over.\n");
485 H1(" 1 - flush all the frames even when the input is not over. Slicetype decision may change with this option.\n");
486 H1(" 2 - flush the slicetype decided frames only.\n");
487 H0("\nRate control, Adaptive Quantization:\n");
488 H0(" --bitrate <integer> Target bitrate (kbps) for ABR (implied). Default %d\n", param->rc.bitrate);
489 H1("-q/--qp <integer> QP for P slices in CQP mode (implied). --ipratio and --pbration determine other slice QPs\n");
490 H0(" --crf <float> Quality-based VBR (0-51). Default %.1f\n", param->rc.rfConstant);
491 H1(" --[no-]lossless Enable lossless: bypass transform, quant and loop filters globally. Default %s\n", OPT(param->bLossless));
492 H1(" --crf-max <float> With CRF+VBV, limit RF to this value. Default %f\n", param->rc.rfConstantMax);
493 H1(" May cause VBV underflows!\n");
494 H1(" --crf-min <float> With CRF+VBV, limit RF to this value. Default %f\n", param->rc.rfConstantMin);
495 H1(" this specifies a minimum rate factor value for encode!\n");
496 H0(" --vbv-maxrate <integer> Max local bitrate (kbit/s). Default %d\n", param->rc.vbvMaxBitrate);
497 H0(" --vbv-bufsize <integer> Set size of the VBV buffer (kbit). Default %d\n", param->rc.vbvBufferSize);
498 H0(" --vbv-init <float> Initial VBV buffer occupancy (fraction of bufsize or in kbits). Default %.2f\n", param->rc.vbvBufferInit);
499 H0(" --vbv-end <float> Final VBV buffer emptiness (fraction of bufsize or in kbits). Default 0 (disabled)\n");
500 H0(" --vbv-end-fr-adj <float> Frame from which qp has to be adjusted to achieve final decode buffer emptiness. Default 0\n");
501 H0(" --pass Multi pass rate control.\n"
502 " - 1 : First pass, creates stats file\n"
503 " - 2 : Last pass, does not overwrite stats file\n"
504 " - 3 : Nth pass, overwrites stats file\n");
505 H0(" --[no-]multi-pass-opt-analysis Refine analysis in 2 pass based on analysis information from pass 1\n");
506 H0(" --[no-]multi-pass-opt-distortion Use distortion of CTU from pass 1 to refine qp in 2 pass\n");
507 H0(" --stats Filename for stats file in multipass pass rate control. Default x265_2pass.log\n");
508 H0(" --[no-]analyze-src-pics Motion estimation uses source frame planes. Default disable\n");
509 H0(" --[no-]slow-firstpass Enable a slow first pass in a multipass rate control mode. Default %s\n", OPT(param->rc.bEnableSlowFirstPass));
510 H0(" --[no-]strict-cbr Enable stricter conditions and tolerance for bitrate deviations in CBR mode. Default %s\n", OPT(param->rc.bStrictCbr));
511 H0(" --analysis-save <filename> Dump analysis info into the specified file. Default Disabled\n");
512 H0(" --analysis-load <filename> Load analysis buffers from the file specified. Default Disabled\n");
513 H0(" --analysis-reuse-file <filename> Specify file name used for either dumping or reading analysis data. Deault x265_analysis.dat\n");
514 H0(" --analysis-reuse-level <1..10> Level of analysis reuse indicates amount of info stored/reused in save/load mode, 1:least..10:most. Default %d\n", param->analysisReuseLevel);
515 H0(" --refine-mv-type <string> Reuse MV information received through API call. Supported option is avc. Default disabled - %d\n", param->bMVType);
516 H0(" --scale-factor <int> Specify factor by which input video is scaled down for analysis save mode. Default %d\n", param->scaleFactor);
517 H0(" --refine-intra <0..4> Enable intra refinement for encode that uses analysis-load.\n"
518 " - 0 : Forces both mode and depth from the save encode.\n"
519 " - 1 : Functionality of (0) + evaluate all intra modes at min-cu-size's depth when current depth is one smaller than min-cu-size's depth.\n"
520 " - 2 : Functionality of (1) + irrespective of size evaluate all angular modes when the save encode decides the best mode as angular.\n"
521 " - 3 : Functionality of (1) + irrespective of size evaluate all intra modes.\n"
522 " - 4 : Re-evaluate all intra blocks, does not reuse data from save encode.\n"
523 " Default:%d\n", param->intraRefine);
524 H0(" --refine-inter <0..3> Enable inter refinement for encode that uses analysis-load.\n"
525 " - 0 : Forces both mode and depth from the save encode.\n"
526 " - 1 : Functionality of (0) + evaluate all inter modes at min-cu-size's depth when current depth is one smaller than\n"
527 " min-cu-size's depth. When save encode decides the current block as skip(for all sizes) evaluate skip/merge.\n"
528 " - 2 : Functionality of (1) + irrespective of size restrict the modes evaluated when specific modes are decided as the best mode by the save encode.\n"
529 " - 3 : Functionality of (1) + irrespective of size evaluate all inter modes.\n"
530 " Default:%d\n", param->interRefine);
531 H0(" --[no-]dynamic-refine Dynamically changes refine-inter level for each CU. Default %s\n", OPT(param->bDynamicRefine));
532 H0(" --[no-]refine-mv Enable mv refinement for load mode. Default %s\n", OPT(param->mvRefine));
533 H0(" --aq-mode <integer> Mode for Adaptive Quantization - 0:none 1:uniform AQ 2:auto variance 3:auto variance with bias to dark scenes. Default %d\n", param->rc.aqMode);
534 H0(" --aq-strength <float> Reduces blocking and blurring in flat and textured areas (0 to 3.0). Default %.2f\n", param->rc.aqStrength);
535 H0(" --[no-]aq-motion Adaptive Quantization based on the relative motion of each CU w.r.t., frame. Default %s\n", OPT(param->bOptCUDeltaQP));
536 H0(" --qg-size <int> Specifies the size of the quantization group (64, 32, 16, 8). Default %d\n", param->rc.qgSize);
537 H0(" --[no-]cutree Enable cutree for Adaptive Quantization. Default %s\n", OPT(param->rc.cuTree));
538 H0(" --[no-]rc-grain Enable ratecontrol mode to handle grains specifically. turned on with tune grain. Default %s\n", OPT(param->rc.bEnableGrain));
539 H1(" --ipratio <float> QP factor between I and P. Default %.2f\n", param->rc.ipFactor);
540 H1(" --pbratio <float> QP factor between P and B. Default %.2f\n", param->rc.pbFactor);
541 H1(" --qcomp <float> Weight given to predicted complexity. Default %.2f\n", param->rc.qCompress);
542 H1(" --qpstep <integer> The maximum single adjustment in QP allowed to rate control. Default %d\n", param->rc.qpStep);
543 H1(" --qpmin <integer> sets a hard lower limit on QP allowed to ratecontrol. Default %d\n", param->rc.qpMin);
544 H1(" --qpmax <integer> sets a hard upper limit on QP allowed to ratecontrol. Default %d\n", param->rc.qpMax);
545 H0(" --[no-]const-vbv Enable consistent vbv. turned on with tune grain. Default %s\n", OPT(param->rc.bEnableConstVbv));
546 H1(" --cbqpoffs <integer> Chroma Cb QP Offset [-12..12]. Default %d\n", param->cbQpOffset);
547 H1(" --crqpoffs <integer> Chroma Cr QP Offset [-12..12]. Default %d\n", param->crQpOffset);
548 H1(" --scaling-list <string> Specify a file containing HM style quant scaling lists or 'default' or 'off'. Default: off\n");
549 H1(" --zones <zone0>/<zone1>/... Tweak the bitrate of regions of the video\n");
550 H1(" Each zone is of the form\n");
551 H1(" <start frame>,<end frame>,<option>\n");
552 H1(" where <option> is either\n");
553 H1(" q=<integer> (force QP)\n");
554 H1(" or b=<float> (bitrate multiplier)\n");
555 H1(" --lambda-file <string> Specify a file containing replacement values for the lambda tables\n");
556 H1(" MAX_MAX_QP+1 floats for lambda table, then again for lambda2 table\n");
557 H1(" Blank lines and lines starting with hash(#) are ignored\n");
558 H1(" Comma is considered to be white-space\n");
559 H0(" --max-ausize-factor <float> This value controls the maximum AU size defined in specification.\n");
560 H0(" It represents the percentage of maximum AU size used. Default %.1f\n", param->maxAUSizeFactor);
561 H0("\nLoop filters (deblock and SAO):\n");
562 H0(" --[no-]deblock Enable Deblocking Loop Filter, optionally specify tC:Beta offsets Default %s\n", OPT(param->bEnableLoopFilter));
563 H0(" --[no-]sao Enable Sample Adaptive Offset. Default %s\n", OPT(param->bEnableSAO));
564 H1(" --[no-]sao-non-deblock Use non-deblocked pixels, else right/bottom boundary areas skipped. Default %s\n", OPT(param->bSaoNonDeblocked));
565 H0(" --[no-]limit-sao Limit Sample Adaptive Offset types. Default %s\n", OPT(param->bLimitSAO));
566 H0("\nVUI options:\n");
567 H0(" --sar <width:height|int> Sample Aspect Ratio, the ratio of width to height of an individual pixel.\n");
568 H0(" Choose from 0=undef, 1=1:1(\"square\"), 2=12:11, 3=10:11, 4=16:11,\n");
569 H0(" 5=40:33, 6=24:11, 7=20:11, 8=32:11, 9=80:33, 10=18:11, 11=15:11,\n");
570 H0(" 12=64:33, 13=160:99, 14=4:3, 15=3:2, 16=2:1 or custom ratio of <int:int>. Default %d\n", param->vui.aspectRatioIdc);
571 H1(" --display-window <string> Describe overscan cropping region as 'left,top,right,bottom' in pixels\n");
572 H1(" --overscan <string> Specify whether it is appropriate for decoder to show cropped region: undef, show or crop. Default undef\n");
573 H0(" --videoformat <string> Specify video format from undef, component, pal, ntsc, secam, mac. Default undef\n");
574 H0(" --range <string> Specify black level and range of luma and chroma signals as full or limited Default limited\n");
575 H0(" --colorprim <string> Specify color primaries from bt709, unknown, reserved, bt470m, bt470bg, smpte170m,\n");
576 H0(" smpte240m, film, bt2020, smpte428, smpte431, smpte432. Default undef\n");
577 H0(" --transfer <string> Specify transfer characteristics from bt709, unknown, reserved, bt470m, bt470bg, smpte170m,\n");
578 H0(" smpte240m, linear, log100, log316, iec61966-2-4, bt1361e, iec61966-2-1,\n");
579 H0(" bt2020-10, bt2020-12, smpte2084, smpte428, arib-std-b67. Default undef\n");
580 H1(" --colormatrix <string> Specify color matrix setting from undef, bt709, fcc, bt470bg, smpte170m,\n");
581 H1(" smpte240m, GBR, YCgCo, bt2020nc, bt2020c, smpte2085, chroma-derived-nc, chroma-derived-c, ictcp. Default undef\n");
582 H1(" --chromaloc <integer> Specify chroma sample location (0 to 5). Default of %d\n", param->vui.chromaSampleLocTypeTopField);
583 H0(" --master-display <string> SMPTE ST 2086 master display color volume info SEI (HDR)\n");
584 H0(" format: G(x,y)B(x,y)R(x,y)WP(x,y)L(max,min)\n");
585 H0(" --max-cll <string> Emit content light level info SEI as \"cll,fall\" (HDR)\n");
586 H0(" --[no-]hdr Control dumping of HDR SEI packet. If max-cll or master-display has non-zero values, this is enabled. Default %s\n", OPT(param->bEmitHDRSEI));
587 H0(" --[no-]hdr-opt Add luma and chroma offsets for HDR/WCG content. Default %s\n", OPT(param->bHDROpt));
588 H0(" --min-luma <integer> Minimum luma plane value of input source picture\n");
589 H0(" --max-luma <integer> Maximum luma plane value of input source picture\n");
590 H0("\nBitstream options:\n");
591 H0(" --[no-]repeat-headers Emit SPS and PPS headers at each keyframe. Default %s\n", OPT(param->bRepeatHeaders));
592 H0(" --[no-]info Emit SEI identifying encoder and parameters. Default %s\n", OPT(param->bEmitInfoSEI));
593 H0(" --[no-]hrd Enable HRD parameters signaling. Default %s\n", OPT(param->bEmitHRDSEI));
594 H0(" --[no-]idr-recovery-sei Emit recovery point infor SEI at each IDR frame \n");
595 H0(" --[no-]temporal-layers Enable a temporal sublayer for unreferenced B frames. Default %s\n", OPT(param->bEnableTemporalSubLayers));
596 H0(" --[no-]aud Emit access unit delimiters at the start of each access unit. Default %s\n", OPT(param->bEnableAccessUnitDelimiters));
597 H1(" --hash <integer> Decoded Picture Hash SEI 0: disabled, 1: MD5, 2: CRC, 3: Checksum. Default %d\n", param->decodedPictureHashSEI);
598 H0(" --atc-sei <integer> Emit the alternative transfer characteristics SEI message where the integer is the preferred transfer characteristics. Default disabled\n");
599 H0(" --pic-struct <integer> Set the picture structure and emits it in the picture timing SEI message. Values in the range 0..12. See D.3.3 of the HEVC spec. for a detailed explanation.\n");
600 H0(" --log2-max-poc-lsb <integer> Maximum of the picture order count\n");
601 H0(" --[no-]vui-timing-info Emit VUI timing information in the bistream. Default %s\n", OPT(param->bEmitVUITimingInfo));
602 H0(" --[no-]vui-hrd-info Emit VUI HRD information in the bistream. Default %s\n", OPT(param->bEmitVUIHRDInfo));
603 H0(" --[no-]opt-qp-pps Dynamically optimize QP in PPS (instead of default 26) based on QPs in previous GOP. Default %s\n", OPT(param->bOptQpPPS));
604 H0(" --[no-]opt-ref-list-length-pps Dynamically set L0 and L1 ref list length in PPS (instead of default 0) based on values in last GOP. Default %s\n", OPT(param->bOptRefListLengthPPS));
605 H0(" --[no-]multi-pass-opt-rps Enable storing commonly used RPS in SPS in multi pass mode. Default %s\n", OPT(param->bMultiPassOptRPS));
606 H0(" --[no-]opt-cu-delta-qp Optimize to signal consistent CU level delta QPs in frame. Default %s\n", OPT(param->bOptCUDeltaQP));
607 H1("\nReconstructed video options (debugging):\n");
608 H1("-r/--recon <filename> Reconstructed raw image YUV or Y4M output file name\n");
609 H1(" --recon-depth <integer> Bit-depth of reconstructed raw image file. Defaults to input bit depth, or 8 if Y4M\n");
610 H1(" --recon-y4m-exec <string> pipe reconstructed frames to Y4M viewer, ex:\"ffplay -i pipe:0 -autoexit\"\n");
611 H0(" --lowpass-dct Use low-pass subband dct approximation. Default %s\n", OPT(param->bLowPassDct));
612 H1("\nExecutable return codes:\n");
613 H1(" 0 - encode successful\n");
614 H1(" 1 - unable to parse command line\n");
615 H1(" 2 - unable to open encoder\n");
616 H1(" 3 - unable to generate stream headers\n");
617 H1(" 4 - encoder abort\n");
618#undef OPT
619#undef H0
620#undef H1
621 if (level < X265_LOG_DEBUG)
622 printf("\nUse --fullhelp for a full listing (or --log-level full --help)\n");
623 printf("\n\nComplete documentation may be found at http://x265.readthedocs.org/en/default/cli.html\n");
624 exit(1);
625}
626
627#ifdef __cplusplus
628}
629#endif
630
631#endif
632/*------------------------------- PASTE END --------------------------------*/