?? ac.txt
字號(hào):
Arithmetic Coding Library-------------------------Fred Wheeler (wheeler@cipr.rpi.edu)Feb 24, 1996This package was adapted from the program in "Arithmetic Coding forData Compression", by Ian H. Witten, Radford M. Neal and JohnG. Cleary, Communications of the ACM, June 1987, Vol. 30, No. 6.(Source at ftp://ftp.cpsc.ucalgary.ca/pub/projects/ar.cod/cacm-87.shar)This version uses structures for the coder, decoder and data modelinstead of global variables. This object oriented approach allows youto simultaneously use several arithmetic coders, each streaming bitsto a different file and to have several models for each coder, eachwith a possibly different number of symbols and frequency table.This package does not come with models for character, word and bitencoding, like the Witten Neal Cleary package. You must create yourown model (probability table).Encoders can be given a file to which the bits are stored. If no fileis given, the encoder will simply count the bits that would have beenstored. Decoders must be given a file to work.Models may be initiated with a frequency table, or the table willdefault to uniform (all 1's). Regardless of initiation, the modelscan be adaptive or fixed.Unlike the original version by Witten et. al., symbol indices start at0, not 1.The program is written in ANSI C.I owe credit to Amir Said, who has also written a similar packagebased on the Witten Neal Cleary package.If you find this program useful, please send me an e-mail.ACDEMO------The program ACDEMO is a simple demonstration of the multiple modelarithmetic codec defined in ac.h and ac.c. ACDEMO encodes a fewrandom streams and then decodes them, making sure that the originaldata is recovered. To be useful, ac.h and ac.c must be incorporatedinto another compression program.To compile and run ACDEMO with gcc use: gcc -Wall -O2 -c ac.c gcc -Wall -O2 -c acdemo.c gcc -o acdemo ac.o acdemo.o ./acdemoThe most common problem encountered is the compiler not findingrandom() and srandom(), used in acdemo.c. See the comments inacdemo.c to fix this.Change Log----------Sep 10, 1999 by Fred Wheeler (wheeler@cipr.rpi.edu)In ac.c removed declaration for main() and declarations for randomfunctions.Jan 20, 1999 by Fred Wheeler (wheeler@cipr.rpi.edu)In ac.c use "b" in fopen so files are opened in binary mode. This isnecessary for the code to work on a PC.Jun 15, 2000 by Fred Wheeler (wheeler@cipr.rpi.edu)Use macros for random/rand and srandom/srand and comment their usageFiles-----ac.c: source for all arithmetic coding functionsac.h: header file for any file using the arithmetic coding libraryacdemo.c: an example
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -