数据压缩(有损和无损)如何工作? [英] How does data compression (lossy and lossless) works?

查看:132
本文介绍了数据压缩(有损和无损)如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有许多可用的压缩算法,通常这些算法从文件中获取频繁值,该文件必须被压缩并保持计数。那么,这些价值究竟是什么呢?这些字节(我认为大多数文件都以十六进制形式表示以方便使用)构成整个文件吗?



压缩算法是什么东西在文件中查找随机性?

解决方案

哦,男孩......



这是一个复杂的主题:远远超出我们在一个小文本框中讨论的内容。



所以从这里开始:https://en.wikipedia.org/wiki/Data_compression [ ^ ]



然后开始阅读其中一些内容: Google [ ^ ]



我们可以回答具体的问题 - 但我们无法解释这样的大问题!


它在算法上以及要压缩的数据,特别是在有损压缩的情况下。 频繁值的使用只是在一些通常最原始的算法中使用的技术,例如游程编码 https://en.wikipedia.org/wiki/Run-length_encoding [ ^ ])。在这种情况下,值可以是任何长度的连续字节的任何数组,并且长度通常是有限的。



许多压缩算法不使用此方法。例如,典型的音频和视频压缩算法使用基于小波的方法: https://en.wikipedia。 org / wiki / Wavelet [ ^ ]。



一个非常有趣的压缩方法基于分形

https://en.wikipedia.org/wiki/Fractal_compression [ ^ ],

https://en.wikipedia .org / wiki / Fractal [ ^ ]。



毋庸置疑,这些压缩算法与您使用文件中的常用值的想法相去甚远。



这个主题太大而且难以涵盖在快速解答中。您可以从这篇概述文章开始: https://en.wikipedia.org/wiki/Data_compression [ ^ ]。



-SA

There are many compression algorithms available and in general these algorithms take the frequent values from a file which has to be compressed and keeps a count of it. Okay, so what are these values exactly? are these the bytes (I think most files are represented in Hexadecimal form for ease of use) which make up the entire file?

What is that thing which the compression algorithms look in a file for randomness?

解决方案

Oh, boy...

This is a complicated subject: far, far beyond what we can discuss in a little text box.

So start here: https://en.wikipedia.org/wiki/Data_compression[^]

Then begin reading some of these: Google[^]

We can answer specific questions - but we can't explain a huge subject like that!


It on the algorithm and the data to be compressed as well, especially in case of lossy compression. The use of "frequent values" is just the technique used only in some, often most primitive algorithms, such as run-length encoding (https://en.wikipedia.org/wiki/Run-length_encoding[^]). The "values" in this case could be any arrays of consecutive bytes of any length, and the lengths are usually limited.

Many algorithms of compression don't use this approach at all. For example, typical audio and video compression algorithms use wavelet-based approach: https://en.wikipedia.org/wiki/Wavelet[^].

A very interesting compression method is based on fractals:
https://en.wikipedia.org/wiki/Fractal_compression[^],
https://en.wikipedia.org/wiki/Fractal[^].

Needless to say, these compression algorithms are quite far from your idea of using of "the frequent values from a file".

This topic is too big and complicated to cover in a Quick Answer. You can start with this overview article: https://en.wikipedia.org/wiki/Data_compression[^].

—SA


这篇关于数据压缩(有损和无损)如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