From: "Ronald S. Bultje" <rsbultje@gmail.com>
To: Wu Jianhua <toqsxw@outlook.com>
Cc: Nuo Mi <nuomi2021@gmail.com>, James Almer <jamrial@gmail.com>,
FFmpeg development discussions and patches
<ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 1/3] avcodec/x86/vvc/vvc_alf: fix integer overflow
Date: Wed, 29 May 2024 16:56:27 -0400
Message-ID: <CAEEMt2khNCWX5WU7UpG42uSzhQxwBwx=fF95f_FT5asYyXQh0g@mail.gmail.com> (raw)
In-Reply-To: <OSZP286MB2173E91C4A88B40E809F0931CAF22@OSZP286MB2173.JPNP286.PROD.OUTLOOK.COM>
Hi,
On Wed, May 29, 2024 at 3:44 PM Wu Jianhua <toqsxw@outlook.com> wrote:
> Ronald S. Bultje:
> > On Wed, May 29, 2024 at 11:38 AM <toqsxw@outlook.com<mailto:
> toqsxw@outlook.com>> wrote:
> > +%else
> > + vpunpcklqdq m11, m2, m2
> > + vpunpckhqdq m12, m2, m2
> > + vpunpcklwd m11, m11, m14
> > + vpunpcklwd m12, m12, m14
> > + paddd m0, m11
> > + paddd m1, m12
> > + packssdw m0, m0, m1
> > +%endif
> >
> [..]
>
> Also, the whole thing just emulates a saturated add. Can't you use paddsw
> instead of paddw and be done with it? To add to Andreas' question: is
> saturating here normatively required?
>
> We didn't have any sample that failed for this issue except for the
> checksum with specific seeds. I think we can keep not changing it until a
> real sample has something wrong.
>
> @Nuomi to get more details.
>
I think "just" replacing paddw with paddsw is correct, since the input
pixels are 12bit (so they could be either unsigned or signed), the filtered
output is the result of packssdw (so signed words), and the desired output
is 12bit pixels anyway, anything greater than that is clipped to 12bit
range. So to me, it seems paddsw is a cheaper way to accomplish the same
thing.
Ronald
_______________________________________________
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".
next prev parent reply other threads:[~2024-05-29 20:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 15:38 toqsxw
2024-05-29 16:23 ` Andreas Rheinhardt
2024-05-29 17:51 ` Ronald S. Bultje
2024-05-29 19:44 ` [FFmpeg-devel] 回复: " Wu Jianhua
2024-05-29 20:56 ` Ronald S. Bultje [this message]
2024-05-30 16:31 ` Wu Jianhua
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='CAEEMt2khNCWX5WU7UpG42uSzhQxwBwx=fF95f_FT5asYyXQh0g@mail.gmail.com' \
--to=rsbultje@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=jamrial@gmail.com \
--cc=nuomi2021@gmail.com \
--cc=toqsxw@outlook.com \
/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