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

HDR10 support #30

Open
Tronic opened this issue May 20, 2023 · 0 comments
Open

HDR10 support #30

Tronic opened this issue May 20, 2023 · 0 comments

Comments

@Tronic
Copy link

Tronic commented May 20, 2023

Nowadays the most commonly needed conversion tends to be HDR, with all new displays doing that natively. The module is clearly designed for SDR, but would it be possible to implement a meaningful HDR conversion?

Note that HDR exists with linear brightness (float16 or float32) that can be expressed as linear RGB using the BT.2020 primaries, but on wire and on some surface pixmaps a 10-bit integer quantization (PQ curve) is used. Note that the range of values uses limited range 64-940 (inclusive from black to peak up to 10 000 nits). sRGB white point would typically be mapped around 200 nits but may be configurable (brightness setting, or simply multiply values in linear space). To add to that complication, both RGB (all components either float linear or PQ10) and YUV formats are available (YUV apparently have 8 bit U and V as usual but Y using that 10 bit PQ curve).

https://en.wikipedia.org/wiki/Rec._2100 - HDR10 standard, BT.2020 primaries
https://en.wikipedia.org/wiki/Perceptual_quantizer - PQ transfer function

And if anyone wants to dive into the YUV conversion, this thread has proper (full range RGB to limited range YUV conversions in 8 bits, just need to change Y to use PQ apparently):

https://stackoverflow.com/questions/17892346/how-to-convert-rgb-yuv-rgb-both-ways

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

No branches or pull requests

1 participant