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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 &kf_min_dist, &kf_max_dist, &kf_disabled, NULL | 321 &kf_min_dist, &kf_max_dist, &kf_disabled, NULL |
322 }; | 322 }; |
323 | 323 |
324 | 324 |
325 static const arg_def_t noise_sens = ARG_DEF( | 325 static const arg_def_t noise_sens = ARG_DEF( |
326 NULL, "noise-sensitivity", 1, "Noise sensitivity (frames to blur)"); | 326 NULL, "noise-sensitivity", 1, "Noise sensitivity (frames to blur)"); |
327 static const arg_def_t sharpness = ARG_DEF( | 327 static const arg_def_t sharpness = ARG_DEF( |
328 NULL, "sharpness", 1, "Loop filter sharpness (0..7)"); | 328 NULL, "sharpness", 1, "Loop filter sharpness (0..7)"); |
329 static const arg_def_t static_thresh = ARG_DEF( | 329 static const arg_def_t static_thresh = ARG_DEF( |
330 NULL, "static-thresh", 1, "Motion detection threshold"); | 330 NULL, "static-thresh", 1, "Motion detection threshold"); |
331 static const arg_def_t cpu_used = ARG_DEF( | 331 static const arg_def_t cpu_used_vp8 = ARG_DEF( |
332 NULL, "cpu-used", 1, "CPU Used (-16..16)"); | 332 NULL, "cpu-used", 1, "CPU Used (-16..16)"); |
| 333 static const arg_def_t cpu_used_vp9 = ARG_DEF( |
| 334 NULL, "cpu-used", 1, "CPU Used (-8..8)"); |
333 static const arg_def_t auto_altref = ARG_DEF( | 335 static const arg_def_t auto_altref = ARG_DEF( |
334 NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames"); | 336 NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames"); |
335 static const arg_def_t arnr_maxframes = ARG_DEF( | 337 static const arg_def_t arnr_maxframes = ARG_DEF( |
336 NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)"); | 338 NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)"); |
337 static const arg_def_t arnr_strength = ARG_DEF( | 339 static const arg_def_t arnr_strength = ARG_DEF( |
338 NULL, "arnr-strength", 1, "AltRef filter strength (0..6)"); | 340 NULL, "arnr-strength", 1, "AltRef filter strength (0..6)"); |
339 static const arg_def_t arnr_type = ARG_DEF( | 341 static const arg_def_t arnr_type = ARG_DEF( |
340 NULL, "arnr-type", 1, "AltRef type"); | 342 NULL, "arnr-type", 1, "AltRef type"); |
341 static const struct arg_enum_list tuning_enum[] = { | 343 static const struct arg_enum_list tuning_enum[] = { |
342 {"psnr", VP8_TUNE_PSNR}, | 344 {"psnr", VP8_TUNE_PSNR}, |
(...skipping 11 matching lines...) Expand all Loading... |
354 static const arg_def_t gf_cbr_boost_pct = ARG_DEF( | 356 static const arg_def_t gf_cbr_boost_pct = ARG_DEF( |
355 NULL, "gf-cbr-boost", 1, "Boost for Golden Frame in CBR mode (pct)"); | 357 NULL, "gf-cbr-boost", 1, "Boost for Golden Frame in CBR mode (pct)"); |
356 | 358 |
357 static const arg_def_t screen_content_mode = ARG_DEF(NULL, "screen-content-mode"
, 1, | 359 static const arg_def_t screen_content_mode = ARG_DEF(NULL, "screen-content-mode"
, 1, |
358 "Screen content mode"); | 360 "Screen content mode"); |
359 | 361 |
360 #if CONFIG_VP8_ENCODER | 362 #if CONFIG_VP8_ENCODER |
361 static const arg_def_t token_parts = ARG_DEF( | 363 static const arg_def_t token_parts = ARG_DEF( |
362 NULL, "token-parts", 1, "Number of token partitions to use, log2"); | 364 NULL, "token-parts", 1, "Number of token partitions to use, log2"); |
363 static const arg_def_t *vp8_args[] = { | 365 static const arg_def_t *vp8_args[] = { |
364 &cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh, | 366 &cpu_used_vp8, &auto_altref, &noise_sens, &sharpness, &static_thresh, |
365 &token_parts, &arnr_maxframes, &arnr_strength, &arnr_type, | 367 &token_parts, &arnr_maxframes, &arnr_strength, &arnr_type, |
366 &tune_ssim, &cq_level, &max_intra_rate_pct, &screen_content_mode, | 368 &tune_ssim, &cq_level, &max_intra_rate_pct, &screen_content_mode, |
367 NULL | 369 NULL |
368 }; | 370 }; |
369 static const int vp8_arg_ctrl_map[] = { | 371 static const int vp8_arg_ctrl_map[] = { |
370 VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, | 372 VP8E_SET_CPUUSED, VP8E_SET_ENABLEAUTOALTREF, |
371 VP8E_SET_NOISE_SENSITIVITY, VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, | 373 VP8E_SET_NOISE_SENSITIVITY, VP8E_SET_SHARPNESS, VP8E_SET_STATIC_THRESHOLD, |
372 VP8E_SET_TOKEN_PARTITIONS, | 374 VP8E_SET_TOKEN_PARTITIONS, |
373 VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, | 375 VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE, |
374 VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT, | 376 VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 static const struct arg_enum_list tune_content_enum[] = { | 415 static const struct arg_enum_list tune_content_enum[] = { |
414 {"default", VP9E_CONTENT_DEFAULT}, | 416 {"default", VP9E_CONTENT_DEFAULT}, |
415 {"screen", VP9E_CONTENT_SCREEN}, | 417 {"screen", VP9E_CONTENT_SCREEN}, |
416 {NULL, 0} | 418 {NULL, 0} |
417 }; | 419 }; |
418 | 420 |
419 static const arg_def_t tune_content = ARG_DEF_ENUM( | 421 static const arg_def_t tune_content = ARG_DEF_ENUM( |
420 NULL, "tune-content", 1, "Tune content type", tune_content_enum); | 422 NULL, "tune-content", 1, "Tune content type", tune_content_enum); |
421 | 423 |
422 static const arg_def_t *vp9_args[] = { | 424 static const arg_def_t *vp9_args[] = { |
423 &cpu_used, &auto_altref, &sharpness, &static_thresh, | 425 &cpu_used_vp9, &auto_altref, &sharpness, &static_thresh, |
424 &tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type, | 426 &tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type, |
425 &tune_ssim, &cq_level, &max_intra_rate_pct, &max_inter_rate_pct, | 427 &tune_ssim, &cq_level, &max_intra_rate_pct, &max_inter_rate_pct, |
426 &gf_cbr_boost_pct, &lossless, | 428 &gf_cbr_boost_pct, &lossless, |
427 &frame_parallel_decoding, &aq_mode, &frame_periodic_boost, | 429 &frame_parallel_decoding, &aq_mode, &frame_periodic_boost, |
428 &noise_sens, &tune_content, | 430 &noise_sens, &tune_content, |
429 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 431 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
430 &bitdeptharg, &inbitdeptharg, | 432 &bitdeptharg, &inbitdeptharg, |
431 #endif | 433 #endif |
432 NULL | 434 NULL |
433 }; | 435 }; |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1190 struct stream_state *stream; \ | 1192 struct stream_state *stream; \ |
1191 for (stream = streams; stream; stream = stream->next) { \ | 1193 for (stream = streams; stream; stream = stream->next) { \ |
1192 func; \ | 1194 func; \ |
1193 } \ | 1195 } \ |
1194 } while (0) | 1196 } while (0) |
1195 | 1197 |
1196 | 1198 |
1197 static void validate_stream_config(const struct stream_state *stream, | 1199 static void validate_stream_config(const struct stream_state *stream, |
1198 const struct VpxEncoderConfig *global) { | 1200 const struct VpxEncoderConfig *global) { |
1199 const struct stream_state *streami; | 1201 const struct stream_state *streami; |
| 1202 (void)global; |
1200 | 1203 |
1201 if (!stream->config.cfg.g_w || !stream->config.cfg.g_h) | 1204 if (!stream->config.cfg.g_w || !stream->config.cfg.g_h) |
1202 fatal("Stream %d: Specify stream dimensions with --width (-w) " | 1205 fatal("Stream %d: Specify stream dimensions with --width (-w) " |
1203 " and --height (-h)", stream->index); | 1206 " and --height (-h)", stream->index); |
1204 | 1207 |
1205 // Check that the codec bit depth is greater than the input bit depth. | 1208 // Check that the codec bit depth is greater than the input bit depth. |
1206 if (stream->config.cfg.g_input_bit_depth > | 1209 if (stream->config.cfg.g_input_bit_depth > |
1207 (unsigned int)stream->config.cfg.g_bit_depth) { | 1210 (unsigned int)stream->config.cfg.g_bit_depth) { |
1208 fatal("Stream %d: codec bit depth (%d) less than input bit depth (%d)", | 1211 fatal("Stream %d: codec bit depth (%d) less than input bit depth (%d)", |
1209 stream->index, (int)stream->config.cfg.g_bit_depth, | 1212 stream->index, (int)stream->config.cfg.g_bit_depth, |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2231 | 2234 |
2232 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 2235 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
2233 if (allocated_raw_shift) | 2236 if (allocated_raw_shift) |
2234 vpx_img_free(&raw_shift); | 2237 vpx_img_free(&raw_shift); |
2235 #endif | 2238 #endif |
2236 vpx_img_free(&raw); | 2239 vpx_img_free(&raw); |
2237 free(argv); | 2240 free(argv); |
2238 free(streams); | 2241 free(streams); |
2239 return res ? EXIT_FAILURE : EXIT_SUCCESS; | 2242 return res ? EXIT_FAILURE : EXIT_SUCCESS; |
2240 } | 2243 } |
OLD | NEW |