Commit d2c42f03 authored by James Zern's avatar James Zern

av1_rc_update_rate_correction_factors: avoid log(0)

avoids a floating point error being generated. this doesn't change
behavior, the -HUGE_VAL return was being ignored due to the min()

BUG=aomedia:388

Change-Id: I698aab248c777b02b60081bb7619e0aa6f3a0ba2
parent 9f7ca0b7
......@@ -444,8 +444,12 @@ void av1_rc_update_rate_correction_factors(AV1_COMP *cpi) {
// More heavily damped adjustment used if we have been oscillating either side
// of target.
adjustment_limit =
0.25 + 0.5 * AOMMIN(1, fabs(log10(0.01 * correction_factor)));
if (correction_factor > 0) {
adjustment_limit =
0.25 + 0.5 * AOMMIN(1, fabs(log10(0.01 * correction_factor)));
} else {
adjustment_limit = 0.75;
}
cpi->rc.q_2_frame = cpi->rc.q_1_frame;
cpi->rc.q_1_frame = cm->base_qindex;
......
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