Network Working Group P. Deutsch
Request for Comments: 1951 Aladdin Enterprises
Category: Informational May 1996
DEFLATE Compressed Data Format Specification version 1.3
Status of This Memo
This memo provides information for the Internet community. This memo
does not specify an Internet standard of any kind. Distribution of
this memo is unlimited.
IESG Note:
The IESG takes no position on the validity of any Intellectual
Property Rights statements contained in this document.
Notices
Copyright (c) 1996 L. Peter Deutsch
Permission is granted to copy and distribute this document for any
purpose and without charge, including translations into other
languages and incorporation into compilations, provided that the
copyright notice and this notice are preserved, and that any
substantive changes or deletions from the original are clearly
marked.
A pointer to the latest version of this and related documentation in
HTML format can be found at the URL
<ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html>.
Abstract
This specification defines a lossless compressed data format that
compresses data using a combination of the LZ77 algorithm and Huffman
coding, with efficiency comparable to the best currently available
general-purpose compression methods. The data can be produced or
consumed, even for an arbitrarily long sequentially presented input
data stream, using only an a priori bounded amount of intermediate
storage. The format can be implemented readily in a manner not
covered by patents.
Deutsch Informational [Page 1]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
Table of Contents
1. Introduction ................................................... 2
1.1. Purpose ................................................... 2
1.2. Intended audience ......................................... 3
1.3. Scope ..................................................... 3
1.4. Compliance ................................................ 3
1.5. Definitions of terms and conventions used ................ 3
1.6. Changes from previous versions ............................ 4
2. Compressed representation overview ............................. 4
3. Detailed specification ......................................... 5
3.1. Overall conventions ....................................... 5
3.1.1. Packing into bytes .................................. 5
3.2. Compressed block format ................................... 6
3.2.1. Synopsis of prefix and Huffman coding ............... 6
3.2.2. Use of Huffman coding in the "deflate" format ....... 7
3.2.3. Details of block format ............................. 9
3.2.4. Non-compressed blocks (BTYPE=00) ................... 11
3.2.5. Compressed blocks (length and distance codes) ...... 11
3.2.6. Compression with fixed Huffman codes (BTYPE=01) .... 12
3.2.7. Compression with dynamic Huffman codes (BTYPE=10) .. 13
3.3. Compliance ............................................... 14
4. Compression algorithm details ................................. 14
5. References .................................................... 16
6. Security Considerations ....................................... 16
7. Source code ................................................... 16
8. Acknowledgements .............................................. 16
9. Author's Address .............................................. 17
1. Introduction
1.1. Purpose
The purpose of this specification is to define a lossless
compressed data format that:
* Is independent of CPU type, operating system, file system,
and character set, and hence can be used for interchange;
* Can be produced or consumed, even for an arbitrarily long
sequentially presented input data stream, using only an a
priori bounded amount of intermediate storage, and hence
can be used in data communications or similar structures
such as Unix filters;
* Compresses data with efficiency comparable to the best
currently available general-purpose compression methods,
and in particular considerably better than the "compress"
program;
* Can be implemented readily in a manner not covered by
patents, and hence can be practiced freely;
Deutsch Informational [Page 2]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
* Is compatible with the file format produced by the current
widely used gzip utility, in that conforming decompressors
will be able to read data produced by the existing gzip
compressor.
The data format defined by this specification does not attempt to:
* Allow random access to compressed data;
* Compress specialized data (e.g., raster graphics) as well
as the best currently available specialized algorithms.
A simple counting argument shows that no lossless compression
algorithm can compress every possible input data set. For the
format defined here, the worst case expansion is 5 bytes per 32K-
byte block, i.e., a size increase of 0.015% for large data sets.
English text usually compresses by a factor of 2.5 to 3;
executable files usually compress somewhat less; graphical data
such as raster images may compress much more.
1.2. Intended audience
This specification is intended for use by implementors of software
to compress data into "deflate" format and/or decompress data from
"deflate" format.
The text of the specification assumes a basic background in
programming at the level of bits and other primitive data
representations. Familiarity with the technique of Huffman coding
is helpful but not required.
1.3. Scope
The specification specifies a method for representing a sequence
of bytes as a (usually shorter) sequence of bits, and a method for
packing the latter bit sequence into bytes.
1.4. Compliance
Unless otherwise indicated below, a compliant decompressor must be
able to accept and decompress any data set that conforms to all
the specifications presented here; a compliant compressor must
produce data sets that conform to all the specifications presented
here.
1.5. Definitions of terms and conventions used
Byte: 8 bits stored or transmitted as a unit (same as an octet).
For this specification, a byte is exactly 8 bits, even on machines
Deutsch Informational [Page 3]
RFC 1951 DEFLATE Compressed Data Format Specification May 1996
which store a character on a number of bits different from eight.
See below, for the numbering of bits within a byte.
String: a sequence of arbitrary bytes.
1.6. Changes from previous versions
There have been no technical changes to the deflate format since
version 1.1 of this specification. In version 1.2, some
terminology was changed. Version 1.3 is a conversion of the
specification to RFC style.
2. Compressed representation overview
A compressed data set consists of a series of blocks, corresponding
to successive blocks of input data. The block sizes are arbitrary,
except that non-compressible blocks are limited to 65,535 bytes.
Each block is compressed using a combination of the LZ77 algorithm
and Huffman coding. The Huffman trees for each block are indepe
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
升级OpenSSH所有包.rar (254个子文件)
miniunzip.1 2KB
minizip.1 1KB
zlib.3 4KB
README.686 2KB
configure.ac 786B
zlib.adb 20KB
test.adb 13KB
zlib-streams.adb 6KB
mtest.adb 4KB
read.adb 4KB
buffer_demo.adb 4KB
zlib-thin.adb 3KB
zlib-thin.ads 15KB
zlib.ads 13KB
zlib-streams.ads 4KB
Makefile.am 818B
gvmat64.asm 16KB
inffas32.asm 16KB
match686.asm 15KB
inffasx64.asm 10KB
bld_ml32.bat 92B
bld_ml64.bat 86B
bndsrc 8KB
Makefile.bor 3KB
Makefile.bor 3KB
DotZLib.build 1KB
deflate.c 70KB
unzip.c 69KB
zip.c 64KB
inflate.c 52KB
trees.c 43KB
gzlog.c 40KB
inffas86.c 40KB
puff.c 37KB
gun.c 25KB
infcover.c 24KB
enough.c 24KB
infback.c 22KB
infback9.c 21KB
gzread.c 18KB
miniunz.c 17KB
blast.c 17KB
gzappend.c 17KB
example.c 16KB
untgz.c 16KB
gzlib.c 16KB
gzwrite.c 16KB
minigzip.c 15KB
zran.c 15KB
minizip.c 15KB
iowin32.c 14KB
gzjoin.c 14KB
inffast.c 13KB
inftree9.c 13KB
crc32.c 13KB
inftrees.c 13KB
fitblk.c 8KB
ioapi.c 8KB
mztools.c 8KB
testzlib.c 7KB
inffas8664.c 7KB
zutil.c 7KB
zpipe.c 6KB
adler32.c 5KB
pufftest.c 5KB
compress.c 2KB
uncompr.c 2KB
gzclose.c 678B
zfstream.cc 13KB
test.cc 1KB
ChangeLog 75KB
DotZLib.chm 71KB
compile.clp 5KB
zconf.h.cmakein 15KB
zlib.pc.cmakein 294B
make_vms.com 26KB
make_vms.com 901B
configure 25KB
README.contrib 3KB
zfstream.cpp 5KB
zstream_test.cpp 711B
test.cpp 526B
GZipStream.cs 11KB
DotZLib.cs 10KB
ChecksumImpl.cs 8KB
UnitTests.cs 8KB
CodecBase.cs 6KB
Deflater.cs 4KB
Inflater.cs 4KB
AssemblyInfo.cs 2KB
CircularBuffer.cs 2KB
DotZLib.csproj 5KB
zlibvc.def 7KB
zlibvc.def 7KB
zlibvc.def 7KB
zlib.def 1KB
zlib.def 778B
Makefile.dj2 3KB
Makefile.emx 1KB
Makefile.emx 1KB
共 254 条
- 1
- 2
- 3
资源评论
- 钢铁是乍样练成的2020-10-27升级失败,安装时提示缺少GCC环境包
登风360
- 粉丝: 1
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功