[FFmpeg-devel] [PATCH]levc/hevc_cabac Optimise ff_hevc_hls_residual_coding (especially ARM)

John Cox jc at kynesim.co.uk
Tue Jan 19 18:05:56 CET 2016


>On 1/19/2016 9:46 AM, John Cox wrote:
>> +// Helper fns
>> +#ifndef hevc_mem_bits32
>> +static av_always_inline uint32_t hevc_mem_bits32(const void * buf, const unsigned int offset)
>> +{
>> +    return AV_RB32((const uint8_t *)buf + (offset >> 3)) << (offset & 7);
>> +}
>> +#endif
>> +
>> +#if AV_GCC_VERSION_AT_LEAST(3,4) && !defined(hevc_clz32)
>> +#define hevc_clz32 hevc_clz32_builtin
>> +static av_always_inline unsigned int hevc_clz32_builtin(const uint32_t x)
>> +{
>> +    // __builtin_clz says it works on ints - so adjust if int is >32 bits long
>> +    return __builtin_clz(x) - (sizeof(int) * 8 - 32);
>
>Why aren't you simply using ff_clz?

Because it doesn't exist? or at least I can't find it.

>> +}
>> +#endif
>> +
>> +// It is unlikely that we will ever need this but include for completeness
>
>There are at least two compilers we support that don't define __GNUC__, so
>it would be used.
>And in any case, isn't all this duplicating ff_clz, which is available in
>libavutil/inthmath.h?

Are you sure of that?  I can find ff_ctz but no ff_clz...
I would happily be wrong.

[snip]

JC


More information about the ffmpeg-devel mailing list