| 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)"); | |
| 188 static const arg_def_t use_ivf = ARG_DEF( | 186 static const arg_def_t use_ivf = ARG_DEF( |
| 189 NULL, "ivf", 0, "Output IVF"); | 187 NULL, "ivf", 0, "Output IVF (default is WebM if WebM IO is enabled)"); |
| 190 static const arg_def_t out_part = ARG_DEF( | 188 static const arg_def_t out_part = ARG_DEF( |
| 191 "P", "output-partitions", 0, | 189 "P", "output-partitions", 0, |
| 192 "Makes encoder output partitions. Requires IVF output!"); | 190 "Makes encoder output partitions. Requires IVF output!"); |
| 193 static const arg_def_t q_hist_n = ARG_DEF( | 191 static const arg_def_t q_hist_n = ARG_DEF( |
| 194 NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)"); | 192 NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)"); |
| 195 static const arg_def_t rate_hist_n = ARG_DEF( | 193 static const arg_def_t rate_hist_n = ARG_DEF( |
| 196 NULL, "rate-hist", 1, "Show rate histogram (n-buckets)"); | 194 NULL, "rate-hist", 1, "Show rate histogram (n-buckets)"); |
| 197 static const arg_def_t disable_warnings = ARG_DEF( | 195 static const arg_def_t disable_warnings = ARG_DEF( |
| 198 NULL, "disable-warnings", 0, | 196 NULL, "disable-warnings", 0, |
| 199 "Disable warnings about potentially incorrect encode settings."); | 197 "Disable warnings about potentially incorrect encode settings."); |
| 200 static const arg_def_t disable_warning_prompt = ARG_DEF( | 198 static const arg_def_t disable_warning_prompt = ARG_DEF( |
| 201 "y", "disable-warning-prompt", 0, | 199 "y", "disable-warning-prompt", 0, |
| 202 "Display warnings, but do not prompt user to continue."); | 200 "Display warnings, but do not prompt user to continue."); |
| 203 | 201 |
| 204 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 202 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
| 205 static const arg_def_t test16bitinternalarg = ARG_DEF( | 203 static const arg_def_t test16bitinternalarg = ARG_DEF( |
| 206 NULL, "test-16bit-internal", 0, "Force use of 16 bit internal buffer"); | 204 NULL, "test-16bit-internal", 0, "Force use of 16 bit internal buffer"); |
| 207 #endif | 205 #endif |
| 208 | 206 |
| 209 static const arg_def_t *main_args[] = { | 207 static const arg_def_t *main_args[] = { |
| 210 &debugmode, | 208 &debugmode, |
| 211 &outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &skip, | 209 &outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &skip, |
| 212 &deadline, &best_dl, &good_dl, &rt_dl, | 210 &deadline, &best_dl, &good_dl, &rt_dl, |
| 213 &quietarg, &verbosearg, &psnrarg, &use_webm, &use_ivf, &out_part, &q_hist_n, | 211 &quietarg, &verbosearg, &psnrarg, &use_ivf, &out_part, &q_hist_n, |
| 214 &rate_hist_n, &disable_warnings, &disable_warning_prompt, | 212 &rate_hist_n, &disable_warnings, &disable_warning_prompt, |
| 215 NULL | 213 NULL |
| 216 }; | 214 }; |
| 217 | 215 |
| 218 static const arg_def_t usage = ARG_DEF( | 216 static const arg_def_t usage = ARG_DEF( |
| 219 "u", "usage", 1, "Usage profile number to use"); | 217 "u", "usage", 1, "Usage profile number to use"); |
| 220 static const arg_def_t threads = ARG_DEF( | 218 static const arg_def_t threads = ARG_DEF( |
| 221 "t", "threads", 1, "Max number of threads to use"); | 219 "t", "threads", 1, "Max number of threads to use"); |
| 222 static const arg_def_t profile = ARG_DEF( | 220 static const arg_def_t profile = ARG_DEF( |
| 223 NULL, "profile", 1, "Bitstream profile number to use"); | 221 NULL, "profile", 1, "Bitstream profile number to use"); |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 | 1052 |
| 1055 if (0) { | 1053 if (0) { |
| 1056 } else if (arg_match(&arg, &outputfile, argi)) { | 1054 } else if (arg_match(&arg, &outputfile, argi)) { |
| 1057 config->out_fn = arg.val; | 1055 config->out_fn = arg.val; |
| 1058 } else if (arg_match(&arg, &fpf_name, argi)) { | 1056 } else if (arg_match(&arg, &fpf_name, argi)) { |
| 1059 config->stats_fn = arg.val; | 1057 config->stats_fn = arg.val; |
| 1060 #if CONFIG_FP_MB_STATS | 1058 #if CONFIG_FP_MB_STATS |
| 1061 } else if (arg_match(&arg, &fpmbf_name, argi)) { | 1059 } else if (arg_match(&arg, &fpmbf_name, argi)) { |
| 1062 config->fpmb_stats_fn = arg.val; | 1060 config->fpmb_stats_fn = arg.val; |
| 1063 #endif | 1061 #endif |
| 1064 } else if (arg_match(&arg, &use_webm, argi)) { | |
| 1065 #if CONFIG_WEBM_IO | |
| 1066 config->write_webm = 1; | |
| 1067 #else | |
| 1068 die("Error: --webm specified but webm is disabled."); | |
| 1069 #endif | |
| 1070 } else if (arg_match(&arg, &use_ivf, argi)) { | 1062 } else if (arg_match(&arg, &use_ivf, argi)) { |
| 1071 config->write_webm = 0; | 1063 config->write_webm = 0; |
| 1072 } else if (arg_match(&arg, &threads, argi)) { | 1064 } else if (arg_match(&arg, &threads, argi)) { |
| 1073 config->cfg.g_threads = arg_parse_uint(&arg); | 1065 config->cfg.g_threads = arg_parse_uint(&arg); |
| 1074 } else if (arg_match(&arg, &profile, argi)) { | 1066 } else if (arg_match(&arg, &profile, argi)) { |
| 1075 config->cfg.g_profile = arg_parse_uint(&arg); | 1067 config->cfg.g_profile = arg_parse_uint(&arg); |
| 1076 } else if (arg_match(&arg, &width, argi)) { | 1068 } else if (arg_match(&arg, &width, argi)) { |
| 1077 config->cfg.g_w = arg_parse_uint(&arg); | 1069 config->cfg.g_w = arg_parse_uint(&arg); |
| 1078 } else if (arg_match(&arg, &height, argi)) { | 1070 } else if (arg_match(&arg, &height, argi)) { |
| 1079 config->cfg.g_h = arg_parse_uint(&arg); | 1071 config->cfg.g_h = arg_parse_uint(&arg); |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2242 | 2234 |
| 2243 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 2235 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
| 2244 if (allocated_raw_shift) | 2236 if (allocated_raw_shift) |
| 2245 vpx_img_free(&raw_shift); | 2237 vpx_img_free(&raw_shift); |
| 2246 #endif | 2238 #endif |
| 2247 vpx_img_free(&raw); | 2239 vpx_img_free(&raw); |
| 2248 free(argv); | 2240 free(argv); |
| 2249 free(streams); | 2241 free(streams); |
| 2250 return res ? EXIT_FAILURE : EXIT_SUCCESS; | 2242 return res ? EXIT_FAILURE : EXIT_SUCCESS; |
| 2251 } | 2243 } |
| OLD | NEW |