Luca Barbato <[email protected]> writes:

> On 24/11/11 12:03, Robert Nagy wrote:
>> Just scrolling through the prores code. And found a possible minor
>> optimization. Don't have a setup for compiling right now so I can't measure
>> the perf diff.
>>
>> In static inline int decode_vlc_codeword(GetBitContext *gb, uint8_t
>> codebook)
>>
>> Replace:
>>
>>> log = 31 - av_log2(buf)  /* count prefix bits (zeroes) */
>>
>> with something like:
>>
>>> #ifdef X86
>>> #define NLZ(x) // use BSR instruction
>>> #else
>>> #define NLZ(x) 31 - av_log2_c(x)
>>> #endif
>>>
>>> log = NLZ(buf);  /* count prefix bits (zeroes) */
>
> If the compiler doesn't do that for us, might be useful adding a
> mathop for it.

av_log2() already uses __builtin_clz() if available.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to