Skip to Content
数据压缩入门
book

数据压缩入门

by Colt McAnlis, Aleks Haecky
April 2020
Intermediate to advanced
210 pages
4h 47m
Chinese
Posts & Telecom Press
Content preview from 数据压缩入门
71
第 6 章
自适应统计编码
6.1
 位置对熵的重要性
第
5
章介绍的所有统计编码算法,在编码开始之前都需要遍历一次数据,以计算出各符号
出现的概率。这样做是有缺点的,为了计算概率总需要多遍历一次数据集,而在计算出整
个数据集中各符号的出现概率后,还要继续处理这些数值。如果是相对较小的数据集,那
么这些就不是什么问题。
然而,随着要压缩的数据集变大,统计编码的结果与熵的偏差也会越来越大,这是因为数
据集的不同部分有着不同的概率特征。如果处理的是流数据,比如视频流或音频流,由于
整个数据集没有“结尾”,因此就不能“遍历两次”。
这些概念适用于所有的流数据,下面就在相对简单的示例数据集中来看一看这些概念。在
数据流中,字符
Q
可能会在前三分之一部分出现很多次,而在后三分之二部分则一次也没
有出现。统计编码算法的概率表无法处理字符
Q
分布的这种局部性。如果字符
Q
出现的
概率为
0.01
,那么通常我们会期望它在整个数据流中均匀分布,也就是说,大约每
100
个
字符中就有
1
个是
Q
。
然而实际数据的情况并非如此,数据中总会存在某种类型的
局部偏态
(
locality-dependent
skewing
)
1
,将某些符号、想法或者单词集中在数据集的某个子区间里。
结果是统计编码算法生成的编码比根据熵生成的更臃肿,这是因为其所依据的概率信息没
注
1
:
这个词完全是我们自造的。
72
|
第
6
章
有考虑统计上的局部变化。例如,如果将数据流分为
N
块并且每块都单独压缩,那么得到
的结果可能会比将数据流整体压缩得到的结果小(如果数据流中存在很多局部偏态的情况 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115534170