shithub: libvpx

Download patch

ref: 15d041e1e2b074e584773a3e0545b58cbf969e46
parent: aab2aff9aa264d573852f4dce34bea47708cf1be
author: Jingning Han <[email protected]>
date: Wed Aug 1 10:34:14 EDT 2018

Simplify temporal filter strength calculation

Change-Id: I5f878e9b6581bcb427ecc29ce490feb68378f8af

--- 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);
--- 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);