| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 static const arg_def_t fpf_name_arg = | 53 static const arg_def_t fpf_name_arg = |
| 54 ARG_DEF(NULL, "fpf", 1, "First pass statistics file name"); | 54 ARG_DEF(NULL, "fpf", 1, "First pass statistics file name"); |
| 55 static const arg_def_t min_q_arg = | 55 static const arg_def_t min_q_arg = |
| 56 ARG_DEF(NULL, "min-q", 1, "Minimum quantizer"); | 56 ARG_DEF(NULL, "min-q", 1, "Minimum quantizer"); |
| 57 static const arg_def_t max_q_arg = | 57 static const arg_def_t max_q_arg = |
| 58 ARG_DEF(NULL, "max-q", 1, "Maximum quantizer"); | 58 ARG_DEF(NULL, "max-q", 1, "Maximum quantizer"); |
| 59 static const arg_def_t min_bitrate_arg = | 59 static const arg_def_t min_bitrate_arg = |
| 60 ARG_DEF(NULL, "min-bitrate", 1, "Minimum bitrate"); | 60 ARG_DEF(NULL, "min-bitrate", 1, "Minimum bitrate"); |
| 61 static const arg_def_t max_bitrate_arg = | 61 static const arg_def_t max_bitrate_arg = |
| 62 ARG_DEF(NULL, "max-bitrate", 1, "Maximum bitrate"); | 62 ARG_DEF(NULL, "max-bitrate", 1, "Maximum bitrate"); |
| 63 static const arg_def_t lag_in_frame_arg = |
| 64 ARG_DEF(NULL, "lag-in-frames", 1, "Number of frame to input before " |
| 65 "generating any outputs"); |
| 66 static const arg_def_t rc_end_usage_arg = |
| 67 ARG_DEF(NULL, "rc-end-usage", 1, "0 - 3: VBR, CBR, CQ, Q"); |
| 63 | 68 |
| 64 #if CONFIG_VP9_HIGHBITDEPTH | 69 #if CONFIG_VP9_HIGHBITDEPTH |
| 65 static const struct arg_enum_list bitdepth_enum[] = { | 70 static const struct arg_enum_list bitdepth_enum[] = { |
| 66 {"8", VPX_BITS_8}, | 71 {"8", VPX_BITS_8}, |
| 67 {"10", VPX_BITS_10}, | 72 {"10", VPX_BITS_10}, |
| 68 {"12", VPX_BITS_12}, | 73 {"12", VPX_BITS_12}, |
| 69 {NULL, 0} | 74 {NULL, 0} |
| 70 }; | 75 }; |
| 71 | 76 |
| 72 static const arg_def_t bitdepth_arg = | 77 static const arg_def_t bitdepth_arg = |
| 73 ARG_DEF_ENUM("d", "bit-depth", 1, "Bit depth for codec 8, 10 or 12. ", | 78 ARG_DEF_ENUM("d", "bit-depth", 1, "Bit depth for codec 8, 10 or 12. ", |
| 74 bitdepth_enum); | 79 bitdepth_enum); |
| 75 #endif // CONFIG_VP9_HIGHBITDEPTH | 80 #endif // CONFIG_VP9_HIGHBITDEPTH |
| 76 | 81 |
| 77 | 82 |
| 78 static const arg_def_t *svc_args[] = { | 83 static const arg_def_t *svc_args[] = { |
| 79 &frames_arg, &width_arg, &height_arg, | 84 &frames_arg, &width_arg, &height_arg, |
| 80 &timebase_arg, &bitrate_arg, &skip_frames_arg, &spatial_layers_arg, | 85 &timebase_arg, &bitrate_arg, &skip_frames_arg, &spatial_layers_arg, |
| 81 &kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg, | 86 &kf_dist_arg, &scale_factors_arg, &passes_arg, &pass_arg, |
| 82 &fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg, | 87 &fpf_name_arg, &min_q_arg, &max_q_arg, &min_bitrate_arg, |
| 83 &max_bitrate_arg, &temporal_layers_arg, | 88 &max_bitrate_arg, &temporal_layers_arg, &lag_in_frame_arg, |
| 84 #if CONFIG_VP9_HIGHBITDEPTH | 89 #if CONFIG_VP9_HIGHBITDEPTH |
| 85 &bitdepth_arg, | 90 &bitdepth_arg, |
| 86 #endif | 91 #endif |
| 87 NULL | 92 &rc_end_usage_arg, NULL |
| 88 }; | 93 }; |
| 89 | 94 |
| 90 static const uint32_t default_frames_to_skip = 0; | 95 static const uint32_t default_frames_to_skip = 0; |
| 91 static const uint32_t default_frames_to_code = 60 * 60; | 96 static const uint32_t default_frames_to_code = 60 * 60; |
| 92 static const uint32_t default_width = 1920; | 97 static const uint32_t default_width = 1920; |
| 93 static const uint32_t default_height = 1080; | 98 static const uint32_t default_height = 1080; |
| 94 static const uint32_t default_timebase_num = 1; | 99 static const uint32_t default_timebase_num = 1; |
| 95 static const uint32_t default_timebase_den = 60; | 100 static const uint32_t default_timebase_den = 60; |
| 96 static const uint32_t default_bitrate = 1000; | 101 static const uint32_t default_bitrate = 1000; |
| 97 static const uint32_t default_spatial_layers = 5; | 102 static const uint32_t default_spatial_layers = 5; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } else if (arg_match(&arg, &min_q_arg, argi)) { | 205 } else if (arg_match(&arg, &min_q_arg, argi)) { |
| 201 snprintf(string_options, sizeof(string_options), "%s min-quantizers=%s", | 206 snprintf(string_options, sizeof(string_options), "%s min-quantizers=%s", |
| 202 string_options, arg.val); | 207 string_options, arg.val); |
| 203 } else if (arg_match(&arg, &max_q_arg, argi)) { | 208 } else if (arg_match(&arg, &max_q_arg, argi)) { |
| 204 snprintf(string_options, sizeof(string_options), "%s max-quantizers=%s", | 209 snprintf(string_options, sizeof(string_options), "%s max-quantizers=%s", |
| 205 string_options, arg.val); | 210 string_options, arg.val); |
| 206 } else if (arg_match(&arg, &min_bitrate_arg, argi)) { | 211 } else if (arg_match(&arg, &min_bitrate_arg, argi)) { |
| 207 min_bitrate = arg_parse_uint(&arg); | 212 min_bitrate = arg_parse_uint(&arg); |
| 208 } else if (arg_match(&arg, &max_bitrate_arg, argi)) { | 213 } else if (arg_match(&arg, &max_bitrate_arg, argi)) { |
| 209 max_bitrate = arg_parse_uint(&arg); | 214 max_bitrate = arg_parse_uint(&arg); |
| 215 } else if (arg_match(&arg, &lag_in_frame_arg, argi)) { |
| 216 enc_cfg->g_lag_in_frames = arg_parse_uint(&arg); |
| 217 } else if (arg_match(&arg, &rc_end_usage_arg, argi)) { |
| 218 enc_cfg->rc_end_usage = arg_parse_uint(&arg); |
| 210 #if CONFIG_VP9_HIGHBITDEPTH | 219 #if CONFIG_VP9_HIGHBITDEPTH |
| 211 } else if (arg_match(&arg, &bitdepth_arg, argi)) { | 220 } else if (arg_match(&arg, &bitdepth_arg, argi)) { |
| 212 enc_cfg->g_bit_depth = arg_parse_enum_or_int(&arg); | 221 enc_cfg->g_bit_depth = arg_parse_enum_or_int(&arg); |
| 213 switch (enc_cfg->g_bit_depth) { | 222 switch (enc_cfg->g_bit_depth) { |
| 214 case VPX_BITS_8: | 223 case VPX_BITS_8: |
| 215 enc_cfg->g_input_bit_depth = 8; | 224 enc_cfg->g_input_bit_depth = 8; |
| 216 enc_cfg->g_profile = 0; | 225 enc_cfg->g_profile = 0; |
| 217 break; | 226 break; |
| 218 case VPX_BITS_10: | 227 case VPX_BITS_10: |
| 219 enc_cfg->g_input_bit_depth = 10; | 228 enc_cfg->g_input_bit_depth = 10; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 439 |
| 431 vpx_img_free(&raw); | 440 vpx_img_free(&raw); |
| 432 | 441 |
| 433 // display average size, psnr | 442 // display average size, psnr |
| 434 printf("%s", vpx_svc_dump_statistics(&svc_ctx)); | 443 printf("%s", vpx_svc_dump_statistics(&svc_ctx)); |
| 435 | 444 |
| 436 vpx_svc_release(&svc_ctx); | 445 vpx_svc_release(&svc_ctx); |
| 437 | 446 |
| 438 return EXIT_SUCCESS; | 447 return EXIT_SUCCESS; |
| 439 } | 448 } |
| OLD | NEW |