Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7926523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:48:31+00:00 2026-06-03T18:48:31+00:00

I am developing a file compressor program. We are currently implementing .ZIP archiver standart,

  • 0

I am developing a file compressor program. We are currently implementing .ZIP archiver standart, so that when generate a compressed .ZIP archiver any other reputable compressor (such as 7zip) can perfectly understand/uncompres it.

We are now developing the DEFLATE algorithm based on RFC 1951
We have a variant of LZ77 and the Huffman coding with fixed codes working perfectly and compatible with the RFC, thus working with Literal-Length + Distance values.

On the Dynamic Huffman Coding I am currently able to extract the Huffman trees from some compressed data (compressed via another reliable compressor), but when it’s time to start decompressing the real data I get incorrect values.
Possibly I’m reading the trees in a wrong way.

I have not specificly found any place where someone explains with exactitude the way the values of these trees are stored on the compressed data.

I assume the encoded data follows the same literal-length values (0~285) + distance (0~30) with its corresponding extra bits per literal / distance as explained in the RFC the same way fixed huffman encoding does.

The way this is stored on fixed huffman encoding is that Huffman Codes are stored with the most significant bit of the code on the least significant bit in memory. This way you are able to navigate down the encoding tree reading bit by bit.
Extra bits of the Huffman code are stored the other way instead .

Does Dynamic Huffman Coding store them the same way?

Is there something I am missing or that I should be aware?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T18:48:37+00:00Added an answer on June 3, 2026 at 6:48 pm

    First off, you don’t need to do what you’re doing, since it has already been done for you in zlib, a free compression library that permits commercial use. zlib provides implementations of deflate compression and inflate decompression, per RFC 1951. Also you can use minizip, which is included as a third party contribution in the zlib source code package, or libzip, to process zip files using zlib.

    If you are intent on doing it yourself, then you can look at puff.c, also in the zlib distribution, which was written with the purpose of supplementing RFC 1951 with an unambiguous definition of the deflate format by virtue of being a heavily commented working deflate decoder.

    RFC 1951 does in fact explain the format with exactitude. You just need to read it carefully. puff.c may help accelerate the learning process.

    The correct term for the non-fixed Huffman coding is “dynamic”. Not “adaptive”. The reason is that the term “Adaptive Huffman” refers to something else — a special technique that is not used in the deflate format — where the Huffman tree actually morphs as you move through the data. Dynamic Huffman coding, what deflate uses, instead breaks the data up into blocks, and sends a complete Huffman code for each block that is constant throughout that block.

    Yes, the dynamic Huffman codes and extra bits are stored in the same order as the fixed Huffman codes. The tricky part is understanding how the Huffman codes are transmitted in the deflate stream header for each block.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a solution that allows people to upload a DOCX file as a
I'm developing an extension for Google Chrome that generates an mp3 file and saves
I'm currently developing a firefox extension which checks some server side XML-File on a
Iam developing one applcation.In that,in my xml file having the threetags with same name
I'm currently developing a web file browser using jquery and php. One of my
I am developing a compressor and the result are bytes (ASCII 0-255) that I
I am developing an ASPX file that returns results from a SQL stored proc
I'm currently developing a mex-file with CUDA functionality to be used in MATLAB. When
I'm developing an application that will Download another apk file, and asks for it's
I'm developing software that will utilize a config file. I don't know many syntaxes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.