comparison dsputil.c @ 493:873b9075d853 libavcodec

move unaligned access macros to dsputil.h - added unaligned 32 bit store
author bellard
date Tue, 11 Jun 2002 13:43:27 +0000
parents a7cbee351b55
children 0cb7ab35ccb2
comparison
equal deleted inserted replaced
492:de11e138a661 493:873b9075d853
249 pix[7] = cm[pix[7] + p[7]]; 249 pix[7] = cm[pix[7] + p[7]];
250 pix += line_size; 250 pix += line_size;
251 p += 8; 251 p += 8;
252 } 252 }
253 } 253 }
254
255 #ifdef __GNUC__
256
257 struct unaligned_64 { uint64_t l; } __attribute__((packed));
258 struct unaligned_32 { uint32_t l; } __attribute__((packed));
259
260 #define LD32(a) (((const struct unaligned_32 *) (a))->l)
261 #define LD64(a) (((const struct unaligned_64 *) (a))->l)
262
263 #else /* __GNUC__ */
264
265 #define LD32(a) (*((uint32_t*)(a)))
266 #define LD64(a) (*((uint64_t*)(a)))
267
268 #endif /* !__GNUC__ */
269 254
270 #if 0 255 #if 0
271 256
272 #define PIXOP2(OPNAME, OP) \ 257 #define PIXOP2(OPNAME, OP) \
273 void OPNAME ## _pixels(uint8_t *block, const uint8_t *pixels, int line_size, int h)\ 258 void OPNAME ## _pixels(uint8_t *block, const uint8_t *pixels, int line_size, int h)\