Lines Matching refs:bits
44 int bits[8];
88 static void init_rubin(struct rubin_state *rs, int div, int *bits)
98 rs->bits[c] = bits[c];
151 static void init_decode(struct rubin_state *rs, int div, int *bits)
153 init_rubin(rs, div, bits);
168 int c, bits = 0;
171 * First, work out how many bits we need from the input stream.
176 bits++;
185 rs->bit_number += bits;
188 * Now get the bits. We really want this to be "get n bits".
196 } while (--bits);
237 ret = encode(rs, rs->bit_divider-rs->bits[i],
238 rs->bits[i], byte & 1);
254 result |= decode(rs, bit_divider - rs->bits[i],
255 rs->bits[i]) << i;
262 static int rubin_do_compress(int bit_divider, int *bits, unsigned char *data_in,
272 init_rubin(&rs, bit_divider, bits);
308 int bits[8];
323 memset(bits, 0, sizeof(int)*8);
326 bits[7] += histo[i];
328 bits[6] += histo[i];
330 bits[5] += histo[i];
332 bits[4] += histo[i];
334 bits[3] += histo[i];
336 bits[2] += histo[i];
338 bits[1] += histo[i];
340 bits[0] += histo[i];
344 bits[i] = (bits[i] * 256) / mysrclen;
345 if (!bits[i]) bits[i] = 1;
346 if (bits[i] > 255) bits[i] = 255;
347 cpage_out[i] = bits[i];
350 ret = rubin_do_compress(256, bits, data_in, cpage_out+8, &mysrclen,
368 static void rubin_do_decompress(int bit_divider, int *bits,
377 init_decode(&rs, bit_divider, bits);
397 int bits[8];
401 bits[c] = data_in[c];
403 rubin_do_decompress(256, bits, data_in+8, cpage_out, sourcelen-8,