Skip to content

Commit

Permalink
Add support of HEIC and AVIF with gain map encoding and decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
DichenZhang1 committed Apr 9, 2024
1 parent 856f56a commit 91f1d24
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/include/ultrahdr/ultrahdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

#include <string>

#define WITH_EXPERIMENTAL_GAIN_MAP 1

namespace ultrahdr {
#define ULTRAHDR_CHECK(x) \
{ \
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 91f1d24

Please sign in to comment.