shithub: libvpx

Download patch

ref: 8839cffe2ddce58faeb4f624dcc9584bcfa4019b
parent: 6c62530c666fc0bcf4385a35a7c49e44c9f38cf5
parent: 80d1063c7b3f3e2358916b5e5e5adcd82663c25a
author: Jingning Han <[email protected]>
date: Thu Aug 16 12:53:30 EDT 2018

Merge changes I6ab0ece8,I5f878e9b

* changes:
  Temporarily revert to vp9_temporal_filter_apply_c
  Simplify temporal filter strength calculation

--- a/vp9/encoder/vp9_temporal_filter.c
+++ b/vp9/encoder/vp9_temporal_filter.c
@@ -103,7 +103,7 @@
   unsigned int i, j, k;
   int modifier;
   int byte = 0;
-  const int rounding = strength > 0 ? 1 << (strength - 1) : 0;
+  const int rounding = (1 << strength) >> 1;
 
   assert(strength >= 0);
   assert(strength <= 6);
@@ -435,17 +435,17 @@
         }
 #else
         // Apply the filter (YUV)
-        vp9_temporal_filter_apply(f->y_buffer + mb_y_offset, f->y_stride,
-                                  predictor, 16, 16, strength, filter_weight,
-                                  accumulator, count);
-        vp9_temporal_filter_apply(f->u_buffer + mb_uv_offset, f->uv_stride,
-                                  predictor + 256, mb_uv_width, mb_uv_height,
-                                  strength, filter_weight, accumulator + 256,
-                                  count + 256);
-        vp9_temporal_filter_apply(f->v_buffer + mb_uv_offset, f->uv_stride,
-                                  predictor + 512, mb_uv_width, mb_uv_height,
-                                  strength, filter_weight, accumulator + 512,
-                                  count + 512);
+        vp9_temporal_filter_apply_c(f->y_buffer + mb_y_offset, f->y_stride,
+                                    predictor, 16, 16, strength, filter_weight,
+                                    accumulator, count);
+        vp9_temporal_filter_apply_c(f->u_buffer + mb_uv_offset, f->uv_stride,
+                                    predictor + 256, mb_uv_width, mb_uv_height,
+                                    strength, filter_weight, accumulator + 256,
+                                    count + 256);
+        vp9_temporal_filter_apply_c(f->v_buffer + mb_uv_offset, f->uv_stride,
+                                    predictor + 512, mb_uv_width, mb_uv_height,
+                                    strength, filter_weight, accumulator + 512,
+                                    count + 512);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
       }
     }
--- a/vp9/encoder/x86/temporal_filter_sse4.c
+++ b/vp9/encoder/x86/temporal_filter_sse4.c
@@ -241,7 +241,7 @@
                                       int weight, uint32_t *accumulator,
                                       uint16_t *count) {
   unsigned int h;
-  const int rounding = strength > 0 ? 1 << (strength - 1) : 0;
+  const int rounding = (1 << strength) >> 1;
 
   assert(strength >= 0);
   assert(strength <= 6);