[FFmpeg-cvslog] avcodec: move bitswap_32() into a header file

Steinar H. Gunderson git at videolan.org
Wed Jan 11 17:14:23 EET 2017


ffmpeg | branch: master | Steinar H. Gunderson <steinar+ffmpeg at gunderson.no> | Sun Jan  8 14:14:54 2017 +0100| [eaff1aa09e90e2711207c9463db8bf8e8dec8178] | committer: Paul B Mahol

avcodec: move bitswap_32() into a header file

Allows more codecs than mpeg12video to make use of it.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=eaff1aa09e90e2711207c9463db8bf8e8dec8178
---

 libavcodec/bitstream.c | 8 --------
 libavcodec/mathops.h   | 8 ++++++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 6c8dca1..c266500 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -128,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static)
     return index;
 }
 
-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];
-}
-
 typedef struct VLCcode {
     uint8_t bits;
     uint16_t symbol;
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 */



More information about the ffmpeg-cvslog mailing list