Coder Social home page Coder Social logo

phunm211 / libultrahdr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from google/libultrahdr

0.0 0.0 0.0 1.28 MB

Ultra HDR is a true 10-bit HDR image format, and is backcompatible. libultrahdr is the reference codec for the Ultra HDR format. The codecs that support the format can render the HDR intent of the image on HDR displays; other codecs can still decode and display the SDR intent of the image.

Home Page: https://developer.android.com/guide/topics/media/platform/hdr-image-format

License: Apache License 2.0

Shell 0.21% C++ 81.53% C 0.37% CMake 2.52% Yacc 15.37%

libultrahdr's Introduction

Background

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.

Building libultrahdr

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.

Requirements

  • CMake v3.13 or later

  • NASM or Yasm (If libjpeg-turbo needs to be built with SIMD extensions)

    • If using NASM, 2.13 or later is required.
    • If using Yasm, 1.2.0 or later is required.
    • If building on macOS, NASM or Yasm can be obtained from MacPorts or Homebrew.
  • 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.

Build Procedure

To build libultrahdr, examples, unit tests:

Un*x (including Linux, Mac)

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

Visual C++ (IDE)

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

Visual C++ (Command line)

mkdir {build_directory}
cd {build_directory}
cmake -G "NMake Makefiles" -DUHDR_BUILD_TESTS=1 ../
cmake --build ./ --config=Release
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

MinGW

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

Building Fuzzers

Refer to README.md for complete instructions.

Using libultrahdr

libultrahdr includes two classes of APIs, one to compress and the other to decompress HDR images:

  • Refer to jpegr.h for detailed description of various encode and decode api.
  • Refer to ultrahdr_app.cpp for examples of its usage.

libultrahdr's People

Contributors

dichenzhang1 avatar ram-mohan avatar harishdm avatar phunm211 avatar aayushsoni111 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.