Skip to content

Commit

Permalink
Remove AVIF_ENABLE_GAIN_MAP flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
maryla-uc committed Dec 9, 2024
1 parent 3196438 commit 6387c83
Show file tree
Hide file tree
Showing 29 changed files with 143 additions and 496 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-fuzztest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
-DAVIF_ENABLE_FUZZTEST=ON
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-linux-golden-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
-DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF
-DAVIF_CODEC_AOM=LOCAL -DAVIF_LIBYUV=LOCAL
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_LIBXML2=LOCAL
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GOLDEN_TESTS=ON
-DAVIF_ENABLE_GTEST=OFF -DAVIF_ENABLE_WERROR=ON
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-linux-static-old-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_LOCAL_GTEST=ON
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_WERROR=ON
- name: Build libavif (ninja)
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-unix-shared-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
-DAVIF_ENABLE_WERROR=ON
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-unix-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
-DAVIF_ENABLE_WERROR=ON
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-windows-installed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
-DAVIF_ENABLE_WERROR=ON $env:AVIF_CMAKE_C_COMPILER $env:AVIF_CMAKE_CXX_COMPILER
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-windows-shared-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
-DAVIF_ENABLE_WERROR=ON $env:AVIF_CMAKE_C_COMPILER $env:AVIF_CMAKE_CXX_COMPILER
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ jobs:
-DAVIF_BUILD_EXAMPLES=ON -DAVIF_BUILD_APPS=ON
-DAVIF_BUILD_TESTS=ON -DAVIF_ENABLE_GTEST=ON -DAVIF_GTEST=LOCAL
-DAVIF_ENABLE_EXPERIMENTAL_YCGCO_R=ON
-DAVIF_ENABLE_GAIN_MAP=ON
-DAVIF_ENABLE_EXPERIMENTAL_MINI=ON
-DAVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM=ON
-DAVIF_ENABLE_WERROR=ON
Expand Down
80 changes: 32 additions & 48 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ option(BUILD_SHARED_LIBS "Build shared avif library" ON)

option(AVIF_ENABLE_WERROR "Treat all compiler warnings as errors" OFF)

option(AVIF_ENABLE_GAIN_MAP
"Enable gain map code (for HDR images that look good both on HDR and SDR displays)" ON
)

option(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R "Enable experimental YCgCo-R matrix code" OFF)
option(AVIF_ENABLE_EXPERIMENTAL_MINI "Enable experimental reduced header" OFF)
option(AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM "Enable experimental sample transform code" OFF)
Expand Down Expand Up @@ -273,13 +269,10 @@ if(AVIF_LIBSHARPYUV_ENABLED)
endif(AVIF_LIBSHARPYUV_ENABLED)

set_local_or_system_option(
"LIBXML2" "OFF" "Use libxml2. When enabled and AVIF_ENABLE_GAIN_MAP is ON, \
allows converting JPEG files with gain maps to AVIF using avifenc"
"LIBXML2" "OFF" "Use libxml2. When enabled, allows converting jpeg files with gain maps to avif using avifenc"
)
check_avif_option(AVIF_LIBXML2 TARGET LibXml2::LibXml2 PKG_NAME LibXml2)

if(AVIF_ENABLE_GAIN_MAP)
check_avif_option(AVIF_LIBXML2 TARGET LibXml2::LibXml2 PKG_NAME LibXml2)
endif()
# ---------------------------------------------------------------------------------------

# Enable all warnings
Expand Down Expand Up @@ -365,10 +358,6 @@ if(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
add_compile_definitions(AVIF_ENABLE_EXPERIMENTAL_YCGCO_R)
endif()

if(AVIF_ENABLE_GAIN_MAP)
add_compile_definitions(AVIF_ENABLE_GAIN_MAP)
endif()

if(AVIF_ENABLE_EXPERIMENTAL_MINI)
add_compile_definitions(AVIF_ENABLE_EXPERIMENTAL_MINI)
endif()
Expand All @@ -384,6 +373,7 @@ set(AVIF_SRCS
src/colrconvert.c
src/diag.c
src/exif.c
src/gainmap.c
src/io.c
src/mem.c
src/obu.c
Expand All @@ -397,9 +387,6 @@ set(AVIF_SRCS
src/utils.c
src/write.c
)
if(AVIF_ENABLE_GAIN_MAP)
list(APPEND AVIF_SRCS src/gainmap.c)
endif()
if(AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM)
list(APPEND AVIF_SRCS src/sampletransform.c)
endif()
Expand Down Expand Up @@ -585,7 +572,7 @@ if(NOT AVIF_CODEC_AOM_ENABLED
message(WARNING "libavif: No decoding library is enabled.")
endif()

if(AVIF_LIB_USE_CXX OR (AVIF_BUILD_APPS AND AVIF_ENABLE_GAIN_MAP) OR (AVIF_BUILD_TESTS AND (AVIF_ENABLE_FUZZTEST
if(AVIF_LIB_USE_CXX OR AVIF_BUILD_APPS OR (AVIF_BUILD_TESTS AND (AVIF_ENABLE_FUZZTEST
OR AVIF_ENABLE_GTEST))
)
enable_language(CXX)
Expand Down Expand Up @@ -677,13 +664,11 @@ if(AVIF_BUILD_APPS OR (AVIF_BUILD_TESTS AND (AVIF_ENABLE_FUZZTEST OR AVIF_ENABLE
find_package(JPEG REQUIRED)
endif()

if(AVIF_ENABLE_GAIN_MAP)
if(TARGET LibXml2::LibXml2)
set(AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION TRUE)
add_compile_definitions(AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION)
else()
message(STATUS "libavif: libxml2 not found; avifenc will ignore any gain map in jpeg files")
endif()
if(TARGET LibXml2::LibXml2)
set(AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION TRUE)
add_compile_definitions(AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION)
else()
message(STATUS "libavif: libxml2 not found; avifenc will ignore any gain map in jpeg files")
endif()

set(AVIF_APPS_SRCS apps/shared/avifexif.c apps/shared/avifjpeg.c apps/shared/avifpng.c apps/shared/avifutil.c
Expand Down Expand Up @@ -755,33 +740,32 @@ if(AVIF_BUILD_APPS)
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if(AVIF_ENABLE_GAIN_MAP)
include(LocalLibargparse)
set(AVIFGAINMAPUTIL_SRCS
apps/avifgainmaputil/avifgainmaputil.cc
apps/avifgainmaputil/convert_command.cc
apps/avifgainmaputil/combine_command.cc
apps/avifgainmaputil/extractgainmap_command.cc
apps/avifgainmaputil/imageio.cc
apps/avifgainmaputil/printmetadata_command.cc
apps/avifgainmaputil/tonemap_command.cc
apps/avifgainmaputil/program_command.cc
apps/avifgainmaputil/swapbase_command.cc
)
include(LocalLibargparse)

set(AVIFGAINMAPUTIL_SRCS
apps/avifgainmaputil/avifgainmaputil.cc
apps/avifgainmaputil/convert_command.cc
apps/avifgainmaputil/combine_command.cc
apps/avifgainmaputil/extractgainmap_command.cc
apps/avifgainmaputil/imageio.cc
apps/avifgainmaputil/printmetadata_command.cc
apps/avifgainmaputil/tonemap_command.cc
apps/avifgainmaputil/program_command.cc
apps/avifgainmaputil/swapbase_command.cc
)

add_executable(avifgainmaputil "${AVIFGAINMAPUTIL_SRCS}")
if(WIN32)
if(MSVC)
target_sources(avifgainmaputil PRIVATE apps/utf8.manifest)
elseif(MINGW)
target_sources(avifgainmaputil PRIVATE apps/utf8.rc)
endif()
add_executable(avifgainmaputil "${AVIFGAINMAPUTIL_SRCS}")
if(WIN32)
if(MSVC)
target_sources(avifgainmaputil PRIVATE apps/utf8.manifest)
elseif(MINGW)
target_sources(avifgainmaputil PRIVATE apps/utf8.rc)
endif()
set_target_properties(avifgainmaputil PROPERTIES LINKER_LANGUAGE "CXX")
target_include_directories(avifgainmaputil PRIVATE apps/avifgainmaputil/)
target_link_libraries(avifgainmaputil libargparse avif_apps avif avif_enable_warnings)
# Don't add avifgainmaputil to installed apps for now.
endif()
set_target_properties(avifgainmaputil PROPERTIES LINKER_LANGUAGE "CXX")
target_include_directories(avifgainmaputil PRIVATE apps/avifgainmaputil/)
target_link_libraries(avifgainmaputil libargparse avif_apps avif avif_enable_warnings)
# Don't add avifgainmaputil to installed apps for now.
endif()

if(AVIF_BUILD_TESTS)
Expand Down
3 changes: 1 addition & 2 deletions apps/avifenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ typedef struct
avifBool ignoreXMP;
avifBool ignoreColorProfile;

// These settings are only relevant when compiled with AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION
// (which also implies AVIF_ENABLE_GAIN_MAP).
// These settings are only relevant when compiled with AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION.
avifBool qualityGainMapIsConstrained; // true if qualityGainMap explicitly set by the user
int qualityGainMap;
avifBool ignoreGainMap; // ignore any gain map present in the input file.
Expand Down
3 changes: 1 addition & 2 deletions apps/shared/avifjpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ extern "C" {
// bytes of Exif or XMP metadata will be read or an error returned.
// 'ignoreGainMap' is only relevant for jpeg files that have a gain map
// and only if AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION is ON
// (requires AVIF_ENABLE_GAIN_MAP and libxml2). Otherwise
// it has no effect.
// (requires libxml2). Otherwise it has no effect.
avifBool avifJPEGRead(const char * inputFilename,
avifImage * avif,
avifPixelFormat requestedFormat,
Expand Down
2 changes: 0 additions & 2 deletions apps/shared/avifutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ static void avifImageDumpInternal(const avifImage * avif, uint32_t gridCols, uin
printf(" * CLLI : %hu, %hu\n", avif->clli.maxCLL, avif->clli.maxPALL);
}

#if defined(AVIF_ENABLE_GAIN_MAP)
printf(" * Gain map : ");
avifImage * gainMapImage = avif->gainMap ? avif->gainMap->image : NULL;
if (gainMapImage != NULL) {
Expand Down Expand Up @@ -161,7 +160,6 @@ static void avifImageDumpInternal(const avifImage * avif, uint32_t gridCols, uin
} else {
printf("Absent\n");
}
#endif // AVIF_ENABLE_GAIN_MAP
}

void avifImageDump(const avifImage * avif, uint32_t gridCols, uint32_t gridRows, avifProgressiveState progressiveState)
Expand Down
3 changes: 1 addition & 2 deletions apps/shared/avifutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ struct y4mFrameIterator;
// Returns AVIF_APP_FILE_FORMAT_UNKNOWN in case of error.
// 'ignoreGainMap' is only relevant for jpeg files that have a gain map
// and only if AVIF_ENABLE_EXPERIMENTAL_JPEG_GAIN_MAP_CONVERSION is ON
// (requires AVIF_ENABLE_GAIN_MAP and libxml2). Otherwise
// it has no effect.
// (requires libxml2). Otherwise it has no effect.
avifAppFileFormat avifReadImage(const char * filename,
avifPixelFormat requestedFormat,
int requestedDepth,
Expand Down
34 changes: 7 additions & 27 deletions include/avif/avif.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,9 @@ typedef enum AVIF_NODISCARD avifResult
AVIF_RESULT_CANNOT_CHANGE_SETTING = 27, // a setting that can't change is changed during encoding
AVIF_RESULT_INCOMPATIBLE_IMAGE = 28, // the image is incompatible with already encoded images
AVIF_RESULT_INTERNAL_ERROR = 29, // some invariants have not been satisfied (likely a bug in libavif)
#if defined(AVIF_ENABLE_GAIN_MAP)
AVIF_RESULT_ENCODE_GAIN_MAP_FAILED = 30,
AVIF_RESULT_DECODE_GAIN_MAP_FAILED = 31,
AVIF_RESULT_INVALID_TONE_MAPPED_IMAGE = 32,
#endif
#if defined(AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM)
AVIF_RESULT_ENCODE_SAMPLE_TRANSFORM_FAILED = 33,
AVIF_RESULT_DECODE_SAMPLE_TRANSFORM_FAILED = 34,
Expand Down Expand Up @@ -590,7 +588,6 @@ typedef struct avifContentLightLevelInformationBox
uint16_t maxPALL;
} avifContentLightLevelInformationBox;

#if defined(AVIF_ENABLE_GAIN_MAP)
// ---------------------------------------------------------------------------
// avifGainMap
// Gain Maps are a solution for a consistent and adaptive display of HDR images.
Expand Down Expand Up @@ -700,8 +697,6 @@ AVIF_API avifGainMap * avifGainMapCreate(void);
// Frees a gain map, including the 'image' field if non NULL.
AVIF_API void avifGainMapDestroy(avifGainMap * gainMap);

#endif // AVIF_ENABLE_GAIN_MAP

// ---------------------------------------------------------------------------

#if defined(AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM)
Expand Down Expand Up @@ -828,22 +823,19 @@ typedef struct avifImage
avifImageItemProperty * properties; // NULL only if numProperties is 0.
size_t numProperties;

#if defined(AVIF_ENABLE_GAIN_MAP)
// Gain map image and metadata. NULL if no gain map is present.
// Owned by the avifImage and gets freed when calling avifImageDestroy().
// gainMap->image->transformFlags is always AVIF_TRANSFORM_NONE.
avifGainMap * gainMap;
#endif
} avifImage;

// avifImageCreate() and avifImageCreateEmpty() return NULL if arguments are invalid or if a memory allocation failed.
AVIF_NODISCARD AVIF_API avifImage * avifImageCreate(uint32_t width, uint32_t height, uint32_t depth, avifPixelFormat yuvFormat);
AVIF_NODISCARD AVIF_API avifImage * avifImageCreateEmpty(void); // helper for making an image to decode into
// Performs a deep copy of an image, including all metadata and planes, and the gain map metadata/planes if present
// and if AVIF_ENABLE_GAIN_MAP is defined.
// Performs a deep copy of an image, including all metadata and planes, and the gain map metadata/planes if present.
AVIF_API avifResult avifImageCopy(avifImage * dstImage, const avifImage * srcImage, avifPlanesFlags planes);
// Performs a shallow copy of a rectangular area of an image. 'dstImage' does not own the planes.
// Ignores the gainMap field (which exists only if AVIF_ENABLE_GAIN_MAP is defined).
// Ignores the gainMap field.
AVIF_API avifResult avifImageSetViewRect(avifImage * dstImage, const avifImage * srcImage, const avifCropRect * rect);
AVIF_API void avifImageDestroy(avifImage * image);

Expand All @@ -856,8 +848,7 @@ AVIF_API avifResult avifImageSetMetadataExif(avifImage * image, const uint8_t *
// Sets XMP metadata.
AVIF_API avifResult avifImageSetMetadataXMP(avifImage * image, const uint8_t * xmp, size_t xmpSize);

// Allocate/free/steal planes. These functions ignore the gainMap field (which exists only if
// AVIF_ENABLE_GAIN_MAP is defined).
// Allocate/free/steal planes. These functions ignore the gainMap field.
AVIF_API avifResult avifImageAllocatePlanes(avifImage * image, avifPlanesFlags planes); // Ignores any pre-existing planes
AVIF_API void avifImageFreePlanes(avifImage * image, avifPlanesFlags planes); // Ignores already-freed planes
AVIF_API void avifImageStealPlanes(avifImage * dstImage, avifImage * srcImage, avifPlanesFlags planes);
Expand Down Expand Up @@ -1199,12 +1190,8 @@ typedef enum avifImageContentTypeFlag
AVIF_IMAGE_CONTENT_NONE = 0,
// Color only or alpha only is not currently supported.
AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA = (1 << 0) | (1 << 1),
#if defined(AVIF_ENABLE_GAIN_MAP)
AVIF_IMAGE_CONTENT_GAIN_MAP = (1 << 2),
AVIF_IMAGE_CONTENT_ALL = AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA | AVIF_IMAGE_CONTENT_GAIN_MAP,
#else
AVIF_IMAGE_CONTENT_ALL = AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA,
#endif

AVIF_IMAGE_CONTENT_DECODE_DEFAULT = AVIF_IMAGE_CONTENT_COLOR_AND_ALPHA,
} avifImageContentTypeFlag;
Expand Down Expand Up @@ -1394,10 +1381,10 @@ AVIF_API avifResult avifDecoderNthImageTiming(const avifDecoder * decoder, uint3
// function can be called next to retrieve the number of top rows that can be immediately accessed
// from the luma plane of decoder->image, and alpha if any. The corresponding rows from the chroma planes,
// if any, can also be accessed (half rounded up if subsampled, same number of rows otherwise).
// If a gain map is present and AVIF_ENABLE_GAIN_MAP is on and
// (imageContentToDecode & AVIF_IMAGE_CONTENT_GAIN_MAP) is nonzero, the gain map's planes can also be accessed
// in the same way. If the gain map's height is different from the main image, then the number of
// available gain map rows is at least:
// If a gain map is present and (imageContentToDecode & AVIF_IMAGE_CONTENT_GAIN_MAP) is nonzero,
// the gain map's planes can also be accessed in the same way.
// If the gain map's height is different from the main image, then the number of available gain map
// rows is at least:
// roundf((float)decoded_row_count / decoder->image->height * decoder->image->gainMap.image->height)
// When gain map scaling is needed, callers might choose to use a few less rows depending on how many rows
// are needed by the scaling algorithm, to avoid the last row(s) changing when more data becomes available.
Expand Down Expand Up @@ -1517,9 +1504,7 @@ typedef struct avifEncoder

// Version 1.1.0 ends here. Add any new members after this line.

#if defined(AVIF_ENABLE_GAIN_MAP)
int qualityGainMap; // changeable encoder setting
#endif

#if defined(AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM)
// Perform extra steps at encoding and decoding to extend AV1 features using bundled additional image items.
Expand Down Expand Up @@ -1587,10 +1572,8 @@ AVIF_API avifResult avifEncoderFinish(avifEncoder * encoder, avifRWData * output
// AVIF_RESULT_INVALID_CODEC_SPECIFIC_OPTION from avifEncoderWrite() or avifEncoderAddImage().
AVIF_API avifResult avifEncoderSetCodecSpecificOption(avifEncoder * encoder, const char * key, const char * value);

#if defined(AVIF_ENABLE_GAIN_MAP)
// Returns the size in bytes of the AV1 image item containing gain map samples, or 0 if no gain map was encoded.
AVIF_API size_t avifEncoderGetGainMapSizeBytes(avifEncoder * encoder);
#endif

// Helpers
AVIF_NODISCARD AVIF_API avifBool avifImageUsesU16(const avifImage * image);
Expand All @@ -1605,7 +1588,6 @@ AVIF_API uint32_t avifImagePlaneHeight(const avifImage * image, int channel);
// either the brand 'avif' or 'avis' (or both), without performing any allocations.
AVIF_NODISCARD AVIF_API avifBool avifPeekCompatibleFileType(const avifROData * input);

#if defined(AVIF_ENABLE_GAIN_MAP)
// ---------------------------------------------------------------------------
// Gain Map utilities.
// Gain Maps are a HIGHLY EXPERIMENTAL FEATURE, see comments in the avifGainMap
Expand Down Expand Up @@ -1658,8 +1640,6 @@ AVIF_API avifResult avifImageComputeGainMap(const avifImage * baseImage,
avifGainMap * gainMap,
avifDiagnostics * diag);

#endif // AVIF_ENABLE_GAIN_MAP

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
Loading

0 comments on commit 6387c83

Please sign in to comment.