From 91f1d247aa066efe0c67527125a8e21d0d19b47d Mon Sep 17 00:00:00 2001 From: Dichen Zhang Date: Tue, 9 Apr 2024 23:19:18 +0000 Subject: [PATCH] Add support of HEIC and AVIF with gain map encoding and decoding --- lib/include/ultrahdr/ultrahdr.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/include/ultrahdr/ultrahdr.h b/lib/include/ultrahdr/ultrahdr.h index 8f395cd6..2a582fb2 100644 --- a/lib/include/ultrahdr/ultrahdr.h +++ b/lib/include/ultrahdr/ultrahdr.h @@ -19,6 +19,8 @@ #include +#define WITH_EXPERIMENTAL_GAIN_MAP 1 + namespace ultrahdr { #define ULTRAHDR_CHECK(x) \ { \ @@ -69,6 +71,20 @@ typedef enum { ULTRAHDR_PIX_FMT_RGBA1010102, } ultrahdr_pixel_format; +// Supported codec +typedef enum { + ULTRAHDR_CODEC_UNSPECIFIED = -1, + ULTRAHDR_CODEC_RAW_PIXELS, + ULTRAHDR_CODEC_JPEG, + ULTRAHDR_CODEC_JPEG_R, + ULTRAHDR_CODEC_HEIC, + ULTRAHDR_CODEC_HEIC_R, + ULTRAHDR_CODEC_HEIC_10_BIT, + ULTRAHDR_CODEC_AVIF, + ULTRAHDR_CODEC_AVIF_R, + ULTRAHDR_CODEC_AVIF_10_BIT, +} ultrahdr_codec; + typedef enum { ULTRAHDR_NO_ERROR = 0, ULTRAHDR_UNKNOWN_ERROR = -1, @@ -193,7 +209,7 @@ static const char* const kGainMapVersion = "1.0"; static const size_t kMapDimensionScaleFactor = 4; class UltraHdr { -public: +protected: /* * This method is called in the encoding pipeline. It will take the uncompressed 8-bit and * 10-bit yuv images as input, and calculate the uncompressed gain map. The input images