Merge "Adding local pointer variables referencing REATE_CONTROL struct."
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 25f7dcb..cf0f805 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -911,6 +911,7 @@
const double section_err = fpstats->coded_error / fpstats->count;
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)
return rc->worst_quality; // Highest value allowed
@@ -924,8 +925,8 @@
for (q = rc->best_quality; q < rc->worst_quality; ++q) {
const double err_correction_factor = calc_correction_factor(err_per_mb,
ERR_DIVISOR, 0.5, 0.90, q);
- const int bits_per_mb_at_this_q = vp9_rc_bits_per_mb(INTER_FRAME, q,
- err_correction_factor);
+ const int bits_per_mb_at_this_q =
+ 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)
break;
}
diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c
index 9089f2f..9ee5818 100644
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -977,12 +977,9 @@
q = rc_pick_q_and_bounds_two_pass(cpi, bottom_index, top_index);
}
- // JBB : This is realtime mode. In real time mode the first frame
- // should be larger. Q of 0 is disabled because we force tx size to be
+ // Q of 0 is disabled because we force tx size to be
// 16x16...
if (cpi->sf.use_nonrd_pick_mode) {
- if (cpi->common.current_video_frame == 0)
- q /= 3;
if (q == 0)
q++;
if (cpi->sf.partition_check == 1)
@@ -1013,7 +1010,7 @@
*frame_over_shoot_limit = this_frame_target * 9 / 8;
*frame_under_shoot_limit = this_frame_target * 7 / 8;
} else {
- // Stron overshoot limit for constrained quality
+ // Strong overshoot limit for constrained quality
if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
*frame_over_shoot_limit = this_frame_target * 11 / 8;
*frame_under_shoot_limit = this_frame_target * 2 / 8;