ref: 4e61b2eec7dda9409927fdbdc5c1513081f3ea6f
parent: b628161cbce7d06b71582ea12bf31f7f11a51121
parent: ec7ab809c55ceca4cfd6c768e4ebc02feef6a51f
author: Jingning Han <jingning@google.com>
date: Fri Sep 28 13:38:14 EDT 2018
Merge "Adjustment of GOP intra factor for multi-layer."
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2486,6 +2486,8 @@
const int is_key_frame = frame_is_intra_only(cm);
const int arf_active_or_kf = is_key_frame || rc->source_alt_ref_active;
+ double gop_intra_factor = 1.0;
+
// Reset the GF group data structures unless this is a key
// frame in which case it will already have been done.
if (is_key_frame == 0) {
@@ -2553,6 +2555,17 @@
active_max_gf_interval = rc->frames_to_key / 2;
}
+ if (cpi->multi_layer_arf) {
+ int layers = 0;
+ int max_layers = VPXMIN(MAX_ARF_LAYERS, cpi->oxcf.enable_auto_arf);
+
+ // Adapt the intra_error factor to active_max_gf_interval limit.
+ for (i = active_max_gf_interval; i > 0; i >>= 1) ++layers;
+
+ layers = VPXMIN(max_layers, layers);
+ gop_intra_factor += (layers * 0.25);
+ }
+
i = 0;
while (i < rc->static_scene_max_gf_interval && i < rc->frames_to_key) {
++i;
@@ -2629,7 +2642,7 @@
(!flash_detected) &&
((mv_ratio_accumulator > mv_ratio_accumulator_thresh) ||
(abs_mv_in_out_accumulator > abs_mv_in_out_thresh) ||
- (sr_accumulator > next_frame.intra_error)))) {
+ (sr_accumulator > gop_intra_factor * next_frame.intra_error)))) {
break;
}