[flac-dev] FLAC specification clarification

Martijn van Beurden mvanb1 at gmail.com
Wed Jun 17 20:22:02 UTC 2020


Hi all,

When trying to better understand the way LPC exactly works, I stumbled upon
something which, after some digging, was already reported and (partly)
fixed: https://sourceforge.net/p/flac/bugs/424/

Apparently, the FLAC specification has a LPC shift that can be both
positive and negative, but the encoder specifically makes sure that only
positive shifts are encoded and the decoder only accepts positive shifts.
The ffmpeg FLAC encoder and decoder show the same behaviour.

Now, the documentation in the source code is fixed, the documentation on
the website (which I was looking at) isn't yet. The website format.html
states: "Quantized linear predictor coefficient shift needed in bits (NOTE:
this number is signed two's-complement)." The source code format.html says
"Quantized linear predictor coefficient shift needed in bits (NOTE: this
number is signed two's-complement; but, due to implementation details, must
be non-negative)."

I was thinking of submitting a patch to the FLAC website git to get the
website format.html up-to-date (there have been more changes than just this
one), but I feel the line above isn't clear enough. Maybe change it to
something like this, to make the wording more similar to the rest of the
specification

Quantized linear predictor coefficient shift needed in bits (NOTE: these
bits must be 00000-01111. Originally this was a signed integer, but
negative shifts were never implemented).

Or perhaps:

Quantized linear predictor coefficient shift needed in bits (NOTE: First
bit must be zero. Originally this was a signed integer, but negative shifts
were never implemented).

Any thoughts?

Kind regards, Martijn van Beurden
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20200617/c6d448d1/attachment.html>


More information about the flac-dev mailing list