🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #53558

CP compression (or any) - some numbers...

#53558
From: The Archiver
Date: Mon, 30 Jul 2001 12:29
69 lines
2307 bytes
If someone wants to define a new scheme for compressing 
binaries efficiently (with an 8 bit mode) and has to encode
special chars (NUL, TAB, CR, LF) with 'escape chars':

I did a scan on a few common filetypes and made an 
evaluation of the occurrence of bytes.
A good compressed file would have an occurence of
approx 0.39% for each binary value (1 / 256).

1500 JPG pictures:

0x00: 1.3 %
0x01: 0.42 %
0xFE: 0.52 %
0xFF: 0.7%

500 MB AVI-DivX files

0x00: 1.54%
0x01: 0.69%
0x05: 0.71%
0x80: 0.68%
0xFF: 0.33%

500 MB  MP3-files

0x00: 1.77%
0x01: 0.43%
0xFB: 0.62%
0xFF: 1.30%

500 MB MPG file (movie)

0x00: 4.6%  (!)
0x01: 1.3%
0x02: 0.7%
0x60: 0.5%
0x80: 0.9%
0xFE: 0.28%
0xFF: 0.78%

In the 'extreme' case an MPG file would result in an overhead
of > 8% if all NULL chars would be encoded with a double
byte escape character.


If I would be the one who defines a new encoding then I would
introduce a fixed (or variable) additive factor to each byte before
encoding (and checking for NUL,TAB,CR,LF) is done.

For a fixed value I would propose to add '42' to each byte
before encoding.

This makes sure that the special chars (FE,FF,00..31) are all
moved to '7-bit-ascii' and just the uncommon characters
214,223,224,227 are encoded with a two byte escape value.

Compressed binaries really tend to use 00/01/FF more often
than other values. And if a simple addition can save up to 8%
then it might be worth thinking about it.


Just my three cents (one cent for my binary archive ;-)
Thanks for considering.

-- 
Juergen, [The Archiver]

Technical Details
Message-ID: <0529e.u71200@archiver.winews.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.alt.net!archiver.winews.net!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <0529e.u71200@archiver.winews.net>
Subject: CP compression (or any) - some numbers...
Date: Mon, 30 Jul 2001 12:29:05 +0000
From: archiver@i3w.com (The Archiver)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.alt.net!archiver.winews.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Altopia Corp. - Usenet Access - http://www.altopia.com
Lines: 68
X-Newsreader: MyNews