summaryrefslogtreecommitdiffstats
path: root/libavcodec/mathops.h
diff options
context:
space:
mode:
authorSteinar H. Gunderson <steinar+ffmpeg@gunderson.no>2017-01-08 14:14:54 +0100
committerPaul B Mahol <onemda@gmail.com>2017-01-11 15:40:01 +0100
commiteaff1aa09e90e2711207c9463db8bf8e8dec8178 (patch)
treef591f9b57c53bcb3d4750058e82639cae26260a7 /libavcodec/mathops.h
parent107b3064d8bf783c64f488f17c1f485dd72653e7 (diff)
downloadffmpeg-streaming-eaff1aa09e90e2711207c9463db8bf8e8dec8178.zip
ffmpeg-streaming-eaff1aa09e90e2711207c9463db8bf8e8dec8178.tar.gz
avcodec: move bitswap_32() into a header file
Allows more codecs than mpeg12video to make use of it.
Diffstat (limited to 'libavcodec/mathops.h')
-rw-r--r--libavcodec/mathops.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 5168dc2..958132d 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -249,4 +249,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 */
OpenPOWER on IntegriCloud