FLAC
Encyclopedia
FLAC is a codec
Codec
A codec is a device or computer program capable of encoding or decoding a digital data stream or signal. The word codec is a portmanteau of "compressor-decompressor" or, more commonly, "coder-decoder"...

 (compressor-decompressor) which allows digital audio
Digital audio
Digital audio is sound reproduction using pulse-code modulation and digital signals. Digital audio systems include analog-to-digital conversion , digital-to-analog conversion , digital storage, processing and transmission components...

 to be losslessly compressed such that file size is reduced without any information being lost. Digital audio compressed by FLAC's algorithm
Algorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...

 can be typically be reduced to 50–60% of its original size, and decompressed into an identical copy of the original audio data.

FLAC is an open format
Open format
An open file format is a published specification for storing digital data, usually maintained by a standards organization, which can therefore be used and implemented by anyone. For example, an open format can be implementable by both proprietary and free and open source software, using the typical...

 with royalty-free licensing and a reference implementation
Reference implementation
In the software development process, a reference implementation is the standard from which all other implementations, with their attendant customizations, are measured, and to which all improvements are added...

 which is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

. FLAC has support for metadata
Metadata
The term metadata is an ambiguous term which is used for two fundamentally different concepts . Although the expression "data about data" is often used, it does not apply to both in the same way. Structural metadata, the design and specification of data structures, cannot be about data, because at...

 tagging, album cover
Album cover
An album cover is the front of the packaging of a commercially released audio recording product, or album. The term can refer to either the printed cardboard covers typically used to package sets of 10" and 12" 78 rpm records, single and sets of 12" LPs, sets of 45 rpm records , or the front-facing...

 art, and fast seeking.

Though FLAC playback support in portable audio devices and dedicated audio systems is limited compared to formats like MP3
MP3
MPEG-1 or MPEG-2 Audio Layer III, more commonly referred to as MP3, is a patented digital audio encoding format using a form of lossy data compression...

 or uncompressed PCM
Pulse-code modulation
Pulse-code modulation is a method used to digitally represent sampled analog signals. It is the standard form for digital audio in computers and various Blu-ray, Compact Disc and DVD formats, as well as other uses such as digital telephone systems...

, FLAC is supported by more hardware devices than competing lossless compressed formats like WavPack
WavPack
WavPack is a free, open source lossless audio compression format developed by David Bryant.-Features:WavPack compression can compress 8-, 16-, 24-, and 32-bit fixed-point, and 32-bit floating point audio files in the .WAV file format. It also supports surround sound streams and high frequency...

.

History

Development started in 2000 by Josh Coalson. The bit-stream format was frozen when FLAC entered beta stage with the release of version 0.5 of the reference implementation on 15 January 2001. Version 1.0 was released on 20 July 2001.

On 29 January 2003, the Xiph.Org Foundation
Xiph.Org Foundation
Xiph.Org Foundation is a non-profit organizationthat produces free multimedia formats and software tools. It focuses on the Ogg family of formats, the most successful of which has been Vorbis, an open and freely licensed audio format and codec designed to compete with the patented MP3 and AAC...

 and the FLAC project announced the incorporation of FLAC under the Xiph.org banner. Xiph.org is behind other free compression formats such as Vorbis
Vorbis
Vorbis is a free software / open source project headed by the Xiph.Org Foundation . The project produces an audio format specification and software implementation for lossy audio compression...

, Theora
Theora
Theora is a free lossy video compression format. It is developed by the Xiph.Org Foundation and distributed without licensing fees alongside their other free and open media projects, including the Vorbis audio format and the Ogg container....

 and Speex
Speex
Speex is a patent-free audio compression format designed for speech and also a free software speech codec that may be used on VoIP applications and podcasts. It is based on the CELP speech coding algorithm. Speex claims to be free of any patent restrictions and is licensed under the revised BSD...

.

On 17 September 2007, the version 1.2.1 was released.

Composition

The FLAC project consists of:
  • The stream formats
  • A simple container format for the stream, also called FLAC (or Native FLAC)
  • libFLAC, a library of reference encoders and decoders, and a metadata interface
  • libFLAC++, an object wrapper around libFLAC
  • flac, a command-line program based on libFLAC to encode and decode FLAC streams
  • metaflac, a command-line metadata editor for .flac files and for applying ReplayGain
  • Input plugins for various music players (Winamp
    Winamp
    Winamp is a media player for Windows-based PCs and Android devices, written by Nullsoft, now a subsidiary of AOL. It is proprietary freeware/shareware, multi-format, extensible with plug-ins and skins, and is noted for its graphical sound visualization, playlist, and media library features.Winamp...

    , XMMS
    XMMS
    The X Multimedia System is a free audio player for Unix-like systems.-History:XMMS was originally written as X11Amp by Peter and Mikael Alm in November 1997. The player was made to resemble Winamp, which was first released in May that year. As such, XMMS has supported Winamp 2 "classic" skins...

    , foobar2000
    Foobar2000
    foobar2000 is a freeware audio player for Windows developed by Peter Pawlowski, a former freelance contractor for Nullsoft. It is known for its highly modular design and extensive SDK which allows third-party developers to do such things as completely replace the interface...

    , musikCube
    MusikCube
    musikCube is a partially open source audio player. Originally created as a fork of wxMusik, it has since been expanded to include capabilities not available in wxMusik. Internally, musikCube uses the proprietary BASS audio library to provide playback support....

    , and many more)
  • With Xiph.org incorporation, the Ogg
    Ogg
    Ogg is a free, open container format maintained by the Xiph.Org Foundation. The creators of the Ogg format state that it is unrestricted by software patents and is designed to provide for efficient streaming and manipulation of high quality digital multimedia.The Ogg container format can multiplex...

     container format, suitable for streaming (also called Ogg FLAC)


The specification of the stream format can be implemented by anyone without prior permission (Xiph.org reserves the right to set the FLAC specification and certify compliance), and that neither the FLAC format nor any of the implemented encoding
Encoder
An encoder is a device, circuit, transducer, software program, algorithm or person that converts information from one format or code to another, for the purposes of standardization, speed, secrecy, security, or saving space by shrinking size.-Media:...

 / decoding
Decoder
A decoder is a device which does the reverse operation of an encoder, undoing the encoding so that the original information can be retrieved. The same method used to encode is usually just reversed in order to decode...

 methods are covered by any patent. It also means that the reference implementation
Reference implementation
In the software development process, a reference implementation is the standard from which all other implementations, with their attendant customizations, are measured, and to which all improvements are added...

 is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

. The source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

 for libFLAC and libFLAC++ is available under the BSD license, and the sources for flac, metaflac, and the plugins are available under the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

.

In its stated goals, the FLAC project encourages its developers not to implement copy prevention features of any kind.

Design

Audio sources encoded to FLAC are typically reduced to 50–60% of their original size.

FLAC supports only fixed-point
Fixed-point arithmetic
In computing, a fixed-point number representation is a real data type for a number that has a fixed number of digits after the radix point...

 samples, not floating-point. This is to avoid the imprecision of floating point arithmetic so as to ensure the encoder is fully lossless. It can handle any PCM bit resolution
Audio bit depth
In digital audio, bit depth describes the number of bits of information recorded for each sample. Bit depth directly corresponds to the resolution of each sample in a set of digital audio data...

 from 4 to 32 bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

s per sample, any sampling rate
Sampling rate
The sampling rate, sample rate, or sampling frequency defines the number of samples per unit of time taken from a continuous signal to make a discrete signal. For time-domain signals, the unit for sampling rate is hertz , sometimes noted as Sa/s...

 from 1 Hz
Hertz
The hertz is the SI unit of frequency defined as the number of cycles per second of a periodic phenomenon. One of its most common uses is the description of the sine wave, particularly those used in radio and audio applications....

 to 655,350 Hz in 1 Hz increments, and any number of channels from 1 to 8. Channels can be grouped in cases like stereo
Stereophonic sound
The term Stereophonic, commonly called stereo, sound refers to any method of sound reproduction in which an attempt is made to create an illusion of directionality and audible perspective...

 and 5.1 channel surround
Surround sound
Surround sound encompasses a range of techniques such as for enriching the sound reproduction quality of an audio source with audio channels reproduced via additional, discrete speakers. Surround sound is characterized by a listener location or sweet spot where the audio effects work best, and...

 to take advantage of interchannel correlations to increase compression. FLAC uses CRC
Cyclic redundancy check
A cyclic redundancy check is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to raw data...

 checksums for identifying corrupted frames when used in a streaming protocol, and also has a complete MD5
MD5
The MD5 Message-Digest Algorithm is a widely used cryptographic hash function that produces a 128-bit hash value. Specified in RFC 1321, MD5 has been employed in a wide variety of security applications, and is also commonly used to check data integrity...

 hash of the raw PCM audio stored in its STREAMINFO metadata header. FLAC allows for a Rice parameter
Golomb coding
Golomb coding is a lossless data compression method using a family of data compression codes invented by Solomon W. Golomb in the 1960s. Alphabets following a geometric distribution will have a Golomb code as an optimal prefix code, making Golomb coding highly suitable for situations in which the...

 between 0 and 16. FLAC supports ReplayGain.

FLAC uses linear prediction
Linear prediction
Linear prediction is a mathematical operation where future values of a discrete-time signal are estimated as a linear function of previous samples....

 to convert the audio samples to a series of small, uncorrelated numbers (known as the residual), which are stored efficiently using Golomb-Rice coding
Golomb coding
Golomb coding is a lossless data compression method using a family of data compression codes invented by Solomon W. Golomb in the 1960s. Alphabets following a geometric distribution will have a Golomb code as an optimal prefix code, making Golomb coding highly suitable for situations in which the...

. It also uses run-length encoding
Run-length encoding
Run-length encoding is a very simple form of data compression in which runs of data are stored as a single data value and count, rather than as the original run...

 for blocks of identical samples, such as silent passages.

For tagging, FLAC uses the same system as Vorbis comment
Vorbis comment
A Vorbis comment is a metadata container used in the Vorbis, FLAC, Theora and Speex file formats. It allows information such as the title, artist, album, track number or other information about the file to be added to the file itself. However, as the official Ogg Vorbis documentation notes:- Format...

s.

The libFLAC API is organized into streams, seekable streams, and files (listed in the order of increasing abstraction from the base FLAC bitstream). Most FLAC applications will generally restrict themselves to encoding/decoding using libFLAC at the file level interface.

Comparison to other formats

FLAC is specifically designed for efficient packing of audio data, unlike general purpose lossless algorithms such as DEFLATE
DEFLATE
Deflate is a lossless data compression algorithm that uses a combination of the LZ77 algorithm and Huffman coding. It was originally defined by Phil Katz for version 2 of his PKZIP archiving tool and was later specified in RFC 1951....

 which is used in ZIP and gzip
Gzip
Gzip is any of several software applications used for file compression and decompression. The term usually refers to the GNU Project's implementation, "gzip" standing for GNU zip. It is based on the DEFLATE algorithm, which is a combination of Lempel-Ziv and Huffman coding...

. While ZIP may compress a CD-quality audio file by 10–20%, FLAC achieves compression rates of 30–50% for most music, with significantly greater compression for voice recordings.

The technical strengths of FLAC compared to other lossless formats lie in its ability to be streamed and decoded quickly, which is independent of compression level. In a comparison of compressed audio formats, FFmpeg
FFmpeg
FFmpeg is a free software project that produces libraries and programs for handling multimedia data. The most notable parts of FFmpeg are libavcodec, an audio/video codec library used by several other projects, libavformat, an audio/video container mux and demux library, and the ffmpeg command line...

's FLAC implementation was noted to have the fastest and most efficient embedded decoder of any modern lossless audio format.

Since FLAC is a lossless scheme, it is suitable as an archive format for owners of CDs
Compact Disc
The Compact Disc is an optical disc used to store digital data. It was originally developed to store and playback sound recordings exclusively, but later expanded to encompass data storage , write-once audio and data storage , rewritable media , Video Compact Discs , Super Video Compact Discs ,...

 and other media who wish to preserve their audio collections. If the original media is lost, damaged, or worn out, a FLAC copy of the audio tracks ensures that an exact duplicate of the original data can be recovered at any time. An exact restoration from a lossy archive (e.g., MP3) of the same data is impossible. FLAC being lossless means it is highly suitable for transcode
Transcode
Transcoding is the direct digital-to-digital data conversion of one encoding to another, such as for movie data files or audio files. This is usually done in cases where a target device does not support the format or has limited storage capacity that mandates a reduced file size, or to convert...

 e.g. to MP3, without the normally associated transcoding quality loss. A CUE file can optionally be created when ripping
