From: Alan Kelly <alankelly-at-google.com@ffmpeg.org>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 3/5] libswscale: Avx2 hscale can process inputs of any size.
Date: Wed, 13 Jul 2022 10:04:22 +0200
Message-ID: <CABaBdZqj8tOB8SdFcHmQEFVjKociHU3rLmiF_5p6UvKoezGxZQ@mail.gmail.com> (raw)
In-Reply-To: <20220426080002.404023-1-alankelly@google.com>
Hi,
Are there any further comments on this patch or can it be committed?
Thanks,
Alan
On Tue, Apr 26, 2022 at 10:00 AM Alan Kelly <alankelly@google.com> wrote:
> The main loop processes blocks of 16 pixels. The tail processes blocks
> of size 4.
> ---
> libswscale/x86/scale_avx2.asm | 44 ++++++++++++++++++++++++++++++++++-
> 1 file changed, 43 insertions(+), 1 deletion(-)
>
> diff --git a/libswscale/x86/scale_avx2.asm b/libswscale/x86/scale_avx2.asm
> index 20acdbd633..7657b2825f 100644
> --- a/libswscale/x86/scale_avx2.asm
> +++ b/libswscale/x86/scale_avx2.asm
> @@ -53,6 +53,9 @@ cglobal hscale8to15_%1, 7, 9, 16, pos0, dst, w, srcmem,
> filter, fltpos, fltsize,
> mova m14, [four]
> shr fltsized, 2
> %endif
> + cmp wq, 16
> + jl .tail_loop
> + sub wq, 0x10
> .loop:
> movu m1, [fltposq]
> movu m2, [fltposq+32]
> @@ -101,7 +104,46 @@ cglobal hscale8to15_%1, 7, 9, 16, pos0, dst, w,
> srcmem, filter, fltpos, fltsize,
> add fltposq, 0x40
> add countq, 0x10
> cmp countq, wq
> - jl .loop
> + jle .loop
> +
> + add wq, 0x10
> + cmp countq, wq
> + jge .end
> +
> +.tail_loop:
> + movu xm1, [fltposq]
> +%ifidn %1, X4
> + pxor xm9, xm9
> + pxor xm10, xm10
> + xor innerq, innerq
> +.tail_innerloop:
> +%endif
> + vpcmpeqd xm13, xm13
> + vpgatherdd xm3,[srcmemq + xm1], xm13
> + vpunpcklbw xm5, xm3, xm0
> + vpunpckhbw xm6, xm3, xm0
> + vpmaddwd xm5, xm5, [filterq]
> + vpmaddwd xm6, xm6, [filterq + 16]
> + add filterq, 0x20
> +%ifidn %1, X4
> + paddd xm9, xm5
> + paddd xm10, xm6
> + paddd xm1, xm14
> + add innerq, 1
> + cmp innerq, fltsizeq
> + jl .tail_innerloop
> + vphaddd xm5, xm9, xm10
> +%else
> + vphaddd xm5, xm5, xm6
> +%endif
> + vpsrad xm5, 7
> + vpackssdw xm5, xm5, xm5
> + vmovq [dstq + countq * 2], xm5
> + add fltposq, 0x10
> + add countq, 0x4
> + cmp countq, wq
> + jl .tail_loop
> +.end:
> REP_RET
> %endmacro
>
> --
> 2.36.0.rc2.479.g8af0fa9b8e-goog
>
>
_______________________________________________
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".
prev parent reply other threads:[~2022-07-13 8:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-17 10:04 Alan Kelly
2022-02-17 16:21 ` Michael Niedermayer
2022-03-07 15:27 ` Alan Kelly
2022-04-22 8:02 ` Alan Kelly
2022-04-22 14:53 ` Paul B Mahol
2022-04-22 17:42 ` Michael Niedermayer
2022-04-26 7:45 ` Alan Kelly
2022-04-26 8:00 ` Alan Kelly
2022-07-13 8:04 ` Alan Kelly [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=CABaBdZqj8tOB8SdFcHmQEFVjKociHU3rLmiF_5p6UvKoezGxZQ@mail.gmail.com \
--to=alankelly-at-google.com@ffmpeg.org \
--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