Unified · Split
| @@ -220,14 +220,14 @@ static void subtract_stats(FIRSTPASS_STATS *section, · 219 unmodified lines | ||
| 220 | 220 | // bars and partially discounts other 0 energy areas. |
| 221 | 221 | #define MIN_ACTIVE_AREA 0.5 |
| 222 | 222 | #define MAX_ACTIVE_AREA 1.0 |
| 223 | −static double calculate_active_area(const VP9_COMP *cpi, | |
| 223 | +static double calculate_active_area(const FRAME_INFO *frame_info, | |
| 224 | 224 | const FIRSTPASS_STATS *this_frame) { |
| 225 | 225 | double active_pct; |
| 226 | 226 | |
| 227 | 227 | active_pct = |
| 228 | 228 | 1.0 - |
| 229 | 229 | ((this_frame->intra_skip_pct / 2) + |
| 230 | − ((this_frame->inactive_zone_rows * 2) / (double)cpi->common.mb_rows)); | |
| 230 | + ((this_frame->inactive_zone_rows * 2) / (double)frame_info->mb_rows)); | |
| 231 | 231 | return fclamp(active_pct, MIN_ACTIVE_AREA, MAX_ACTIVE_AREA); |
| 232 | 232 | } |
| 233 | 233 | |
| @@ -260,8 +260,8 @@ static double calculate_mod_frame_score(const VP9_COMP *cpi, · 26 unmodified lines | ||
| 260 | 260 | // remaining active MBs. The correction here assumes that coding |
| 261 | 261 | // 0.5N blocks of complexity 2X is a little easier than coding N |
| 262 | 262 | // blocks of complexity X. |
| 263 | − modified_score *= | |
| 264 | − pow(calculate_active_area(cpi, this_frame), ACT_AREA_CORRECTION); | |
| 263 | + modified_score *= pow(calculate_active_area(&cpi->frame_info, this_frame), | |
| 264 | + ACT_AREA_CORRECTION); | |
| 265 | 265 | |
| 266 | 266 | return modified_score; |
| 267 | 267 | } |
| @@ -284,8 +284,8 @@ static double calculate_norm_frame_score(const VP9_COMP *cpi, · 16 unmodified lines | ||
| 284 | 284 | // remaining active MBs. The correction here assumes that coding |
| 285 | 285 | // 0.5N blocks of complexity 2X is a little easier than coding N |
| 286 | 286 | // blocks of complexity X. |
| 287 | − modified_score *= | |
| 288 | − pow(calculate_active_area(cpi, this_frame), ACT_AREA_CORRECTION); | |
| 287 | + modified_score *= pow(calculate_active_area(&cpi->frame_info, this_frame), | |
| 288 | + ACT_AREA_CORRECTION); | |
| 289 | 289 | |
| 290 | 290 | // Normalize to a midpoint score. |
| 291 | 291 | modified_score /= DOUBLE_DIVIDE_CHECK(twopass->mean_mod_score); |
| @@ -1887,7 +1887,8 @@ static double calc_frame_boost(VP9_COMP *cpi, const FIRSTPASS_STATS *this_frame, · 1595 unmodified lines | ||
| 1887 | 1887 | const double lq = vp9_convert_qindex_to_q( |
| 1888 | 1888 | cpi->rc.avg_frame_qindex[INTER_FRAME], cpi->common.bit_depth); |
| 1889 | 1889 | const double boost_q_correction = VPXMIN((0.5 + (lq * 0.015)), 1.5); |
| 1890 | − const double active_area = calculate_active_area(cpi, this_frame); | |
| 1890 | + const double active_area = | |
| 1891 | + calculate_active_area(&cpi->frame_info, this_frame); | |
| 1891 | 1892 | |
| 1892 | 1893 | // Underlying boost factor is based on inter error ratio. |
| 1893 | 1894 | frame_boost = (BASELINE_ERR_PER_MB * active_area) / |
| @@ -1926,7 +1927,8 @@ static double calc_kf_frame_boost(VP9_COMP *cpi, · 32 unmodified lines | ||
| 1926 | 1927 | const double lq = vp9_convert_qindex_to_q( |
| 1927 | 1928 | cpi->rc.avg_frame_qindex[INTER_FRAME], cpi->common.bit_depth); |
| 1928 | 1929 | const double boost_q_correction = VPXMIN((0.50 + (lq * 0.015)), 2.00); |
| 1929 | − const double active_area = calculate_active_area(cpi, this_frame); | |
| 1930 | + const double active_area = | |
| 1931 | + calculate_active_area(&cpi->frame_info, this_frame); | |
| 1930 | 1932 | |
| 1931 | 1933 | // Underlying boost factor is based on inter error ratio. |
| 1932 | 1934 | frame_boost = (kf_err_per_mb(cpi) * active_area) / |