Mercurial > libavcodec.hg
comparison common.c @ 1660:806afb8e9085 libavcodec
removing unused var & converting 64->32bit
| author | michael |
|---|---|
| date | Fri, 05 Dec 2003 23:12:03 +0000 |
| parents | fdb8244da1e5 |
| children | 07a484280a82 |
comparison
equal
deleted
inserted
replaced
| 1659:3075fc11a974 | 1660:806afb8e9085 |
|---|---|
| 46 | 46 |
| 47 void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size) | 47 void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size) |
| 48 { | 48 { |
| 49 s->buf = buffer; | 49 s->buf = buffer; |
| 50 s->buf_end = s->buf + buffer_size; | 50 s->buf_end = s->buf + buffer_size; |
| 51 s->data_out_size = 0; | |
| 52 #ifdef ALT_BITSTREAM_WRITER | 51 #ifdef ALT_BITSTREAM_WRITER |
| 53 s->index=0; | 52 s->index=0; |
| 54 ((uint32_t*)(s->buf))[0]=0; | 53 ((uint32_t*)(s->buf))[0]=0; |
| 55 // memset(buffer, 0, buffer_size); | 54 // memset(buffer, 0, buffer_size); |
| 56 #else | 55 #else |
| 61 } | 60 } |
| 62 | 61 |
| 63 #ifdef CONFIG_ENCODERS | 62 #ifdef CONFIG_ENCODERS |
| 64 | 63 |
| 65 /* return the number of bits output */ | 64 /* return the number of bits output */ |
| 66 int64_t get_bit_count(PutBitContext *s) | 65 int get_bit_count(PutBitContext *s) |
| 67 { | 66 { |
| 68 #ifdef ALT_BITSTREAM_WRITER | 67 #ifdef ALT_BITSTREAM_WRITER |
| 69 return s->data_out_size * 8 + s->index; | 68 return s->index; |
| 70 #else | 69 #else |
| 71 return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (int64_t)s->bit_left; | 70 return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left; |
| 72 #endif | 71 #endif |
| 73 } | 72 } |
| 74 | 73 |
| 75 void align_put_bits(PutBitContext *s) | 74 void align_put_bits(PutBitContext *s) |
| 76 { | 75 { |
