38 #define GIF_TRANSPARENT_COLOR 0x00ffffff
86 for (i = 0; i < nb; i++, pal++)
87 *pal = (0xffu << 24) | bytestream2_get_be24u(&s->
gb);
92 uint32_t *p = (uint32_t *)picture->
data[0];
93 uint32_t *p_end = p + (picture->
linesize[0] /
sizeof(uint32_t)) * picture->
height;
95 for (; p < p_end; p++)
101 const int linesize = picture->
linesize[0] /
sizeof(uint32_t);
102 const uint32_t *py = (uint32_t *)picture->
data[0] + t * linesize;
103 const uint32_t *pr, *pb = py + h * linesize;
106 for (; py < pb; py += linesize) {
107 px = (uint32_t *)py + l;
110 for (; px < pr; px++)
116 int linesize,
int l,
int t,
int w,
int h)
118 const int y_start = t * linesize;
119 const uint32_t *src_px, *src_pr,
120 *src_py = src + y_start,
121 *dst_py = dst + y_start;
122 const uint32_t *src_pb = src_py + h * linesize;
125 for (; src_py < src_pb; src_py += linesize, dst_py += linesize) {
127 dst_px = (uint32_t *)dst_py + l;
130 for (; src_px < src_pr; src_px++, dst_px++)
138 int is_interleaved, has_local_palette, y,
pass, y1, linesize, pal_size;
139 uint32_t *ptr, *pal, *px, *pr, *ptr1;
147 left = bytestream2_get_le16u(&s->
gb);
148 top = bytestream2_get_le16u(&s->
gb);
149 width = bytestream2_get_le16u(&s->
gb);
150 height = bytestream2_get_le16u(&s->
gb);
151 flags = bytestream2_get_byteu(&s->
gb);
152 is_interleaved = flags & 0x40;
153 has_local_palette = flags & 0x80;
154 bits_per_pixel = (flags & 0x07) + 1;
156 av_dlog(s->
avctx,
"image x=%d y=%d w=%d h=%d\n", left, top, width, height);
158 if (has_local_palette) {
159 pal_size = 1 << bits_per_pixel;
225 code_size = bytestream2_get_byteu(&s->
gb);
234 ptr1 = (uint32_t *)s->
picture.
data[0] + top * linesize + left;
244 for (px = ptr, idx = s->
idx_line; px < pr; px++, idx++) {
249 if (is_interleaved) {
258 ptr = ptr1 + linesize * y1;
267 ptr = ptr1 + linesize;
295 int ext_code, ext_len, gce_flags, gce_transparent_index;
302 ext_code = bytestream2_get_byteu(&s->
gb);
303 ext_len = bytestream2_get_byteu(&s->
gb);
305 av_dlog(s->
avctx,
"ext_code=0x%x len=%d\n", ext_code, ext_len);
317 gce_flags = bytestream2_get_byteu(&s->
gb);
319 gce_transparent_index = bytestream2_get_byteu(&s->
gb);
320 if (gce_flags & 0x01)
326 av_dlog(s->
avctx,
"gce_flags=%x tcolor=%d disposal=%d\n",
332 av_dlog(s->
avctx,
"invalid value in gce_disposal (%d). Using default value of 0.\n", ext_len);
335 ext_len = bytestream2_get_byteu(&s->
gb);
341 while (ext_len != 0) {
347 ext_len = bytestream2_get_byteu(&s->
gb);
358 int background_color_index;
383 v = bytestream2_get_byteu(&s->
gb);
387 background_color_index = bytestream2_get_byteu(&s->
gb);
388 n = bytestream2_get_byteu(&s->
gb);
394 av_dlog(s->
avctx,
"screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
417 int code = bytestream2_get_byte(&s->
gb);
467 if (avpkt->
size >= 6) {
534 {
"trans_color",
"color value (ARGB) that is used instead of transparent color",