google / libultrahdr

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.
https://developer.android.com/guide/topics/media/platform/hdr-image-format
Apache License 2.0
160 stars 28 forks source link

use separate field to store configured gainmap gamma #203

Closed ram-mohan closed 3 months ago

ram-mohan commented 3 months ago

Current implementation is overwriting fields reserved for api-4 support. An accidental call to uhdr_enc_set_gainmap_image followed by uhdr_enc_set_gainmap_gamma can cause problems in the encoded image.

Also default initialize the gamma field to 1.0

Test: ./ultrahdr_unit_test