Merge "Cleaning up vp9_init_second_pass()."

This commit is contained in:
Dmitry Kovalev 2014-05-22 14:49:33 -07:00 committed by Gerrit Code Review
commit 639e16ee00
2 changed files with 12 additions and 19 deletions

View File

@ -1003,25 +1003,19 @@ void vp9_init_second_pass(VP9_COMP *cpi) {
// Scan the first pass file and calculate a modified total error based upon
// the bias/power function used to allocate bits.
{
const FIRSTPASS_STATS *const start_pos = twopass->stats_in;
FIRSTPASS_STATS this_frame;
const double av_error = stats->ssim_weighted_pred_err /
DOUBLE_DIVIDE_CHECK(stats->count);
twopass->modified_error_total = 0.0;
twopass->modified_error_min =
(av_error * oxcf->two_pass_vbrmin_section) / 100;
twopass->modified_error_max =
(av_error * oxcf->two_pass_vbrmax_section) / 100;
while (input_stats(twopass, &this_frame) != EOF) {
twopass->modified_error_total += calculate_modified_err(twopass, oxcf,
&this_frame);
const double avg_error = stats->ssim_weighted_pred_err /
DOUBLE_DIVIDE_CHECK(stats->count);
const FIRSTPASS_STATS *s = twopass->stats_in;
double modified_error_total = 0.0;
twopass->modified_error_min = (avg_error *
oxcf->two_pass_vbrmin_section) / 100;
twopass->modified_error_max = (avg_error *
oxcf->two_pass_vbrmax_section) / 100;
while (s < twopass->stats_in_end) {
modified_error_total += calculate_modified_err(twopass, oxcf, s);
++s;
}
twopass->modified_error_left = twopass->modified_error_total;
reset_fpf_position(twopass, start_pos);
twopass->modified_error_left = modified_error_total;
}
// Reset the vbr bits off target counter

View File

@ -51,7 +51,6 @@ typedef struct {
int64_t bits_left;
double modified_error_min;
double modified_error_max;
double modified_error_total;
double modified_error_left;
double kf_intra_err_min;
double gf_intra_err_min;