shithub: libvpx

Download patch

ref: 3134b502118bb4dfad04ffcdae04b1d6e1c9b62b
parent: d2828f773fd034fb6c44f544e6c2db6e22ca4dc9
author: Marco Paniconi <marpan@google.com>
date: Thu Mar 14 13:27:58 EDT 2019

vp9-rtc: Some adjustments for low-resolns real-time

Force smooth_interpol filter for low resolutions at high Q,
avoid the loopfilter strength reduction for similar conditon,
and reduce thresh_motion for cyclic refresh turnoff.

Change-Id: I4e9121d1cdc7d1b04992c741dc4f0cec281592f7

--- a/vp9/encoder/vp9_aq_cyclicrefresh.c
+++ b/vp9/encoder/vp9_aq_cyclicrefresh.c
@@ -478,7 +478,7 @@
   int target_refresh = 0;
   double weight_segment_target = 0;
   double weight_segment = 0;
-  int thresh_low_motion = (cm->width < 720) ? 55 : 20;
+  int thresh_low_motion = 20;
   int qp_thresh = VPXMIN((cpi->oxcf.content == VP9E_CONTENT_SCREEN) ? 35 : 20,
                          rc->best_quality << 1);
   cr->apply_cyclic_refresh = 1;
--- a/vp9/encoder/vp9_picklpf.c
+++ b/vp9/encoder/vp9_picklpf.c
@@ -179,6 +179,7 @@
 #endif  // CONFIG_VP9_HIGHBITDEPTH
     if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR &&
         cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled &&
+        (cm->base_qindex < 200 || cm->width * cm->height > 320 * 240) &&
         cpi->oxcf.content != VP9E_CONTENT_SCREEN && cm->frame_type != KEY_FRAME)
       filt_guess = 5 * filt_guess >> 3;
 
--- a/vp9/encoder/vp9_pickmode.c
+++ b/vp9/encoder/vp9_pickmode.c
@@ -1442,7 +1442,7 @@
                               int mi_row, int mi_col, PRED_BUFFER *tmp,
                               BLOCK_SIZE bsize, int reuse_inter_pred,
                               PRED_BUFFER **this_mode_pred, unsigned int *var_y,
-                              unsigned int *sse_y) {
+                              unsigned int *sse_y, int force_smooth_filter) {
   MACROBLOCKD *const xd = &x->e_mbd;
   MODE_INFO *const mi = xd->mi[0];
   struct macroblockd_plane *const pd = &xd->plane[0];
@@ -1458,8 +1458,8 @@
   INTERP_FILTER best_filter = SWITCHABLE, filter;
   PRED_BUFFER *current_pred = *this_mode_pred;
   uint8_t skip_txfm = SKIP_TXFM_NONE;
-
-  for (filter = EIGHTTAP; filter <= EIGHTTAP_SMOOTH; ++filter) {
+  INTERP_FILTER filter_start = force_smooth_filter ? EIGHTTAP_SMOOTH : EIGHTTAP;
+  for (filter = filter_start; filter <= EIGHTTAP_SMOOTH; ++filter) {
     int64_t cost;
     mi->interp_filter = filter;
     vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
@@ -1700,6 +1700,11 @@
   int no_scaling = 0;
   unsigned int thresh_svc_skip_golden = 500;
   unsigned int thresh_skip_golden = 500;
+  int force_smooth_filter =
+      (cpi->oxcf.speed >= 8 && cm->width * cm->height <= 320 * 240 &&
+       cm->base_qindex >= 200)
+          ? 1
+          : 0;
   int scene_change_detected =
       cpi->rc.high_source_sad ||
       (cpi->use_svc && cpi->svc.high_source_sad_superframe);
@@ -2225,7 +2230,8 @@
         (((mi->mv[0].as_mv.row | mi->mv[0].as_mv.col) & 0x07) != 0)) {
       rd_computed = 1;
       search_filter_ref(cpi, x, &this_rdc, mi_row, mi_col, tmp, bsize,
-                        reuse_inter_pred, &this_mode_pred, &var_y, &sse_y);
+                        reuse_inter_pred, &this_mode_pred, &var_y, &sse_y,
+                        force_smooth_filter);
     } else {
       // For low motion content use x->sb_is_skin in addition to VeryHighSad
       // for setting large_block.