History

avcodec: move bitswap_32() into a header file

Allows more codecs than mpeg12video to make use of it.

Steinar H. Gunderson committed 9 years ago

Commit eaff1aa1 parent 107b3062 files · +8 −8Browse files

Unified · Split

2 files
  1. libavcodec/bitstream.c +0 −8
  2. libavcodec/mathops.h +8 −0
libavcodec/bitstream.c+0−8
@@ -128,14 +128,6 @@ static int alloc_table(VLC *vlc, int size, int use_static) · 127 unmodified lines
128 return index;128 return index;
129}129}
130 130
131static av_always_inline uint32_t bitswap_32(uint32_t x)
132{
133 return (uint32_t)ff_reverse[ x & 0xFF] << 24 |
134 (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 |
135 (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 |
136 (uint32_t)ff_reverse[ x >> 24];
137}
138
139typedef struct VLCcode {131typedef struct VLCcode {
140 uint8_t bits;132 uint8_t bits;
141 uint16_t symbol;133 uint16_t symbol;
libavcodec/mathops.h+8−0
@@ -249,4 +249,12 @@ static inline int8_t ff_u8_to_s8(uint8_t a) · 248 unmodified lines
249 return b.s8;249 return b.s8;
250}250}
251 251
252static av_always_inline uint32_t bitswap_32(uint32_t x)
253{
254 return (uint32_t)ff_reverse[ x & 0xFF] << 24 |
255 (uint32_t)ff_reverse[(x >> 8) & 0xFF] << 16 |
256 (uint32_t)ff_reverse[(x >> 16) & 0xFF] << 8 |
257 (uint32_t)ff_reverse[ x >> 24];
258}
259
252#endif /* AVCODEC_MATHOPS_H */260#endif /* AVCODEC_MATHOPS_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t