[libav-devel] prores micro-opt suggestion
Janne Grunau
janne-libav at jannau.net
Thu Nov 24 12:27:22 CET 2011
On Thu, Nov 24, 2011 at 12:03:58PM +0100, 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
see how av_log2 is defined: this will only add clutter and won't be
faster
Janne
More information about the libav-devel
mailing list