summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Wilkins <paulwilkins@google.com>2018-09-28 16:54:03 +0100
committerPaul Wilkins <paulwilkins@google.com>2018-09-28 17:10:53 +0100
commitec7ab809c55ceca4cfd6c768e4ebc02feef6a51f (patch)
tree749587322f89a1d7a1c287e7389185b50ffddc98
parentd2641ff1df06ce974f2a1fac4336843c358acecd (diff)
downloadlibvpx-ec7ab809c55ceca4cfd6c768e4ebc02feef6a51f.tar
libvpx-ec7ab809c55ceca4cfd6c768e4ebc02feef6a51f.tar.gz
libvpx-ec7ab809c55ceca4cfd6c768e4ebc02feef6a51f.tar.bz2
libvpx-ec7ab809c55ceca4cfd6c768e4ebc02feef6a51f.zip
Adjustment of GOP intra factor for multi-layer.
This provides and alternative (still to be tuned for edge cases) approach to adjusting the gop intra factor when multi-layer coding is in effect that does not alter single layer coding. Change-Id: Iba86d65a6e68e86aa031b7e1f0b6a4c55761b1b8
-rw-r--r--vp9/encoder/vp9_firstpass.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 985c2fa2e..4c287311d 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2482,6 +2482,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
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) {
@@ -2549,6 +2551,17 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
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;
@@ -2625,7 +2638,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
(!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;
}