diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2019-08-30 14:38:05 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2019-08-30 14:38:31 +0300 |
commit | 91b0af2fa2572dfbb22700183c70eefa61136c33 (patch) | |
tree | 0853c1217a3497b33826b078171ad0c908ec413d | |
parent | 1ffbeda00def479c554b46ad5f2fd29480d56906 (diff) |
Apply high-bitdepth adjustment of pixel index after delta calculation
Fixes libaom/dav1d mismatch in av1-1-b10-23-film_grain-50.ivf.
-rw-r--r-- | src/film_grain_tmpl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/film_grain_tmpl.c b/src/film_grain_tmpl.c index 7782ddb..ec8afde 100644 --- a/src/film_grain_tmpl.c +++ b/src/film_grain_tmpl.c @@ -180,16 +180,16 @@ static void generate_scaling(const int bitdepth, // Linearly interpolate the values in the middle for (int i = 0; i < num - 1; i++) { - const int bx = points[i][0] << shift_x; + const int bx = points[i][0]; const int by = points[i][1]; - const int ex = points[i+1][0] << shift_x; + const int ex = points[i+1][0]; const int ey = points[i+1][1]; const int dx = ex - bx; const int dy = ey - by; const int delta = dy * ((0x10000 + (dx >> 1)) / dx); - for (int x = 0; x < dx; x += pad) { + for (int x = 0; x < dx; x++) { const int v = by + ((x * delta + 0x8000) >> 16); - scaling[bx + x] = v; + scaling[(bx + x) << shift_x] = v; } } |