Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa
@ 2022-06-16  8:59 Thilo Borgmann
  2022-06-18 21:50 ` Martin Storsjö
  0 siblings, 1 reply; 3+ messages in thread
From: Thilo Borgmann @ 2022-06-16  8:59 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

[-- Attachment #1: Type: text/plain, Size: 145 bytes --]

Hi,

movdqa in ff_yuv2yuvX_sse3() expects a 16-byte alignment according to its documentation causing segfaults in fate-checkasm-sw_scale.

-Thilo

[-- Attachment #2: 0001-tests-checkasm-sw_scale-Fix-alignment-for-movdqa.patch --]
[-- Type: text/plain, Size: 1753 bytes --]

From ed84410b2371a758dad03d3830bfb4f3d86cd4ed Mon Sep 17 00:00:00 2001
From: Michael Goulet <mgoulet@fb.com>
Date: Thu, 16 Jun 2022 10:14:50 +0200
Subject: [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa

SSE3 instruction movdqa in ff_yuv2yuvX_sse3() expects a 16-byte aligned address for a memory address, or else a segfault is generated.
The src_pixels buffer below was not aligned to 16 bytes on the stack necessarily, so we got segfaults during fate-checkasm-sw_scale.

Therefore 16-byte align all of these local variables, aligning them too much shouldn't hurt.
---
 tests/checkasm/sw_scale.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
index 31d9a525e9..b643a47c30 100644
--- a/tests/checkasm/sw_scale.c
+++ b/tests/checkasm/sw_scale.c
@@ -75,11 +75,11 @@ static void check_yuv2yuvX(void)
                       int dstW, const uint8_t *dither, int offset);
 
     const int16_t **src;
-    LOCAL_ALIGNED_8(int16_t, src_pixels, [LARGEST_FILTER * LARGEST_INPUT_SIZE]);
-    LOCAL_ALIGNED_8(int16_t, filter_coeff, [LARGEST_FILTER]);
-    LOCAL_ALIGNED_8(uint8_t, dst0, [LARGEST_INPUT_SIZE]);
-    LOCAL_ALIGNED_8(uint8_t, dst1, [LARGEST_INPUT_SIZE]);
-    LOCAL_ALIGNED_8(uint8_t, dither, [LARGEST_INPUT_SIZE]);
+    LOCAL_ALIGNED_16(int16_t, src_pixels, [LARGEST_FILTER * LARGEST_INPUT_SIZE]);
+    LOCAL_ALIGNED_16(int16_t, filter_coeff, [LARGEST_FILTER]);
+    LOCAL_ALIGNED_16(uint8_t, dst0, [LARGEST_INPUT_SIZE]);
+    LOCAL_ALIGNED_16(uint8_t, dst1, [LARGEST_INPUT_SIZE]);
+    LOCAL_ALIGNED_16(uint8_t, dither, [LARGEST_INPUT_SIZE]);
     union VFilterData{
         const int16_t *src;
         uint16_t coeff[8];
-- 
2.20.1 (Apple Git-117)


[-- Attachment #3: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa
  2022-06-16  8:59 [FFmpeg-devel] [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa Thilo Borgmann
@ 2022-06-18 21:50 ` Martin Storsjö
  2022-06-20  9:09   ` Thilo Borgmann
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Storsjö @ 2022-06-18 21:50 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Thu, 16 Jun 2022, Thilo Borgmann wrote:

> Hi,
>
> movdqa in ff_yuv2yuvX_sse3() expects a 16-byte alignment according to its 
> documentation causing segfaults in fate-checkasm-sw_scale.

LGTM, thanks!

// Martin

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [FFmpeg-devel] [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa
  2022-06-18 21:50 ` Martin Storsjö
@ 2022-06-20  9:09   ` Thilo Borgmann
  0 siblings, 0 replies; 3+ messages in thread
From: Thilo Borgmann @ 2022-06-20  9:09 UTC (permalink / raw)
  To: ffmpeg-devel

Am 18.06.22 um 23:50 schrieb Martin Storsjö:
> On Thu, 16 Jun 2022, Thilo Borgmann wrote:
> 
>> Hi,
>>
>> movdqa in ff_yuv2yuvX_sse3() expects a 16-byte alignment according to its documentation causing segfaults in fate-checkasm-sw_scale.
> 
> LGTM, thanks!

Pushed, Thanks!

-Thilo
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-20  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16  8:59 [FFmpeg-devel] [PATCH] tests/checkasm/sw_scale: Fix alignment for movdqa Thilo Borgmann
2022-06-18 21:50 ` Martin Storsjö
2022-06-20  9:09   ` Thilo Borgmann

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git