Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: openjph HT decoder #1119

Closed
wants to merge 161 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
37b81c9
rename heif-convert to heif-dec
farindk Oct 17, 2023
100d172
install link from 'heif-convert' to new filename 'heif-dec'
farindk Oct 17, 2023
fd1d633
show correct program name in help
farindk Oct 17, 2023
8055af7
cmake: move creating the heif-convert symlink to after installing hei…
farindk Oct 17, 2023
87815a5
On Windows, copy heic-dec to heic-convert instead of using symlink
farindk Oct 18, 2023
c4401ef
rename heif-convert to heif-dec in manpage
farindk Oct 18, 2023
7b7c0f2
rename heif-convert to heif-dec in CI script
farindk Oct 18, 2023
30b696b
fix parse error reporting
farindk Oct 18, 2023
47cde92
heif_context_encode_grid_image()
dukesook May 31, 2024
6cf978c
renamed several variables
dukesook May 31, 2024
fce23a6
document function
dukesook May 31, 2024
bdd6380
misc cleanup
dukesook May 31, 2024
b2fa352
Better error checking
dukesook May 31, 2024
e35c599
additional minor cleanup
dukesook May 31, 2024
1392198
use 'tiles' instead of 'images'
dukesook May 31, 2024
4e803df
revert whitespace-only diff
farindk Jun 11, 2024
37d5102
Revert "fix parse error reporting" as it does not belong into this PR.
farindk Jun 11, 2024
db223b7
Merge branch 'master' into rename-heif-convert
farindk Jun 11, 2024
1468e7d
Update to the dav1d 1.4.3 release
wantehchang Jun 12, 2024
77e9adb
Merge pull request #1187 from wantehchang/dav1d-1-4-3
farindk Jun 12, 2024
5885b4d
[ffmpeg plugin] Add more chroma subsampling support
roticv Jun 25, 2024
7d7caa6
Merge pull request #1180 from dukesook/encode_grid_pr
farindk Jun 25, 2024
8d7ac4c
Update to SVT-AV1 v2.1.1
wantehchang Jun 25, 2024
4b8ab5f
Merge pull request #1195 from wantehchang/svt-av1-v2-1-1
farindk Jun 25, 2024
9ba4dcc
Merge branch 'develop-v1.18.0'
farindk Jun 26, 2024
e2219ab
Merge pull request #1193 from roticv/master
farindk Jun 26, 2024
85381e5
ffmpeg-dec: round up chroma sizes (#1193)
farindk Jun 26, 2024
78f97e3
uncompressed: define some default values to prevent undefined behavior
farindk Jun 26, 2024
a0275c7
Merge branch 'master' into rename-heif-convert
farindk Jun 26, 2024
eb795b8
Merge pull request #996 from strukturag/rename-heif-convert
farindk Jun 26, 2024
875963c
VVC: integer range checking and casting to prevent compiler errors
farindk Jun 26, 2024
35104e6
define M_PI if not defined
farindk Jun 26, 2024
bae12ab
Merge branch 'rename-heif-convert'
farindk Jun 26, 2024
9933395
add missing includes
farindk Jun 26, 2024
44479dd
add error enums to emscripten
farindk Jun 26, 2024
c556a31
add error enums to emscripten
farindk Jun 26, 2024
b9d39e1
remove duplicate error from emscripten
farindk Jun 26, 2024
34bfa4f
uncompressed: support version 1 boxes
bradh Feb 26, 2024
c590d8f
uncompressed: use more specific options
bradh Jun 26, 2024
8a686f1
Moved public API into 'api', image codecs into 'codecs' directory.
farindk Jun 26, 2024
9dd33d7
adapt new paths in CI
farindk Jun 26, 2024
3ad5c0a
adapt new paths in CI
farindk Jun 26, 2024
7a34b62
adapt more paths
farindk Jun 26, 2024
a137da9
add new errors to Go binding
farindk Jun 26, 2024
0730781
uncompressed: move member variable initialization
farindk Jun 26, 2024
cc392b7
adapt path for jpeg2000 test
farindk Jun 26, 2024
cb3f8f1
fix uninitialized value in JPEG2000_Extension_Capability
farindk Jun 26, 2024
75ecfb5
fix clang-tidy warnings/errors
farindk Jun 26, 2024
56211ac
trying to fix clang-tidy
farindk Jun 26, 2024
f9113af
AVC: fix path
farindk Jun 26, 2024
d15b6fd
fuzzing: fix undefined shift
farindk Jun 26, 2024
1b51e0d
only build uncompressed_box test when visibility is off and uncompres…
farindk Jun 26, 2024
dca605f
cmin/cmex: use unsigned shift for denominators
farindk Jun 26, 2024
527ad05
fix typo in CMakePresets
farindk Jun 26, 2024
0931b2a
increase version to v1.18.0
farindk Jun 26, 2024
7b6c39c
update README with uvg266 flag
farindk Jun 26, 2024
6fe94e9
doxygen: minor updates
bradh Jun 27, 2024
ad93ec6
Merge pull request #1201 from bradh/doxygen_2024-06-27
farindk Jun 27, 2024
f14f7a3
add vvdec based VVC decoder (#519)
farindk Jun 27, 2024
0513f5e
Merge branch 'master' of github.com:strukturag/libheif
farindk Jun 27, 2024
ebb4dd3
mention vvdec in README
farindk Jun 27, 2024
51c496b
vvc decoder cleanup
farindk Jun 27, 2024
0a63293
add FindUVG266.cmake
farindk Jun 27, 2024
717999d
add missing include
farindk Jun 27, 2024
4224567
Fix unsigned integer
Jamaika1 Jun 28, 2024
9d4a510
Merge pull request #1203 from Jamaika1/patch-14
farindk Jun 28, 2024
c760f0b
add explicit cast
farindk Jun 28, 2024
7a8c58e
remove unused string
farindk Jun 28, 2024
ddb541a
on Windows, copy DLL into executable directory to allow easier develo…
farindk Jun 30, 2024
0dcadb9
copy DLL whenever the was rebuilt (not whenever the EXE was rebuilt),…
farindk Jul 1, 2024
3a6f8cd
skip depth and alpha map references to non-images (#1190)
farindk Jul 1, 2024
3db91ea
add vvenc plugin (#519)
farindk Jul 2, 2024
d15b47f
add vvenc to README
farindk Jul 2, 2024
7b11087
add js binding to check filetype
EzraH442 Jul 3, 2024
87fcd2d
add js binding to get primary image handle
EzraH442 Jul 3, 2024
e8b33b2
Merge pull request #1218 from EzraH442/master
farindk Jul 3, 2024
fcbc79c
uncompressed: fix up reading of uncompressed images that use the uncC…
bradh Jun 29, 2024
b224783
Add initial TIFF decoder for heif-enc.
fancycode Jun 28, 2024
7a81491
Extract EXIF data from TIFF images.
fancycode Jul 4, 2024
e6c9967
CI: Install libtiff on Windows.
fancycode Jul 4, 2024
f7bcbdc
add cmake output whether libtiff was found (#1205)
farindk Jul 4, 2024
b429be0
Limit total size of image instead of width and height individually.
fancycode Jun 28, 2024
0e0e737
Cast to correct types for comparisons.
fancycode Jul 1, 2024
fba9ee8
Add fuzzing example that caused overflow.
fancycode Jul 1, 2024
2e9c361
add cmake output which input formats are supported for heif-enc (#1205)
farindk Jul 4, 2024
d432310
AOM encoder: set maximum number of threads to 64 (#1212)
farindk Jul 4, 2024
29bc4c3
Do not check maximum image size while merely parsing the file. Do the…
farindk Jul 4, 2024
8ddaa74
aom: Use all available CPUs for encoding by default.
fancycode Jul 4, 2024
73f23a1
Fix filename in fuzzing corpus so it gets parsed during regression te…
fancycode Jul 4, 2024
b34e7ac
Bring back overflow check removed in 29bc4c32514b1fc720b29dc1b0ac6cea…
fancycode Jul 4, 2024
e42b01f
Merge pull request #1221 from strukturag/aom-default-threadcount
farindk Jul 4, 2024
e476f58
Merge pull request #1222 from strukturag/fuzzer-fix-filename
farindk Jul 4, 2024
7a74023
Merge pull request #1217 from strukturag/vvenc
farindk Jul 4, 2024
c954e20
CI: Enable more codecs when compiling on Windows.
fancycode Jul 4, 2024
eb4ce12
CI: Only install x265 on x64, doesn't exist on arm64.
fancycode Jul 4, 2024
9a8f1e1
Merge pull request #1219 from strukturag/ci-windows-codecs
farindk Jul 4, 2024
bd5748f
uncompressed: add sanity limit check on number of tile rows and cols
bradh Jun 28, 2024
32dc21b
Merge pull request #1207 from bradh/uncompressed_tile_limits_2024-06-28
farindk Jul 5, 2024
cc31d57
fix wrong include directories for libde265 and aom in build-emscripte…
EzraH442 Jul 3, 2024
34ece2d
upgrade libde265 version to 1.0.15 from 1.0.12
EzraH442 Jul 3, 2024
8d447f3
make build-emscripten script compatible with emsdk versions >=3.1.55
EzraH442 Jul 3, 2024
5ef70d8
CI: upgrade emscripten to v3.1.61
EzraH442 Jul 5, 2024
7c9729e
check for zero width/height images (clusterfuzz issue 70099)
farindk Jul 6, 2024
a4cfe72
Added patch to check that overlay's offsets are valid
flyyee Jul 7, 2024
6bed0f0
Sanity-check tile dimensions/resolution
lovell Jul 7, 2024
3c4e060
Merge pull request #1228 from lovell/context-tile-check-resolution
farindk Jul 8, 2024
d60b2c6
more checks on valid grid image tile sizes (#1228)
farindk Jul 8, 2024
45c704a
Changed offset checks against image dimensions to use >=
flyyee Jul 8, 2024
e382107
Merge pull request #1227 from flyyee/master
farindk Jul 8, 2024
a3ed1b1
rewrite overlay image area intersection (#1226)
farindk Jul 8, 2024
0d56f46
Merge pull request #1224 from EzraH442/master
farindk Jul 8, 2024
6826a9d
AOM encoder: default number of threads should not exceed maximum (#1221)
farindk Jul 8, 2024
2de879a
error if read box version is not supported
farindk Jul 9, 2024
b97d0c2
fix iinf box version in example image
farindk Jul 9, 2024
e8e7f0c
when reading HEVC SEI, make sure that there is enough input data
farindk Jul 9, 2024
98c1d7c
fill_RGB_16bit() for very large images
farindk Jul 9, 2024
9f047ca
include <limits>
farindk Jul 9, 2024
c0e4d24
uncompressed: implement generic compression decode
bradh Jun 28, 2024
6a20e4a
uncompressed: add missing emscripten enum
bradh Jul 6, 2024
f4344a0
uncompressed add missing go enum
bradh Jul 6, 2024
3aa63af
uncompressed: fix up go formatting
bradh Jul 6, 2024
ee76649
uncompressed: check icbr version
bradh Jul 6, 2024
3ad8292
uncompressed: try harder to make zlib optional
bradh Jul 6, 2024
25d0c77
uncompressed: minor editorial cleanups
bradh Jul 6, 2024
86299ef
uncompressed: add version checks for cmpC and icbr
bradh Jul 9, 2024
85956fb
uncompressed: rename ZLIB compression preprocessor define
bradh Jul 9, 2024
c47a18c
Merge pull request #1208 from bradh/generic_compression
farindk Jul 9, 2024
1cb2c0e
rename data compression functions (zlib/deflate/brotli)
farindk Jul 9, 2024
ebf6c61
metadata compression cleanup
farindk Jul 9, 2024
d2e1188
zlib is optional for both metadata and 23001-17
farindk Jul 9, 2024
595b0e4
fix ZLIB_FOUND variable
farindk Jul 9, 2024
dd83804
fix compilation without WITH_UNCOMPRESSED_CODEC (fixes #1229)
farindk Jul 9, 2024
baa8e09
compression: add (internal) api documentation for compression
bradh Jul 9, 2024
f466dfe
uncompressed: fix parse fuzz failure
bradh Jul 10, 2024
9496e96
additional fuzzer fix for 64 bit parsing
bradh Jul 10, 2024
7555aa9
Merge pull request #1230 from bradh/compress_doxygen_2024-07-10
farindk Jul 10, 2024
8cd90a9
fix heif_dec no-colons option for windows
dnd29 Jul 10, 2024
f3d2217
uncompressed: fix box dump when profile is 0
bradh Jul 10, 2024
52208af
Merge pull request #1233 from bradh/uncc_dump_fixup
farindk Jul 10, 2024
325f282
Merge pull request #1232 from dnd29/master
farindk Jul 10, 2024
67e7405
Merge pull request #1231 from bradh/icbr_fuzz_2024-07-10
farindk Jul 10, 2024
eb97cd6
rewrite parsing of 'grpl' and add 'pymd'
farindk Jul 10, 2024
8a48bf8
implement Box_ster (stereo entity group)
farindk Jul 10, 2024
537d668
do not enforce iinf box version<2 as there are many images in circula…
farindk Jul 10, 2024
97e8c24
Fix libbrotlidec pkg-config requires
kmilos Jul 10, 2024
67a8d84
Merge pull request #1236 from kmilos/patch-1
farindk Jul 10, 2024
a4560c2
tiff: Fix wrong type for "seekTIFF" function.
fancycode Jul 10, 2024
408118f
Merge pull request #1237 from strukturag/tiff-type-conversions
farindk Jul 10, 2024
66bdcdc
fix 32bit compiler warnings in box.cc (#1235)
farindk Jul 10, 2024
d067859
Fix coverity build.
fancycode Jul 11, 2024
9b5defa
CI: Fail if third-party build fails.
fancycode Jul 11, 2024
96df51d
Merge pull request #1238 from strukturag/fix-coverity
fancycode Jul 11, 2024
9d62fb4
appveyor: Build multithreaded.
fancycode Jul 11, 2024
4161994
Merge pull request #1240 from strukturag/appveyor-multithreaded
fancycode Jul 11, 2024
e8ca091
Bump rav1e to 0.6 to fix compile error.
fancycode Jul 11, 2024
08a3d91
Merge pull request #1239 from strukturag/ci-fail-on-thirdparty-build-…
fancycode Jul 12, 2024
2832a8d
fix memory leaks in Brotli decoder (oss-fuzz #70383)
farindk Jul 15, 2024
0c47c2a
rename property raw data implementation to match header
bradh Jul 16, 2024
a3f43c1
Merge pull request #1243 from bradh/raw_data_rename
farindk Jul 17, 2024
0a0fec6
libheif: add API to get UUID for user extension boxes
bradh Jul 19, 2024
42fc168
wip: openjph HT decoder
bradh Jan 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ name: coverity
on:
push:
branches: [ coverity ]
pull_request:
branches: [ master ]

jobs:
scan:
runs-on: ubuntu-20.04
env:
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
WITH_AOM: 1
WITH_DAV1D: 1
WITH_GRAPHICS: 1
WITH_LIBDE265: 1
WITH_RAV1E: 1
WITH_X265: 1
steps:
- uses: actions/checkout@v4
Expand All @@ -21,7 +25,7 @@ jobs:
with:
path: |
coverity_tool.tar.gz
key: ${{ runner.os }}
key: coverity_tool-${{ runner.os }}

- name: Download Coverity build tool
run: |
Expand All @@ -39,10 +43,13 @@ jobs:

- name: Build with Coverity build tool
run: |
export PATH=`pwd`/coverity_tool/bin:$PATH
cov-build --dir cov-int make
export PATH=$(pwd)/coverity_tool/bin:$PATH
export PKG_CONFIG_PATH="$(pwd)/libde265/dist/lib/pkgconfig/:$(pwd)/third-party/rav1e/dist/lib/pkgconfig/:$(pwd)/third-party/dav1d/dist/lib/x86_64-linux-gnu/pkgconfig/"
cmake --preset=develop .
cov-build --dir cov-int make -j$(nproc)

- name: Submit build result to Coverity Scan
if: github.ref == 'refs/heads/coverity'
run: |
tar czvf libheif.tar.gz cov-int
curl --form token=$TOKEN \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
emscripten:
env:
EMSCRIPTEN_VERSION: 3.1.47
EMSCRIPTEN_VERSION: 3.1.61
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
Expand Down
59 changes: 51 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.16.3) # Oldest Ubuntu LTS (20.04 currently)

project(libheif LANGUAGES C CXX VERSION 1.17.6)
project(libheif LANGUAGES C CXX VERSION 1.18.0)

# compatibility_version is never allowed to be decreased for any specific SONAME.
# Libtool in the libheif-1.15.1 release had set it to 17.0.0, so we have to use this for the v1.x.y versions.
Expand Down Expand Up @@ -137,6 +137,30 @@ if (WITH_UVG266)
endif ()
endif ()

# vvdec

plugin_option(VVDEC "vvdec VVC decoder (experimental)" OFF OFF)
if (WITH_VVDEC)
# TODO: how to do configure vvdec cleanly?
find_package(Threads REQUIRED)
find_package(vvdec 2.3.0)
if (vvdec_FOUND)
set(vvdec_LIBRARIES vvdec::vvdec)
endif()
endif ()

# vvenc

plugin_option(VVENC "vvenc VVC encoder (experimental)" OFF OFF)
if (WITH_VVENC)
# TODO: how to do configure vvenc cleanly?
find_package(Threads REQUIRED)
find_package(vvenc 1.12.0)
if (vvenc_FOUND)
set(vvenc_LIBRARIES vvenc::vvenc)
endif()
endif ()

# dav1d

plugin_option(DAV1D "Dav1d AV1 decoder" OFF ON)
Expand Down Expand Up @@ -200,7 +224,7 @@ endif ()
# openjph

plugin_option(OPENJPH_ENCODER "OpenJPH HT-J2K encoder" OFF ON)
# plugin_option(OPENJPH_DECODER "OpenJPH HT-J2K decoder" OFF ON)
plugin_option(OPENJPH_DECODER "OpenJPH HT-J2K decoder" OFF ON)
if (WITH_OPENJPH_ENCODER OR WITH_OPENJPH_DECODER)
find_package(OPENJPH)
endif()
Expand All @@ -226,9 +250,11 @@ plugin_compilation_info(JPEG_DECODER JPEG "JPEG decoder")
plugin_compilation_info(JPEG_ENCODER JPEG "JPEG encoder")
plugin_compilation_info(OpenJPEG_DECODER OpenJPEG "OpenJPEG J2K decoder")
plugin_compilation_info(OpenJPEG_ENCODER OpenJPEG "OpenJPEG J2K encoder")
# plugin_compilation_info(OPENJPH_DECODER OPENJPH "OpenJPH HT-J2K decoder")
plugin_compilation_info(OPENJPH_DECODER OPENJPH "OpenJPH HT-J2K decoder")
plugin_compilation_info(OPENJPH_ENCODER OPENJPH "OpenJPH HT-J2K encoder")
plugin_compilation_info(UVG266_ENCODER UVG266 "uvg266 VVC enc. (experimental)")
plugin_compilation_info(VVENC vvenc "vvenc VVC enc. (experimental)")
plugin_compilation_info(VVDEC vvdec "vvdec VVC dec. (experimental)")

# --- show summary which formats are supported

Expand Down Expand Up @@ -284,9 +310,12 @@ endif()
if (OPENJPH_FOUND AND WITH_OPENJPH_DECODER)
set(SUPPORTS_J2K_HT_ENCODING TRUE)
endif()
if (UVG266_FOUND)
if (UVG266_FOUND OR vvenc_FOUND)
set(SUPPORTS_VVC_ENCODING TRUE)
endif()
if (vvdec_FOUND AND WITH_VVDEC)
set(SUPPORTS_VVC_DECODING TRUE)
endif()

if (WITH_UNCOMPRESSED_CODEC)
set(SUPPORTS_UNCOMPRESSED_DECODING TRUE)
Expand All @@ -297,7 +326,7 @@ message("\n=== Supported formats ===")
message("format decoding encoding")
format_compilation_info("HEIC" SUPPORTS_HEIC_DECODING SUPPORTS_HEIC_ENCODING)
format_compilation_info("AVIF" SUPPORTS_AVIF_DECODING SUPPORTS_AVIF_ENCODING)
format_compilation_info("VVC" FALSE SUPPORTS_VVC_ENCODING)
format_compilation_info("VVC" SUPPORTS_VVC_DECODING SUPPORTS_VVC_ENCODING)
format_compilation_info("JPEG" SUPPORTS_JPEG_DECODING SUPPORTS_JPEG_ENCODING)
format_compilation_info("JPEG2000" SUPPORTS_J2K_DECODING SUPPORTS_J2K_ENCODING)
format_compilation_info("JPEG2000-HT" SUPPORTS_J2K_HT_DECODING SUPPORTS_J2K_HT_ENCODING)
Expand Down Expand Up @@ -366,8 +395,22 @@ endif()
if (LIBSHARPYUV_FOUND)
list(APPEND REQUIRES_PRIVATE "libsharpyuv")
endif()
if (WITH_DEFLATE_HEADER_COMPRESSION)
list(APPEND REQUIRES_PRIVATE "zlib")
if (WITH_HEADER_COMPRESSION OR WITH_UNCOMPRESSED_CODEC)
find_package(ZLIB)
if (ZLIB_FOUND)
message("zlib found")
list(APPEND REQUIRES_PRIVATE "zlib")
else()
message("zlib not found")
endif()

find_package(Brotli)
if (Brotli_FOUND)
message("Brotli found")
list(APPEND REQUIRES_PRIVATE "libbrotlidec")
else()
message("Brotli not found")
endif()
endif()

list(JOIN REQUIRES_PRIVATE " " REQUIRES_PRIVATE)
Expand All @@ -392,7 +435,7 @@ option(WITH_GDK_PIXBUF "Build gdk-pixbuf plugin" ON)

option(WITH_REDUCED_VISIBILITY "Reduced symbol visibility in library" ON)

option(WITH_DEFLATE_HEADER_COMPRESSION OFF)
option(WITH_HEADER_COMPRESSION OFF)
option(ENABLE_MULTITHREADING_SUPPORT "Switch off for platforms without multithreading support" ON)
option(ENABLE_PARALLEL_TILE_DECODING "Will launch multiple decoders to decode tiles in parallel (requires ENABLE_MULTITHREADING_SUPPORT)" ON)

Expand Down
9 changes: 5 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"WITH_FFMPEG_DECODER_PLUGIN" : "OFF",

"WITH_REDUCED_VISIBILITY" : "OFF",
"WITH_DEFLATE_HEADER_COMPRESSION" : "ON",
"WITH_HEADER_COMPRESSION" : "ON",
"WITH_LIBSHARPYUV" : "ON",
"WITH_EXAMPLES": "ON",
"WITH_FUZZERS": "OFF"
Expand Down Expand Up @@ -91,7 +91,7 @@
"WITH_FFMPEG_DECODER_PLUGIN" : "ON",

"WITH_REDUCED_VISIBILITY" : "ON",
"WITH_DEFLATE_HEADER_COMPRESSION" : "ON",
"WITH_HEADER_COMPRESSION" : "ON",
"WITH_LIBSHARPYUV" : "ON",
"WITH_EXAMPLES": "ON",
"WITH_FUZZERS": "OFF"
Expand Down Expand Up @@ -123,7 +123,7 @@
"WITH_FFMPEG_DECODER" : "OFF",

"WITH_REDUCED_VISIBILITY" : "ON",
"WITH_DEFLATE_HEADER_COMPRESSION" : "OFF",
"WITH_HEADER_COMPRESSION" : "OFF",
"WITH_LIBSHARPYUV" : "ON",
"WITH_EXAMPLES": "ON",
"WITH_FUZZERS": "OFF"
Expand All @@ -137,7 +137,8 @@
"CMAKE_BUILD_TYPE": "Debug",
"ENABLE_PLUGIN_LOADING" : "OFF",
"BUILD_TESTING" : "ON",
"WITH_REDUCED_VISIBILITY" : "OFF"
"WITH_REDUCED_VISIBILITY" : "OFF",
"WITH_UNCOMPRESSED_CODEC" : "ON"
}
},
{
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ libheif has support for:
* decoding of files while downloading (e.g. extract image size before file has been completely downloaded)

Supported codecs:
| Format | Decoders | Encoders |
|:-------------|:----------------:|:---------------------:|
| HEIC | libde265, ffmpeg | x265, kvazaar |
| AVIF | AOM, dav1d | AOM, rav1e, svt-av1 |
| VVC | - | uvg266 (experimental) |
| JPEG | libjpeg(-turbo) | libjpeg(-turbo) |
| JPEG2000 | OpenJPEG | OpenJPEG |
| uncompressed | built-in | built-in |
| Format | Decoders | Encoders |
|:-------------|:-------------------:|:----------------------------:|
| HEIC | libde265, ffmpeg | x265, kvazaar |
| AVIF | AOM, dav1d | AOM, rav1e, svt-av1 |
| VVC | vvdec (experimental)| vvenc, uvg266 (experimental) |
| JPEG | libjpeg(-turbo) | libjpeg(-turbo) |
| JPEG2000 | OpenJPEG | OpenJPEG |
| uncompressed | built-in | built-in |

## API

Expand Down Expand Up @@ -155,13 +155,13 @@ For each codec, there are two configuration variables:
* `WITH_{codec}_PLUGIN`: when enabled, the codec is compiled as a separate plugin.

In order to use dynamic plugins, also make sure that `ENABLE_PLUGIN_LOADING` is enabled.
The placeholder `{codec}` can have these values: `LIBDE265`, `X265`, `AOM_DECODER`, `AOM_ENCODER`, `SvtEnc`, `DAV1D`, `FFMPEG_DECODER`, `JPEG_DECODER`, `JPEG_ENCODER`, `KVAZAAR`, `OpenJPEG_DECODER`, `OpenJPEG_ENCODER`, `OPENJPH_ENCODER`
The placeholder `{codec}` can have these values: `LIBDE265`, `X265`, `AOM_DECODER`, `AOM_ENCODER`, `SvtEnc`, `DAV1D`, `FFMPEG_DECODER`, `JPEG_DECODER`, `JPEG_ENCODER`, `KVAZAAR`, `OpenJPEG_DECODER`, `OpenJPEG_ENCODER`, `OPENJPH_ENCODER`, `VVDEC`, `VVENC`, `UVG266`.

Further options are:

* `WITH_UNCOMPRESSED_CODEC`: enable support for uncompressed images according to ISO/IEC 23001-17:2023. This is *experimental*
and not available as a dynamic plugin.
* `WITH_DEFLATE_HEADER_COMPRESSION`: enables support for compressed metadata. When enabled, it adds a dependency to `zlib`.
* `WITH_UNCOMPRESSED_CODEC`: enable support for uncompressed images according to ISO/IEC 23001-17:2024. This is *experimental*
and not available as a dynamic plugin. When enabled, it adds a dependency to `zlib`, and optionally will use `brotli`.
* `WITH_HEADER_COMPRESSION`: enables support for compressed metadata. When enabled, it adds a dependency to `zlib`.
Note that header compression is not widely supported yet.
* `WITH_LIBSHARPYUV`: enables high-quality YCbCr/RGB color space conversion algorithms (requires `libsharpyuv`,
e.g. from the `third-party` directory).
Expand All @@ -170,7 +170,7 @@ Further options are:
* `PLUGIN_DIRECTORY`: the directory where libheif will search for dynamic plugins when the environment
variable `LIBHEIF_PLUGIN_PATH` is not set.
* `WITH_REDUCED_VISIBILITY`: only export those symbols into the library that are public API.
Has to be turned off for running the tests.
Has to be turned off for running some tests.

### macOS

Expand Down Expand Up @@ -305,15 +305,15 @@ This is `libheif` running in JavaScript in your browser.
## Example programs

Some example programs are provided in the `examples` directory.
The program `heif-convert` converts all images stored in an HEIF/AVIF file to JPEG or PNG.
The program `heif-dec` converts all images stored in an HEIF/AVIF file to JPEG or PNG.
`heif-enc` lets you convert JPEG files to HEIF/AVIF.
The program `heif-info` is a simple, minimal decoder that dumps the file structure to the console.

For example convert `example.heic` to JPEGs and one of the JPEGs back to HEIF:

```sh
cd examples/
./heif-convert example.heic example.jpeg
./heif-dec example.heic example.jpeg
./heif-enc example-1.jpeg -o example.heif
```

Expand Down Expand Up @@ -377,5 +377,5 @@ The sample applications are distributed under the terms of the MIT License.
See COPYING for more details.

Copyright (c) 2017-2020 Struktur AG</br>
Copyright (c) 2017-2023 Dirk Farin</br>
Copyright (c) 2017-2024 Dirk Farin</br>
Contact: Dirk Farin <[email protected]>
17 changes: 10 additions & 7 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,32 @@ image: Visual Studio 2022
configuration: Release
cache: c:\tools\vcpkg\installed\

matrix:
allow_failures:
- arch: arm64 # libde265 currently doesn't support arm64 on vcpkg

environment:
matrix:
- arch: x64
- arch: arm64

install:
- vcpkg install libde265:%arch%-windows
- vcpkg install x265:%arch%-windows
- vcpkg install aom:%arch%-windows
- vcpkg install dav1d:%arch%-windows
- vcpkg install ffmpeg[avcodec]:%arch%-windows
- vcpkg install libde265:%arch%-windows
- vcpkg install libjpeg-turbo:%arch%-windows
- vcpkg install libpng:%arch%-windows
- vcpkg install tiff:%arch%-windows
- ps: If (${env:arch} -eq "x64") { vcpkg install x265:${env:arch}-windows }
- vcpkg install zlib:%arch%-windows
- cd c:\tools\vcpkg
- vcpkg integrate install
- cd %APPVEYOR_BUILD_FOLDER%

before_build:
- mkdir build
- cd build
- cmake .. -A %arch% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
- 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

build:
parallel: true
verbosity: normal

artifacts:
Expand Down
22 changes: 15 additions & 7 deletions build-emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ SRCDIR=$1

CORES="${CORES:-`nproc --all`}"
ENABLE_LIBDE265="${ENABLE_LIBDE265:-1}"
LIBDE265_VERSION="${LIBDE265_VERSION:-1.0.12}"
LIBDE265_VERSION="${LIBDE265_VERSION:-1.0.15}"
ENABLE_AOM="${ENABLE_AOM:-0}"
AOM_VERSION="${AOM_VERSION:-3.6.1}"
STANDALONE="${STANDALONE:-0}"
DEBUG="${DEBUG:-0}"
USE_WASM="${USE_WASM:-1}"
USE_TYPESCRIPT="${USE_TYPESCRIPT:-1}"
USE_UNSAFE_EVAL="${USE_UNSAFE_EVAL:-1}"

echo "Build using ${CORES} CPU cores"

Expand All @@ -46,9 +48,10 @@ if [ "$ENABLE_LIBDE265" = "1" ]; then
emmake make -j${CORES}
cd ..
fi
CONFIGURE_ARGS_LIBDE265="-DLIBDE265_INCLUDE_DIR=${DIR}/libde265-${LIBDE265_VERSION} -DLIBDE265_LIBRARY=-L${DIR}/libde265-${LIBDE265_VERSION}/libde265/.libs"
LIBDE265_DIR="$(pwd)/libde265-${LIBDE265_VERSION}"
CONFIGURE_ARGS_LIBDE265="-DLIBDE265_INCLUDE_DIR=${LIBDE265_DIR} -DLIBDE265_LIBRARY=-L${LIBDE265_DIR}/libde265/.libs"
LIBRARY_LINKER_FLAGS="$LIBRARY_LINKER_FLAGS -lde265"
LIBRARY_INCLUDE_FLAGS="$LIBRARY_INCLUDE_FLAGS -L${DIR}/libde265-${LIBDE265_VERSION}/libde265/.libs"
LIBRARY_INCLUDE_FLAGS="$LIBRARY_INCLUDE_FLAGS -L${LIBDE265_DIR}/libde265/.libs"
fi

CONFIGURE_ARGS_AOM=""
Expand Down Expand Up @@ -80,9 +83,10 @@ if [ "$ENABLE_AOM" = "1" ]; then
cd ..
fi

CONFIGURE_ARGS_AOM="-DAOM_INCLUDE_DIR=${DIR}/aom-${AOM_VERSION}/aom-source -DAOM_LIBRARY=-L${DIR}/aom-${AOM_VERSION}"
AOM_DIR="$(pwd)/aom-${AOM_VERSION}"
CONFIGURE_ARGS_AOM="-DAOM_INCLUDE_DIR=${AOM_DIR}/aom-source -DAOM_LIBRARY=-L${AOM_DIR}"
LIBRARY_LINKER_FLAGS="$LIBRARY_LINKER_FLAGS -laom"
LIBRARY_INCLUDE_FLAGS="$LIBRARY_INCLUDE_FLAGS -L${DIR}/aom-${AOM_VERSION}"
LIBRARY_INCLUDE_FLAGS="$LIBRARY_INCLUDE_FLAGS -L${AOM_DIR}"
fi

EXTRA_EXE_LINKER_FLAGS="-lembind"
Expand All @@ -108,7 +112,12 @@ EXPORTED_FUNCTIONS=$($EMSDK/upstream/bin/llvm-nm $LIBHEIFA --format=just-symbols

echo "Running Emscripten..."

BUILD_FLAGS="-lembind -o libheif.js --post-js ${SRCDIR}/post.js -sWASM=$USE_WASM"
BUILD_FLAGS="-lembind -o libheif.js --post-js ${SRCDIR}/post.js -sWASM=$USE_WASM -sDYNAMIC_EXECUTION=$USE_UNSAFE_EVAL"

if [ "$USE_TYPESCRIPT" = "1" ]; then
BUILD_FLAGS="$BUILD_FLAGS --emit-tsd libheif.d.ts"
fi

RELEASE_BUILD_FLAGS="-O3"

if [ "$STANDALONE" = "1" ]; then
Expand All @@ -128,7 +137,6 @@ emcc -Wl,--whole-archive "$LIBHEIFA" -Wl,--no-whole-archive \
-sEXPORT_NAME="libheif" \
-sWASM_ASYNC_COMPILATION=0 \
-sALLOW_MEMORY_GROWTH \
--memory-init-file 0 \
-std=c++11 \
$LIBRARY_INCLUDE_FLAGS \
$LIBRARY_LINKER_FLAGS \
Expand Down
Loading