Commit eaff1aa0 authored by Steinar H. Gunderson's avatar Steinar H. Gunderson Committed by Paul B Mahol

avcodec: move bitswap_32() into a header file

Allows more codecs than mpeg12video to make use of it.
parent 107b3064
...@@ -128,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static) ...@@ -128,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static)
return index; 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 { typedef struct VLCcode {
uint8_t bits; uint8_t bits;
uint16_t symbol; uint16_t symbol;
......
...@@ -249,4 +249,12 @@ static inline int8_t ff_u8_to_s8(uint8_t a) ...@@ -249,4 +249,12 @@ static inline int8_t ff_u8_to_s8(uint8_t a)
return b.s8; 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 */ #endif /* AVCODEC_MATHOPS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment