diff options
Diffstat (limited to 'src/libffmpeg/libavcodec/common.h')
-rw-r--r-- | src/libffmpeg/libavcodec/common.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libffmpeg/libavcodec/common.h b/src/libffmpeg/libavcodec/common.h index 348fb7d3f..9dfd7dcda 100644 --- a/src/libffmpeg/libavcodec/common.h +++ b/src/libffmpeg/libavcodec/common.h @@ -256,6 +256,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)) @@ -302,6 +306,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; @@ -850,6 +862,8 @@ static inline int ff_get_fourcc(const char *s){ return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24); } +void ff_float2fraction(int *nom_arg, int *denom_arg, double f, int max); + #ifdef ARCH_X86 #define MASK_ABS(mask, level)\ |