History

Use frame_info in calculate_active_area

angiebird committed 7 years ago

Commit 4a014df1 parent 6b7d2211 file · +10 −8Browse files

Unified · Split

vp9/encoder/vp9_firstpass.c+10−8
@@ -220,14 +220,14 @@ static void subtract_stats(FIRSTPASS_STATS *section, · 219 unmodified lines
220220 // bars and partially discounts other 0 energy areas.
221221 #define MIN_ACTIVE_AREA 0.5
222222 #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,
224224 const FIRSTPASS_STATS *this_frame) {
225225 double active_pct;
226226
227227 active_pct =
228228 1.0 -
229229 ((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));
231231 return fclamp(active_pct, MIN_ACTIVE_AREA, MAX_ACTIVE_AREA);
232232 }
233233
@@ -260,8 +260,8 @@ static double calculate_mod_frame_score(const VP9_COMP *cpi, · 26 unmodified lines
260260 // remaining active MBs. The correction here assumes that coding
261261 // 0.5N blocks of complexity 2X is a little easier than coding N
262262 // 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);
265265
266266 return modified_score;
267267 }
@@ -284,8 +284,8 @@ static double calculate_norm_frame_score(const VP9_COMP *cpi, · 16 unmodified lines
284284 // remaining active MBs. The correction here assumes that coding
285285 // 0.5N blocks of complexity 2X is a little easier than coding N
286286 // 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);
289289
290290 // Normalize to a midpoint score.
291291 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
18871887 const double lq = vp9_convert_qindex_to_q(
18881888 cpi->rc.avg_frame_qindex[INTER_FRAME], cpi->common.bit_depth);
18891889 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);
18911892
18921893 // Underlying boost factor is based on inter error ratio.
18931894 frame_boost = (BASELINE_ERR_PER_MB * active_area) /
@@ -1926,7 +1927,8 @@ static double calc_kf_frame_boost(VP9_COMP *cpi, · 32 unmodified lines
19261927 const double lq = vp9_convert_qindex_to_q(
19271928 cpi->rc.avg_frame_qindex[INTER_FRAME], cpi->common.bit_depth);
19281929 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);
19301932
19311933 // Underlying boost factor is based on inter error ratio.
19321934 frame_boost = (kf_err_per_mb(cpi) * active_area) /

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t