Free Lossless Audio Codec

from Wikipedia, the free encyclopedia
Free Lossless Audio Codec
File extension : .flac
MIME type : audio / x-flac, audio / flac
Magic number : fLaC
Developed by: Josh Coalson ( Xiph.Org Foundation )
Type: Audio
Standard (s) : Format specification
Website : xiph.org/flac

FLAC reference implementation

Logo of the Free Lossless Audio Codec (FLAC)
FLAC command line.png
Basic data

developer Xiph.Org Foundation
Current  version 1.3.3
(August 4, 2019)
operating system cross-platform
programming language C.
category Audio format
License BSD / GPL
German speaking No
xiph.org/flac

Free Lossless Audio Codec ( FLAC , English for Free lossless audio encoder / decoder ) is a codec for lossless audio data compression , which under the Xiph.Org Foundation is developed. It is freely available and its use is not restricted by software patents .

history

Development of FLAC began in 2000. The format was established at the beginning of the beta stage with the release of version 0.5 of the reference implementation on January 15, 2001. Version 1.0 was released on July 20, 2001. In February 2002 the first manufacturer, PhatNoise , announced the support of FLAC in its audio system. In 2003 the Xiph.Org Foundation announced that it would integrate FLAC into its container format in order to enable both Vorbis and lossless compression. In 2004 a wider public became aware of FLAC when the band Metallica announced that in future they would not only sell their concert recordings in the lossy and then patented MP3 format , but also offer the recordings in FLAC format for music lovers. In addition to the reference implementation from Xiph / Coalson, an alternative encoder called Flake by Justin Ruggles, which was included in FFmpeg , has existed since May 2006 .

Development of FLAC was completely suspended between 2007 and 2013, until it was announced on the official website on May 26, 2013 that a new development team had been put together and that FLAC would be worked on again from now on. Version 1.3.0 was released at the same time.

The project

The project is dedicated to the following topics:

libFLAC and libFLAC ++ are available under an adapted version of the BSD license , flac, metaflac and the extensions under the GPL .

Formats

FLAC files are saved by default in FLAC's own container and can contain a data stream . As metadata format is Vorbis comment used. In Ogg and Matroska containers, several FLAC-compressed audio data can be stored side by side in the same file, usually together with a video data stream for multilingual films.

Comparison with other formats

In contrast to lossy audio data compression methods such as MP3 or Ogg Vorbis , the compression with FLAC is lossless, so there is no loss of quality; however, the compressed files are many times larger than lossy compressed files (factor approx. 1.8 upwards). From a technical point of view, FLAC is characterized above all by the fact that it can be streamed and that it has multi-channel , replay gain and cuesheet support. In addition, RIFF and - AIFF - metadata FLAC files are embedded in, which will be restored when decoding. Compared to other lossless audio codecs, the compression strength is in the middle.

FLAC is also a so-called asymmetric codec , i. H. the computational effort for coding is significantly higher than that for decoding. The computational effort for decoding is even less than that for many other lossless codecs. The background to this is the consideration that a file is usually only encoded once, but is decoded much more frequently (mostly for playback). As a result, the format makes comparatively low demands on the computing power of playback devices or programs. Since there is only one level of complexity , the effort involved in decoding always remains the same - regardless of the encoder setting. This is one of the reasons why FLAC next Apple Lossless , lossless compression format from Apple , to players a certain distribution has become.

compression

According to the developers, FLAC achieves an average compression to around 50 percent of the original size, the difference to other lossless audio compression methods is therefore in a range of a few percentage points. Various other tests suggest compression to around 60 percent.

Various factors have a significant influence on the compression rate:

  • Sampling rate: The higher the sampling rate, the greater the compression achieved, since the signal contains fewer high frequencies in relation to the sampling rate and is overall more predictable.
  • The coded signal itself has a significant impact:
    • Higher atonality makes the signal less predictable.
    • A higher level of signal modulation makes the signal less predictable.
  • Bit depth: The more bit depth the signal has, the more difficult it is to compress it. In principle, it is therefore a more meaningful measured variable to specify the absolute number of bits saved on average per sample instead of the compression rate, since this is largely independent of the bit depth.

Procedure

FLAC uses only fixed point arithmetic for coding and decoding , which in particular simplifies hardware implementations. The codec is very flexible with regard to the input signal: resolutions between 4 and 32 bits per sample , sampling frequencies between 1 Hz and around 655 kHz and 1 to 8 channels are supported. The file format used supports the storage of metadata using Vorbis comment and can also store replay gain data . With compression, FLAC processes the input data in several steps:

  • Blocking : FLAC divides the data of each channel into blocks of 1000 to 6000 samples each. The blocks of all channels at a certain point in time are put together in one frame.
  • Inter-Channel Decorrelation : If a stereo signal is present, it can be converted from the existing left-right coding (i.e. each channel is coded separately) into a mid-side coding . This is done either permanently (i.e. always left at L / R or always converted to M / S) or adaptively in each frame (the encoder selects the more favorable coding). In the case of signals with more channels (e.g. 5.1 surround), this step can be used analogously.
  • Modeling : The course of values ​​of each block is approximated either by means of a polynomial function or with the linear predictive coding method . The resulting coefficients are stored in the frame.
  • Residual Coding : The error signal, i.e. the difference between the actual signal and the modeled signal, is stored in the frame without loss using Rice coding .
  • Framing : Finally, the resulting frames are provided with headers and footers, which, among other things, ensure error detection using CRC and synchronization.

