summaryrefslogtreecommitdiff
path: root/libavcodec/get_bits.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-01-24 19:19:09 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-01-24 19:19:09 +0000
commitd9ef0d2e143341be0a543e328ccc247ad2905888 (patch)
treeeabd09ff680babb3b8bd3978ff13e529151b40b6 /libavcodec/get_bits.h
parent449d1442a62dda3815cb322d67be740db8f20c1b (diff)
Mark index as unsigend so gcc knows it doesnt need a sign extension on x86_64.
Any tips on how i can convince gcc that it doesnt need a mov %eax, %eax in every get_bits() ? Originally committed as revision 21433 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/get_bits.h')
-rw-r--r--libavcodec/get_bits.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index d9ef8607f2..a660f2f136 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -152,7 +152,7 @@ for examples see get_bits, show_bits, skip_bits, get_vlc
# define MIN_CACHE_BITS 25
# define OPEN_READER(name, gb)\
- int name##_index= (gb)->index;\
+ unsigned int name##_index= (gb)->index;\
int name##_cache= 0;\
# define CLOSE_READER(name, gb)\
@@ -413,7 +413,7 @@ static inline void skip_bits(GetBitContext *s, int n){
static inline unsigned int get_bits1(GetBitContext *s){
#ifdef ALT_BITSTREAM_READER
- int index= s->index;
+ unsigned int index= s->index;
uint8_t result= s->buffer[ index>>3 ];
#ifdef ALT_BITSTREAM_READER_LE
result>>= (index&0x07);
@@ -557,7 +557,8 @@ void free_vlc(VLC *vlc);
*/
#define GET_VLC(code, name, gb, table, bits, max_depth)\
{\
- int n, index, nb_bits;\
+ int n, nb_bits;\
+ unsigned int index;\
\
index= SHOW_UBITS(name, gb, bits);\
code = table[index][0];\
@@ -588,7 +589,8 @@ void free_vlc(VLC *vlc);
#define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)\
{\
- int n, index, nb_bits;\
+ int n, nb_bits;\
+ unsigned int index;\
\
index= SHOW_UBITS(name, gb, bits);\
level = table[index].level;\