Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] swscale/aarch64: dotprod implementation of rgba32_to_Y
Date: Fri, 28 Feb 2025 11:49:53 +0100
Message-ID: <GV1SPRMB0036660B3DEF03336AFA45B08FCC2@GV1SPRMB0036.EURP250.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20250228112117.GB623013@haasn.xyz>

Niklas Haas:
> On Fri, 28 Feb 2025 10:31:19 +0800 Zhao Zhili <quinkblack@foxmail.com> wrote:
>> Cc haasn.
>>
>> Libswscale in under refactor. Does current asm works after refactor, or they need to be refactored or
>> rewrite after? If it’s the second case, maybe we should hold on to do more asm with libswscale
>> before hassn work done.
> 
> No, almost all current asm will be unused after the rewrite. There are some we
> can in theory reuse, but for the most part, it doesn't seem to be worth it.
> 
> Especially for the very bespoke functions like this one.
> 
> For context, in general, the focus in nu-swscale is to focus more on smaller,
> flexible primitives and have the calling code combine them as needed. So instead
> of a "brga_to_y" function, you would have a sequence that looks like this:
> 
> Operation list:
>   [ u8 XXXX -> dddX] SWS_OP_READ         : 4 elem(s) packed >> 0
>   [ u8 ...X -> dddX] SWS_OP_SWIZZLE      : 2103
>   [ u8 ...X -> dddX] SWS_OP_CONVERT      : u8 -> f32
>   [f32 ...X -> .XXX] SWS_OP_LINEAR       : dot3 [[0.299000 0.587000 0.114000 0 0] [0 1 0 0 0] [0 0 1 0 0] [0 0 0 1 0]]
>   [f32 .XXX -> .XXX] SWS_OP_DITHER       : 16x16 {255 _ _ _}
>   [f32 .XXX -> dXXX] SWS_OP_CONVERT      : f32 -> u8
>   [ u8 .XXX -> XXXX] SWS_OP_WRITE        : 1 elem(s) packed >> 0
> 
> Where each low-level implementation can combine one, or multiple, such
> operations together. For example, in the current prototype, SWS_OP_CONVERT and
> SWS_OP_WRITE can be fused together into a single implementation.
> 
> Note also the conversion to float. I found that the cost of going through
> floats seems to be lower on average, across all tested platforms, than the
> extra cost of dealing with integers (which require extra shifting, extra
> dithering, and extra width conversions - all of which exceed the cost of just
> one extra float->int conversion step). This also comes with improved accuracy.
> 
But what about bitexactness?

- Andreas

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

  parent reply	other threads:[~2025-02-28 10:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27 22:44 Krzysztof Pyrkosz via ffmpeg-devel
2025-02-28  2:31 ` Zhao Zhili
2025-02-28 10:21   ` Niklas Haas
2025-02-28 10:43     ` Martin Storsjö
2025-02-28 10:49     ` Andreas Rheinhardt [this message]
2025-02-28 11:32       ` Niklas Haas

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=GV1SPRMB0036660B3DEF03336AFA45B08FCC2@GV1SPRMB0036.EURP250.PROD.OUTLOOK.COM \
    --to=andreas.rheinhardt@outlook.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