FLAC

Template: Infobox file format / Maintenance / MagischeZahlHex missing FLAC

Free Lossless Audio Codec (FLAC, English for Free Lossless Audio-Kodierer/-Dekodierer ) is a codec for lossless audio data compression, which is being developed as part of the Xiph.Org Foundation. It is free and its use is not limited by software patents.

  • 6.1 Software and Hardware Support

History

The development of FLAC began in 2000. The format was established at the beginning of the beta stage through release of version 0.5 of the reference implementation on 15 January 2001. On July 20, 2001 Revision 1.0 was released. In February 2002, was the first manufacturer to PhatNoise, support for FLAC in his audio system is known. 2003 announced the Xiph.Org Foundation to integrate FLAC into their container format, in order to enable next Vorbis and lossless compression. In 2004, a greater public attention was drawn to FLAC, as the band Metallica announced their concert recordings in the future not only in the loss and patent -prone MP3 format for sale, but to offer the recordings in FLAC format for music lovers. Since May 2006 there is in addition to the reference implementation of Xiph / Coalson an alternative encoder called Flake by Justin Ruggles, who was admitted to FFmpeg.

Between 2007 and 2013 the development of FLAC rested completely until it was announced on 26 May 2013, the official website that a new development team has been assembled and will henceforth worked again FLAC. At the same time, version 1.3.0 has been released.

The project

The project focuses on the following topics:

  • The streaming format,
  • LibFLAC, a library of reference encoders and decoders, and a metadata interface,
  • LibFLAC , an object wrapper around libFLAC
  • Flac, a command line tool for encoding and decoding. flac files with libFLAC,
  • Metaflac, a command line tool for editing the metadata. flac files, and
  • Input filters as plugins for various music players (Winamp, XMMS, ...).

LibFLAC and libFLAC are on a customized version of the BSD license, flac, metaflac and the extensions available under the GPL.

Formats

FLAC files are stored by default in FLAC own container and can contain a data stream. As a metadata format Vorbis comment will be used. In Ogg and Matroska containers several FLAC compressed audio data can be stored next to each other in the same file, usually accompanied by a video data stream for multilingual movies.

Comparison with other formats

Unlike lossy audio data compression methods such as MP3 or Ogg Vorbis compression is lossless in FLAC, so there is no loss of quality; for the compressed files are larger but many times as lossy compressed (factor of about 1.8 upwards). Technically, FLAC is characterized above all by the fact that it can be streamed and brings multi-channel, replay gain and cue sheet support with it. In addition, RIFF and AIFF metadata can be embedded into FLAC files, which will be restored when decoding. The compression strength is compared to other lossless audio codecs in midfield.

In addition FLAC is a so-called asymmetric codec, ie the amount of computation for encoding is much higher than that for the decoding. The computational effort for decoding is even lower than that of many other lossless codecs. Background is the consideration that a file usually only once coded, but much more common (mostly for playing) decoded. This illustrates the format of comparatively low requirements on the computing power of players or programs. Since there is only one level of complexity, the complexity in decoding still remains the same - regardless of the Enkodereinstellung. This is one of the reasons why Apple Lossless FLAC addition, the lossless compression format, Apple acquired players on a certain distribution has.

Compression

According to the developers, FLAC achieves an average compression to around 50 % of the initial size, the difference to other lossless audio compression method is therefore in a range of a few percentage points. But various other tests seem to suggest a compression to about 60 %. The type of music is crucial for the possible compression rate: A quiet piece with a few instruments can be compressed to 30 % of the original size, a very complex piece, however, only come to 75%. The compression rate depends strongly on sample rate and word length.

Method

FLAC uses for encoding and decoding only fixed-point arithmetic, which in particular hardware implementations can be simplified. With respect to the input signal of the codec is very flexible: resolutions between four and 32 bits per sample, sampling frequencies between 1 Hz and approximately 655 kHz and a channel number between one and eight are supported. The file format supports the storage of metadata using Vorbis comment and can also store replay gain data. During compression, FLAC processes the input data in several steps:

  • Blocking: FLAC divides the data of each channel is always in blocks of 1000 to 6000 samples. The blocks of all the channels at any given time are placed together in a frame.
  • Inter Channel Decorrelation: If a stereo signal is present, it can from the present left-right encoding ( that is, each channel is encoded separately) can be converted into a mid-side coding. This is done either fixed (ie always left at L / R or always in M / S transform ) or adaptively in each frame ( the encoder selects the favorable encoding). In the case of signals with more channels (eg 5.1 surround ), this step can be applied by analogy.
  • Modeling: The values ​​history of each block is approximated by either a polynomial or by the method of linear predictive coding. The resulting coefficients are stored in the frame.
  • Residual Coding: The error signal, ie the difference between the actual signal and the modeled signal is stored by means of Rice coding lossless frame.
  • Framing: Finally, the resulting frames are provided with header and footer, which among other things, for error detection using CRC and synchronizability.

Compression levels

The individual parameters of the FLAC encoding are all manually adjustable in the reference encoder, including the block size, the degree of linear predictive coding or the use of mid-side coding. In order to simplify the handling but the reference encoder also offers nine levels of compression to (0-8, default level is 5), each representing a certain preset parameter combination. The coding in higher levels affects Although only little on the available file size, but the computing time increases disproportionately; the decoding speed, however, remains almost constant.

  • Steps 0-2 work with extremely small blocks and fixed LPC coefficients to increase the coding speed.
  • The steps of 3-6 using larger blocks and a LPC level of up to eight in order to compress a space-saving.
  • The steps 7 and 8 to try in addition, by exhaustive search for the optimal encoding parameters ( model exhaustive search) to get the target file to a minimal size, with the disadvantage of a much lower encoding speed.

Dissemination

Since FLAC is also part of Ogg framework of the Xiph.Org Foundation, FLAC comes the awareness of other formats of the Foundation, such as Vorbis, benefit. There are also adequate efforts to port the codec on all platforms that support Ogg.

Software and hardware support

Since FLAC free software is any program or device is allowed to use it. So it is the standard supported by most Linux distributions. For many other operating systems are FLAC plug-ins and playback programs available that FLAC support (such as VLC media player, Songbird, Winamp, QuickTime / iTunes, Clementine, AIMP, The KMPlayer, Media Player Classic, or foobar2000 ).

Since about 2003, there are devices on the market, increasingly portable players that can play the free audio format. For many players, in which the firmware can be updated, there is an additional open source projects that support FLAC playback, such as Rockbox. For mobile phones with Android several programs for playing FLAC available. Since version 3.1, Android has native FLAC support. Under Symbian Freeware OggPlay example, can be used.

413
de