Article View: comp.lang.postscript
Article #1936Re: PS L2 compression behavior
From: C.E. Thompson
Date: Sun, 13 Sep 1992 00:42
Date: Sun, 13 Sep 1992 00:42
25 lines
1626 bytes
1626 bytes
In article <1992Sep8.205244.17495@adobe.com>, taft@adobe.com (Ed Taft) writes: |> In article <1992Sep8.143846.3667@Princeton.EDU> |> dmlaur@ernie.Princeton.EDU (David M. Laur) writes: [...] |> >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. However, it so happens that there are some tricks to aid multiplication and division by 85, in the absence of decent integer multiply or divide hardware, based on the fact that 85 = (2^8-1)/3. For multiplication y = (x<<2)+x ; z = (y<<4)+y /* would be two instructions on an ARM */ makes z == 85*x. For division use 1/85 = 3/2^8 + 3/2^16 + 3/2^24 + ...; details left as an exercise for the reader (as they say in all the best books). Chris Thompson Cambridge University Computing Service JANET: cet1@uk.ac.cam.phx Internet: cet1@phx.cam.ac.uk
Technical Details
Message-ID:
<1992Sep13.004206.13328@infodev.cam.ac.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!pavo.csi.cam.ac.uk!camcus!cet1References:
<1992Sep8.143846.3667@Princeton.EDU> <1992Sep8.205244.17495@adobe.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!pavo.csi.cam.ac.uk!camcus!cet1 From: cet1@cus.cam.ac.uk (C.E. Thompson) Newsgroups: comp.lang.postscript Subject: Re: PS L2 compression behavior Keywords: PostScript compression rle pathological Message-ID: <1992Sep13.004206.13328@infodev.cam.ac.uk> Date: 13 Sep 92 00:42:06 GMT References: <1992Sep8.143846.3667@Princeton.EDU> <1992Sep8.205244.17495@adobe.com> Sender: news@infodev.cam.ac.uk (USENET news) Organization: U of Cambridge, England Lines: 25 Nntp-Posting-Host: grus.cus.cam.ac.uk