Temporal filter: new function to model control parameter h

h = decay_control * (0.7 + ln(sigma + 0.5))
This change leads to larger decay, i.e., stronger smoothing when
sigma (noise) is larger.

It applies to frame sizes (min of width and height) >= 480.
Lowres and ugc360 set are therefore the same.

Net metric gains are observed.

speed4    avg_psnr    ovr_psnr     ssim      vmaf
midres     -0.08       -0.12      -0.11    -0.12
hdres      -0.34       -0.31      -0.43    -0.23

speed1    avg_psnr    ovr_psnr     ssim      vmaf
midres     -0.02       -0.03      -0.10    -0.14
hdres      -0.25       -0.22      -0.35    -0.00

STATS_CHANGED

Change-Id: Ia232c55412ffee4aa23e9b21890d6bae593154df
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
index fb94e20..6ba08d0 100644
--- a/av1/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -688,8 +688,7 @@
   (void)strength;
   (void)blk_fw;
   (void)use_32x32;
-  const double decay = decay_control * exp(1 - sigma);
-  const double h = AOMMAX(decay * sigma, 0.1);
+  const double h = decay_control * (0.7 + log(sigma + 0.5));
   const double beta = 1.0;
   for (int i = 0, k = 0; i < block_height; i++) {
     for (int j = 0; j < block_width; j++, k++) {
@@ -734,8 +733,7 @@
   (void)use_32x32;
   uint16_t *frame1 = CONVERT_TO_SHORTPTR(frame1_8bit);
   uint16_t *frame2 = CONVERT_TO_SHORTPTR(frame2_8bit);
-  const double decay = decay_control * exp(1 - sigma);
-  const double h = decay * sigma;
+  const double h = decay_control * (0.7 + log(sigma + 0.5));
   const double beta = 1.0;
   for (int i = 0, k = 0; i < block_height; i++) {
     for (int j = 0; j < block_width; j++, k++) {
@@ -786,9 +784,9 @@
       int decay_control;
       // The decay is obtained empirically, subject to better tuning.
       if (frame_height >= 720) {
-        decay_control = 7;
+        decay_control = 4;
       } else if (frame_height >= 480) {
-        decay_control = 5;
+        decay_control = 4;
       } else {
         decay_control = 3;
       }
@@ -838,9 +836,9 @@
     int decay_control;
     // The decay is obtained empirically, subject to better tuning.
     if (frame_height >= 720) {
-      decay_control = 7;
+      decay_control = 4;
     } else if (frame_height >= 480) {
-      decay_control = 5;
+      decay_control = 4;
     } else {
       decay_control = 3;
     }
@@ -1035,8 +1033,8 @@
   const int mb_uv_width = BW >> mbd->plane[1].subsampling_x;
 #if EXPERIMENT_TEMPORAL_FILTER
   const int is_screen_content_type = cm->allow_screen_content_tools != 0;
-  const int use_new_temporal_mode = AOMMIN(cm->width, cm->height) >= 480 &&
-                                    !is_screen_content_type && !is_key_frame;
+  const int use_new_temporal_mode =
+      !is_screen_content_type && AOMMIN(cm->width, cm->height) >= 480;
 #else
   (void)sigma;
   const int use_new_temporal_mode = 0;
diff --git a/av1/encoder/x86/temporal_filter_avx2.c b/av1/encoder/x86/temporal_filter_avx2.c
index 9cd71ac..09325aa 100644
--- a/av1/encoder/x86/temporal_filter_avx2.c
+++ b/av1/encoder/x86/temporal_filter_avx2.c
@@ -138,8 +138,7 @@
   (void)strength;
   (void)blk_fw;
   (void)use_32x32;
-  const double decay = decay_control * exp(1 - sigma);
-  const double h = AOMMAX(decay * sigma, 0.1);
+  const double h = decay_control * (0.7 + log(sigma + 0.5));
   const double beta = 1.0;
 
   uint16_t frame_sse[SSE_STRIDE * BH];
diff --git a/av1/encoder/x86/temporal_filter_sse2.c b/av1/encoder/x86/temporal_filter_sse2.c
index 07105dd..bc0dd51 100644
--- a/av1/encoder/x86/temporal_filter_sse2.c
+++ b/av1/encoder/x86/temporal_filter_sse2.c
@@ -109,8 +109,7 @@
   (void)strength;
   (void)blk_fw;
   (void)use_32x32;
-  const double decay = decay_control * exp(1 - sigma);
-  const double h = AOMMAX(decay * sigma, 0.1);
+  const double h = decay_control * (0.7 + log(sigma + 0.5));
   const double beta = 1.0;
 
   uint16_t frame_sse[SSE_STRIDE * BH];