Skip to content

use memcpy if pixel format is the same#32

Open
agners wants to merge 1 commit intoany1:masterfrom
agners:optimize-pixel32-to-cpixel
Open

use memcpy if pixel format is the same#32
agners wants to merge 1 commit intoany1:masterfrom
agners:optimize-pixel32-to-cpixel

Conversation

@agners
Copy link
Copy Markdown
Contributor

@agners agners commented May 22, 2020

Use memcpy if the pixel format of source and destination is the same.
This improves performance of raw encoding significantly in my test
case with Weston.

Use memcpy if the pixel format of source and destination is the same.
This improves performance of raw encoding significantly in my test
case with Weston.
@any1
Copy link
Copy Markdown
Owner

any1 commented May 22, 2020

The problem here is that if bytes_per_cpixel = 3 and the pixel format is xRGB or xBGR big endian, then this breaks because VNC has this special "compact pixel" format that discards the unused byte when the depth = 24 bits and bits-per-pixel = 32 bits.

This function is written in such a way that it can be auto-vectorized. If you set --buildtype=release and with x86_64-simd in meson_options.txt set to avx2, you should get significant performance improvements.

However, keep in mind that it is fairly uncommon for clients to choose raw encoding, so optimising this particular function is probably not very good use of your time as it is definitely not going to be the tightest bottleneck when using tight or zrle encoding.

If you want to have a chat about performance and optimisation, drop by #wayvnc on freenode.

Decodetalkers pushed a commit to Decodetalkers/neatvnc that referenced this pull request Aug 20, 2022
@jhofstee
Copy link
Copy Markdown
Contributor

jhofstee commented Nov 2, 2024

@agners please comment on @any1 his comment or please close the pull request. This is 4 years old by now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants