Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Trudeau <ltrudeau@twoorioles.com>2018-10-31 18:46:27 +0300
committerLuc Trudeau <ltrudeau@twoorioles.com>2018-10-31 18:46:27 +0300
commit285d1b7641df768621b57787a7ae3c20d6f6794d (patch)
treecaf26ff4490706a55a73cd45dae05504de1c204f /src/looprestoration_tmpl.c
parente0a05e5e1a73d0b2b0eb78f4a9c251ffa7331bb1 (diff)
Remove dav1d_sgr_one_by_x
Since n equals either 25 or 9, the dav1d_sgr_one_by_x table can be replaced with a ternary operation.
Diffstat (limited to 'src/looprestoration_tmpl.c')
-rw-r--r--src/looprestoration_tmpl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/looprestoration_tmpl.c b/src/looprestoration_tmpl.c
index 65e4ea9..cd8440a 100644
--- a/src/looprestoration_tmpl.c
+++ b/src/looprestoration_tmpl.c
@@ -412,6 +412,8 @@ static void selfguided_filter(int32_t *dst, const pixel *src,
const ptrdiff_t src_stride, const int w,
const int h, const int n, const int s)
{
+ const int sgr_one_by_x = n == 25 ? 164 : 455;
+
// Selfguided filter is applied to a maximum stripe height of 64 + 3 pixels
// of padding above and below
int32_t A_[70 /*(64 + 3 + 3)*/ * REST_UNIT_STRIDE];
@@ -444,7 +446,7 @@ static void selfguided_filter(int32_t *dst, const pixel *src,
const int x = dav1d_sgr_x_by_xplus1[imin(z, 255)];
// This is where we invert A and B, so that B is of size coef.
- AA[i] = (((1 << 8) - x) * BB[i] * dav1d_sgr_one_by_x[n - 1] + (1 << 11)) >> 12;
+ AA[i] = (((1 << 8) - x) * BB[i] * sgr_one_by_x + (1 << 11)) >> 12;
BB[i] = x;
}
AA += step * REST_UNIT_STRIDE;