From c702c0fdde27d72536ca9f24637fde2f76b0b0ec Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 7 Feb 2024 20:51:38 +0000 Subject: [PATCH] sync with zlib.h ok jmc --- lib/libz/compress.3 | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/libz/compress.3 b/lib/libz/compress.3 index 96db2af96e9..73d21d573c1 100644 --- a/lib/libz/compress.3 +++ b/lib/libz/compress.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: compress.3,v 1.26 2024/01/20 11:16:27 tb Exp $ +.\" $OpenBSD: compress.3,v 1.27 2024/02/07 20:51:38 tb Exp $ .\" .\" Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler .\" @@ -23,7 +23,7 @@ .\" .\" This page corresponds to zlib version 1.2.3 .\" -.Dd $Mdocdate: January 20 2024 $ +.Dd $Mdocdate: February 7 2024 $ .Dt COMPRESS 3 .Os .Sh NAME @@ -1127,33 +1127,41 @@ for normal data; .Dv Z_FILTERED for data produced by a filter .Pq or predictor ; -.Dv Z_HUFFMAN_ONLY -to force Huffman encoding only -.Pq no string match , -or .Dv Z_RLE to limit match distances to one -.Pq run-length encoding . +.Pq run-length encoding , +or +.Dv Z_HUFFMAN_ONLY +to force Huffman encoding only +.Pq no string match . Filtered data consists mostly of small values with a -somewhat random distribution. +somewhat random distribution, +as produced by the PNG filters. In this case, the compression algorithm is tuned to compress them better. The effect of .Dv Z_FILTERED -is to force more Huffman coding and less string matching; -it is somewhat intermediate between +is to force more Huffman coding and less string matching than the default; +it is intermediate between .Dv Z_DEFAULT_STRATEGY and .Dv Z_HUFFMAN_ONLY . .Dv Z_RLE -is designed to be almost as fast as +is almost as fast as .Dv Z_HUFFMAN_ONLY , -but gives better compression for PNG image data. +but should give better compression for PNG image data than Huffman only. +The degree of string matching from most to none is: +.Dv Z_DEFAULT_STRATEGY , +.Dv Z_FILTERED , +.Dv Z_RLE , +then +.Dv Z_HUFFMAN . The .Fa strategy -parameter only affects the compression ratio but not the correctness of the -compressed output, even if it is not set appropriately. +parameter affects the compression ratio but never the correctness of the +compressed output, even if it is not set optimally for the given data. .Dv Z_FIXED -prevents the use of dynamic Huffman codes, +uses the default string matching, +but prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. .Pp .Fn deflateInit2 -- 2.20.1