Results 1 to 3 of 3

Thread: deflate

  1. #1
    Member
    Join Date
    Jun 2018
    Location
    Yugoslavia
    Posts
    58
    Thanks
    8
    Thanked 3 Times in 3 Posts

    deflate

    apart from compression level and size of the sliding window, what makes zip encoder produce different deflate data from other algorithms?

  2. #2
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,918
    Thanks
    291
    Thanked 1,276 Times in 722 Posts
    Do you mean, why other deflate libraries produce different deflate data than zlib?

    Any LZ format has multiple ways to parse the data into strings (eg. "abc"="a"."b"."c"="ab"."c"="a"."bc"),
    plus a string can be encoded as a reference to any of its previous occurrences within the window, which adds even more options.

    Deflate is a relatively complicated version of LZ algorithm - it uses Huffman coding for the data,
    then RLE + Huffman for length tables of primary Huffman codes.

    So there're multiple options for splitting the data into blocks, then parsing each block, then encoding of each block header.
    Its actually very hard to find one specific way of data parsing that would result in best compression - there're too many
    combinations so just trying all of them is impossible, and even iterative optimization methods can run for a week and
    still keep finding small improvements.

    Thus all practical compressor implementations only can rely on various heuristics to run with reasonable speed,
    so its not surprising that different implementations would produce different outputs - its pretty unlikely
    that different developers would make the same intuitive choices dozens of times.

  3. Thanks:

    pklat (5th June 2020)

  4. #3
    Member
    Join Date
    Jun 2018
    Location
    Yugoslavia
    Posts
    58
    Thanks
    8
    Thanked 3 Times in 3 Posts
    Thanks Shelwien, I understand (better) now.

Similar Threads

  1. deflate decoding benchmark
    By Shelwien in forum Data Compression
    Replies: 10
    Last Post: 29th November 2019, 12:14
  2. Efficient deflate implementations
    By Bulat Ziganshin in forum Data Compression
    Replies: 10
    Last Post: 27th March 2019, 23:25
  3. understanding of deflate
    By Defplus in forum Data Compression
    Replies: 5
    Last Post: 14th July 2017, 20:48
  4. Optimal Deflate
    By FunkyBob in forum Data Compression
    Replies: 14
    Last Post: 15th June 2017, 15:46
  5. deflate model for paq8?
    By kaitz in forum Data Compression
    Replies: 2
    Last Post: 6th February 2009, 20:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •