diff options
Diffstat (limited to 'tests/checkasm/checkasm.h')
-rw-r--r-- | tests/checkasm/checkasm.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h index e077c50..b22a9f0 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -307,11 +307,22 @@ void checkasm_stack_clobber(uint64_t clobber, ...); #define bench_new(...) do {} while (0) #endif + +#define PIXEL_RECT(name, w, h) \ + ALIGN_STK_64(pixel, name##_buf, ((h)+32)*((w)+64) + 64,); \ + ptrdiff_t name##_stride = sizeof(pixel)*((w)+64); \ + (void)name##_stride; \ + pixel *name = name##_buf + ((w)+64)*16 + 64 + +#define CLEAR_PIXEL_RECT(name) \ + memset(name##_buf, 0x99, sizeof(name##_buf)) \ + #define DECL_CHECKASM_CHECK_FUNC(type) \ int checkasm_check_##type(const char *const file, const int line, \ const type *const buf1, const ptrdiff_t stride1, \ const type *const buf2, const ptrdiff_t stride2, \ - const int w, const int h, const char *const name) + const int w, const int h, const char *const name, \ + const int padding) DECL_CHECKASM_CHECK_FUNC(uint8_t); DECL_CHECKASM_CHECK_FUNC(uint16_t); @@ -321,10 +332,12 @@ DECL_CHECKASM_CHECK_FUNC(int32_t); #define CONCAT(a,b) a ## b -#define checkasm_check(prefix, ...) CONCAT(checkasm_check_, prefix)(__FILE__, __LINE__, __VA_ARGS__) +#define checkasm_check2(prefix, ...) CONCAT(checkasm_check_, prefix)(__FILE__, __LINE__, __VA_ARGS__) +#define checkasm_check(prefix, ...) checkasm_check2(prefix, __VA_ARGS__, 0) #ifdef BITDEPTH #define checkasm_check_pixel(...) checkasm_check(PIXEL_TYPE, __VA_ARGS__) +#define checkasm_check_pixel_padded(...) checkasm_check2(PIXEL_TYPE, __VA_ARGS__, 8) #define checkasm_check_coef(...) checkasm_check(COEF_TYPE, __VA_ARGS__) #endif |