[Vorbis-dev] BARK implementation (or specification) error

xiphmont at xiph.org xiphmont at xiph.org
Fri Feb 27 21:47:19 UTC 2015


Digging this up from a year ago, because I'd missed it at the time
(and thank you for pointing it out again in the other errata
thread)...

> In the course of some work which I describe below, I have found a very significant difference between the BARK function described in the Vorbis specification and its implementation in libvorbis.
>
> In the specificationhttp://xiph.org/vorbis/doc/Vorbis_I_spec.pdf
> bark(x) = 13.1arctan(.00074x) + 2.24arctan(.0000000185x**2 + .0001x)

The last paren in the above equation is misplaced.  The original HTML
version of the spec is correct (yay commit history), but this typo
crept in a long time ago when the HTML spec was re-typeset to XML and
TeX.  And, unfortunately, at some point someone noticed they didn't
match, and updated the HTML to match the typo (thus once again
reinforcing that all you have to do is typeset something in TeX and it
automatically will be treated as authoritative :-)

The original and correct equation is:

bark(x) = 13.1arctan(.00074x) + 2.24arctan(.0000000185x**2) + .0001x

> Otherwise, for information, I have been looking into the differences between the output of Tremor and the output of the Vorbis floating point decoder reported in the following post:
> http://www.mail-archive.com/tremor@xiph.org/msg00072.html
>
> Where floor1 is used the RMS differences are already small: about 0.7
> However with a couple of trivial modifications I have been able to reduce the RMS differences to about 0.1
>
> The big problem is that where floor0 is used the RMS differences are *enormous*.
> I have investigated these and they are:
> a) partly due to an insufficient number of fractional bits in certain places,
> b) partly due to insufficient precision in the approximation of transcendental functions (cos, atan, exp, sqrt).
> I have been able to significantly improve the results but I hope to do better.
> The main difficulties are in the approximation of these transcendental functions.

There are also #defines to alter the precision.  However, the
broadband RMS differences are less important than spectral energy and
peak differences.  Do they also differ by large amounts?

> How should I submit my modifications?
> They are basically of three types:
> a) trivial improvements having no impact on the results (e.g. constifying, more efficient calculations, saving table space).
> b) trivial modifications improving the accuracy of floor1 and the MDCT,
> c) substantial modifications to floor0 (these are currently unfinished).

Submitting patches here on hte list is appropriate, as is opening a
Trac bug and attaching the patches there.  However, I generally prefer
discussion to happen on the list; more people see it with less effort.

Monty


More information about the Vorbis-dev mailing list