[FFmpeg-devel] [PATCH] intmath.h: add an ff_log2_nz

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Dec 17 23:09:41 CET 2015

On Thu, Dec 17, 2015 at 1:58 PM, Rostislav Pehlivanov
<atomnuker at gmail.com> wrote:
> On Thu, 2015-12-17 at 22:17 +0100, Michael Niedermayer wrote:
>> 32 and (32|1) have the same count of leading zeros so both functions
>> would return the same value, what am i missing ?
> Damn, sorry, I think I was half asleep while writing the patch.
> Probably because I forgot to add 1 to ff_log2(x) while debugging and
> wondering why it didn't work :)
> Nevermind this patch, disregard and ignore it. Ganesh's patch could use
> the faster C version though, but that's up to him.

I will leave it to others; anyway there exists ways to get MSVC and
others to use a builtin (which at some point someone with such a
platform will add if they care), so the fallback is of low priority.
And as I said, if a "proper" fallback is done, a de-Bruijn version is
likely fastest.

Anyway, the patch I posted is still under review, will be left for a day or two.

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list