Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] swscale: aarch64: Fix yuv2rgb with negative strides
Date: Thu, 27 Oct 2022 13:18:26 +0300 (EEST)
Message-ID: <d7df49-5e4-83c3-3a16-c99455a3b5dc@martin.st> (raw)
In-Reply-To: <20221025101920.40198-1-martin@martin.st>

On Tue, 25 Oct 2022, Martin Storsjö wrote:

> Treat the 32 bit stride registers as signed.
>
> Alternatively, we could make the stride arguments ptrdiff_t instead
> of int, and changing all of the assembly to operate on these
> registers with their full 64 bit width, but that's a much larger
> and more intrusive change (and risks missing some operation, which
> would clamp the intermediates to 32 bit still).
>
> Fixes: https://trac.ffmpeg.org/ticket/9985
>
> Signed-off-by: Martin Storsjö <martin@martin.st>
> ---
> libswscale/aarch64/yuv2rgb_neon.S | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
> index f4b220fb60..f341268c5d 100644
> --- a/libswscale/aarch64/yuv2rgb_neon.S
> +++ b/libswscale/aarch64/yuv2rgb_neon.S
> @@ -118,8 +118,8 @@
> .endm
>
> .macro increment_yuv422p
> -    add                 x6,  x6,  w7, UXTW                              // srcU += incU
> -    add                 x13, x13, w14, UXTW                             // srcV += incV
> +    add                 x6,  x6,  w7, SXTW                              // srcU += incU
> +    add                 x13, x13, w14, SXTW                             // srcV += incV
> .endm
>
> .macro compute_rgba r1 g1 b1 a1 r2 g2 b2 a2
> @@ -189,8 +189,8 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
>     st4                 {v16.8B,v17.8B,v18.8B,v19.8B}, [x2], #32
>     subs                w8, w8, #16                                     // width -= 16
>     b.gt                2b
> -    add                 x2, x2, w3, UXTW                                // dst  += padding
> -    add                 x4, x4, w5, UXTW                                // srcY += paddingY
> +    add                 x2, x2, w3, SXTW                                // dst  += padding
> +    add                 x4, x4, w5, SXTW                                // srcY += paddingY
>     increment_\ifmt
>     subs                w1, w1, #1                                      // height -= 1
>     b.gt                1b
> -- 
> 2.37.0 (Apple Git-136)

Will push later today, and backport to some older branches where relevant 
(a bit later).

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

      reply	other threads:[~2022-10-27 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25 10:19 Martin Storsjö
2022-10-27 10:18 ` Martin Storsjö [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=d7df49-5e4-83c3-3a16-c99455a3b5dc@martin.st \
    --to=martin@martin.st \
    --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