From c8b520d2c3f38e4dcaeb7f9ef4bebe93dd8bbb44 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E3=82=88=E3=82=84?= Date: Sat, 13 Aug 2011 14:14:00 +0900 Subject: [PATCH] bitstream_putbit remove waste variable. --- src/bitstream.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/bitstream.c b/src/bitstream.c index d7d0330..ddade79 100644 --- a/src/bitstream.c +++ b/src/bitstream.c @@ -257,22 +257,15 @@ bitstream_getbytesBE(bitstream_t *bs, int byte_width) { int bitstream_putbit(bitstream_t *bs, int bit) { - int byte; if (bs->data_len <= bs->byte_offset) { -// fprintf(stderr, "bs->data_len(%ld) <= bs->byte_offset(%ld)\n", -// bs->data_len, bs->byte_offset); if (bs->data_alloc_len <= bs->byte_offset) { // fprintf(stderr, "bitstream_putbit: alloc_len=%lu\n", bs->data_alloc_len); bitstream_realloc(bs); } bs->data[bs->byte_offset] = 0; bs->data_len ++; -// return 1; } - bit &= 1; - byte = bs->data[bs->byte_offset]; - byte |= bit << (7 - bs->bit_offset); - bs->data[bs->byte_offset] = byte; + bs->data[bs->byte_offset] |= (bit & 1) << (7 - bs->bit_offset); bitstream_incrpos(bs, 0, 1); return 0; } -- 2.11.0