• Home
Name Date Size #Lines LOC

..--

.github/workflows/04-Jul-2025-300235

adobe-hdr-gain-map-license/04-Jul-2025-2219

benchmark/04-Jul-2025-661548

cmake/04-Jul-2025-443377

docs/04-Jul-2025-560401

examples/04-Jul-2025-1,8211,659

fuzzer/04-Jul-2025-1,054834

java/04-Jul-2025-3,4132,155

lib/04-Jul-2025-15,73211,920

tests/04-Jul-2025-8,4535,201

third_party/image_io/04-Jul-2025-11,1056,973

.clang-formatD04-Jul-2025153 86

.gitignoreD04-Jul-2025144 98

Android.bpD04-Jul-20253.1 KiB133127

CMakeLists.txtD04-Jul-202532.9 KiB839775

DESCRIPTIOND04-Jul-2025778 1311

LICENSED04-Jul-202511.1 KiB203169

METADATAD04-Jul-2025571 2018

OWNERSD04-Jul-2025105 32

README.mdD04-Jul-20253.7 KiB5742

ultrahdr_api.hD04-Jul-202541.3 KiB899205

README.md

1## Introduction
2
3libultrahdr is an image compression library that uses gain map technology
4to store and distribute HDR images. Conceptually on the encoding side, the
5library accepts SDR and HDR rendition of an image and from these a Gain Map
6(quotient between the two renditions) is computed. The library then uses
7backward compatible means to store the base image (SDR), gain map image and
8some associated metadata. Legacy readers that do not support handling the
9gain map image and/or metadata, will display the base image. Readers that
10support the format combine the base image with the gain map and render a
11high dynamic range image on compatible displays.
12
13For additional information, see android hdr-image-format
14[guide](https://developer.android.com/guide/topics/media/platform/hdr-image-format).
15
16## Build from source using CMake
17
18This software suite has been built and tested on platforms:
19- Android
20- Linux
21- macOS
22- Windows
23
24Refer to [building.md](docs/building.md) for complete instructions.
25
26## Using libultrahdr
27
28A detailed description of libultrahdr encode and decode api is included in [ultrahdr_api.h](ultrahdr_api.h)
29and for sample usage refer [demo app](examples/ultrahdr_app.cpp).
30
31libultrahdr includes two classes of APIs, one to compress and the other to decompress HDR images:
32
33### Encoding api outline:
34
35| Scenario  | Hdr intent raw | Sdr intent raw | Sdr intent compressed | Gain map compressed | Quality |   Exif   | Use Case |
36|:---------:| :----------: | :----------: | :---------------------: | :-------------------: | :-------: | :---------: | :-------- |
37| API - 0 | P010 or rgba1010102 or rgbaf16 |    No   |  No  |  No  | Optional| Optional | Used if, only hdr raw intent is present. [^1] |
38| API - 1 | P010 or rgba1010102 or rgbaf16 | YUV420 or rgba8888 |  No  |  No  | Optional| Optional | Used if, hdr raw and sdr raw intents are present.[^2] |
39| API - 2 | P010 or rgba1010102 or rgbaf16 | YUV420 or rgba8888 | Yes  |  No  |    No   |    No    | Used if, hdr raw, sdr raw and sdr compressed intents are present.[^3] |
40| API - 3 | P010 or rgba1010102 or rgbaf16 |    No   | Yes  |  No  |    No   |    No    | Used if, hdr raw and sdr compressed intents are present.[^4] |
41| API - 4 |  No  |    No   | Yes  | Yes  |    No   |    No    | Used if, sdr compressed, gain map compressed and GainMap Metadata are present.[^5] |
42
43[^1]: Tonemap hdr to sdr. Compute gain map from hdr and sdr. Compress sdr and gainmap at quality configured. Add exif if provided. Combine sdr compressed, gainmap in multi picture format with gainmap metadata.
44[^2]: Compute gain map from hdr and sdr. Compress sdr and gainmap at quality configured. Add exif if provided. Combine sdr compressed, gainmap in multi picture format with gainmap metadata.
45[^3]: Compute gain map from hdr and raw sdr. Compress gainmap. Combine sdr compressed, gainmap in multi picture format with gainmap metadata.
46[^4]: Decode compressed sdr input. Compute gain map from hdr and decoded sdr. Compress gainmap. Combine sdr compressed, gainmap in multi picture format with gainmap metadata.
47[^5]: Combine sdr compressed, gainmap in multi picture format with gainmap metadata.
48
49### Decoding api outline:
50
51Configure display device characteristics (display transfer characteristics, max display boost) for optimal usage.
52
53| Input  | Usage |
54| ------------- | ------------- |
55| max_display_boost  | (optional, >= 1.0) the maximum available boost supported by a display. |
56| supported color transfer format pairs  | <table><thead><tr><th>color transfer</th><th>Color format </th></tr></thead><tbody><tr><td>SDR</td><td>32bppRGBA8888</td></tr><tr><td>HDR_LINEAR</td><td>64bppRGBAHalfFloat</td></tr><tr><td>HDR_PQ</td><td>32bppRGBA1010102 PQ</td></tr><tr><td>HDR_HLG</td><td>32bppRGBA1010102 HLG</td></tr></tbody></table> |
57