🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1897

Re: PS L2 compression behavior

#1897
From: Ed Taft
Date: Tue, 08 Sep 1992 20:52
24 lines
1542 bytes
In article <1992Sep8.143846.3667@Princeton.EDU>
dmlaur@ernie.Princeton.EDU (David M. Laur) writes:

>Am I correct in computing the worst case expansion of an input file
>under RunLengthEncode followed by ASCII85Encode to be
>
>   (worst output size) = (input data size) (4/3) (5/4)
>
>i.e.  for data of the form "abbabbabbabb ..." the RLE algorithm
>requires two bytes for each 'a' (right?)

No. There is nothing that requires you to encode repeated characters
as a repetition. You can encode the entire input as literal text,
producing an expansion of 128/127. This is the worst case. Use the
repetition encoding only when there is an advantage in doing so.

>Secondly, is there something wonderfully magic about the number 85
>that makes the encoding algorithm Very Easy(tm)?

I'm not aware of any tricks that apply specifically to multiplying and
dividing by 85. The choice of 85 as a base derives from it being the
smallest integer n such than n^5 >= 2^32.
-- 
Ed Taft      taft@adobe.com      ...decwrl!adobe!taft
Technical Details
Message-ID: <1992Sep8.205244.17495@adobe.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!sun-barr!decwrl!adobe!taft
References: <1992Sep8.143846.3667@Princeton.EDU>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.postscript
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!sun-barr!decwrl!adobe!taft
From: taft@adobe.com (Ed Taft)
Subject: Re: PS L2 compression behavior
Message-ID: <1992Sep8.205244.17495@adobe.com>
Keywords: PostScript compression rle pathological
Sender: usenet@adobe.com (USENET NEWS)
Organization: Adobe Systems Incorporated, Mountain View
References: <1992Sep8.143846.3667@Princeton.EDU>
Date: Tue, 8 Sep 1992 20:52:44 GMT
Lines: 24