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:
authorRonald S. Bultje <rsbultje@gmail.com>2019-09-30 22:30:30 +0300
committerRonald S. Bultje <rsbultje@gmail.com>2019-10-01 19:47:11 +0300
commitf6a8cc0cee72b659b5a878b6f5f324077c85aa36 (patch)
treeb82c5f28712f249fb1746078ef242bbac876d55a
parentf7743da199f9ccca9e15e8faf37c0bfa36d482f1 (diff)
Minor cleanup
-rw-r--r--src/fg_apply_tmpl.c11
-rw-r--r--src/film_grain_tmpl.c4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/fg_apply_tmpl.c b/src/fg_apply_tmpl.c
index 5b061be..40f5015 100644
--- a/src/fg_apply_tmpl.c
+++ b/src/fg_apply_tmpl.c
@@ -42,9 +42,12 @@ static void generate_scaling(const int bitdepth,
const uint8_t points[][2], const int num,
uint8_t scaling[SCALING_SIZE])
{
+#if BITDEPTH == 8
+ const int shift_x = 0;
+#else
const int shift_x = bitdepth - 8;
+#endif
const int scaling_size = 1 << bitdepth;
- const int pad = 1 << shift_x;
// Fill up the preceding entries with the initial value
for (int i = 0; i < points[0][0] << shift_x; i++)
@@ -69,9 +72,8 @@ static void generate_scaling(const int bitdepth,
for (int i = points[num - 1][0] << shift_x; i < scaling_size; i++)
scaling[i] = points[num - 1][1];
- if (pad <= 1) return;
-
- const int rnd = pad >> 1;
+#if BITDEPTH != 8
+ const int pad = 1 << shift_x, rnd = pad >> 1;
for (int i = 0; i < num - 1; i++) {
const int bx = points[i][0] << shift_x;
const int ex = points[i+1][0] << shift_x;
@@ -83,6 +85,7 @@ static void generate_scaling(const int bitdepth,
}
}
}
+#endif
}
#ifndef UNIT_TEST
diff --git a/src/film_grain_tmpl.c b/src/film_grain_tmpl.c
index 3d596e5..a65c227 100644
--- a/src/film_grain_tmpl.c
+++ b/src/film_grain_tmpl.c
@@ -156,8 +156,8 @@ gnuv_ss_fn(444, 0, 0);
// samples from the correct block of a grain LUT, while taking into account the
// offsets provided by the offsets cache
static inline entry sample_lut(const entry grain_lut[][GRAIN_WIDTH],
- int offsets[2][2], int subx, int suby,
- int bx, int by, int x, int y)
+ const int offsets[2][2], const int subx, const int suby,
+ const int bx, const int by, const int x, const int y)
{
const int randval = offsets[bx][by];
const int offx = 3 + (2 >> subx) * (3 + (randval >> 4));