summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2019-03-26 10:45:22 -0700
committerMarco Paniconi <marpan@google.com>2019-03-26 11:01:30 -0700
commitc09e95fc7da1c91db3cef34dc61010ab33443eea (patch)
treeef99d4b11f364d163330b96dabe9fcb28eb00b67
parentcf728f89137a73b148a9e577697f209303604a9c (diff)
downloadlibvpx-c09e95fc7da1c91db3cef34dc61010ab33443eea.tar
libvpx-c09e95fc7da1c91db3cef34dc61010ab33443eea.tar.gz
libvpx-c09e95fc7da1c91db3cef34dc61010ab33443eea.tar.bz2
libvpx-c09e95fc7da1c91db3cef34dc61010ab33443eea.zip
vp9-rtc: Disable cyclic refresh under some conditions
cyclic refresh does not work for speeds <= 4, so disable it for this case. And dynamically disable it when average_qp is close to MAXQ (only for non-svc), to improve quality/rate control at very low bitrates. Change-Id: I447be43aef0fbb80f4a30d81e11658b58744eae5
-rw-r--r--vp9/encoder/vp9_aq_cyclicrefresh.c5
-rw-r--r--vp9/encoder/vp9_speed_features.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c
index b3b546044..adb12c10c 100644
--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -481,6 +481,7 @@ void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) {
int thresh_low_motion = 20;
int qp_thresh = VPXMIN((cpi->oxcf.content == VP9E_CONTENT_SCREEN) ? 35 : 20,
rc->best_quality << 1);
+ int qp_max_thresh = 117 * MAXQ >> 7;
cr->apply_cyclic_refresh = 1;
if (frame_is_intra_only(cm) || cpi->svc.temporal_layer_id > 0 ||
is_lossless_requested(&cpi->oxcf) ||
@@ -488,7 +489,9 @@ void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) {
(cpi->use_svc &&
cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame) ||
(!cpi->use_svc && rc->avg_frame_low_motion < thresh_low_motion &&
- rc->frames_since_key > 40)) {
+ rc->frames_since_key > 40) ||
+ (!cpi->use_svc && rc->avg_frame_qindex[INTER_FRAME] > qp_max_thresh &&
+ rc->frames_since_key > 20)) {
cr->apply_cyclic_refresh = 0;
return;
}
diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c
index 836642594..55bd106ab 100644
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -793,6 +793,10 @@ static void set_rt_speed_feature_framesize_independent(
// small step_param for all spatial layers.
sf->mv.fullpel_search_step_param = 2;
}
+ // TODO(marpan): There is regression for aq-mode=3 speed <= 4, force it
+ // off for now.
+ if (speed <= 4 && cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)
+ cpi->oxcf.aq_mode = 0;
}
void vp9_set_speed_features_framesize_dependent(VP9_COMP *cpi, int speed) {