分享
 
 
 

RFC1951的部分翻译及原文(1/2)

王朝other·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

下面只是RFC文档中的第1,2,3,节,其余部分请参照原文。

1. Introduction

1.1. Purpose

本规范是用来定义一个无损的数据压缩格式:

The purpose of this specification is to define a lossless

compressed data format that:

它不依赖于CPU类型,操作系统类型,文件系统类型,字符集。因此

可以被用来进行交换。

* Is independent of CPU type, operating system, file system,

and character set, and hence can be used for interchange;

能够被生成或是去除,甚至是使用一个预先确定的中间存贮器的边界

长度,对一个任意长的连续输入数据流进行操作。因此可以被用在数据通信及相似的

结构中,如UNIX过滤器。

* 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;

* 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

这篇文档被用来实现软件压缩数据为“deflate”格式或从“deflate”解压数据。

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

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

一个压缩的数据集包含一系列的块,与输入数据的块相对应。块的大小是任意

的,但是非压缩的块要在65535字节之内。

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.

每一块的压缩都使用了LZ77法则和Huffman编码方法。每块的Huffman树都

和它的前一块及后一块无关。LZ77法则可以参考所复制的前一个串中的前32K内容。

Each block is compressed using a combination of the LZ77 algorithm

and Huffman coding. The Huffman trees for each block are independent

of those for previous or subsequent blocks; the LZ77 algorithm may

use a reference to a duplicated string occurring in a previous block,

up to 32K input bytes before.

每个块包含了两部分:1)一对Huffman编码树,它描述了压缩内容的表示方法。

2)还有就是压缩数据的部分。(其中的Huffman树也是经过了Huffman编码的)压缩后的

数据包括了两种类型。1)文字字节(是字符串的一部分,这个字符串不是所复制的

前32K的内容。2)指向复制的字符串的指针,这个指针的形式是一个<长度,向后的距

离>对。这个使用在"deflate"格式中的形式限定了距离为32K及长度为258字节。但是

没有限制块的大小(除了没有压缩的数据以外)。

Each block consists of two parts: a pair of Huffman code trees that

describe the representation of the compressed data part, and a

compressed data part. (The Huffman trees themselves are compressed

using Huffman encoding.) The compressed data consists of a series of

elements of two types: literal bytes (of strings that have not been

detected as duplicated within the previous 32K input bytes), and

pointers to duplicated strings, where a pointer is represented as a

pair <length, backward distance>. The representation used in the

"deflate" format limits distances to 32K bytes and lengths to 258

bytes, but does not limit the size of a block, except for

uncompressible blocks, which are limited as noted above.

压缩数据中的每种类型值(文字,距离及长度)都使用Huffman编码方法,使用一

个编码树编码文字和长度,使用另一个独立的编码树来编码距离。每一块的编码树都以

压缩的方式存在于那一块中压缩的数据之前的位置。

Each type of value (literals, distances, and lengths) in the

compressed data is represented using a Huffman code, using one code

tree for literals and lengths and a separate code tree for distances.

The code trees for each block appear in a compact form just before

the compressed data for that block.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有