36 #define GIF_TRANSPARENT_COLOR 0x00ffffff
84 for (i = 0; i < nb; i++, pal++)
85 *pal = (0xffu << 24) | bytestream2_get_be24u(&s->
gb);
90 uint32_t *p = (uint32_t *)picture->
data[0];
91 uint32_t *p_end = p + (picture->
linesize[0] /
sizeof(uint32_t)) * picture->
height;
93 for (; p < p_end; p++)
99 const int linesize = picture->
linesize[0] /
sizeof(uint32_t);
100 const uint32_t *py = (uint32_t *)picture->
data[0] + t * linesize;
101 const uint32_t *pr, *pb = py + h * linesize;
104 for (; py < pb; py += linesize) {
105 px = (uint32_t *)py + l;
108 for (; px < pr; px++)
114 int linesize,
int l,
int t,
int w,
int h)
116 const int y_start = t * linesize;
117 const uint32_t *src_px,
118 *src_py = src + y_start,
119 *dst_py = dst + y_start;
120 const uint32_t *src_pb = src_py + h * linesize;
123 for (; src_py < src_pb; src_py += linesize, dst_py += linesize) {
125 dst_px = (uint32_t *)dst_py + l;
127 memcpy(dst_px, src_px, w *
sizeof(uint32_t));
134 int is_interleaved, has_local_palette,
y,
pass, y1, linesize, pal_size;
135 uint32_t *ptr, *pal, *px, *pr, *ptr1;
143 left = bytestream2_get_le16u(&s->
gb);
144 top = bytestream2_get_le16u(&s->
gb);
145 width = bytestream2_get_le16u(&s->
gb);
146 height = bytestream2_get_le16u(&s->
gb);
147 flags = bytestream2_get_byteu(&s->
gb);
148 is_interleaved = flags & 0x40;
149 has_local_palette = flags & 0x80;
150 bits_per_pixel = (flags & 0x07) + 1;
152 av_dlog(s->
avctx,
"image x=%d y=%d w=%d h=%d\n", left, top, width, height);
154 if (has_local_palette) {
155 pal_size = 1 << bits_per_pixel;
186 if (width <= 0 || height <= 0)
214 frame->
linesize[0] /
sizeof(uint32_t), left, top, width, height);
223 code_size = bytestream2_get_byteu(&s->
gb);
231 linesize = frame->
linesize[0] /
sizeof(uint32_t);
232 ptr1 = (uint32_t *)frame->
data[0] + top * linesize + left;
242 for (px = ptr, idx = s->
idx_line; px < pr; px++, idx++) {
247 if (is_interleaved) {
256 ptr = ptr1 + linesize * y1;
265 ptr = ptr1 + linesize;
293 int ext_code, ext_len, gce_flags, gce_transparent_index;
300 ext_code = bytestream2_get_byteu(&s->
gb);
301 ext_len = bytestream2_get_byteu(&s->
gb);
303 av_dlog(s->
avctx,
"ext_code=0x%x len=%d\n", ext_code, ext_len);
315 gce_flags = bytestream2_get_byteu(&s->
gb);
317 gce_transparent_index = bytestream2_get_byteu(&s->
gb);
318 if (gce_flags & 0x01)
324 av_dlog(s->
avctx,
"gce_flags=%x tcolor=%d disposal=%d\n",
330 av_dlog(s->
avctx,
"invalid value in gce_disposal (%d). Using default value of 0.\n", ext_len);
333 ext_len = bytestream2_get_byteu(&s->
gb);
345 ext_len = bytestream2_get_byteu(&s->
gb);
356 int background_color_index;
372 v = bytestream2_get_byteu(&s->
gb);
376 background_color_index = bytestream2_get_byteu(&s->
gb);
377 n = bytestream2_get_byteu(&s->
gb);
383 av_dlog(s->
avctx,
"screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
404 int code = bytestream2_get_byte(&s->
gb);
453 if (avpkt->
size >= 6) {
518 {
"trans_color",
"color value (ARGB) that is used instead of transparent color",