Mercurial > libavcodec.hg
comparison get_bits.h @ 11200:cd8a77473dd1 libavcodec
Move NEG_[US]SR32 macros to mathops.h
| author | mru |
|---|---|
| date | Wed, 17 Feb 2010 23:58:59 +0000 |
| parents | 87bcae769ee7 |
| children | 5401fc245167 |
comparison
equal
deleted
inserted
replaced
| 11199:f1b38a8588b2 | 11200:cd8a77473dd1 |
|---|---|
| 47 //#define LIBMPEG2_BITSTREAM_READER | 47 //#define LIBMPEG2_BITSTREAM_READER |
| 48 //#define A32_BITSTREAM_READER | 48 //#define A32_BITSTREAM_READER |
| 49 # endif | 49 # endif |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 #if ARCH_X86 | |
| 53 // avoid +32 for shift optimization (gcc should do that ...) | |
| 54 static inline int32_t NEG_SSR32( int32_t a, int8_t s){ | |
| 55 __asm__ ("sarl %1, %0\n\t" | |
| 56 : "+r" (a) | |
| 57 : "ic" ((uint8_t)(-s)) | |
| 58 ); | |
| 59 return a; | |
| 60 } | |
| 61 static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ | |
| 62 __asm__ ("shrl %1, %0\n\t" | |
| 63 : "+r" (a) | |
| 64 : "ic" ((uint8_t)(-s)) | |
| 65 ); | |
| 66 return a; | |
| 67 } | |
| 68 #else | |
| 69 # define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) | |
| 70 # define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) | |
| 71 #endif | |
| 72 | |
| 73 /* bit input */ | 52 /* bit input */ |
| 74 /* buffer, buffer_end and size_in_bits must be present and used by every reader */ | 53 /* buffer, buffer_end and size_in_bits must be present and used by every reader */ |
| 75 typedef struct GetBitContext { | 54 typedef struct GetBitContext { |
| 76 const uint8_t *buffer, *buffer_end; | 55 const uint8_t *buffer, *buffer_end; |
| 77 #ifdef ALT_BITSTREAM_READER | 56 #ifdef ALT_BITSTREAM_READER |
