commit | be53c5794e5db5ffe3669ca16b27d0daa97a094b | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <[email protected]> | Sat Dec 02 02:07:41 2023 +0000 |
committer | Android Build Coastguard Worker <[email protected]> | Sat Dec 02 02:07:41 2023 +0000 |
tree | f4ccb049b732c195a54810c3113449d664a784ce | |
parent | 7f6fe3262672a9cbc38e3209026838069ebafbb6 [diff] | |
parent | 5d7f30ac00a5b92fca6656629c995cc0fd0087f4 [diff] |
Snap for 11169761 from 5d7f30ac00a5b92fca6656629c995cc0fd0087f4 to 24Q1-release Change-Id: I4176037208211422fcf7c0e461ac47df16445a27
libultrahdr is an image compression library that uses gain map technology to store and distribute HDR images. Conceptually on the encoding side, the library accepts SDR and HDR rendition of an image and from these a Gain Map (quotient between the two renditions) is computed. The library then uses backward compatible means to store the base image (SDR), gain map image and some associated metadata. Legacy readers that do not support parsing the gain map image and/or metadata, will display the base image. Readers that support the format combine the base image with the gain map and render a high dynamic range image on compatible displays.
More information about libultrahdr can be found at https://developer.android.com/guide/topics/media/platform/hdr-image-format.
libultrahdr compresses base image and gain map image in to jpeg format. For this libjpeg-turbo is used. This is cloned from https://github.com/libjpeg-turbo/libjpeg-turbo.git and included in the build process.
CMake v3.13 or later
NASM or Yasm (If libjpeg-turbo needs to be built with SIMD extensions)
Compilers with support for C++17
Should work with GCC v7 (or later) and Clang 5 (or later) on Linux and Mac Platforms.
Should work with Microsoft Visual C++ 2019 (or later) on Windows Platforms.
To build libultrahdr, examples, unit tests:
mkdir {build_directory} cd {build_directory} cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DUHDR_BUILD_TESTS=1 ../ make ctest
This will generate the following files under {build_directory}:
libultrahdr.a
Static link library for the ultrahdr API
ultrahdr_app
Sample application demonstrating ultrahdr API
ultrahdr_unit_test
Unit tests
mkdir {build_directory} cd {build_directory} cmake -G "Visual Studio 16 2019" -DUHDR_BUILD_TESTS=1 ../ cmake --build ./ --config=Release ctest -C Release
This will generate the following files under {build_directory/Release}:
ultrahdr.lib
Static link library for the ultrahdr API
ultrahdr_app.exe
Sample application demonstrating ultrahdr API
ultrahdr_unit_test.exe
Unit tests
mkdir {build_directory} cd {build_directory} cmake -G "NMake Makefiles" -DUHDR_BUILD_TESTS=1 ../ cmake --build ./ ctest
This will generate the following files under {build_directory}:
ultrahdr.lib
Static link library for the ultrahdr API
ultrahdr_app.exe
Sample application demonstrating ultrahdr API
ultrahdr_unit_test.exe
Unit tests
NOTE: This assumes that you are building on a Windows machine using the MSYS environment.
mkdir {build_directory} cd {build_directory} cmake -G "MSYS Makefiles" -DUHDR_BUILD_TESTS=1 ../ cmake --build ./ ctest mkdir {build_directory} cd {build_directory} cmake -G "MinGW Makefiles" -DUHDR_BUILD_TESTS=1 ../ cmake --build ./ ctest
This will generate the following files under {build_directory}:
libultrahdr.a
Static link library for the ultrahdr API
ultrahdr_app.exe
Sample application demonstrating ultrahdr API
ultrahdr_unit_test.exe
Unit tests
NOTE: To not build unit tests, skip passing -DUHDR_BUILD_TESTS=1
Refer to README.md for complete instructions.
libultrahdr includes two classes of APIs, one to compress and the other to decompress HDR images: