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,
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;
129 memcpy(dst_px, src_px, w *
sizeof(uint32_t));
136 int is_interleaved, has_local_palette,
y,
pass, y1, linesize, pal_size;
137 uint32_t *ptr, *pal, *px, *pr, *ptr1;
145 left = bytestream2_get_le16u(&s->
gb);
146 top = bytestream2_get_le16u(&s->
gb);
147 width = bytestream2_get_le16u(&s->
gb);
148 height = bytestream2_get_le16u(&s->
gb);
149 flags = bytestream2_get_byteu(&s->
gb);
150 is_interleaved = flags & 0x40;
151 has_local_palette = flags & 0x80;
152 bits_per_pixel = (flags & 0x07) + 1;
154 av_dlog(s->
avctx,
"image x=%d y=%d w=%d h=%d\n", left, top, width, height);
156 if (has_local_palette) {
157 pal_size = 1 << bits_per_pixel;
188 if (width <= 0 || height <= 0)
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);
347 ext_len = bytestream2_get_byteu(&s->
gb);
358 int background_color_index;
374 v = bytestream2_get_byteu(&s->
gb);
378 background_color_index = bytestream2_get_byteu(&s->
gb);
379 n = bytestream2_get_byteu(&s->
gb);
385 av_dlog(s->
avctx,
"screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
406 int code = bytestream2_get_byte(&s->
gb);
456 if (avpkt->
size >= 6) {
528 {
"trans_color",
"color value (ARGB) that is used instead of transparent color",