Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
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?
Posted

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!
 
Share this answer
 
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900