Advertisement
Guest User

Untitled

a guest
Jan 7th, 2016
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.36 KB | None | 0 0
  1. diff --git a/libavutil/common.h b/libavutil/common.h
  2. index 9ac04da..f3276a2 100644
  3. --- a/libavutil/common.h
  4. +++ b/libavutil/common.h
  5. @@ -331,6 +331,11 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
  6.      return av_popcount((uint32_t)x) + av_popcount((uint32_t)(x >> 32));
  7.  }
  8.  
  9. +static av_always_inline av_const int av_parity_c(uint32_t v)
  10. +{
  11. +    return av_popcount(v) & 1;
  12. +}
  13. +
  14.  #define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
  15.  #define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
  16.  
  17. @@ -517,3 +522,6 @@ static av_always_inline av_const int av_popcount64_c(uint64_t x)
  18.  #ifndef av_popcount64
  19.  #   define av_popcount64    av_popcount64_c
  20.  #endif
  21. +#ifndef av_parity
  22. +#   define av_parity        av_parity_c
  23. +#endif
  24. diff --git a/libavutil/intmath.h b/libavutil/intmath.h
  25. index 17c4f1b..9573109 100644
  26. --- a/libavutil/intmath.h
  27. +++ b/libavutil/intmath.h
  28. @@ -153,16 +153,10 @@ static av_always_inline av_const unsigned ff_clz_c(unsigned x)
  29.  }
  30.  #endif
  31.  
  32. -#ifndef ff_parity
  33. -#define ff_parity ff_parity_c
  34. -static av_always_inline av_const int ff_parity_c(uint32_t v)
  35. -{
  36. -#if HAVE_PARITY
  37. -    return __builtin_parity(v);
  38. -#else
  39. -    return av_popcount(v) & 1;
  40. +#if AV_GCC_VERSION_AT_LEAST(3,4)
  41. +#ifndef av_parity
  42. +#define av_parity __builtin_parity
  43.  #endif
  44. -}
  45.  #endif
  46.  
  47.  /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement