Coder Social home page Coder Social logo

google / libultrahdr Goto Github PK

View Code? Open in Web Editor NEW
109.0 8.0 21.0 1.66 MB

Ultra HDR is a true 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

C++ 83.66% CMake 3.66% C 3.19% Shell 0.13% Yacc 9.36%
hdr hdr-images ultrahdr

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 handling 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.

For additional information about libultrahdr, see android hdr-image-format guide.

Building libultrahdr

Requirements

  • CMake v3.13 or later
  • C++ compiler, supporting at least C++17.
  • libultrahdr uses jpeg compression format to store sdr image and gainmap quotient. So, libjpeg or any other jpeg codec that is ABI and API compatible with libjpeg.

The library offers a way to skip installing libjpeg by passing UHDR_BUILD_DEPS=1 at the time of configure. That is, cmake -DUHDR_BUILD_DEPS=1 will clone jpeg codec from link and include it in the build process. This is however not recommended.

If jpeg is included in the build process then to build jpeg with simd extensions,

  • C compiler
  • NASM or Yasm are needed.
    • If using NASM, 2.13 or later is required.
    • If using Yasm, 1.2.0 or later is required.

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
make install

This will generate the following files under build_directory:

libuhdr.so or libuhdr.dylib
ultrahdr shared library

libuhdr.pc
ultrahdr pkg-config file

ultrahdr_app
Statically linked sample application demonstrating ultrahdr API usage

ultrahdr_unit_test
Unit tests

make install will install libuhdr.so, ultrahdr_api.h, libuhdr.pc for system-wide usage and make uninstall will remove the same.

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:

libuhdr.dll
ultrahdr shared library

ultrahdr_app.exe
Sample application demonstrating ultrahdr API

ultrahdr_unit_test.exe
Unit tests

Visual C++ (IDE)

mkdir build_directory
cd build_directory
cmake -G "Visual Studio 16 2019" -DUHDR_BUILD_DEPS=1 -DUHDR_BUILD_TESTS=1 ../
cmake --build ./ --config=Release
ctest -C Release

This will generate the following files under build_directory/Release:

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_DEPS=1 -DUHDR_BUILD_TESTS=1 ../
cmake --build ./
ctest

This will generate the following files under build_directory:

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 Benchmark

To build benchmarks, pass -DUHDR_BUILD_BENCHMARK=1 to cmake configure command and build.

This will additionally generate,

ultrahdr_bm
Benchmark tests

Building Fuzzers

Refer to README.md for complete instructions.

Using libultrahdr

A detailed description of libultrahdr encode and decode api is included in ultrahdr_api.h and for sample usage refer demo app.

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

Encoding api outline:

Scenario Hdr intent raw Sdr intent raw Sdr intent compressed Gain map compressed Quality Exif Use Case
API - 0 P010 No No No Optional Optional Used if, only hdr raw intent is present. 1
API - 1 P010 YUV420 No No Optional Optional Used if, hdr raw and sdr raw intents are present.2
API - 2 P010 YUV420 Yes No No No Used if, hdr raw, sdr raw and sdr compressed intents are present.3
API - 3 P010 No Yes No No No Used if, hdr raw and sdr compressed intents are present.4
API - 4 No No Yes Yes No No Used if, sdr compressed, gain map compressed and GainMap Metadata are present.5

Decoding api outline:

Configure display device characteristics (display transfer characteristics, max display boost) for optimal usage.

Input Usage
max_display_boost (optional, >= 1.0) the maximum available boost supported by a display.
supported color transfer format pairs
color transferColor format
SDR32bppRGBA8888
HDR_LINEAR64bppRGBAHalfFloat
HDR_PQ32bppRGBA1010102 PQ
HDR_HLG32bppRGBA1010102 HLG

Footnotes

  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.

  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.

  3. Compute gain map from hdr and raw sdr. Compress gainmap. Combine sdr compressed, gainmap in multi picture format with gainmap metadata.

  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.

  5. Combine sdr compressed, gainmap in multi picture format with gainmap metadata.

libultrahdr's People

Contributors

aayushsoni111 avatar cmacdonald-arm avatar dichenzhang1 avatar harishdm avatar majormurphy avatar nico avatar ram-mohan avatar vivekrj1806 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libultrahdr's Issues

Google Pixel8 images fail to open

Images generated with the Pixel8 Pro camera fail to open here:

"gain map dimensions scale factor value is not an integer, primary image resolution is "

Image: 4080x3072 (ratio 1.318125)
Gain Map: 540x406 (ratio 1.33004...)

