ref: 62261d5eb83183f67113cd9cea9d8c0759137f68
parent: 25ca4edf74151dcd871c4012ac9748831526f49f
author: Marco Paniconi <marpan@google.com>
date: Sun Aug 12 17:35:15 EDT 2018
vp9-svc: Fixes for cyclic refresh for SVC. Add metrics that are being updated per-frame to the layer struct, so each layer using the cyclic refresh has the correct update. This is more consistent for the rate control and refresh rate. Some improvement in screen content clips. Neutral for SVC on rtc set. Change-Id: I0a9862fb6b6a79e894e2ff30c120dc4aa26fcda5
--- a/test/svc_datarate_test.cc
+++ b/test/svc_datarate_test.cc
@@ -1353,7 +1353,7 @@
}
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
CheckLayerRateTargeting(number_spatial_layers_, number_temporal_layers_, 0.73,
- 1.2);
+ 1.25);
#if CONFIG_VP9_DECODER
// The non-reference frames are expected to be mismatched frames as the
// encoder will avoid loopfilter on these frames.
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -146,6 +146,9 @@
size_t consec_zero_mv_size;
VP9_COMMON *const cm = &cpi->common;
lc->sb_index = 0;
+ lc->actual_num_seg1_blocks = 0;
+ lc->actual_num_seg2_blocks = 0;
+ lc->counter_encode_maxq_scene_change = 0;
CHECK_MEM_ERROR(cm, lc->map,
vpx_malloc(mi_rows * mi_cols * sizeof(*lc->map)));
memset(lc->map, 0, mi_rows * mi_cols);
@@ -349,6 +352,9 @@
cpi->consec_zero_mv = lc->consec_zero_mv;
lc->consec_zero_mv = temp3;
cr->sb_index = lc->sb_index;
+ cr->actual_num_seg1_blocks = lc->actual_num_seg1_blocks;
+ cr->actual_num_seg2_blocks = lc->actual_num_seg2_blocks;
+ cr->counter_encode_maxq_scene_change = lc->counter_encode_maxq_scene_change;
}
}
@@ -376,6 +382,9 @@
lc->consec_zero_mv = cpi->consec_zero_mv;
cpi->consec_zero_mv = temp3;
lc->sb_index = cr->sb_index;
+ lc->actual_num_seg1_blocks = cr->actual_num_seg1_blocks;
+ lc->actual_num_seg2_blocks = cr->actual_num_seg2_blocks;
+ lc->counter_encode_maxq_scene_change = cr->counter_encode_maxq_scene_change;
}
}
--- a/vp9/encoder/vp9_svc_layercontext.h
+++ b/vp9/encoder/vp9_svc_layercontext.h
@@ -60,10 +60,14 @@
size_t layer_size;
struct vpx_psnr_pkt psnr_pkt;
// Cyclic refresh parameters (aq-mode=3), that need to be updated per-frame.
+ // TODO(jianj/marpan): Is it better to use the full cyclic refresh struct.
int sb_index;
signed char *map;
uint8_t *last_coded_q_map;
uint8_t *consec_zero_mv;
+ int actual_num_seg1_blocks;
+ int actual_num_seg2_blocks;
+ int counter_encode_maxq_scene_change;
uint8_t speed;
} LAYER_CONTEXT;