summaryrefslogtreecommitdiff
path: root/media/ffvpx/libavcodec/mathops.h
diff options
context:
space:
mode:
Diffstat (limited to 'media/ffvpx/libavcodec/mathops.h')
-rw-r--r--media/ffvpx/libavcodec/mathops.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/media/ffvpx/libavcodec/mathops.h b/media/ffvpx/libavcodec/mathops.h
index 5168dc2ce0..1c35664318 100644
--- a/media/ffvpx/libavcodec/mathops.h
+++ b/media/ffvpx/libavcodec/mathops.h
@@ -25,6 +25,7 @@
#include <stdint.h>
#include "libavutil/common.h"
+#include "libavutil/reverse.h"
#include "config.h"
#define MAX_NEG_CROP 1024
@@ -96,15 +97,6 @@ static av_always_inline unsigned UMULH(unsigned a, unsigned b){
#define mid_pred mid_pred
static inline av_const int mid_pred(int a, int b, int c)
{
-#if 0
- int t= (a-b)&((a-b)>>31);
- a-=t;
- b+=t;
- b-= (b-c)&((b-c)>>31);
- b+= (a-b)&((a-b)>>31);
-
- return b;
-#else
if(a>b){
if(c>b){
if(c>a) b=a;
@@ -117,7 +109,6 @@ static inline av_const int mid_pred(int a, int b, int c)
}
}
return b;
-#endif
}
#endif
@@ -249,4 +240,12 @@ static inline int8_t ff_u8_to_s8(uint8_t a)
return b.s8;
}
+static av_always_inline uint32_t bitswap_32(uint32_t x)
+{
+ return (uint32_t)ff_reverse[ x & 0xFF] << 24 |
+ (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 |
+ (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 |
+ (uint32_t)ff_reverse[ x >> 24];
+}
+
#endif /* AVCODEC_MATHOPS_H */