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
path: root/tests
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2021-03-26 12:45:56 +0300
committerMartin Storsjö <martin@martin.st>2021-04-27 15:32:40 +0300
commit1206819d988277a63489d5c2221d7599d9c0e818 (patch)
tree14c33d63cff941cb28f8bc10a86172727aa7edd5 /tests
parent4023c9a445a0902da8ce7d7d3779489b4b51d4b9 (diff)
checkasm: Implement printing of grain lut entries
Diffstat (limited to 'tests')
-rw-r--r--tests/checkasm/checkasm.c1
-rw-r--r--tests/checkasm/checkasm.h1
-rw-r--r--tests/checkasm/filmgrain.c23
3 files changed, 16 insertions, 9 deletions
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index ab93a32..689830e 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -852,6 +852,7 @@ int checkasm_check_##type(const char *const file, const int line, \
return err; \
}
+DEF_CHECKASM_CHECK_FUNC(int8_t, "%4d")
DEF_CHECKASM_CHECK_FUNC(uint8_t, "%02x")
DEF_CHECKASM_CHECK_FUNC(uint16_t, "%04x")
DEF_CHECKASM_CHECK_FUNC(int16_t, "%6d")
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index ae51d61..0871130 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -325,6 +325,7 @@ int checkasm_check_##type(const char *const file, const int line, \
const int align_w, const int align_h, \
const int padding)
+DECL_CHECKASM_CHECK_FUNC(int8_t);
DECL_CHECKASM_CHECK_FUNC(uint8_t);
DECL_CHECKASM_CHECK_FUNC(uint16_t);
DECL_CHECKASM_CHECK_FUNC(int16_t);
diff --git a/tests/checkasm/filmgrain.c b/tests/checkasm/filmgrain.c
index a74d09b..eadf2ad 100644
--- a/tests/checkasm/filmgrain.c
+++ b/tests/checkasm/filmgrain.c
@@ -34,6 +34,12 @@
#define UNIT_TEST 1
#include "src/fg_apply_tmpl.c"
+#if BITDEPTH == 8
+#define checkasm_check_entry(...) checkasm_check(int8_t, __VA_ARGS__)
+#else
+#define checkasm_check_entry(...) checkasm_check(int16_t, __VA_ARGS__)
+#endif
+
static const char ss_name[][4] = {
[DAV1D_PIXEL_LAYOUT_I420 - 1] = "420",
[DAV1D_PIXEL_LAYOUT_I422 - 1] = "422",
@@ -65,11 +71,9 @@ static void check_gen_grny(const Dav1dFilmGrainDSPContext *const dsp) {
call_ref(grain_lut_c, fg_data HIGHBD_TAIL_SUFFIX);
call_new(grain_lut_a, fg_data HIGHBD_TAIL_SUFFIX);
- if (memcmp(grain_lut_c, grain_lut_a,
- GRAIN_WIDTH * GRAIN_HEIGHT * sizeof(entry)))
- {
- fail();
- }
+ checkasm_check_entry(grain_lut_c[0], sizeof(entry) * GRAIN_WIDTH,
+ grain_lut_a[0], sizeof(entry) * GRAIN_WIDTH,
+ GRAIN_WIDTH, GRAIN_HEIGHT, "grain_lut");
bench_new(grain_lut_a, fg_data HIGHBD_TAIL_SUFFIX);
}
@@ -123,10 +127,11 @@ static void check_gen_grnuv(const Dav1dFilmGrainDSPContext *const dsp) {
memset(grain_lut_a, 0xff, sizeof(grain_lut_a));
call_ref(grain_lut_c, grain_lut_y, fg_data, uv HIGHBD_TAIL_SUFFIX);
call_new(grain_lut_a, grain_lut_y, fg_data, uv HIGHBD_TAIL_SUFFIX);
- int diff = 0, w = ss_x ? 44 : GRAIN_WIDTH;
- for (int y = 0; y < (ss_y ? 38 : GRAIN_HEIGHT); y++)
- diff |= memcmp(grain_lut_a[y], grain_lut_c[y], w * sizeof(entry));
- if (diff) fail();
+ int w = ss_x ? 44 : GRAIN_WIDTH;
+ int h = ss_y ? 38 : GRAIN_HEIGHT;
+ checkasm_check_entry(grain_lut_c[0], sizeof(entry) * GRAIN_WIDTH,
+ grain_lut_a[0], sizeof(entry) * GRAIN_WIDTH,
+ w, h, "grain_lut");
bench_new(grain_lut_a, grain_lut_y, fg_data, uv HIGHBD_TAIL_SUFFIX);
}