aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/common.h
diff options
context:
space:
mode:
authorPhilip Gladstone <philipjsg@users.sourceforge.net>2002-11-26 04:29:40 +0000
committerPhilip Gladstone <philipjsg@users.sourceforge.net>2002-11-26 04:29:40 +0000
commit35fedfc349b04e53e77044a3c0ac3027401f4863 (patch)
tree49cdfe3c5b4bea28171d6d5402e2a8e07b069726 /libavcodec/common.h
parentb55e4ef43d7aed14716e3eaa42f0709f486e0d78 (diff)
downloadffmpeg-35fedfc349b04e53e77044a3c0ac3027401f4863.tar.gz
Add some rudimentary support for sparc64
Originally committed as revision 1279 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r--libavcodec/common.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index b657aba7ba..966f1cd6af 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -248,6 +248,10 @@ typedef struct RL_VLC_ELEM {
uint8_t run;
} RL_VLC_ELEM;
+#ifdef ARCH_SPARC64
+#define UNALIGNED_STORES_ARE_BAD
+#endif
+
/* used to avoid missaligned exceptions on some archs (alpha, ...) */
#ifdef ARCH_X86
# define unaligned32(a) (*(UINT32*)(a))
@@ -294,6 +298,14 @@ static inline void put_bits(PutBitContext *s, int n, unsigned int value)
} else {
bit_buf<<=bit_left;
bit_buf |= value >> (n - bit_left);
+#ifdef UNALIGNED_STORES_ARE_BAD
+ if (3 & (int) s->buf_ptr) {
+ s->buf_ptr[0] = bit_buf >> 24;
+ s->buf_ptr[1] = bit_buf >> 16;
+ s->buf_ptr[2] = bit_buf >> 8;
+ s->buf_ptr[3] = bit_buf ;
+ } else
+#endif
*(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
//printf("bitbuf = %08x\n", bit_buf);
s->buf_ptr+=4;