[FFmpeg-cvslog] checkasm/sw_rgb: fix alignment of buffers for rgb_to_yuv tests

James Almer git at videolan.org
Sun Jun 9 20:32:52 EEST 2024


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Jun  9 13:48:40 2024 -0300| [287d139b779d5b8db5f9440159fb768cdd12c19f] | committer: James Almer

checkasm/sw_rgb: fix alignment of buffers for rgb_to_yuv tests

src is apparently not guaranteed to be >8 byte aligned, but align to 16
nonetheless as the x86 asm will do unaligned loads anyway.
dst is guaranteed to be 32 byte aligned for the Y plane, but 16 byte for UV.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=287d139b779d5b8db5f9440159fb768cdd12c19f
---

 tests/checkasm/sw_rgb.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/checkasm/sw_rgb.c b/tests/checkasm/sw_rgb.c
index fde20bec42..f278454d3d 100644
--- a/tests/checkasm/sw_rgb.c
+++ b/tests/checkasm/sw_rgb.c
@@ -195,8 +195,8 @@ static const enum AVPixelFormat rgb_formats[] = {
 
 static void check_rgb_to_y(struct SwsContext *ctx)
 {
-    LOCAL_ALIGNED_32(uint8_t, src24,  [MAX_LINE_SIZE * 3]);
-    LOCAL_ALIGNED_32(uint8_t, src32,  [MAX_LINE_SIZE * 4]);
+    LOCAL_ALIGNED_16(uint8_t, src24,  [MAX_LINE_SIZE * 3]);
+    LOCAL_ALIGNED_16(uint8_t, src32,  [MAX_LINE_SIZE * 4]);
     LOCAL_ALIGNED_32(uint8_t, dst0_y, [MAX_LINE_SIZE * 2]);
     LOCAL_ALIGNED_32(uint8_t, dst1_y, [MAX_LINE_SIZE * 2]);
 
@@ -238,12 +238,12 @@ static void check_rgb_to_y(struct SwsContext *ctx)
 
 static void check_rgb_to_uv(struct SwsContext *ctx)
 {
-    LOCAL_ALIGNED_32(uint8_t, src24,  [MAX_LINE_SIZE * 3]);
-    LOCAL_ALIGNED_32(uint8_t, src32,  [MAX_LINE_SIZE * 4]);
-    LOCAL_ALIGNED_32(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]);
-    LOCAL_ALIGNED_32(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]);
-    LOCAL_ALIGNED_32(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]);
-    LOCAL_ALIGNED_32(uint8_t, dst1_v, [MAX_LINE_SIZE * 2]);
+    LOCAL_ALIGNED_16(uint8_t, src24,  [MAX_LINE_SIZE * 3]);
+    LOCAL_ALIGNED_16(uint8_t, src32,  [MAX_LINE_SIZE * 4]);
+    LOCAL_ALIGNED_16(uint8_t, dst0_u, [MAX_LINE_SIZE * 2]);
+    LOCAL_ALIGNED_16(uint8_t, dst0_v, [MAX_LINE_SIZE * 2]);
+    LOCAL_ALIGNED_16(uint8_t, dst1_u, [MAX_LINE_SIZE * 2]);
+    LOCAL_ALIGNED_16(uint8_t, dst1_v, [MAX_LINE_SIZE * 2]);
 
     declare_func(void, uint8_t *dstU, uint8_t *dstV,
                  const uint8_t *src1, const uint8_t *src2, const uint8_t *src3,



More information about the ffmpeg-cvslog mailing list