| @@ -287,6 +287,46 @@ static const arg_def_t *rc_args[] = { · 286 unmodified lines |
| 287 | &buf_sz, &buf_initial_sz, &buf_optimal_sz, NULL | 287 | &buf_sz, &buf_initial_sz, &buf_optimal_sz, NULL |
| 288 | }; | 288 | }; |
| 289 | | 289 | |
| | 290 | #if CONFIG_VP9_ENCODER |
| | 291 | static const arg_def_t active_wq_factor = |
| | 292 | ARG_DEF(NULL, "active-wq-factor", 1, "Active worst quality factor"); |
| | 293 | static const arg_def_t base_err_per_mb = |
| | 294 | ARG_DEF(NULL, "base-err-per-mb", 1, "Base error per macroblock"); |
| | 295 | static const arg_def_t sr_default_decay_limit = ARG_DEF( |
| | 296 | NULL, "sr-default-decay-limit", 1, "Second reference default decay limit"); |
| | 297 | static const arg_def_t sr_diff_factor = |
| | 298 | ARG_DEF(NULL, "sr-diff-factor", 1, "Second reference diff factor"); |
| | 299 | static const arg_def_t kf_err_per_mb = |
| | 300 | ARG_DEF(NULL, "kf-err-per-mb", 1, "Keyframe error per macroblock"); |
| | 301 | static const arg_def_t kf_frame_min_boost = |
| | 302 | ARG_DEF(NULL, "kf-frame-min-boost", 1, "Keyframe min boost"); |
| | 303 | static const arg_def_t kf_frame_max_boost_first = ARG_DEF( |
| | 304 | NULL, "kf-frame-max-boost-first", 1, "Max for the first keyframe boost"); |
| | 305 | static const arg_def_t kf_frame_max_boost_subs = ARG_DEF( |
| | 306 | NULL, "kf-frame-max-boost-subs", 1, "Max for subsequent keyframe boost"); |
| | 307 | static const arg_def_t kf_max_total_boost = |
| | 308 | ARG_DEF(NULL, "kf-max-total-boost", 1, "Keyframe max total boost"); |
| | 309 | static const arg_def_t gf_max_total_boost = |
| | 310 | ARG_DEF(NULL, "gf-max-total-boost", 1, "Golden frame max total boost"); |
| | 311 | static const arg_def_t gf_frame_max_boost = |
| | 312 | ARG_DEF(NULL, "gf-frame-max-boost", 1, "Golden frame max boost"); |
| | 313 | static const arg_def_t zm_power_factor = |
| | 314 | ARG_DEF(NULL, "zm-power-factor", 1, "Zero motion power factor"); |
| | 315 | static const arg_def_t *vizier_rc_args[] = { &active_wq_factor, |
| | 316 | &base_err_per_mb, |
| | 317 | &sr_default_decay_limit, |
| | 318 | &sr_diff_factor, |
| | 319 | &kf_err_per_mb, |
| | 320 | &kf_frame_min_boost, |
| | 321 | &kf_frame_max_boost_first, |
| | 322 | &kf_frame_max_boost_subs, |
| | 323 | &kf_max_total_boost, |
| | 324 | &gf_max_total_boost, |
| | 325 | &gf_frame_max_boost, |
| | 326 | &zm_power_factor, |
| | 327 | NULL }; |
| | 328 | #endif |
| | 329 | |
| 290 | static const arg_def_t bias_pct = | 330 | static const arg_def_t bias_pct = |
| 291 | ARG_DEF(NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)"); | 331 | ARG_DEF(NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)"); |
| 292 | static const arg_def_t minsection_pct = | 332 | static const arg_def_t minsection_pct = |
| @@ -573,6 +613,8 @@ static void show_help(FILE *fout, int shorthelp) { · 280 unmodified lines |
| 573 | #if CONFIG_VP9_ENCODER | 613 | #if CONFIG_VP9_ENCODER |
| 574 | fprintf(fout, "\nVP9 Specific Options:\n"); | 614 | fprintf(fout, "\nVP9 Specific Options:\n"); |
| 575 | arg_show_usage(fout, vp9_args); | 615 | arg_show_usage(fout, vp9_args); |
| | 616 | fprintf(fout, "\nVizier Rate Control Options:\n"); |
| | 617 | arg_show_usage(fout, vizier_rc_args); |
| 576 | #endif | 618 | #endif |
| 577 | fprintf(fout, | 619 | fprintf(fout, |
| 578 | "\nStream timebase (--timebase):\n" | 620 | "\nStream timebase (--timebase):\n" |
| @@ -983,6 +1025,32 @@ static int parse_stream_params(struct VpxEncoderConfig *global, · 404 unmodified lines |
| 983 | config->cfg.kf_max_dist = arg_parse_uint(&arg); | 1025 | config->cfg.kf_max_dist = arg_parse_uint(&arg); |
| 984 | } else if (arg_match(&arg, &kf_disabled, argi)) { | 1026 | } else if (arg_match(&arg, &kf_disabled, argi)) { |
| 985 | config->cfg.kf_mode = VPX_KF_DISABLED; | 1027 | config->cfg.kf_mode = VPX_KF_DISABLED; |
| | 1028 | #if CONFIG_VP9_ENCODER |
| | 1029 | } else if (arg_match(&arg, &active_wq_factor, argi)) { |
| | 1030 | config->cfg.active_wq_factor = arg_parse_rational(&arg); |
| | 1031 | } else if (arg_match(&arg, &base_err_per_mb, argi)) { |
| | 1032 | config->cfg.base_err_per_mb = arg_parse_rational(&arg); |
| | 1033 | } else if (arg_match(&arg, &sr_default_decay_limit, argi)) { |
| | 1034 | config->cfg.sr_default_decay_limit = arg_parse_rational(&arg); |
| | 1035 | } else if (arg_match(&arg, &sr_diff_factor, argi)) { |
| | 1036 | config->cfg.sr_diff_factor = arg_parse_rational(&arg); |
| | 1037 | } else if (arg_match(&arg, &kf_err_per_mb, argi)) { |
| | 1038 | config->cfg.kf_err_per_mb = arg_parse_rational(&arg); |
| | 1039 | } else if (arg_match(&arg, &kf_frame_min_boost, argi)) { |
| | 1040 | config->cfg.kf_frame_min_boost = arg_parse_rational(&arg); |
| | 1041 | } else if (arg_match(&arg, &kf_frame_max_boost_first, argi)) { |
| | 1042 | config->cfg.kf_frame_max_boost_first = arg_parse_rational(&arg); |
| | 1043 | } else if (arg_match(&arg, &kf_frame_max_boost_subs, argi)) { |
| | 1044 | config->cfg.kf_frame_max_boost_subs = arg_parse_rational(&arg); |
| | 1045 | } else if (arg_match(&arg, &kf_max_total_boost, argi)) { |
| | 1046 | config->cfg.kf_max_total_boost = arg_parse_rational(&arg); |
| | 1047 | } else if (arg_match(&arg, &gf_max_total_boost, argi)) { |
| | 1048 | config->cfg.gf_max_total_boost = arg_parse_rational(&arg); |
| | 1049 | } else if (arg_match(&arg, &gf_frame_max_boost, argi)) { |
| | 1050 | config->cfg.gf_frame_max_boost = arg_parse_rational(&arg); |
| | 1051 | } else if (arg_match(&arg, &zm_power_factor, argi)) { |
| | 1052 | config->cfg.zm_power_factor = arg_parse_rational(&arg); |
| | 1053 | #endif |
| 986 | #if CONFIG_VP9_HIGHBITDEPTH | 1054 | #if CONFIG_VP9_HIGHBITDEPTH |
| 987 | } else if (arg_match(&arg, &test16bitinternalarg, argi)) { | 1055 | } else if (arg_match(&arg, &test16bitinternalarg, argi)) { |
| 988 | if (strcmp(global->codec->name, "vp9") == 0) { | 1056 | if (strcmp(global->codec->name, "vp9") == 0) { |
| @@ -1177,6 +1245,9 @@ static void show_stream_config(struct stream_state *stream, · 188 unmodified lines |
| 1177 | SHOW(kf_mode); | 1245 | SHOW(kf_mode); |
| 1178 | SHOW(kf_min_dist); | 1246 | SHOW(kf_min_dist); |
| 1179 | SHOW(kf_max_dist); | 1247 | SHOW(kf_max_dist); |
| | 1248 | // Temporary use for debug |
| | 1249 | SHOW(active_wq_factor.num); |
| | 1250 | SHOW(active_wq_factor.den); |
| 1180 | } | 1251 | } |
| 1181 | | 1252 | |
| 1182 | static void open_output_file(struct stream_state *stream, | 1253 | static void open_output_file(struct stream_state *stream, |