Files
Jungfraujoch/compression/CMakeLists.txt
T
leonarski_fandClaude Opus 4.8 7e7a73062c Compression: add BSHUF_ZSTD_RLE_HUFF (RLE runs + Huffman literals)
New CompressionAlgorithm that emits a standard Zstandard frame: zero/0xFF runs
become RLE_Blocks (like BSHUF_ZSTD_RLE) and literal regions become
Compressed_Blocks with per-block adaptive Huffman literals and no sequences
(Number_of_Sequences=0). Short runs are absorbed into the literal stream;
incompressible literals fall back to Raw_Blocks so the worst case stays within
ZSTD_compressBound.

The Huffman tree + bitstream are produced by zstd's own HUF_compress{1,4}X_repeat
(the same calls ZSTD_compressLiterals uses); only the frame/block/literals-section
framing is hand-written, with comments citing zstd_compression_format.md so it can
be checked clause by clause. Output decodes with stock ZSTD_decompress, so no
reader changes are needed (decode routes like BSHUF_ZSTD).

On sparse diffraction this gives ~12% smaller files than bitshuffle/LZ4 at about
the same end-to-end speed, sitting between LZ4 and full ZSTD; for maximum ratio
use BSHUF_ZSTD. Robust on any input: tests round-trip pure zeros, Poisson(10),
Mersenne-Twister noise (checked against the size bound), an extreme-sparsity mask,
and a real lyso image through stock ZSTD_decompress.

API: exposed as "bszstd_rlehuf"; regenerate the Python/TS clients (update_version.sh)
to surface the new value there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 14:41:46 +02:00

22 lines
775 B
CMake

ADD_LIBRARY(Compression STATIC
lz4/lz4.c
lz4/lz4.h
bitshuffle/bitshuffle.c
bitshuffle/bitshuffle_core.c
bitshuffle/iochain.c
bitshuffle_hperf/bitshuffle.c
bitshuffle_hperf/bitshuffle.h
JFJochZstdCompressor.cpp
JFJochZstdCompressor.h
JFJochZstdHuffCompressor.cpp
JFJochZstdHuffCompressor.h
JFJochCompressor.cpp
JFJochCompressor.h
JFJochDecompress.h
MaxCompressedSize.cpp
MaxCompressedSize.h)
set_target_properties(Compression PROPERTIES POSITION_INDEPENDENT_CODE ON)
TARGET_COMPILE_DEFINITIONS(Compression PUBLIC -DZSTD_SUPPORT -DUSE_ZSTD)
TARGET_LINK_LIBRARIES(Compression libzstd_static)
TARGET_INCLUDE_DIRECTORIES(Compression PUBLIC . zstd/lib)