Commit 285d1b76 authored by Luc Trudeau's avatar Luc Trudeau

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.
parent e0a05e5e
......@@ -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;
......
......@@ -523,11 +523,6 @@ const int16_t dav1d_sgr_x_by_xplus1[256] = {
256,
};
const int16_t dav1d_sgr_one_by_x[25] = {
4096, 2048, 1365, 1024, 819, 683, 585, 512, 455, 410, 372, 341, 315,
293, 273, 256, 241, 228, 216, 205, 195, 186, 178, 171, 164,
};
const int8_t ALIGN(dav1d_mc_subpel_filters[5][15][8], 8) = {
[FILTER_8TAP_REGULAR] = {
{ 0, 1, -3, 63, 4, -1, 0, 0 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment