Only in libheif-1.14.2: aclocal.m4 Only in libheif_1.14.2+51+git54b16a7: .clang-tidy diff -r libheif_1.14.2+51+git54b16a7/CMakeLists.txt libheif-1.14.2/CMakeLists.txt 63c63 < if (ENABLE_PLUGIN_LOADING) --- > if (ENABLE_PLUGIN_LOADING AND UNIX) 115c115 < if (LIBDE265_FOUND AND NOT WITH_LIBDE265_PLUGIN) --- > if (LIBDE265_FOUND) 116a117,119 > set(have_libde265 yes) > else() > set(have_libde265 no) 118c121 < if (X265_FOUND AND NOT WITH_X265_PLUGIN) --- > if (X265_FOUND) 119a123,125 > set(have_x265 yes) > else() > set(have_x265 no) 121c127 < if ((AOM_DECODER_FOUND AND NOT WITH_AOM_DECODER_PLUGIN) OR (AOM_ENCODER_FOUND AND NOT WITH_AOM_ENCODER_PLUGIN)) --- > if (AOM_DECODER_FOUND OR AOM_ENCODER_FOUND) 124c130 < if (DAV1D_FOUND AND NOT WITH_DAV1D_PLUGIN) --- > if (DAV1D_FOUND) 127c133 < if (RAV1E_FOUND AND NOT WITH_RAV1E_PLUGIN) --- > if (RAV1E_FOUND) 130c136 < if (SvtEnc_FOUND AND NOT WITH_SvtEnc_PLUGIN) --- > if (SvtEnc_FOUND) 131a138,147 > endif() > if (AOM_DECODER_FOUND OR DAV1D_FOUND) > set(have_avif_decoder yes) > else() > set(have_avif_decoder no) > endif() > if (AOM_ENCODER_FOUND OR RAV1E_FOUND) > set(have_avif_encoder yes) > else() > set(have_avif_encoder no) Only in libheif-1.14.2: compile Only in libheif-1.14.2: config.guess Only in libheif-1.14.2: config.h.in Only in libheif-1.14.2: config.sub Only in libheif-1.14.2: configure Only in libheif-1.14.2: depcomp diff -r libheif_1.14.2+51+git54b16a7/examples/CMakeLists.txt libheif-1.14.2/examples/CMakeLists.txt 4,11c4,22 < if (MSVC) < set(getopt_sources < ../extra/getopt.c < ../extra/getopt.h < ../extra/getopt_long.c < ) < include_directories("../extra") < endif () --- > set (heif_convert_sources > encoder.cc > encoder.h > encoder_y4m.cc > encoder_y4m.h > heif_convert.cc > ../libheif/exif.cc > ../libheif/exif.cc > ) > > set (additional_link_directories) > set (additional_libraries) > set (additional_includes) > > include (${CMAKE_ROOT}/Modules/FindJPEG.cmake) > > if(JPEG_FOUND) > add_definitions(-DHAVE_LIBJPEG=1) > include_directories(SYSTEM ${JPEG_INCLUDE_DIR}) 12a24 > include (${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake) 14,48c26 < add_executable(heif-info ${getopt_sources} < heif_info.cc) < target_link_libraries(heif-info heif) < install(TARGETS heif-info RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) < install(FILES heif-info.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) < < < add_executable(heif-convert ${getopt_sources} < encoder.cc < encoder.h < encoder_y4m.cc < encoder_y4m.h < heif_convert.cc < ../libheif/exif.cc < ../libheif/exif.cc) < target_link_libraries(heif-convert PRIVATE heif) < install(TARGETS heif-convert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) < install(FILES heif-convert.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) < < < add_executable(heif-enc ${getopt_sources} < heif_enc.cc < ../libheif/exif.cc < ../libheif/exif.cc < benchmark.h < benchmark.cc < encoder.cc) < target_link_libraries(heif-enc PRIVATE heif) < install(TARGETS heif-enc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) < install(FILES heif-enc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) < < < add_executable(heif-test ${getopt_sources} < heif_test.cc) < target_link_libraries(heif-test heif) --- > set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES}) 49a28,29 > # while the docs say JPEG_INCLUDE_DIRS, my FindJPEG.cmake script returns it in JPEG_INCLUDE_DIR > set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR}) 51,60c31 < find_package(JPEG) < if (JPEG_FOUND) < add_definitions(-DHAVE_LIBJPEG=1) < < include(CheckCXXSourceCompiles) < < # this is needed for CheckCXXSourceCompiles < set(CMAKE_REQUIRED_LIBRARIES ${JPEG_LIBRARIES}) < set(CMAKE_REQUIRED_INCLUDES ${JPEG_INCLUDE_DIRS}) < check_cxx_source_compiles(" --- > check_cxx_source_compiles(" 70,75c41,116 < unset(CMAKE_REQUIRED_LIBRARIES) < unset(CMAKE_REQUIRED_INCLUDES) < < if (HAVE_JPEG_WRITE_ICC_PROFILE) < add_definitions(-DHAVE_JPEG_WRITE_ICC_PROFILE=1) < endif () --- > if(HAVE_JPEG_WRITE_ICC_PROFILE) > add_definitions(-DHAVE_JPEG_WRITE_ICC_PROFILE=1) > endif() > > set (heif_convert_sources > ${heif_convert_sources} > encoder_jpeg.cc > encoder_jpeg.h > ) > set (additional_libraries > ${additional_libraries} > ${JPEG_LIBRARIES} > ) > set (additional_includes > ${additional_includes} > ${JPEG_INCLUDE_DIRS} > ${JPEG_INCLUDE_DIR} > ) > endif() > > if(UNIX OR MINGW) > include (${CMAKE_ROOT}/Modules/FindPkgConfig.cmake) > pkg_check_modules (LIBPNG libpng) > if(LIBPNG_FOUND) > add_definitions(-DHAVE_LIBPNG=1) > set (heif_convert_sources > ${heif_convert_sources} > encoder_png.cc > encoder_png.h > benchmark.h benchmark.cc) > set (additional_link_directories > ${additional_link_directories} > ${LIBPNG_LIBRARY_DIRS} > ) > set (additional_libraries > ${additional_libraries} > ${LIBPNG_LINK_LIBRARIES} ${LIBPNG_LIBRARIES} > ) > set (additional_includes > ${additional_includes} > ${LIBPNG_INCLUDE_DIRS} > ) > endif() > endif() > > set (heif_info_sources > heif_info.cc > ) > > set (heif_enc_sources > heif_enc.cc > ../libheif/exif.cc > ../libheif/exif.cc > benchmark.h > benchmark.cc > ) > > set (heif_test_sources > heif_test.cc > ) > > if(MSVC) > set (getopt_sources > ../extra/getopt.c > ../extra/getopt.h > ../extra/getopt_long.c > ) > include_directories ("../extra") > endif() > > add_executable (heif-convert ${heif_convert_sources} ${getopt_sources}) > target_link_directories (heif-convert PRIVATE ${additional_link_directories}) > target_link_libraries (heif-convert heif ${additional_libraries}) > target_include_directories(heif-convert PRIVATE ${additional_includes}) > install(TARGETS heif-convert RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) > install(FILES heif-convert.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 77,80c118,121 < target_link_libraries(heif-convert PRIVATE ${JPEG_LIBRARIES}) < target_link_libraries(heif-enc PRIVATE ${JPEG_LIBRARIES}) < target_include_directories(heif-convert PRIVATE ${JPEG_INCLUDE_DIRS}) < target_include_directories(heif-enc PRIVATE ${JPEG_INCLUDE_DIRS}) --- > add_executable (heif-info ${heif_info_sources} ${getopt_sources}) > target_link_libraries (heif-info heif) > install(TARGETS heif-info RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) > install(FILES heif-info.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 82,83c123,128 < target_sources(heif-convert PRIVATE encoder_jpeg.cc encoder_jpeg.h) < endif () --- > add_executable (heif-enc ${heif_enc_sources} ${getopt_sources}) > target_link_directories (heif-enc PRIVATE ${additional_link_directories}) > target_link_libraries (heif-enc heif ${additional_libraries}) > target_include_directories(heif-enc PRIVATE ${additional_includes}) > install(TARGETS heif-enc RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) > install(FILES heif-enc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) 84a130,131 > add_executable (heif-test ${heif_test_sources} ${getopt_sources}) > target_link_libraries (heif-test heif) 86,88d132 < find_package(PNG) < if (PNG_FOUND) < add_definitions(-DHAVE_LIBPNG=1) 90,113c134,151 < target_link_libraries(heif-convert PRIVATE ${PNG_LIBRARIES}) < target_link_libraries(heif-enc PRIVATE ${PNG_LIBRARIES}) < target_include_directories(heif-convert PRIVATE ${PNG_INCLUDE_DIR}) < target_include_directories(heif-enc PRIVATE ${PNG_INCLUDE_DIR}) < < target_sources(heif-convert PRIVATE encoder_png.cc encoder_png.h) < endif () < < < if (PNG_FOUND) < add_executable(heif-thumbnailer ${getopt_sources} < encoder.cc < encoder.h < heif_thumbnailer.cc < encoder_png.cc < encoder_png.h < ../libheif/exif.h < ../libheif/exif.cc) < target_link_libraries(heif-thumbnailer heif ${PNG_LIBRARIES}) < target_include_directories(heif-thumbnailer PRIVATE ${PNG_INCLUDE_DIR}) < < install(TARGETS heif-thumbnailer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) < install(FILES heif-thumbnailer.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) < endif () --- > if(LIBPNG_FOUND) > set (heif_thumbnailer_sources > encoder.cc > encoder.h > heif_thumbnailer.cc > encoder_png.cc > encoder_png.h > ../libheif/exif.h > ../libheif/exif.cc > ) > > add_executable (heif-thumbnailer ${heif_thumbnailer_sources}) > target_link_directories (heif-thumbnailer PRIVATE ${LIBPNG_LIBRARY_DIRS}) > target_link_libraries (heif-thumbnailer heif ${LIBPNG_LINK_LIBRARIES} ${LIBPNG_LIBRARIES}) > target_include_directories(heif-thumbnailer PRIVATE ${LIBPNG_INCLUDE_DIRS}) > install(TARGETS heif-thumbnailer RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) > install(FILES heif-thumbnailer.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) > endif() diff -r libheif_1.14.2+51+git54b16a7/examples/heif_convert.cc libheif-1.14.2/examples/heif_convert.cc 64c64 < #if defined(_MSC_VER) --- > #if defined(__MINGW32__) || defined(__MINGW64__) || defined(_MSC_VER) 82d81 < " -d, --decoder ID use a specific decoder (see --list-decoders)\n" 88d86 < " --list-decoders list all available decoders (built-in and plugins)\n" 115d112 < int option_list_decoders = 0; 120d116 < {(char* const) "decoder", required_argument, 0, 'd'}, 127d122 < {(char* const) "list-decoders", no_argument, &option_list_decoders, 1}, 132,159d126 < #define MAX_DECODERS 20 < < void list_decoders(heif_compression_format format) < { < const heif_decoder_descriptor* decoders[MAX_DECODERS]; < int n = heif_get_decoder_descriptors(format, decoders, MAX_DECODERS); < < for (int i=0;i int c = getopt_long(argc, argv, "hq:s", long_options, &option_index); 189,191d154 < case 'd': < decoder_id = optarg; < break; 204,208d166 < if (option_list_decoders) { < list_all_decoders(); < return 0; < } < 361d318 < decode_options->decoder_id = decoder_id; diff -r libheif_1.14.2+51+git54b16a7/examples/heif_enc.cc libheif-1.14.2/examples/heif_enc.cc 160,161c160,161 < << " -A, --avif encode as AVIF (not needed if output filename with .avif suffix is provided)\n" < << " --list-encoders list all available encoders for all compression formats\n" --- > << " -A, --avif encode as AVIF\n" > << " --list-encoders list all available encoders for the selected output format\n" 1146c1146 < static void show_list_of_encoders(const heif_encoder_descriptor* const* encoder_descriptors, --- > static void show_list_of_encoders(const heif_encoder_descriptor*const* encoder_descriptors, 1148a1149 > std::cout << "Encoders (first is default):\n"; 1152,1187c1153,1154 < << heif_encoder_descriptor_get_name(encoder_descriptors[i]); < < if (i==0) { < std::cout << " [default]"; < } < < std::cout << "\n"; < } < } < < < static void show_list_of_all_encoders() < { < for (auto compression_format : {heif_compression_HEVC, heif_compression_AV1}) { < < switch (compression_format) { < case heif_compression_AV1: < std::cout << "AVIF"; < break; < case heif_compression_HEVC: < std::cout << "HEIC"; < break; < default: < assert(false); < } < < std::cout << " encoders:\n"; < < #define MAX_ENCODERS 10 < const heif_encoder_descriptor* encoder_descriptors[MAX_ENCODERS]; < int count = heif_get_encoder_descriptors(compression_format, < nullptr, < encoder_descriptors, MAX_ENCODERS); < #undef MAX_ENCODERS < < show_list_of_encoders(encoder_descriptors, count); --- > << heif_encoder_descriptor_get_name(encoder_descriptors[i]) > << "\n"; 1192,1221c1159 < bool ends_with(const std::string& str, const std::string& end) < { < if (str.length() < end.length()) { < return false; < } < else { < return str.compare(str.length() - end.length(), end.length(), end) == 0; < } < } < < < heif_compression_format guess_compression_format_from_filename(const std::string& filename) < { < std::string filename_lowercase = filename; < std::transform(filename_lowercase.begin(), filename_lowercase.end(), filename_lowercase.begin(), ::tolower); < < if (ends_with(filename_lowercase, ".avif")) { < return heif_compression_AV1; < } < else if (ends_with(filename_lowercase, ".heic")) { < return heif_compression_HEVC; < } < else { < return heif_compression_undefined; < } < } < < < class LibHeifInitializer < { --- > class LibHeifInitializer { 1224d1161 < 1241c1178 < bool force_enc_av1f = false; --- > bool enc_av1f = false; 1282c1219 < force_enc_av1f = true; --- > enc_av1f = true; 1335,1365d1271 < struct heif_encoder* encoder = nullptr; < < if (list_encoders) { < show_list_of_all_encoders(); < return 0; < } < < if (optind > argc - 1) { < show_help(argv[0]); < return 0; < } < < < // --- determine output compression format (from output filename or command line parameter) < < heif_compression_format compressionFormat; < < if (force_enc_av1f) { < compressionFormat = heif_compression_AV1; < } < else { < compressionFormat = guess_compression_format_from_filename(output_filename); < } < < if (compressionFormat == heif_compression_undefined) { < compressionFormat = heif_compression_HEVC; < } < < < // --- select encoder < 1374c1280,1282 < #define MAX_ENCODERS 10 --- > struct heif_encoder* encoder = nullptr; > > #define MAX_ENCODERS 5 1376,1379c1284,1292 < int count = heif_get_encoder_descriptors(compressionFormat, < nullptr, < encoder_descriptors, MAX_ENCODERS); < #undef MAX_ENCODERS --- > int count = heif_context_get_encoder_descriptors(context.get(), > enc_av1f ? heif_compression_AV1 : heif_compression_HEVC, > nullptr, > encoder_descriptors, MAX_ENCODERS); > > if (list_encoders) { > show_list_of_encoders(encoder_descriptors, count); > return 0; > } 1386c1299 < if (i == count) { --- > if (i==count) { 1408c1321 < std::cerr << "No " << (compressionFormat==heif_compression_AV1 ? "AV1" : "HEVC") << " encoder available.\n"; --- > std::cerr << "No " << (enc_av1f ? "AV1" : "HEVC") << " encoder available.\n"; 1411a1325 > 1417a1332,1337 > if (optind > argc - 1) { > show_help(argv[0]); > return 0; > } > > 1435c1355 < output_filename = filename_without_suffix + (compressionFormat==heif_compression_AV1 ? ".avif" : ".heic"); --- > output_filename = filename_without_suffix + (enc_av1f ? ".avif" : ".heic"); Only in libheif-1.14.2/examples: Makefile.in Only in libheif-1.14.2/extra: Makefile.in Only in libheif_1.14.2+51+git54b16a7/fuzzing/corpus: clusterfuzz-testcase-minimized-color-conversion-fuzzer-6275694804467712 Only in libheif-1.14.2/fuzzing: Makefile.in Only in libheif-1.14.2/gdk-pixbuf: Makefile.in Only in libheif_1.14.2+51+git54b16a7/.github: dependabot.yml Only in libheif_1.14.2+51+git54b16a7/.github: FUNDING.yml Only in libheif_1.14.2+51+git54b16a7: .gitignore Only in libheif-1.14.2/gnome: Makefile.in Only in libheif-1.14.2/go: Makefile.in Only in libheif-1.14.2: install-sh diff -r libheif_1.14.2+51+git54b16a7/libheif/box.cc libheif-1.14.2/libheif/box.cc 2467c2467,2470 < return m_clean_aperture_width.round(); --- > int left = (Fraction(0, 1) - (m_clean_aperture_width - 1) / 2).round(); > int right = ((m_clean_aperture_width - 1) / 2).round(); > > return right + 1 - left; 2472c2475,2478 < return m_clean_aperture_height.round(); --- > int top = (Fraction(0, 1) - (m_clean_aperture_height - 1) / 2).round(); > int bottom = ((m_clean_aperture_height - 1) / 2).round(); > > return bottom + 1 - top; diff -r libheif_1.14.2+51+git54b16a7/libheif/CMakeLists.txt libheif-1.14.2/libheif/CMakeLists.txt 42,43d41 < common_utils.cc < common_utils.h 47,52d44 < if (WIN32) < target_sources(heif PRIVATE plugins_windows.cc plugins_windows.h) < else () < target_sources(heif PRIVATE plugins_unix.cc plugins_unix.h) < endif () < 75c67 < target_link_libraries(heif PRIVATE ${CMAKE_DL_LIBS}) --- > target_link_libraries(heif PRIVATE dl) Only in libheif_1.14.2+51+git54b16a7/libheif: common_utils.cc Only in libheif_1.14.2+51+git54b16a7/libheif: common_utils.h diff -r libheif_1.14.2+51+git54b16a7/libheif/encoder_fuzzer.cc libheif-1.14.2/libheif/encoder_fuzzer.cc 154,156c154,157 < int count = heif_get_encoder_descriptors(use_avif ? heif_compression_AV1 : heif_compression_HEVC, < nullptr, < encoder_descriptors, kMaxEncoders); --- > int count = heif_context_get_encoder_descriptors(context.get(), > use_avif ? heif_compression_AV1 : heif_compression_HEVC, > nullptr, > encoder_descriptors, kMaxEncoders); diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_avif.cc libheif-1.14.2/libheif/heif_avif.cc 24d23 < #include "common_utils.h" 37c36,49 < uint8_t profile = compute_avif_profile(bpp, chroma); --- > uint8_t profile; > > if (bpp <= 10 && > (chroma == heif_chroma_420 || > chroma == heif_chroma_monochrome)) { > profile = 0; > } > else if (bpp <= 10 && > chroma == heif_chroma_444) { > profile = 1; > } > else { > profile = 2; > } diff -r libheif_1.14.2+51+git54b16a7/libheif/heif.cc libheif-1.14.2/libheif/heif.cc 906c906 < options->version = 4; --- > options->version = 3; 910,913c910,913 < options->start_progress = nullptr; < options->on_progress = nullptr; < options->end_progress = nullptr; < options->progress_user_data = nullptr; --- > options->start_progress = NULL; > options->on_progress = NULL; > options->end_progress = NULL; > options->progress_user_data = NULL; 923,926d922 < // version 4 < < options->decoder_id = nullptr; < 1169,1182d1164 < struct heif_error heif_image_extend_padding_to_size(struct heif_image* image, int min_physical_width, int min_physical_height) < { < bool mem_alloc_success = image->image->extend_padding_to_size(min_physical_width, min_physical_height); < if (!mem_alloc_success) { < return heif_error{heif_error_Memory_allocation_error, < heif_suberror_Unspecified, < "Cannot allocate image memory."}; < } < else { < return heif_error{heif_error_Ok, heif_suberror_Unspecified, Error::kSuccess}; < } < } < < 1636c1618 < else if (decoder_plugin->plugin_api_version > 3) { --- > else if (decoder_plugin->plugin_api_version > 2) { 1650c1632 < else if (decoder_plugin->plugin_api_version > 3) { --- > else if (decoder_plugin->plugin_api_version > 2) { 1743,1751d1724 < return heif_get_encoder_descriptors(format, name, out_encoder_descriptors, count); < } < < < int heif_get_encoder_descriptors(enum heif_compression_format format, < const char* name, < const struct heif_encoder_descriptor** out_encoder_descriptors, < int count) < { 1780,1844d1752 < int heif_get_decoder_descriptors(enum heif_compression_format format_filter, < const struct heif_decoder_descriptor** out_decoders, < int count) < { < struct decoder_with_priority { < const heif_decoder_plugin* plugin; < int priority; < }; < < std::vector plugins; < std::vector formats; < if (format_filter == heif_compression_undefined) { < formats = { heif_compression_HEVC, heif_compression_AV1 }; < } < else { < formats.emplace_back(format_filter); < } < < for (const auto* plugin : s_decoder_plugins) { < for (auto& format : formats) { < int priority = plugin->does_support_format(format); < if (priority) { < plugins.push_back({plugin, priority}); < break; < } < } < } < < if (out_decoders == nullptr) { < return (int)plugins.size(); < } < < std::sort(plugins.begin(), plugins.end(), [](const decoder_with_priority& a, const decoder_with_priority& b) { < return a.priority > b.priority; < }); < < int nDecodersReturned = std::min(count, (int)plugins.size()); < < for (int i=0;iget_plugin_name(); < } < < < const char* heif_decoder_descriptor_get_id_name(const struct heif_decoder_descriptor* descriptor) < { < auto decoder = (heif_decoder_plugin*)descriptor; < if (decoder->plugin_api_version < 3) { < return nullptr; < } < else { < return decoder->id_name; < } < } < < 1903c1811 < auto plugin = heif::get_decoder(format, nullptr); --- > auto plugin = heif::get_decoder(format); diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_colorconversion.cc libheif-1.14.2/libheif/heif_colorconversion.cc 23d22 < #include "common_utils.h" diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_context.cc libheif-1.14.2/libheif/heif_context.cc 472c472 < const struct heif_decoder_plugin* HeifContext::get_decoder(enum heif_compression_format type, const char* name_id) const --- > const struct heif_decoder_plugin* HeifContext::get_decoder(enum heif_compression_format type) const 480c480 < best_plugin = heif::get_decoder(type, name_id); --- > best_plugin = heif::get_decoder(type); 490,496d489 < < if (priority > 0 && name_id && plugin->plugin_api_version >= 3) { < if (strcmp(name_id, plugin->id_name) == 0) { < return plugin; < } < } < 1155c1148 < const struct heif_decoder_plugin* decoder_plugin = get_decoder(compression, options ? options->decoder_id : nullptr); --- > const struct heif_decoder_plugin* decoder_plugin = get_decoder(compression); 1159,1160d1151 < < std::cout << "using decoder: " << decoder_plugin->get_plugin_name() << "\n"; diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_context.h libheif-1.14.2/libheif/heif_context.h 415c415 < const struct heif_decoder_plugin* get_decoder(enum heif_compression_format type, const char* name_id) const; --- > const struct heif_decoder_plugin* get_decoder(enum heif_compression_format type) const; diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_emscripten.h libheif-1.14.2/libheif/heif_emscripten.h 35c35 < memcpy(_dest, _src, width); --- > memcpy(_dest, _src, stride); diff -r libheif_1.14.2+51+git54b16a7/libheif/heif.h libheif-1.14.2/libheif/heif.h 48d47 < // 1.15 1 4 5 1 1 1 1027,1033d1025 < < // version 4 options < < // name_id of the decoder to use for the decoding. < // If set to NULL (default), the highest priority decoder is chosen. < // The priority is defined in the plugin. < const char* decoder_id; 1212,1232d1203 < struct heif_decoder_descriptor; < < // Get a list of available decoders. You can filter the encoders by compression format. < // Use format_filter==heif_compression_undefined to get all available decoders. < // The returned list of decoders is sorted by their priority (which is a plugin property). < // The number of decoders is returned, which are not more than 'count' if (out_encoders != nullptr). < // By setting out_encoders==nullptr, you can query the number of decoders, 'count' is ignored. < LIBHEIF_API < int heif_get_decoder_descriptors(enum heif_compression_format format_filter, < const struct heif_decoder_descriptor** out_decoders, < int count); < < // Return a long, descriptive name of the decoder (including version information). < LIBHEIF_API < const char* heif_decoder_descriptor_get_name(const struct heif_decoder_descriptor*); < < // Return a short, symbolic name for identifying the decoder. < // This name should stay constant over different decoder versions. < // Note: the returned ID may be NULL for old plugins that don't support this yet. < LIBHEIF_API < const char* heif_decoder_descriptor_get_id_name(const struct heif_decoder_descriptor*); 1234d1204 < // DEPRECATED: use heif_get_encoder_descriptors() instead. 1246,1255d1215 < // Get a list of available encoders. You can filter the encoders by compression format and name. < // Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards. < // The returned list of encoders is sorted by their priority (which is a plugin property). < // Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder(). < LIBHEIF_API < int heif_get_encoder_descriptors(enum heif_compression_format format_filter, < const char* name_filter, < const struct heif_encoder_descriptor** out_encoders, < int count); < 1608,1615d1567 < < // This function extends the padding of the image so that it has at least the given physical size. < // The padding border is filled with the pixels along the right/bottom border. < // This function may be useful if you want to process the image, but have some external padding requirements. < // The image size will not be modified if it is already larger/equal than the given physical size. < // I.e. you cannot assume that after calling this function, the stride will be equal to min_physical_width. < LIBHEIF_API < struct heif_error heif_image_extend_padding_to_size(struct heif_image* image, int min_physical_width, int min_physical_height); diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_image.cc libheif-1.14.2/libheif/heif_image.cc 24d23 < #include "common_utils.h" 33a33,70 > uint8_t heif::chroma_h_subsampling(heif_chroma c) > { > switch (c) { > case heif_chroma_monochrome: > case heif_chroma_444: > return 1; > > case heif_chroma_420: > case heif_chroma_422: > return 2; > > case heif_chroma_interleaved_RGB: > case heif_chroma_interleaved_RGBA: > default: > assert(false); > return 0; > } > } > > uint8_t heif::chroma_v_subsampling(heif_chroma c) > { > switch (c) { > case heif_chroma_monochrome: > case heif_chroma_444: > case heif_chroma_422: > return 1; > > case heif_chroma_420: > return 2; > > case heif_chroma_interleaved_RGB: > case heif_chroma_interleaved_RGBA: > default: > assert(false); > return 0; > } > } > 192a230,251 > void heif::get_subsampled_size(int width, int height, > heif_channel channel, > heif_chroma chroma, > int* subsampled_width, int* subsampled_height) > { > if (channel == heif_channel_Cb || > channel == heif_channel_Cr) { > uint8_t chromaSubH = chroma_h_subsampling(chroma); > uint8_t chromaSubV = chroma_v_subsampling(chroma); > > // NOLINTNEXTLINE(clang-analyzer-core.DivideZero) > *subsampled_width = (width + chromaSubH - 1) / chromaSubH; > // NOLINTNEXTLINE(clang-analyzer-core.DivideZero) > *subsampled_height = (height + chromaSubV - 1) / chromaSubV; > } > else { > *subsampled_width = width; > *subsampled_height = height; > } > } > > 227c286 < int bytes_per_pixel = (plane->m_bit_depth + 7) / 8; --- > int nbytes = (plane->m_bit_depth + 7) / 8; 231,233c290,292 < memcpy(&plane->mem[y * plane->stride + x * bytes_per_pixel], < &plane->mem[y * plane->stride + (plane->m_width - 1) * bytes_per_pixel], < bytes_per_pixel); --- > memcpy(&plane->mem[y * plane->stride + x * nbytes], > &plane->mem[y * plane->stride + (plane->m_width - 1) * nbytes], > nbytes); 240c299 < subsampled_width * bytes_per_pixel); --- > subsampled_width * nbytes); diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_image.h libheif-1.14.2/libheif/heif_image.h 37a38,41 > uint8_t chroma_h_subsampling(heif_chroma c); > > uint8_t chroma_v_subsampling(heif_chroma c); > 38a43,47 > > void get_subsampled_size(int width, int height, > heif_channel channel, > heif_chroma chroma, > int* subsampled_width, int* subsampled_height); diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_init.cc libheif-1.14.2/libheif/heif_init.cc 25d24 < #include "common_utils.h" 31,36d29 < #if defined(_WIN32) < #include "plugins_windows.h" < #else < #include "plugins_unix.h" < #endif < 45,61c38 < std::vector get_plugin_paths() < { < #if defined(_WIN32) < return get_plugin_directories_from_environment_variable_windows(); < #else < return get_plugin_directories_from_environment_variable_unix(); < #endif < } < < std::vector list_all_potential_plugins_in_directory(const char* directory) < { < #if defined(_WIN32) < return list_all_potential_plugins_in_directory_windows(directory); < #else < return list_all_potential_plugins_in_directory_unix(directory); < #endif < } --- > std::vector get_plugin_paths(); 141c118,120 < #if ENABLE_PLUGIN_LOADING --- > #if defined(__linux__) && ENABLE_PLUGIN_LOADING > > // Currently only linux, as we don't have dynamic plugins for other systems yet. 154a134 > 185,193d164 < < #if defined(_WIN32) < typedef PluginLibrary_Windows PluginLibrary_SysDep; < #else < typedef PluginLibrary_Unix PluginLibrary_SysDep; < #endif < < < 196c167 < PluginLibrary_SysDep plugin_library_handle; --- > void* plugin_library_handle = nullptr; 203,205c174,178 < MAYBE_UNUSED heif_error error_dlopen{heif_error_Plugin_loading_error, heif_suberror_Plugin_loading_error, "Cannot open plugin (dlopen)."}; < MAYBE_UNUSED heif_error error_plugin_not_loaded{heif_error_Plugin_loading_error, heif_suberror_Plugin_is_not_loaded, "Trying to remove a plugin that is not loaded."}; < MAYBE_UNUSED heif_error error_cannot_read_plugin_directory{heif_error_Plugin_loading_error, heif_suberror_Cannot_read_plugin_directory, "Cannot read plugin directory."}; --- > __attribute__((unused)) static heif_error error_dlopen{heif_error_Plugin_loading_error, heif_suberror_Plugin_loading_error, "Cannot open plugin (dlopen)."}; > __attribute__((unused)) static heif_error error_plugin_not_loaded{heif_error_Plugin_loading_error, heif_suberror_Plugin_is_not_loaded, "Trying to remove a plugin that is not loaded."}; > __attribute__((unused)) static heif_error error_cannot_read_plugin_directory{heif_error_Plugin_loading_error, heif_suberror_Cannot_read_plugin_directory, "Cannot read plugin directory."}; > #endif > 207c180,182 < MAYBE_UNUSED static void unregister_plugin(const heif_plugin_info* info) --- > #if ENABLE_PLUGIN_LOADING > > __attribute__((unused)) static void unregister_plugin(const heif_plugin_info* info) 220a196,203 > #endif > > > #if ENABLE_PLUGIN_LOADING && defined(__linux__) > > #include > #include > #include 228,231c211,214 < PluginLibrary_SysDep plugin; < auto err = plugin.load_from_file(filename); < if (err.code) { < return err; --- > void* plugin_handle = dlopen(filename, RTLD_LAZY); > if (!plugin_handle) { > fprintf(stderr, "dlopen: %s\n", dlerror()); > return error_dlopen; 234c217,221 < heif_plugin_info* plugin_info = plugin.get_plugin_info(); --- > auto* plugin_info = (heif_plugin_info*) dlsym(plugin_handle, "plugin_info"); > if (!plugin_info) { > fprintf(stderr, "dlsym: %s\n", dlerror()); > return error_dlopen; > } 240c227 < if (p.plugin_library_handle == plugin) { --- > if (p.plugin_library_handle == plugin_handle) { 250c237 < loadedPlugin.plugin_library_handle = plugin; --- > loadedPlugin.plugin_library_handle = plugin_handle; 257c244 < switch (loadedPlugin.info->type) { --- > switch (plugin_info->type) { 279a267 > 290c278 < p.plugin_library_handle.release(); --- > dlclose(p.plugin_library_handle); 306a295 > 317c306 < p.plugin_library_handle.release(); --- > dlclose(p.plugin_library_handle); 323a313 > 329c319,322 < auto libraryFiles = list_all_potential_plugins_in_directory(directory); --- > DIR* dir = opendir(directory); > if (dir == nullptr) { > return error_cannot_read_plugin_directory; > } 333,339c326,348 < for (const auto& filename : libraryFiles) { < const struct heif_plugin_info* info = nullptr; < auto err = heif_load_plugin(filename.c_str(), &info); < if (err.code == 0) { < if (out_plugins) { < if (nPlugins == output_array_size) { < break; --- > struct dirent* d; > for (;;) { > d = readdir(dir); > if (d == nullptr) { > break; > } > > if ((d->d_type == DT_REG || d->d_type == DT_LNK) && strlen(d->d_name) > 3 && > strcmp(d->d_name + strlen(d->d_name) - 3, ".so") == 0) { > std::string filename = directory; > filename += '/'; > filename += d->d_name; > //printf("load %s\n", filename.c_str()); > > const struct heif_plugin_info* info = nullptr; > auto err = heif_load_plugin(filename.c_str(), &info); > if (err.code == 0) { > if (out_plugins) { > if (nPlugins == output_array_size) { > break; > } > > out_plugins[nPlugins] = info; 342c351 < out_plugins[nPlugins] = info; --- > nPlugins++; 344,345d352 < < nPlugins++; 356a364,365 > closedir(dir); > 359a369,389 > > std::vector get_plugin_paths() > { > char* path_variable = getenv("LIBHEIF_PLUGIN_PATH"); > if (path_variable == nullptr) { > return {}; > } > > // --- split LIBHEIF_PLUGIN_PATH value at ':' into separate directories > > std::vector plugin_paths; > > std::istringstream paths(path_variable); > std::string dir; > while (getline(paths, dir, ':')) { > plugin_paths.push_back(dir); > } > > return plugin_paths; > } > 382a413,417 > } > > std::vector get_plugin_paths() > { > return {}; diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_init.h libheif-1.14.2/libheif/heif_init.h 25,30d24 < #include "libheif/heif.h" < < extern heif_error error_dlopen; < extern heif_error error_plugin_not_loaded; < extern heif_error error_cannot_read_plugin_directory; < 34,45d27 < < // Note: the loaded plugin is not released automatically then the class is released, because this would require that < // we reference-count the handle. We do not really need this since releasing the library explicitly with release() is simple enough. < class PluginLibrary < { < public: < virtual struct heif_error load_from_file(const char*) = 0; < < virtual void release() = 0; < < virtual struct heif_plugin_info* get_plugin_info() = 0; < }; diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_plugin.h libheif-1.14.2/libheif/heif_plugin.h 44d43 < // 1.15 3 3 2 72c71 < // Default priority is 100. Returning 0 indicates that the plugin cannot decode this format. --- > // Default priority is 100. 106,111d104 < < // --- version 3 functions will follow below ... --- < < const char* id_name; < < // --- version 4 functions will follow below ... --- diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_plugin_registry.cc libheif-1.14.2/libheif/heif_plugin_registry.cc 27d26 < #include 122c121 < const struct heif_decoder_plugin* heif::get_decoder(enum heif_compression_format type, const char* name_id) --- > const struct heif_decoder_plugin* heif::get_decoder(enum heif_compression_format type) 128d126 < 130,136d127 < < if (priority > 0 && name_id && plugin->plugin_api_version >= 3) { < if (strcmp(name_id, plugin->id_name)==0) { < return plugin; < } < } < 145d135 < diff -r libheif_1.14.2+51+git54b16a7/libheif/heif_plugin_registry.h libheif-1.14.2/libheif/heif_plugin_registry.h 70c70 < const struct heif_decoder_plugin* get_decoder(enum heif_compression_format type, const char* name_id); --- > const struct heif_decoder_plugin* get_decoder(enum heif_compression_format type); Only in libheif-1.14.2/libheif: heif_version.h diff -r libheif_1.14.2+51+git54b16a7/libheif/Makefile.am libheif-1.14.2/libheif/Makefile.am 89,91c89 < nclx.h \ < common_utils.cc \ < common_utils.h --- > nclx.h 192d189 < # hack, plugin_*.h files are not used by autotools, because our autotools build scripts don't support plugins, but we need it anyways 195,197c192 < plugins/CMakeLists.txt \ < plugins_unix.h \ < plugins_windows.h --- > plugins/CMakeLists.txt Only in libheif-1.14.2/libheif: Makefile.in diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/CMakeLists.txt libheif-1.14.2/libheif/plugins/CMakeLists.txt 24c24 < target_link_libraries(heif-${name} PRIVATE ${${varName}_LIBRARIES} ${${varName}_LINKDIR} heif) --- > target_link_libraries(heif-${name} PRIVATE ${${varName}_LIBRARIES} ${${varName}_LINKDIR}) 50c50 < set(LIBDE265_extra_plugin_sources ../error.cc) --- > set(LIBDE265_extra_plugin_sources ../heif_image.cc ../error.cc) 54c54 < set(DAV1D_extra_plugin_sources ../common_utils.cc ../common_utils.h) --- > set(DAV1D_extra_plugin_sources) 62c62 < set(AOM_ENCODER_extra_plugin_sources ../error.cc ../common_utils.cc ../common_utils.h) --- > set(AOM_ENCODER_extra_plugin_sources ../heif_avif.cc ../error.cc) diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_decoder_aom.cc libheif-1.14.2/libheif/plugins/heif_decoder_aom.cc 284c284 < 3, --- > 2, 293,294c293 < aom_set_strict_decoding, < "aom" --- > aom_set_strict_decoding diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_decoder_aom.h libheif-1.14.2/libheif/plugins/heif_decoder_aom.h 24,25d23 < #include "libheif/common_utils.h" < 30c28 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_decoder_dav1d.cc libheif-1.14.2/libheif/plugins/heif_decoder_dav1d.cc 24c24 < #include "libheif/common_utils.h" --- > #include "libheif/heif_image.h" 34d33 < #include 48d46 < static const char kSuccess[] = "Success"; 269,270c267,268 < get_subsampled_size(frame.p.w, frame.p.h, < channel2plane[c], chroma, &w, &h); --- > heif::get_subsampled_size(frame.p.w, frame.p.h, > channel2plane[c], chroma, &w, &h); 300c298 < 3, --- > 2, 309,310c307 < dav1d_set_strict_decoding, < "dav1d" --- > dav1d_set_strict_decoding 317a315 > diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_decoder_dav1d.h libheif-1.14.2/libheif/plugins/heif_decoder_dav1d.h 24,25d23 < #include "libheif/common_utils.h" < 30c28 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_decoder_libde265.cc libheif-1.14.2/libheif/plugins/heif_decoder_libde265.cc 23,24c23,24 < //#include "libheif/heif_colorconversion.h" < //#include "libheif/heif_api_structs.h" --- > #include "libheif/heif_colorconversion.h" > #include "libheif/heif_api_structs.h" 36a37 > using namespace heif; 46d46 < static const char kSuccess[] = "Success"; 99,107c99,103 < heif_error err; < err = heif_image_create(de265_get_image_width(de265img, 0), < de265_get_image_height(de265img, 0), < is_mono ? heif_colorspace_monochrome : heif_colorspace_YCbCr, < (heif_chroma) de265_get_chroma_format(de265img), < image); < if (err.code) { < return err; < } --- > std::shared_ptr yuv_img = std::make_shared(); > yuv_img->create(de265_get_image_width(de265img, 0), > de265_get_image_height(de265img, 0), > is_mono ? heif_colorspace_monochrome : heif_colorspace_YCbCr, > (heif_chroma) de265_get_chroma_format(de265img)); 124,127c120,122 < heif_image_release(*image); < err = {heif_error_Unsupported_feature, < heif_suberror_Unsupported_color_conversion, < "Channels with different number of bits per pixel are not supported"}; --- > struct heif_error err = {heif_error_Unsupported_feature, > heif_suberror_Unsupported_color_conversion, > "Channels with different number of bits per pixel are not supported"}; 137,140c132,134 < heif_image_release(*image); < err = {heif_error_Decoder_plugin_error, < heif_suberror_Invalid_image_size, < kEmptyString}; --- > struct heif_error err = {heif_error_Decoder_plugin_error, > heif_suberror_Invalid_image_size, > kEmptyString}; 144,146c138,141 < err = heif_image_add_plane(*image, channel2plane[c], w,h, bpp); < if (err.code) { < heif_image_release(*image); --- > if (!yuv_img->add_plane(channel2plane[c], w, h, bpp)) { > struct heif_error err = {heif_error_Memory_allocation_error, > heif_suberror_Unspecified, > "Cannot allocate memory for image plane"}; 151c146 < uint8_t* dst_mem = heif_image_get_plane(*image, channel2plane[c], &dst_stride); --- > uint8_t* dst_mem = yuv_img->get_plane(channel2plane[c], &dst_stride); 161c156,160 < return {heif_error_Ok, heif_suberror_Unspecified, kSuccess}; --- > *image = new heif_image; > (*image)->image = yuv_img; > > struct heif_error err = {heif_error_Ok, heif_suberror_Unspecified, kSuccess}; > return err; 384c383 < 3, --- > 2, 393,394c392 < libde265_set_strict_decoding, < "libde265" --- > libde265_set_strict_decoding diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_decoder_libde265.h libheif-1.14.2/libheif/plugins/heif_decoder_libde265.h 24,25d23 < #include "libheif/common_utils.h" < 30c28 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_aom.cc libheif-1.14.2/libheif/plugins/heif_encoder_aom.cc 23c23,24 < #include "libheif/common_utils.h" --- > #include "libheif/heif_avif.h" > #include "libheif/heif_api_structs.h" 34d34 < #include 861,862c861,862 < int seq_profile = compute_avif_profile(heif_image_get_bits_per_pixel(image, heif_channel_Y), < heif_image_get_chroma_format(image)); --- > heif::Box_av1C::configuration inout_config; > heif::fill_av1C_configuration(&inout_config, image->image); 883c883 < cfg.g_profile = seq_profile; --- > cfg.g_profile = inout_config.seq_profile; 941,948c941 < struct heif_color_profile_nclx* nclx = nullptr; < err = heif_image_get_nclx_color_profile(image, &nclx); < if (err.code != heif_error_Ok) { < nclx = nullptr; < } < < // make sure NCLX profile is deleted at end of function < auto nclx_deleter = std::unique_ptr(nclx, heif_nclx_color_profile_free); --- > auto nclx = image->image->get_color_profile_nclx(); 951c944 < aom_codec_control(&codec, AV1E_SET_COLOR_RANGE, nclx ? nclx->full_range_flag : 1); --- > aom_codec_control(&codec, AV1E_SET_COLOR_RANGE, nclx ? nclx->get_full_range_flag() : 1); 957,959c950,952 < aom_codec_control(&codec, AV1E_SET_COLOR_PRIMARIES, nclx->color_primaries); < aom_codec_control(&codec, AV1E_SET_MATRIX_COEFFICIENTS, nclx->matrix_coefficients); < aom_codec_control(&codec, AV1E_SET_TRANSFER_CHARACTERISTICS, nclx->transfer_characteristics); --- > aom_codec_control(&codec, AV1E_SET_COLOR_PRIMARIES, nclx->get_colour_primaries()); > aom_codec_control(&codec, AV1E_SET_MATRIX_COEFFICIENTS, nclx->get_matrix_coefficients()); > aom_codec_control(&codec, AV1E_SET_TRANSFER_CHARACTERISTICS, nclx->get_transfer_characteristics()); diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_aom.h libheif-1.14.2/libheif/plugins/heif_encoder_aom.h 24d23 < #include "libheif/common_utils.h" 30c29 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_rav1e.cc libheif-1.14.2/libheif/plugins/heif_encoder_rav1e.cc 22a23,24 > #include "libheif/heif_avif.h" > #include "libheif/heif_api_structs.h" 517,525d518 < struct heif_color_profile_nclx* nclx = nullptr; < heif_error err = heif_image_get_nclx_color_profile(image, &nclx); < if (err.code != heif_error_Ok) { < nclx = nullptr; < } < < // make sure NCLX profile is deleted at end of function < auto nclx_deleter = std::unique_ptr(nclx, heif_nclx_color_profile_free); < 526a520 > auto nclx = image->image->get_color_profile_nclx(); 528c522 < rav1eRange = nclx->full_range_flag ? RA_PIXEL_RANGE_FULL : RA_PIXEL_RANGE_LIMITED; --- > rav1eRange = nclx->get_full_range_flag() ? RA_PIXEL_RANGE_FULL : RA_PIXEL_RANGE_LIMITED; 531c525,526 < int bitDepth = heif_image_get_bits_per_pixel(image, heif_channel_Y); --- > int bitDepth = image->image->get_bits_per_pixel(heif_channel_Y); > 543c538 < if (rav1e_config_parse_int(rav1eConfig.get(), "width", heif_image_get_width(image, heif_channel_Y)) == -1) { --- > if (rav1e_config_parse_int(rav1eConfig.get(), "width", image->image->get_width()) == -1) { 546c541 < if (rav1e_config_parse_int(rav1eConfig.get(), "height", heif_image_get_height(image, heif_channel_Y)) == -1) { --- > if (rav1e_config_parse_int(rav1eConfig.get(), "height", image->image->get_height()) == -1) { 557,559c552,554 < (RaMatrixCoefficients) nclx->matrix_coefficients, < (RaColorPrimaries) nclx->color_primaries, < (RaTransferCharacteristics) nclx->transfer_characteristics) == -1) { --- > (RaMatrixCoefficients) nclx->get_matrix_coefficients(), > (RaColorPrimaries) nclx->get_colour_primaries(), > (RaTransferCharacteristics) nclx->get_transfer_characteristics()) == -1) { 590c585,586 < if (nclx) { --- > auto colorProfile = image->image->get_color_profile_nclx(); > if (auto nclxProfile = std::dynamic_pointer_cast(colorProfile)) { 592,594c588,590 < (RaMatrixCoefficients) nclx->matrix_coefficients, < (RaColorPrimaries) nclx->color_primaries, < (RaTransferCharacteristics) nclx->transfer_characteristics); --- > (RaMatrixCoefficients) nclxProfile->matrix_coefficients, > (RaColorPrimaries) nclxProfile->color_primaries, > (RaTransferCharacteristics) nclxProfile->transfer_characteristics); 614c610 < const uint8_t* Y = heif_image_get_plane_readonly(image, heif_channel_Y, &strideY); --- > const uint8_t* Y = image->image->get_plane(heif_channel_Y, &strideY); 616c612 < const uint8_t* Cb = heif_image_get_plane_readonly(image, heif_channel_Cb, &strideCb); --- > const uint8_t* Cb = image->image->get_plane(heif_channel_Cb, &strideCb); 618,619c614 < const uint8_t* Cr = heif_image_get_plane_readonly(image, heif_channel_Cr, &strideCr); < --- > const uint8_t* Cr = image->image->get_plane(heif_channel_Cr, &strideCr); 621c616 < uint32_t height = heif_image_get_height(image, heif_channel_Y); --- > uint32_t height = image->image->get_height(); 718,721c713,716 < heif_plugin_info plugin_info{ < 1, < heif_plugin_type_encoder, < &encoder_plugin_rav1e --- > heif_plugin_info plugin_info { > 1, > heif_plugin_type_encoder, > &encoder_plugin_rav1e diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_rav1e.h libheif-1.14.2/libheif/plugins/heif_encoder_rav1e.h 24d23 < #include "libheif/common_utils.h" 30c29 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_svt.cc libheif-1.14.2/libheif/plugins/heif_encoder_svt.cc 22a23 > #include "libheif/heif_api_structs.h" 33c34 < #include --- > #include 517d517 < // NOLINTNEXTLINE(build/include_what_you_use) 583,590c583 < // Note: it is ok to cast away the const, as the image content is not changed. < // However, we have to guarantee that there are no plane pointers or stride values kept over calling the svt_encode_image() function. < heif_error err = heif_image_extend_padding_to_size(const_cast(image), < (int) encoded_width, < (int) encoded_height); < if (err.code) { < return err; < } --- > image->image->extend_padding_to_size(encoded_width, encoded_height); 640,648c633 < struct heif_color_profile_nclx* nclx = nullptr; < err = heif_image_get_nclx_color_profile(image, &nclx); < if (err.code != heif_error_Ok) { < nclx = nullptr; < } < < // make sure NCLX profile is deleted at end of function < auto nclx_deleter = std::unique_ptr(nclx, heif_nclx_color_profile_free); < --- > auto nclx = image->image->get_color_profile_nclx(); 652,655c637,640 < svt_config.color_primaries = static_cast(nclx->color_primaries); < svt_config.transfer_characteristics = static_cast(nclx->transfer_characteristics); < svt_config.matrix_coefficients = static_cast(nclx->matrix_coefficients); < svt_config.color_range = nclx->full_range_flag ? EB_CR_FULL_RANGE : EB_CR_STUDIO_RANGE; --- > svt_config.color_primaries = static_cast(nclx->get_colour_primaries()); > svt_config.transfer_characteristics = static_cast(nclx->get_transfer_characteristics()); > svt_config.matrix_coefficients = static_cast(nclx->get_matrix_coefficients()); > svt_config.color_range = nclx->get_full_range_flag() ? EB_CR_FULL_RANGE : EB_CR_STUDIO_RANGE; 657,660c642,645 < svt_config.color_primaries = static_cast(nclx->color_primaries); < svt_config.transfer_characteristics = static_cast(nclx->transfer_characteristics); < svt_config.matrix_coefficients = static_cast(nclx->matrix_coefficients); < svt_config.color_range = nclx->full_range_flag ? 1 : 0; --- > svt_config.color_primaries = static_cast(nclx->get_colour_primaries()); > svt_config.transfer_characteristics = static_cast(nclx->get_transfer_characteristics()); > svt_config.matrix_coefficients = static_cast(nclx->get_matrix_coefficients()); > svt_config.color_range = nclx->get_full_range_flag() ? 1 : 0; 666,668c651,653 < nclx->color_primaries == heif_color_primaries_ITU_R_BT_2020_2_and_2100_0 && < nclx->transfer_characteristics == heif_transfer_characteristic_ITU_R_BT_2100_0_PQ && < nclx->matrix_coefficients == heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance); --- > nclx->get_colour_primaries() == heif_color_primaries_ITU_R_BT_2020_2_and_2100_0 && > nclx->get_transfer_characteristics() == heif_transfer_characteristic_ITU_R_BT_2100_0_PQ && > nclx->get_matrix_coefficients() == heif_matrix_coefficients_ITU_R_BT_2020_2_non_constant_luminance); diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_svt.h libheif-1.14.2/libheif/plugins/heif_encoder_svt.h 24d23 < #include "libheif/common_utils.h" 30c29 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_x265.cc libheif-1.14.2/libheif/plugins/heif_encoder_x265.cc 22a23 > #include "libheif/heif_api_structs.h" 24,25d24 < #include < #include 43a43 > static const char* kError_out_of_memory = "Out of memory"; 793,801c793 < struct heif_color_profile_nclx* nclx = nullptr; < heif_error err = heif_image_get_nclx_color_profile(image, &nclx); < if (err.code != heif_error_Ok) { < nclx = nullptr; < } < < // make sure NCLX profile is deleted at end of function < auto nclx_deleter = std::unique_ptr(nclx, heif_nclx_color_profile_free); < --- > auto nclx = image->image->get_color_profile_nclx(); 803c795 < api->param_parse(param, "range", nclx->full_range_flag ? "full" : "limited"); --- > api->param_parse(param, "range", nclx->get_full_range_flag() ? "full" : "limited"); 815c807 < sstr << nclx->color_primaries; --- > sstr << nclx->get_colour_primaries(); 821c813 < sstr << nclx->transfer_characteristics; --- > sstr << nclx->get_transfer_characteristics(); 827c819 < sstr << nclx->matrix_coefficients; --- > sstr << nclx->get_matrix_coefficients(); 880,885c872,878 < // Note: it is ok to cast away the const, as the image content is not changed. < // However, we have to guarantee that there are no plane pointers or stride values kept over calling the svt_encode_image() function. < err = heif_image_extend_padding_to_size(const_cast(image), < param->sourceWidth, < param->sourceHeight); < if (err.code) { --- > bool success = image->image->extend_padding_to_size(param->sourceWidth, param->sourceHeight); > if (!success) { > struct heif_error err = { > heif_error_Memory_allocation_error, > heif_suberror_Unspecified, > kError_out_of_memory > }; diff -r libheif_1.14.2+51+git54b16a7/libheif/plugins/heif_encoder_x265.h libheif-1.14.2/libheif/plugins/heif_encoder_x265.h 24d23 < #include "libheif/common_utils.h" 41c40 < MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; --- > __attribute__((unused)) LIBHEIF_API extern heif_plugin_info plugin_info; Only in libheif_1.14.2+51+git54b16a7/libheif: plugins_unix.cc Only in libheif_1.14.2+51+git54b16a7/libheif: plugins_unix.h Only in libheif_1.14.2+51+git54b16a7/libheif: plugins_windows.cc Only in libheif_1.14.2+51+git54b16a7/libheif: plugins_windows.h diff -r libheif_1.14.2+51+git54b16a7/libheif.pc.in libheif-1.14.2/libheif.pc.in 5,13c5,8 < < # Contrary to older versions of libheif (<= 1.14.2), the available-codec-variables are now all set to 'yes' < # as since 1.14.0, codecs can be dynamically loaded at runtime and it is not possible anymore to determine < # the available codecs at compile-time. You'll get an unknown codec error at runtime if you try to use an < # unavailable codec. < builtin_h265_decoder=yes < builtin_h265_encoder=yes < builtin_avif_decoder=yes < builtin_avif_encoder=yes --- > builtin_h265_decoder=@have_libde265@ > builtin_h265_encoder=@have_x265@ > builtin_avif_decoder=@have_avif_decoder@ > builtin_avif_encoder=@have_avif_encoder@ Only in libheif_1.14.2+51+git54b16a7: logos Only in libheif-1.14.2: ltmain.sh Only in libheif-1.14.2/m4: libtool.m4 Only in libheif-1.14.2/m4: lt~obsolete.m4 Only in libheif-1.14.2/m4: ltoptions.m4 Only in libheif-1.14.2/m4: ltsugar.m4 Only in libheif-1.14.2/m4: ltversion.m4 Only in libheif-1.14.2: Makefile.in Only in libheif-1.14.2: missing diff -r libheif_1.14.2+51+git54b16a7/README.md libheif-1.14.2/README.md 154c154 < ./bootstrap-vcpkg.bat --- > ./bootstrap-vcpkg.sh 216c216 < The plugins are loaded from the colon-separated (semicolon-separated on Windows) list of directories stored in the environment variable `LIBHEIF_PLUGIN_PATH`. --- > The plugins are loaded from the colon-separated list of directories stored in the environment variable `LIBHEIF_PLUGIN_PATH`. Only in libheif_1.14.2+51+git54b16a7/scripts: configure-fuzzer.sh diff -r libheif_1.14.2+51+git54b16a7/scripts/install-ci-linux.sh libheif-1.14.2/scripts/install-ci-linux.sh 197c197 < cargo install --force cargo-c@0.9.14+cargo-0.66 --- > cargo install --force cargo-c diff -r libheif_1.14.2+51+git54b16a7/scripts/install-emscripten.sh libheif-1.14.2/scripts/install-emscripten.sh 14d13 < EMSDK_VERSION=3.1.29 36,37c35 < echo "Updating SDK base to ${EMSDK_VERSION} ..." < git checkout main --- > echo "Updating SDK ..." 39d36 < git checkout ${EMSDK_VERSION} Only in libheif-1.14.2/scripts: Makefile.in Only in libheif-1.14.2/tests: Makefile.in Only in libheif_1.14.2+51+git54b16a7: third-party Only in libheif-1.14.2: TODO