- Requires zlib
- Fixed width integer types up to
- Integers must be two’s complement.
CHAR_BITmust equal 8.
size_tmust be unsigned and at least 32-bit, 16-bit platforms are not supported.
Build with CMake¶
mkdir cbuild cd cbuild cmake .. make make install
Build with Meson¶
meson build cd build ninja ninja install
Architecture-specific optimizations are enabled by default,
this can be disabled with the
SPNG_DISABLE_OPT compiler option.
The Meson project has an
enable_opt option, it is enabled by default,
the CMake equivalent is
Optimizations on x86 require SSE2 by default, to enable SSSE3
-DSPNG_SSE=3 as a compiler option, this improves
performance by up to 7%.
Compiler-specific macros are used to omit the need for the
-mssse3 compiler flags, if the code does not compile without these flags
you should file a bug report.
Profile-guided optimization (PGO) improves performance by up to 10%.
# Run in root directory git clone https://gitlab.com/randy408/benchmark_images.git cd build meson configure -Dbuildtype=release --default-library both -Db_pgo=generate ninja ./example ../benchmark_images/medium_rgb8.png ./example ../benchmark_images/medium_rgba8.png ./example ../benchmark_images/large_palette.png meson configure -Db_pgo=use ninja ninja install