annotate bswap.h @ 16198:3e8e281ecc86

fix brokeness caused by demuxer patch, this code is useless for any case other than avi and should not be run even then. patch by Uoti Urpala (urpala BANG cc MEEP helsinki MEEP fi)
author ods15
date Thu, 11 Aug 2005 17:01:13 +0000
parents 28b8fc8278e0
children 915a3791f6c1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
1 #ifndef __BSWAP_H__
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
2 #define __BSWAP_H__
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
3
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
4 #ifdef HAVE_BYTESWAP_H
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
5 #include <byteswap.h>
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
6 #else
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
7
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
8 #include <inttypes.h>
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
9
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
10 #ifdef ARCH_X86_64
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
11 # define LEGACY_REGS "=Q"
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
12 #else
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
13 # define LEGACY_REGS "=q"
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
14 #endif
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
15
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
16 #if defined(ARCH_X86) || defined(ARCH_X86_64)
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
17 static inline uint16_t ByteSwap16(uint16_t x)
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
18 {
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
19 __asm("xchgb %b0,%h0" :
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
20 LEGACY_REGS (x) :
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
21 "0" (x));
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
22 return x;
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
23 }
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
24 #define bswap_16(x) ByteSwap16(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
25
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
26 static inline uint32_t ByteSwap32(uint32_t x)
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
27 {
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
28 #if __CPU__ > 386
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
29 __asm("bswap %0":
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
30 "=r" (x) :
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
31 #else
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
32 __asm("xchgb %b0,%h0\n"
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
33 " rorl $16,%0\n"
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
34 " xchgb %b0,%h0":
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
35 LEGACY_REGS (x) :
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
36 #endif
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
37 "0" (x));
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
38 return x;
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
39 }
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
40 #define bswap_32(x) ByteSwap32(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
41
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
42 static inline uint64_t ByteSwap64(uint64_t x)
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
43 {
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
44 #ifdef ARCH_X86_64
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
45 __asm("bswap %0":
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
46 "=r" (x) :
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
47 "0" (x));
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
48 return x;
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
49 #else
10481
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
50 register union { __extension__ uint64_t __ll;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
51 uint32_t __l[2]; } __x;
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
52 asm("xchgl %0,%1":
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
53 "=r"(__x.__l[0]),"=r"(__x.__l[1]):
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
54 "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
55 return __x.__ll;
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10481
diff changeset
56 #endif
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
57 }
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
58 #define bswap_64(x) ByteSwap64(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
59
10481
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
60 #elif defined(ARCH_SH4)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
61
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
62 static inline uint16_t ByteSwap16(uint16_t x) {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
63 __asm__("swap.b %0,%0":"=r"(x):"0"(x));
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
64 return x;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
65 }
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
66
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
67 static inline uint32_t ByteSwap32(uint32_t x) {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
68 __asm__(
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
69 "swap.b %0,%0\n"
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
70 "swap.w %0,%0\n"
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
71 "swap.b %0,%0\n"
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
72 :"=r"(x):"0"(x));
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
73 return x;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
74 }
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
75
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
76 #define bswap_16(x) ByteSwap16(x)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
77 #define bswap_32(x) ByteSwap32(x)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
78
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
79 static inline uint64_t ByteSwap64(uint64_t x)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
80 {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
81 union {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
82 uint64_t ll;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
83 struct {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
84 uint32_t l,h;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
85 } l;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
86 } r;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
87 r.l.l = bswap_32 (x);
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
88 r.l.h = bswap_32 (x>>32);
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
89 return r.ll;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
90 }
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
91 #define bswap_64(x) ByteSwap64(x)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
92
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
93 #else
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
94
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
95 #define bswap_16(x) (((x) & 0x00ff) << 8 | ((x) & 0xff00) >> 8)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
96
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
97
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
98 // code from bits/byteswap.h (C) 1997, 1998 Free Software Foundation, Inc.
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
99 #define bswap_32(x) \
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
100 ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
101 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
102
10481
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
103 static inline uint64_t ByteSwap64(uint64_t x)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
104 {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
105 union {
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
106 uint64_t ll;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
107 uint32_t l[2];
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
108 } w, r;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
109 w.ll = x;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
110 r.l[0] = bswap_32 (w.l[1]);
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
111 r.l[1] = bswap_32 (w.l[0]);
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
112 return r.ll;
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
113 }
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
114 #define bswap_64(x) ByteSwap64(x)
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
115
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
116 #endif /* !ARCH_X86 */
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
117
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
118 #endif /* !HAVE_BYTESWAP_H */
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
119
15976
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
120 static float inline bswap_flt(float x) {
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
121 union {uint32_t i; float f;} u;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
122 u.f = x;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
123 u.i = bswap_32(u.i);
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
124 return u.f;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
125 }
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
126
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
127 static double inline bswap_dbl(double x) {
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
128 union {uint64_t i; double d;} u;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
129 u.d = x;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
130 u.i = bswap_64(u.i);
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
131 return u.d;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
132 }
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
133
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
134 static long double inline bswap_ldbl(long double x) {
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
135 union {char d[10]; long double ld;} uin;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
136 union {char d[10]; long double ld;} uout;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
137 uin.ld = x;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
138 uout.d[0] = uin.d[9];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
139 uout.d[1] = uin.d[8];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
140 uout.d[2] = uin.d[7];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
141 uout.d[3] = uin.d[6];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
142 uout.d[4] = uin.d[5];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
143 uout.d[5] = uin.d[4];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
144 uout.d[6] = uin.d[3];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
145 uout.d[7] = uin.d[2];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
146 uout.d[8] = uin.d[1];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
147 uout.d[9] = uin.d[0];
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
148 return uout.ld;
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
149 }
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
150
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
151 // be2me ... BigEndian to MachineEndian
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
152 // le2me ... LittleEndian to MachineEndian
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
153
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
154 #ifdef WORDS_BIGENDIAN
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
155 #define be2me_16(x) (x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
156 #define be2me_32(x) (x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
157 #define be2me_64(x) (x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
158 #define le2me_16(x) bswap_16(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
159 #define le2me_32(x) bswap_32(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
160 #define le2me_64(x) bswap_64(x)
15976
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
161 #define be2me_flt(x) (x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
162 #define be2me_dbl(x) (x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
163 #define be2me_ldbl(x) (x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
164 #define le2me_flt(x) bswap_flt(x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
165 #define le2me_dbl(x) bswap_dbl(x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
166 #define le2me_ldbl(x) bswap_ldbl(x)
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
167 #else
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
168 #define be2me_16(x) bswap_16(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
169 #define be2me_32(x) bswap_32(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
170 #define be2me_64(x) bswap_64(x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
171 #define le2me_16(x) (x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
172 #define le2me_32(x) (x)
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
173 #define le2me_64(x) (x)
15976
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
174 #define be2me_flt(x) bswap_flt(x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
175 #define be2me_dbl(x) bswap_dbl(x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
176 #define be2me_ldbl(x) bswap_ldbl(x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
177 #define le2me_flt(x) (x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
178 #define le2me_dbl(x) (x)
28b8fc8278e0 (hopefully) fixing remaining float endianness problems
reimar
parents: 13720
diff changeset
179 #define le2me_ldbl(x) (x)
1423
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
180 #endif
3a347b949c5d Furter compatibility with new ffmpeg stuff.
nick
parents: 1309
diff changeset
181
10481
1911eb291dfb sync with libavcodec (sh4 optim)
alex
parents: 6922
diff changeset
182 #endif /* __BSWAP_H__ */