29 #include "config-adpcm.h"
31 #ifdef HAVE_AV_CONFIG_H
36 # include "aarch64/bswap.h"
38 # include "arm/bswap.h"
40 # include "avr32/bswap.h"
42 # include "riscv/bswap.h"
44 # include "sh4/bswap.h"
46 # include "x86/bswap.h"
51 #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))
52 #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
53 #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
55 #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
57 namespace adpcm_ffmpeg {
61 static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
69 static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
71 return AV_BSWAP32C(x);
76 static inline uint64_t av_const av_bswap64(uint64_t x)
78 return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
86 #define av_be2ne16(x) (x)
87 #define av_be2ne32(x) (x)
88 #define av_be2ne64(x) (x)
89 #define av_le2ne16(x) av_bswap16(x)
90 #define av_le2ne32(x) av_bswap32(x)
91 #define av_le2ne64(x) av_bswap64(x)
92 #define AV_BE2NEC(s, x) (x)
93 #define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
95 #define av_be2ne16(x) av_bswap16(x)
96 #define av_be2ne32(x) av_bswap32(x)
97 #define av_be2ne64(x) av_bswap64(x)
98 #define av_le2ne16(x) (x)
99 #define av_le2ne32(x) (x)
100 #define av_le2ne64(x) (x)
101 #define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
102 #define AV_LE2NEC(s, x) (x)
105 #define AV_BE2NE16C(x) AV_BE2NEC(16, x)
106 #define AV_BE2NE32C(x) AV_BE2NEC(32, x)
107 #define AV_BE2NE64C(x) AV_BE2NEC(64, x)
108 #define AV_LE2NE16C(x) AV_LE2NEC(16, x)
109 #define AV_LE2NE32C(x) AV_LE2NEC(32, x)
110 #define AV_LE2NE64C(x) AV_LE2NEC(64, x)