817.flac_s
SPEC CPU®2026 Benchmark Description

Benchmark Name

817.flac_s

Benchmark Program General Category

Lossless Audio Compression

Benchmark Authors

Josh Coalson, original author; Erik de Castro Lopo, maintainer; Martijn van Beurden, maintainer.

Benchmark Description

FLAC is the Free Lossless Audio Codec. FLAC is open source software that can reduce the amount of storage space needed to store digital audio signals without needing to remove information in doing so. Digital audio compressed by FLAC's algorithm can typically be reduced to between 50 and 70 percent of its original size and decompresses to an identical audio copy of the original audio data (although the metadata may have changed).

FLAC is a lossless encoding of linear pulse-code modulation data. The FLAC encoding algorithm consists of multiple stages. In the first stage, the input audio is split into blocks. If the audio contains multiple channels, each channel is encoded separately as a subblock. The encoder then tries to find a good mathematical approximation of the block, either by fitting a simple polynomial, or through general linear predictive coding. A description of the approximation, which is only a few bytes in length, is then written. Finally, the difference between the approximation and the input, called residual, is encoded using Rice coding. In many cases, a description of the approximation and the encoded residual takes up less space than using pulse-code modulation.

The SPEC CPU version of FLAC started with the v1.4.3 release, and some cherry picked commits were added to enable multithreading. The benchmark exercises the encoding path at high compression rates, and also analyzes/tests the output file to ensure correctness of the encoded audio.

Input Description

The inputs are .wav audio files, either in mono or stereo. The command lines are constructed to encode at high compression levels and verify the result. The performant switches for the benchmark command lines are as follows:

There are more options available, which can be discovered through running flac -h. A savvy user can use their own audio input file with other encoding options to craft their own benchmark.

FLAC public documentation is available at xiph.org/flac/documentation.html.

Output Description

The output consists of an encoded .flac file, and the standard output of the benchmark run. The SPEC verification step is performed on the stdout, which provides the status of the flac internal verification, as well as the encoded file size in bytes and the compression ratio. The benchmark also runs the analyze/test step which decodes the file without writing out the bytes. This is a more detailed and heavyweight step in checking the integrity of encoded audio for each frame; therefore it is only done during the (untimed) test size of the benchmark. Note that a SPEC CPU reportable run requires that the benchmark binary successfully validate all three workload sizes - test, train, and ref.

Even though FLAC is lossless, we allow for some tolerance in the file size due to metadata and other nuances. To motivate this tolerance, here are some relevant Q+A's taken directly from the FLAC FAQ:

Programming Language

C, plus C++ for threading

Threading Model

The benchmark uses C++ std::thread for parallelism.

Known Portability Issues

GNU/Linux systems implement C++ std::thread using POSIX Threads. Although some systems automatically include the needed support, this is not universal. Surprises have been seen when changing OS versions, or libraries, or compilers; or when FDO is added; or when combining C and C++ modules. Typically, it is safest to add -pthread to all compile and link lines for all SPEC CPU benchmarks that use std::thread. Please see the $SPEC/config directory for Example config files that demonstrate how to conveniently do so.

Sources and Licensing

The sources for the Free Lossless Audio Codec (FLAC) are available at github.com/xiph/flac. The SPEC CPU sources started from v1.4.3 released on June 23, 2023, and added commits up to 8cf7e7fbb from August 7, 2023 to enable multithreading.

A variety of licenses apply, including GPLv2; LGPLv2.1; GPLv2; BSD-3 code copyrighted by Josh Coalson and the Xiph.Org Foundation; and MD5 code in md5.h and md5.c which has been dedicated to the public domain by its author, Ron Rivest.

The audio file inputs are given freely to SPEC by Ampere Computing.

References

Copyright © 2026 Standard Performance Evaluation Corporation (SPEC®)