Mercurial > libavcodec.hg
comparison get_bits.h @ 10997:9bd48e510bef libavcodec
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() ?
| author | michael |
|---|---|
| date | Sun, 24 Jan 2010 19:19:09 +0000 |
| parents | 4289d95e5022 |
| children | 87bcae769ee7 |
comparison
equal
deleted
inserted
replaced
| 10996:26f9c146ef2a | 10997:9bd48e510bef |
|---|---|
| 150 | 150 |
| 151 #ifdef ALT_BITSTREAM_READER | 151 #ifdef ALT_BITSTREAM_READER |
| 152 # define MIN_CACHE_BITS 25 | 152 # define MIN_CACHE_BITS 25 |
| 153 | 153 |
| 154 # define OPEN_READER(name, gb)\ | 154 # define OPEN_READER(name, gb)\ |
| 155 int name##_index= (gb)->index;\ | 155 unsigned int name##_index= (gb)->index;\ |
| 156 int name##_cache= 0;\ | 156 int name##_cache= 0;\ |
| 157 | 157 |
| 158 # define CLOSE_READER(name, gb)\ | 158 # define CLOSE_READER(name, gb)\ |
| 159 (gb)->index= name##_index;\ | 159 (gb)->index= name##_index;\ |
| 160 | 160 |
| 411 CLOSE_READER(re, s) | 411 CLOSE_READER(re, s) |
| 412 } | 412 } |
| 413 | 413 |
| 414 static inline unsigned int get_bits1(GetBitContext *s){ | 414 static inline unsigned int get_bits1(GetBitContext *s){ |
| 415 #ifdef ALT_BITSTREAM_READER | 415 #ifdef ALT_BITSTREAM_READER |
| 416 int index= s->index; | 416 unsigned int index= s->index; |
| 417 uint8_t result= s->buffer[ index>>3 ]; | 417 uint8_t result= s->buffer[ index>>3 ]; |
| 418 #ifdef ALT_BITSTREAM_READER_LE | 418 #ifdef ALT_BITSTREAM_READER_LE |
| 419 result>>= (index&0x07); | 419 result>>= (index&0x07); |
| 420 result&= 1; | 420 result&= 1; |
| 421 #else | 421 #else |
| 555 * if the vlc code is invalid and max_depth>1 than the number of bits removed | 555 * if the vlc code is invalid and max_depth>1 than the number of bits removed |
| 556 * is undefined | 556 * is undefined |
| 557 */ | 557 */ |
| 558 #define GET_VLC(code, name, gb, table, bits, max_depth)\ | 558 #define GET_VLC(code, name, gb, table, bits, max_depth)\ |
| 559 {\ | 559 {\ |
| 560 int n, index, nb_bits;\ | 560 int n, nb_bits;\ |
| 561 unsigned int index;\ | |
| 561 \ | 562 \ |
| 562 index= SHOW_UBITS(name, gb, bits);\ | 563 index= SHOW_UBITS(name, gb, bits);\ |
| 563 code = table[index][0];\ | 564 code = table[index][0];\ |
| 564 n = table[index][1];\ | 565 n = table[index][1];\ |
| 565 \ | 566 \ |
| 586 SKIP_BITS(name, gb, n)\ | 587 SKIP_BITS(name, gb, n)\ |
| 587 } | 588 } |
| 588 | 589 |
| 589 #define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)\ | 590 #define GET_RL_VLC(level, run, name, gb, table, bits, max_depth, need_update)\ |
| 590 {\ | 591 {\ |
| 591 int n, index, nb_bits;\ | 592 int n, nb_bits;\ |
| 593 unsigned int index;\ | |
| 592 \ | 594 \ |
| 593 index= SHOW_UBITS(name, gb, bits);\ | 595 index= SHOW_UBITS(name, gb, bits);\ |
| 594 level = table[index].level;\ | 596 level = table[index].level;\ |
| 595 n = table[index].len;\ | 597 n = table[index].len;\ |
| 596 \ | 598 \ |
