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

Fix pixel byte order / color correctness for vtcapture #115

Merged
merged 2 commits into from
Apr 13, 2024

Conversation

sundermann
Copy link
Contributor

@sundermann sundermann commented Apr 2, 2024

In libyuv RGB24 actually means bgr byte order. Hyperion/HyperHDR expect pixels to be in rgb byte order.

This wasn't really an issue with UI layer captures as:

Capture using FMT_ABGR (which is in fact ARGB) => ABGRToARGB (now the bytes are indeed bgr) => ARGBToRGB24 (reversing it again to get rgb again)

Though in case for the captured content from vtcapture we assumed it to be NV21 (which is in fact NV12, confirmed using kernel sources) it kind of works because NV21 uses a similar but swapped layout. However we end up with swapped UV planes resulting in the colors being a little bit off. If NV12 is used then colors are almost perfect.

Thanks @asturel for investigating this

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.

None yet

1 participant