Remove reset_fpf_position() because compute_arf_boost does not count on twopass->stats_in
Unified · Split
| @@ -2694,8 +2694,16 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) { · 2693 unmodified lines | ||
| 2694 | 2694 | b_frames, avg_inter_frame_qindex); |
| 2695 | 2695 | rc->source_alt_ref_pending = 1; |
| 2696 | 2696 | } else { |
| 2697 | − reset_fpf_position(twopass, start_pos); | |
| 2698 | − rc->gfu_boost = VPXMIN(MAX_GF_BOOST, calc_arf_boost(cpi, (i - 1), 0)); | |
| 2697 | + const int f_frames = i - 1; | |
| 2698 | + const int b_frames = 0; | |
| 2699 | + const int avg_inter_frame_qindex = rc->avg_frame_qindex[INTER_FRAME]; | |
| 2700 | + // TODO(angiebird): figure out why arf's location is assigned this way | |
| 2701 | + const int gld_show_idx = | |
| 2702 | + VPXMIN(gf_start_show_idx + 1, fps_get_num_frames(first_pass_info)); | |
| 2703 | + const int arf_boost = | |
| 2704 | + compute_arf_boost(frame_info, first_pass_info, gld_show_idx, f_frames, | |
| 2705 | + b_frames, avg_inter_frame_qindex); | |
| 2706 | + rc->gfu_boost = VPXMIN(MAX_GF_BOOST, arf_boost); | |
| 2699 | 2707 | rc->source_alt_ref_pending = 0; |
| 2700 | 2708 | } |
| 2701 | 2709 | |
| @@ -2740,9 +2748,6 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) { · 38 unmodified lines | ||
| 2740 | 2748 | |
| 2741 | 2749 | rc->baseline_gf_interval = i - rc->source_alt_ref_pending; |
| 2742 | 2750 | |
| 2743 | − // Reset the file position. | |
| 2744 | − reset_fpf_position(twopass, start_pos); | |
| 2745 | − | |
| 2746 | 2751 | if (rc->source_alt_ref_pending) |
| 2747 | 2752 | is_alt_ref_flash = detect_flash(twopass, rc->baseline_gf_interval); |
| 2748 | 2753 | |