Compression levels

The parameters of the encoder regulate, among other things, the block size, the degree of linear predictive coding or the use of mid-side coding. In order to simplify handling, the reference implementation has 9 selectable compression levels, each of which stands for a specific selection of parameter combinations. The higher levels only have a slight effect on the reduction of the file size, but the computing time required increases disproportionately; the decoding speed, however, remains almost constant.

  • Levels 0 to 2 work with relatively small blocks and fixed LPC coefficients in order to increase the coding speed.
  • Levels 3 to 6 use larger blocks and an LPC level of up to eight in order to compress more space.
  • Levels 7 and 8 also attempt to compress the target file to a minimum size by extensive search for the optimal coding parameters ( exhaustive model search ), which significantly slows down the encoding speed.

The reference implementation uses level 5 as the standard.

distribution

Since FLAC is also part of the Ogg framework of the Xiph.Org Foundation, the awareness of other formats of the foundation, such as Vorbis , also benefits FLAC. In addition, efforts are being made to port the codec to all platforms that Ogg support.

Software and hardware support

Since FLAC is free software , any program and device can use it. It is supported by most Linux distributions by default . FLAC plug-ins and playback programs that support FLAC are available for many other operating systems - examples are VLC media player , Quod Libet , Songbird , Winamp , Clementine , AIMP , The KMPlayer , Media Player Classic and foobar2000 .

Devices have been on the market since around 2003, including increasingly portable players that can play the free audio format. For many players that have firmware updates, there are also open source projects that support FLAC playback, such as Rockbox . Various programs for playing FLAC are available for mobile phones with Android . From version 3.1, Android offers native FLAC support. For example, the freeware OggPlay can be used under Symbian . In web browsers, FLAC Playback is fully supported natively in Firefox from version 51 (January 2017) and in Chrome from version 56 (January 2017).

Online sales

Some online stores offer audio in addition the format FLAC to or have generally specialized in lossless audio formats, for example, offers GOG.com DRM -free computer game - soundtracks in FLAC format. Providers of high-resolution music recordings in particular are reliant on lossless audio compression.

See also

Web links

Commons : Free Lossless Audio Codec  - collection of images, videos and audio files
  • Project page at Xiph.Org (English)
  • FLAC in the Wiki of the Xiph.Org Foundation (English)
  • FLAC on the Hydrogenaudio Wiki
  • FLAC compared to other lossless audio formats in Hydrogenaudio's Wiki
  • Further information on software support and the creation of FLAC files at blog.teufel.de
  • FLAC compared to MP3 from different points of view on chip.de

Individual evidence

  1. a b changelog. xiph.org, accessed October 24, 2019 .
  2. ^ The flac Open Source Project on Open Hub: Languages ​​Page . In: Open Hub . (accessed October 17, 2018).
  3. Hajo Schulz: Metallica offers concert recordings for download. In: Heise online. April 7, 2004, accessed November 16, 2016 .
  4. flake-enc.sourceforge.net
  5. Lossless comparison in the hydrogenaudio.org wiki, January 4, 2006 (English).
  6. FLAC homepage: Comparison , accessed on October 15, 2013.
  7. Performance comparison of lossless audio compressors ( Memento of the original from November 25, 2010 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. , dated February 7, 2005, accessed April 8, 2009. @1@ 2Template: Webachiv / IABot / members.home.nl
  8. SqueezeChart: Lossless Audio Compression , from February 14, 2009 ( Memento from October 5, 2013 in the web archive archive.today )
  9. FLAC homepage: FAQ , accessed on October 15, 2013.
  10. flac homepage: Documentation , accessed on October 15, 2013.
  11. according to the parameter description of the FLAC reference encoder in version 1.2.1.
  12. ^ Xiph.Org Foundation: license. In: flac. free lossless audio codec. Retrieved October 16, 2017 .
  13. Android Developer - Supported Media Formats
  14. OggPlay homepage on Sourceforge.net.
  15. Where can I buy FLAC music files? The Guardian (June 14, 2012)
  16. Jordan Devore: How nice: GOG.com adds 31 FLAC soundtracks ( English ) Destructoid. January 31, 2014. Retrieved June 17, 2014: “One of my favorite features of GOG.com is its inclusion of bonuses at no additional charge [...] Going a step further this week, GOG.com has added 31 FLAC -encoded soundtracks to games like Another World, Darklands, Earthworm Jim, Heroes of Might and Magic, MDK 2, Neverwinter Nights 2, Shadow Warrior, and The Witcher. "
  17. Explanation in the official FAQ from hdtracks.com (English).