Data Compression · 数据压缩
| English | 中文 | Pinyin · 拼音 |
|---|---|---|
| Compression/kəmˈpreʃn/ | 压缩 | yā suō |
| Internet/ˈɪntənet/ | 互联网 | hù lián wǎng |
| Lossless/ˈlɒsləs/ | 无损 | wú sǔn |
| Lossy/ˈlɒsi/ | 有损 | yǒu sǔn |
| size/saɪz/ | 大小 | dà xiǎo |
| quality/ˈkwɒlɪti/ | 质量 | zhì liàng |
| trade-off/treɪd ɒf/ | 权衡 | quán héng |
| redundancy/rɪˈdʌndənsi/ | 冗余 | rǒng yú |
| transmission/trænˈsmɪʃn/ | 传输 | chuán shū |
Storing the same data in fewer bits
- A photo or song can hold millions of bytes — files get large.
- Compression 压缩 is any method that stores the same data using fewer bits.
- Smaller files take less space to store.
- And they are faster to send across the Internet 互联网.
用更少的位存储同样的数据
- 一张照片或一首歌能占几百万字节——文件变大。
- 压缩(compression)是用更少的位存储同样数据的任何方法。
- 更小的文件占用更少的存储空间。
- 而且它们在互联网(Internet)上发送得更快。
Compression means storing the same data using: · 压缩意味着用什么存储同样的数据:
Fewer bits means smaller files that store and send faster. · 更少的位意味着更小的文件,存储和发送都更快。
Match each method to its property. · 把每种方法与其性质配对。
Text needs lossless; photos and music often use lossy. · 文本需要无损;照片和音乐常用有损。
Which data type must use lossless compression? · 哪种数据类型必须使用无损压缩?
One changed byte could break a program, so it must be lossless. · 一个改动的字节就可能破坏程序,所以它必须无损。
Lossless vs lossy
- Lossless 无损 compression keeps every bit — the data restores exactly.
- Text and program files must be lossless; one changed letter could break them.
- Lossy 有损 compression makes files much smaller by throwing away data people are unlikely to notice.
- The original cannot be restored exactly — photos, music, and video often use it.
无损与有损
- 无损(lossless)压缩保留每一个位——数据被精确地还原。
- 文本和程序文件必须无损;一个改动的字母就可能破坏它们。
- 有损(lossy)压缩通过丢弃人们不太会注意到的数据,把文件做得小得多。
- 原始数据无法被精确还原——照片、音乐和视频常用它。
Lossy compression trades data quality for smaller file size. · 有损压缩用数据质量换取更小的文件大小。
Smaller size usually means losing some detail. · 更小的大小通常意味着丢失一些细节。
The size–quality trade-off
- Lossy compression forces a trade-off 权衡 between two things.
- File size 大小: how many bits it needs. Data quality 质量: how close it is to the original.
- Squeezing smaller usually means losing more detail.
Same photo, two ways. A lossless file is 5 MB and looks perfect; a lossy file is 0.5 MB — ten times smaller — but slightly blurry when zoomed. For a fast website, pick the small lossy file; for a large sharp poster, pick the lossless one.
大小-质量的权衡
- 有损压缩迫使在两件事之间权衡(trade-off)。
- 文件大小(size):它需要多少位。数据质量(quality):它与原始有多接近。
- 压得更小通常意味着丢失更多细节。
同一张照片,两种方式。 一个无损文件是 5 MB,看起来完美;一个有损文件是 0.5 MB——小十倍——但放大时略微模糊。对于快速的网站,选小的有损文件;对于大而清晰的海报,选无损的。
Run-length encoding (a lossless method) · 行程编码(一个无损方法)
Run-length encoding replaces a run of repeated values with one value plus a count. It is lossless — the original rebuilds exactly — but only shrinks data that has long runs. · 行程编码用一个值加一个计数替换一段重复的值。它是无损的——原始数据精确地重建——但只缩小有长行程的数据。
Storing "100 white pixels" as "white, 100 times" works by removing: · 把"100 个白色像素"存成"白色,100 次",是通过去除什么:
Run-length encoding replaces a run with a value plus a count — lossless. · 行程编码用一个值加一个计数替换一段行程——无损。
A compressed file with fewer bits transmits across a network faster. · 一个位更少的压缩文件在网络上传输更快。
Fewer bits to send means faster transmission. · 要发送的位更少意味着更快的传输。
Removing redundancy
- Many methods work by removing redundancy 冗余 — data that repeats or can be predicted.
- A line of 100 identical white pixels can be stored as "white, 100 times" instead of listing all 100.
- That is far fewer bits for the same picture — a lossless method called run-length encoding.
- Fewer bits also means faster transmission 传输 across a network.
去除冗余
- 许多方法通过去除冗余(redundancy)工作——重复或可预测的数据。
- 一行 100 个相同的白色像素可以存成"白色,100 次",而不是列出全部 100 个。
- 那是同一幅图用少得多的位——一种叫行程编码的无损方法。
- 更少的位也意味着在网络上更快的传输(transmission)。
Compression stores data in fewer bits — saving space and speeding transmission. Lossless keeps every bit (needed for text and code); lossy discards unnoticeable data for much smaller files (photos, music). Lossy forces a size–quality trade-off, and many methods shrink files by removing redundancy.
压缩用更少的位存储数据——节省空间并加快传输。无损保留每一个位(文本和代码需要);有损丢弃不易察觉的数据以获得小得多的文件(照片、音乐)。有损迫使大小-质量的权衡,许多方法通过去除冗余缩小文件。