diff options
author | Mohamed Tarek <mt@rockbox.org> | 2010-07-17 07:53:14 +0000 |
---|---|---|
committer | Mohamed Tarek <mt@rockbox.org> | 2010-07-17 07:53:14 +0000 |
commit | 0f947104100131069fbfa9e53c8ef129c4716a30 (patch) | |
tree | bbb94c6b1899e25eb3d7e2ac38d7a338dd620d21 /apps/codecs/libwmapro/libavutil | |
parent | 090768194fdbd611b995572f424c6fae690eb329 (diff) | |
download | rockbox-0f947104100131069fbfa9e53c8ef129c4716a30.tar.gz rockbox-0f947104100131069fbfa9e53c8ef129c4716a30.zip |
More cleaning for libwmapro; use codeclib's bitstream functions and drop those from the libwmapro.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27453 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwmapro/libavutil')
-rw-r--r-- | apps/codecs/libwmapro/libavutil/bswap.h | 89 | ||||
-rw-r--r-- | apps/codecs/libwmapro/libavutil/intreadwrite.h | 483 |
2 files changed, 0 insertions, 572 deletions
diff --git a/apps/codecs/libwmapro/libavutil/bswap.h b/apps/codecs/libwmapro/libavutil/bswap.h deleted file mode 100644 index 82ed2271ac..0000000000 --- a/apps/codecs/libwmapro/libavutil/bswap.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | /* | ||
2 | * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> | ||
3 | * | ||
4 | * This file is part of FFmpeg. | ||
5 | * | ||
6 | * FFmpeg is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU Lesser General Public | ||
8 | * License as published by the Free Software Foundation; either | ||
9 | * version 2.1 of the License, or (at your option) any later version. | ||
10 | * | ||
11 | * FFmpeg is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | * Lesser General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU Lesser General Public | ||
17 | * License along with FFmpeg; if not, write to the Free Software | ||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file libavutil/bswap.h | ||
23 | * byte swapping routines | ||
24 | */ | ||
25 | |||
26 | #ifndef AVUTIL_BSWAP_H | ||
27 | #define AVUTIL_BSWAP_H | ||
28 | |||
29 | #include <stdint.h> | ||
30 | //#include "config.h" | ||
31 | |||
32 | #ifndef bswap_16 | ||
33 | static inline uint16_t bswap_16(uint16_t x) | ||
34 | { | ||
35 | x= (x>>8) | (x<<8); | ||
36 | return x; | ||
37 | } | ||
38 | #endif | ||
39 | |||
40 | #ifndef bswap_32 | ||
41 | static inline uint32_t bswap_32(uint32_t x) | ||
42 | { | ||
43 | x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); | ||
44 | x= (x>>16) | (x<<16); | ||
45 | return x; | ||
46 | } | ||
47 | #endif | ||
48 | |||
49 | #ifndef bswap_64 | ||
50 | static inline uint64_t bswap_64(uint64_t x) | ||
51 | { | ||
52 | #if 0 | ||
53 | x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL); | ||
54 | x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL); | ||
55 | return (x>>32) | (x<<32); | ||
56 | #else | ||
57 | union { | ||
58 | uint64_t ll; | ||
59 | uint32_t l[2]; | ||
60 | } w, r; | ||
61 | w.ll = x; | ||
62 | r.l[0] = bswap_32 (w.l[1]); | ||
63 | r.l[1] = bswap_32 (w.l[0]); | ||
64 | return r.ll; | ||
65 | #endif | ||
66 | } | ||
67 | #endif | ||
68 | |||
69 | // be2me ... big-endian to machine-endian | ||
70 | // le2me ... little-endian to machine-endian | ||
71 | |||
72 | #define HAVE_BIGENDIAN 0 | ||
73 | #if HAVE_BIGENDIAN | ||
74 | #define be2me_16(x) (x) | ||
75 | #define be2me_32(x) (x) | ||
76 | #define be2me_64(x) (x) | ||
77 | #define le2me_16(x) bswap_16(x) | ||
78 | #define le2me_32(x) bswap_32(x) | ||
79 | #define le2me_64(x) bswap_64(x) | ||
80 | #else | ||
81 | #define be2me_16(x) bswap_16(x) | ||
82 | #define be2me_32(x) bswap_32(x) | ||
83 | #define be2me_64(x) bswap_64(x) | ||
84 | #define le2me_16(x) (x) | ||
85 | #define le2me_32(x) (x) | ||
86 | #define le2me_64(x) (x) | ||
87 | #endif | ||
88 | |||
89 | #endif /* AVUTIL_BSWAP_H */ | ||
diff --git a/apps/codecs/libwmapro/libavutil/intreadwrite.h b/apps/codecs/libwmapro/libavutil/intreadwrite.h deleted file mode 100644 index 32dfcf2cad..0000000000 --- a/apps/codecs/libwmapro/libavutil/intreadwrite.h +++ /dev/null | |||
@@ -1,483 +0,0 @@ | |||
1 | /* | ||
2 | * This file is part of FFmpeg. | ||
3 | * | ||
4 | * FFmpeg is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU Lesser General Public | ||
6 | * License as published by the Free Software Foundation; either | ||
7 | * version 2.1 of the License, or (at your option) any later version. | ||
8 | * | ||
9 | * FFmpeg is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | * Lesser General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with FFmpeg; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef AVUTIL_INTREADWRITE_H | ||
20 | #define AVUTIL_INTREADWRITE_H | ||
21 | |||
22 | #include <stdint.h> | ||
23 | //#include "config.h" | ||
24 | #include "bswap.h" | ||
25 | //#include "common.h" | ||
26 | |||
27 | /* | ||
28 | * Arch-specific headers can provide any combination of | ||
29 | * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros. | ||
30 | * Preprocessor symbols must be defined, even if these are implemented | ||
31 | * as inline functions. | ||
32 | */ | ||
33 | |||
34 | /* | ||
35 | * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers. | ||
36 | */ | ||
37 | #define HAVE_BIGENDIAN 0 | ||
38 | #if HAVE_BIGENDIAN | ||
39 | |||
40 | # if defined(AV_RN16) && !defined(AV_RB16) | ||
41 | # define AV_RB16(p) AV_RN16(p) | ||
42 | # elif !defined(AV_RN16) && defined(AV_RB16) | ||
43 | # define AV_RN16(p) AV_RB16(p) | ||
44 | # endif | ||
45 | |||
46 | # if defined(AV_WN16) && !defined(AV_WB16) | ||
47 | # define AV_WB16(p, v) AV_WN16(p, v) | ||
48 | # elif !defined(AV_WN16) && defined(AV_WB16) | ||
49 | # define AV_WN16(p, v) AV_WB16(p, v) | ||
50 | # endif | ||
51 | |||
52 | # if defined(AV_RN24) && !defined(AV_RB24) | ||
53 | # define AV_RB24(p) AV_RN24(p) | ||
54 | # elif !defined(AV_RN24) && defined(AV_RB24) | ||
55 | # define AV_RN24(p) AV_RB24(p) | ||
56 | # endif | ||
57 | |||
58 | # if defined(AV_WN24) && !defined(AV_WB24) | ||
59 | # define AV_WB24(p, v) AV_WN24(p, v) | ||
60 | # elif !defined(AV_WN24) && defined(AV_WB24) | ||
61 | # define AV_WN24(p, v) AV_WB24(p, v) | ||
62 | # endif | ||
63 | |||
64 | # if defined(AV_RN32) && !defined(AV_RB32) | ||
65 | # define AV_RB32(p) AV_RN32(p) | ||
66 | # elif !defined(AV_RN32) && defined(AV_RB32) | ||
67 | # define AV_RN32(p) AV_RB32(p) | ||
68 | # endif | ||
69 | |||
70 | # if defined(AV_WN32) && !defined(AV_WB32) | ||
71 | # define AV_WB32(p, v) AV_WN32(p, v) | ||
72 | # elif !defined(AV_WN32) && defined(AV_WB32) | ||
73 | # define AV_WN32(p, v) AV_WB32(p, v) | ||
74 | # endif | ||
75 | |||
76 | # if defined(AV_RN64) && !defined(AV_RB64) | ||
77 | # define AV_RB64(p) AV_RN64(p) | ||
78 | # elif !defined(AV_RN64) && defined(AV_RB64) | ||
79 | # define AV_RN64(p) AV_RB64(p) | ||
80 | # endif | ||
81 | |||
82 | # if defined(AV_WN64) && !defined(AV_WB64) | ||
83 | # define AV_WB64(p, v) AV_WN64(p, v) | ||
84 | # elif !defined(AV_WN64) && defined(AV_WB64) | ||
85 | # define AV_WN64(p, v) AV_WB64(p, v) | ||
86 | # endif | ||
87 | |||
88 | #else /* HAVE_BIGENDIAN */ | ||
89 | |||
90 | # if defined(AV_RN16) && !defined(AV_RL16) | ||
91 | # define AV_RL16(p) AV_RN16(p) | ||
92 | # elif !defined(AV_RN16) && defined(AV_RL16) | ||
93 | # define AV_RN16(p) AV_RL16(p) | ||
94 | # endif | ||
95 | |||
96 | # if defined(AV_WN16) && !defined(AV_WL16) | ||
97 | # define AV_WL16(p, v) AV_WN16(p, v) | ||
98 | # elif !defined(AV_WN16) && defined(AV_WL16) | ||
99 | # define AV_WN16(p, v) AV_WL16(p, v) | ||
100 | # endif | ||
101 | |||
102 | # if defined(AV_RN24) && !defined(AV_RL24) | ||
103 | # define AV_RL24(p) AV_RN24(p) | ||
104 | # elif !defined(AV_RN24) && defined(AV_RL24) | ||
105 | # define AV_RN24(p) AV_RL24(p) | ||
106 | # endif | ||
107 | |||
108 | # if defined(AV_WN24) && !defined(AV_WL24) | ||
109 | # define AV_WL24(p, v) AV_WN24(p, v) | ||
110 | # elif !defined(AV_WN24) && defined(AV_WL24) | ||
111 | # define AV_WN24(p, v) AV_WL24(p, v) | ||
112 | # endif | ||
113 | |||
114 | # if defined(AV_RN32) && !defined(AV_RL32) | ||
115 | # define AV_RL32(p) AV_RN32(p) | ||
116 | # elif !defined(AV_RN32) && defined(AV_RL32) | ||
117 | # define AV_RN32(p) AV_RL32(p) | ||
118 | # endif | ||
119 | |||
120 | # if defined(AV_WN32) && !defined(AV_WL32) | ||
121 | # define AV_WL32(p, v) AV_WN32(p, v) | ||
122 | # elif !defined(AV_WN32) && defined(AV_WL32) | ||
123 | # define AV_WN32(p, v) AV_WL32(p, v) | ||
124 | # endif | ||
125 | |||
126 | # if defined(AV_RN64) && !defined(AV_RL64) | ||
127 | # define AV_RL64(p) AV_RN64(p) | ||
128 | # elif !defined(AV_RN64) && defined(AV_RL64) | ||
129 | # define AV_RN64(p) AV_RL64(p) | ||
130 | # endif | ||
131 | |||
132 | # if defined(AV_WN64) && !defined(AV_WL64) | ||
133 | # define AV_WL64(p, v) AV_WN64(p, v) | ||
134 | # elif !defined(AV_WN64) && defined(AV_WL64) | ||
135 | # define AV_WN64(p, v) AV_WL64(p, v) | ||
136 | # endif | ||
137 | |||
138 | #endif /* !HAVE_BIGENDIAN */ | ||
139 | |||
140 | #define HAVE_ATTRIBUTE_PACKED 0 | ||
141 | #define HAVE_FAST_UNALIGNED 0 | ||
142 | /* | ||
143 | * Define AV_[RW]N helper macros to simplify definitions not provided | ||
144 | * by per-arch headers. | ||
145 | */ | ||
146 | |||
147 | #if HAVE_ATTRIBUTE_PACKED | ||
148 | |||
149 | union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; | ||
150 | union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; | ||
151 | union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; | ||
152 | |||
153 | # define AV_RN(s, p) (((const union unaligned_##s *) (p))->l) | ||
154 | # define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v)) | ||
155 | |||
156 | #elif defined(__DECC) | ||
157 | |||
158 | # define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p))) | ||
159 | # define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v)) | ||
160 | |||
161 | #elif HAVE_FAST_UNALIGNED | ||
162 | |||
163 | # define AV_RN(s, p) (((const av_alias##s*)(p))->u##s) | ||
164 | # define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v)) | ||
165 | |||
166 | #else | ||
167 | |||
168 | #ifndef AV_RB16 | ||
169 | # define AV_RB16(x) \ | ||
170 | ((((const uint8_t*)(x))[0] << 8) | \ | ||
171 | ((const uint8_t*)(x))[1]) | ||
172 | #endif | ||
173 | #ifndef AV_WB16 | ||
174 | # define AV_WB16(p, d) do { \ | ||
175 | ((uint8_t*)(p))[1] = (d); \ | ||
176 | ((uint8_t*)(p))[0] = (d)>>8; \ | ||
177 | } while(0) | ||
178 | #endif | ||
179 | |||
180 | #ifndef AV_RL16 | ||
181 | # define AV_RL16(x) \ | ||
182 | ((((const uint8_t*)(x))[1] << 8) | \ | ||
183 | ((const uint8_t*)(x))[0]) | ||
184 | #endif | ||
185 | #ifndef AV_WL16 | ||
186 | # define AV_WL16(p, d) do { \ | ||
187 | ((uint8_t*)(p))[0] = (d); \ | ||
188 | ((uint8_t*)(p))[1] = (d)>>8; \ | ||
189 | } while(0) | ||
190 | #endif | ||
191 | |||
192 | #ifndef AV_RB32 | ||
193 | # define AV_RB32(x) \ | ||
194 | ((((const uint8_t*)(x))[0] << 24) | \ | ||
195 | (((const uint8_t*)(x))[1] << 16) | \ | ||
196 | (((const uint8_t*)(x))[2] << 8) | \ | ||
197 | ((const uint8_t*)(x))[3]) | ||
198 | #endif | ||
199 | #ifndef AV_WB32 | ||
200 | # define AV_WB32(p, d) do { \ | ||
201 | ((uint8_t*)(p))[3] = (d); \ | ||
202 | ((uint8_t*)(p))[2] = (d)>>8; \ | ||
203 | ((uint8_t*)(p))[1] = (d)>>16; \ | ||
204 | ((uint8_t*)(p))[0] = (d)>>24; \ | ||
205 | } while(0) | ||
206 | #endif | ||
207 | |||
208 | #ifndef AV_RL32 | ||
209 | # define AV_RL32(x) \ | ||
210 | ((((const uint8_t*)(x))[3] << 24) | \ | ||
211 | (((const uint8_t*)(x))[2] << 16) | \ | ||
212 | (((const uint8_t*)(x))[1] << 8) | \ | ||
213 | ((const uint8_t*)(x))[0]) | ||
214 | #endif | ||
215 | #ifndef AV_WL32 | ||
216 | # define AV_WL32(p, d) do { \ | ||
217 | ((uint8_t*)(p))[0] = (d); \ | ||
218 | ((uint8_t*)(p))[1] = (d)>>8; \ | ||
219 | ((uint8_t*)(p))[2] = (d)>>16; \ | ||
220 | ((uint8_t*)(p))[3] = (d)>>24; \ | ||
221 | } while(0) | ||
222 | #endif | ||
223 | |||
224 | #ifndef AV_RB64 | ||
225 | # define AV_RB64(x) \ | ||
226 | (((uint64_t)((const uint8_t*)(x))[0] << 56) | \ | ||
227 | ((uint64_t)((const uint8_t*)(x))[1] << 48) | \ | ||
228 | ((uint64_t)((const uint8_t*)(x))[2] << 40) | \ | ||
229 | ((uint64_t)((const uint8_t*)(x))[3] << 32) | \ | ||
230 | ((uint64_t)((const uint8_t*)(x))[4] << 24) | \ | ||
231 | ((uint64_t)((const uint8_t*)(x))[5] << 16) | \ | ||
232 | ((uint64_t)((const uint8_t*)(x))[6] << 8) | \ | ||
233 | (uint64_t)((const uint8_t*)(x))[7]) | ||
234 | #endif | ||
235 | #ifndef AV_WB64 | ||
236 | # define AV_WB64(p, d) do { \ | ||
237 | ((uint8_t*)(p))[7] = (d); \ | ||
238 | ((uint8_t*)(p))[6] = (d)>>8; \ | ||
239 | ((uint8_t*)(p))[5] = (d)>>16; \ | ||
240 | ((uint8_t*)(p))[4] = (d)>>24; \ | ||
241 | ((uint8_t*)(p))[3] = (d)>>32; \ | ||
242 | ((uint8_t*)(p))[2] = (d)>>40; \ | ||
243 | ((uint8_t*)(p))[1] = (d)>>48; \ | ||
244 | ((uint8_t*)(p))[0] = (d)>>56; \ | ||
245 | } while(0) | ||
246 | #endif | ||
247 | |||
248 | #ifndef AV_RL64 | ||
249 | # define AV_RL64(x) \ | ||
250 | (((uint64_t)((const uint8_t*)(x))[7] << 56) | \ | ||
251 | ((uint64_t)((const uint8_t*)(x))[6] << 48) | \ | ||
252 | ((uint64_t)((const uint8_t*)(x))[5] << 40) | \ | ||
253 | ((uint64_t)((const uint8_t*)(x))[4] << 32) | \ | ||
254 | ((uint64_t)((const uint8_t*)(x))[3] << 24) | \ | ||
255 | ((uint64_t)((const uint8_t*)(x))[2] << 16) | \ | ||
256 | ((uint64_t)((const uint8_t*)(x))[1] << 8) | \ | ||
257 | (uint64_t)((const uint8_t*)(x))[0]) | ||
258 | #endif | ||
259 | #ifndef AV_WL64 | ||
260 | # define AV_WL64(p, d) do { \ | ||
261 | ((uint8_t*)(p))[0] = (d); \ | ||
262 | ((uint8_t*)(p))[1] = (d)>>8; \ | ||
263 | ((uint8_t*)(p))[2] = (d)>>16; \ | ||
264 | ((uint8_t*)(p))[3] = (d)>>24; \ | ||
265 | ((uint8_t*)(p))[4] = (d)>>32; \ | ||
266 | ((uint8_t*)(p))[5] = (d)>>40; \ | ||
267 | ((uint8_t*)(p))[6] = (d)>>48; \ | ||
268 | ((uint8_t*)(p))[7] = (d)>>56; \ | ||
269 | } while(0) | ||
270 | #endif | ||
271 | |||
272 | #if HAVE_BIGENDIAN | ||
273 | # define AV_RN(s, p) AV_RB##s(p) | ||
274 | # define AV_WN(s, p, v) AV_WB##s(p, v) | ||
275 | #else | ||
276 | # define AV_RN(s, p) AV_RL##s(p) | ||
277 | # define AV_WN(s, p, v) AV_WL##s(p, v) | ||
278 | #endif | ||
279 | |||
280 | #endif /* HAVE_FAST_UNALIGNED */ | ||
281 | |||
282 | #ifndef AV_RN16 | ||
283 | # define AV_RN16(p) AV_RN(16, p) | ||
284 | #endif | ||
285 | |||
286 | #ifndef AV_RN32 | ||
287 | # define AV_RN32(p) AV_RN(32, p) | ||
288 | #endif | ||
289 | |||
290 | #ifndef AV_RN64 | ||
291 | # define AV_RN64(p) AV_RN(64, p) | ||
292 | #endif | ||
293 | |||
294 | #ifndef AV_WN16 | ||
295 | # define AV_WN16(p, v) AV_WN(16, p, v) | ||
296 | #endif | ||
297 | |||
298 | #ifndef AV_WN32 | ||
299 | # define AV_WN32(p, v) AV_WN(32, p, v) | ||
300 | #endif | ||
301 | |||
302 | #ifndef AV_WN64 | ||
303 | # define AV_WN64(p, v) AV_WN(64, p, v) | ||
304 | #endif | ||
305 | |||
306 | #if HAVE_BIGENDIAN | ||
307 | # define AV_RB(s, p) AV_RN##s(p) | ||
308 | # define AV_WB(s, p, v) AV_WN##s(p, v) | ||
309 | # define AV_RL(s, p) bswap_##s(AV_RN##s(p)) | ||
310 | # define AV_WL(s, p, v) AV_WN##s(p, bswap_##s(v)) | ||
311 | #else | ||
312 | # define AV_RB(s, p) bswap_##s(AV_RN##s(p)) | ||
313 | # define AV_WB(s, p, v) AV_WN##s(p, bswap_##s(v)) | ||
314 | # define AV_RL(s, p) AV_RN##s(p) | ||
315 | # define AV_WL(s, p, v) AV_WN##s(p, v) | ||
316 | #endif | ||
317 | |||
318 | #define AV_RB8(x) (((const uint8_t*)(x))[0]) | ||
319 | #define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0) | ||
320 | |||
321 | #define AV_RL8(x) AV_RB8(x) | ||
322 | #define AV_WL8(p, d) AV_WB8(p, d) | ||
323 | |||
324 | #ifndef AV_RB16 | ||
325 | # define AV_RB16(p) AV_RB(16, p) | ||
326 | #endif | ||
327 | #ifndef AV_WB16 | ||
328 | # define AV_WB16(p, v) AV_WB(16, p, v) | ||
329 | #endif | ||
330 | |||
331 | #ifndef AV_RL16 | ||
332 | # define AV_RL16(p) AV_RL(16, p) | ||
333 | #endif | ||
334 | #ifndef AV_WL16 | ||
335 | # define AV_WL16(p, v) AV_WL(16, p, v) | ||
336 | #endif | ||
337 | |||
338 | #ifndef AV_RB32 | ||
339 | # define AV_RB32(p) AV_RB(32, p) | ||
340 | #endif | ||
341 | #ifndef AV_WB32 | ||
342 | # define AV_WB32(p, v) AV_WB(32, p, v) | ||
343 | #endif | ||
344 | |||
345 | #ifndef AV_RL32 | ||
346 | # define AV_RL32(p) AV_RL(32, p) | ||
347 | #endif | ||
348 | #ifndef AV_WL32 | ||
349 | # define AV_WL32(p, v) AV_WL(32, p, v) | ||
350 | #endif | ||
351 | |||
352 | #ifndef AV_RB64 | ||
353 | # define AV_RB64(p) AV_RB(64, p) | ||
354 | #endif | ||
355 | #ifndef AV_WB64 | ||
356 | # define AV_WB64(p, v) AV_WB(64, p, v) | ||
357 | #endif | ||
358 | |||
359 | #ifndef AV_RL64 | ||
360 | # define AV_RL64(p) AV_RL(64, p) | ||
361 | #endif | ||
362 | #ifndef AV_WL64 | ||
363 | # define AV_WL64(p, v) AV_WL(64, p, v) | ||
364 | #endif | ||
365 | |||
366 | #ifndef AV_RB24 | ||
367 | # define AV_RB24(x) \ | ||
368 | ((((const uint8_t*)(x))[0] << 16) | \ | ||
369 | (((const uint8_t*)(x))[1] << 8) | \ | ||
370 | ((const uint8_t*)(x))[2]) | ||
371 | #endif | ||
372 | #ifndef AV_WB24 | ||
373 | # define AV_WB24(p, d) do { \ | ||
374 | ((uint8_t*)(p))[2] = (d); \ | ||
375 | ((uint8_t*)(p))[1] = (d)>>8; \ | ||
376 | ((uint8_t*)(p))[0] = (d)>>16; \ | ||
377 | } while(0) | ||
378 | #endif | ||
379 | |||
380 | #ifndef AV_RL24 | ||
381 | # define AV_RL24(x) \ | ||
382 | ((((const uint8_t*)(x))[2] << 16) | \ | ||
383 | (((const uint8_t*)(x))[1] << 8) | \ | ||
384 | ((const uint8_t*)(x))[0]) | ||
385 | #endif | ||
386 | #ifndef AV_WL24 | ||
387 | # define AV_WL24(p, d) do { \ | ||
388 | ((uint8_t*)(p))[0] = (d); \ | ||
389 | ((uint8_t*)(p))[1] = (d)>>8; \ | ||
390 | ((uint8_t*)(p))[2] = (d)>>16; \ | ||
391 | } while(0) | ||
392 | #endif | ||
393 | |||
394 | /* | ||
395 | * The AV_[RW]NA macros access naturally aligned data | ||
396 | * in a type-safe way. | ||
397 | */ | ||
398 | |||
399 | #define AV_RNA(s, p) (((const av_alias##s*)(p))->u##s) | ||
400 | #define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v)) | ||
401 | |||
402 | #ifndef AV_RN16A | ||
403 | # define AV_RN16A(p) AV_RNA(16, p) | ||
404 | #endif | ||
405 | |||
406 | #ifndef AV_RN32A | ||
407 | # define AV_RN32A(p) AV_RNA(32, p) | ||
408 | #endif | ||
409 | |||
410 | #ifndef AV_RN64A | ||
411 | # define AV_RN64A(p) AV_RNA(64, p) | ||
412 | #endif | ||
413 | |||
414 | #ifndef AV_WN16A | ||
415 | # define AV_WN16A(p, v) AV_WNA(16, p, v) | ||
416 | #endif | ||
417 | |||
418 | #ifndef AV_WN32A | ||
419 | # define AV_WN32A(p, v) AV_WNA(32, p, v) | ||
420 | #endif | ||
421 | |||
422 | #ifndef AV_WN64A | ||
423 | # define AV_WN64A(p, v) AV_WNA(64, p, v) | ||
424 | #endif | ||
425 | |||
426 | /* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be | ||
427 | * naturally aligned. They may be implemented using MMX, | ||
428 | * so emms_c() must be called before using any float code | ||
429 | * afterwards. | ||
430 | */ | ||
431 | |||
432 | #define AV_COPY(n, d, s) \ | ||
433 | (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n) | ||
434 | |||
435 | #ifndef AV_COPY16 | ||
436 | # define AV_COPY16(d, s) AV_COPY(16, d, s) | ||
437 | #endif | ||
438 | |||
439 | #ifndef AV_COPY32 | ||
440 | # define AV_COPY32(d, s) AV_COPY(32, d, s) | ||
441 | #endif | ||
442 | |||
443 | #ifndef AV_COPY64 | ||
444 | # define AV_COPY64(d, s) AV_COPY(64, d, s) | ||
445 | #endif | ||
446 | |||
447 | #ifndef AV_COPY128 | ||
448 | # define AV_COPY128(d, s) \ | ||
449 | do { \ | ||
450 | AV_COPY64(d, s); \ | ||
451 | AV_COPY64((char*)(d)+8, (char*)(s)+8); \ | ||
452 | } while(0) | ||
453 | #endif | ||
454 | |||
455 | #define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b)) | ||
456 | |||
457 | #ifndef AV_SWAP64 | ||
458 | # define AV_SWAP64(a, b) AV_SWAP(64, a, b) | ||
459 | #endif | ||
460 | |||
461 | #define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0) | ||
462 | |||
463 | #ifndef AV_ZERO16 | ||
464 | # define AV_ZERO16(d) AV_ZERO(16, d) | ||
465 | #endif | ||
466 | |||
467 | #ifndef AV_ZERO32 | ||
468 | # define AV_ZERO32(d) AV_ZERO(32, d) | ||
469 | #endif | ||
470 | |||
471 | #ifndef AV_ZERO64 | ||
472 | # define AV_ZERO64(d) AV_ZERO(64, d) | ||
473 | #endif | ||
474 | |||
475 | #ifndef AV_ZERO128 | ||
476 | # define AV_ZERO128(d) \ | ||
477 | do { \ | ||
478 | AV_ZERO64(d); \ | ||
479 | AV_ZERO64((char*)(d)+8); \ | ||
480 | } while(0) | ||
481 | #endif | ||
482 | |||
483 | #endif /* AVUTIL_INTREADWRITE_H */ | ||