35#define randomize_buffers(buf, size) \
38 for (j = 0; j < size; j++) \
39 buf[j] = rnd() & 0xFFFF; \
42#define randomize_buffer_mask(buf, width, mask) \
44 unsigned mask2 = mask | (mask << 16); \
45 for (size_t i = 0; i < (width & ~1); i += 2) \
46 AV_WN32A((buf) + i, rnd() & mask2); \
48 buf[width - 1] = rnd() & mask; \
63 if (!
src0 || !
src1 || !dst0 || !dst1)
71 if (memcmp(dst0, dst1,
width *
sizeof(uint16_t)))
85 int w,
int *
left,
int *left_top);
87 if (!
check_func(
c->add_hfyu_median_pred_int16,
"add_hfyu_median_pred_int16"))
94 int left_new =
rnd() &
mask, left_ref = left_new;
95 int lt_new =
rnd() &
mask, lt_ref = lt_new;
103 if (left_ref != left_new || lt_ref != lt_new ||
104 memcmp(dst_ref, dst_new,
width *
sizeof(dst_ref[0])))
114 uint8_t
left[4], left0[4], left1[4];
116 declare_func(
void, uint8_t *d,
const uint8_t *
s, intptr_t
w, uint8_t *l);
118 if (!
check_func(
c->add_hfyu_left_pred_bgr32,
"add_hfyu_left_pred_bgr32"))
129 if (memcmp(dst0, dst1,
sizeof (dst0)) != 0 ||
130 memcmp(left0, left1,
sizeof (left0)) != 0) {
143 unsigned bps = 9 +
rnd() % 8;
144 unsigned mask = (1 <<
bps) - 1;
149 report(
"add_int16_rnd_width");
156 report(
"add_hfyu_median_pred_int16");
159 report(
"add_hfyu_left_pred_bgr32");
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static int BS_FUNC left(const BSCTX *bc)
Return the number of the bits left in a buffer.
av_cold void ff_huffyuvdsp_init(HuffYUVDSPContext *c)
static const uint16_t mask[17]
Memory handling functions.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
#define randomize_buffer_mask(buf, width, mask)
void checkasm_check_huffyuvdsp(void)
static void check_add_int16(HuffYUVDSPContext *c, unsigned mask, int width, const char *name)
@ MAX_WIDTH
arbitrary limit used for the tests
static void check_add_hfyu_left_pred_bgr32(HuffYUVDSPContext *c)
#define randomize_buffers(buf, size)
static void check_add_hfyu_median_pred_int16(const HuffYUVDSPContext *c, unsigned mask, int width)
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)