From 62b9df5d2af68262fa6fcfb66086bf128f7d67c3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 21 Dec 2017 13:32:02 +0100 Subject: Add ZSTD compression codec From https://github.com/facebook/zstd "Zstandard, or zstd as short version, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios. It's backed by a very fast entropy stage, provided by Huff0 and FSE library." We require libzstd >= 1.0.0 so as to be able to use streaming compression and decompression methods. The default compression level we have selected is 9 (range goes from 1 to 22), which experimentally offers equivalent or better compression ratio than the default deflate/ZIP level of 6, and much faster compression. For example on a 6600x4400 16bit image, tiffcp -c zip runs in 10.7 seconds, while tiffcp -c zstd runs in 5.3 seconds. Decompression time for zip is 840 ms, and for zstd 650 ms. File size is 42735936 for zip, and 42586822 for zstd. Similar findings on other images. On a 25894x16701 16bit image, Compression time Decompression time File size ZSTD 35 s 3.2 s 399 700 498 ZIP/Deflate 1m 20 s 4.9 s 419 622 336 --- libtiff/tiffiop.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libtiff/tiffiop.h') diff --git a/libtiff/tiffiop.h b/libtiff/tiffiop.h index 0f59a705..d44e76a5 100644 --- a/libtiff/tiffiop.h +++ b/libtiff/tiffiop.h @@ -422,6 +422,9 @@ extern int TIFFInitSGILog(TIFF*, int); #ifdef LZMA_SUPPORT extern int TIFFInitLZMA(TIFF*, int); #endif +#ifdef ZSTD_SUPPORT +extern int TIFFInitZSTD(TIFF*, int); +#endif #ifdef VMS extern const TIFFCodec _TIFFBuiltinCODECS[]; #else -- cgit v1.2.1