Lines Matching full:1
28 #define LZW_TABLE_SIZE (1 << LZW_MAXBITS)
48 return bytes[0] + (((uint16_t) bytes[1]) << 8); in read_num()
100 f_gif_read(gif_base, &fdsz, 1); in gif_open()
107 depth = ((fdsz >> 4) & 7) + 1; in gif_open()
110 gct_sz = 1 << ((fdsz & 0x07) + 1); in gif_open()
112 f_gif_read(gif_base, &bgidx, 1); in gif_open()
114 f_gif_read(gif_base, &aspect, 1); in gif_open()
143 gif->canvas = (uint8_t *) &gif[1]; in gif_open()
154 … GIFDEC_FILL_BG(gif->canvas, gif->width * gif->height, 1, gif->width * gif->height, bgcolor, 0xff); in gif_open()
158 gif->canvas[i * 4 + 1] = *(bgcolor + 1); in gif_open()
164 gif->loop_count = -1; in gif_open()
178 f_gif_read(gif, &size, 1); in discard_sub_blocks()
190 f_gif_seek(gif, 1, LV_FS_SEEK_CUR); /* block size = 12 */ in read_plain_text_ext()
195 f_gif_read(gif, &cw, 1); in read_plain_text_ext()
196 f_gif_read(gif, &ch, 1); in read_plain_text_ext()
197 f_gif_read(gif, &fg, 1); in read_plain_text_ext()
198 f_gif_read(gif, &bg, 1); in read_plain_text_ext()
217 f_gif_seek(gif, 1, LV_FS_SEEK_CUR); in read_graphic_control_ext()
218 f_gif_read(gif, &rdit, 1); in read_graphic_control_ext()
221 gif->gce.transparency = rdit & 1; in read_graphic_control_ext()
223 f_gif_read(gif, &gif->gce.tindex, 1); in read_graphic_control_ext()
225 f_gif_seek(gif, 1, LV_FS_SEEK_CUR); in read_graphic_control_ext()
248 f_gif_seek(gif, 1, LV_FS_SEEK_CUR); in read_application_ext()
262 gif->loop_count = loop_count + 1; in read_application_ext()
266 f_gif_seek(gif, 1, LV_FS_SEEK_CUR); in read_application_ext()
284 f_gif_read(gif, &label, 1); in read_ext()
317 f_gif_read(gif, sub_len, 1); /* Must be nonzero! */ in get_key()
320 f_gif_read(gif, byte, 1); in get_key()
327 key &= (1 << key_size) - 1; in get_key()
334 * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table) or parse error. */
357 f_gif_read(gif, &byte, 1); in read_image_data()
359 clear_code = 1 << key_size; in read_image_data()
360 stop_code = clear_code + 1; in read_image_data()
381 curr_size = key_size + 1; in read_image_data()
382 top_slot = 1 << curr_size; in read_image_data()
385 first_value = -1; in read_image_data()
386 last_key = -1; in read_image_data()
394 return -1; in read_image_data()
397 frm_off += 1; in read_image_data()
403 case 1: in read_image_data()
436 curr_size = key_size + 1; in read_image_data()
438 top_slot = 1 << curr_size; in read_image_data()
439 first_value = last_key = -1; in read_image_data()
471 top_slot <<= 1; in read_image_data()
472 curr_size += 1; in read_image_data()
477 if (key == stop_code) f_gif_read(gif, &sub_len, 1); /* Must be zero! */ in read_image_data()
486 int init_bulk = MAX(1 << (key_size + 1), 0x100); in new_table()
490 table->nentries = (1 << key_size) + 2; in new_table()
491 table->entries = (Entry *) &table[1]; in new_table()
492 for(key = 0; key < (1 << key_size); key++) in new_table()
494 1, 0xFFF, key in new_table()
502 * +1 if key size must be incremented after this addition
503 * -1 if could not realloc table */
511 if(!table) return -1; in add_entry()
512 table->entries = (Entry *) &table[1]; in add_entry()
519 if((table->nentries & (table->nentries - 1)) == 0) in add_entry()
520 return 1; in add_entry()
530 p = (h - 1) / 8 + 1; in interlaced_line_index()
531 if(y < p) /* pass 1 */ in interlaced_line_index()
534 p = (h - 5) / 8 + 1; in interlaced_line_index()
538 p = (h - 3) / 4 + 1; in interlaced_line_index()
543 return y * 2 + 1; in interlaced_line_index()
547 * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table) or parse error. */
560 f_gif_read(gif, &byte, 1); in read_image_data()
566 clear = 1 << key_size; in read_image_data()
567 stop = clear + 1; in read_image_data()
579 table->nentries = (1 << (key_size - 1)) + 2; in read_image_data()
583 ret = add_entry(&table, str_len + 1, key, entry.suffix); in read_image_data()
584 if(ret == -1) { in read_image_data()
586 return -1; in read_image_data()
590 table_is_full = 1; in read_image_data()
596 if(ret == 1) key_size++; in read_image_data()
601 return -1; in read_image_data()
604 p = frm_off + entry.length - 1; in read_image_data()
616 if(key < table->nentries - 1 && !table_is_full) in read_image_data()
617 table->entries[table->nentries - 1].suffix = entry.suffix; in read_image_data()
620 if(key == stop) f_gif_read(gif, &sub_len, 1); /* Must be zero! */ in read_image_data()
628 * Return 0 on success or -1 on out-of-memory (w.r.t. LZW code table) or parse error. */
642 return -1; in read_image()
644 f_gif_read(gif, &fisrz, 1); in read_image()
650 gif->lct.size = 1 << ((fisrz & 0x07) + 1); in read_image()
678 buffer[(i + k) * 4 + 1] = *(color + 1); in render_frame_rect()
708 gif->canvas[(i + k) * 4 + 1] = *(bgcolor + 1); in dispose()
724 /* Return 1 if got a frame; 0 if got GIF trailer; -1 if error. */
731 f_gif_read(gif, &sep, 1); in gd_get_frame()
735 if(gif->loop_count == 1 || gif->loop_count < 0) { in gd_get_frame()
738 else if(gif->loop_count > 1) { in gd_get_frame()
744 else return -1; in gd_get_frame()
745 f_gif_read(gif, &sep, 1); in gd_get_frame()
747 if(read_image(gif) == -1) in gd_get_frame()
748 return -1; in gd_get_frame()
749 return 1; in gd_get_frame()
761 gif->loop_count = -1; in gd_rewind()