diff options
author | Martin Storsjö <martin@martin.st> | 2020-05-11 23:27:50 +0300 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2020-05-12 10:29:07 +0300 |
commit | 152391b28de5d6d5cc257492596b5cfcac746971 (patch) | |
tree | 4ba5dd727745a64202ecd6054d37506373d667e0 /tests | |
parent | a0678eac0ee1a67ff871247b551e42fa448591b7 (diff) |
checkasm: filmgrain: Fix benchmarking in 16 bpc mode
When benchmarking, the functions are called with a fixed width
of 64x32 or 32x16, while the test itself is run with a random size
in the range up to 128x32.
In 16 bpc mode, the source pixels must be within the valid range,
because they otherwise cause accesses out of bounds in the scaling
array.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/checkasm/filmgrain.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/checkasm/filmgrain.c b/tests/checkasm/filmgrain.c index 5c9e0bf..1219ee7 100644 --- a/tests/checkasm/filmgrain.c +++ b/tests/checkasm/filmgrain.c @@ -181,8 +181,8 @@ static void check_fgy_sbrow(const Dav1dFilmGrainDSPContext *const dsp) { const int w = 1 + (rnd() & 127); const int h = 1 + (rnd() & 31); - for (int y = 0; y < h; y++) - for (int x = 0; x < w; x++) + for (int y = 0; y < 32; y++) + for (int x = 0; x < 128; x++) src[y * PXSTRIDE(stride) + x] = rnd() & bitdepth_max; const int row_num = rnd() & 1 ? rnd() & 0x7ff : 0; @@ -260,13 +260,12 @@ static void check_fguv_sbrow(const Dav1dFilmGrainDSPContext *const dsp) { const int w = 1 + (rnd() & (127 >> ss_x)); const int h = 1 + (rnd() & (31 >> ss_y)); - const int lw = w << ss_x, lh = h << ss_y; - for (int y = 0; y < h; y++) - for (int x = 0; x < w; x++) + for (int y = 0; y < 32; y++) + for (int x = 0; x < 128; x++) src[y * PXSTRIDE(stride) + x] = rnd() & bitdepth_max; - for (int y = 0; y < lh; y++) - for (int x = 0; x < lw; x++) + for (int y = 0; y < 32; y++) + for (int x = 0; x < 128; x++) luma_src[y * PXSTRIDE(lstride) + x] = rnd() & bitdepth_max; const int row_num = rnd() & 1 ? rnd() & 0x7ff : 0; |