1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Add av_popcount64

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
This commit is contained in:
Daniel Verkamp 2012-01-03 01:23:48 +00:00 committed by Janne Grunau
parent 418f066f8c
commit b73ec05473

View File

@ -218,6 +218,16 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
return (x + (x >> 16)) & 0x3F;
}
/**
* Count number of bits set to one in x
* @param x value to count bits of
* @return the number of bits set to one in x
*/
static av_always_inline av_const int av_popcount64_c(uint64_t x)
{
return av_popcount(x) + av_popcount(x >> 32);
}
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
@ -383,3 +393,6 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
#ifndef av_popcount
# define av_popcount av_popcount_c
#endif
#ifndef av_popcount64
# define av_popcount64 av_popcount64_c
#endif