]> git.sesse.net Git - ffmpeg/commitdiff
avcodec: move bitswap_32() into a header file
authorSteinar H. Gunderson <steinar+ffmpeg@gunderson.no>
Sun, 8 Jan 2017 13:14:54 +0000 (14:14 +0100)
committerPaul B Mahol <onemda@gmail.com>
Wed, 11 Jan 2017 14:40:01 +0000 (15:40 +0100)
Allows more codecs than mpeg12video to make use of it.

libavcodec/bitstream.c
libavcodec/mathops.h

index 6c8dca1d8587aeeaa0e206df2757101afacc138a..c26650099f5981da02bfeb7544e3c9b5aa919f9f 100644 (file)
@@ -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;
index 5168dc2ce00f4eb8c711a8053b6fd007c50d6151..958132d897de39f7fd704b17a88dab4c72fa4b34 100644 (file)
@@ -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 */