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>2022-01-12 01:19:05 +0300
committerRonald S. Bultje <rsbultje@gmail.com>2022-01-13 23:40:46 +0300
commit8ca7d41c73ed17c79a86f5afcd40c6873665a971 (patch)
treee374968ba471fe3175ed5ec9eb7a54efdc273924 /tests
parent0d9c7435a086583b131fb8e5a19dd71f96ad5e1d (diff)
checkasm: Align the width in PIXEL_RECT
This is necessary if the dimensions set aren't properly aligned.
Diffstat (limited to 'tests')
-rw-r--r--tests/checkasm/checkasm.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index eac9f81..a804c0e 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -311,11 +311,12 @@ void checkasm_stack_clobber(uint64_t clobber, ...);
#endif
+#define ROUND_UP(x,a) (((x)+((a)-1)) & ~((a)-1))
#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); \
+ ALIGN_STK_64(pixel, name##_buf, ((h)+32)*(ROUND_UP(w,64)+64) + 64,); \
+ ptrdiff_t name##_stride = sizeof(pixel)*(ROUND_UP(w,64)+64); \
(void)name##_stride; \
- pixel *name = name##_buf + ((w)+64)*16 + 64
+ pixel *name = name##_buf + (ROUND_UP(w,64)+64)*16 + 64
#define CLEAR_PIXEL_RECT(name) \
memset(name##_buf, 0x99, sizeof(name##_buf)) \