From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] libswscale.c : ff_xyz12Torgb48 expensive unaligned 16 byte accesses
Date: Sun, 25 May 2025 21:58:45 -0300
Message-ID: <ec30364b-2189-42b7-8048-7b6a343f775a@gmail.com> (raw)
In-Reply-To: <DM4PR21MB461911571585877FFEEE236E9265A@DM4PR21MB4619.namprd21.prod.outlook.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 1002 bytes --]
On 5/25/2025 9:44 PM, Chitra Dey Sarkar via ffmpeg-devel wrote:
> H
> We have been profiling FFmpeg at Microsoft and have identified that ff_xyz12ToRgb48 has a high sample count ( profiled every 1ms )
>
> It seems like ff_xyz12ToRgb48 has performance penalty for
>
> 1. Unaligned read and write access
> 2. Access to xyz2rgb_matrix
> 3. Multiplication
>
> I would be interested in optimizing this code , wanted to check if there is an existing optimized version of this function, or any recommended approach to improve it(?
> I can move the repeated access to xyz2rgb_matrix outside the inner loop and load a full cache line at once to extract the X, Y, and Z values more efficiently-but I wanted to start by getting some initial feedback or thoughts before proceeding further
Niklas is currently working in a library rewrite, which may affect xyz
scaling. But in any case, the obvious approach is a SIMD optimized
implementation (SSE2, AVX2, etc) of this function.
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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:[~2025-05-26 0:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <DM4PR21MB46198B14FF74B677790A8459929AA@DM4PR21MB4619.namprd21.prod.outlook.com>
2025-05-26 0:44 ` Chitra Dey Sarkar via ffmpeg-devel
2025-05-26 0:58 ` 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=ec30364b-2189-42b7-8048-7b6a343f775a@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