aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/bitstream.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-17 10:39:42 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-21 23:25:36 +0100
commitb303f1e08335bb6ab4c4e58ec3771ae2cac2b33f (patch)
tree1a5f0ba66250d4f6807e9f37eb568b59a32f54b2 /libavcodec/bitstream.c
parent7aebdb8bf1fc3e09263617a7f49101cba2d43804 (diff)
downloadffmpeg-b303f1e08335bb6ab4c4e58ec3771ae2cac2b33f.tar.gz
avcodec/mathops: Move bitswap_32() to its only user
Effectively reverts eaff1aa09e90e2711207c9463db8bf8e8dec8178 given that bitswap_32 is no longer used outside of bitstream.c since 03008c2811ec26cf338780a89b6b2b849b399e3c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/bitstream.c')
-rw-r--r--libavcodec/bitstream.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index c948c889b6..04817f9a84 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -35,7 +35,6 @@
#include "config.h"
#include "libavutil/avassert.h"
-#include "libavutil/bswap.h"
#include "libavutil/error.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
@@ -43,7 +42,7 @@
#include "libavutil/macros.h"
#include "libavutil/mem.h"
#include "libavutil/qsort.h"
-#include "mathops.h"
+#include "libavutil/reverse.h"
#include "put_bits.h"
#include "vlc.h"
@@ -134,6 +133,14 @@ static int alloc_table(VLC *vlc, int size, int use_static)
#define LOCALBUF_ELEMS 1500 // the maximum currently needed is 1296 by rv34
+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;
VLC_TYPE symbol;