Add std/png benches for ignore/verify checksums

wuffs_png_decode_image_552k_32bpp_ignore_checksum/clang9   324MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_verify_checksum/clang9   258MB/s ± 0%

wuffs_png_decode_image_552k_32bpp_ignore_checksum/gcc10    319MB/s ± 0%
wuffs_png_decode_image_552k_32bpp_verify_checksum/gcc10    269MB/s ± 0%
This commit is contained in:
Nigel Tao committed 2021-01-22 11:34:52 +11:00
1 parent 5669f6da87
commit 170a810486
2 files changed
+49 -4

No files matched your search

+21
View File
@@ -14,6 +14,8 @@
#include "png.h"
#define WUFFS_MIMICLIB_PNG_DOES_NOT_SUPPORT_QUIRK_IGNORE_CHECKSUM 1
const char* //
mimic_png_decode(uint64_t* n_bytes_out,
wuffs_base__io_buffer* dst,
@@ -40,6 +42,25 @@ mimic_png_decode(uint64_t* n_bytes_out,
goto cleanup0;
}
size_t i;
for (i = 0; i < quirks_len; i++) {
uint32_t q = quirks_ptr[i];
if (q == WUFFS_BASE__QUIRK_IGNORE_CHECKSUM) {
// TODO: configure libpng to ignore Adler-32 and CRC-32 checksums.
//
// The libpng "simplified API" (based on the png_image struct type) does
// not offer an equivalent of libpng's lower level API's
// png_set_crc_action and png_set_option(etc, PNG_IGNORE_ADLER32, etc).
// But the lower level API is complicated (hence why libpng introduced a
// "simplified API" in the first place), especially trying to make the
// equivalent of the png_image.format field work.
//
// Instead, we simply disable (via the
// WUFFS_MIMICLIB_PNG_DOES_NOT_SUPPORT_QUIRK_IGNORE_CHECKSUM macro) any
// tests or benches that try to use WUFFS_BASE__QUIRK_IGNORE_CHECKSUM.
}
}
switch (pixfmt.repr) {
case WUFFS_BASE__PIXEL_FORMAT__Y:
pi.format = PNG_FORMAT_GRAY;