| 309 | } |
| 310 | |
| 311 | static void |
| 312 | init_decoder(struct Bitstream *gif, unsigned bit_width) |
| 313 | { |
| 314 | unsigned i; |
| 315 | unsigned clear; |
| 316 | |
| 317 | gif->bits = 0; |
| 318 | gif->num_bits = 0; |
| 319 | gif->initial_bit_width = bit_width; |
| 320 | gif->block_size = 0; |
| 321 | |
| 322 | clear = 1 << bit_width; |
| 323 | gif->dict_size = clear + 2; |
| 324 | for (i = 0; i < clear; ++i) { |
| 325 | gif->dictionary[i].byte = i; |
| 326 | gif->dictionary[i].next = 0xFFFF; |
| 327 | } |
| 328 | |
| 329 | gif->str_size = 0; |
| 330 | |
| 331 | reset_decoder(gif); |
| 332 | } |
| 333 | |
| 334 | static void |
| 335 | reset_decoder(struct Bitstream *gif) |
no test coverage detected