🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #56940

Re: [yEnc] some newbie questions

#56940
From: Nuutti Kotivuori
Date: Wed, 27 Feb 2002 08:05
41 lines
3072 bytes
Curt Welch wrote:
> Liyang Hu <newsgroups@nerv.cx> wrote:
>> After arithmetic coding, the number of \000, \012 and \016 bytes
>> will add up to zero.
> 
> But if the skew before encoding meant it had none of those bytes to
> begin with, then there will be no expansion using escape characters,
> but with arithmetic coding, there will always be a fixed expansion.
> 
> So the question becomes, instead of using artihmetic coding to
> flaten the skew (at the cost of expansion) might it be better to use
> some of the skew already in the data?

Actually, you assume that we do the arithmetic coding with a flat
1/251 table of probabilities. Then what you say will be true.

But if we, for example, use adaptive coding, the table will shape
itself to respect the actual distribution of bytes in the input
data. When decoding, we start with the original table and let it adapt
exactly the same way as it did on encoding. This ofcourse means that
in the beginning, we might lose a bit because the table is
non-optimal, but those losses will come back fast.

Doing this is not ofcourse as trivial as arithmetic coding normally
is, but still quite easily hand written. But ofcourse this is already
the realm of compression.

So what I was trying to say is that arithmetic encoding encodes the
symbols with the optimal number of bits if we have an exact
probability table for the appearance of the different characters in
the stream. This table can either be generated by scanning the data
first and then prepending it to the message - or by using adaptive
coding.

But all in all - the discussion is academic - the gains gained from
optimally encoding the few files that happen to have a lot of zero
bytes are not worth the added complexity.

-- Naked

Technical Details
Message-ID: <87it8j2vuq.fsf@iki.fi>
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!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.cc.tut.fi!uutiset.saunalahti.fi!localhost
References: <3c6e6798.9093644@news> <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <1rr8nmjix6.fsf@fjorir.ifi.uio.no> <a4knl3$3ol$1@pegasus.csx.cam.ac.uk> <3c7a60b7.469568@news> <a5gp0f$621$1@pegasus.csx.cam.ac.uk> <20020226152108.753$EN@newsreader.com>

Show Full Headers
Complete Article Headers
Message-ID: <87it8j2vuq.fsf@iki.fi>
Subject: Re: [yEnc] some newbie questions
Date: Wed, 27 Feb 2002 10:05:17 +0200
From: Nuutti Kotivuori <naked@iki.fi>
References: <3c6e6798.9093644@news> <a4kc41$ou1$2@pegasus.csx.cam.ac.uk> <1rr8nmjix6.fsf@fjorir.ifi.uio.no> <a4knl3$3ol$1@pegasus.csx.cam.ac.uk> <3c7a60b7.469568@news> <a5gp0f$621$1@pegasus.csx.cam.ac.uk> <20020226152108.753$EN@newsreader.com>
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!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.stealth.net!news.cc.tut.fi!uutiset.saunalahti.fi!localhost
Newsgroups: news.software.nntp
Organization: SAUNALAHDEN asiakas
Lines: 40
NNTP-Posting-Host: cs183115.pp.htv.fi
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: tron.sci.fi 1014831550 23651 213.243.183.115 (27 Feb 2002 17:39:10 GMT)
X-Complaints-To: newsmaster@saunalahti.fi
NNTP-Posting-Date: 27 Feb 2002 17:39:10 GMT
User-Agent: Gnus/5.090006 (Oort Gnus v0.06) XEmacs/21.4 (Common Lisp, i386-debian-linux)
Cancel-Lock: sha1:MDrHxb0kNDQJijSFaQTHhAU3zek=