Skip to main content

All Questions

Tagged with
0 votes
1 answer
31 views

how to correctly decode data when bits are read from right to left?

I have had my fair share of understanding compression so with major discoveries that i will later post on github but i am still unable to manually decode few byte sequence accordingly. here is the ...
terry franklin's user avatar
1 vote
1 answer
64 views

How can one correctly extract Huffman Tree from a dynamic compressed block?

My problem is similar to the one solved HERE, with few differences. So the a Deflated block with dynamic Huffman codes is structured like this: |Block Header|compressed block|end of block| Then Block ...
terry franklin's user avatar
0 votes
1 answer
39 views

Is it possible match initial bytes of Deflate compressed data using knowledge of first portion of uncompressed data?

So my obsession with deflate compression is leading me no where but i feel like there is something i can do the process better. Here is what i understood so far: def lz77(uncompressed): #find ...
terry franklin's user avatar
0 votes
1 answer
60 views

Iterate through all possible code length distributions for canonical Huffman

Given the constraints imposed by Deflate (as used in zlib), I want to iterate through all possible code length distributions to find extreme cases which might break my assumptions. Deflate assigns the ...
sh1's user avatar
  • 4,650
0 votes
1 answer
89 views

Should stream's next_in, the compressed buffer be available for inflatePrime() ? - zlib

I noticed on 2nd boot up, when inflatePrime() is called, stream.next_in doesn't have a compressed data buffer assigned yet, so how would it insert bits? (byte offset and bit offset, how they work to ...
Anton Fernando's user avatar
1 vote
1 answer
315 views

DEFLATE Block Header

I had a few questions regarding the header of a DEFLATE block, specifically concerning this section: 5 Bits: HLIT, # of Literal/Length codes - 257 (257 - 286) 5 Bits: ...
AviatingFotographer's user avatar
0 votes
1 answer
166 views

LZ77 Extra Bits in DEFLATE

In the LZ77 phase of the DEFLATE compression, extra bits are used to represent the length and distances of the back reference. However, are these extra bits concatenated onto the base values to form a ...
AviatingFotographer's user avatar
0 votes
1 answer
754 views

How to read and decode zlib block and deflate block in a png image file

Recently I started writing a png decoder for fun.And for understanding the format and compression I have read the following PNG (Portable Network Graphics) Specification, Version 1.2) RFC 1950("...
Nobody's user avatar
  • 5
0 votes
1 answer
236 views

How are Huffman trees transmitted?

I'm trying to understand how the DEFLATE algorithm works. I found this document published by UC Davis. I don't understand the part where it talks about how Huffman trees are transmitted Probably the ...
rayanJ's user avatar
  • 71
0 votes
1 answer
312 views

Why is the literal/length alphabet in the DEFLATE format 286 symbols long?

According to the DEFLATE specification (RFC 1951), the literal and length alphabets are combined in order to be decoded using one huffman tree. The literal and length alphabets are both 256 symbols ...
fortytoo's user avatar
  • 462
0 votes
1 answer
108 views

Deflate: code lengths of > 7 bits for top-level HCLEN?

RFC 1951 specifies that the first level of encoding in a block contains HCLEN 3-bit values, which encode the lengths of the next level of Huffman codes. Since these are 3-bit values, it follows that ...
persson's user avatar
  • 149
0 votes
1 answer
151 views

DEFLATE: how to handle "no distance codes" case?

I mostly get RFC 1951, however I'm not too clear on how to manage the case where (when using dynamic Huffman tables) no distance codes are needed or present. For example, let's take the input: ...
persson's user avatar
  • 149
0 votes
1 answer
242 views

Memory usage by DEFLATE algorithm

Many implementations of the DEFLATE algorithm allow for stream-based inputs. An example is Java's java.util.zip.ZipOutputStream. As far as I'm aware, DEFLATE builds a Huffman tree prior to compression ...
GingerBadger's user avatar
0 votes
1 answer
178 views

Size constraints on DEFLATE Huffman trees

Reading through RFC 1951, it seems like a valid dynamic Huffman tree is not necessarily a full binary tree - for example, the tree specified by the bit lengths (2, 2, 2) has a node with a single child:...
squirl's user avatar
  • 1,734
-2 votes
1 answer
485 views

How to Merge huffman and lz77?

I have huffman and lz77 codes, but I need any way to merge this algorithms to make deflate How i can do this? I have to write it manually without using libraries.
Mohamad1299's user avatar

15 30 50 per page