home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / compress / 3916 < prev    next >
Encoding:
Internet Message Format  |  1992-11-24  |  3.5 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!darkstar.UCSC.EDU!jade!paula
  2. From: paula@jade.ucsc.edu (Paul J. Ausbeck Jr. )
  3. Newsgroups: comp.compression
  4. Subject: Re: Need a compressor for sparse bit datastream
  5. Date: 24 Nov 1992 02:53:39 GMT
  6. Organization: UC Santa Cruz CIS/CE
  7. Lines: 67
  8. Distribution: world
  9. Message-ID: <1es5fjINNou1@darkstar.UCSC.EDU>
  10. References: <1992Nov13.120505.29654@spectrum.xerox.com> <1992Nov16.232015.15970@coe.montana.edu>
  11. NNTP-Posting-Host: jade.ucsc.edu
  12. Keywords: compression technique
  13.  
  14. In article <1992Nov16.232015.15970@coe.montana.edu>, bithead@cs.montana.edu (Bob Wall) writes:
  15. |> In article <1992Nov13.120505.29654@spectrum.xerox.com> landells.sbd-e@rx.xerox.com writes:
  16. |> >I have an application that generates binary output.  The output is relatively random, but there are approximately twice as many off bits as on bits.  My objective is to compress this as much as possible.  
  17. |> >
  18. |> >I have tried several 'standard' compressors, arj 2.2, lharc, pkzip 1.1, and have only managed to achieve very minimal compression in the order of 4% at best (on a 40K file).  Now I know that a truly random binary datastream cannot be compressed, but I wa|> s kind of hoping for better than 4%.  Am I missing something fundamental, or is this really the best that can be achieved?  
  19. |> >
  20. |> >If there is a technique to compress this type of data, I would appreciate some pointers to some source code that implements it.
  21. |> >
  22. |> >
  23. |> >Richard Landells  (landells.sbd-e@rx.xerox.com)
  24. |> >Rank Xerox System Centre
  25. |> 
  26. |>    You might try a variation of arithmetic coding referred to as the BAC
  27. |> (Binary Arithmetic Code).  It is described in the paper
  28. |> 
  29. |>    Glen G. Langdon, Jr. and Jorma Rissanenm, "A Simple General Binary Source
  30. |>       Code," _IEEE Transactions on Information Theory_, Vol. IT-28, No. 5,
  31. |>       Sept. 1982, pp. 800-803.
  32. |> 
  33. |>    I implemented this once, and I remember that it did OK on binary data
  34. |> streams where the frequency of one bit was substantially higher than the
  35. |> frequency of the other bit (and I would classify 2 to 1 as substantially
  36. |> higher) but I don't remember just what compression ratio OK would be.
  37. |> 
  38. |>    It's a pretty simple algorithm, although the article is written in
  39. |> math, instead of English  B^(.  A more straightforward explanation (in
  40. |> near-English) is given in
  41. |> 
  42. |>    Glen G. Langdon, Jr., "An Introduction to Arithmetic Coding," _IBM
  43. |>       Journal of Research and Development_, Vol. 28, No. 2, March 1984,
  44. |>       pp. 135-149.
  45. |> 
  46. |>    This article also has some other references that might help, although I
  47. |> haven't tracked them down.
  48. |> 
  49. |> 
  50. |> Hope this helps,
  51. |> Bob
  52. |> 
  53. |> 
  54. |> -- 
  55. |> =============================================================================
  56. |>   bithead@fubar.cs.montana.edu          (Bob Wall,  CS grad student)
  57. |>    "Software means never having to say you're finished."
  58. |>             --J. D. Hildebrand in UNIX REVIEW
  59.  
  60.  
  61. For stationary data information theory predicts compression as follows:
  62.  
  63. Pm = Probability of occurance of most probable symbol
  64. Pl = Probability of occurance of the least probable (1 - Pm in this case)
  65. lg is the base 2 logarithm
  66.  
  67. compressed data size (%) = -lg(Pm)*Pm -lg(Pl)*Pl
  68.  
  69. in this case: 
  70.  
  71. -lg(2/3)*2/3 - lg(1/3)*1/3 = .92 
  72.  
  73. approximately 8 percent is obtainable on stationary data.  If the data is
  74. non-stationary adaptive schemes such as the Q-coder (Langdon, Rissanen etal.)
  75. can be used for better compression.
  76.  
  77. I hope I didn't foul up the formula.  In any case the 8% compression sounds
  78. about right for this data set.
  79.  
  80. Paul Ausbeck
  81.