🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #56680

Re: [yEnc] some newbie questions

#56680
From: Liyang Hu
Date: Wed, 20 Feb 2002 11:19
41 lines
2895 bytes
The Archiver <archiver@i3w.com> wrote:
> An integrated compression would solve _all_ these problems with
> _one_ feature.

I'll bite: give me a few days, and I'll give you a *simple*[1]
reference arithmetic coder[0] that avoids these problems without
having to resort to using compression libraries.

Say if we forbid the use of /all/ control characters (that's 32 of
them), we're left with 224 symbols out of 256. This still gets us

    log_2 224 == 7.81 bits

ie. we waste 0.19 bits for every 8 we send, which corresponds to
2.4%. Compare this with the current yEnc method, where we escape on
average, 4 different characters for every 256 sent, and you see that
the waste in this case is 1-256/260 == 1.5%. This may looks better
on the surface, but then again, only 4 symbols out of 256 are
disallowed.

If say we allow 16 of the 32 control characters (ie. use 240 of the
256 possible symbols), we get a redundancy of 1.2%. Add on
compression[2], and see which one fairs better. You do the maths.

Google for `arithmetic coding' if you need background reading.

/Liyang
[0] ie. representing 256 different symbols using only 224, say. No
    escape codes necessary. (Note that Base64 and UUEncode are just
    special cases of this, where we only use 64 different symbols.)
[1] As in, no compression, hence no statistical modelling and other
    messy stuff.
[2] Arithmetic coding with statistical modelling beats zlib any day,
    although I can't attest to the existence of any readily
    available, Free (as opposed to GNU Free), *and* easily portable
    source code. I still think you should leave compression out of it.
-- 
.--| Liyang HU |--| http://nerv.cx/ |--| Caius@Cam |--| ICQ: 39391385 |--.
| Real computer scientists don't write in assembler.                     |
| They don't write in anything less portable than a number two pencil.   |
Technical Details
Message-ID: <a500oj$736$1@pegasus.csx.cam.ac.uk>
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!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.icl.net!peer.news.eu-x.com!server2.netnews.ja.net!pegasus.csx.cam.ac.uk!not-for-mail
References: <3c6e6798.9093644@news> <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <yleljh722r.fsf@windlord.stanford.edu> <04477.k22202@archiver.winews.net>

Show Full Headers
Complete Article Headers
Message-ID: <a500oj$736$1@pegasus.csx.cam.ac.uk>
Subject: Re: [yEnc] some newbie questions
Date: Wed, 20 Feb 2002 11:19:47 +0000
From: Liyang Hu <newsgroups@nerv.cx>
References: <3c6e6798.9093644@news> <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <yleljh722r.fsf@windlord.stanford.edu> <04477.k22202@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!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.icl.net!peer.news.eu-x.com!server2.netnews.ja.net!pegasus.csx.cam.ac.uk!not-for-mail
Newsgroups: news.software.nntp
Organization: University of Cambridge, England
Lines: 40
Sender: Liyang Hu <lh259@portal.acad.cai.cam.ac.uk>
NNTP-Posting-Host: portal.acad.cai.cam.ac.uk
User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (Linux/2.4.17-xfs+lvm10+intl (i686))