Commit 992c41d2 authored by Paul Wilkins's avatar Paul Wilkins
Browse files

Speed setting correction to max q estimate.

Use a crude correction factor to correct for
lower compression efficiency at higher encode
speeds when estimating the max Q for the
clip.

Change-Id: I5ae377647f4adf5e91d700a8791fb3b8f70efc73
parent e1574b94
...@@ -911,6 +911,7 @@ int vp9_twopass_worst_quality(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats, ...@@ -911,6 +911,7 @@ int vp9_twopass_worst_quality(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats,
const double section_err = fpstats->coded_error / fpstats->count; const double section_err = fpstats->coded_error / fpstats->count;
const double err_per_mb = section_err / num_mbs; const double err_per_mb = section_err / num_mbs;
const double speed_term = 1.0 + ((double)cpi->speed * 0.04);
if (section_target_bandwitdh <= 0) if (section_target_bandwitdh <= 0)
return rc->worst_quality; // Highest value allowed return rc->worst_quality; // Highest value allowed
...@@ -924,8 +925,8 @@ int vp9_twopass_worst_quality(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats, ...@@ -924,8 +925,8 @@ int vp9_twopass_worst_quality(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats,
for (q = rc->best_quality; q < rc->worst_quality; ++q) { for (q = rc->best_quality; q < rc->worst_quality; ++q) {
const double err_correction_factor = calc_correction_factor(err_per_mb, const double err_correction_factor = calc_correction_factor(err_per_mb,
ERR_DIVISOR, 0.5, 0.90, q); ERR_DIVISOR, 0.5, 0.90, q);
const int bits_per_mb_at_this_q = vp9_rc_bits_per_mb(INTER_FRAME, q, const int bits_per_mb_at_this_q =
err_correction_factor); vp9_rc_bits_per_mb(INTER_FRAME, q, (err_correction_factor * speed_term));
if (bits_per_mb_at_this_q <= target_norm_bits_per_mb) if (bits_per_mb_at_this_q <= target_norm_bits_per_mb)
break; break;
} }
......
...@@ -1010,7 +1010,7 @@ void vp9_rc_compute_frame_size_bounds(const VP9_COMP *cpi, ...@@ -1010,7 +1010,7 @@ void vp9_rc_compute_frame_size_bounds(const VP9_COMP *cpi,
*frame_over_shoot_limit = this_frame_target * 9 / 8; *frame_over_shoot_limit = this_frame_target * 9 / 8;
*frame_under_shoot_limit = this_frame_target * 7 / 8; *frame_under_shoot_limit = this_frame_target * 7 / 8;
} else { } else {
// Stron overshoot limit for constrained quality // Strong overshoot limit for constrained quality
if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) { if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
*frame_over_shoot_limit = this_frame_target * 11 / 8; *frame_over_shoot_limit = this_frame_target * 11 / 8;
*frame_under_shoot_limit = this_frame_target * 2 / 8; *frame_under_shoot_limit = this_frame_target * 2 / 8;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment