comparison common.h @ 891:d3fc77a6d57e libavcodec

Add some rudimentary support for sparc64
author philipjsg
date Tue, 26 Nov 2002 04:29:40 +0000
parents 1c32039e7215
children c3758b2e59a1
comparison
equal deleted inserted replaced
890:653d9419ea01 891:d3fc77a6d57e
246 int16_t level; 246 int16_t level;
247 int8_t len; 247 int8_t len;
248 uint8_t run; 248 uint8_t run;
249 } RL_VLC_ELEM; 249 } RL_VLC_ELEM;
250 250
251 #ifdef ARCH_SPARC64
252 #define UNALIGNED_STORES_ARE_BAD
253 #endif
254
251 /* used to avoid missaligned exceptions on some archs (alpha, ...) */ 255 /* used to avoid missaligned exceptions on some archs (alpha, ...) */
252 #ifdef ARCH_X86 256 #ifdef ARCH_X86
253 # define unaligned32(a) (*(UINT32*)(a)) 257 # define unaligned32(a) (*(UINT32*)(a))
254 #else 258 #else
255 # ifdef __GNUC__ 259 # ifdef __GNUC__
292 bit_buf = (bit_buf<<n) | value; 296 bit_buf = (bit_buf<<n) | value;
293 bit_left-=n; 297 bit_left-=n;
294 } else { 298 } else {
295 bit_buf<<=bit_left; 299 bit_buf<<=bit_left;
296 bit_buf |= value >> (n - bit_left); 300 bit_buf |= value >> (n - bit_left);
301 #ifdef UNALIGNED_STORES_ARE_BAD
302 if (3 & (int) s->buf_ptr) {
303 s->buf_ptr[0] = bit_buf >> 24;
304 s->buf_ptr[1] = bit_buf >> 16;
305 s->buf_ptr[2] = bit_buf >> 8;
306 s->buf_ptr[3] = bit_buf ;
307 } else
308 #endif
297 *(UINT32 *)s->buf_ptr = be2me_32(bit_buf); 309 *(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
298 //printf("bitbuf = %08x\n", bit_buf); 310 //printf("bitbuf = %08x\n", bit_buf);
299 s->buf_ptr+=4; 311 s->buf_ptr+=4;
300 bit_left+=32 - n; 312 bit_left+=32 - n;
301 bit_buf = value; 313 bit_buf = value;