[vorbis-dev] Trivial 12% performance gain in encoding
Timothy J. Wood
tjw at omnigroup.com
Sun Nov 26 13:49:28 PST 2000
(well, YMMV, but it got me 12% on Mac OS X Public Beta on my test case).
In vorbis/lib/scales.h, add the following after fromdB()
#define sqrt_fromdB(x) (exp((x)*.11512925*0.5))
In vorbis/lib/psy.c at the bottom of bark_noise(), do:
< noise[i]=sqrt(fromdB(v));
> noise[i]=sqrt_fromdB(v);
This avoids the sqrt() call entirely by just doing it as part of the exp().
(I'd send a patch, but my local source tree is severely mauled with timing instrumentation code :)
-tim
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Vorbis-dev
mailing list