Ripping
Ripping is the process of copying audio or video content to a hard disk, typically from removable media. The word is used to refer to all forms of media. Despite the name, neither the media nor the data is damaged after extraction....

 a CD. If a CD is read and ripped perfectly to FLAC files, the CUE file allows later burning of an audio CD that is identical in audio data to the original CD, including track order, pregap
Pregap
The pregap on a Red Book audio CD is the portion of the audio track that precedes "index 01" for a given track in the table of contents . The pregap is typically two seconds long and usually, but not always, contains silence...

s, and CD-Text
CD-Text
CD-Text is an extension of the Red Book Compact Disc specifications standard for audio CDs. It allows for storage of additional information on a standards-compliant audio CD...

. However, additional data present on some audio CDs such as lyrics and CD+G
CD+G
CD+G is an extension of the compact disc standard that can present low-resolution graphics alongside the audio data on the disc when played on a compatible device...

 graphics are beyond the scope of a CUE file and most ripping software, so that data will not be archived.

Adoption and implementations

The reference implementation
Reference implementation
In the software development process, a reference implementation is the standard from which all other implementations, with their attendant customizations, are measured, and to which all improvements are added...

 of FLAC is implemented as the libFLAC core encoder & decoder library, with the main distributable program flac being the reference implementation
Reference implementation
In the software development process, a reference implementation is the standard from which all other implementations, with their attendant customizations, are measured, and to which all improvements are added...

 of the libFLAC API. This codec
Codec
A codec is a device or computer program capable of encoding or decoding a digital data stream or signal. The word codec is a portmanteau of "compressor-decompressor" or, more commonly, "coder-decoder"...

 API is also available in C++ as libFLAC++. The reference implementation of FLAC compiles on many platforms, including most Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 (such as Solaris and Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

) and Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 (including Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...

, BSD), Microsoft Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, BeOS
BeOS
BeOS is an operating system for personal computers which began development by Be Inc. in 1991. It was first written to run on BeBox hardware. BeOS was optimized for digital media work and was written to take advantage of modern hardware facilities such as symmetric multiprocessing by utilizing...

, and OS/2
OS/2
OS/2 is a computer operating system, initially created by Microsoft and IBM, then later developed by IBM exclusively. The name stands for "Operating System/2," because it was introduced as part of the same generation change release as IBM's "Personal System/2 " line of second-generation personal...

 operating systems. There are build systems for autoconf
Autoconf
GNU Autoconf is a tool for producing configure scripts for building, installing and packaging software on computer systems where a Bourne shell is available....

/automake
Automake
GNU Automake is a programming tool that produces portable makefiles for use by the make program, used in compiling software. It is made by the Free Software Foundation as one of GNU programs, and is part of the GNU build system. The makefiles produced follow the GNU Coding Standards.It is written...

, MSVC, Watcom C, and Xcode
Xcode
Xcode is a suite of tools, developed by Apple, for developing software for Mac OS X and iOS. Xcode 4.2, the latest major version, is available on the Mac App Store for free for Mac OS X 10.7 , and on the Apple Developer Connection website for free to registered developers Xcode is a suite of tools,...

. There is currently no multicore
Multicore
Multicore may refer to:* Multi-core processor ** Multicore Association, founded in 2005, a non-profit, industry consortium focused on multicore technology* multicore cable, a generic term for an electrical cable that has multiple cores...

 support in libFLAC.

Though FLAC playback support in portable audio devices and dedicated audio systems is limited compared to formats like MP3
MP3
MPEG-1 or MPEG-2 Audio Layer III, more commonly referred to as MP3, is a patented digital audio encoding format using a form of lossy data compression...

 or uncompressed PCM
Pulse-code modulation
Pulse-code modulation is a method used to digitally represent sampled analog signals. It is the standard form for digital audio in computers and various Blu-ray, Compact Disc and DVD formats, as well as other uses such as digital telephone systems...

, FLAC is supported by more hardware devices than competing lossless compressed formats like WavPack
WavPack
WavPack is a free, open source lossless audio compression format developed by David Bryant.-Features:WavPack compression can compress 8-, 16-, 24-, and 32-bit fixed-point, and 32-bit floating point audio files in the .WAV file format. It also supports surround sound streams and high frequency...

.

The European Broadcasting Union
European Broadcasting Union
The European Broadcasting Union is a confederation of 74 broadcasting organisations from 56 countries, and 49 associate broadcasters from a further 25...

(EBU) has adopted the FLAC format for the distribution of high quality audio over its Euroradio network.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK