arith_coder.1
上传用户:ykyjsl
上传日期:2022-01-30
资源大小:145k
文件大小:6k
源码类别:

压缩解压

开发平台:

C/C++

  1. .PU
  2. .TH arith_coder 1 local "Rev: 3.0"
  3. .SH NAME
  4. arith_coder, bits, char, uint, word - data compression using arithmetic
  5. coding and a bit, character, unsigned integer, or word based model
  6. .SH SYNOPSIS
  7. .ll +8
  8. .B bits 
  9. [fB-hfR]
  10. [fB-vfR]
  11. [
  12. fB-efR
  13. [fB-mfR fImbytesfP]
  14. [fB-bfR fIcodebitsfP]
  15. [fB-ffR fIfbitsfP]
  16. [fB-cfR fIctxbitsfP]
  17. ]
  18. |
  19. [fB-dfR]
  20. [fIfnamefP]
  21. .B char
  22. [fB-hfR]
  23. [fB-vfR]
  24. [fB-efR
  25. [fB-bfR fIcodebitsfP]
  26. [fB-ffR fIfbitsfP]
  27. ]
  28. |
  29. [fB-dfR]
  30. [fIfnamefP]
  31. .B uint
  32. [fB-hfR]
  33. [fB-vfR]
  34. [fB-efR
  35. [fB-bfR fIcodebitsfP]
  36. [fB-ffR fIfbitsfP]
  37. ]
  38. |
  39. [fB-dfR]
  40. [fIfnamefP]
  41. .B word
  42. [fB-hfR]
  43. [fB-vfR]
  44. [
  45. fB-efR
  46. [fB-mfR fImbytesfP]
  47. [fB-bfR fIcodebitsfP]
  48. [fB-ffR fIfbitsfP]
  49. ]
  50. |
  51. [
  52. fB-dfR
  53. ]
  54. [fIfnamefP]
  55. .B arith_coder
  56. [fB-hfR]
  57. [fB-vfR]
  58. [fB-efR
  59. [fB-tfR fImodelfP]
  60. [fB-mfR fImbytesfP]
  61. [fB-bfR fIcodebitsfP]
  62. [fB-ffR fIfbitsfP]
  63. [fB-cfR fIctxbitsfP]
  64. ]
  65. |
  66. [fB-dfR]
  67. [fIfnamefP]
  68. .ll -8
  69. .SH DESCRIPTION
  70. .I Bits, char, uint, 
  71. and
  72. .I word
  73. are programs that use arithmetic coding for compressing data, using
  74. bit, character, unsigned integer, and word based models, respectively.
  75. They are links to
  76. .I arith_coder,
  77. which can also be called directly with
  78. .B -t
  79. .I model
  80. specified to be "bits", "char", "uint", or "word".
  81. .I Bits 
  82. uses an adaptive fixed order bit based model.
  83. The model encodes each
  84. bit of the input using probabilities conditioned by the previous 
  85. .I ctxbits
  86. bits of the file.
  87. The program potentially allocates up to 2^fIctxbitsfR contexts requiring
  88. 16 bytes each. If the memory limit is exceeded when allocating new contexts,
  89. existing contexts are re-used.
  90. .I Char
  91. uses an adaptive zero-order character based model.
  92. It
  93. is provided for comparison with the original CACM arithmetic coding
  94. package, but is unlikely to provide compression as good as
  95. .I bits
  96. or
  97. .I word.
  98. .I Uint
  99. uses an adaptive zero-order unsigned-integer based model which is initialised
  100. with a single escape symbol.
  101. Message symbols are read using the
  102. .I fwrite
  103. function.
  104. The input symbols are expected to occur for the first time in numerical 
  105. order.
  106. This removes the need to store the actual integer causing an escape 
  107. symbol to be transmitted: it is simply the next integer in sequence.
  108. This restriction imples that the first integer in the file must 1.
  109. .I Word
  110. uses an adaptive zero-order word based model.  
  111. If the memory limit is reached, all words are purged from memory, and
  112. collection of words is started from scratch.
  113. Binary files (for example,
  114. bit-map images) will be handled correctly, but compression is unlikely to be as
  115. good as the rates obtained by tailor-made compression regimes.
  116. The specified uncompressed file 
  117. .I fname
  118. is compressed to standard output if
  119. .B -e
  120. is specified. Similarly, 
  121. a compressed file
  122. .I fname
  123. is decompressed to standard output if
  124. .B -d
  125. is specified.
  126. If no
  127. .I fname
  128. is given, input is read from stdin.
  129. The level of compression obtained depends upon the size of the file, and the
  130. amount of redundancy. The program uses an arithmetic coding 
  131. scheme which uses frequency counts of 2^fIfbitsfR.
  132. There is a constraint that 
  133. fIfbitsfR <= fIcodebitsfR-2, where fIcodebitsfR is the
  134. number of bits of precision for arithmetic in the arithmetic coding module.
  135. So, for example, if fIcodebitsfR is 32 then fIfbitsfR could be at most 30.
  136. .ll -8
  137. .SH OPTIONS 
  138. .TP
  139. f4-hfP
  140. Display help (lists valid command line parameters).
  141. .TP
  142. f4-efP
  143. Select compression.
  144. .TP
  145. f4-dfP
  146. Select decompression.  The appropriate model is
  147. selected automatically, based on the magic number at the start of
  148. the compressed file.
  149. .TP
  150. f4-vfP
  151. Verbose mode. Display details about compression performance.
  152. If this flag is the only option on the command line, displays the
  153. command line options, as well as information about the compile time
  154. characteristics of the program (whether shift/add or multiplication/division
  155. arithmetic is being used, etc).
  156. .TP
  157. f4-tfP
  158. Specify fImodelfR to encode data.  Can be one of "bits", "char" or "word".
  159. .TP
  160. f4-mfP
  161. Limit memory usage (for data structures) to
  162. .I mbytes
  163. megabytes.
  164. Default value is 1. (Bit and word based models only).
  165. .TP
  166. f4-bfP
  167. Use
  168. .I codebits
  169. bits for arithmetic done in arithmetic coding.  Default is 32, and is
  170. bounded by the size of the data type used to store code values
  171. (typedef code_value in arith.h).
  172. .TP
  173. f4-ffP
  174. Use
  175. .I fbits
  176. bits for frequency counts. Larger values allow
  177. more accurate modelling of large files and
  178. faster compression and decompression if
  179. compiled with shift/add arithmetic (the MULT_DIV option is not specified
  180. in the Makefile).
  181. However larger values of
  182. .I fbits
  183. relative to
  184. .I codebits
  185. may also reduce overall compression efficiency.
  186. This is because of
  187. truncation effects at the coding stage, and because of the recency
  188. effect that is a by-product of count scaling is reduced.
  189. .I Fbits
  190. must be at least 2 less than
  191. .I codebits.
  192. Default is 27.
  193. .TP
  194. f4-cfP
  195. Use
  196. .I ctxbits
  197. previous bits
  198. as a context for each compressed bit. Larger values
  199. provide more accurate modelling and better compression.
  200. Note, however, that in the absence of any memory limit
  201. memory use is proportional to 2^fIctxbitsfP.
  202. Default is 16.  (Bit based model only).
  203.  
  204. .SH BUGS
  205. .LP
  206. Compressed files with the "word" and "bits" models may not be portable across
  207. architectures.  This may be the case if there are different
  208. alignment restrictions or the size of type freq_value
  209. (currently declared as "int") is different.
  210. This is due to memory limits being reached at different stages.
  211. .SH REFERENCE
  212. .I Arithmetic Coding Revisited,
  213. Alistair Moffat, Radford Neal, Ian H. Witten,
  214. ACM Transactions on Information Systems,
  215. 16(3):256-294, July 1998;
  216. and
  217. .I An improved data structure for cumulative probability tables;
  218. Alistair Moffat,
  219. Software-Practice & Experience,
  220. 1999.
  221. See also 
  222. .I http://www.cs.mu.oz.au/~alistair/abstracts/.
  223. .SH CONDITIONS
  224. These programs are supplied free of charge for research purposes only,
  225. and may not sold or incorporated into any commercial product.  There is
  226. ABSOLUTELY NO WARRANTY of any sort, nor any undertaking that they are
  227. fit for ANY PURPOSE WHATSOEVER.  Use them at your own risk.  If you do
  228. happen to find a bug, or have modifications to suggest, please report
  229. the same to Alistair Moffat, alistair@cs.mu.oz.au.  The copyright
  230. notice included in the source code
  231. and this statement of conditions must remain an integral
  232. part of each and every copy made of these files.