[flac-dev] About de Bruijn sequences in bitmath.h
lvqcl.mail at gmail.com
Fri Sep 6 15:24:08 PDT 2013
Ulrich Klauer <ulrich at chirlu.de> wrote:
> The canonical location is at CCAN: http://ccodearchive.net/info/ilog.html
> Note that the code is licensed LGPL. On the other hand, the author is
> Xiph.org's Timothy Terryberry, so he might be willing to relicense.
Thanks for the information.
I just thought that for x86 architecture it's faster to simply use 32-bit intrinsic:
/* FLAC__bitmath_ilog2(x) == _BitScanReverse(x) == 31 - __builtin_clz(x) */
static inline unsigned FLAC__bitmath_ilog2_wide(FLAC__uint64 v)
More information about the flac-dev