From: "Martin Storsjö" <martin@martin.st>
To: "Swinney, Jonathan" <jswinney@amazon.com>
Cc: "Pop, Sebastian" <spop@amazon.com>,
"ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v2 2/2] swscale/aarch64: add hscale specializations
Date: Wed, 25 May 2022 11:40:44 +0300 (EEST)
Message-ID: <d3d8b98a-b1c3-2fb7-4ed6-73279725675c@martin.st> (raw)
In-Reply-To: <aa94ef683ff046bfbae0e06384741005@EX13D07UWB004.ant.amazon.com>
On Wed, 25 May 2022, Swinney, Jonathan wrote:
> This patch adds code to support specializations of the hscale function and adds
> a specialization for filterSize == 4.
>
> ff_hscale8to15_4_neon is a complete rewrite. Since the main bottleneck here is
> loading the data from src, this data is loaded a whole block ahead and stored
> back to the stack to be loaded again with ld4. This arranges the data for most
> efficient use of the vector instructions and removes the need for completion
> adds at the end. The number of iterations of the C per iteration of the assembly
> is increased from 4 to 8, but because of the prefetching, there must be a
> special section without prefetching when dstW < 16.
>
> This improves speed on Graviton 2 (Neoverse N1) dramatically in the case where
> previously fs=8 would have been required.
>
> before: hscale_8_to_15__fs_8_dstW_512_neon: 1962.8
> after : hscale_8_to_15__fs_4_dstW_512_neon: 1220.9
>
> Signed-off-by: Jonathan Swinney <jswinney@amazon.com>
> ---
> libswscale/aarch64/hscale.S | 172 ++++++++++++++++++++++++++++++++++-
> libswscale/aarch64/swscale.c | 40 ++++++--
> libswscale/utils.c | 2 +-
> 3 files changed, 203 insertions(+), 11 deletions(-)
>
> -void ff_hscale_8_to_15_neon(SwsContext *c, int16_t *dst, int dstW,
> - const uint8_t *src, const int16_t *filter,
> - const int32_t *filterPos, int filterSize);
> +#define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
> +void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
> + SwsContext *c, int16_t *data, \
> + int dstW, const uint8_t *src, \
> + const int16_t *filter, \
> + const int32_t *filterPos, int filterSize)
> +#define SCALE_FUNCS(filter_n, opt) \
> + SCALE_FUNC(filter_n, 8, 15, opt);
> +#define ALL_SCALE_FUNCS(opt) \
> + SCALE_FUNCS(4, opt); \
> + SCALE_FUNCS(8, opt); \
> + SCALE_FUNCS(X8, opt)
Here, you still declare the -8 function which no longer is implemented.
Other than that, this patch looks fine I think.
// 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".
next prev parent reply other threads:[~2022-05-25 8:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-25 1:21 Swinney, Jonathan
2022-05-25 8:40 ` Martin Storsjö [this message]
2022-05-25 8:53 ` Martin Storsjö
2022-05-25 8:54 ` Martin Storsjö
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=d3d8b98a-b1c3-2fb7-4ed6-73279725675c@martin.st \
--to=martin@martin.st \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=jswinney@amazon.com \
--cc=spop@amazon.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