OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 static const struct arg_enum_list test_decode_enum[] = { | 176 static const struct arg_enum_list test_decode_enum[] = { |
177 {"off", TEST_DECODE_OFF}, | 177 {"off", TEST_DECODE_OFF}, |
178 {"fatal", TEST_DECODE_FATAL}, | 178 {"fatal", TEST_DECODE_FATAL}, |
179 {"warn", TEST_DECODE_WARN}, | 179 {"warn", TEST_DECODE_WARN}, |
180 {NULL, 0} | 180 {NULL, 0} |
181 }; | 181 }; |
182 static const arg_def_t recontest = ARG_DEF_ENUM( | 182 static const arg_def_t recontest = ARG_DEF_ENUM( |
183 NULL, "test-decode", 1, "Test encode/decode mismatch", test_decode_enum); | 183 NULL, "test-decode", 1, "Test encode/decode mismatch", test_decode_enum); |
184 static const arg_def_t framerate = ARG_DEF( | 184 static const arg_def_t framerate = ARG_DEF( |
185 NULL, "fps", 1, "Stream frame rate (rate/scale)"); | 185 NULL, "fps", 1, "Stream frame rate (rate/scale)"); |
| 186 static const arg_def_t use_webm = ARG_DEF( |
| 187 NULL, "webm", 0, "Output WebM (default when WebM IO is enabled)"); |
186 static const arg_def_t use_ivf = ARG_DEF( | 188 static const arg_def_t use_ivf = ARG_DEF( |
187 NULL, "ivf", 0, "Output IVF (default is WebM if WebM IO is enabled)"); | 189 NULL, "ivf", 0, "Output IVF"); |
188 static const arg_def_t out_part = ARG_DEF( | 190 static const arg_def_t out_part = ARG_DEF( |
189 "P", "output-partitions", 0, | 191 "P", "output-partitions", 0, |
190 "Makes encoder output partitions. Requires IVF output!"); | 192 "Makes encoder output partitions. Requires IVF output!"); |
191 static const arg_def_t q_hist_n = ARG_DEF( | 193 static const arg_def_t q_hist_n = ARG_DEF( |
192 NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)"); | 194 NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)"); |
193 static const arg_def_t rate_hist_n = ARG_DEF( | 195 static const arg_def_t rate_hist_n = ARG_DEF( |
194 NULL, "rate-hist", 1, "Show rate histogram (n-buckets)"); | 196 NULL, "rate-hist", 1, "Show rate histogram (n-buckets)"); |
195 static const arg_def_t disable_warnings = ARG_DEF( | 197 static const arg_def_t disable_warnings = ARG_DEF( |
196 NULL, "disable-warnings", 0, | 198 NULL, "disable-warnings", 0, |
197 "Disable warnings about potentially incorrect encode settings."); | 199 "Disable warnings about potentially incorrect encode settings."); |
198 static const arg_def_t disable_warning_prompt = ARG_DEF( | 200 static const arg_def_t disable_warning_prompt = ARG_DEF( |
199 "y", "disable-warning-prompt", 0, | 201 "y", "disable-warning-prompt", 0, |
200 "Display warnings, but do not prompt user to continue."); | 202 "Display warnings, but do not prompt user to continue."); |
201 | 203 |
202 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 204 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
203 static const arg_def_t test16bitinternalarg = ARG_DEF( | 205 static const arg_def_t test16bitinternalarg = ARG_DEF( |
204 NULL, "test-16bit-internal", 0, "Force use of 16 bit internal buffer"); | 206 NULL, "test-16bit-internal", 0, "Force use of 16 bit internal buffer"); |
205 #endif | 207 #endif |
206 | 208 |
207 static const arg_def_t *main_args[] = { | 209 static const arg_def_t *main_args[] = { |
208 &debugmode, | 210 &debugmode, |
209 &outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &skip, | 211 &outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &skip, |
210 &deadline, &best_dl, &good_dl, &rt_dl, | 212 &deadline, &best_dl, &good_dl, &rt_dl, |
211 &quietarg, &verbosearg, &psnrarg, &use_ivf, &out_part, &q_hist_n, | 213 &quietarg, &verbosearg, &psnrarg, &use_webm, &use_ivf, &out_part, &q_hist_n, |
212 &rate_hist_n, &disable_warnings, &disable_warning_prompt, | 214 &rate_hist_n, &disable_warnings, &disable_warning_prompt, |
213 NULL | 215 NULL |
214 }; | 216 }; |
215 | 217 |
216 static const arg_def_t usage = ARG_DEF( | 218 static const arg_def_t usage = ARG_DEF( |
217 "u", "usage", 1, "Usage profile number to use"); | 219 "u", "usage", 1, "Usage profile number to use"); |
218 static const arg_def_t threads = ARG_DEF( | 220 static const arg_def_t threads = ARG_DEF( |
219 "t", "threads", 1, "Max number of threads to use"); | 221 "t", "threads", 1, "Max number of threads to use"); |
220 static const arg_def_t profile = ARG_DEF( | 222 static const arg_def_t profile = ARG_DEF( |
221 NULL, "profile", 1, "Bitstream profile number to use"); | 223 NULL, "profile", 1, "Bitstream profile number to use"); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 static const arg_def_t frame_parallel_decoding = ARG_DEF( | 391 static const arg_def_t frame_parallel_decoding = ARG_DEF( |
390 NULL, "frame-parallel", 1, "Enable frame parallel decodability features"); | 392 NULL, "frame-parallel", 1, "Enable frame parallel decodability features"); |
391 static const arg_def_t aq_mode = ARG_DEF( | 393 static const arg_def_t aq_mode = ARG_DEF( |
392 NULL, "aq-mode", 1, | 394 NULL, "aq-mode", 1, |
393 "Adaptive quantization mode (0: off (default), 1: variance 2: complexity, " | 395 "Adaptive quantization mode (0: off (default), 1: variance 2: complexity, " |
394 "3: cyclic refresh)"); | 396 "3: cyclic refresh)"); |
395 static const arg_def_t frame_periodic_boost = ARG_DEF( | 397 static const arg_def_t frame_periodic_boost = ARG_DEF( |
396 NULL, "frame-boost", 1, | 398 NULL, "frame-boost", 1, |
397 "Enable frame periodic boost (0: off (default), 1: on)"); | 399 "Enable frame periodic boost (0: off (default), 1: on)"); |
398 | 400 |
| 401 static const struct arg_enum_list color_space_enum[] = { |
| 402 { "unknown", VPX_CS_UNKNOWN }, |
| 403 { "bt601", VPX_CS_BT_601 }, |
| 404 { "bt709", VPX_CS_BT_709 }, |
| 405 { "smpte170", VPX_CS_SMPTE_170 }, |
| 406 { "smpte240", VPX_CS_SMPTE_240 }, |
| 407 { "bt2020", VPX_CS_BT_2020 }, |
| 408 { "reserved", VPX_CS_RESERVED }, |
| 409 { "sRGB", VPX_CS_SRGB }, |
| 410 { NULL, 0 } |
| 411 }; |
| 412 |
| 413 static const arg_def_t input_color_space = ARG_DEF_ENUM( |
| 414 NULL, "color-space", 1, |
| 415 "The color space of input content:", color_space_enum); |
| 416 |
399 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 417 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
400 static const struct arg_enum_list bitdepth_enum[] = { | 418 static const struct arg_enum_list bitdepth_enum[] = { |
401 {"8", VPX_BITS_8}, | 419 {"8", VPX_BITS_8}, |
402 {"10", VPX_BITS_10}, | 420 {"10", VPX_BITS_10}, |
403 {"12", VPX_BITS_12}, | 421 {"12", VPX_BITS_12}, |
404 {NULL, 0} | 422 {NULL, 0} |
405 }; | 423 }; |
406 | 424 |
407 static const arg_def_t bitdeptharg = ARG_DEF_ENUM( | 425 static const arg_def_t bitdeptharg = ARG_DEF_ENUM( |
408 "b", "bit-depth", 1, | 426 "b", "bit-depth", 1, |
(...skipping 11 matching lines...) Expand all Loading... |
420 | 438 |
421 static const arg_def_t tune_content = ARG_DEF_ENUM( | 439 static const arg_def_t tune_content = ARG_DEF_ENUM( |
422 NULL, "tune-content", 1, "Tune content type", tune_content_enum); | 440 NULL, "tune-content", 1, "Tune content type", tune_content_enum); |
423 | 441 |
424 static const arg_def_t *vp9_args[] = { | 442 static const arg_def_t *vp9_args[] = { |
425 &cpu_used_vp9, &auto_altref, &sharpness, &static_thresh, | 443 &cpu_used_vp9, &auto_altref, &sharpness, &static_thresh, |
426 &tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type, | 444 &tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type, |
427 &tune_ssim, &cq_level, &max_intra_rate_pct, &max_inter_rate_pct, | 445 &tune_ssim, &cq_level, &max_intra_rate_pct, &max_inter_rate_pct, |
428 &gf_cbr_boost_pct, &lossless, | 446 &gf_cbr_boost_pct, &lossless, |
429 &frame_parallel_decoding, &aq_mode, &frame_periodic_boost, | 447 &frame_parallel_decoding, &aq_mode, &frame_periodic_boost, |
430 &noise_sens, &tune_content, | 448 &noise_sens, &tune_content, &input_color_space, |
431 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 449 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
432 &bitdeptharg, &inbitdeptharg, | 450 &bitdeptharg, &inbitdeptharg, |
433 #endif | 451 #endif |
434 NULL | 452 NULL |
435 }; | 453 }; |
436 static const int vp9_arg_ctrl_map[] = { | 454 static const int vp9_arg_ctrl_map[] = { |
437 VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, | 455 VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, |
438 VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, | 456 VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, |
439 VP9E_SET_TILE_COLUMNS, VP9E_SET_TILE_ROWS, | 457 VP9E_SET_TILE_COLUMNS, VP9E_SET_TILE_ROWS, |
440 VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, | 458 VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 * shifting arguments but not consuming them. | 1061 * shifting arguments but not consuming them. |
1044 */ | 1062 */ |
1045 if (eos_mark_found) { | 1063 if (eos_mark_found) { |
1046 argj++; | 1064 argj++; |
1047 continue; | 1065 continue; |
1048 } else if (!strcmp(*argj, "--")) { | 1066 } else if (!strcmp(*argj, "--")) { |
1049 eos_mark_found = 1; | 1067 eos_mark_found = 1; |
1050 continue; | 1068 continue; |
1051 } | 1069 } |
1052 | 1070 |
1053 if (0) { | 1071 if (arg_match(&arg, &outputfile, argi)) { |
1054 } else if (arg_match(&arg, &outputfile, argi)) { | |
1055 config->out_fn = arg.val; | 1072 config->out_fn = arg.val; |
1056 } else if (arg_match(&arg, &fpf_name, argi)) { | 1073 } else if (arg_match(&arg, &fpf_name, argi)) { |
1057 config->stats_fn = arg.val; | 1074 config->stats_fn = arg.val; |
1058 #if CONFIG_FP_MB_STATS | 1075 #if CONFIG_FP_MB_STATS |
1059 } else if (arg_match(&arg, &fpmbf_name, argi)) { | 1076 } else if (arg_match(&arg, &fpmbf_name, argi)) { |
1060 config->fpmb_stats_fn = arg.val; | 1077 config->fpmb_stats_fn = arg.val; |
1061 #endif | 1078 #endif |
| 1079 } else if (arg_match(&arg, &use_webm, argi)) { |
| 1080 #if CONFIG_WEBM_IO |
| 1081 config->write_webm = 1; |
| 1082 #else |
| 1083 die("Error: --webm specified but webm is disabled."); |
| 1084 #endif |
1062 } else if (arg_match(&arg, &use_ivf, argi)) { | 1085 } else if (arg_match(&arg, &use_ivf, argi)) { |
1063 config->write_webm = 0; | 1086 config->write_webm = 0; |
1064 } else if (arg_match(&arg, &threads, argi)) { | 1087 } else if (arg_match(&arg, &threads, argi)) { |
1065 config->cfg.g_threads = arg_parse_uint(&arg); | 1088 config->cfg.g_threads = arg_parse_uint(&arg); |
1066 } else if (arg_match(&arg, &profile, argi)) { | 1089 } else if (arg_match(&arg, &profile, argi)) { |
1067 config->cfg.g_profile = arg_parse_uint(&arg); | 1090 config->cfg.g_profile = arg_parse_uint(&arg); |
1068 } else if (arg_match(&arg, &width, argi)) { | 1091 } else if (arg_match(&arg, &width, argi)) { |
1069 config->cfg.g_w = arg_parse_uint(&arg); | 1092 config->cfg.g_w = arg_parse_uint(&arg); |
1070 } else if (arg_match(&arg, &height, argi)) { | 1093 } else if (arg_match(&arg, &height, argi)) { |
1071 config->cfg.g_h = arg_parse_uint(&arg); | 1094 config->cfg.g_h = arg_parse_uint(&arg); |
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2234 | 2257 |
2235 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 2258 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
2236 if (allocated_raw_shift) | 2259 if (allocated_raw_shift) |
2237 vpx_img_free(&raw_shift); | 2260 vpx_img_free(&raw_shift); |
2238 #endif | 2261 #endif |
2239 vpx_img_free(&raw); | 2262 vpx_img_free(&raw); |
2240 free(argv); | 2263 free(argv); |
2241 free(streams); | 2264 free(streams); |
2242 return res ? EXIT_FAILURE : EXIT_SUCCESS; | 2265 return res ? EXIT_FAILURE : EXIT_SUCCESS; |
2243 } | 2266 } |
OLD | NEW |