If pass --use-vizier-rc-params=1, the rc parameters are overwittern by pass in values. It --use-vizier-rc-params=0, the rc parameters remain the default values.
Unified · Split
| @@ -258,6 +258,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, · 257 unmodified lines | |||
| 258 | #endif | 258 | #endif |
| 259 | 259 | ||
| 260 | // The range below shall be further tuned. | 260 | // The range below shall be further tuned. |
| 261 | RANGE_CHECK(cfg, use_vizier_rc_params, 0, 1); | ||
| 261 | RANGE_CHECK(cfg, active_wq_factor.den, 1, 1000); | 262 | RANGE_CHECK(cfg, active_wq_factor.den, 1, 1000); |
| 262 | RANGE_CHECK(cfg, base_err_per_mb.den, 1, 1000); | 263 | RANGE_CHECK(cfg, base_err_per_mb.den, 1, 1000); |
| 263 | RANGE_CHECK(cfg, sr_default_decay_limit.den, 1, 1000); | 264 | RANGE_CHECK(cfg, sr_default_decay_limit.den, 1, 1000); |
| @@ -1302,6 +1303,7 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] = { · 1038 unmodified lines | |||
| 1302 | { 0 }, /* ts_layer_id */ | 1303 | { 0 }, /* ts_layer_id */ |
| 1303 | { 0 }, /* layer_target_bitrate */ | 1304 | { 0 }, /* layer_target_bitrate */ |
| 1304 | 0, /* temporal_layering_mode */ | 1305 | 0, /* temporal_layering_mode */ |
| 1306 | 0, /* use_vizier_rc_params */ | ||
| 1305 | { 0, 1 }, /* active_wq_factor */ | 1307 | { 0, 1 }, /* active_wq_factor */ |
| 1306 | { 0, 1 }, /* base_err_per_mb */ | 1308 | { 0, 1 }, /* base_err_per_mb */ |
| 1307 | { 0, 1 }, /* sr_default_decay_limit */ | 1309 | { 0, 1 }, /* sr_default_decay_limit */ |
| @@ -3493,109 +3493,32 @@ static int is_skippable_frame(const VP9_COMP *cpi) { · 3492 unmodified lines | |||
| 3493 | // Configure image size specific vizier parameters. | 3493 | // Configure image size specific vizier parameters. |
| 3494 | // Later these will be set via additional command line options | 3494 | // Later these will be set via additional command line options |
| 3495 | static void init_vizier_params(TWO_PASS *const twopass, int screen_area) { | 3495 | static void init_vizier_params(TWO_PASS *const twopass, int screen_area) { |
| 3496 | if (1) { | 3496 | // When |use_vizier_rc_params| is 1, we expect the rc parameters have been |
| 3497 | // Force defaults for now | 3497 | // initialized by the pass in values. |
| 3498 | twopass->active_wq_factor = AV_WQ_FACTOR; | 3498 | // Be careful that parameters below are only initialized to 0, if we do not |
| 3499 | twopass->base_err_per_mb = BASELINE_ERR_PER_MB; | 3499 | // pass values to them. It is desired to take care of each parameter when |
| 3500 | twopass->sr_default_decay_limit = DEFAULT_DECAY_LIMIT; | 3500 | // using |use_vizier_rc_params|. |
| 3501 | twopass->sr_diff_factor = 1.0; | 3501 | if (twopass->use_vizier_rc_params) return; |
| 3502 | twopass->gf_frame_max_boost = GF_MAX_FRAME_BOOST; | 3502 | |
| 3503 | twopass->gf_max_total_boost = MAX_GF_BOOST; | 3503 | // When |use_vizier_rc_params| is 0, use defaults for now. |
| 3504 | if (screen_area < 1280 * 720) { | 3504 | twopass->active_wq_factor = AV_WQ_FACTOR; |
| 3505 | twopass->kf_err_per_mb = 2000.0; | 3505 | twopass->base_err_per_mb = BASELINE_ERR_PER_MB; |
| 3506 | } else if (screen_area < 1920 * 1080) { | 3506 | twopass->sr_default_decay_limit = DEFAULT_DECAY_LIMIT; |
| 3507 | twopass->kf_err_per_mb = 500.0; | 3507 | twopass->sr_diff_factor = 1.0; |
| 3508 | } else { | 3508 | twopass->gf_frame_max_boost = GF_MAX_FRAME_BOOST; |
| 3509 | twopass->kf_err_per_mb = 250.0; | 3509 | twopass->gf_max_total_boost = MAX_GF_BOOST; |
| 3510 | } | 3510 | if (screen_area < 1280 * 720) { |
| 3511 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | 3511 | twopass->kf_err_per_mb = 2000.0; |
| 3512 | twopass->kf_frame_max_boost_first = KF_MAX_FRAME_BOOST; | 3512 | } else if (screen_area < 1920 * 1080) { |
| 3513 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | 3513 | twopass->kf_err_per_mb = 500.0; |
| 3514 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3515 | twopass->zm_factor = 1.0; | ||
| 3516 | } else { | 3514 | } else { |
| 3517 | // Vizer experimental parameters from training. | 3515 | twopass->kf_err_per_mb = 250.0; |
| 3518 | // Later these will be set via the command line. | ||
| 3519 | if (screen_area <= 176 * 144) { | ||
| 3520 | twopass->active_wq_factor = 46.0; | ||
| 3521 | twopass->base_err_per_mb = 37597.399760969536; | ||
| 3522 | twopass->sr_default_decay_limit = 0.3905639800962774; | ||
| 3523 | twopass->sr_diff_factor = 6.4; | ||
| 3524 | twopass->gf_frame_max_boost = 87.27362648627846; | ||
| 3525 | twopass->gf_max_total_boost = MAX_GF_BOOST; | ||
| 3526 | twopass->kf_err_per_mb = 1854.8255436877148; | ||
| 3527 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3528 | twopass->kf_frame_max_boost_first = 25.5; | ||
| 3529 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3530 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3531 | twopass->zm_factor = 1.0; | ||
| 3532 | } else if (screen_area <= 320 * 240) { | ||
| 3533 | twopass->active_wq_factor = 55.0; | ||
| 3534 | twopass->base_err_per_mb = 34525.33177195309; | ||
| 3535 | twopass->sr_default_decay_limit = 0.23901360046804604; | ||
| 3536 | twopass->sr_diff_factor = 5.73; | ||
| 3537 | twopass->gf_frame_max_boost = 127.34978204980285; | ||
| 3538 | twopass->gf_max_total_boost = MAX_GF_BOOST; | ||
| 3539 | twopass->kf_err_per_mb = 723.8337508755031; | ||
| 3540 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3541 | twopass->kf_frame_max_boost_first = 185.0; | ||
| 3542 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3543 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3544 | twopass->zm_factor = 1.0; | ||
| 3545 | } else if (screen_area <= 640 * 360) { | ||
| 3546 | twopass->active_wq_factor = 12.5; | ||
| 3547 | twopass->base_err_per_mb = 18823.978018028298; | ||
| 3548 | twopass->sr_default_decay_limit = 0.6043527690301296; | ||
| 3549 | twopass->sr_diff_factor = 2.28; | ||
| 3550 | twopass->gf_frame_max_boost = 75.17672317013668; | ||
| 3551 | twopass->gf_max_total_boost = MAX_GF_BOOST; | ||
| 3552 | twopass->kf_err_per_mb = 422.2871502380377; | ||
| 3553 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3554 | twopass->kf_frame_max_boost_first = 224.5; | ||
| 3555 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3556 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3557 | twopass->zm_factor = 1.0; | ||
| 3558 | } else if (screen_area <= 854 * 480) { | ||
| 3559 | twopass->active_wq_factor = 51.5; | ||
| 3560 | twopass->base_err_per_mb = 33718.98307662595; | ||
| 3561 | twopass->sr_default_decay_limit = 0.33633414970713393; | ||
| 3562 | twopass->sr_diff_factor = 5.8; | ||
| 3563 | twopass->gf_frame_max_boost = 85.2868528581522; | ||
| 3564 | twopass->gf_max_total_boost = MAX_GF_BOOST; | ||
| 3565 | twopass->kf_err_per_mb = 1513.4883914008383; | ||
| 3566 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3567 | twopass->kf_frame_max_boost_first = 28.0; | ||
| 3568 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3569 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3570 | twopass->zm_factor = 1.0; | ||
| 3571 | } else if (screen_area <= 1280 * 720) { | ||
| 3572 | twopass->active_wq_factor = 41.5; | ||
| 3573 | twopass->base_err_per_mb = 29527.46375825401; | ||
| 3574 | twopass->sr_default_decay_limit = 0.5009117586299728; | ||
| 3575 | twopass->sr_diff_factor = 3.33; | ||
| 3576 | twopass->gf_frame_max_boost = 81.00472969483079; | ||
| 3577 | twopass->gf_max_total_boost = MAX_GF_BOOST; | ||
| 3578 | twopass->kf_err_per_mb = 998.6342911785146; | ||
| 3579 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3580 | twopass->kf_frame_max_boost_first = 53.0; | ||
| 3581 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3582 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3583 | twopass->zm_factor = 1.0; | ||
| 3584 | } else { | ||
| 3585 | twopass->active_wq_factor = 31.0; | ||
| 3586 | twopass->base_err_per_mb = 34474.723463367416; | ||
| 3587 | twopass->sr_default_decay_limit = 0.23346886902707745; | ||
| 3588 | twopass->sr_diff_factor = 7.6; | ||
| 3589 | twopass->gf_frame_max_boost = 213.2940230360479; | ||
| 3590 | twopass->gf_max_total_boost = MAX_GF_BOOST; | ||
| 3591 | twopass->kf_err_per_mb = 35931.25734431429; | ||
| 3592 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3593 | twopass->kf_frame_max_boost_first = 419.5; | ||
| 3594 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3595 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3596 | twopass->zm_factor = 1.0; | ||
| 3597 | } | ||
| 3598 | } | 3516 | } |
| 3517 | twopass->kf_frame_min_boost = KF_MIN_FRAME_BOOST; | ||
| 3518 | twopass->kf_frame_max_boost_first = KF_MAX_FRAME_BOOST; | ||
| 3519 | twopass->kf_frame_max_boost_subs = twopass->kf_frame_max_boost_first; | ||
| 3520 | twopass->kf_max_total_boost = MAX_KF_TOT_BOOST; | ||
| 3521 | twopass->zm_factor = 1.0; | ||
| 3599 | } | 3522 | } |
| 3600 | 3523 | ||
| 3601 | void vp9_rc_get_second_pass_params(VP9_COMP *cpi) { | 3524 | void vp9_rc_get_second_pass_params(VP9_COMP *cpi) { |
| @@ -223,6 +223,10 @@ typedef struct { · 222 unmodified lines | |||
| 223 | GF_GROUP gf_group; | 223 | GF_GROUP gf_group; |
| 224 | 224 | ||
| 225 | // Vizeir project experimental two pass rate control parameters. | 225 | // Vizeir project experimental two pass rate control parameters. |
| 226 | // When |use_vizier_rc_params| is 1, the following parameters will | ||
| 227 | // be overwritten by pass in values. Otherwise, they are initialized | ||
| 228 | // by default values. | ||
| 229 | int use_vizier_rc_params; | ||
| 226 | double active_wq_factor; | 230 | double active_wq_factor; |
| 227 | double base_err_per_mb; | 231 | double base_err_per_mb; |
| 228 | double sr_default_decay_limit; | 232 | double sr_default_decay_limit; |
| @@ -350,6 +350,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, · 349 unmodified lines | |||
| 350 | RANGE_CHECK(extra_cfg, color_range, VPX_CR_STUDIO_RANGE, VPX_CR_FULL_RANGE); | 350 | RANGE_CHECK(extra_cfg, color_range, VPX_CR_STUDIO_RANGE, VPX_CR_FULL_RANGE); |
| 351 | 351 | ||
| 352 | // The range below shall be further tuned. | 352 | // The range below shall be further tuned. |
| 353 | RANGE_CHECK(cfg, use_vizier_rc_params, 0, 1); | ||
| 353 | RANGE_CHECK(cfg, active_wq_factor.den, 1, 1000); | 354 | RANGE_CHECK(cfg, active_wq_factor.den, 1, 1000); |
| 354 | RANGE_CHECK(cfg, base_err_per_mb.den, 1, 1000); | 355 | RANGE_CHECK(cfg, base_err_per_mb.den, 1, 1000); |
| 355 | RANGE_CHECK(cfg, sr_default_decay_limit.den, 1, 1000); | 356 | RANGE_CHECK(cfg, sr_default_decay_limit.den, 1, 1000); |
| @@ -654,8 +655,10 @@ static vpx_codec_err_t set_encoder_config( · 298 unmodified lines | |||
| 654 | 655 | ||
| 655 | static vpx_codec_err_t set_twopass_params_from_config( | 656 | static vpx_codec_err_t set_twopass_params_from_config( |
| 656 | const vpx_codec_enc_cfg_t *const cfg, struct VP9_COMP *cpi) { | 657 | const vpx_codec_enc_cfg_t *const cfg, struct VP9_COMP *cpi) { |
| 658 | if (!cfg->use_vizier_rc_params) return VPX_CODEC_OK; | ||
| 657 | if (cpi == NULL) return VPX_CODEC_ERROR; | 659 | if (cpi == NULL) return VPX_CODEC_ERROR; |
| 658 | 660 | ||
| 661 | cpi->twopass.use_vizier_rc_params = cfg->use_vizier_rc_params; | ||
| 659 | cpi->twopass.active_wq_factor = | 662 | cpi->twopass.active_wq_factor = |
| 660 | (double)cfg->active_wq_factor.num / (double)cfg->active_wq_factor.den; | 663 | (double)cfg->active_wq_factor.num / (double)cfg->active_wq_factor.den; |
| 661 | cpi->twopass.base_err_per_mb = | 664 | cpi->twopass.base_err_per_mb = |
| @@ -1943,6 +1946,7 @@ static vpx_codec_enc_cfg_map_t encoder_usage_cfg_map[] = { · 1281 unmodified lines | |||
| 1943 | { 0 }, // ts_layer_id | 1946 | { 0 }, // ts_layer_id |
| 1944 | { 0 }, // layer_taget_bitrate | 1947 | { 0 }, // layer_taget_bitrate |
| 1945 | 0, // temporal_layering_mode | 1948 | 0, // temporal_layering_mode |
| 1949 | 0, // use_vizier_rc_params | ||
| 1946 | { 0, 1 }, // active_wq_factor | 1950 | { 0, 1 }, // active_wq_factor |
| 1947 | { 0, 1 }, // base_err_per_mb | 1951 | { 0, 1 }, // base_err_per_mb |
| 1948 | { 0, 1 }, // sr_default_decay_limit | 1952 | { 0, 1 }, // sr_default_decay_limit |
| @@ -694,9 +694,17 @@ typedef struct vpx_codec_enc_cfg { · 693 unmodified lines | |||
| 694 | */ | 694 | */ |
| 695 | int temporal_layering_mode; | 695 | int temporal_layering_mode; |
| 696 | 696 | ||
| 697 | /*!\brief A flag indicating whether to use external rate control parameters. | ||
| 698 | * By default is 0. If set to 1, the following parameters will be used in the | ||
| 699 | * rate control system. | ||
| 700 | */ | ||
| 701 | int use_vizier_rc_params; | ||
| 702 | |||
| 697 | /*!\brief Active worst quality factor. | 703 | /*!\brief Active worst quality factor. |
| 698 | * | 704 | * |
| 699 | * Rate control parameters, set from external experiment results. | 705 | * Rate control parameters, set from external experiment results. |
| 706 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 707 | * used. Otherwise, the default value is used. | ||
| 700 | * | 708 | * |
| 701 | */ | 709 | */ |
| 702 | vpx_rational_t active_wq_factor; | 710 | vpx_rational_t active_wq_factor; |
| @@ -704,6 +712,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 704 | /*!\brief Base error per macroblock. | 712 | /*!\brief Base error per macroblock. |
| 705 | * | 713 | * |
| 706 | * Rate control parameters, set from external experiment results. | 714 | * Rate control parameters, set from external experiment results. |
| 715 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 716 | * used. Otherwise, the default value is used. | ||
| 707 | * | 717 | * |
| 708 | */ | 718 | */ |
| 709 | vpx_rational_t base_err_per_mb; | 719 | vpx_rational_t base_err_per_mb; |
| @@ -711,6 +721,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 711 | /*!\brief Second reference default decay limit. | 721 | /*!\brief Second reference default decay limit. |
| 712 | * | 722 | * |
| 713 | * Rate control parameters, set from external experiment results. | 723 | * Rate control parameters, set from external experiment results. |
| 724 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 725 | * used. Otherwise, the default value is used. | ||
| 714 | * | 726 | * |
| 715 | */ | 727 | */ |
| 716 | vpx_rational_t sr_default_decay_limit; | 728 | vpx_rational_t sr_default_decay_limit; |
| @@ -718,6 +730,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 718 | /*!\brief Second reference difference factor. | 730 | /*!\brief Second reference difference factor. |
| 719 | * | 731 | * |
| 720 | * Rate control parameters, set from external experiment results. | 732 | * Rate control parameters, set from external experiment results. |
| 733 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 734 | * used. Otherwise, the default value is used. | ||
| 721 | * | 735 | * |
| 722 | */ | 736 | */ |
| 723 | vpx_rational_t sr_diff_factor; | 737 | vpx_rational_t sr_diff_factor; |
| @@ -725,6 +739,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 725 | /*!\brief Keyframe error per macroblock. | 739 | /*!\brief Keyframe error per macroblock. |
| 726 | * | 740 | * |
| 727 | * Rate control parameters, set from external experiment results. | 741 | * Rate control parameters, set from external experiment results. |
| 742 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 743 | * used. Otherwise, the default value is used. | ||
| 728 | * | 744 | * |
| 729 | */ | 745 | */ |
| 730 | vpx_rational_t kf_err_per_mb; | 746 | vpx_rational_t kf_err_per_mb; |
| @@ -732,6 +748,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 732 | /*!\brief Keyframe minimum boost. | 748 | /*!\brief Keyframe minimum boost. |
| 733 | * | 749 | * |
| 734 | * Rate control parameters, set from external experiment results. | 750 | * Rate control parameters, set from external experiment results. |
| 751 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 752 | * used. Otherwise, the default value is used. | ||
| 735 | * | 753 | * |
| 736 | */ | 754 | */ |
| 737 | vpx_rational_t kf_frame_min_boost; | 755 | vpx_rational_t kf_frame_min_boost; |
| @@ -739,6 +757,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 739 | /*!\brief Keyframe maximum boost, for the first keyframe in a chunk. | 757 | /*!\brief Keyframe maximum boost, for the first keyframe in a chunk. |
| 740 | * | 758 | * |
| 741 | * Rate control parameters, set from external experiment results. | 759 | * Rate control parameters, set from external experiment results. |
| 760 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 761 | * used. Otherwise, the default value is used. | ||
| 742 | * | 762 | * |
| 743 | */ | 763 | */ |
| 744 | vpx_rational_t kf_frame_max_boost_first; | 764 | vpx_rational_t kf_frame_max_boost_first; |
| @@ -746,6 +766,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 746 | /*!\brief Keyframe maximum boost, for subsequent keyframes. | 766 | /*!\brief Keyframe maximum boost, for subsequent keyframes. |
| 747 | * | 767 | * |
| 748 | * Rate control parameters, set from external experiment results. | 768 | * Rate control parameters, set from external experiment results. |
| 769 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 770 | * used. Otherwise, the default value is used. | ||
| 749 | * | 771 | * |
| 750 | */ | 772 | */ |
| 751 | vpx_rational_t kf_frame_max_boost_subs; | 773 | vpx_rational_t kf_frame_max_boost_subs; |
| @@ -753,6 +775,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 753 | /*!\brief Keyframe maximum total boost. | 775 | /*!\brief Keyframe maximum total boost. |
| 754 | * | 776 | * |
| 755 | * Rate control parameters, set from external experiment results. | 777 | * Rate control parameters, set from external experiment results. |
| 778 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 779 | * used. Otherwise, the default value is used. | ||
| 756 | * | 780 | * |
| 757 | */ | 781 | */ |
| 758 | vpx_rational_t kf_max_total_boost; | 782 | vpx_rational_t kf_max_total_boost; |
| @@ -760,6 +784,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 760 | /*!\brief Golden frame maximum total boost. | 784 | /*!\brief Golden frame maximum total boost. |
| 761 | * | 785 | * |
| 762 | * Rate control parameters, set from external experiment results. | 786 | * Rate control parameters, set from external experiment results. |
| 787 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 788 | * used. Otherwise, the default value is used. | ||
| 763 | * | 789 | * |
| 764 | */ | 790 | */ |
| 765 | vpx_rational_t gf_max_total_boost; | 791 | vpx_rational_t gf_max_total_boost; |
| @@ -767,6 +793,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 767 | /*!\brief Golden frame maximum boost. | 793 | /*!\brief Golden frame maximum boost. |
| 768 | * | 794 | * |
| 769 | * Rate control parameters, set from external experiment results. | 795 | * Rate control parameters, set from external experiment results. |
| 796 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 797 | * used. Otherwise, the default value is used. | ||
| 770 | * | 798 | * |
| 771 | */ | 799 | */ |
| 772 | vpx_rational_t gf_frame_max_boost; | 800 | vpx_rational_t gf_frame_max_boost; |
| @@ -774,6 +802,8 @@ typedef struct vpx_codec_enc_cfg { · 1 unmodified line | |||
| 774 | /*!\brief Zero motion power factor. | 802 | /*!\brief Zero motion power factor. |
| 775 | * | 803 | * |
| 776 | * Rate control parameters, set from external experiment results. | 804 | * Rate control parameters, set from external experiment results. |
| 805 | * Only when |use_vizier_rc_params| is set to 1, the pass in value will be | ||
| 806 | * used. Otherwise, the default value is used. | ||
| 777 | * | 807 | * |
| 778 | */ | 808 | */ |
| 779 | vpx_rational_t zm_factor; | 809 | vpx_rational_t zm_factor; |
| @@ -288,6 +288,8 @@ static const arg_def_t *rc_args[] = { · 287 unmodified lines | |||
| 288 | }; | 288 | }; |
| 289 | 289 | ||
| 290 | #if CONFIG_VP9_ENCODER | 290 | #if CONFIG_VP9_ENCODER |
| 291 | static const arg_def_t use_vizier_rc_params = | ||
| 292 | ARG_DEF(NULL, "use-vizier-rc-params", 1, "Use vizier rc params"); | ||
| 291 | static const arg_def_t active_wq_factor = | 293 | static const arg_def_t active_wq_factor = |
| 292 | ARG_DEF(NULL, "active-wq-factor", 1, "Active worst quality factor"); | 294 | ARG_DEF(NULL, "active-wq-factor", 1, "Active worst quality factor"); |
| 293 | static const arg_def_t base_err_per_mb = | 295 | static const arg_def_t base_err_per_mb = |
| @@ -311,8 +313,9 @@ static const arg_def_t gf_max_total_boost = · 17 unmodified lines | |||
| 311 | static const arg_def_t gf_frame_max_boost = | 313 | static const arg_def_t gf_frame_max_boost = |
| 312 | ARG_DEF(NULL, "gf-frame-max-boost", 1, "Golden frame max boost"); | 314 | ARG_DEF(NULL, "gf-frame-max-boost", 1, "Golden frame max boost"); |
| 313 | static const arg_def_t zm_factor = | 315 | static const arg_def_t zm_factor = |
| 314 | ARG_DEF(NULL, "zm-power-factor", 1, "Zero motion power factor"); | 316 | ARG_DEF(NULL, "zm-factor", 1, "Zero motion power factor"); |
| 315 | static const arg_def_t *vizier_rc_args[] = { &active_wq_factor, | 317 | static const arg_def_t *vizier_rc_args[] = { &use_vizier_rc_params, |
| 318 | &active_wq_factor, | ||
| 316 | &base_err_per_mb, | 319 | &base_err_per_mb, |
| 317 | &sr_default_decay_limit, | 320 | &sr_default_decay_limit, |
| 318 | &sr_diff_factor, | 321 | &sr_diff_factor, |
| @@ -1026,6 +1029,8 @@ static int parse_stream_params(struct VpxEncoderConfig *global, · 707 unmodified lines | |||
| 1026 | } else if (arg_match(&arg, &kf_disabled, argi)) { | 1029 | } else if (arg_match(&arg, &kf_disabled, argi)) { |
| 1027 | config->cfg.kf_mode = VPX_KF_DISABLED; | 1030 | config->cfg.kf_mode = VPX_KF_DISABLED; |
| 1028 | #if CONFIG_VP9_ENCODER | 1031 | #if CONFIG_VP9_ENCODER |
| 1032 | } else if (arg_match(&arg, &use_vizier_rc_params, argi)) { | ||
| 1033 | config->cfg.use_vizier_rc_params = arg_parse_int(&arg); | ||
| 1029 | } else if (arg_match(&arg, &active_wq_factor, argi)) { | 1034 | } else if (arg_match(&arg, &active_wq_factor, argi)) { |
| 1030 | config->cfg.active_wq_factor = arg_parse_rational(&arg); | 1035 | config->cfg.active_wq_factor = arg_parse_rational(&arg); |
| 1031 | } else if (arg_match(&arg, &base_err_per_mb, argi)) { | 1036 | } else if (arg_match(&arg, &base_err_per_mb, argi)) { |
| @@ -1246,6 +1251,7 @@ static void show_stream_config(struct stream_state *stream, · 214 unmodified lines | |||
| 1246 | SHOW(kf_min_dist); | 1251 | SHOW(kf_min_dist); |
| 1247 | SHOW(kf_max_dist); | 1252 | SHOW(kf_max_dist); |
| 1248 | // Temporary use for debug | 1253 | // Temporary use for debug |
| 1254 | SHOW(use_vizier_rc_params); | ||
| 1249 | SHOW(active_wq_factor.num); | 1255 | SHOW(active_wq_factor.num); |
| 1250 | SHOW(active_wq_factor.den); | 1256 | SHOW(active_wq_factor.den); |
| 1251 | } | 1257 | } |