Questions tagged [deflate]

deflate is a lossless data compression format, and also refers to implementations that compress to the deflate format. The deflate format was created by Phil Katz of PKWare for the PKZip (.zip) archive format. Public domain software provides deflate and inflate functionality in the gzip utility and the zlib library.

Documentation of the deflate format may be found in RFC-1951

588 questions
7
votes
2 answers

Deflate and fixed Huffman codes

I'm trying to implement a deflate compressor and I have to decide whether to compress a block using the static huffman code or create a dynamic one. What is the rationale behind the length associated with the static code? (this is the table included…
dvd
  • 1,014
  • 6
  • 12
7
votes
2 answers

How to find the compression level of a zip file?

I would like to know how to find the compression level of a zip file. Zip files made by 7z and winzip have different ratings for levels, so i would like to map few of them to their corresponding level in the other tool. Store level or level 0 for…
theCrow
  • 176
  • 3
  • 13
7
votes
1 answer

How does DEFLATE(zlib) determine block size?

I wonder how DEFLATE determines block size(I mean, in zlib.) In RFC 1591, following explanation exists: "The compressor terminates a block when it determines that starting a new block with fresh trees would be useful, or when the block size fills up…
S.Lee
  • 73
  • 1
  • 5
7
votes
3 answers

DICOM Deflated Explicit VR Little Endian (1.2.840.10008.1.2.1.99)

How is the data in this transfer syntax organized? A description from the standard: This Transfer Syntax applies to the encoding of the entire DICOM Data Set. The entire Data Set is first encoded according to the rules specified in Section A.2. …
martinez314
  • 12,162
  • 5
  • 36
  • 63
7
votes
1 answer

Implementing permessage-deflate in WebSockets

I hava a problem understanding and implementing a permessage-deflate extension in WebSockets. So far, I have added 'Sec-WebSocket-Extensions: permessage-deflate' inside handshake code. It seems to work all fine. However when I send a "TEST" message…
user1491657
  • 81
  • 1
  • 1
  • 3
7
votes
2 answers

Deflate length of 258 double encoding

In Deflate algorithm there are two ways to encode a length of 258: Code 284 + 5 extra bits of all 1's Code 285 + 0 extra bits; On first glance, this is not optimal, because the proper use of code 285 would allow a length of 259 be encoded; Is this…
johnfound
  • 6,857
  • 4
  • 31
  • 60
7
votes
3 answers

What is the maximum size of encoded dynamic Huffman tree as used by DEFLATE (zlib, gzip) format?

Section "3.2.7. Compression with dynamic Huffman codes (BTYPE=10)" of https://www.ietf.org/rfc/rfc1951.txt describes encoding of dynamic Huffman tree used during compression. What is the maximum size (in bits) of such encoded Huffman tree…
pfalcon
  • 6,724
  • 4
  • 35
  • 43
7
votes
1 answer

Benchmarking Zlib Java vs. C

I'm trying to speed up my TIFF encoder initially written in Java by switching to C and have compiled Zlib 1.2.8 with Z_SOLO defined and minimum set of C files: adler32.c, crc32.c, deflate.c, trees.c and zutil.c. Java is using…
Matthieu
  • 2,736
  • 4
  • 57
  • 87
7
votes
1 answer

ServiceStack - Using gzip/deflate compression with JSONP requests

I have a ServiceStack service that compresses the response using RequestContext.ToOptimizedResult(), e.g.: [Route("/numbers/search")] public class FindNumbers { } public object Get(FindNumbers query) { var data = new List { "One",…
SteveChapman
  • 3,051
  • 1
  • 22
  • 37
7
votes
2 answers

Deflate in Java - Inflate in Javascript

I'm sending compressed data from a java app via nodejs to a webpage. The data is compressed with the java deflater and base64 encoded. On the webpage I'm trying to inflate the data with https://github.com/dankogai/js-deflate, but it does not work…
dbrettschneider
  • 3,173
  • 1
  • 29
  • 28
6
votes
3 answers

Enable mod_deflate to send Content-Encoding: gzip

EDIT I have found that the problem is actually php minify. This was sending the deflated content instead of Apache. I'll find more on this. According to High Performance Web Sites, if I enable mod_deflate in Apache 2.x, by adding the following line,…
Sabya
  • 11,534
  • 17
  • 67
  • 94
6
votes
3 answers

Rails Paperclip image compression compared to what Page Speed produces

I've set up paperclip in rails and everything is working hunky-dory (i actually had to google that...:). I've noticed however that Page Speed tells me I could losslessly compress my thumbnail and large images (the ones that paperclip produces)…
6
votes
1 answer

Using Java Deflater/Inflater with custom dictionary causes IllegalArgumentException

The following code is based on the example given in the javadocs for java.util.zip.Deflater. The only changes I have made is to create a byte array called dict and then set the dictionary on both the Deflater and Inflater instances using the…
Mike Deck
  • 18,045
  • 16
  • 68
  • 92
6
votes
1 answer

The structure of Deflate compressed block

I have troubles with understanding Deflate algorithm (RFC 1951). TL; DR How to parse Deflate compressed block 4be4 0200? I created a file with a letter and newline a\n in it, and run gzip a.txt. Resultant file a.txt.gz: 1f8b 0808 fe8b eb55 0003 612e…
EugZol
  • 6,476
  • 22
  • 41
6
votes
2 answers

Git DEFLATE/optimized zlib

We have some really big repositories in git, in these we have observed how remote/server compression is a bottleneck when cloning/pulling. Given how pervasive git has become and that is uses zlib, has this zlib compression been optimized? An Intel…
nietras
  • 3,949
  • 1
  • 34
  • 38