📄 shuff.1
字号:
.\"------------------------------------------------------------.\" Man page for shuff. Written by aht, extended by alistair..\"------------------------------------------------------------.TH shuff 1 "February 2000, February 2002" "Andrew Turpin and Alistair Moffat".SH NAMEshuff \- semi-static canonical coder for files of unsigned integers.SH SYNOPSIS.B shuff .B \-e [.BI \-b " block_size "] [.B \-Z] [.B \-v{ 1 | 2 | 3 }] [.I file] .P.B shuff .BI \-e1 " filename "[.BI \-v " n "] [.I file] .P.B shuff .BI \-e2 " filename "[.BI \-v " n "] [.I file] .P.B shuff .B \-d[.BI \-v " n "] [.I file] .SH DESCRIPTION.B shuffencodes and decodes a file of unsigned integers using semi-staticcanonical minimum-redundancy (Huffman) coding to .IR stdout .There are two options forencoding: two-pass coding, which requires a pass over the input fileto gather the frequencies of the integers, and a second pass to perform theactual coding; or one-pass coding where the integer file is broken intoblocks and two passes are made on each block in memory (so the file is only read once)..PDecoding is the same for files encoded with either method. .B Two-pass encodingThe two-pass encoding process writes an auxiliary file of integer frequencies which is used as the.I filenameargument of the -e1 and -e2 options.The file of frequencies is not required for decoding, since.B shuffstores a representation of the Huffman code within the compressed output..TP "\w'\fB\-d\fP \fIdir\fP'u+2n".BI \-e1 " filename "Causes .B shuffto make an intial pass though .I fileor .IR stdin ,writing a file of symbol frequencies to .IR filename ..TP.BI \-e2 " filename "Causes .B shuffto read the symbol frequency information from.IR filename , build a minimum-redundancy canonical prefix code for thatdistribution,and then pass through .I fileor .I stdinreading unsigned integers, calculating their correspondingcodewords, and writing encoded bits to .IR stdout .The file.IR filenameshould previously have been created from the same, or representative,data as is being compressed during the second pass..TP.BI \-v " n "Prints statistical information to.I stderrshowing the operations being performed.The larger the value of.I nthe more detailed (and voluminous) the output..HP 1.B One-pass encodingOne-pass encoding splits the.I fileor.I stdininto blocks, and then applies the algorithms of the two-pass coder to each block in memory, writing bits to .IR stdout .The blocks can be of fixed length (using the .BI -b " blocksize "option), or can be terminated by integer zeroes in the input file (using the.B \-Z option). .TP "\w'\fB\-d\fP \fIdir\fP'u+2n".B \-eUse one pass encoding..TP.BI \-b " block_size "Encodes symbols in blocks of .IR block_size ..TP.B \-ZTreats all symbols between zero symbols as a single block (the -b option is ignored). The zeroes are also included in the compressed message andreproduced by the decoder,allowing the process that writes the file of integersto determine where block boundaries should lie \- usefulwhen each integer has a different probabilityin each block.It is not strictlynecessary to have a zero as the final symbol of the file, buta warning message will be printed if this is not the case..TP.BI \-v " n "Outputs summary information.Use of.I n=2outputs information per block in bits per symbol,.I n=3outputs information per block in bits..SH USAGETo encode a file named.I numbersusing two pass coding into a file .I numbers-encand then decode to a file.I numbers-decyou would proceed as.P.B shuff \-e1 .I freqs numbers.P.B shuff \-e2.I freqs numbers >.I numbers-enc.P.B rm.IR freqs.P.B shuff \-d.I numbers-enc >.I numbers-dec.PThe files.I numbersand.I numbers-decshould be the same. (Check with .B cmp .I numbers.I numbers-dec)To encode .I numbersin a single pass using a block size of 1 MB (assuming 4-byte integers):.P.B shuff \-e.BI \-b " 262144 ".IR numbers " > " numbers-enc.P.B shuff \-d.IR numbers-enc " > " numbers-dec.PAgain, the files.I numbersand.I numbers-decshould be the same.To encode .I numbersin a single pass using zero symbols as block terminators: .P.B shuff \-e.B \-Z.IR numbers " > " numbers-enc.P.B shuff \-d.IR numbers-enc " > " numbers-dec.P.B cmp .I numbers numbers-dec.SH ORIGINS.B shuffis based upon original work of the two authors, described in"On the Implementation of Minimum-Redundancy Prefix Codes",.I IEEE Transactions on Communications,45(10):1200-1207, October 1997, and"Housekeeping for Prefix Coding",.I IEEE Transactions on Communications,48(4):622-628, April 2000. .LPFor more details of the implementation, seethe two papers listed above, or the book.I Compression and Coding Algorithms A. Moffat and A. Turpin,Kluwer Academic Press, February 2002.Further information about this book is available athttp://www.cs.mu.oz.au/caca/We ask that, if you use this software to deriveexperimental results that are reported in any way,you cite the original work in which theunderlying processes are described (by referencing either both of thetwo listed papers,or the book); andalso acknowledge our authorship of the implementation you have used..SH BUGS.B shuffhas not been extensively tested, and should be used for researchpurposes only.Portability is not guaranteed.There is no warranty, either express or implied,that it is fit for any purpose whatsoever, andneither the authors nor The University of Melbourne accept anyresponsibility for any consequences that may arise from your use of this software..SH LICENCEUse and modify for your personal use, but do not distribute in any way shape or form (forcommercial or noncommercial purposes, modified or unmodified, including by passively making it available on any internet site) withoutprior consent of the authors..SH AUTHORSAndrew Turpin* and Alistair Moffat,Department of Computer Science and Software Engineering,The University of Melbourne,Victoria 3010, Australia.Email: aht@cs.mu.oz.au, alistair@cs.mu.oz.au.(*Now at Curtin University, Perth, Australia,Email: andrew@computing.edu.au)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -