Mercurial > libavcodec.hg
comparison bitstream.h @ 3632:25ceb2cc950d libavcodec
make A32 reader align its ptr during init no matter what missaligned mess is given to it
| author | michael |
|---|---|
| date | Sat, 26 Aug 2006 11:37:33 +0000 |
| parents | 40f753fc46a4 |
| children | f9660d3a9975 |
comparison
equal
deleted
inserted
replaced
| 3631:40f753fc46a4 | 3632:25ceb2cc950d |
|---|---|
| 717 { | 717 { |
| 718 s->buffer_ptr = buffer; | 718 s->buffer_ptr = buffer; |
| 719 s->bit_count = 16; | 719 s->bit_count = 16; |
| 720 s->cache = 0; | 720 s->cache = 0; |
| 721 } | 721 } |
| 722 #elif defined A32_BITSTREAM_READER | |
| 723 s->buffer_ptr = (uint32_t*)buffer; | |
| 724 s->bit_count = 32; | |
| 725 s->cache0 = 0; | |
| 726 s->cache1 = 0; | |
| 727 #endif | |
| 728 { | 722 { |
| 729 OPEN_READER(re, s) | 723 OPEN_READER(re, s) |
| 730 UPDATE_CACHE(re, s) | 724 UPDATE_CACHE(re, s) |
| 731 UPDATE_CACHE(re, s) | 725 UPDATE_CACHE(re, s) |
| 732 CLOSE_READER(re, s) | 726 CLOSE_READER(re, s) |
| 733 } | 727 } |
| 734 #ifdef A32_BITSTREAM_READER | 728 #elif defined A32_BITSTREAM_READER |
| 735 s->cache1 = 0; | 729 s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3)); |
| 730 s->bit_count = 32 + 8*((intptr_t)buffer&3); | |
| 731 skip_bits_long(s, 0); | |
| 736 #endif | 732 #endif |
| 737 } | 733 } |
| 738 | 734 |
| 739 static void align_get_bits(GetBitContext *s) | 735 static void align_get_bits(GetBitContext *s) |
| 740 { | 736 { |
