Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/vsrc_testsrc: use aligned macros for writing
Date: Mon, 10 Mar 2025 16:29:18 -0300
Message-ID: <20250310192918.3504-2-jamrial@gmail.com> (raw)
In-Reply-To: <20250310192918.3504-1-jamrial@gmail.com>

Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavfilter/vsrc_testsrc.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 71188e624a..0da8cb0fa4 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -1035,7 +1035,7 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
     case AV_PIX_FMT_ABGR:
         v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)) + (255U << (rgba_map[A]*8));
         p = dst + 4*x + y*dst_linesize;
-        AV_WL32(p, v);
+        AV_WL32A(p, v);
         break;
     case AV_PIX_FMT_X2RGB10LE:
     case AV_PIX_FMT_X2BGR10LE:
@@ -1044,7 +1044,7 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
             (b  << ((desc->comp[2].offset*8) + desc->comp[2].shift)) +
             (3U << ((desc->comp[3].offset*8) + desc->comp[3].shift));
         p = dst + 4*x + y*dst_linesize;
-        AV_WL32(p, v);
+        AV_WL32A(p, v);
         break;
     case AV_PIX_FMT_GBRP:
         p = dstp[0] + x + y * dst_linesize;
@@ -1197,22 +1197,22 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
             (u << ((desc->comp[1].offset*8) + desc->comp[1].shift)) +
             (v << ((desc->comp[2].offset*8) + desc->comp[2].shift)) +
             (3U << ((desc->comp[3].offset*8) + desc->comp[3].shift));
-        AV_WL32(&dstp[0][i*4 + j*dst_linesizep[0]], n);
+        AV_WL32A(&dstp[0][i*4 + j*dst_linesizep[0]], n);
         break;
     case AV_PIX_FMT_XV36:
     case AV_PIX_FMT_XV48:
     case AV_PIX_FMT_AYUV64:
-        AV_WN16(&dstp[0][i*8 + ayuv_map[Y]*2 + j*dst_linesizep[0]], y << desc->comp[0].shift);
-        AV_WN16(&dstp[0][i*8 + ayuv_map[U]*2 + j*dst_linesizep[0]], u << desc->comp[1].shift);
-        AV_WN16(&dstp[0][i*8 + ayuv_map[V]*2 + j*dst_linesizep[0]], v << desc->comp[2].shift);
-        AV_WN16(&dstp[0][i*8 + ayuv_map[A]*2 + j*dst_linesizep[0]], UINT16_MAX << desc->comp[3].shift);
+        AV_WN16A(&dstp[0][i*8 + ayuv_map[Y]*2 + j*dst_linesizep[0]], y << desc->comp[0].shift);
+        AV_WN16A(&dstp[0][i*8 + ayuv_map[U]*2 + j*dst_linesizep[0]], u << desc->comp[1].shift);
+        AV_WN16A(&dstp[0][i*8 + ayuv_map[V]*2 + j*dst_linesizep[0]], v << desc->comp[2].shift);
+        AV_WN16A(&dstp[0][i*8 + ayuv_map[A]*2 + j*dst_linesizep[0]], UINT16_MAX << desc->comp[3].shift);
         break;
     case AV_PIX_FMT_UYVA:
     case AV_PIX_FMT_VUYA:
     case AV_PIX_FMT_VUYX:
     case AV_PIX_FMT_AYUV:
         n = (y << (ayuv_map[Y]*8)) + (u << (ayuv_map[U]*8)) + (v << (ayuv_map[V]*8)) + (255U << (ayuv_map[A]*8));
-        AV_WL32(&dstp[0][i*4 + j*dst_linesizep[0]], n);
+        AV_WL32A(&dstp[0][i*4 + j*dst_linesizep[0]], n);
         break;
     case AV_PIX_FMT_YUV444P:
     case AV_PIX_FMT_YUVJ444P:
@@ -1225,9 +1225,9 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
     case AV_PIX_FMT_YUV444P12:
     case AV_PIX_FMT_YUV444P14:
     case AV_PIX_FMT_YUV444P16:
-        AV_WN16(&dstp[0][i*2 + j*dst_linesizep[0]], y);
-        AV_WN16(&dstp[1][i*2 + j*dst_linesizep[1]], u);
-        AV_WN16(&dstp[2][i*2 + j*dst_linesizep[2]], v);
+        AV_WN16A(&dstp[0][i*2 + j*dst_linesizep[0]], y);
+        AV_WN16A(&dstp[1][i*2 + j*dst_linesizep[1]], u);
+        AV_WN16A(&dstp[2][i*2 + j*dst_linesizep[2]], v);
         break;
     case AV_PIX_FMT_NV24:
         dstp[0][i   + j*dst_linesizep[0] + 0] = y;
@@ -1242,9 +1242,9 @@ static void yuvtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
     case AV_PIX_FMT_P410:
     case AV_PIX_FMT_P412:
     case AV_PIX_FMT_P416:
-        AV_WN16(&dstp[0][i*2 + j*dst_linesizep[0] + 0], y << (16 - desc->comp[0].depth));
-        AV_WN16(&dstp[1][i*4 + j*dst_linesizep[1] + 0], u << (16 - desc->comp[1].depth));
-        AV_WN16(&dstp[1][i*4 + j*dst_linesizep[1] + 2], v << (16 - desc->comp[1].depth));
+        AV_WN16A(&dstp[0][i*2 + j*dst_linesizep[0] + 0], y << (16 - desc->comp[0].depth));
+        AV_WN16A(&dstp[1][i*4 + j*dst_linesizep[1] + 0], u << (16 - desc->comp[1].depth));
+        AV_WN16A(&dstp[1][i*4 + j*dst_linesizep[1] + 2], v << (16 - desc->comp[1].depth));
         break;
     }
 }
-- 
2.48.1

_______________________________________________
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".

      reply	other threads:[~2025-03-10 19:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 19:29 [FFmpeg-devel] [PATCH 1/2] tests/fate/pixfmt: add conversion tests with semi planar YUV formats James Almer
2025-03-10 19:29 ` James Almer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250310192918.3504-2-jamrial@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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