• Home
  • Raw
  • Download

Lines Matching full:g

56 static int gif_find_frame_end(GIFParseContext *g, const uint8_t *buf,  in gif_find_frame_end()  argument
62 if (!g->state) { in gif_find_frame_end()
65 g->state = GIF_HEADER; in gif_find_frame_end()
66 g->found_sig++; in gif_find_frame_end()
68 g->state = GIF_EXTENSION; in gif_find_frame_end()
69 g->found_start = 1; in gif_find_frame_end()
71 g->state = GIF_IMAGE; in gif_find_frame_end()
73 g->state = 0; in gif_find_frame_end()
74 g->found_end = 1; in gif_find_frame_end()
75 g->found_sig = 0; in gif_find_frame_end()
77 g->found_sig = 0; in gif_find_frame_end()
81 if (g->state == GIF_HEADER) { in gif_find_frame_end()
82 if (g->index == 10) { in gif_find_frame_end()
83 g->gct_flag = !!(buf[index] & 0x80); in gif_find_frame_end()
84 g->gct_size = 3 * (1 << ((buf[index] & 0x07) + 1)); in gif_find_frame_end()
86 if (g->index >= 12 + g->gct_flag * g->gct_size) { in gif_find_frame_end()
87 g->state = 0; in gif_find_frame_end()
88 g->index = 0; in gif_find_frame_end()
89 g->gct_flag = 0; in gif_find_frame_end()
90 g->gct_size = 0; in gif_find_frame_end()
93 g->index++; in gif_find_frame_end()
94 } else if (g->state == GIF_EXTENSION) { in gif_find_frame_end()
95 if (g->found_start && g->found_end && g->found_sig) { in gif_find_frame_end()
97 g->found_start = 0; in gif_find_frame_end()
98 g->found_end = 0; in gif_find_frame_end()
99 g->index = 0; in gif_find_frame_end()
100 g->gct_flag = 0; in gif_find_frame_end()
101 g->gct_size = 0; in gif_find_frame_end()
102 g->state = 0; in gif_find_frame_end()
105 if (g->index == 1) { in gif_find_frame_end()
106 g->etype = buf[index]; in gif_find_frame_end()
108 if (g->index >= 2) { in gif_find_frame_end()
109 g->block_size = buf[index]; in gif_find_frame_end()
110 g->index = 0; in gif_find_frame_end()
111 g->state = GIF_EXTENSION_BLOCK; in gif_find_frame_end()
114 g->index++; in gif_find_frame_end()
115 } else if (g->state == GIF_IMAGE_BLOCK) { in gif_find_frame_end()
116 if (!g->index) in gif_find_frame_end()
117 g->block_size = buf[index]; in gif_find_frame_end()
118 if (g->index >= g->block_size) { in gif_find_frame_end()
119 g->index = 0; in gif_find_frame_end()
120 if (!g->block_size) { in gif_find_frame_end()
121 g->state = 0; in gif_find_frame_end()
122 g->found_end = 1; in gif_find_frame_end()
126 g->index++; in gif_find_frame_end()
127 } else if (g->state == GIF_EXTENSION_BLOCK) { in gif_find_frame_end()
128 if (g->etype == GIF_GCE_EXT_LABEL) { in gif_find_frame_end()
129 if (g->index == 0) in gif_find_frame_end()
130 g->delay = 0; in gif_find_frame_end()
131 if (g->index >= 1 && g->index <= 2) { in gif_find_frame_end()
132 g->delay |= buf[index] << (8 * (g->index - 1)); in gif_find_frame_end()
135 if (g->index >= g->block_size) { in gif_find_frame_end()
136 g->block_size = buf[index]; in gif_find_frame_end()
137 g->index = 0; in gif_find_frame_end()
138 if (!g->block_size) in gif_find_frame_end()
139 g->state = 0; in gif_find_frame_end()
142 g->index++; in gif_find_frame_end()
143 } else if (g->state == GIF_IMAGE) { in gif_find_frame_end()
144 if (g->index == 8) { in gif_find_frame_end()
145 g->gct_flag = !!(buf[index] & 0x80); in gif_find_frame_end()
146 g->gct_size = 3 * (1 << ((buf[index] & 0x07) + 1)); in gif_find_frame_end()
148 if (g->index >= 10 + g->gct_flag * g->gct_size) { in gif_find_frame_end()
149 g->state = GIF_IMAGE_BLOCK; in gif_find_frame_end()
150 g->index = 0; in gif_find_frame_end()
151 g->gct_flag = 0; in gif_find_frame_end()
152 g->gct_size = 0; in gif_find_frame_end()
155 g->index++; in gif_find_frame_end()
166 GIFParseContext *g = s->priv_data; in gif_parse() local
169 next = gif_find_frame_end(g, buf, buf_size, avctx); in gif_parse()
170 if (ff_combine_frame(&g->pc, next, &buf, &buf_size) < 0) { in gif_parse()
176 s->duration = g->delay; in gif_parse()