Data compression

From LinuxReviews
Jump to navigationJump to search

Data compression is the art of storing an amount of data using less space than the original data. There are two main categories of data compression: Lossless and lossy.

Lossless Compression

Lossless compression generates a 1:1 compressed copy of the original data. Compression algorithms like zstd and lzip make archives that can be extracted.

The lossless audio FLAC audio compression format compresses audio into files that contain everything the original files had. A FLAC file created from a .WAV file can be decompressed into a identical WAV file.

See also: Comparison of Compression Algorithms

Lossy Compression

Lossy compression does not just involve compression. The original file is analyzed and modified before any actual data compression takes place. Most audio and video compression is done using lossy compression.

Lossy audio codecs like MP3, Vorvis and Opus will first look for parts of the original file that are "not important" and throw those away. The same is true for video codecs like HEVC, VP9 and AV1. Converting a video file back and forth between HEVC and VP9 100 times will result in a file with far less data than the original file had.

Lossy compression should be avoided whenever it is possible to do so. Lossy audio codecs like MP3 and Opus used to have a purpose. Larger storage capacities have made them a foolish choice for computer hard drives. Converting a collection of FLAC files to Vorbis or Opus for the purpose of temporary storing files on a portable device like a phone or music player is of course fine.

Avoiding lossy compression is harder when it comes to video. Storage capacities are still such that it is rather unpractical to store raw lossless compressed video.

See also: HOWTO Convert audio files, Lossy audio compression

Add your comment
LinuxReviews welcomes all comments. If you do not want to be anonymous, register or log in. It is free.