load_png(mem), load_tga(file), load_jpg(file/mem) and load_qoi(mem/file) now
go through a thin Wuffs C-API adapter (wuffs_load_ldr) when
BASISU_USE_WUFFS_LDR_LOADER is 1 (the default, basisu_enc.h). Everything
built on them (load_image, load_image_hdr's LDR paths, basis_compressor,
the basisu tool, KTX2 Studio's WASM encoder) switches automatically. The
old pvpngreader / read_tga() / jpgd / qoi.h decode bodies stay in #else
branches (=0 gives today's code; qoi.h is still used to write .QOI).
The adapter only converts to basisu's RGBA image, enforces the caps and
reports errors. Wuffs' accept/reject and pixels are final: no fallback,
no fixups. decode_image_config reads the header, then a 0 width/height
("empty image"), width/height > BASISU_WUFFS_LDR_MAX_DIM (default
basist::BASISU_MAX_SUPPORTED_TEXTURE_DIMENSION = 16384) or a work buffer >
BASISU_WUFFS_LDR_MAX_WORKBUF_BYTES (default 3 GiB here, the measured worst
case at 16384^2; tradeoff documented in basisu_enc.h) is refused BEFORE any
pixel or work buffer is allocated. All memory is basisu's own
(image::try_alloc - added here - and try_resize, initialized); img is only
replaced on success; nothing asserts on file data.
get_ldr_image_info() is a header-only query (no cap) that returns the
true dimensions, even of files beyond the decode cap.
Wuffs is declared here (wuffs-v0.4.c included without
WUFFS_IMPLEMENTATION, same config header) and compiled in
encoder/3rdparty/basisu_wuffs.cpp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linux's `<sys/timex.h>` header was used instead of
FreeBSD's <sys/time.h> due to missing preprocessor comparison.
Co-authored-by: robfram <robfram@gmail.com>
- Optimized ETC1S encoder (3-4.5x faster)
- Added optional SSE 4.1 support to encoder
- Switched from std::vector to a custom vector in the encoder and transcoder
- Added CppSPMD (SSE only for now)
- UASTC RDO is now more effective, but the command line parameter controlling qualiy has changed (to "lambda")
Encoder is now a library in the "encoder" directory
JavaScript wrappers now expose the entire codec: encoder, transcoder, container independent transcoding, and .basis file information