aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
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
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')
-rw-r--r--libavcodec/bitstream.c11
-rw-r--r--libavcodec/dstdec.c1
-rw-r--r--libavcodec/mathops.h9
-rw-r--r--libavcodec/mpeg12dec.c1
-rw-r--r--libavcodec/pcm.c1
-rw-r--r--libavcodec/s302m.c1
-rw-r--r--libavcodec/s302menc.c1
-rw-r--r--libavcodec/tiff.c1
-rw-r--r--libavcodec/xbmdec.c1
-rw-r--r--libavcodec/xbmenc.c1
10 files changed, 17 insertions, 11 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;
diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index 0458856580..3ea3f38eee 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -27,6 +27,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/mem_internal.h"
+#include "libavutil/reverse.h"
#include "codec_internal.h"
#include "internal.h"
#include "get_bits.h"
diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index 1c35664318..239e0e492f 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -25,7 +25,6 @@
#include <stdint.h>
#include "libavutil/common.h"
-#include "libavutil/reverse.h"
#include "config.h"
#define MAX_NEG_CROP 1024
@@ -240,12 +239,4 @@ 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 */
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 6110e63af8..6b6cadeb05 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -34,6 +34,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/mem_internal.h"
+#include "libavutil/reverse.h"
#include "libavutil/stereo3d.h"
#include "libavutil/timecode.h"
diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
index 1e83b356ac..aaccd86199 100644
--- a/libavcodec/pcm.c
+++ b/libavcodec/pcm.c
@@ -28,6 +28,7 @@
#include "config_components.h"
#include "libavutil/attributes.h"
#include "libavutil/float_dsp.h"
+#include "libavutil/reverse.h"
#include "libavutil/thread.h"
#include "avcodec.h"
#include "bytestream.h"
diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index 2c0cfc699a..d90549e487 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -24,6 +24,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/log.h"
+#include "libavutil/reverse.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "internal.h"
diff --git a/libavcodec/s302menc.c b/libavcodec/s302menc.c
index ad5186d69c..737fc94697 100644
--- a/libavcodec/s302menc.c
+++ b/libavcodec/s302menc.c
@@ -21,6 +21,7 @@
*/
#include "libavutil/channel_layout.h"
+#include "libavutil/reverse.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 88ac838587..fdd3ae5c68 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -39,6 +39,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
+#include "libavutil/reverse.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c
index 0ea5883024..9dbd0ac571 100644
--- a/libavcodec/xbmdec.c
+++ b/libavcodec/xbmdec.c
@@ -21,6 +21,7 @@
*/
#include "libavutil/avstring.h"
+#include "libavutil/reverse.h"
#include "avcodec.h"
#include "codec_internal.h"
diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c
index d578eec930..95db87dba6 100644
--- a/libavcodec/xbmenc.c
+++ b/libavcodec/xbmenc.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/reverse.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"