PXL_20240318_183908407

I'll to share my solution as a pull request.

Encode Scenario 4 Does not replace gain map if input jpeg already contains a gain map.

When using ultrahdr_app to encode in scenario 4, if the input jpeg file contains a gain map, then the command simply copies the input file to the output without raising an error condition.
The supplied gain map is ignored and not applied to the image.

For example, when using the command :
ultrahdr_app -m 0 -i jpegR.jpg -g gainmap.jpg -f metadata.cfg -z UltraHDR.jpg

UltraHDR.jpg is the same as jpegR.jpg if jpegR.jpg already contains a gain map.

I propose that the command should either:
a) ignore the gain map in the input file and apply the gain map supplied in the command line to the base image, i.e. UltraHDR.jpg contains the gain map found in gainmap.jpg, not the one found in jpegR.jpg.

Or
b) report an error stating that a gain map was found in the input file and that gainmap.jpg has not been applied.

I prefer a) as it provides the useful function of allowing the user to replace an existing gain map with another.

Request: brew formula

It would be super to have brew formula for this library so people can use it as a delegate for homebrew imagemagick

Request: Emscripten/wasm support

What the title says: can webassembly support be added to CMakeLists.txt, so users building with an Emscripten toolchain can integrate this?

There are some clear architecture & platform checks at the beginning of the top-level CMakeLists.txt file, which prevent this project from building via Emscripten. If I try to hack past those most basic checks, there are also errors related to libjpeg-turbo.

I already have libjpeg-turbo building for emscripten in my build system, so these issues can be worked around.

Decode function does not work for Ultra hdr images created on pixel 6 pro

I wanted to decompress image I took using my pixel 6 pro (UltraHDR option enabled, together with P2 colorspace, does not contain mjpeg stream with video). It gives me error hinting at added text encoding information of XMP information in the file.

$ ./ultrahdr_app -m 1 -j '/home/daniel/Desktop/PXL_20231230_110024323.jpg'
ERROR:Expected first character of a name
- line:1:<?xpacket begin="\xEF\xBB\xBF" id="W5M0MpCehiHzreSzNTczkc9d...
-         ^expected:Name
Encountered error during decodeJPEGR call, error code -20005

PXL_20231230_110024323.jpg.tar.gz

Support Crop usecases

Support crop functionality inside the UHDR library. If the user were to feed in crop regions along with the input P010 and/or YUV420, JPEG the library should perform the crop operation based on the crop values provided.

no error thrown in ultrahdr_app for invalid pixel dimensions

If your input image pixel count does not match the height and with flags (such as "-w 1024 -h 1024"), no error is thrown. This can lead to debugging complexity if the flags do not match the source.

I recommend that an error be thrown if the source pixel count does not match the flags (I cannot think of a case where this would be a valid thing to do on purpose).

DLL installed in lib on MSYS2

DLL is a runtime, and should be installed to bin.

This covers all platforms:

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -537,7 +537,9 @@ if(UHDR_ENABLE_INSTALL)
     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libuhdr.pc"
             DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
     install(TARGETS ${UHDR_TARGET_NAME}
-            DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+            RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+            LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+            ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
             PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")

     add_custom_target(uninstall)

Request: Add support for multi-channel gain maps

The gain map spec allows gain maps with either single channel (luminance only) and multi-channel (RGB values in the map and metadata to allow hue/saturation correction as well).

Currrently, libultrahdr appears to only process single-channel maps (

* This method only supports single gain map metadata values for fields that allow multi-channel
). However, Lightroom and Adobe Camera RAW and Lightroom export color images with RGB gain maps (the metadata is typically per channel, but occasionally a single value - probably because all three channels have identical limits for values like hdrgm:GainMapMax. The quality of such multi-channel maps is higher and allows for higher quality results and such 3D maps are therefore ideal.

It would be highly valuable for libultrahdr to support multi-channel maps to facilitate resizing, compressing, or cropping gain maps exported from Adobe software.

Encoding error

I encountered an issue when combining the SDR base image with the YUV image. The error I received was "Encountered error during encodeJPEGR call, error code -20002." Interestingly, when I re-exported from Photoshop at a lower quality, everything worked smoothly.

I'm unsure if the problem is related to file size or chroma sampling rates like 4:2:0, or if there's another factor I'm not aware of. I've attached all four images for your reference.

File details:

  1. Source (quality set to maximum -12): trin_rain_acr_3d_gainmap.jpg (3D gain map from Adobe Camera RAW 16.2)
  2. YUV Conversion using FFMpeg: trin_rain_converted_using_ffmpeg.yuv
  3. High-Quality SDR base (output from FFmpeg): trin_rain_base_sdr_high_quality.jpeg
  4. Low-Quality (set to 5) re-export from Ps: trin_rain_base_sdr_low_quality.jpg

Combining images 2 and 3 failed, but combining 2 and 4 was successful.

The command used to run libultrahdr was: ./ultrahdr_app -m 0 -p trin_rain_converted_using_ffmpeg.yuv -i trin_rain_base_sdr_high_quality.jpeg -w 1080 -h 1350

FFmpeg version used: 6.1.1

Here is the link to the images: images link

output.jpeg doesn't contain MPF info in exiftool

Hi,

I used the API-0 that you provided and got the output result output.jpeg, then I checked the output with camera-raw demo from adobe and the gainmap option can't be activated, and I found that is because the MPF info is not saved in the jpeg file.

Can you help me to solve the issue so that I can check the HDR image?

Bests

Unable to build tests on windows

Not sure what is happening. The error as well can be on my side. I hope the build log will help.

PS D:\Users\danda\Downloads\libultrahdr-1.0.0\build> cmake .. -DUHDR_BUILD_DEPS=1 -DUHDR_BUILD_TESTS=1 -G "Visual Studio 17 2022"
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.40.33808.0
-- The CXX compiler identification is MSVC 19.40.33808.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- No target type chosen, selecting Shared
-- Install and uninstall targets - Disabled
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Configuring done (8.2s)
-- Generating done (0.1s)
-- Build files have been written to: D:/Users/danda/Downloads/libultrahdr-1.0.0/build
PS D:\Users\danda\Downloads\libultrahdr-1.0.0\build> cmake --build ./ --config=Debug
MSBuild verze 17.10.4+10fbfbf2e pro .NET Framework

  1>Checking Build System
  Creating directories for 'googletest'
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
  Performing download step (git clone) for 'googletest'
  Cloning into 'googletest'...
  HEAD is now at f8d7d77c Bump version to v1.14 in preparation for release
  Performing update step for 'googletest'
  No patch step for 'googletest'
  Performing configure step for 'googletest'
  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
  -- The C compiler identification is MSVC 19.40.33808.0
  -- The CXX compiler identification is MSVC 19.40.33808.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bi
  n/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/
  bin/Hostx64/x64/cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter)
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
  -- Looking for pthread_create in pthreads
  -- Looking for pthread_create in pthreads - not found
  -- Looking for pthread_create in pthread
  -- Looking for pthread_create in pthread - not found
  -- Found Threads: TRUE
  -- Configuring done (11.6s)
  -- Generating done (0.1s)
CUSTOMBUILD : CMake warning :  [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\googletest.vcxproj]
    Manually-specified variables were not used by the project:

      CMAKE_BUILD_TYPE


  -- Build files have been written to: D:/Users/danda/Downloads/libultrahdr-1.0.0/build/googletest/src/googletest-build
  Performing build step for 'googletest'
  MSBuild verze 17.10.4+10fbfbf2e pro .NET Framework

    1>Checking Build System
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/googletest/googlemock/CMakeLists.txt
    gtest-all.cc
    gmock-all.cc
    Generov├ín├ş k├│du...
    gmock.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\googletest\src\googletest-build\lib\Debug\gmock.l
  ib
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/googletest/googlemock/CMakeLists.txt
    gtest-all.cc
    gmock-all.cc
    gmock_main.cc
    Generov├ín├ş k├│du...
    gmock_main.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\googletest\src\googletest-build\lib\Debug\gm
  ock_main.lib
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/googletest/googletest/CMakeLists.txt
    gtest-all.cc
    gtest.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\googletest\src\googletest-build\lib\Debug\gtest.l
  ib
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/googletest/googletest/CMakeLists.txt
    gtest_main.cc
    gtest_main.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\googletest\src\googletest-build\lib\Debug\gt
  est_main.lib
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/googletest/CMakeLists.txt
  No install step for 'googletest'
  Completed 'googletest'
  Creating directories for 'turbojpeg'
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
  Performing download step (git clone) for 'turbojpeg'
  Cloning into 'turbojpeg'...
  HEAD is now at ec32420f example.c: Fix 12-bit PPM write w/ big endian CPUs
  Performing update step for 'turbojpeg'
  No patch step for 'turbojpeg'
  Performing configure step for 'turbojpeg'
  CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
    Compatibility with CMake < 3.5 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
  -- The C compiler identification is MSVC 19.40.33808.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bi
  n/Hostx64/x64/cl.exe - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- CMAKE_BUILD_TYPE = Release
  -- VERSION = 3.0.1, BUILD = 20240526
  -- 64-bit build (x86_64)
  -- CMAKE_INSTALL_PREFIX = c:/libjpeg-turbo64
  -- CMAKE_INSTALL_BINDIR = bin (c:/libjpeg-turbo64/bin)
  -- CMAKE_INSTALL_DATAROOTDIR =  (c:/libjpeg-turbo64)
  -- CMAKE_INSTALL_DOCDIR = doc (c:/libjpeg-turbo64/doc)
  -- CMAKE_INSTALL_INCLUDEDIR = include (c:/libjpeg-turbo64/include)
  -- CMAKE_INSTALL_LIBDIR = lib (c:/libjpeg-turbo64/lib)
  -- Shared libraries disabled (ENABLE_SHARED = 0)
  -- Static libraries enabled (ENABLE_STATIC = 1)
  -- Arithmetic decoding support enabled (WITH_ARITH_DEC = 1)
  -- Arithmetic encoding support enabled (WITH_ARITH_ENC = 1)
  -- TurboJPEG API library enabled (WITH_TURBOJPEG = 1)
  -- TurboJPEG Java wrapper disabled (WITH_JAVA = 0)
  -- Emulating libjpeg API/ABI v6.2 (WITH_JPEG7 = 0, WITH_JPEG8 = 0)
  -- libjpeg API shared library version = 62.4.0
  -- Compiler flags = /DWIN32 /D_WINDOWS /W3 -DUHDR_BUILDING_SHARED_LIBRARY -DUHDR_ENABLE_INTRINSICS /wd4244 /wd4267 /w
  d4305 /wd4838 /wd26812 /MT /O2 /Ob2 /DNDEBUG
  -- Linker flags = /machine:x64 /INCREMENTAL:NO
  -- Looking for sys/types.h
  -- Looking for sys/types.h - found
  -- Looking for stdint.h
  -- Looking for stdint.h - found
  -- Looking for stddef.h
  -- Looking for stddef.h - found
  -- Check size of size_t
  -- Check size of size_t - done
  -- Check size of unsigned long
  -- Check size of unsigned long - done
  -- Looking for include file intrin.h
  -- Looking for include file intrin.h - found
  -- Performing Test INLINE_WORKS
  -- Performing Test INLINE_WORKS - Success
  -- INLINE = __forceinline (FORCE_INLINE = 1)
  -- Performing Test HAVE_THREAD_LOCAL
  -- Performing Test HAVE_THREAD_LOCAL - Success
  -- THREAD_LOCAL = __declspec(thread)
  -- CMAKE_EXECUTABLE_SUFFIX = .exe
  -- Looking for a ASM_NASM compiler
  -- Looking for a ASM_NASM compiler - NOTFOUND
  CMake Warning at simd/CMakeLists.txt:5 (message):
    SIMD extensions disabled: could not find NASM compiler.  Performance will
    suffer.
  Call Stack (most recent call first):
    simd/CMakeLists.txt:48 (simd_fail)


  -- FLOATTEST8 = no-fp-contract
  -- FLOATTEST12 = no-fp-contract
  -- Configuring done (16.4s)
  -- Generating done (0.2s)
CUSTOMBUILD : CMake warning :  [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\turbojpeg.vcxproj]
    Manually-specified variables were not used by the project:

      CMAKE_CXX_COMPILER
      CMAKE_CXX_FLAGS
      CMAKE_CXX_FLAGS_DEBUG
      CMAKE_CXX_FLAGS_MINSIZEREL
      CMAKE_CXX_FLAGS_RELEASE
      CMAKE_CXX_FLAGS_RELWITHDEBINFO
      gtest_force_shared_crt


  -- Build files have been written to: D:/Users/danda/Downloads/libultrahdr-1.0.0/build/turbojpeg/src/turbojpeg-build
  Performing build step for 'turbojpeg'
  MSBuild verze 17.10.4+10fbfbf2e pro .NET Framework

    1>Checking Build System
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/turbojpeg/CMakeLists.txt
    jcapistd.c
    jccolor.c
    jcdiffct.c
    jclossls.c
    jcmainct.c
    jcprepct.c
    jcsample.c
    jdapistd.c
    jdcolor.c
    jddiffct.c
    jdlossls.c
    jdmainct.c
    jdpostct.c
    jdsample.c
    jutils.c
    jccoefct.c
    jcdctmgr.c
    jdcoefct.c
    jddctmgr.c
    jdmerge.c
    Generov├ín├ş k├│du...
    Kompilov├ín├ş...
    jfdctfst.c
    jfdctint.c
    jidctflt.c
    jidctfst.c
    jidctint.c
    jidctred.c
    jquant1.c
    jquant2.c
    Generov├ín├ş k├│du...
    jpeg12-static.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\turbojpeg\src\turbojpeg-build\jpeg12-stat
  ic.dir\Debug\jpeg12-static.lib
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/turbojpeg/CMakeLists.txt
    jcapistd.c
    jccolor.c
    jcdiffct.c
    jclossls.c
    jcmainct.c
    jcprepct.c
    jcsample.c
    jdapistd.c
    jdcolor.c
    jddiffct.c
    jdlossls.c
    jdmainct.c
    jdpostct.c
    jdsample.c
    jutils.c
    Generov├ín├ş k├│du...
    jpeg16-static.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\turbojpeg\src\turbojpeg-build\jpeg16-stat
  ic.dir\Debug\jpeg16-static.lib
    Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/third_party/turbojpeg/CMakeLists.txt
    jcapistd.c
    jccolor.c
    jcdiffct.c
    jclossls.c
    jcmainct.c
    jcprepct.c
    jcsample.c
    jdapistd.c
    jdcolor.c
    jddiffct.c
    jdlossls.c
    jdmainct.c
    jdpostct.c
    jdsample.c
    jutils.c
    jccoefct.c
    jcdctmgr.c
    jdcoefct.c
    jddctmgr.c
    jdmerge.c
    Generov├ín├ş k├│du...
    Kompilov├ín├ş...
    jfdctfst.c
    jfdctint.c
    jidctflt.c
    jidctfst.c
    jidctint.c
    jidctred.c
    jquant1.c
    jquant2.c
    jcapimin.c
    jchuff.c
    jcicc.c
    jcinit.c
    jclhuff.c
    jcmarker.c
    jcmaster.c
    jcomapi.c
    jcparam.c
    jcphuff.c
    jctrans.c
    jdapimin.c
    Generov├ín├ş k├│du...
    Kompilov├ín├ş...
    jdatadst.c
    jdatasrc.c
    jdhuff.c
    jdicc.c
    jdinput.c
    jdlhuff.c
    jdmarker.c
    jdmaster.c
    jdphuff.c
    jdtrans.c
    jerror.c
    jfdctflt.c
    jmemmgr.c
    jmemnobs.c
    jaricom.c
    jcarith.c
    jdarith.c
    Generov├ín├ş k├│du...
    jpeg-static.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\turbojpeg\src\turbojpeg-build\Debug\jpeg-st
  atic.lib
  No install step for 'turbojpeg'
  Completed 'turbojpeg'
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
  byte_buffer.cc
  byte_pointer_data_destination.cc
  data_context.cc
  data_line_map.cc
  data_range_tracking_destination.cc
  data_scanner.cc
  data_segment.cc
  data_segment_data_source.cc
  istream_ref_data_source.cc
  message_handler.cc
  message_writer.cc
  ostream_ref_data_destination.cc
  string_ref_data_source.cc
  base64_decoder_data_destination.cc
  gcontainer.cc
  jpeg_image_extractor.cc
  jpeg_info_builder.cc
  jpeg_marker.cc
  jpeg_scanner.cc
  jpeg_segment.cc
  Generování kódu...
  Kompilování...
  jpeg_segment_builder.cc
  jpeg_segment_lister.cc
  jpeg_xmp_data_extractor.cc
  jpeg_xmp_info.cc
  jpeg_xmp_info_builder.cc
  modp_b64.cc
  file_utils.cc
  xml_attribute_rule.cc
  xml_cdata_and_comment_rules.cc
  xml_element_rules.cc
  xml_handler.cc
  xml_pi_rule.cc
  xml_reader.cc
  xml_rule.cc
  xml_token_context.cc
  xml_writer.cc
  Generování kódu...
D:\Users\danda\Downloads\libultrahdr-1.0.0\third_party\image_io\src\jpeg\jpeg_xmp_info.cc(45,1): warning C4715: photos_
editing_formats::image_io::JpegXmpInfo::GetMimePropertyName: ne všechny cesty k ovládacím prvkům vrací hodnotu [D:\User
s\danda\Downloads\libultrahdr-1.0.0\build\image_io.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\third_party\image_io\src\jpeg\jpeg_xmp_info.cc(36,1): warning C4715: photos_
editing_formats::image_io::JpegXmpInfo::GetDataPropertyName: ne všechny cesty k ovládacím prvkům vrací hodnotu [D:\User
s\danda\Downloads\libultrahdr-1.0.0\build\image_io.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\third_party\image_io\src\jpeg\jpeg_xmp_info.cc(27,1): warning C4715: photos_
editing_formats::image_io::JpegXmpInfo::GetIdentifier: ne všechny cesty k ovládacím prvkům vrací hodnotu [D:\Users\dand
a\Downloads\libultrahdr-1.0.0\build\image_io.vcxproj]
  image_io.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\Debug\image_io.lib
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
  editorhelper.cpp
  gainmapmath.cpp
  gainmapmetadata.cpp
  icc.cpp
  jpegdecoderhelper.cpp
  jpegencoderhelper.cpp
  jpegr.cpp
  jpegrutils.cpp
  multipictureformat.cpp
  ultrahdr_api.cpp
  Generování kódu...
  core.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\Debug\core.lib
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
     Vytváří se knihovna D:/Users/danda/Downloads/libultrahdr-1.0.0/build/Debug/uhdr.lib a objekt D:/Users/danda/Downlo
  ads/libultrahdr-1.0.0/build/Debug/uhdr.exp.
LINK : warning LNK4098: Výchozí knihovna LIBCMTD je v konfliktu s použitím jiných knihoven. Použijte /NODEFAULTLIB:libr
ary. [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\uhdr.vcxproj]
  uhdr.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\Debug\uhdr.dll
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
  ultrahdr_app.cpp
     Vytváří se knihovna D:/Users/danda/Downloads/libultrahdr-1.0.0/build/Debug/ultrahdr_app.lib a objekt D:/Users/dand
  a/Downloads/libultrahdr-1.0.0/build/Debug/ultrahdr_app.exp.
LINK : warning LNK4098: Výchozí knihovna LIBCMTD je v konfliktu s použitím jiných knihoven. Použijte /NODEFAULTLIB:libr
ary. [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_app.vcxproj]
  ultrahdr_app.vcxproj -> D:\Users\danda\Downloads\libultrahdr-1.0.0\build\Debug\ultrahdr_app.exe
  Building Custom Rule D:/Users/danda/Downloads/libultrahdr-1.0.0/CMakeLists.txt
  editorhelper_test.cpp
  gainmapmath_test.cpp
D:\Users\danda\Downloads\libultrahdr-1.0.0\third_party\googletest\googletest\include\gtest\gtest-printers.h(357,31): wa
rning C4180: Kvalifikátor použitý pro typ funkce nemá žádný význam; ignoruje se. [D:\Users\danda\Downloads\libultrahdr-
1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\third_party\googletest\googletest\include\gtest\gtest-printers.h(989,21): wa
rning C4180: Kvalifikátor použitý pro typ funkce nemá žádný význam; ignoruje se. [D:\Users\danda\Downloads\libultrahdr-
1.0.0\build\ultrahdr_unit_test.vcxproj]
  gainmapmetadata_test.cpp
  icchelper_test.cpp
  jpegdecoderhelper_test.cpp
  jpegencoderhelper_test.cpp
  jpegr_test.cpp
  ultrahdr_app.cpp
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(80,20): error C2079: Profiler::mStartingTime používá
nedefinované struct timeval. [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(81,20): error C2079: Profiler::mEndingTime používá ne
definované struct timeval. [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(68,25): error C3861: gettimeofday: identifikátor se n
enašel [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(70,24): error C3861: gettimeofday: identifikátor se n
enašel [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(73,24): error C2079: elapsedMicroseconds používá nede
finované struct timeval. [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(244,23): error C2065: UNKNOWN_ERROR: nedeklarovaný id
entifikátor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(253,13): error C2065: OK: nedeklarovaný identifikátor
 [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(261,13): error C2065: OK: nedeklarovaný identifikátor
 [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(281,34): error C2440: inicializování: nejde převést z
: std::vector<uint8_t,std::allocator<uint8_t>> * na: ultrahdr::jpeg_info_struct *. [D:\Users\danda\Downloads\libultrahd
r-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(281,44): error C2440: inicializování: nejde převést z
: std::vector<uint8_t,std::allocator<uint8_t>> * na: ultrahdr::jpeg_info_struct *. [D:\Users\danda\Downloads\libultrahd
r-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(284,9): error C2065: OK: nedeklarovaný identifikátor
[D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(299,13): error C2065: OK: nedeklarovaný identifikátor
 [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(794,18): error C3861: getopt: identifikátor se nenaše
l [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(797,29): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(800,31): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(803,30): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(806,31): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(809,65): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(812,67): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(815,67): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(818,32): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(821,63): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(824,29): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(827,30): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
D:\Users\danda\Downloads\libultrahdr-1.0.0\tests\ultrahdr_app.cpp(830,37): error C2065: optarg: nedeklarovaný identifik
átor [D:\Users\danda\Downloads\libultrahdr-1.0.0\build\ultrahdr_unit_test.vcxproj]
  Generování kódu...
PS D:\Users\danda\Downloads\libultrahdr-1.0.0\build>

Error when building

Hi,
I tried to build the code on my Ubuntu vm, and it said that the third party library doesn't exist, and I checked the folder again, the googletest and libjpeg-turbo is not pull from git.
I tried to manually pull the third party library and build it , then the error shows up :

undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status

am I building the code correctly? I'm looking forward to you helps,

Bests

Request: Support prebuilt binaries for Major Linux distributions

Hello.

I'm considering to use this library on our media server implementation.

In my case, I'm using RHEL(Redhat Enterprise Linux)7 compliant distribution (CentOS 7)

In the case of the Linux operating environment, if EOL remains, there is a high tendency not to change the operating environment.

Currently, libultrahdr requires (or recommends)

  • Clang 15
  • CMake 3.5
    • gtest requires CMake 3.13

For RHEL7, It seems Redhat provides Clang 15 for their service subscribers.
But for CentOS7, it provides Clang 7 by SCL
Also CentOS7 provides CMake 3.6.1 by SCL

So libultrahdr is hard to use with CentOS7 by toolchain requirements even if they are supported by upstream(RHEL7).

Providing prebuilt binaries for popular Linux distributions would make it easier to adapt this library and help spread the Ultra HDR format.

Make fails

MacOS 14, Yasm

[  1%] Performing update step for 'googletest'
[  3%] No patch step for 'googletest'
[  4%] Performing configure step for 'googletest'
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/joe/stage/libraries/uhdr/build/googletest/src/googletest-build
[  6%] Performing build step for 'googletest'
[ 25%] Built target gtest
[ 50%] Built target gmock
[ 75%] Built target gmock_main
[100%] Built target gtest_main
[  7%] No install step for 'googletest'
[  9%] Completed 'googletest'
[ 12%] Built target googletest
[ 69%] Built target image_io
[ 84%] Built target core
[ 87%] Built target ultrahdr_app
[ 98%] Built target ultrahdr_unit_test
[100%] Linking CXX shared library libuhdr.dylib
Undefined symbols for architecture arm64:
  "_jpeg_CreateCompress", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
  "_jpeg_CreateDecompress", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
  "_jpeg_destroy_compress", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
  "_jpeg_destroy_decompress", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
  "_jpeg_finish_compress", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
  "_jpeg_finish_decompress", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
  "_jpeg_read_header", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
  "_jpeg_read_raw_data", referenced from:
      ultrahdr::JpegDecoderHelper::decompressSingleChannel(jpeg_decompress_struct*, unsigned char const*) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decompressSingleChannel(jpeg_decompress_struct*, unsigned char const*) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decompressYUV(jpeg_decompress_struct*, unsigned char const*) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decompressYUV(jpeg_decompress_struct*, unsigned char const*) in jpegdecoderhelper.cpp.o
  "_jpeg_read_scanlines", referenced from:
      ultrahdr::JpegDecoderHelper::decompress(jpeg_decompress_struct*, unsigned char const*, bool) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decompressRGBA(jpeg_decompress_struct*, unsigned char const*) in jpegdecoderhelper.cpp.o
  "_jpeg_resync_to_restart", referenced from:
      ultrahdr::jpegr_source_mgr::jpegr_source_mgr(unsigned char const*, int) in jpegdecoderhelper.cpp.o
      ultrahdr::jpegr_source_mgr::jpegr_source_mgr(unsigned char const*, int) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
  "_jpeg_save_markers", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
  "_jpeg_set_defaults", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
      ultrahdr::JpegEncoderHelper::setJpegCompressStruct(int, int, int, jpeg_compress_struct*, bool) in jpegencoderhelper.cpp.o
  "_jpeg_set_quality", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
      ultrahdr::JpegEncoderHelper::setJpegCompressStruct(int, int, int, jpeg_compress_struct*, bool) in jpegencoderhelper.cpp.o
  "_jpeg_start_compress", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
  "_jpeg_start_decompress", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
  "_jpeg_std_error", referenced from:
      ultrahdr::JpegDecoderHelper::decode(void const*, int, ultrahdr::decode_mode_t) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegDecoderHelper::extractEXIF(void const*, int) in jpegdecoderhelper.cpp.o
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
  "_jpeg_write_marker", referenced from:
      ultrahdr::JpegEncoderHelper::encode(unsigned char const*, unsigned char const*, int, int, int, int, int, void const*, unsigned int) in jpegencoderhelper.cpp.o
  "_jpeg_write_raw_data", referenced from:
      ultrahdr::JpegEncoderHelper::compressY(jpeg_compress_struct*, unsigned char const*, int) in jpegencoderhelper.cpp.o
      ultrahdr::JpegEncoderHelper::compressY(jpeg_compress_struct*, unsigned char const*, int) in jpegencoderhelper.cpp.o
      ultrahdr::JpegEncoderHelper::compressYuv(jpeg_compress_struct*, unsigned char const*, unsigned char const*, int, int) in jpegencoderhelper.cpp.o
      ultrahdr::JpegEncoderHelper::compressYuv(jpeg_compress_struct*, unsigned char const*, unsigned char const*, int, int) in jpegencoderhelper.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libuhdr.dylib] Error 1
make[1]: *** [CMakeFiles/uhdr.dir/all] Error 2
make: *** [all] Error 2

The srgbRgbToYuv conversion issue in JpegR::toneMap

When the color gamut of source image is BT.2100, hdrGamutConversionFn is bt2100ToP3. However, in the final step of converting from RGB to YUV format, it uses the function srgbRgbToYuv. I think function p3RgbToYuv should be used for the yuv conversion to match the previously transformed color gamut. Here is my reasoning:

srgbRgbToYuv uses the transformation coefficients in ITU-R BT.709-6, so the input of the function should comply with BT.709. I know that there are some cases where P3 and BT.601 are interpreted similarly in this library, and BT601_625 has the same color primaries with BT.709. In this case, if bt2100ToP3 is same with to BT.601 and BT.709, srgbRgbToYuv is right. I want to confirm if P3 is BT.601_625 in this case by reviewing the ITU-R BT.2407 and EG 432-1 documents, but can not find the P3 related coefficients. However, I found bt2100ToBt709 coefficients in ITU-R BT.2407, they match perfectly and are diffenent from bt2100ToP3`s coefficients.Therefore, in conclusion, I believe the output of the function bt2100ToP3 is truely P3 gamut, srgbRgbToYuv is incorrect in this context.

Looking forward to your reply. Thx.

Bundled libjpeg-turbo linkage seems to be hard-coded

I get this failure when trying to build on MSYS2 UCRT64:

ninja: error: 'C:/msys64/home/kmilos/MINGW-packages/mingw-w64-libultrahdr/src/libultrahdr-1.0.0/third_party/build/libjpeg-turbo/src/libjpeg-turbo-build/libjpeg.a', needed by 'ultrahdr_app.exe', missing and no known rule to make it

Issue while runing ultrahdr_app demo

Hi,

I build the library successfully and try to run some hdr image with the ultrahdr_app demo,

when I gave the command :
./ultrahdr_app -p ./data/Gain_Map_Sample_Photos/samples_avif/01.avif -w 2400 -h 3000 -o 0

and it showed the error message here when I run the avif file:
requested to read 29752320 bytes from file : ./data/Gain_Map_Sample_Photossamples_avif/01.avif, file contains only 29752320 bytes

Can you help me to check why the issue comes? It would be great if you can provide an example how to use the demo.

Bests

Compilation failure with Ninja

1.0.0-23-g2ca5b2a (2ca5b2a)

$ cmake -B out -G Ninja
$ ninja -C out
ninja: error: 'libjpeg-turbo/src/libjpeg-turbo-build/libjpeg.a', needed by 'ultrahdr_app', missing and no known rule to make it
$ ninja -j1 -C out
ninja: error: 'libjpeg-turbo/src/libjpeg-turbo-build/libjpeg.a', needed by 'ultrahdr_app', missing and no known rule to make it
$ cmake --build out
ninja: error: 'libjpeg-turbo/src/libjpeg-turbo-build/libjpeg.a', needed by 'ultrahdr_app', missing and no known rule to make it

make and make -j work as expected.

Encode Scenario 4 : Missing Parameters

Using the example command:
ultrahdr_app -m 0 -i cosmat_1920x1080_420_8bit.jpg -g cosmat_1920x1080_420_8bit.jpg -f metadata.cfg

results in:
did not receive valid image width for encoding. width : 0

It looks like the example should be modified to include width (-w) and height (-h) parameters as in the other encode scenarios.

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.