diff options
author | James Almer <jamrial@gmail.com> | 2016-01-08 01:59:03 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2016-01-08 02:04:24 +0300 |
commit | 28d5a3a74aee33786673925a46a310c773e94748 (patch) | |
tree | 7aefda60e72e310798accd4f9ccda8a9218de686 /libavutil/common.h | |
parent | a1136ca973e3b216804d05bbf64fcc19ad0f14da (diff) |
lavu: rename and move ff_parity to av_parity
av_popcount is not defined in intmath.h.
Reviewed-by: ubitux
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/common.h')
-rw-r--r-- | libavutil/common.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/common.h b/libavutil/common.h index 9ac04daf95..f3276a2369 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -331,6 +331,11 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32)); } +static av_always_inline av_const int av_parity_c(uint32_t v) +{ + return av_popcount(v) & 1; +} + #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)) @@ -517,3 +522,6 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x) #ifndef av_popcount64 # define av_popcount64 av_popcount64_c #endif +#ifndef av_parity +# define av_parity av_parity_c +#endif |