Results 1 to 3 of 3

Thread: defdb a tool to dump the deflate stream from .gz and .png files

  1. #1
    Member caveman's Avatar
    Join Date
    Jul 2009
    Location
    Strasbourg, France
    Posts
    189
    Thanks
    6
    Thanked 53 Times in 32 Posts

    defdb a tool to dump the deflate stream from .gz and .png files

    This is an update of pngdb (since it handles .gz files the name has changed)

    Code:
    defdb: displays deflate block Type Boundary and Size & full stream size in bits.
    Version 0.4b (18 May 2014) by Frederic Kayser
    Usage: defdb [-s|-d|-t|-a|-w] file[.png|.gz]
    Options: -s displays only the Deflate stream overall size
             -d dumps the entire Deflate stream in human readable form
             -t same as option d plus printable ASCII literals
             -a displays header analyse
             -w writes the raw deflate stream in file raw_deflate_stream
    -s is for quick comparison of stream lengths in bits
    -a is not finished yet, it is ment to compare the current header and a zlib produced one.
    -d is a nice way to understand how a deflate stream is actually made.
    Each line represents an element of the stream, its size (in bits) is figured between square brackets [].
    Concerning the block headers you have to be familiar with RFC 1951 to understand them.
    Once in the data stream itself these conventions are used:
    - [size] XX, a literal value XX in hexa (ranges from 00 to FF that is 0 to 255), takes size bits.
    - [size] (length, distance), LZ pair in decimal -length between 3 and 258, distance between 1 and 32768-, takes size bits.
    - [size] EofB, End of Block, takes size bits.

    It looks like this:
    Code:
     [3] 00
     [9] (3,1)
     [5] 1E
     [3] 00
    [11] (7,1)
     [5] 21
    [10] (8,9)
     [4] 40
     [4] 80
     [8] (6,9)
    ...
    [12] (9,432)
    [12] (9,450)
    [12] (9,468)
    [12] (9,486)
    [6] EoB
    [3] 00 -> a literal of value 00, takes 3 bits in the stream
    [9] (3,1) -> an LZ match of length 3 and distance 1, takes 9 bits in the stream (9 is the sum of two parts: the lenght length and the distance length these can be found in the block header).

    I've started an experimental work to display compression efficiency of text files in the same way as pngthermal, it's called gzthermal.
    Attached Files Attached Files
    Last edited by caveman; 24th May 2014 at 14:19. Reason: New version 0.4b with printable ASCII

  2. The Following 2 Users Say Thank You to caveman For This Useful Post:

    Bulat Ziganshin (19th May 2014),Jaff (7th October 2013)

  3. #2
    Member m^2's Avatar
    Join Date
    Sep 2008
    Location
    Ślůnsk, PL
    Posts
    1,524
    Thanks
    21
    Thanked 47 Times in 34 Posts
    Thank you.

  4. #3
    Member caveman's Avatar
    Join Date
    Jul 2009
    Location
    Strasbourg, France
    Posts
    189
    Thanks
    6
    Thanked 53 Times in 32 Posts
    New version 0.4b adds option "t" for text which is the same as "d" but will also display the ASCII char equivalent for literals. (First post updated, I'm a bit late with the Windows version, expect it tomorrow).
    Last edited by caveman; 22nd May 2014 at 11:34.

  5. The Following User Says Thank You to caveman For This Useful Post:

    Paul W. (19th May 2014)

Similar Threads

  1. convert swf files to avi files
    By Jabilo in forum Off-Topic
    Replies: 11
    Last Post: 28th April 2015, 05:14
  2. Comparison of lossless PNG compression tools
    By Surfer in forum Data Compression
    Replies: 54
    Last Post: 19th September 2011, 22:58
  3. Direct edit if palette entry in PNG?
    By SvenBent in forum Off-Topic
    Replies: 2
    Last Post: 14th September 2009, 22:51
  4. Easy way for BMF to png
    By SvenBent in forum Data Compression
    Replies: 5
    Last Post: 13th November 2008, 08:13
  5. unsupported PNG verient for Precomp
    By maadjordan in forum Data Compression
    Replies: 5
    Last Post: 22nd May 2008, 16:22

Posting Permissions

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