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

2015-12-17 Thread Ganesh Ajjanagadde
On Thu, Dec 17, 2015 at 1:58 PM, Rostislav Pehlivanov 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 whi

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

2015-12-17 Thread Rostislav Pehlivanov
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

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

2015-12-17 Thread Michael Niedermayer
On Thu, Dec 17, 2015 at 08:44:38PM +, Rostislav Pehlivanov wrote: > On Thu, 2015-12-17 at 19:22 +0100, Michael Niedermayer wrote: > > On Thu, Dec 17, 2015 at 05:29:58PM +, Rostislav Pehlivanov wrote: > > > This commit adds a raw integer log2 function (which directly maps > > > to a > > > bu

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

2015-12-17 Thread Rostislav Pehlivanov
On Thu, 2015-12-17 at 19:22 +0100, Michael Niedermayer wrote: > On Thu, Dec 17, 2015 at 05:29:58PM +, Rostislav Pehlivanov wrote: > > This commit adds a raw integer log2 function (which directly maps > > to a > > builtin). This was needed as the Daala entropy coding system > > requires a > > ra

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

2015-12-17 Thread Michael Niedermayer
On Thu, Dec 17, 2015 at 05:29:58PM +, Rostislav Pehlivanov wrote: > This commit adds a raw integer log2 function (which directly maps to a > builtin). This was needed as the Daala entropy coding system requires a > raw log2 and the existing ff_log2 OR'd the argument with 1. __builtin_clz(0) is

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

2015-12-17 Thread Carl Eugen Hoyos
Rostislav Pehlivanov gmail.com> writes: > +/* From Daala, src/internal.c, od_ilog() */ How does the copyright statement and license in internal.c look like? > +static av_always_inline av_const int > ff_log2_c_nz(unsigned int x) Shouldn't this be uint32_t (and uint64_t below)? Carl Eugen _

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

2015-12-17 Thread Ganesh Ajjanagadde
On Thu, Dec 17, 2015 at 9:29 AM, Rostislav Pehlivanov wrote: > This commit adds a raw integer log2 function (which directly maps to a > builtin). This was needed as the Daala entropy coding system requires a > raw log2 and the existing ff_log2 OR'd the argument with 1. > > The C implementation was

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

2015-12-17 Thread Rostislav Pehlivanov
This commit adds a raw integer log2 function (which directly maps to a builtin). This was needed as the Daala entropy coding system requires a raw log2 and the existing ff_log2 OR'd the argument with 1. The C implementation was taken from Daala's source code, which got it from someplace else as a