1

I have bought some music online, delivered in WAV format, presumably highest quality, supposing there was no transcoding happening, but anyway, straight to my question:

My intention is to get at least some minimum understanding of two flac's (man page) options:

  1. -p, --qlp-coeff-precision-search:

    Do exhaustive search of LP coefficient quantization (expensive!). Overrides -q; does nothing if using -l 0.

  2. -e, --exhaustive-model-search:

    Do exhaustive model search (expensive!).

It is absurdly unclear to me, as to just an average music listener, what these settings actually do?


OS + FLAC versions: I am on converting the WAV file to FLAC on Linux Mint 20 (Ubuntu Focal base) with FLAC version 1.3.3.


Several details on original file in WAV format I am testing this on:

file dopamine-remix.wav

RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz

# +

mediainfo dopamine-remix.wav

General
Complete name                            : dopamine-remix.wav
Format                                   : Wave
File size                                : 86.7 MiB
Duration                                 : 8 min 35 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 1 411 kb/s

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 8 min 35 s
Bit rate mode                            : Constant
Bit rate                                 : 1 411.2 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 kHz
Bit depth                                : 16 bits
Stream size                              : 86.7 MiB (100%)

The exact 3 commands I issued for testing purposes were:

# this equals to -8 compression
flac --verify --best --output-name=dopamine-remix--8.flac dopamine-remix.wav

# this equals to -8 -e compression
flac --verify --best --exhaustive-model-search --output-name=dopamine-remix--8e.flac dopamine-remix.wav

# this equals to -8 -e -p compression
flac --verify --best --exhaustive-model-search --qlp-coeff-precision-search --output-name=dopamine-remix--8ep.flac dopamine-remix.wav

Having no idea what different the output is supposed to be(?)

Anyway, I am intentionally not stating how much time these commands took. Please, consider that I do not care about the time spent. For the sake of this question, let's suppose I just want to achieve the best overall compression achievable with FLAC. Thank you.

2 Answers 2

4

They give a small improvement to the compression at the cost of encoding time.

As neither requires specifying --lax, they do not make the resulting files less compliant.

-8e, -8p and -8ep could be thought of as compression levels better/slower than -8.

They both independently brute-force a setting/value in order to find the best combination for every individual subframe. (Encoding will get exponentially slower for every additional "brute-forced digit" like this.)

A simple comparison on the same sample of 51 songs (3h22m of audio) using flac 1.3.3:

options CPU time encoding speed compress ratio "Δratio ratio"
-8V (baseline) 1.00 (baseline) 100.0 % 71.43 % 0.000 %
-8Ve 3.10 32.2 % 71.38 % 0.063 %
-8Vp 3.05 32.8 % 71.37 % 0.076 %
-8Vep 21.50 4.7 % 71.33 % 0.134 %
--lax -8Vl32 4.45 22.5 % 71.24 % 0.259 %
--lax -8Vpl32 16.21 6.2 % 71.15 % 0.390 %
--lax -8Vel32 40.46 2.5 % 71.13 % 0.415 %
--lax -8Vepl32 290.58 0.3 % 71.05 % 0.522 %

"Δratio ratio" is "the additional size reduction over plain -8V", [(-8V ratio)-ratio]/(-8V ratio). This was selected to show the options in the best light I could.
The results are not precise or controlled in any way, as the tests were done by just directly recompressing and replacing the same FLACs over and over.

0

Okay, it did not come to my mind just to do internet search for flac documentation, by doing this I found the official docu web page.


--exhaustive-model-search

Exhaustive model search (expensive!). Normally the encoder estimates the best model to use and encodes once based on the estimate. With an exhaustive model search, the encoder will generate subframes for every order and use the smallest. If the max LPC order is high this can significantly increase the encode time but can shave off another 0.5%.


--qlp-coeff-precision-search

Do exhaustive LP coefficient quantization optimization. This option overrides any -q option. It is expensive and typically will only improve the compression a tiny fraction of a percent. -q has no effect when -l 0 is used.


The second one remains a mystery, though... The provided explanation I find insufficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.