Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use memcpy if pixel format is the same #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agners
Copy link
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
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
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.

2 participants