diff options
author | Rémi Denis-Courmont <remi@remlab.net> | 2023-11-12 15:41:59 +0200 |
---|---|---|
committer | Rémi Denis-Courmont <remi@remlab.net> | 2023-11-15 16:51:07 +0200 |
commit | 6b708cd7831342496b4430ef8c62ad9b8d836dd4 (patch) | |
tree | e46c401c3a55c06fa47b9f6d09c949f6b29dfd2c /tests | |
parent | 575efc0406864542a65aa3f31ebe8eb0bbef5087 (diff) | |
download | ffmpeg-6b708cd7831342496b4430ef8c62ad9b8d836dd4.tar.gz |
checkasm/huffyuvdsp: test for add_hfyu_left_pred_bgr32
Diffstat (limited to 'tests')
-rw-r--r-- | tests/checkasm/huffyuvdsp.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/checkasm/huffyuvdsp.c b/tests/checkasm/huffyuvdsp.c index 6ba27e267f..a08f5a8391 100644 --- a/tests/checkasm/huffyuvdsp.c +++ b/tests/checkasm/huffyuvdsp.c @@ -64,6 +64,34 @@ static void check_add_int16(HuffYUVDSPContext *c, unsigned mask, int width, cons av_free(dst1); } +static void check_add_hfyu_left_pred_bgr32(HuffYUVDSPContext *c) +{ +#define BUF_SIZE 1080 + uint8_t src[4 * BUF_SIZE], dst0[4 * BUF_SIZE], dst1[4 * BUF_SIZE]; + uint8_t left[4], left0[4], left1[4]; + + declare_func(void, uint8_t *d, const uint8_t *s, intptr_t w, uint8_t *l); + + randomize_buffers(src, sizeof (src)); + randomize_buffers(left, sizeof (left)); + memcpy(left0, left, sizeof (left)); + memcpy(left1, left, sizeof (left)); + + if (check_func(c->add_hfyu_left_pred_bgr32, "add_hfyu_left_pred_bgr32")) { + call_ref(dst0, src, BUF_SIZE, left0); + call_new(dst1, src, BUF_SIZE, left1); + + if (memcmp(dst0, dst1, sizeof (dst0)) != 0 || + memcmp(left0, left1, sizeof (left0)) != 0) { + fail(); + } + + bench_new(dst1, src, BUF_SIZE, left); + } + + report("add_hfyu_left_pred_bgr32"); +} + void checkasm_check_huffyuvdsp(void) { HuffYUVDSPContext c; @@ -78,4 +106,6 @@ void checkasm_check_huffyuvdsp(void) /*! test always with the same size (for perf test) */ check_add_int16(&c, 65535, 16*128, "add_int16_128"); report("add_int16_128"); + + check_add_hfyu_left_pred_bgr32(&c); } |