Lines Matching refs:bs

137     Bit_stream_struc *bs = &gfc->bs;
141 memcpy(&bs->buf[bs->buf_byte_idx], esv->header[esv->w_ptr].buf, cfg->sideinfo_len);
142 bs->buf_byte_idx += cfg->sideinfo_len;
143 bs->totbit += cfg->sideinfo_len * 8;
155 Bit_stream_struc *bs;
156 bs = &gfc->bs;
162 if (bs->buf_bit_idx == 0) {
163 bs->buf_bit_idx = 8;
164 bs->buf_byte_idx++;
165 assert(bs->buf_byte_idx < BUFFER_SIZE);
166 assert(esv->header[esv->w_ptr].write_timing >= bs->totbit);
167 if (esv->header[esv->w_ptr].write_timing == bs->totbit) {
170 bs->buf[bs->buf_byte_idx] = 0;
173 k = Min(j, bs->buf_bit_idx);
176 bs->buf_bit_idx -= k;
179 assert(bs->buf_bit_idx < MAX_LENGTH);
181 bs->buf[bs->buf_byte_idx] |= ((val >> j) << bs->buf_bit_idx);
182 bs->totbit += k;
190 Bit_stream_struc *bs;
191 bs = &gfc->bs;
197 if (bs->buf_bit_idx == 0) {
198 bs->buf_bit_idx = 8;
199 bs->buf_byte_idx++;
200 assert(bs->buf_byte_idx < BUFFER_SIZE);
201 bs->buf[bs->buf_byte_idx] = 0;
204 k = Min(j, bs->buf_bit_idx);
207 bs->buf_bit_idx -= k;
210 assert(bs->buf_bit_idx < MAX_LENGTH);
212 bs->buf[bs->buf_byte_idx] |= ((val >> j) << bs->buf_bit_idx);
213 bs->totbit += k;
497 int gegebo = gfc->bs.totbit;
550 gfc->bs.totbit - gegebo, gi->count1bits, gi->big_values, gi->count1);
701 hogege = gfc->bs.totbit;
725 DEBUGF(gfc, "<%ld> ", gfc->bs.totbit - hogege);
742 hogege = gfc->bs.totbit;
773 DEBUGF(gfc, "<%ld> ", gfc->bs.totbit - hogege);
815 flushbits = esv->header[last_ptr].write_timing - gfc->bs.totbit;
840 *total_bytes_output += gfc->bs.buf_byte_idx + 1;
850 DEBUGF(gfc, "bs.totbit: %i \n", gfc->bs.totbit);
881 == gfc->bs.totbit);
972 assert(gfc->bs.totbit % 8 == 0);
974 if (gfc->bs.totbit > 1000000000) {
978 esv->header[i].write_timing -= gfc->bs.totbit;
979 gfc->bs.totbit = 0;
1058 Bit_stream_struc *const bs = &gfc->bs;
1059 int const minimum = bs->buf_byte_idx + 1;
1064 memcpy(buffer, bs->buf, minimum);
1065 bs->buf_byte_idx = -1;
1066 bs->buf_bit_idx = 0;
1104 gfc->bs.buf = lame_calloc(unsigned char, BUFFER_SIZE);
1105 gfc->bs.buf_size = BUFFER_SIZE;
1106 gfc->bs.buf_byte_idx = -1;
1107 gfc->bs.buf_bit_idx = 0;
1108 gfc->bs.totbit = 0;