How does lossless file compression work




















At this point, I should note that I have no insider knowledge about these systems. This is simply my understanding gathered over a couple of decades, and not denied by any relevant players. But it possible to roughly predict it. If the wave form is going up at a particular rate, the next sample will likely be close to a simple extrapolation of the sequence before the sample.

Here for example is sequence of samples from one channel of a real recording. You can see how from any set of three or four samples, you could approximately predict the next one:. So these compression systems all use a predictive algorithm. That saves space. But one thing is clear: a predictive model is going to sound terrible. Even if a predicted sample or two is fairly close to what it should be, it would soon drift far away from the correct signal. So, what the compressed audio stream mostly consists of is not the original signal, but a stream of corrections to the predictions.

The original signal in our example was bits, remember. Our corrections can generally be contained in 4, 6 or 8 bits, with perhaps the occasional 12 or even 16 bits required for extreme transients. If the average requirement for the correction stream is 8 bits, then that reduces the size of file or data stream by fifty percent.

I should clarify that. The efficiency depends on a lot of things. A lot of extreme transients will increase the file size, because the corrections will be bigger, requiring more bits to encode. And completely unpredictable data cannot be compressed at all with a system that depends on at least some predictability. Unpredictable data goes by another name: noise. I found that for those with 5. Because much of those least significant eight bits were noise. Read it here if you want to get deep into numbers and methodology.

But I should note that the reason the bit stuff managed a higher level of compression than is typical for stereo FLAC music is that with 5. MB is megabyte, Mb is megabit. There are 8 bits in a byte. It is conventional to talk about computer storage in bytes, and the rate of data required for digital audio in bits per second.

For the best exprience, visit the website. Create your account Lost password? First name. Last name. Lossless compression means that as the file size is compressed, the picture quality remains the same - it does not get worse.

Also, the file can be decompressed to its original quality. Lossy compression permanently removes data. There are a number of types of compressed image file.

These include the following. PNG is a lossless compression type. Files that include a lot of unique information, such as graphics or MP3 files , cannot be compressed much with this system because they don't repeat many patterns more on this in the next section. If a file has a lot of repeated patterns, the rate of reduction typically increases with file size. You can see this just by looking at our example -- if we had more of Kennedy's speech, we would be able to refer to the patterns in our dictionary more often, and so get more out of each entry's file space.

Also, more pervasive patterns might emerge in the longer work, allowing us to create a more efficient dictionary.

This efficiency also depends on the specific algorithm used by the compression program. Some programs are particularly suited to picking up patterns in certain types of files, and so may compress them more succinctly. Others have dictionaries within dictionaries, which might compress efficiently for larger files but not for smaller ones.

While all compression programs of this sort work with the same basic idea, there is actually a good deal of variation in the manner of execution. Programmers are always trying to build a better system. The type of compression we've been discussing here is called lossless compression , because it lets you recreate the original file exactly.

All lossless compression is based on the idea of breaking a file into a "smaller" form for transmission or storage and then putting it back together on the other end so it can be used again. Lossy compression works very differently.

These programs simply eliminate "unnecessary" bits of information, tailoring the file so that it is smaller. This type of compression is used a lot for reducing the file size of bitmap pictures, which tend to be fairly bulky. To see how this works, let's consider how your computer might compress a scanned photograph. A lossless compression program can't do much with this type of file.

While large parts of the picture may look the same -- the whole sky is blue, for example -- most of the individual pixels are a little bit different. To make this picture smaller without compromising the resolution, you have to change the color value for certain pixels.

If the picture had a lot of blue sky, the program would pick one color of blue that could be used for every pixel. Then, the program rewrites the file so that the value for every sky pixel refers back to this information. If the compression scheme works well, you won't notice the change, but the file size will be significantly reduced. Of course, with lossy compression, you can't get the original file back after it has been compressed. You're stuck with the compression program's reinterpretation of the original.

For this reason, you can't use this sort of compression for anything that needs to be reproduced exactly, including software applications, databases and presidential inauguration speeches. For more information on file compression and related topics, check out the links on the next page. Sign up for our Newsletter! Mobile Newsletter banner close. Mobile Newsletter chat close. Mobile Newsletter chat dots. Mobile Newsletter chat avatar. Mobile Newsletter chat subscribe.

Computer Software. File Sharing. How File Compression Works. Need to compress your files? Redundancy and Algorithms Most compression programs use a variation of the LZ adaptive dictionary-based algorithm to shrink files. Searching for Patterns In our previous example, we picked out all the repeated words and put those in a dictionary.



0コメント

  • 1000 / 1000