├── .clang-tidy ├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ ├── build.yml │ ├── cifuzz.yml │ ├── clang.yml │ ├── coverity.yml │ ├── diagram.yml │ ├── emscripten.yml │ ├── fuzzer.yml │ ├── go.yml │ ├── lint.yml │ ├── mingw.yml │ ├── osx.yml │ └── test.yml ├── .gitignore ├── CMakeLists.txt ├── CMakePresets.json ├── COPYING ├── CPPLINT.cfg ├── README.md ├── appveyor.yml ├── build-emscripten.sh ├── cmake └── modules │ ├── FindAOM.cmake │ ├── FindBrotli.cmake │ ├── FindDAV1D.cmake │ ├── FindFFMPEG.cmake │ ├── FindLIBDE265.cmake │ ├── FindOPENJPH.cmake │ ├── FindOpenH264.cmake │ ├── FindRAV1E.cmake │ ├── FindSvtEnc.cmake │ ├── FindUVG266.cmake │ ├── FindX265.cmake │ ├── Findkvazaar.cmake │ ├── Findlibsharpyuv.cmake │ └── LibFindMacros.cmake ├── examples ├── CMakeLists.txt ├── COPYING ├── benchmark.cc ├── benchmark.h ├── common.cc ├── common.h ├── demo.html ├── example.avif ├── example.heic ├── heif-dec.1 ├── heif-enc.1 ├── heif-info.1 ├── heif-test.go ├── heif-thumbnailer.1 ├── heif_dec.cc ├── heif_enc.cc ├── heif_info.cc ├── heif_test.cc ├── heif_thumbnailer.cc ├── heif_view.cc ├── sdl.cc ├── sdl.hh └── test_c_api.c ├── extra ├── getopt.c ├── getopt.h └── getopt_long.c ├── fuzzing ├── CMakeLists.txt ├── box_fuzzer.cc ├── color_conversion_fuzzer.cc ├── data │ ├── corpus │ │ ├── clap-overflow-divide-zero.heic │ │ ├── clusterfuzz-testcase-minimized-color-conversion-fuzzer-6275694804467712 │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-4616081830051840.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5120279175102464.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5643900194127872.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5651556035198976.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5662360964956160.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5671864958976000.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5686319331672064.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5718632116518912.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5720856641142784.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5724458239655936.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5732616832024576.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5752063708495872.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-5757633845264384.heic │ │ ├── clusterfuzz-testcase-minimized-file-fuzzer-6045213633282048.heic │ │ ├── colors-no-alpha-thumbnail.heic │ │ ├── colors-no-alpha.heic │ │ ├── colors-with-alpha-thumbnail.heic │ │ ├── colors-with-alpha.heic │ │ ├── crash-20ca2625096a205937b809a7841e7f019f0b2dc6.heic │ │ ├── github_138.heic │ │ ├── github_15.heic │ │ ├── github_20.heic │ │ ├── github_367_1.heic │ │ ├── github_367_2.heic │ │ ├── github_44.heic │ │ ├── github_45.heic │ │ ├── github_46_1.heic │ │ ├── github_46_2.heic │ │ ├── github_47.heic │ │ ├── github_48.heic │ │ ├── github_49.heic │ │ ├── github_50.heic │ │ ├── hbo_heif_context.h_126_1.heic │ │ ├── j2k-siz-segment-undersized.heic │ │ ├── region-mask-missing-refs.heic │ │ ├── rgb_generic_compressed_brotli.heic │ │ ├── rgb_generic_compressed_defl.heic │ │ ├── rgb_generic_compressed_tile_deflate.heic │ │ ├── rgb_generic_compressed_zlib.heic │ │ ├── rgb_generic_compressed_zlib_rows.heic │ │ ├── rgb_generic_compressed_zlib_tiled.heic │ │ ├── uaf_heif_context.h_117_1.heic │ │ ├── uncompressed_comp_ABGR.heic │ │ ├── uncompressed_comp_ABGR_tiled.heic │ │ ├── uncompressed_comp_B16R16G16.heic │ │ ├── uncompressed_comp_B16R16G16_tiled.heic │ │ ├── uncompressed_comp_M.heic │ │ ├── uncompressed_comp_M_tiled.heic │ │ ├── uncompressed_comp_R5G6B5_tiled.heic │ │ ├── uncompressed_comp_R7+1G7+1B7+1_tiled.heic │ │ ├── uncompressed_comp_R7G7+1B7_tiled.heic │ │ ├── uncompressed_comp_R7G7B7_tiled.heic │ │ ├── uncompressed_comp_RGB.heic │ │ ├── uncompressed_comp_RGB_tiled.heic │ │ ├── uncompressed_comp_RGB_tiled_row_tile_align.heic │ │ ├── uncompressed_comp_RGxB.heic │ │ ├── uncompressed_comp_RGxB_tiled.heic │ │ ├── uncompressed_comp_VUY_420.heic │ │ ├── uncompressed_comp_VUY_422.heic │ │ ├── uncompressed_comp_Y16U16V16_420.heic │ │ ├── uncompressed_comp_Y16U16V16_422.heic │ │ ├── uncompressed_comp_YUV_420.heic │ │ ├── uncompressed_comp_YUV_422.heic │ │ ├── uncompressed_comp_YUV_tiled.heic │ │ ├── uncompressed_comp_YVU_420.heic │ │ ├── uncompressed_comp_YVU_422.heic │ │ ├── uncompressed_mix_VUY_420.heic │ │ ├── uncompressed_mix_VUY_422.heic │ │ ├── uncompressed_mix_Y16U16V16_420.heic │ │ ├── uncompressed_mix_Y16U16V16_422.heic │ │ ├── uncompressed_mix_YUV_420.heic │ │ ├── uncompressed_mix_YUV_422.heic │ │ ├── uncompressed_mix_YVU_420.heic │ │ ├── uncompressed_mix_YVU_422.heic │ │ ├── uncompressed_pix_ABGR.heic │ │ ├── uncompressed_pix_ABGR_tiled.heic │ │ ├── uncompressed_pix_B16R16G16.heic │ │ ├── uncompressed_pix_B16R16G16_tiled.heic │ │ ├── uncompressed_pix_M.heic │ │ ├── uncompressed_pix_M_tiled.heic │ │ ├── uncompressed_pix_R5G6B5_tiled.heic │ │ ├── uncompressed_pix_R7+1G7+1B7+1_tiled.heic │ │ ├── uncompressed_pix_R7G7+1B7_tiled.heic │ │ ├── uncompressed_pix_R7G7B7_tiled.heic │ │ ├── uncompressed_pix_R8G8B8A8_bsz0_psz10_tiled.heic │ │ ├── uncompressed_pix_R8G8B8A8_bsz0_psz5_tiled.heic │ │ ├── uncompressed_pix_R8G8B8_bsz0_psz10_tiled.heic │ │ ├── uncompressed_pix_R8G8B8_bsz0_psz5_tiled.heic │ │ ├── uncompressed_pix_RGB.heic │ │ ├── uncompressed_pix_RGB_tiled.heic │ │ ├── uncompressed_pix_RGB_tiled_row_tile_align.heic │ │ ├── uncompressed_pix_RGxB.heic │ │ ├── uncompressed_pix_RGxB_tiled.heic │ │ ├── uncompressed_pix_YUV_tiled.heic │ │ ├── uncompressed_row_ABGR.heic │ │ ├── uncompressed_row_ABGR_tiled.heic │ │ ├── uncompressed_row_B16R16G16.heic │ │ ├── uncompressed_row_B16R16G16_tiled.heic │ │ ├── uncompressed_row_M.heic │ │ ├── uncompressed_row_M_tiled.heic │ │ ├── uncompressed_row_R5G6B5_tiled.heic │ │ ├── uncompressed_row_R7+1G7+1B7+1_tiled.heic │ │ ├── uncompressed_row_R7G7+1B7_tiled.heic │ │ ├── uncompressed_row_R7G7B7_tiled.heic │ │ ├── uncompressed_row_RGB.heic │ │ ├── uncompressed_row_RGB_tiled.heic │ │ ├── uncompressed_row_RGB_tiled_row_tile_align.heic │ │ ├── uncompressed_row_RGxB.heic │ │ ├── uncompressed_row_RGxB_tiled.heic │ │ ├── uncompressed_row_YUV_tiled.heic │ │ ├── uncompressed_tile_ABGR_tiled.heic │ │ ├── uncompressed_tile_B16R16G16_tiled.heic │ │ ├── uncompressed_tile_M_tiled.heic │ │ ├── uncompressed_tile_R5G6B5_tiled.heic │ │ ├── uncompressed_tile_R7+1G7+1B7+1_tiled.heic │ │ ├── uncompressed_tile_R7G7+1B7_tiled.heic │ │ ├── uncompressed_tile_R7G7B7_tiled.heic │ │ ├── uncompressed_tile_RGB_tiled.heic │ │ ├── uncompressed_tile_RGB_tiled_row_tile_align.heic │ │ ├── uncompressed_tile_RGxB_tiled.heic │ │ └── uncompressed_tile_YUV_tiled.heic │ └── dictionary.txt ├── encoder_fuzzer.cc └── file_fuzzer.cc ├── gdk-pixbuf ├── CMakeLists.txt └── pixbufloader-heif.c ├── gnome ├── CMakeLists.txt └── heif.thumbnailer ├── go └── heif │ ├── heif.go │ └── heif_test.go ├── heifio ├── CMakeLists.txt ├── decoder.h ├── decoder_jpeg.cc ├── decoder_jpeg.h ├── decoder_png.cc ├── decoder_png.h ├── decoder_tiff.cc ├── decoder_tiff.h ├── decoder_y4m.cc ├── decoder_y4m.h ├── encoder.cc ├── encoder.h ├── encoder_jpeg.cc ├── encoder_jpeg.h ├── encoder_png.cc ├── encoder_png.h ├── encoder_tiff.cc ├── encoder_tiff.h ├── encoder_y4m.cc ├── encoder_y4m.h ├── exif.cc ├── exif.h └── stubs.cc ├── libheif.pc.in ├── libheif ├── CMakeLists.txt ├── Doxyfile.in ├── api │ └── libheif │ │ ├── api_structs.h │ │ ├── heif.cc │ │ ├── heif.h │ │ ├── heif_aux_images.cc │ │ ├── heif_aux_images.h │ │ ├── heif_brands.cc │ │ ├── heif_brands.h │ │ ├── heif_color.cc │ │ ├── heif_color.h │ │ ├── heif_context.cc │ │ ├── heif_context.h │ │ ├── heif_cxx.h │ │ ├── heif_decoding.cc │ │ ├── heif_decoding.h │ │ ├── heif_emscripten.h │ │ ├── heif_encoding.cc │ │ ├── heif_encoding.h │ │ ├── heif_entity_groups.cc │ │ ├── heif_entity_groups.h │ │ ├── heif_error.h │ │ ├── heif_experimental.cc │ │ ├── heif_experimental.h │ │ ├── heif_image.cc │ │ ├── heif_image.h │ │ ├── heif_image_handle.cc │ │ ├── heif_image_handle.h │ │ ├── heif_items.cc │ │ ├── heif_items.h │ │ ├── heif_library.cc │ │ ├── heif_library.h │ │ ├── heif_metadata.cc │ │ ├── heif_metadata.h │ │ ├── heif_plugin.cc │ │ ├── heif_plugin.h │ │ ├── heif_properties.cc │ │ ├── heif_properties.h │ │ ├── heif_regions.cc │ │ ├── heif_regions.h │ │ ├── heif_security.cc │ │ ├── heif_security.h │ │ ├── heif_sequences.cc │ │ ├── heif_sequences.h │ │ ├── heif_tai_timestamps.cc │ │ ├── heif_tai_timestamps.h │ │ ├── heif_tiling.cc │ │ ├── heif_tiling.h │ │ ├── heif_uncompressed.cc │ │ ├── heif_uncompressed.h │ │ └── heif_version.h.in ├── bitstream.cc ├── bitstream.h ├── box.cc ├── box.h ├── brands.cc ├── brands.h ├── codecs │ ├── avc_boxes.cc │ ├── avc_boxes.h │ ├── avc_dec.cc │ ├── avc_dec.h │ ├── avif_boxes.cc │ ├── avif_boxes.h │ ├── avif_dec.cc │ ├── avif_dec.h │ ├── avif_enc.cc │ ├── avif_enc.h │ ├── decoder.cc │ ├── decoder.h │ ├── encoder.cc │ ├── encoder.h │ ├── hevc_boxes.cc │ ├── hevc_boxes.h │ ├── hevc_dec.cc │ ├── hevc_dec.h │ ├── hevc_enc.cc │ ├── hevc_enc.h │ ├── jpeg2000_boxes.cc │ ├── jpeg2000_boxes.h │ ├── jpeg2000_dec.cc │ ├── jpeg2000_dec.h │ ├── jpeg2000_enc.cc │ ├── jpeg2000_enc.h │ ├── jpeg_boxes.cc │ ├── jpeg_boxes.h │ ├── jpeg_dec.cc │ ├── jpeg_dec.h │ ├── jpeg_enc.cc │ ├── jpeg_enc.h │ ├── uncompressed │ │ ├── decoder_abstract.cc │ │ ├── decoder_abstract.h │ │ ├── decoder_component_interleave.cc │ │ ├── decoder_component_interleave.h │ │ ├── decoder_mixed_interleave.cc │ │ ├── decoder_mixed_interleave.h │ │ ├── decoder_pixel_interleave.cc │ │ ├── decoder_pixel_interleave.h │ │ ├── decoder_row_interleave.cc │ │ ├── decoder_row_interleave.h │ │ ├── decoder_tile_component_interleave.cc │ │ ├── decoder_tile_component_interleave.h │ │ ├── unc_boxes.cc │ │ ├── unc_boxes.h │ │ ├── unc_codec.cc │ │ ├── unc_codec.h │ │ ├── unc_dec.cc │ │ ├── unc_dec.h │ │ ├── unc_enc.cc │ │ ├── unc_enc.h │ │ └── unc_types.h │ ├── vvc_boxes.cc │ ├── vvc_boxes.h │ ├── vvc_dec.cc │ ├── vvc_dec.h │ ├── vvc_enc.cc │ └── vvc_enc.h ├── color-conversion │ ├── alpha.cc │ ├── alpha.h │ ├── chroma_sampling.cc │ ├── chroma_sampling.h │ ├── colorconversion.cc │ ├── colorconversion.h │ ├── hdr_sdr.cc │ ├── hdr_sdr.h │ ├── monochrome.cc │ ├── monochrome.h │ ├── rgb2rgb.cc │ ├── rgb2rgb.h │ ├── rgb2yuv.cc │ ├── rgb2yuv.h │ ├── rgb2yuv_sharp.cc │ ├── rgb2yuv_sharp.h │ ├── yuv2rgb.cc │ └── yuv2rgb.h ├── common_utils.cc ├── common_utils.h ├── compression.h ├── compression_brotli.cc ├── compression_zlib.cc ├── context.cc ├── context.h ├── error.cc ├── error.h ├── file.cc ├── file.h ├── file_layout.cc ├── file_layout.h ├── image-items │ ├── avc.cc │ ├── avc.h │ ├── avif.cc │ ├── avif.h │ ├── grid.cc │ ├── grid.h │ ├── hevc.cc │ ├── hevc.h │ ├── iden.cc │ ├── iden.h │ ├── image_item.cc │ ├── image_item.h │ ├── jpeg.cc │ ├── jpeg.h │ ├── jpeg2000.cc │ ├── jpeg2000.h │ ├── mask_image.cc │ ├── mask_image.h │ ├── overlay.cc │ ├── overlay.h │ ├── tiled.cc │ ├── tiled.h │ ├── unc_image.cc │ ├── unc_image.h │ ├── vvc.cc │ └── vvc.h ├── init.cc ├── init.h ├── logging.cc ├── logging.h ├── mdat_data.h ├── mini.cc ├── mini.h ├── nclx.cc ├── nclx.h ├── pixelimage.cc ├── pixelimage.h ├── plugin_registry.cc ├── plugin_registry.h ├── plugins │ ├── CMakeLists.txt │ ├── decoder_aom.cc │ ├── decoder_aom.h │ ├── decoder_dav1d.cc │ ├── decoder_dav1d.h │ ├── decoder_ffmpeg.cc │ ├── decoder_ffmpeg.h │ ├── decoder_jpeg.cc │ ├── decoder_jpeg.h │ ├── decoder_libde265.cc │ ├── decoder_libde265.h │ ├── decoder_openh264.cc │ ├── decoder_openh264.h │ ├── decoder_openjpeg.cc │ ├── decoder_openjpeg.h │ ├── decoder_uncompressed.cc │ ├── decoder_uncompressed.h │ ├── decoder_vvdec.cc │ ├── decoder_vvdec.h │ ├── encoder_aom.cc │ ├── encoder_aom.h │ ├── encoder_jpeg.cc │ ├── encoder_jpeg.h │ ├── encoder_kvazaar.cc │ ├── encoder_kvazaar.h │ ├── encoder_mask.cc │ ├── encoder_mask.h │ ├── encoder_openjpeg.cc │ ├── encoder_openjpeg.h │ ├── encoder_openjph.cc │ ├── encoder_openjph.h │ ├── encoder_rav1e.cc │ ├── encoder_rav1e.h │ ├── encoder_svt.cc │ ├── encoder_svt.h │ ├── encoder_uncompressed.cc │ ├── encoder_uncompressed.h │ ├── encoder_uvg266.cc │ ├── encoder_uvg266.h │ ├── encoder_vvenc.cc │ ├── encoder_vvenc.h │ ├── encoder_x265.cc │ ├── encoder_x265.h │ ├── nalu_utils.cc │ └── nalu_utils.h ├── plugins_unix.cc ├── plugins_unix.h ├── plugins_windows.cc ├── plugins_windows.h ├── region.cc ├── region.h ├── security_limits.cc ├── security_limits.h └── sequences │ ├── chunk.cc │ ├── chunk.h │ ├── seq_boxes.cc │ ├── seq_boxes.h │ ├── track.cc │ ├── track.h │ ├── track_metadata.cc │ ├── track_metadata.h │ ├── track_visual.cc │ └── track_visual.h ├── logos └── sponsors │ └── shopify.svg ├── post.js ├── scripts ├── build-android-libs.sh ├── check-emscripten-enums.sh ├── check-go-enums.sh ├── check-gofmt.sh ├── check-licenses.sh ├── configure-fuzzer.sh ├── cpplint.py ├── install-ci-linux.sh ├── install-ci-osx.sh ├── install-clang.sh ├── install-emscripten.sh ├── pre-commit.hook ├── prepare-ci.sh ├── run-ci.sh └── test-javascript.js ├── tests ├── CMakeLists.txt ├── avc_box.cc ├── bitstream_tests.cc ├── box_equals.cc ├── catch_amalgamated.cpp ├── catch_amalgamated.hpp ├── conversion.cc ├── data │ ├── heifio │ │ ├── mono.tif │ │ ├── mono_planar.tif │ │ ├── rgb.tif │ │ ├── rgb_planar.tif │ │ ├── rgba.tif │ │ └── rgba_planar.tif │ ├── lightning_mini.heif │ ├── rgb_generic_compressed_brotli.heif │ ├── rgb_generic_compressed_defl.heif │ ├── rgb_generic_compressed_tile_deflate.heif │ ├── rgb_generic_compressed_zlib.heif │ ├── rgb_generic_compressed_zlib_rows.heif │ ├── rgb_generic_compressed_zlib_tiled.heif │ ├── simple_osm_tile_alpha.avif │ ├── simple_osm_tile_meta.avif │ ├── uncompressed_comp_ABGR.heif │ ├── uncompressed_comp_ABGR_tiled.heif │ ├── uncompressed_comp_B16R16G16.heif │ ├── uncompressed_comp_B16R16G16_tiled.heif │ ├── uncompressed_comp_M.heif │ ├── uncompressed_comp_M_tiled.heif │ ├── uncompressed_comp_R5G6B5_tiled.heif │ ├── uncompressed_comp_R7+1G7+1B7+1_tiled.heif │ ├── uncompressed_comp_R7G7+1B7_tiled.heif │ ├── uncompressed_comp_R7G7B7_tiled.heif │ ├── uncompressed_comp_RGB.heif │ ├── uncompressed_comp_RGB_tiled.heif │ ├── uncompressed_comp_RGB_tiled_row_tile_align.heif │ ├── uncompressed_comp_RGxB.heif │ ├── uncompressed_comp_RGxB_tiled.heif │ ├── uncompressed_comp_VUY_420.heif │ ├── uncompressed_comp_VUY_422.heif │ ├── uncompressed_comp_Y16U16V16_420.heif │ ├── uncompressed_comp_Y16U16V16_422.heif │ ├── uncompressed_comp_YUV_420.heif │ ├── uncompressed_comp_YUV_422.heif │ ├── uncompressed_comp_YUV_tiled.heif │ ├── uncompressed_comp_YVU_420.heif │ ├── uncompressed_comp_YVU_422.heif │ ├── uncompressed_mix_VUY_420.heif │ ├── uncompressed_mix_VUY_422.heif │ ├── uncompressed_mix_Y16U16V16_420.heif │ ├── uncompressed_mix_Y16U16V16_422.heif │ ├── uncompressed_mix_YUV_420.heif │ ├── uncompressed_mix_YUV_422.heif │ ├── uncompressed_mix_YVU_420.heif │ ├── uncompressed_mix_YVU_422.heif │ ├── uncompressed_pix_ABGR.heif │ ├── uncompressed_pix_ABGR_tiled.heif │ ├── uncompressed_pix_B16R16G16.heif │ ├── uncompressed_pix_B16R16G16_tiled.heif │ ├── uncompressed_pix_M.heif │ ├── uncompressed_pix_M_tiled.heif │ ├── uncompressed_pix_R5G6B5_tiled.heif │ ├── uncompressed_pix_R7+1G7+1B7+1_tiled.heif │ ├── uncompressed_pix_R7G7+1B7_tiled.heif │ ├── uncompressed_pix_R7G7B7_tiled.heif │ ├── uncompressed_pix_R8G8B8A8_bsz0_psz10_tiled.heif │ ├── uncompressed_pix_R8G8B8A8_bsz0_psz5_tiled.heif │ ├── uncompressed_pix_R8G8B8_bsz0_psz10_tiled.heif │ ├── uncompressed_pix_R8G8B8_bsz0_psz5_tiled.heif │ ├── uncompressed_pix_RGB.heif │ ├── uncompressed_pix_RGB_tiled.heif │ ├── uncompressed_pix_RGB_tiled_row_tile_align.heif │ ├── uncompressed_pix_RGxB.heif │ ├── uncompressed_pix_RGxB_tiled.heif │ ├── uncompressed_pix_YUV_tiled.heif │ ├── uncompressed_row_ABGR.heif │ ├── uncompressed_row_ABGR_tiled.heif │ ├── uncompressed_row_B16R16G16.heif │ ├── uncompressed_row_B16R16G16_tiled.heif │ ├── uncompressed_row_M.heif │ ├── uncompressed_row_M_tiled.heif │ ├── uncompressed_row_R5G6B5_tiled.heif │ ├── uncompressed_row_R7+1G7+1B7+1_tiled.heif │ ├── uncompressed_row_R7G7+1B7_tiled.heif │ ├── uncompressed_row_R7G7B7_tiled.heif │ ├── uncompressed_row_RGB.heif │ ├── uncompressed_row_RGB_tiled.heif │ ├── uncompressed_row_RGB_tiled_row_tile_align.heif │ ├── uncompressed_row_RGxB.heif │ ├── uncompressed_row_RGxB_tiled.heif │ ├── uncompressed_row_YUV_tiled.heif │ ├── uncompressed_tile_ABGR_tiled.heif │ ├── uncompressed_tile_B16R16G16_tiled.heif │ ├── uncompressed_tile_M_tiled.heif │ ├── uncompressed_tile_R5G6B5_tiled.heif │ ├── uncompressed_tile_R7+1G7+1B7+1_tiled.heif │ ├── uncompressed_tile_R7G7+1B7_tiled.heif │ ├── uncompressed_tile_R7G7B7_tiled.heif │ ├── uncompressed_tile_RGB_tiled.heif │ ├── uncompressed_tile_RGB_tiled_row_tile_align.heif │ ├── uncompressed_tile_RGxB_tiled.heif │ └── uncompressed_tile_YUV_tiled.heif ├── encode.cc ├── encode_htj2k.cc ├── encode_jpeg2000.cc ├── extended_type.cc ├── file_layout.cc ├── idat.cc ├── jpeg2000.cc ├── main.cc ├── mini_box.cc ├── mini_decode.cc ├── pixel_data_types.cc ├── region.cc ├── tai.cc ├── test-config.cc.in ├── test-config.h ├── test-race.go ├── test_utils.cc ├── test_utils.h ├── tiffdecode.cc ├── uncompressed_box.cc ├── uncompressed_decode.cc ├── uncompressed_decode.h ├── uncompressed_decode_generic_compression.cc ├── uncompressed_decode_mono.cc ├── uncompressed_decode_rgb.cc ├── uncompressed_decode_rgb16.cc ├── uncompressed_decode_rgb565.cc ├── uncompressed_decode_rgb7.cc ├── uncompressed_decode_ycbcr.cc ├── uncompressed_decode_ycbcr420.cc ├── uncompressed_decode_ycbcr422.cc └── uncompressed_encode.cc └── third-party ├── aom.cmd ├── dav1d.cmd ├── libsharpyuv.cmd ├── rav1e.cmd └── svt.cmd /.clang-tidy: -------------------------------------------------------------------------------- 1 | --- 2 | Checks: > 3 | -clang-analyzer-security.insecureAPI.strcat, 4 | -clang-analyzer-security.insecureAPI.strcpy, 5 | modernize-shrink-to-fit, 6 | modernize-use-default-member-init, 7 | modernize-use-equals-default, 8 | modernize-use-equals-delete, 9 | modernize-use-override, 10 | performance-* 11 | HeaderFilterRegex: .* 12 | WarningsAsErrors: '*' 13 | ... 14 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [farindk] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | env: 14 | - { NAME: "nothing" } 15 | - { NAME: "tarball", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_AOM: 1, WITH_LIBDE265: 1, TARBALL: 1 } 16 | - { NAME: "graphics", WITH_GRAPHICS: 1 } 17 | - { NAME: "x265", WITH_X265: 1 } 18 | - { NAME: "x265 / graphics", WITH_GRAPHICS: 1, WITH_X265: 1 } 19 | - { NAME: "libde265 (1) / graphics", WITH_GRAPHICS: 1, WITH_LIBDE265: 1 } 20 | - { NAME: "libde265 (2) / graphics", WITH_GRAPHICS: 1, WITH_LIBDE265: 2 } 21 | - { NAME: "libde265 (1) / x265 / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_LIBDE265: 1 } 22 | - { NAME: "libde265 (2) / x265 / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_LIBDE265: 2 } 23 | - { NAME: "libde265 (1) / x265 / aom / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_AOM: 1, WITH_LIBDE265: 1 } 24 | - { NAME: "libde265 (1) / x265 / dav1d / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_DAV1D: 1, WITH_LIBDE265: 1 } 25 | - { NAME: "libde265 (1) / x265 / aom / rav1e / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_AOM: 1, WITH_RAV1E: 1, WITH_LIBDE265: 1 } 26 | env: ${{ matrix.env }} 27 | runs-on: ubuntu-22.04 28 | steps: 29 | - uses: actions/checkout@v4 30 | 31 | - name: Install dependencies 32 | run: | 33 | ./scripts/install-ci-linux.sh 34 | 35 | - name: Prepare CI 36 | run: | 37 | ./scripts/prepare-ci.sh 38 | 39 | - name: Run tests 40 | run: | 41 | ./scripts/run-ci.sh 42 | -------------------------------------------------------------------------------- /.github/workflows/cifuzz.yml: -------------------------------------------------------------------------------- 1 | name: CIFuzz 2 | on: [pull_request] 3 | jobs: 4 | Fuzzing: 5 | runs-on: ubuntu-22.04 6 | steps: 7 | - name: Build Fuzzers 8 | id: build 9 | uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master 10 | with: 11 | oss-fuzz-project-name: 'libheif' 12 | dry-run: false 13 | - name: Run Fuzzers 14 | uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master 15 | with: 16 | oss-fuzz-project-name: 'libheif' 17 | fuzz-seconds: 600 18 | dry-run: false 19 | - name: Upload Crash 20 | uses: actions/upload-artifact@v4 21 | if: failure() && steps.build.outcome == 'success' 22 | with: 23 | name: artifacts 24 | path: ./out/artifacts 25 | -------------------------------------------------------------------------------- /.github/workflows/clang.yml: -------------------------------------------------------------------------------- 1 | name: clang 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | env: 14 | - { NAME: "nothing" } 15 | - { NAME: "libde265 (1) / x265 / aom / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_AOM: 1, WITH_LIBDE265: 1 } 16 | - { NAME: "libde265 (2) / x265 / aom / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_AOM: 1, WITH_LIBDE265: 2 } 17 | env: ${{ matrix.env }} 18 | runs-on: ubuntu-22.04 19 | steps: 20 | - uses: actions/checkout@v4 21 | 22 | - name: Install dependencies 23 | run: | 24 | ./scripts/install-ci-linux.sh 25 | sudo apt install clang 26 | 27 | - name: Prepare CI 28 | env: 29 | CC: clang 30 | CXX: clang++ 31 | run: | 32 | ./scripts/prepare-ci.sh 33 | 34 | - name: Run tests 35 | env: 36 | CC: clang 37 | CXX: clang++ 38 | run: | 39 | ./scripts/run-ci.sh 40 | 41 | tidy: 42 | env: 43 | WITH_GRAPHICS: 1 44 | WITH_X265: 1 45 | WITH_AOM: 1 46 | WITH_DAV1D: 1 47 | WITH_LIBDE265: 1 48 | CLANG_TIDY: 1 49 | runs-on: ubuntu-22.04 50 | steps: 51 | - uses: actions/checkout@v4 52 | 53 | - name: Install dependencies 54 | run: | 55 | ./scripts/install-ci-linux.sh 56 | sudo apt install clang-tidy-12 57 | 58 | - name: Prepare CI 59 | run: | 60 | ./scripts/prepare-ci.sh 61 | 62 | - name: Run tests 63 | run: | 64 | ./scripts/run-ci.sh 65 | 66 | - name: Run clang-tidy 67 | run: | 68 | run-clang-tidy-12 -checks=-clang-diagnostic-tautological-compare,-clang-diagnostic-tautological-constant-out-of-range-compare -j$(nproc) 69 | -------------------------------------------------------------------------------- /.github/workflows/diagram.yml: -------------------------------------------------------------------------------- 1 | name: Create diagram 2 | on: 3 | workflow_dispatch: {} 4 | push: 5 | branches: 6 | - main 7 | jobs: 8 | get_data: 9 | runs-on: ubuntu-22.04 10 | steps: 11 | - name: Checkout code 12 | uses: actions/checkout@v4 13 | - name: Update diagram 14 | uses: githubocto/repo-visualizer@main 15 | with: 16 | excluded_paths: "ignore,.github" 17 | -------------------------------------------------------------------------------- /.github/workflows/emscripten.yml: -------------------------------------------------------------------------------- 1 | name: emscripten 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | emscripten: 11 | env: 12 | EMSCRIPTEN_VERSION: 3.1.61 13 | runs-on: ubuntu-22.04 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Install emscripten 18 | run: | 19 | ./scripts/install-ci-linux.sh 20 | 21 | - name: Prepare CI 22 | run: | 23 | ./scripts/prepare-ci.sh 24 | 25 | - name: Run tests 26 | run: | 27 | ./scripts/run-ci.sh 28 | -------------------------------------------------------------------------------- /.github/workflows/fuzzer.yml: -------------------------------------------------------------------------------- 1 | name: fuzzer 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | fuzzer: 11 | env: 12 | WITH_AOM: 1 13 | WITH_GRAPHICS: 1 14 | WITH_LIBDE265: 2 15 | WITH_X265: 1 16 | FUZZER: 1 17 | runs-on: ubuntu-22.04 18 | steps: 19 | - uses: actions/checkout@v4 20 | 21 | - name: Install dependencies 22 | run: | 23 | ./scripts/install-ci-linux.sh 24 | 25 | - name: Prepare CI 26 | run: | 27 | ./scripts/prepare-ci.sh 28 | 29 | - name: Run tests 30 | run: | 31 | ./scripts/run-ci.sh 32 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: go 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | libde265: 11 | strategy: 12 | matrix: 13 | libde265-version: 14 | - "1" 15 | - "2" 16 | env: 17 | WITH_LIBDE265: ${{ matrix.libde265-version }} 18 | WITH_X265: 1 19 | WITH_GRAPHICS: 1 20 | GO: 1 21 | runs-on: ubuntu-22.04 22 | steps: 23 | - uses: actions/checkout@v4 24 | 25 | - uses: actions/setup-go@v5 26 | with: 27 | go-version: "1.10" 28 | 29 | - name: Install dependencies 30 | run: | 31 | ./scripts/install-ci-linux.sh 32 | 33 | - name: Prepare CI 34 | run: | 35 | ./scripts/prepare-ci.sh 36 | 37 | - name: Run tests 38 | run: | 39 | ./scripts/run-ci.sh 40 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: lint 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | cpplint: 11 | env: 12 | CPPLINT: 1 13 | runs-on: ubuntu-22.04 14 | steps: 15 | - uses: actions/checkout@v4 16 | 17 | - name: Install dependencies 18 | run: | 19 | ./scripts/install-ci-linux.sh 20 | 21 | - name: Prepare CI 22 | run: | 23 | ./scripts/prepare-ci.sh 24 | 25 | - name: Check format 26 | run: | 27 | ./scripts/run-ci.sh 28 | 29 | licenses: 30 | env: 31 | CHECK_LICENSES: 1 32 | runs-on: ubuntu-22.04 33 | steps: 34 | - uses: actions/checkout@v4 35 | 36 | - name: Install dependencies 37 | run: | 38 | ./scripts/install-ci-linux.sh 39 | 40 | - name: Prepare CI 41 | run: | 42 | ./scripts/prepare-ci.sh 43 | 44 | - name: Check licenses 45 | run: | 46 | ./scripts/run-ci.sh 47 | -------------------------------------------------------------------------------- /.github/workflows/mingw.yml: -------------------------------------------------------------------------------- 1 | name: mingw 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | mingw: 11 | strategy: 12 | matrix: 13 | env: 14 | - { MINGW: 32 } 15 | - { MINGW: 64 } 16 | env: ${{ matrix.env }} 17 | runs-on: ubuntu-24.04 18 | steps: 19 | - uses: actions/checkout@v4 20 | 21 | - name: Install dependencies 22 | run: | 23 | ./scripts/install-ci-linux.sh 24 | 25 | - name: Prepare CI 26 | run: | 27 | ./scripts/prepare-ci.sh 28 | 29 | - name: Run tests 30 | run: | 31 | ./scripts/run-ci.sh 32 | -------------------------------------------------------------------------------- /.github/workflows/osx.yml: -------------------------------------------------------------------------------- 1 | name: osx 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | runner: [ macos-13, macos-15 ] 14 | env: 15 | - { NAME: "nothing" } 16 | - { NAME: "cmake", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_AOM: 1, WITH_LIBDE265: 1 } 17 | - { NAME: "libde265 (1) / x265 / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_LIBDE265: 1 } 18 | - { NAME: "libde265 (2) / x265 / graphics", WITH_GRAPHICS: 1, WITH_X265: 1, WITH_LIBDE265: 2 } 19 | env: ${{ matrix.env }} 20 | runs-on: ${{ matrix.runner }} 21 | steps: 22 | - uses: actions/checkout@v4 23 | 24 | - name: Install dependencies 25 | run: | 26 | ./scripts/install-ci-osx.sh 27 | 28 | - name: Prepare CI 29 | run: | 30 | ./scripts/prepare-ci.sh 31 | 32 | - name: Run tests 33 | run: | 34 | ./scripts/run-ci.sh 35 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | test: 11 | env: 12 | TESTS: 1 13 | WITH_AOM: 1 14 | WITH_LIBDE265: 1 15 | WITH_X265: 1 16 | runs-on: ubuntu-22.04 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - name: Install dependencies 21 | run: | 22 | ./scripts/install-ci-linux.sh 23 | 24 | - name: Prepare CI 25 | run: | 26 | ./scripts/prepare-ci.sh 27 | 28 | - name: Run tests 29 | run: | 30 | ./scripts/run-ci.sh 31 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Please put your IDE or OS specific ignores into a global .gitignore file. 2 | # see here: https://stackoverflow.com/questions/7335420/global-git-ignore 3 | 4 | build 5 | _build 6 | third-party/SVT-AV1/ 7 | third-party/dav1d/ 8 | third-party/libwebp/ 9 | third-party/rav1e/ -------------------------------------------------------------------------------- /CPPLINT.cfg: -------------------------------------------------------------------------------- 1 | set noparent 2 | filter=-,+build/include_what_you_use 3 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # stats available at 2 | # https://ci.appveyor.com/project/strukturag/libheif 3 | image: Visual Studio 2022 4 | configuration: Release 5 | cache: c:\tools\vcpkg\installed\ 6 | 7 | environment: 8 | matrix: 9 | - arch: x64 10 | - arch: arm64 11 | 12 | install: 13 | - vcpkg install aom:%arch%-windows 14 | - vcpkg install dav1d:%arch%-windows 15 | - vcpkg install ffmpeg[avcodec]:%arch%-windows 16 | - vcpkg install libde265:%arch%-windows 17 | - vcpkg install libjpeg-turbo:%arch%-windows 18 | - vcpkg install libpng:%arch%-windows 19 | - vcpkg install tiff:%arch%-windows 20 | - ps: If (${env:arch} -eq "x64") { vcpkg install x265:${env:arch}-windows } 21 | - vcpkg install zlib:%arch%-windows 22 | - cd c:\tools\vcpkg 23 | - vcpkg integrate install 24 | - cd %APPVEYOR_BUILD_FOLDER% 25 | 26 | before_build: 27 | - mkdir build 28 | - cd build 29 | - cmake .. -A %arch% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DWITH_DAV1D=ON -DWITH_AOM_DECODER=ON -DWITH_AOM_ENCODER=ON -DWITH_JPEG_DECODER=ON -DWITH_JPEG_ENCODER=ON -DWITH_UNCOMPRESSED_CODEC=ON -DWITH_HEADER_COMPRESSION=ON -DWITH_FFMPEG_DECODER=ON 30 | - dir 31 | 32 | build: 33 | project: build\libheif.sln 34 | parallel: true 35 | verbosity: normal 36 | 37 | artifacts: 38 | - path: build 39 | - path: build\**\Release\*.exe 40 | - path: build\**\Release\*.dll 41 | -------------------------------------------------------------------------------- /cmake/modules/FindAOM.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | include(CheckSymbolExists) 3 | 4 | libfind_pkg_check_modules(AOM_PKGCONF aom) 5 | 6 | find_path(AOM_INCLUDE_DIR 7 | NAMES aom/aom_decoder.h aom/aom_encoder.h 8 | HINTS ${AOM_PKGCONF_INCLUDE_DIRS} ${AOM_PKGCONF_INCLUDEDIR} 9 | PATH_SUFFIXES AOM 10 | ) 11 | 12 | list(APPEND CMAKE_REQUIRED_INCLUDES ${AOM_INCLUDE_DIR}) 13 | check_symbol_exists(AOM_USAGE_GOOD_QUALITY aom/aom_encoder.h aom_usage_flag_exists) 14 | unset(CMAKE_REQUIRED_INCLUDES) 15 | 16 | find_library(AOM_LIBRARY 17 | NAMES libaom aom 18 | HINTS ${AOM_PKGCONF_LIBRARY_DIRS} ${AOM_PKGCONF_LIBDIR} 19 | ) 20 | 21 | if(EXISTS "${AOM_INCLUDE_DIR}/aom/aom_decoder.h") 22 | set(AOM_DECODER_FOUND YES) 23 | else() 24 | set(AOM_DECODER_FOUND NO) 25 | endif() 26 | 27 | if((EXISTS "${AOM_INCLUDE_DIR}/aom/aom_encoder.h") AND "${aom_usage_flag_exists}") 28 | set(AOM_ENCODER_FOUND YES) 29 | else() 30 | set(AOM_ENCODER_FOUND NO) 31 | endif() 32 | 33 | set(AOM_PROCESS_LIBS AOM_LIBRARY) 34 | set(AOM_PROCESS_INCLUDES AOM_INCLUDE_DIR) 35 | libfind_process(AOM) 36 | 37 | include(FindPackageHandleStandardArgs) 38 | find_package_handle_standard_args(AOM 39 | REQUIRED_VARS 40 | AOM_INCLUDE_DIR 41 | AOM_LIBRARIES 42 | ) 43 | -------------------------------------------------------------------------------- /cmake/modules/FindBrotli.cmake: -------------------------------------------------------------------------------- 1 | include(FindPackageHandleStandardArgs) 2 | 3 | find_path(BROTLI_DEC_INCLUDE_DIR "brotli/decode.h") 4 | find_path(BROTLI_ENC_INCLUDE_DIR "brotli/encode.h") 5 | 6 | find_library(BROTLI_COMMON_LIB NAMES brotlicommon) 7 | find_library(BROTLI_DEC_LIB NAMES brotlidec) 8 | find_library(BROTLI_ENC_LIB NAMES brotlienc) 9 | 10 | find_package_handle_standard_args(Brotli 11 | FOUND_VAR 12 | Brotli_FOUND 13 | REQUIRED_VARS 14 | BROTLI_COMMON_LIB 15 | BROTLI_DEC_INCLUDE_DIR 16 | BROTLI_DEC_LIB 17 | BROTLI_ENC_INCLUDE_DIR 18 | BROTLI_ENC_LIB 19 | FAIL_MESSAGE 20 | "Did not find Brotli" 21 | ) 22 | 23 | 24 | set(HAVE_BROTLI ${Brotli_FOUND}) 25 | set(BROTLI_INCLUDE_DIRS ${BROTLI_DEC_INCLUDE_DIR} ${BROTLI_ENC_INCLUDE_DIR}) 26 | set(BROTLI_LIBS "${BROTLICOMMON_LIBRARY}" "${BROTLI_DEC_LIB}" "${BROTLI_ENC_LIB}") -------------------------------------------------------------------------------- /cmake/modules/FindDAV1D.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(DAV1D_PKGCONF dav1d) 3 | 4 | find_path(DAV1D_INCLUDE_DIR 5 | NAMES dav1d/dav1d.h 6 | HINTS ${DAV1D_PKGCONF_INCLUDE_DIRS} ${DAV1D_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES DAV1D 8 | ) 9 | 10 | find_library(DAV1D_LIBRARY 11 | NAMES libdav1d dav1d 12 | HINTS ${DAV1D_PKGCONF_LIBRARY_DIRS} ${DAV1D_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(DAV1D_PROCESS_LIBS DAV1D_LIBRARY) 16 | set(DAV1D_PROCESS_INCLUDES DAV1D_INCLUDE_DIR) 17 | libfind_process(DAV1D) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(DAV1D 21 | REQUIRED_VARS 22 | DAV1D_INCLUDE_DIR 23 | DAV1D_LIBRARIES 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/modules/FindLIBDE265.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(LIBDE265_PKGCONF libde265) 3 | 4 | find_path(LIBDE265_INCLUDE_DIR 5 | NAMES libde265/de265.h 6 | HINTS ${LIBDE265_PKGCONF_INCLUDE_DIRS} ${LIBDE265_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES DE265 8 | ) 9 | 10 | find_library(LIBDE265_LIBRARY 11 | NAMES libde265 de265 12 | HINTS ${LIBDE265_PKGCONF_LIBRARY_DIRS} ${LIBDE265_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(LIBDE265_PROCESS_LIBS ${LIBDE265_LIBRARY}) 16 | set(LIBDE265_PROCESS_INCLUDES ${LIBDE265_INCLUDE_DIR}) 17 | libfind_process(LIBDE265) 18 | 19 | if(LIBDE265_INCLUDE_DIR) 20 | set(libde265_config_file "${LIBDE265_INCLUDE_DIR}/libde265/de265-version.h") 21 | if(EXISTS ${libde265_config_file}) 22 | file(STRINGS 23 | ${libde265_config_file} 24 | TMP 25 | REGEX "#define LIBDE265_VERSION .*$") 26 | string(REGEX REPLACE "#define LIBDE265_VERSION" "" TMP ${TMP}) 27 | string(REGEX MATCHALL "[0-9.]+" LIBDE265_VERSION ${TMP}) 28 | endif() 29 | endif() 30 | 31 | include(FindPackageHandleStandardArgs) 32 | find_package_handle_standard_args(LIBDE265 33 | REQUIRED_VARS 34 | LIBDE265_INCLUDE_DIRS 35 | LIBDE265_LIBRARIES 36 | VERSION_VAR 37 | LIBDE265_VERSION 38 | ) 39 | -------------------------------------------------------------------------------- /cmake/modules/FindOPENJPH.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(OPENJPH_PKGCONF openjph) 3 | 4 | find_path(OPENJPH_INCLUDE_DIR 5 | NAMES openjph/ojph_version.h 6 | HINTS ${OPENJPH_PKGCONF_INCLUDE_DIRS} ${OPENJPH_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES OPENJPH 8 | ) 9 | 10 | find_library(OPENJPH_LIBRARY 11 | NAMES libopenjph openjph 12 | HINTS ${OPENJPH_PKGCONF_LIBRARY_DIRS} ${OPENJPH_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(OPENJPH_PROCESS_LIBS OPENJPH_LIBRARY) 16 | set(OPENJPH_PROCESS_INCLUDES OPENJPH_INCLUDE_DIR) 17 | libfind_process(OPENJPH) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(OPENJPH 21 | REQUIRED_VARS 22 | OPENJPH_INCLUDE_DIR 23 | OPENJPH_LIBRARY 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/modules/FindOpenH264.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | include(CheckSymbolExists) 3 | 4 | libfind_pkg_check_modules(OpenH264_PKGCONF openh264) 5 | 6 | find_path(OpenH264_INCLUDE_DIR 7 | NAMES wels/codec_api.h 8 | HINTS ${OpenH264_PKGCONF_INCLUDE_DIRS} ${OpenH264_PKGCONF_INCLUDEDIR} 9 | PATH_SUFFIXES OpenH264 10 | ) 11 | 12 | find_library(OpenH264_LIBRARY 13 | NAMES libopenh264 openh264 14 | HINTS ${OpenH264_PKGCONF_LIBRARY_DIRS} ${OpenH264_PKGCONF_LIBDIR} 15 | ) 16 | 17 | set(OpenH264_PROCESS_LIBS OpenH264_LIBRARY) 18 | set(OpenH264_PROCESS_INCLUDES OpenH264_INCLUDE_DIR) 19 | libfind_process(OpenH264) 20 | 21 | include(FindPackageHandleStandardArgs) 22 | find_package_handle_standard_args(OpenH264 23 | REQUIRED_VARS 24 | OpenH264_INCLUDE_DIR 25 | OpenH264_LIBRARIES 26 | ) 27 | -------------------------------------------------------------------------------- /cmake/modules/FindRAV1E.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(RAV1E_PKGCONF rav1e) 3 | 4 | find_path(RAV1E_INCLUDE_DIR 5 | NAMES rav1e.h 6 | HINTS ${RAV1E_PKGCONF_INCLUDE_DIRS} ${RAV1E_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES RAV1E rav1e 8 | ) 9 | 10 | find_library(RAV1E_LIBRARY 11 | NAMES librav1e rav1e rav1e.dll 12 | HINTS ${RAV1E_PKGCONF_LIBRARY_DIRS} ${RAV1E_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(RAV1E_PROCESS_LIBS RAV1E_LIBRARY) 16 | set(RAV1E_PROCESS_INCLUDES RAV1E_INCLUDE_DIR) 17 | libfind_process(RAV1E) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(RAV1E 21 | REQUIRED_VARS 22 | RAV1E_INCLUDE_DIR 23 | RAV1E_LIBRARIES 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/modules/FindSvtEnc.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(SvtEnc_PKGCONF SvtAv1Enc) 3 | 4 | find_path(SvtEnc_INCLUDE_DIR 5 | NAMES svt-av1/EbSvtAv1Enc.h 6 | HINTS ${SvtEnc_PKGCONF_INCLUDE_DIRS} ${SvtEnc_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES SvtEnc 8 | ) 9 | 10 | find_library(SvtEnc_LIBRARY 11 | NAMES SvtAv1Enc libSvtAv1Enc 12 | HINTS ${SvtEnc_PKGCONF_LIBRARY_DIRS} ${SvtEnc_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(SvtEnc_PROCESS_LIBS SvtEnc_LIBRARY) 16 | set(SvtEnc_PROCESS_INCLUDES SvtEnc_INCLUDE_DIR) 17 | libfind_process(SvtEnc) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(SvtEnc 21 | REQUIRED_VARS 22 | SvtEnc_INCLUDE_DIR 23 | SvtEnc_LIBRARIES 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/modules/FindUVG266.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(UVG266_PKGCONF uvg266) 3 | 4 | find_path(UVG266_INCLUDE_DIR 5 | NAMES uvg266.h 6 | HINTS ${UVG266_PKGCONF_INCLUDE_DIRS} ${UVG266_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES UVG266 uvg266 8 | ) 9 | 10 | find_library(UVG266_LIBRARY 11 | NAMES libuvg266 uvg266 uvg266.dll 12 | HINTS ${UVG266_PKGCONF_LIBRARY_DIRS} ${UVG266_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(UVG266_PROCESS_LIBS UVG266_LIBRARY) 16 | set(UVG266_PROCESS_INCLUDES UVG266_INCLUDE_DIR) 17 | libfind_process(UVG266) 18 | 19 | include(FindPackageHandleStandardArgs) 20 | find_package_handle_standard_args(UVG266 21 | REQUIRED_VARS 22 | UVG266_INCLUDE_DIR 23 | UVG266_LIBRARIES 24 | ) 25 | -------------------------------------------------------------------------------- /cmake/modules/FindX265.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | libfind_pkg_check_modules(X265_PKGCONF x265) 3 | 4 | find_path(X265_INCLUDE_DIR 5 | NAMES x265.h 6 | HINTS ${X265_PKGCONF_INCLUDE_DIRS} ${X265_PKGCONF_INCLUDEDIR} 7 | PATH_SUFFIXES X265 8 | ) 9 | 10 | find_library(X265_LIBRARY 11 | NAMES libx265 x265 12 | HINTS ${X265_PKGCONF_LIBRARY_DIRS} ${X265_PKGCONF_LIBDIR} 13 | ) 14 | 15 | set(X265_PROCESS_LIBS X265_LIBRARY) 16 | set(X265_PROCESS_INCLUDES X265_INCLUDE_DIR) 17 | libfind_process(X265) 18 | 19 | if(X265_INCLUDE_DIR) 20 | set(x265_config_file "${X265_INCLUDE_DIR}/x265_config.h") 21 | if(EXISTS ${x265_config_file}) 22 | file(STRINGS 23 | ${x265_config_file} 24 | TMP 25 | REGEX "#define X265_BUILD .*$") 26 | string(REGEX REPLACE "#define X265_BUILD" "" TMP ${TMP}) 27 | string(REGEX MATCHALL "[0-9.]+" X265_BUILD ${TMP}) 28 | endif() 29 | endif() 30 | 31 | include(FindPackageHandleStandardArgs) 32 | find_package_handle_standard_args(X265 33 | REQUIRED_VARS 34 | X265_INCLUDE_DIR 35 | X265_LIBRARIES 36 | VERSION_VAR 37 | X265_BUILD 38 | ) 39 | -------------------------------------------------------------------------------- /cmake/modules/Findkvazaar.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | include(CheckStructHasMember) 3 | 4 | libfind_pkg_check_modules(KVAZAAR_PKGCONF kvazaar) 5 | 6 | find_path(KVAZAAR_INCLUDE_DIR 7 | NAMES kvazaar.h 8 | HINTS ${KVAZAAR_PKGCONF_INCLUDE_DIRS} ${KVAZAAR_PKGCONF_INCLUDEDIR} 9 | PATH_SUFFIXES KVAZAAR kvazaar 10 | ) 11 | 12 | find_library(KVAZAAR_LIBRARY 13 | NAMES libkvazaar kvazaar kvazaar.dll 14 | HINTS ${KVAZAAR_PKGCONF_LIBRARY_DIRS} ${KVAZAAR_PKGCONF_LIBDIR} 15 | ) 16 | 17 | set(KVAZAAR_PROCESS_LIBS KVAZAAR_LIBRARY) 18 | set(KVAZAAR_PROCESS_INCLUDES KVAZAAR_INCLUDE_DIR) 19 | libfind_process(KVAZAAR) 20 | 21 | set(CMAKE_REQUIRED_INCLUDES ${KVAZAAR_INCLUDE_DIR}) 22 | CHECK_STRUCT_HAS_MEMBER("struct kvz_config" enable_logging_output kvazaar.h 23 | HAVE_KVAZAAR_ENABLE_LOGGING LANGUAGE CXX) 24 | unset(CMAKE_REQUIRED_INCLUDES) 25 | 26 | include(FindPackageHandleStandardArgs) 27 | find_package_handle_standard_args(kvazaar 28 | REQUIRED_VARS 29 | KVAZAAR_INCLUDE_DIR 30 | KVAZAAR_LIBRARIES 31 | ) 32 | -------------------------------------------------------------------------------- /cmake/modules/Findlibsharpyuv.cmake: -------------------------------------------------------------------------------- 1 | include(LibFindMacros) 2 | 3 | libfind_pkg_check_modules(LIBSHARPYUV_PKGCONF libsharpyuv) 4 | 5 | find_path(LIBSHARPYUV_INCLUDE_DIR 6 | NAMES sharpyuv/sharpyuv.h 7 | HINTS ${LIBSHARPYUV_PKGCONF_INCLUDE_DIRS} ${LIBSHARPYUV_PKGCONF_INCLUDEDIR} 8 | PATH_SUFFIXES LIBSHARPYUV 9 | ) 10 | 11 | find_library(LIBSHARPYUV_LIBRARY 12 | NAMES sharpyuv 13 | HINTS ${LIBSHARPYUV_PKGCONF_LIBRARY_DIRS} ${LIBSHARPYUV_PKGCONF_LIBDIR} 14 | ) 15 | 16 | set(LIBSHARPYUV_PROCESS_LIBS LIBSHARPYUV_LIBRARY) 17 | set(LIBSHARPYUV_PROCESS_INCLUDES LIBSHARPYUV_INCLUDE_DIR) 18 | libfind_process(LIBSHARPYUV) 19 | 20 | include(FindPackageHandleStandardArgs) 21 | find_package_handle_standard_args(libsharpyuv 22 | REQUIRED_VARS 23 | LIBSHARPYUV_INCLUDE_DIR 24 | LIBSHARPYUV_LIBRARIES 25 | ) 26 | -------------------------------------------------------------------------------- /examples/COPYING: -------------------------------------------------------------------------------- 1 | 2 | MIT License 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /examples/benchmark.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2022 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | 22 | #ifndef LIBHEIF_BENCHMARK_H 23 | #define LIBHEIF_BENCHMARK_H 24 | 25 | #include 26 | #include 27 | 28 | struct heif_image; 29 | 30 | double compute_psnr(heif_image* original_image, const std::string& encoded_file); 31 | 32 | #endif //LIBHEIF_BENCHMARK_H 33 | -------------------------------------------------------------------------------- /examples/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif example application "heif". 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_COMMON_H 28 | #define LIBHEIF_COMMON_H 29 | 30 | #include 31 | #include 32 | 33 | namespace heif_examples { 34 | // Note: the same function is also exists in common_utils.h, but is not in the public API. 35 | std::string fourcc_to_string(uint32_t fourcc); 36 | 37 | void show_version(); 38 | 39 | void list_all_decoders(); 40 | 41 | void list_decoders(heif_compression_format format); 42 | 43 | // returns 0 on success, or program exit code in case of warning/error 44 | int check_for_valid_input_HEIF_file(const std::string& input_filename); 45 | } 46 | 47 | #endif //LIBHEIF_COMMON_H 48 | -------------------------------------------------------------------------------- /examples/example.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/examples/example.avif -------------------------------------------------------------------------------- /examples/example.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/examples/example.heic -------------------------------------------------------------------------------- /examples/heif-dec.1: -------------------------------------------------------------------------------- 1 | .TH HEIF-CONVERT 1 2 | .SH NAME 3 | heif-dec \- decode HEIC/HEIF image 4 | .SH SYNOPSIS 5 | .B heif-dec 6 | [\fB\-q\fR \fIQUALITY\fR] 7 | .IR filename 8 | .IR output[.jpg|.png|.y4m] 9 | .SH DESCRIPTION 10 | .B heif-dec 11 | Convert HEIC/HEIF image to a different image format. 12 | .SH OPTIONS 13 | .TP 14 | .BR \-q\fR\ \fIQUALITY\fR 15 | Defines quality level between 0 and 100 for the generated output file. Only used for JPEG. 16 | .SH EXIT STATUS 17 | .PP 18 | \fB0\fR 19 | .RS 4 20 | Success 21 | .RE 22 | .PP 23 | \fB1\fR 24 | .RS 4 25 | Failure (syntax or usage error; error while loading, converting or writing image). 26 | .RE 27 | .SH NOTES 28 | The available output formats depend on the libraries that were available at 29 | compile time. Supported are JPEG, PNG and Y4M, the file type is determined based 30 | on the extension of the output file. 31 | .SH BUGS 32 | Please reports bugs or issues at https://github.com/strukturag/libheif 33 | .SH AUTHORS 34 | Joachim Bauch, struktur AG 35 | .br 36 | Dirk Farin, struktur AG 37 | .SH COPYRIGHT 38 | Copyright \[co] 2017 struktur AG 39 | -------------------------------------------------------------------------------- /examples/heif-info.1: -------------------------------------------------------------------------------- 1 | .TH HEIF-INFO 1 2 | .SH NAME 3 | heif-info \- show information on HEIC/HEIF file 4 | .SH SYNOPSIS 5 | .B heif-info 6 | [\fB\-d\fR|\fB--dump-boxes\fR] 7 | [\fB\-h\fR|\fB--help\fR] 8 | [\fB\-v\fR|\fB--version\fR] 9 | .IR filename 10 | .SH DESCRIPTION 11 | .B heif-info 12 | Show information on HEIC/HEIF file. 13 | .SH OPTIONS 14 | .TP 15 | .BR \-d ", " \-\-dump-boxes\fR 16 | Show a low-level dump of all MP4 file boxes. 17 | .TP 18 | .BR \-h ", " \-\-help\fR 19 | Show help. A filename is not required or used. 20 | .TP 21 | .BR \-v ", " \-\-version\fR 22 | Show version information for the tool, library version, and the plugin path. A filename is not required or used. 23 | .SH EXIT STATUS 24 | .PP 25 | \fB0\fR 26 | .RS 4 27 | Success 28 | .RE 29 | .PP 30 | \fB1\fR 31 | .RS 4 32 | Failure (syntax or usage error; error while loading image). 33 | .RE 34 | .SH BUGS 35 | Please reports bugs or issues at https://github.com/strukturag/libheif 36 | .SH AUTHORS 37 | Dirk Farin, struktur AG 38 | .SH COPYRIGHT 39 | Copyright \[co] 2017 struktur AG 40 | -------------------------------------------------------------------------------- /examples/heif-thumbnailer.1: -------------------------------------------------------------------------------- 1 | .TH HEIF-THUMBNAILER 1 2 | .SH NAME 3 | heif-thumbnailer \- create thumbnails from HEIC/HEIF files 4 | .SH SYNOPSIS 5 | .B heif-thumbnailer 6 | [\fB\-s\fR \fISIZE\fR] 7 | .IR filename 8 | .IR output 9 | .SH DESCRIPTION 10 | .B heif-thumbnailer 11 | Create thumbnail images from HEIC/HEIF files that can be used for example by Nautilus. 12 | .SH OPTIONS 13 | .TP 14 | .BR \-s\fR\ \fISIZE\fR 15 | Defines the maximum width and height of the thumbnail to generate. 16 | Default is 512 pixel. 17 | .SH EXIT STATUS 18 | .PP 19 | \fB0\fR 20 | .RS 4 21 | Success 22 | .RE 23 | .PP 24 | \fB1\fR 25 | .RS 4 26 | Failure (syntax or usage error; error while loading, converting or writing image). 27 | .RE 28 | .SH BUGS 29 | Please reports bugs or issues at https://github.com/strukturag/libheif 30 | .SH AUTHORS 31 | Dirk Farin, struktur AG 32 | .SH COPYRIGHT 33 | Copyright \[co] 2018 struktur AG 34 | -------------------------------------------------------------------------------- /examples/test_c_api.c: -------------------------------------------------------------------------------- 1 | /* 2 | Very simple test whether the header file compiler with a plain C compiler 3 | This file is part of libheif. It performs test calculations for CI checks. 4 | 5 | MIT License 6 | 7 | Copyright (c) 2018 Dirk Farin 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | */ 27 | 28 | 29 | #include "libheif/heif.h" 30 | #include "libheif/heif_version.h" 31 | #include "libheif/heif_plugin.h" 32 | 33 | int main() 34 | { 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /fuzzing/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(${libheif_BINARY_DIR} ${libheif_SOURCE_DIR}/libheif ${libheif_SOURCE_DIR}/libheif/api) 2 | 3 | 4 | add_executable(box_fuzzer box_fuzzer.cc) 5 | target_link_libraries(box_fuzzer PRIVATE heif) 6 | 7 | add_executable(color_conversion_fuzzer color_conversion_fuzzer.cc) 8 | target_link_libraries(color_conversion_fuzzer PRIVATE heif) 9 | 10 | add_executable(encoder_fuzzer encoder_fuzzer.cc) 11 | target_link_libraries(encoder_fuzzer PRIVATE heif) 12 | 13 | add_executable(file_fuzzer file_fuzzer.cc) 14 | target_link_libraries(file_fuzzer PRIVATE heif) 15 | -------------------------------------------------------------------------------- /fuzzing/box_fuzzer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 struktur AG, Joachim Bauch 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #include 22 | 23 | #include "box.h" 24 | #include "bitstream.h" 25 | #include "logging.h" 26 | 27 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) 28 | { 29 | auto reader = std::make_shared(data, size, false); 30 | 31 | BitstreamRange range(reader, size); 32 | for (;;) { 33 | std::shared_ptr box; 34 | Error error = Box::read(range, &box, heif_get_global_security_limits()); 35 | if (error != Error::Ok || range.error()) { 36 | break; 37 | } 38 | 39 | box->get_type(); 40 | box->get_type_string(); 41 | Indent indent; 42 | box->dump(indent); 43 | } 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /fuzzing/data/corpus/clap-overflow-divide-zero.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clap-overflow-divide-zero.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-color-conversion-fuzzer-6275694804467712: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-color-conversion-fuzzer-6275694804467712 -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-4616081830051840.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-4616081830051840.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5120279175102464.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5120279175102464.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5643900194127872.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5643900194127872.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5651556035198976.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5651556035198976.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5662360964956160.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5662360964956160.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5671864958976000.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5671864958976000.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5686319331672064.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5686319331672064.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5718632116518912.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5718632116518912.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5720856641142784.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5720856641142784.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5724458239655936.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5724458239655936.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5732616832024576.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5732616832024576.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5752063708495872.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5752063708495872.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5757633845264384.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-5757633845264384.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-6045213633282048.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/clusterfuzz-testcase-minimized-file-fuzzer-6045213633282048.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/colors-no-alpha-thumbnail.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/colors-no-alpha-thumbnail.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/colors-no-alpha.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/colors-no-alpha.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/colors-with-alpha-thumbnail.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/colors-with-alpha-thumbnail.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/colors-with-alpha.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/colors-with-alpha.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/crash-20ca2625096a205937b809a7841e7f019f0b2dc6.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/crash-20ca2625096a205937b809a7841e7f019f0b2dc6.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_138.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_138.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_15.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_15.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_20.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_20.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_367_1.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_367_1.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_367_2.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_367_2.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_44.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_44.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_45.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_45.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_46_1.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_46_1.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_46_2.heic: -------------------------------------------------------------------------------- 1 | iprpiprp -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_47.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_47.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_48.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_48.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_49.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_49.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/github_50.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/github_50.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/hbo_heif_context.h_126_1.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/hbo_heif_context.h_126_1.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/j2k-siz-segment-undersized.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/j2k-siz-segment-undersized.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/region-mask-missing-refs.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/region-mask-missing-refs.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/rgb_generic_compressed_brotli.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/rgb_generic_compressed_brotli.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/rgb_generic_compressed_defl.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/rgb_generic_compressed_defl.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/rgb_generic_compressed_tile_deflate.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/rgb_generic_compressed_tile_deflate.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/rgb_generic_compressed_zlib.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/rgb_generic_compressed_zlib.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/rgb_generic_compressed_zlib_rows.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/rgb_generic_compressed_zlib_rows.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/rgb_generic_compressed_zlib_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/rgb_generic_compressed_zlib_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uaf_heif_context.h_117_1.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uaf_heif_context.h_117_1.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_ABGR.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_ABGR.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_ABGR_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_ABGR_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_B16R16G16.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_B16R16G16.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_B16R16G16_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_B16R16G16_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_M.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_M.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_M_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_M_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_R5G6B5_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_R5G6B5_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_R7+1G7+1B7+1_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_R7+1G7+1B7+1_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_R7G7+1B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_R7G7+1B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_R7G7B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_R7G7B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_RGB.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_RGB.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_RGB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_RGB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_RGB_tiled_row_tile_align.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_RGB_tiled_row_tile_align.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_RGxB.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_RGxB.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_RGxB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_RGxB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_VUY_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_VUY_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_VUY_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_VUY_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_Y16U16V16_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_Y16U16V16_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_Y16U16V16_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_Y16U16V16_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_YUV_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_YUV_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_YUV_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_YUV_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_YUV_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_YUV_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_YVU_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_YVU_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_comp_YVU_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_comp_YVU_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_VUY_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_VUY_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_VUY_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_VUY_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_Y16U16V16_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_Y16U16V16_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_Y16U16V16_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_Y16U16V16_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_YUV_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_YUV_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_YUV_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_YUV_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_YVU_420.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_YVU_420.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_mix_YVU_422.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_mix_YVU_422.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_ABGR.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_ABGR.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_ABGR_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_ABGR_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_B16R16G16.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_B16R16G16.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_B16R16G16_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_B16R16G16_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_M.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_M.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_M_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_M_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R5G6B5_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R5G6B5_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R7+1G7+1B7+1_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R7+1G7+1B7+1_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R7G7+1B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R7G7+1B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R7G7B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R7G7B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R8G8B8A8_bsz0_psz10_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R8G8B8A8_bsz0_psz10_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R8G8B8A8_bsz0_psz5_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R8G8B8A8_bsz0_psz5_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R8G8B8_bsz0_psz10_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R8G8B8_bsz0_psz10_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_R8G8B8_bsz0_psz5_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_R8G8B8_bsz0_psz5_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_RGB.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_RGB.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_RGB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_RGB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_RGB_tiled_row_tile_align.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_RGB_tiled_row_tile_align.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_RGxB.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_RGxB.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_RGxB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_RGxB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_pix_YUV_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_pix_YUV_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_ABGR.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_ABGR.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_ABGR_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_ABGR_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_B16R16G16.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_B16R16G16.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_B16R16G16_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_B16R16G16_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_M.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_M.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_M_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_M_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_R5G6B5_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_R5G6B5_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_R7+1G7+1B7+1_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_R7+1G7+1B7+1_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_R7G7+1B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_R7G7+1B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_R7G7B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_R7G7B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_RGB.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_RGB.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_RGB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_RGB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_RGB_tiled_row_tile_align.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_RGB_tiled_row_tile_align.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_RGxB.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_RGxB.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_RGxB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_RGxB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_row_YUV_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_row_YUV_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_ABGR_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_ABGR_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_B16R16G16_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_B16R16G16_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_M_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_M_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_R5G6B5_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_R5G6B5_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_R7+1G7+1B7+1_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_R7+1G7+1B7+1_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_R7G7+1B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_R7G7+1B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_R7G7B7_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_R7G7B7_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_RGB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_RGB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_RGB_tiled_row_tile_align.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_RGB_tiled_row_tile_align.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_RGxB_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_RGxB_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/corpus/uncompressed_tile_YUV_tiled.heic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/fuzzing/data/corpus/uncompressed_tile_YUV_tiled.heic -------------------------------------------------------------------------------- /fuzzing/data/dictionary.txt: -------------------------------------------------------------------------------- 1 | "auxC" 2 | "auxl" 3 | "av1C" 4 | "avif" 5 | "cdsc" 6 | "clap" 7 | "colr" 8 | "dimg" 9 | "dinf" 10 | "dref" 11 | "ftyp" 12 | "grpl" 13 | "hdlr" 14 | "heic" 15 | "heix" 16 | "hevc" 17 | "hevx" 18 | "heim" 19 | "heis" 20 | "hevm" 21 | "hevs" 22 | "hvcC" 23 | "idat" 24 | "iinf" 25 | "iloc" 26 | "imir" 27 | "infe" 28 | "ipco" 29 | "ipma" 30 | "iprp" 31 | "iref" 32 | "irot" 33 | "ispe" 34 | "mdat" 35 | "meta" 36 | "mif1" 37 | "mime" 38 | "msf1" 39 | "nclx" 40 | "pict" 41 | "pitm" 42 | "pixi" 43 | "prof" 44 | "rICC" 45 | "thmb" 46 | "uri " 47 | "url " 48 | "uuid" 49 | -------------------------------------------------------------------------------- /gdk-pixbuf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(UNIX OR MINGW) 2 | find_package(PkgConfig) 3 | pkg_check_modules(GDKPIXBUF2 gdk-pixbuf-2.0) 4 | 5 | if(GDKPIXBUF2_FOUND) 6 | execute_process( 7 | COMMAND ${PKG_CONFIG_EXECUTABLE} gdk-pixbuf-2.0 --variable gdk_pixbuf_moduledir 8 | --define-variable=prefix=${CMAKE_INSTALL_PREFIX} OUTPUT_VARIABLE GDKPIXBUF2_MODULE_DIR 9 | OUTPUT_STRIP_TRAILING_WHITESPACE) 10 | 11 | add_library(pixbufloader-heif MODULE pixbufloader-heif.c) 12 | 13 | target_include_directories(pixbufloader-heif PRIVATE ${GDKPIXBUF2_INCLUDE_DIRS} ${libheif_BINARY_DIR} ${libheif_SOURCE_DIR}/libheif/api) 14 | 15 | target_link_directories(pixbufloader-heif PRIVATE ${GDKPIXBUF2_LIBRARY_DIRS}) 16 | 17 | target_link_libraries(pixbufloader-heif PUBLIC ${GDKPIXBUF2_LIBRARIES} heif) 18 | 19 | install(TARGETS pixbufloader-heif DESTINATION ${GDKPIXBUF2_MODULE_DIR}) 20 | endif() 21 | endif() 22 | -------------------------------------------------------------------------------- /gnome/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(TARGET heif-thumbnailer) 2 | install(FILES heif.thumbnailer DESTINATION ${CMAKE_INSTALL_DATADIR}/thumbnailers) 3 | endif() 4 | -------------------------------------------------------------------------------- /gnome/heif.thumbnailer: -------------------------------------------------------------------------------- 1 | [Thumbnailer Entry] 2 | TryExec=heif-thumbnailer 3 | Exec=heif-thumbnailer -s %s %i %o 4 | MimeType=image/heif;image/avif; 5 | -------------------------------------------------------------------------------- /heifio/decoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif example application "heif". 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_DECODER_H 28 | #define LIBHEIF_DECODER_H 29 | 30 | #include "libheif/heif.h" 31 | #include 32 | #include 33 | 34 | struct InputImage 35 | { 36 | std::shared_ptr image; 37 | std::vector xmp; 38 | std::vector exif; 39 | heif_orientation orientation = heif_orientation_normal; 40 | }; 41 | 42 | #endif //LIBHEIF_DECODER_H 43 | -------------------------------------------------------------------------------- /heifio/decoder_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif example application "heif". 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_DECODER_JPEG_H 28 | #define LIBHEIF_DECODER_JPEG_H 29 | 30 | #include "decoder.h" 31 | 32 | LIBHEIF_API 33 | heif_error loadJPEG(const char *filename, InputImage *input_image); 34 | 35 | #endif //LIBHEIF_DECODER_JPEG_H 36 | -------------------------------------------------------------------------------- /heifio/decoder_png.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif example application "heif". 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_DECODER_PNG_H 28 | #define LIBHEIF_DECODER_PNG_H 29 | 30 | #include "decoder.h" 31 | 32 | LIBHEIF_API 33 | heif_error loadPNG(const char* filename, int output_bit_depth, InputImage *input_image); 34 | 35 | #endif //LIBHEIF_DECODER_PNG_H 36 | -------------------------------------------------------------------------------- /heifio/decoder_tiff.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif example application "heif". 3 | 4 | MIT License 5 | 6 | Copyright (c) 2024 Joachim Bauch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_DECODER_TIFF_H 28 | #define LIBHEIF_DECODER_TIFF_H 29 | 30 | #include "decoder.h" 31 | #include "libheif/heif.h" 32 | 33 | LIBHEIF_API 34 | heif_error loadTIFF(const char *filename, InputImage *input_image); 35 | 36 | #endif // LIBHEIF_DECODER_TIFF_H 37 | -------------------------------------------------------------------------------- /heifio/decoder_y4m.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif example application "heif". 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_DECODER_Y4M_H 28 | #define LIBHEIF_DECODER_Y4M_H 29 | 30 | #include "decoder.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | LIBHEIF_API 37 | heif_error loadY4M(const char *filename, InputImage *input_image); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif //LIBHEIF_DECODER_Y4M_H 44 | -------------------------------------------------------------------------------- /heifio/exif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2022 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_EXIF_H 22 | #define LIBHEIF_EXIF_H 23 | 24 | #include 25 | #include 26 | 27 | int read_exif_orientation_tag(const uint8_t* exif, uint32_t size); 28 | 29 | void modify_exif_orientation_tag_if_it_exists(uint8_t* exifData, uint32_t size, uint16_t orientation); 30 | 31 | void overwrite_exif_image_size_if_it_exists(uint8_t* exif, uint32_t size, uint32_t width, uint32_t height); 32 | 33 | #endif //LIBHEIF_EXIF_H 34 | -------------------------------------------------------------------------------- /libheif.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libheif 7 | Description: HEIF image codec. 8 | URL: https://github.com/strukturag/libheif 9 | Version: @PROJECT_VERSION@ 10 | Requires: 11 | Requires.private: @REQUIRES_PRIVATE@ 12 | Libs: -L${libdir} -lheif 13 | Libs.private: @LIBS_PRIVATE@ 14 | Cflags: -I${includedir} 15 | Cflags.private: -DLIBHEIF_STATIC_BUILD 16 | -------------------------------------------------------------------------------- /libheif/api/libheif/heif.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017-2025 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #include "heif.h" 22 | 23 | #if defined(__EMSCRIPTEN__) && !defined(__EMSCRIPTEN_STANDALONE_WASM__) 24 | #include "api_structs.h" 25 | #include "heif_emscripten.h" 26 | #endif 27 | 28 | 29 | #include "error.h" 30 | 31 | const struct heif_error heif_error_success = {heif_error_Ok, heif_suberror_Unspecified, Error::kSuccess}; 32 | -------------------------------------------------------------------------------- /libheif/api/libheif/heif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017-2025 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_HEIF_H 22 | #define LIBHEIF_HEIF_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /libheif/api/libheif/heif_plugin.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #include "heif.h" 22 | #include "heif_plugin.h" // needed to avoid 'unresolved symbols' on Visual Studio compiler 23 | 24 | struct heif_error heif_error_ok = {heif_error_Ok, heif_suberror_Unspecified, "Success"}; 25 | 26 | struct heif_error heif_error_unsupported_parameter = {heif_error_Usage_error, 27 | heif_suberror_Unsupported_parameter, 28 | "Unsupported encoder parameter"}; 29 | 30 | struct heif_error heif_error_invalid_parameter_value = {heif_error_Usage_error, 31 | heif_suberror_Invalid_parameter_value, 32 | "Invalid parameter value"}; 33 | 34 | 35 | -------------------------------------------------------------------------------- /libheif/api/libheif/heif_version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | /* heif_version.h 22 | * 23 | * This file was automatically generated when libheif was built. 24 | * 25 | * DO NOT EDIT THIS FILE. 26 | */ 27 | #ifndef LIBHEIF_HEIF_VERSION_H 28 | #define LIBHEIF_HEIF_VERSION_H 29 | 30 | /* Numeric representation of the version */ 31 | #define LIBHEIF_NUMERIC_VERSION ((@PROJECT_VERSION_MAJOR@<<24) | (@PROJECT_VERSION_MINOR@<<16) | (@PROJECT_VERSION_PATCH@<<8) | 0) 32 | 33 | /* Version string */ 34 | #define LIBHEIF_VERSION "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" 35 | 36 | #define LIBHEIF_PLUGIN_DIRECTORY "@PLUGIN_DIRECTORY@" 37 | 38 | #endif // LIBHEIF_HEIF_VERSION_H 39 | -------------------------------------------------------------------------------- /libheif/brands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2025 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_BRANDS_H 22 | #define LIBHEIF_BRANDS_H 23 | 24 | #include "context.h" 25 | #include "error.h" 26 | 27 | #include 28 | #include 29 | 30 | std::vector compute_compatible_brands(const HeifContext* ctx, heif_brand2* out_main_brand); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libheif/codecs/avc_dec.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #include "avc_dec.h" 22 | #include "avc_boxes.h" 23 | #include "error.h" 24 | #include "context.h" 25 | 26 | #include 27 | 28 | 29 | Result> Decoder_AVC::read_bitstream_configuration_data() const 30 | { 31 | std::vector data; 32 | m_avcC->get_header_nals(data); 33 | 34 | return data; 35 | } 36 | 37 | 38 | int Decoder_AVC::get_luma_bits_per_pixel() const 39 | { 40 | return m_avcC->get_configuration().bit_depth_luma; 41 | } 42 | 43 | 44 | int Decoder_AVC::get_chroma_bits_per_pixel() const 45 | { 46 | return m_avcC->get_configuration().bit_depth_chroma; 47 | } 48 | 49 | 50 | Error Decoder_AVC::get_coded_image_colorspace(heif_colorspace* out_colorspace, heif_chroma* out_chroma) const 51 | { 52 | *out_chroma = m_avcC->get_configuration().chroma_format; 53 | 54 | if (*out_chroma == heif_chroma_monochrome) { 55 | *out_colorspace = heif_colorspace_monochrome; 56 | } 57 | else { 58 | *out_colorspace = heif_colorspace_YCbCr; 59 | } 60 | 61 | return Error::Ok; 62 | } 63 | -------------------------------------------------------------------------------- /libheif/codecs/avc_dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_AVC_DEC_H 22 | #define HEIF_AVC_DEC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "error.h" 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | class Box_avcC; 32 | 33 | 34 | class Decoder_AVC : public Decoder 35 | { 36 | public: 37 | explicit Decoder_AVC(const std::shared_ptr& avcC) : m_avcC(avcC) {} 38 | 39 | heif_compression_format get_compression_format() const override { return heif_compression_AVC; } 40 | 41 | int get_luma_bits_per_pixel() const override; 42 | 43 | int get_chroma_bits_per_pixel() const override; 44 | 45 | Error get_coded_image_colorspace(heif_colorspace*, heif_chroma*) const override; 46 | 47 | Result> read_bitstream_configuration_data() const override; 48 | 49 | private: 50 | const std::shared_ptr m_avcC; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libheif/codecs/avif_dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_AVIF_DEC_H 22 | #define HEIF_AVIF_DEC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "error.h" 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | class Box_av1C; 32 | 33 | 34 | class Decoder_AVIF : public Decoder 35 | { 36 | public: 37 | explicit Decoder_AVIF(const std::shared_ptr& av1C) : m_av1C(av1C) {} 38 | 39 | heif_compression_format get_compression_format() const override { return heif_compression_AV1; } 40 | 41 | int get_luma_bits_per_pixel() const override; 42 | 43 | int get_chroma_bits_per_pixel() const override; 44 | 45 | Error get_coded_image_colorspace(heif_colorspace*, heif_chroma*) const override; 46 | 47 | Result> read_bitstream_configuration_data() const override; 48 | 49 | private: 50 | const std::shared_ptr m_av1C; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libheif/codecs/avif_enc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_ENCODER_AVIF_H 22 | #define HEIF_ENCODER_AVIF_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "codecs/encoder.h" 34 | 35 | 36 | class Encoder_AVIF : public Encoder { 37 | public: 38 | Result encode(const std::shared_ptr& image, 39 | struct heif_encoder* encoder, 40 | const struct heif_encoding_options& options, 41 | enum heif_image_input_class input_class) override; 42 | 43 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libheif/codecs/hevc_dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_HEVC_DEC_H 22 | #define HEIF_HEVC_DEC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | class Box_hvcC; 33 | 34 | 35 | class Decoder_HEVC : public Decoder 36 | { 37 | public: 38 | explicit Decoder_HEVC(const std::shared_ptr& hvcC) : m_hvcC(hvcC) {} 39 | 40 | heif_compression_format get_compression_format() const override { return heif_compression_HEVC; } 41 | 42 | int get_luma_bits_per_pixel() const override; 43 | 44 | int get_chroma_bits_per_pixel() const override; 45 | 46 | Error get_coded_image_colorspace(heif_colorspace*, heif_chroma*) const override; 47 | 48 | Result> read_bitstream_configuration_data() const override; 49 | 50 | private: 51 | const std::shared_ptr m_hvcC; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /libheif/codecs/hevc_enc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_ENCODER_HEVC_H 22 | #define HEIF_ENCODER_HEVC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "codecs/encoder.h" 34 | 35 | 36 | class Encoder_HEVC : public Encoder { 37 | public: 38 | Result encode(const std::shared_ptr& image, 39 | struct heif_encoder* encoder, 40 | const struct heif_encoding_options& options, 41 | enum heif_image_input_class input_class) override; 42 | 43 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libheif/codecs/jpeg2000_dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_JPEG2000_DEC_H 22 | #define HEIF_JPEG2000_DEC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "image-items/jpeg2000.h" 34 | #include 35 | 36 | 37 | class Decoder_JPEG2000 : public Decoder 38 | { 39 | public: 40 | Decoder_JPEG2000(const std::shared_ptr& j2kH) : m_j2kH(j2kH) {} 41 | 42 | heif_compression_format get_compression_format() const override { return heif_compression_JPEG2000; } 43 | 44 | int get_luma_bits_per_pixel() const override; 45 | 46 | int get_chroma_bits_per_pixel() const override; 47 | 48 | Error get_coded_image_colorspace(heif_colorspace*, heif_chroma*) const override; 49 | 50 | Result> read_bitstream_configuration_data() const override; 51 | 52 | private: 53 | const std::shared_ptr m_j2kH; 54 | }; 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /libheif/codecs/jpeg2000_enc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_ENCODER_JPEG2000_H 22 | #define HEIF_ENCODER_JPEG2000_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "codecs/encoder.h" 34 | 35 | 36 | class Encoder_JPEG2000 : public Encoder { 37 | public: 38 | Result encode(const std::shared_ptr& image, 39 | struct heif_encoder* encoder, 40 | const struct heif_encoding_options& options, 41 | enum heif_image_input_class input_class) override; 42 | 43 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 44 | }; 45 | 46 | 47 | class Encoder_HTJ2K : public Encoder_JPEG2000 { 48 | public: 49 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 50 | }; 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libheif/codecs/jpeg_boxes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF JPEG codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_JPEG_BOXES_H 22 | #define LIBHEIF_JPEG_BOXES_H 23 | 24 | #include "box.h" 25 | #include 26 | #include 27 | #include "image-items/image_item.h" 28 | #include 29 | #include "sequences/seq_boxes.h" 30 | 31 | 32 | class Box_jpgC : public Box 33 | { 34 | public: 35 | Box_jpgC() 36 | { 37 | set_short_type(fourcc("jpgC")); 38 | } 39 | 40 | const std::vector& get_data() const { return m_data; } 41 | 42 | void set_data(const std::vector& data) { m_data = data; } 43 | 44 | std::string dump(Indent&) const override; 45 | 46 | Error write(StreamWriter& writer) const override; 47 | 48 | protected: 49 | Error parse(BitstreamRange& range, const heif_security_limits* limits) override; 50 | 51 | private: 52 | std::vector m_data; 53 | }; 54 | 55 | 56 | class Box_mjpg : public Box_VisualSampleEntry 57 | { 58 | public: 59 | Box_mjpg() 60 | { 61 | set_short_type(fourcc("mjpg")); 62 | } 63 | }; 64 | 65 | 66 | #endif // LIBHEIF_JPEG_BOXES_H 67 | -------------------------------------------------------------------------------- /libheif/codecs/jpeg_enc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_ENCODER_JPEG_H 22 | #define HEIF_ENCODER_JPEG_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "codecs/encoder.h" 34 | 35 | 36 | class Encoder_JPEG : public Encoder { 37 | public: 38 | const heif_color_profile_nclx* get_forced_output_nclx() const override; 39 | 40 | Result encode(const std::shared_ptr& image, 41 | struct heif_encoder* encoder, 42 | const struct heif_encoding_options& options, 43 | enum heif_image_input_class input_class) override; 44 | 45 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 46 | }; 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /libheif/codecs/uncompressed/decoder_component_interleave.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef UNCI_DECODER_COMPONENT_INTERLEAVE_H 22 | #define UNCI_DECODER_COMPONENT_INTERLEAVE_H 23 | 24 | #include "decoder_abstract.h" 25 | #include 26 | #include 27 | 28 | 29 | class ComponentInterleaveDecoder : public AbstractDecoder 30 | { 31 | public: 32 | ComponentInterleaveDecoder(uint32_t width, uint32_t height, 33 | std::shared_ptr cmpd, 34 | std::shared_ptr uncC) : 35 | AbstractDecoder(width, height, std::move(cmpd), std::move(uncC)) {} 36 | 37 | Error decode_tile(const DataExtent& dataExtent, 38 | const UncompressedImageCodec::unci_properties& properties, 39 | std::shared_ptr& img, 40 | uint32_t out_x0, uint32_t out_y0, 41 | uint32_t image_width, uint32_t image_height, 42 | uint32_t tile_x, uint32_t tile_y) override; 43 | }; 44 | 45 | #endif // UNCI_DECODER_COMPONENT_INTERLEAVE_H 46 | -------------------------------------------------------------------------------- /libheif/codecs/uncompressed/decoder_mixed_interleave.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef UNCI_DECODER_MIXED_INTERLEAVE_H 22 | #define UNCI_DECODER_MIXED_INTERLEAVE_H 23 | 24 | #include "decoder_abstract.h" 25 | #include 26 | #include 27 | 28 | 29 | class MixedInterleaveDecoder : public AbstractDecoder 30 | { 31 | public: 32 | MixedInterleaveDecoder(uint32_t width, uint32_t height, std::shared_ptr cmpd, std::shared_ptr uncC) : 33 | AbstractDecoder(width, height, std::move(cmpd), std::move(uncC)) {} 34 | 35 | Error decode_tile(const DataExtent& dataExtent, 36 | const UncompressedImageCodec::unci_properties& properties, 37 | std::shared_ptr& img, 38 | uint32_t out_x0, uint32_t out_y0, 39 | uint32_t image_width, uint32_t image_height, 40 | uint32_t tile_x, uint32_t tile_y) override; 41 | 42 | void processTile(UncompressedBitReader& srcBits, uint32_t tile_row, uint32_t tile_column, 43 | uint32_t out_x0, uint32_t out_y0); 44 | }; 45 | 46 | #endif // UNCI_DECODER_MIXED_INTERLEAVE_H 47 | -------------------------------------------------------------------------------- /libheif/codecs/uncompressed/decoder_tile_component_interleave.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef UNCI_DECODER_TILE_COMPONENT_INTERLEAVE_H 22 | #define UNCI_DECODER_TILE_COMPONENT_INTERLEAVE_H 23 | 24 | #include "decoder_abstract.h" 25 | #include 26 | #include 27 | 28 | 29 | class TileComponentInterleaveDecoder : public AbstractDecoder 30 | { 31 | public: 32 | TileComponentInterleaveDecoder(uint32_t width, uint32_t height, 33 | std::shared_ptr cmpd, std::shared_ptr uncC) : 34 | AbstractDecoder(width, height, std::move(cmpd), std::move(uncC)) {} 35 | 36 | Error decode_tile(const DataExtent& dataExtent, 37 | const UncompressedImageCodec::unci_properties& properties, 38 | std::shared_ptr& img, 39 | uint32_t out_x0, uint32_t out_y0, 40 | uint32_t image_width, uint32_t image_height, 41 | uint32_t tile_column, uint32_t tile_row) override; 42 | }; 43 | 44 | #endif // UNCI_DECODER_TILE_COMPONENT_INTERLEAVE_H 45 | -------------------------------------------------------------------------------- /libheif/codecs/uncompressed/unc_enc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2025 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_ENCODER_UNCOMPRESSED_H 22 | #define HEIF_ENCODER_UNCOMPRESSED_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "codecs/encoder.h" 34 | 35 | 36 | class Encoder_uncompressed : public Encoder { 37 | public: 38 | Result encode(const std::shared_ptr& image, 39 | struct heif_encoder* encoder, 40 | const struct heif_encoding_options& options, 41 | enum heif_image_input_class input_class) override; 42 | 43 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libheif/codecs/vvc_dec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_VVC_DEC_H 22 | #define HEIF_VVC_DEC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | class Box_vvcC; 33 | 34 | 35 | class Decoder_VVC : public Decoder 36 | { 37 | public: 38 | explicit Decoder_VVC(const std::shared_ptr& vvcC) : m_vvcC(vvcC) {} 39 | 40 | heif_compression_format get_compression_format() const override { return heif_compression_VVC; } 41 | 42 | int get_luma_bits_per_pixel() const override; 43 | 44 | int get_chroma_bits_per_pixel() const override; 45 | 46 | Error get_coded_image_colorspace(heif_colorspace*, heif_chroma*) const override; 47 | 48 | Result> read_bitstream_configuration_data() const override; 49 | 50 | private: 51 | const std::shared_ptr m_vvcC; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /libheif/codecs/vvc_enc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef HEIF_ENCODER_VVC_H 22 | #define HEIF_ENCODER_VVC_H 23 | 24 | #include "libheif/heif.h" 25 | #include "box.h" 26 | #include "error.h" 27 | #include "file.h" 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include "codecs/encoder.h" 34 | 35 | 36 | class Encoder_VVC : public Encoder { 37 | public: 38 | Result encode(const std::shared_ptr& image, 39 | struct heif_encoder* encoder, 40 | const struct heif_encoding_options& options, 41 | enum heif_image_input_class input_class) override; 42 | 43 | std::shared_ptr get_sample_description_box(const CodedImageData&) const override; 44 | }; 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libheif/image-items/jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF JPEG codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_JPEG_H 22 | #define LIBHEIF_JPEG_H 23 | 24 | #include "box.h" 25 | #include 26 | #include 27 | #include "image_item.h" 28 | #include 29 | 30 | 31 | class ImageItem_JPEG : public ImageItem 32 | { 33 | public: 34 | ImageItem_JPEG(HeifContext* ctx, heif_item_id id); 35 | 36 | ImageItem_JPEG(HeifContext* ctx); 37 | 38 | uint32_t get_infe_type() const override { return fourcc("jpeg"); } 39 | 40 | heif_compression_format get_compression_format() const override { return heif_compression_JPEG; } 41 | 42 | 43 | Error on_load_file() override; 44 | 45 | heif_brand2 get_compatible_brand() const override; 46 | 47 | protected: 48 | Result> get_decoder() const override; 49 | 50 | std::shared_ptr get_encoder() const override; 51 | 52 | Result> read_bitstream_configuration_data() const override; 53 | 54 | private: 55 | std::shared_ptr m_decoder; 56 | std::shared_ptr m_encoder; 57 | }; 58 | 59 | #endif // LIBHEIF_JPEG_H 60 | -------------------------------------------------------------------------------- /libheif/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_LOGGING_H 22 | #define LIBHEIF_LOGGING_H 23 | 24 | #include 25 | #include 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | class Indent 35 | { 36 | public: 37 | Indent() = default; 38 | 39 | int get_indent() const { return m_indent; } 40 | 41 | void operator++(int) { m_indent++; } 42 | 43 | void operator--(int) 44 | { 45 | m_indent--; 46 | if (m_indent < 0) m_indent = 0; 47 | } 48 | 49 | std::string get_string() const; 50 | 51 | private: 52 | int m_indent = 0; 53 | }; 54 | 55 | 56 | inline std::ostream& operator<<(std::ostream& ostr, const Indent& indent) 57 | { 58 | ostr << indent.get_string(); 59 | return ostr; 60 | } 61 | 62 | std::string write_raw_data_as_hex(const uint8_t* data, size_t len, 63 | const std::string& firstLineIndent, 64 | const std::string& remainingLinesIndent); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /libheif/mdat_data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_MDAT_DATA_H 22 | #define LIBHEIF_MDAT_DATA_H 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | class MdatData 31 | { 32 | public: 33 | virtual ~MdatData() = default; 34 | 35 | // returns the start position of the appended data 36 | virtual size_t append_data(const std::vector& data) = 0; 37 | 38 | virtual size_t get_data_size() const = 0; 39 | 40 | virtual Error write(StreamWriter&) = 0; 41 | }; 42 | 43 | 44 | class MdatData_Memory : public MdatData 45 | { 46 | public: 47 | size_t append_data(const std::vector& data) override { 48 | size_t startPos = m_data.size(); 49 | m_data.insert(m_data.end(), data.begin(), data.end()); 50 | return startPos; 51 | } 52 | 53 | size_t get_data_size() const override { return m_data.size(); } 54 | 55 | Error write(StreamWriter& writer) override 56 | { 57 | writer.write(m_data); 58 | return Error::Ok; 59 | } 60 | 61 | private: 62 | std::vector m_data; 63 | }; 64 | 65 | #endif //LIBHEIF_MDAT_DATA_H 66 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_aom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_DECODER_AOM_H 22 | #define LIBHEIF_DECODER_AOM_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_aom(); 27 | 28 | #if PLUGIN_AOM_DECODER 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_dav1d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_DECODER_DAV1D_H 22 | #define LIBHEIF_DECODER_DAV1D_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_dav1d(); 27 | 28 | #if PLUGIN_DAV1D 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_ffmpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_HEIF_DECODER_FFMPEG_H 22 | #define LIBHEIF_HEIF_DECODER_FFMPEG_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_ffmpeg(); 27 | 28 | #if PLUGIN_FFMPEG_DECODER 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_DECODER_JPEG_H 22 | #define LIBHEIF_DECODER_JPEG_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_jpeg(); 27 | 28 | #if PLUGIN_JPEG_DECODER 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_libde265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_HEIF_DECODER_DE265_H 22 | #define LIBHEIF_HEIF_DECODER_DE265_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_libde265(); 27 | 28 | #if PLUGIN_LIBDE265 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_openh264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2024 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_DECODER_OPENH264_H 22 | #define LIBHEIF_DECODER_OPENH264_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_openh264(); 27 | 28 | #if PLUGIN_OpenH264_DECODER 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_openjpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenJPEG codec. 3 | * Copyright (c) 2023 Devon Sookhoo 4 | * Copyright (c) 2023 Dirk Farin 5 | * 6 | * This file is part of libheif. 7 | * 8 | * libheif is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as 10 | * published by the Free Software Foundation, either version 3 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * libheif is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with libheif. If not, see . 20 | */ 21 | 22 | #ifndef LIBHEIF_DECODER_OPENJPEG_H 23 | #define LIBHEIF_DECODER_OPENJPEG_H 24 | 25 | #include "common_utils.h" 26 | 27 | const struct heif_decoder_plugin* get_decoder_plugin_openjpeg(); 28 | 29 | 30 | #if PLUGIN_OPENJPEG_DECODER 31 | extern "C" { 32 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 33 | } 34 | #endif 35 | 36 | #endif //LIBHEIF_DECODER_OPENJPEG_H 37 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_uncompressed.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * JPEG codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #include "libheif/heif.h" 22 | #include "libheif/heif_plugin.h" 23 | #include "decoder_uncompressed.h" 24 | 25 | struct uncompressed_decoder 26 | { 27 | }; 28 | 29 | static const int UNCOMPRESSED_PLUGIN_PRIORITY = 100; 30 | 31 | 32 | static const char* uncompressed_plugin_name() 33 | { 34 | return "builtin"; 35 | } 36 | 37 | 38 | static int uncompressed_does_support_format(enum heif_compression_format format) 39 | { 40 | if (format == heif_compression_uncompressed) { 41 | return UNCOMPRESSED_PLUGIN_PRIORITY; 42 | } 43 | else { 44 | return 0; 45 | } 46 | } 47 | 48 | 49 | 50 | 51 | static const struct heif_decoder_plugin decoder_uncompressed 52 | { 53 | 3, 54 | uncompressed_plugin_name, 55 | nullptr, 56 | nullptr, 57 | uncompressed_does_support_format, 58 | nullptr, 59 | nullptr, 60 | nullptr, 61 | nullptr, 62 | nullptr, 63 | "uncompressed" 64 | }; 65 | 66 | 67 | const struct heif_decoder_plugin* get_decoder_plugin_uncompressed() 68 | { 69 | return &decoder_uncompressed; 70 | } 71 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_uncompressed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Dummy decoder plugin for the 'uncompressed' codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_DECODER_UNCOMPRESSED_H 22 | #define LIBHEIF_DECODER_UNCOMPRESSED_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_uncompressed(); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libheif/plugins/decoder_vvdec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_DECODER_VVDEC_H 22 | #define LIBHEIF_DECODER_VVDEC_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_decoder_plugin* get_decoder_plugin_vvdec(); 27 | 28 | #if PLUGIN_VVDEC 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_aom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_AOM_H 22 | #define LIBHEIF_ENCODER_AOM_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_encoder_plugin* get_encoder_plugin_aom(); 27 | 28 | #if PLUGIN_AOM_ENCODER 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_JPEG_H 22 | #define LIBHEIF_ENCODER_JPEG_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_encoder_plugin* get_encoder_plugin_jpeg(); 27 | 28 | #if PLUGIN_JPEG_ENCODER 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_kvazaar.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_KVAZAAR_H 22 | #define LIBHEIF_ENCODER_KVAZAAR_H 23 | 24 | #include "common_utils.h" 25 | 26 | /* TODO: check whether this is also the case with kvazaar. 27 | * 28 | * Image sizes in HEVC: since HEVC does not allow for odd image dimensions when 29 | using chroma 4:2:0, our strategy is as follows. 30 | 31 | - Images with odd dimensions are extended with an extra row/column which 32 | contains a copy of the border. 33 | - The HEVC image size generated by kvazaar is rounded up to the CTU size (?) 34 | and the conformance window has to be respected. 35 | - We add an additional crop transform to remove the extra row/column. 36 | */ 37 | 38 | 39 | const struct heif_encoder_plugin* get_encoder_plugin_kvazaar(); 40 | 41 | #if PLUGIN_KVAZAAR 42 | extern "C" { 43 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_mask.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_MASK_H 22 | #define LIBHEIF_ENCODER_MASK_H 23 | 24 | #include "common_utils.h" 25 | 26 | // This is a dummy module. It does not actually do anything except parameter parsing. 27 | // The actual codec is included in the library. 28 | 29 | struct encoder_struct_mask 30 | { 31 | }; 32 | 33 | 34 | const struct heif_encoder_plugin* get_encoder_plugin_mask(); 35 | 36 | #endif //LIBHEIF_ENCODER_MASK_H 37 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_openjpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenJPEG codec. 3 | * Copyright (c) 2023 Devon Sookhoo 4 | * Copyright (c) 2023 Dirk Farin 5 | * 6 | * This file is part of libheif. 7 | * 8 | * libheif is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as 10 | * published by the Free Software Foundation, either version 3 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * libheif is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with libheif. If not, see . 20 | */ 21 | 22 | #ifndef LIBHEIF_ENCODER_OPENJPEG_H 23 | #define LIBHEIF_ENCODER_OPENJPEG_H 24 | 25 | #include "common_utils.h" 26 | 27 | 28 | const struct heif_encoder_plugin* get_encoder_plugin_openjpeg(); 29 | 30 | #if PLUGIN_OPENJPEG_ENCODER 31 | extern "C" { 32 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_openjph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OpenJPH codec. 3 | * Copyright (c) 2023 Devon Sookhoo 4 | * Copyright (c) 2023 Dirk Farin 5 | * Copyright (C) 2024 Brad Hards 6 | * 7 | * This file is part of libheif. 8 | * 9 | * libheif is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU Lesser General Public License as 11 | * published by the Free Software Foundation, either version 3 of 12 | * the License, or (at your option) any later version. 13 | * 14 | * libheif is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public License 20 | * along with libheif. If not, see . 21 | */ 22 | 23 | #ifndef LIBHEIF_ENCODER_OPENJPH_H 24 | #define LIBHEIF_ENCODER_OPENJPH_H 25 | 26 | #include "common_utils.h" 27 | 28 | 29 | const struct heif_encoder_plugin* get_encoder_plugin_openjph(); 30 | 31 | #if PLUGIN_OPENJPH_ENCODER 32 | extern "C" { 33 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_rav1e.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_RAV1E_H 22 | #define LIBHEIF_ENCODER_RAV1E_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_encoder_plugin* get_encoder_plugin_rav1e(); 27 | 28 | #if PLUGIN_RAV1E 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_svt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2022 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_SVT_H 22 | #define LIBHEIF_ENCODER_SVT_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_encoder_plugin* get_encoder_plugin_svt(); 27 | 28 | #if PLUGIN_SvtEnc 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_uncompressed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_UNCOMPRESSED_H 22 | #define LIBHEIF_ENCODER_UNCOMPRESSED_H 23 | 24 | #include "common_utils.h" 25 | 26 | // This is a dummy module. It does not actually do anything except parameter parsing. 27 | // The actual codec is included in the library. 28 | 29 | struct encoder_struct_uncompressed 30 | { 31 | // --- parameters 32 | 33 | enum class InterleaveFormat 34 | { 35 | Planar, Row, Pixel 36 | }; 37 | 38 | InterleaveFormat interleaveFormat = InterleaveFormat::Planar; 39 | 40 | // --- output 41 | 42 | //bool data_read = false; 43 | //std::vector compressedData; 44 | }; 45 | 46 | 47 | const struct heif_encoder_plugin* get_encoder_plugin_uncompressed(); 48 | 49 | #if 0 // PLUGIN_UNCOMPRESSED 50 | extern "C" { 51 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 52 | } 53 | #endif 54 | 55 | #endif //LIBHEIF_ENCODER_UNCOMPRESSED_H 56 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_uvg266.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_UVG266_H 22 | #define LIBHEIF_ENCODER_UVG266_H 23 | 24 | #include "common_utils.h" 25 | 26 | /* TODO: check whether this is also the case with uvg266. 27 | * 28 | * Image sizes in HEVC: since HEVC does not allow for odd image dimensions when 29 | using chroma 4:2:0, our strategy is as follows. 30 | 31 | - Images with odd dimensions are extended with an extra row/column which 32 | contains a copy of the border. 33 | - The HEVC image size generated by uvg266 is rounded up to the CTU size (?) 34 | and the conformance window has to be respected. 35 | - We add an additional crop transform to remove the extra row/column. 36 | */ 37 | 38 | 39 | const struct heif_encoder_plugin* get_encoder_plugin_uvg266(); 40 | 41 | #if PLUGIN_UVG266 42 | extern "C" { 43 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_vvenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_VVENC_H 22 | #define LIBHEIF_ENCODER_VVENC_H 23 | 24 | #include "common_utils.h" 25 | 26 | const struct heif_encoder_plugin* get_encoder_plugin_vvenc(); 27 | 28 | #if PLUGIN_VVENC 29 | extern "C" { 30 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libheif/plugins/encoder_x265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2017 Dirk Farin x 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_ENCODER_X265_H 22 | #define LIBHEIF_ENCODER_X265_H 23 | 24 | #include "common_utils.h" 25 | 26 | /* Image sizes in HEVC: since HEVC does not allow for odd image dimensions when 27 | using chroma 4:2:0, our strategy is as follows. 28 | 29 | - Images with odd dimensions are extended with an extra row/column which 30 | contains a copy of the border. 31 | - The HEVC image size generated by x265 is rounded up to the CTU size (?) 32 | and the conformance window has to be respected. 33 | - We add an additional crop transform to remove the extra row/column. 34 | */ 35 | 36 | 37 | const struct heif_encoder_plugin* get_encoder_plugin_x265(); 38 | 39 | #if PLUGIN_X265 40 | extern "C" { 41 | MAYBE_UNUSED LIBHEIF_API extern heif_plugin_info plugin_info; 42 | } 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /libheif/plugins_unix.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_PLUGINS_UNIX_H 22 | #define LIBHEIF_PLUGINS_UNIX_H 23 | 24 | #include 25 | #include 26 | #include "init.h" 27 | 28 | std::vector get_plugin_directories_from_environment_variable_unix(); 29 | 30 | std::vector list_all_potential_plugins_in_directory_unix(const char*); 31 | 32 | class PluginLibrary_Unix : public PluginLibrary 33 | { 34 | public: 35 | heif_error load_from_file(const char* filename) override; 36 | 37 | void release() override; 38 | 39 | heif_plugin_info* get_plugin_info() override { return m_plugin_info; } 40 | 41 | bool operator==(const PluginLibrary_Unix& b) const 42 | { 43 | return m_library_handle == b.m_library_handle; 44 | } 45 | 46 | private: 47 | void* m_library_handle = nullptr; 48 | heif_plugin_info* m_plugin_info = nullptr; 49 | }; 50 | 51 | #endif //LIBHEIF_PLUGINS_UNIX_H 52 | -------------------------------------------------------------------------------- /libheif/plugins_windows.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF codec. 3 | * Copyright (c) 2023 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | 22 | #ifndef LIBHEIF_PLUGINS_WINDOWS_H 23 | #define LIBHEIF_PLUGINS_WINDOWS_H 24 | 25 | #include 26 | #include 27 | #include "init.h" 28 | #include 29 | 30 | std::vector get_plugin_directories_from_environment_variable_windows(); 31 | 32 | std::vector list_all_potential_plugins_in_directory_windows(const char*); 33 | 34 | class PluginLibrary_Windows : public PluginLibrary 35 | { 36 | public: 37 | heif_error load_from_file(const char* filename) override; 38 | 39 | void release() override; 40 | 41 | heif_plugin_info* get_plugin_info() override { return m_plugin_info; } 42 | 43 | bool operator==(const PluginLibrary_Windows& b) const 44 | { 45 | return m_filename == b.m_filename; 46 | } 47 | 48 | private: 49 | std::string m_filename; 50 | HMODULE m_library_handle = nullptr; 51 | heif_plugin_info* m_plugin_info = nullptr; 52 | }; 53 | 54 | #endif //LIBHEIF_PLUGINS_WINDOWS_H 55 | -------------------------------------------------------------------------------- /libheif/sequences/track_metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * HEIF image base codec. 3 | * Copyright (c) 2025 Dirk Farin 4 | * 5 | * This file is part of libheif. 6 | * 7 | * libheif is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU Lesser General Public License as 9 | * published by the Free Software Foundation, either version 3 of 10 | * the License, or (at your option) any later version. 11 | * 12 | * libheif is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public License 18 | * along with libheif. If not, see . 19 | */ 20 | 21 | #ifndef LIBHEIF_TRACK_METADATA_H 22 | #define LIBHEIF_TRACK_METADATA_H 23 | 24 | #include "track.h" 25 | #include 26 | #include 27 | #include 28 | 29 | 30 | class Track_Metadata : public Track { 31 | public: 32 | //Track(HeifContext* ctx); 33 | 34 | Track_Metadata(HeifContext* ctx, uint32_t track_id, std::string uri, heif_track_info* info); 35 | 36 | Track_Metadata(HeifContext* ctx, const std::shared_ptr&); // when reading the file 37 | 38 | ~Track_Metadata() override = default; 39 | 40 | struct Metadata { 41 | ~Metadata() { heif_tai_timestamp_packet_release(timestamp); } 42 | 43 | std::vector raw_metadata; 44 | uint32_t duration = 0; 45 | 46 | const heif_tai_timestamp_packet* timestamp = nullptr; 47 | std::string gimi_contentID; 48 | }; 49 | 50 | Result> read_next_metadata_sample(); 51 | 52 | Error write_raw_metadata(const Metadata&); 53 | 54 | private: 55 | std::string m_uri; 56 | }; 57 | 58 | #endif //LIBHEIF_TRACK_METADATA_H 59 | -------------------------------------------------------------------------------- /logos/sponsors/shopify.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 18 | 19 | 21 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /scripts/check-gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -eufo pipefail 3 | # 4 | # HEIF codec. 5 | # Copyright (c) 2018 struktur AG, Leon Klingele 6 | # 7 | # This file is part of libheif. 8 | # 9 | # libheif is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # libheif is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with libheif. If not, see . 21 | # 22 | 23 | realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$1"; } 24 | 25 | DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd)" 26 | 27 | FILES=$(find "$DIR"/.. -name *.go) 28 | result=0 29 | for filename in $FILES; do 30 | filename=$(realpath "${filename}") 31 | newfile=`mktemp /tmp/fmt.XXXXXX` || exit 1 32 | gofmt "${filename}" > "${newfile}" 2>> /dev/null 33 | set +e 34 | diff -u -p "${filename}" --label "${filename}" --label "${filename} (formatted)" "${newfile}" 35 | r=$? 36 | set -e 37 | rm "${newfile}" 38 | if [ $r != 0 ] ; then 39 | result=1 40 | else 41 | echo "Done processing ${filename}" 42 | fi 43 | done 44 | 45 | if [ $result != 0 ] ; then 46 | echo 47 | echo "Please fix the formatting errors above." >& 2 48 | exit 1 49 | fi 50 | -------------------------------------------------------------------------------- /scripts/check-licenses.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | # 4 | # HEIF codec. 5 | # Copyright (c) 2018 struktur AG, Joachim Bauch 6 | # 7 | # This file is part of libheif. 8 | # 9 | # libheif is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # libheif is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with libheif. If not, see . 21 | # 22 | 23 | echo "Checking licenses..." 24 | CHECK_RESULT=`/usr/bin/licensecheck --recursive --ignore 'emscripten|libde265|README\.md|post\.js|/.git/|clusterfuzz-testcase-.*|fuzzing/data/.*' .` 25 | 26 | FOUND= 27 | while read -r line; do 28 | if ( echo $line | grep -q "GENERATED FILE" ); then 29 | # We don't care about generated files 30 | echo "OK: $line" 31 | continue 32 | fi 33 | 34 | if ( echo "$line" | grep -q "UNKNOWN" ); then 35 | FILENAME=`echo "$line" | awk '{split($0,a,":");print a[1]}'` 36 | echo "ERROR: $line" >& 2 37 | FOUND=1 38 | continue 39 | fi 40 | 41 | echo "OK: $line" 42 | done <<< "${CHECK_RESULT}" 43 | 44 | if [ ! -z ${FOUND} ]; then 45 | echo "ERROR: Found files without licenses" >& 2 46 | exit 1 47 | fi 48 | -------------------------------------------------------------------------------- /scripts/configure-fuzzer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # HEIF codec. 4 | # Copyright (c) 2018 struktur AG, Joachim Bauch 5 | # 6 | # This file is part of libheif. 7 | # 8 | # libheif is free software: you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation, either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # libheif is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with libheif. If not, see . 20 | # 21 | 22 | FUZZER_FLAGS="-fsanitize=fuzzer-no-link,address,shift,integer -fno-sanitize-recover=shift,integer" # ,undefined 23 | export CFLAGS="$CFLAGS $FUZZER_FLAGS" 24 | export CXXFLAGS="$CXXFLAGS $FUZZER_FLAGS" 25 | export CXX=clang-7 26 | export CC=clang-7 27 | 28 | CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-go" 29 | CONFIGURE_ARGS="$CONFIGURE_ARGS --enable-libfuzzer=-fsanitize=fuzzer" 30 | exec ./configure $CONFIGURE_ARGS 31 | 32 | export TSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-7 33 | export MSAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-7 34 | export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-7 35 | -------------------------------------------------------------------------------- /scripts/install-emscripten.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | VERSION=$1 5 | TARGET=$2 6 | 7 | if [ -z "$VERSION" ] || [ -z "$TARGET" ]; then 8 | echo "USAGE: $0 " 9 | exit 1 10 | fi 11 | 12 | LIBSTDC_BASE=http://de.archive.ubuntu.com/ubuntu/pool/main/g/gcc-5 13 | EMSDK_DOWNLOAD=https://github.com/emscripten-core/emsdk.git 14 | 15 | CODENAME=$(/usr/bin/lsb_release --codename --short) 16 | if [ "$CODENAME" = "trusty" ] && [ ! -e "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21" ]; then 17 | CONTENTS=$(curl --location $LIBSTDC_BASE) 18 | LIBSTDC_VERSION=$(echo $CONTENTS | sed 's|.*libstdc++6_\([^_]*\)_amd64\.deb.*|\1|g') 19 | TMPDIR=$(mktemp --directory) 20 | echo "Installing libstdc++6 $LIBSTDC_VERSION to fix Emscripten ..." 21 | echo "Extracting in $TMPDIR ..." 22 | curl "${LIBSTDC_BASE}/libstdc++6_${LIBSTDC_VERSION}_amd64.deb" > "$TMPDIR/libstdc++6_${LIBSTDC_VERSION}_amd64.deb" 23 | dpkg -x "$TMPDIR/libstdc++6_${LIBSTDC_VERSION}_amd64.deb" "$TMPDIR" 24 | sudo mv "$TMPDIR/usr/lib/x86_64-linux-gnu/"libstdc++* /usr/lib/x86_64-linux-gnu 25 | rm -rf "$TMPDIR" 26 | fi 27 | 28 | cd "$TARGET" 29 | if [ ! -d emsdk ]; then 30 | echo "Cloning SDK base system ..." 31 | git clone --verbose --recursive "$EMSDK_DOWNLOAD" emsdk 32 | fi 33 | 34 | cd emsdk 35 | echo "Updating SDK base to ${VERSION} ..." 36 | git checkout main 37 | git pull --verbose 38 | git checkout ${VERSION} 39 | 40 | echo "Installing SDK version latest ..." 41 | ./emsdk install ${VERSION} 42 | 43 | echo "Activating SDK version latest ..." 44 | ./emsdk activate ${VERSION} 45 | -------------------------------------------------------------------------------- /scripts/prepare-ci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | # 4 | # HEIF codec. 5 | # Copyright (c) 2018 struktur AG, Joachim Bauch 6 | # 7 | # This file is part of libheif. 8 | # 9 | # libheif is free software: you can redistribute it and/or modify 10 | # it under the terms of the GNU General Public License as published by 11 | # the Free Software Foundation, either version 3 of the License, or 12 | # (at your option) any later version. 13 | # 14 | # libheif is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with libheif. If not, see . 21 | # 22 | 23 | ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" 24 | 25 | BUILD_ROOT=$ROOT/.. 26 | 27 | PKG_CONFIG_PATH= 28 | if [ "$WITH_LIBDE265" = "2" ]; then 29 | PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BUILD_ROOT/libde265/dist/lib/pkgconfig/" 30 | fi 31 | 32 | if [ "$WITH_RAV1E" = "1" ]; then 33 | PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BUILD_ROOT/third-party/rav1e/dist/lib/pkgconfig/" 34 | fi 35 | 36 | if [ "$WITH_DAV1D" = "1" ]; then 37 | PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BUILD_ROOT/third-party/dav1d/dist/lib/x86_64-linux-gnu/pkgconfig/" 38 | fi 39 | if [ ! -z "$PKG_CONFIG_PATH" ]; then 40 | export PKG_CONFIG_PATH="$PKG_CONFIG_PATH" 41 | fi 42 | 43 | # This was used with autotools, but not work cmake 44 | # 45 | #CONFIGURE_HOST= 46 | #if [ "$MINGW" == "32" ]; then 47 | # CONFIGURE_HOST=i686-w64-mingw32 48 | #elif [ "$MINGW" == "64" ]; then 49 | # CONFIGURE_HOST=x86_64-w64-mingw32 50 | #fi 51 | -------------------------------------------------------------------------------- /scripts/test-javascript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @preserve libheif.js HEIF decoder 3 | * (c)2017 struktur AG, http://www.struktur.de, opensource@struktur.de 4 | * 5 | * This file is part of libheif 6 | * https://github.com/strukturag/libheif 7 | * 8 | * libheif is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as 10 | * published by the Free Software Foundation, either version 3 of 11 | * the License, or (at your option) any later version. 12 | * 13 | * libheif is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public License 19 | * along with libheif. If not, see . 20 | */ 21 | 22 | const assert = require('assert'); 23 | const fs = require('fs'); 24 | 25 | console.log('Running libheif JavaScript tests ...'); 26 | 27 | const libheif = require('../libheif.js')(); 28 | 29 | // Test Embind API. 30 | console.log('Loaded libheif.js', libheif.heif_get_version()); 31 | 32 | // Test internal C API. 33 | assert(libheif.heif_get_version_number_major() === 1, 'libheif major version should be 1') 34 | 35 | // Test enum values. 36 | assert(libheif.heif_error_Ok.value === 0, 'heif_error_Ok should be 0') 37 | 38 | // Decode the example file and make sure at least one image is returned. 39 | const data = fs.readFileSync('examples/example.heic'); 40 | const decoder = new libheif.HeifDecoder(); 41 | const image_data = decoder.decode(data); 42 | 43 | console.log('Loaded images:', image_data.length); 44 | assert(image_data.length > 0, "Should have loaded images") 45 | -------------------------------------------------------------------------------- /tests/data/heifio/mono.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/heifio/mono.tif -------------------------------------------------------------------------------- /tests/data/heifio/mono_planar.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/heifio/mono_planar.tif -------------------------------------------------------------------------------- /tests/data/heifio/rgb.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/heifio/rgb.tif -------------------------------------------------------------------------------- /tests/data/heifio/rgb_planar.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/heifio/rgb_planar.tif -------------------------------------------------------------------------------- /tests/data/heifio/rgba.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/heifio/rgba.tif -------------------------------------------------------------------------------- /tests/data/heifio/rgba_planar.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/heifio/rgba_planar.tif -------------------------------------------------------------------------------- /tests/data/lightning_mini.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/lightning_mini.heif -------------------------------------------------------------------------------- /tests/data/rgb_generic_compressed_brotli.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/rgb_generic_compressed_brotli.heif -------------------------------------------------------------------------------- /tests/data/rgb_generic_compressed_defl.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/rgb_generic_compressed_defl.heif -------------------------------------------------------------------------------- /tests/data/rgb_generic_compressed_tile_deflate.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/rgb_generic_compressed_tile_deflate.heif -------------------------------------------------------------------------------- /tests/data/rgb_generic_compressed_zlib.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/rgb_generic_compressed_zlib.heif -------------------------------------------------------------------------------- /tests/data/rgb_generic_compressed_zlib_rows.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/rgb_generic_compressed_zlib_rows.heif -------------------------------------------------------------------------------- /tests/data/rgb_generic_compressed_zlib_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/rgb_generic_compressed_zlib_tiled.heif -------------------------------------------------------------------------------- /tests/data/simple_osm_tile_alpha.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/simple_osm_tile_alpha.avif -------------------------------------------------------------------------------- /tests/data/simple_osm_tile_meta.avif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/simple_osm_tile_meta.avif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_ABGR.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_ABGR.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_ABGR_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_ABGR_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_B16R16G16.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_B16R16G16.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_B16R16G16_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_B16R16G16_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_M.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_M.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_M_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_M_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_R5G6B5_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_R5G6B5_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_R7+1G7+1B7+1_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_R7+1G7+1B7+1_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_R7G7+1B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_R7G7+1B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_R7G7B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_R7G7B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_RGB.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_RGB.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_RGB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_RGB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_RGB_tiled_row_tile_align.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_RGB_tiled_row_tile_align.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_RGxB.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_RGxB.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_RGxB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_RGxB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_VUY_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_VUY_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_VUY_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_VUY_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_Y16U16V16_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_Y16U16V16_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_Y16U16V16_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_Y16U16V16_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_YUV_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_YUV_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_YUV_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_YUV_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_YUV_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_YUV_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_YVU_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_YVU_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_comp_YVU_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_comp_YVU_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_VUY_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_VUY_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_VUY_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_VUY_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_Y16U16V16_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_Y16U16V16_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_Y16U16V16_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_Y16U16V16_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_YUV_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_YUV_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_YUV_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_YUV_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_YVU_420.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_YVU_420.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_mix_YVU_422.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_mix_YVU_422.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_ABGR.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_ABGR.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_ABGR_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_ABGR_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_B16R16G16.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_B16R16G16.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_B16R16G16_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_B16R16G16_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_M.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_M.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_M_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_M_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R5G6B5_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R5G6B5_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R7+1G7+1B7+1_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R7+1G7+1B7+1_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R7G7+1B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R7G7+1B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R7G7B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R7G7B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R8G8B8A8_bsz0_psz10_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R8G8B8A8_bsz0_psz10_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R8G8B8A8_bsz0_psz5_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R8G8B8A8_bsz0_psz5_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R8G8B8_bsz0_psz10_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R8G8B8_bsz0_psz10_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_R8G8B8_bsz0_psz5_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_R8G8B8_bsz0_psz5_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_RGB.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_RGB.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_RGB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_RGB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_RGB_tiled_row_tile_align.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_RGB_tiled_row_tile_align.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_RGxB.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_RGxB.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_RGxB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_RGxB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_pix_YUV_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_pix_YUV_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_ABGR.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_ABGR.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_ABGR_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_ABGR_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_B16R16G16.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_B16R16G16.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_B16R16G16_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_B16R16G16_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_M.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_M.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_M_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_M_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_R5G6B5_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_R5G6B5_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_R7+1G7+1B7+1_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_R7+1G7+1B7+1_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_R7G7+1B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_R7G7+1B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_R7G7B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_R7G7B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_RGB.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_RGB.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_RGB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_RGB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_RGB_tiled_row_tile_align.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_RGB_tiled_row_tile_align.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_RGxB.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_RGxB.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_RGxB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_RGxB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_row_YUV_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_row_YUV_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_ABGR_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_ABGR_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_B16R16G16_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_B16R16G16_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_M_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_M_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_R5G6B5_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_R5G6B5_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_R7+1G7+1B7+1_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_R7+1G7+1B7+1_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_R7G7+1B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_R7G7+1B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_R7G7B7_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_R7G7B7_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_RGB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_RGB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_RGB_tiled_row_tile_align.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_RGB_tiled_row_tile_align.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_RGxB_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_RGxB_tiled.heif -------------------------------------------------------------------------------- /tests/data/uncompressed_tile_YUV_tiled.heif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/strukturag/libheif/e0bfb132ab984ad3d7703b5183a9fb336d96f8a0/tests/data/uncompressed_tile_YUV_tiled.heif -------------------------------------------------------------------------------- /tests/main.cc: -------------------------------------------------------------------------------- 1 | /* 2 | libheif unit tests 3 | 4 | MIT License 5 | 6 | Copyright (c) 2019 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #define CATCH_CONFIG_MAIN 28 | #include "catch_amalgamated.hpp" 29 | -------------------------------------------------------------------------------- /tests/test-config.cc.in: -------------------------------------------------------------------------------- 1 | /* 2 | libheif unit tests 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 struktur AG, Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #include 28 | 29 | std::string tests_data_directory = "@TESTING_DATA_DIRECTORY@"; 30 | std::string libheifio_tests_data_directory = "@LIBHEIFIO_TESTING_DATA_DIRECTORY@"; 31 | -------------------------------------------------------------------------------- /tests/test-config.h: -------------------------------------------------------------------------------- 1 | /* 2 | libheif unit tests 3 | 4 | MIT License 5 | 6 | Copyright (c) 2023 Dirk Farin 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in all 16 | copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | SOFTWARE. 25 | */ 26 | 27 | #ifndef LIBHEIF_TEST_CONFIG_H 28 | #define LIBHEIF_TEST_CONFIG_H 29 | 30 | #include 31 | 32 | // Absolute path to the tests/data directory. Can be used by the tests to load input data. 33 | extern std::string tests_data_directory; 34 | extern std::string libheifio_tests_data_directory; 35 | 36 | #endif //LIBHEIF_TEST_CONFIG_H 37 | -------------------------------------------------------------------------------- /third-party/aom.cmd: -------------------------------------------------------------------------------- 1 | : # This install script was originally taken from libavif but might have been modified. 2 | 3 | : # If you want to enable the AOM encoder, please check that the WITH_AOM CMake variable is set correctly. 4 | : # You will also have to set the PKG_CONFIG_PATH to "third-party/aom/dist/lib/pkgconfig" so that the local AOM library is found. 5 | 6 | : # The odd choice of comment style in this file is to try to share this script between *nix and win32. 7 | 8 | : # cmake and ninja must be in your PATH. 9 | 10 | : # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir): 11 | : # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" 12 | 13 | git clone -b v3.12.1 --depth 1 https://aomedia.googlesource.com/aom 14 | 15 | cd aom 16 | 17 | cmake -S . -B build.libavif -G Ninja -DCMAKE_INSTALL_PREFIX="$(pwd)/dist" -DCMAKE_BUILD_TYPE=Release -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TESTDATA=0 -DENABLE_TESTS=0 -DENABLE_TOOLS=0 18 | ninja -C build.libavif 19 | ninja -C build.libavif install 20 | cd .. 21 | 22 | echo "" 23 | echo "----- NOTE ----" 24 | echo "Please add the path to the pkg-config file to your PKG_CONFIG_PATH, like this:" 25 | echo "export PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:$(pwd)/aom/dist/lib/pkgconfig" 26 | -------------------------------------------------------------------------------- /third-party/dav1d.cmd: -------------------------------------------------------------------------------- 1 | : # This install script was originally taken from libavif but might have been modified. 2 | 3 | : # If you want to enable the DAV1D decoder, please check that the WITH_DAV1D CMake variable is set correctly. 4 | : # You will also have to set the PKG_CONFIG_PATH to "third-party/dav1d/dist/lib/x86_64-linux-gnu/pkgconfig" so that the local DAV1D library is found. 5 | 6 | : # The odd choice of comment style in this file is to try to share this script between *nix and win32. 7 | 8 | : # meson and ninja must be in your PATH. 9 | 10 | : # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir): 11 | : # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" 12 | 13 | git clone -b 1.5.0 --depth 1 https://code.videolan.org/videolan/dav1d.git 14 | 15 | cd dav1d 16 | 17 | : # macOS might require: -Dc_args=-fno-stack-check 18 | : # Build with asan: -Db_sanitize=address 19 | : # Build with ubsan: -Db_sanitize=undefined 20 | meson build --default-library=static --buildtype release --prefix "$(pwd)/dist" $@ 21 | ninja -C build 22 | ninja -C build install 23 | cd .. 24 | 25 | echo "" 26 | echo "----- NOTE ----" 27 | echo "Please add the path to the pkg-config file to your PKG_CONFIG_PATH. For" 28 | echo "example, on Linux x86_64, run:" 29 | echo "export PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:$(pwd)/dav1d/dist/lib/x86_64-linux-gnu/pkgconfig" 30 | -------------------------------------------------------------------------------- /third-party/libsharpyuv.cmd: -------------------------------------------------------------------------------- 1 | : # This install script was originally taken from libavif but might have been modified. 2 | 3 | : # If you want to enable the libsharpyuv decoder, please check that the WITH_LIBSHARPYUV CMake variable is set correctly. 4 | : # You will also have to set the PKG_CONFIG_PATH to "third-party/libwebp/build/dist/lib/pkgconfig" so that the local libsharpyuv library is found. 5 | 6 | : # The odd choice of comment style in this file is to try to share this script between *nix and win32. 7 | 8 | : # meson and ninja must be in your PATH. 9 | 10 | : # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir): 11 | : # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat" 12 | git clone --single-branch https://chromium.googlesource.com/webm/libwebp 13 | 14 | cd libwebp 15 | mkdir build 16 | cd build 17 | cmake -G Ninja -DCMAKE_INSTALL_PREFIX="$(pwd)/dist" -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release .. 18 | ninja sharpyuv 19 | ninja install 20 | cd ../.. 21 | -------------------------------------------------------------------------------- /third-party/rav1e.cmd: -------------------------------------------------------------------------------- 1 | : # This install script was originally taken from libavif but might have been modified. 2 | 3 | : # If you want to enable the RAV1E encoder, please check that the WITH_RAV1E CMake variable is set correctly. 4 | : # You will also have to set the PKG_CONFIG_PATH to "third-party/rav1e/dist/lib/x86_64-linux-gnu/pkgconfig" (depending on your architecture) so that the local RAV1E library is found. 5 | 6 | : # The odd choice of comment style in this file is to try to share this script between *nix and win32. 7 | 8 | : # cargo must be in your PATH. (use rustup or brew to install) 9 | 10 | : # If you're running this on Windows targeting Rust's windows-msvc, be sure you've already run this (from your VC2017 install dir): 11 | : # "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" 12 | : # 13 | : # Also, the error that "The target windows-msvc is not supported yet" can safely be ignored provided that rav1e/target/release 14 | : # contains rav1e.h and rav1e.lib. 15 | 16 | git clone -b v0.7.1 --depth 1 https://github.com/xiph/rav1e.git 17 | 18 | cd rav1e 19 | cargo install cargo-c 20 | cargo cinstall --crt-static --release --prefix="$(pwd)/dist" --library-type=staticlib 21 | cd .. 22 | -------------------------------------------------------------------------------- /third-party/svt.cmd: -------------------------------------------------------------------------------- 1 | : # This install script was originally taken from libavif but might have been modified. 2 | 3 | : # cmake and ninja must be in your PATH for compiling. 4 | 5 | : # If you want to enable the SVT-AV1 encoder, please check that the WITH_SvtEnc and WITH_SvtEnc_BUILTIN CMake variables are set correctly. 6 | : # You will also have to set the PKG_CONFIG_PATH to "third-party/SVT-AV1/Build/linux/Release" so that the local SVT-AV1 library is found. 7 | 8 | git clone -b v3.0.0 --depth 1 https://gitlab.com/AOMediaCodec/SVT-AV1.git 9 | 10 | cd SVT-AV1 11 | cd Build/linux 12 | 13 | ./build.sh release static no-apps disable-lto prefix=$(pwd)/install install 14 | cd ../../.. 15 | 16 | echo "" 17 | echo "----- NOTE ----" 18 | echo "Please add the path to the pkg-config file to your PKG_CONFIG_PATH, like this:" 19 | echo "export PKG_CONFIG_PATH=\$PKG_CONFIG_PATH:$(pwd)/SVT-AV1/Build/linux/install/lib/pkgconfig" 20 | --------------------------------------------------------------------------------