36 #define GIF_TRANSPARENT_COLOR 0x00ffffff
83 for (i = 0; i < nb; i++, pal++)
84 *pal = (0xffu << 24) | bytestream2_get_be24u(&s->
gb);
89 uint32_t *p = (uint32_t *)picture->
data[0];
90 uint32_t *p_end = p + (picture->
linesize[0] /
sizeof(uint32_t)) * picture->
height;
92 for (; p < p_end; p++)
98 const int linesize = picture->
linesize[0] /
sizeof(uint32_t);
99 const uint32_t *py = (uint32_t *)picture->
data[0] + t * linesize;
100 const uint32_t *pr, *pb = py + h * linesize;
103 for (; py < pb; py += linesize) {
104 px = (uint32_t *)py + l;
107 for (; px < pr; px++)
113 int linesize,
int l,
int t,
int w,
int h)
115 const int y_start = t * linesize;
116 const uint32_t *src_px,
117 *src_py = src + y_start,
118 *dst_py = dst + y_start;
119 const uint32_t *src_pb = src_py + h * linesize;
122 for (; src_py < src_pb; src_py += linesize, dst_py += linesize) {
124 dst_px = (uint32_t *)dst_py + l;
126 memcpy(dst_px, src_px, w *
sizeof(uint32_t));
133 int is_interleaved, has_local_palette,
y,
pass, y1, linesize, pal_size;
134 uint32_t *ptr, *pal, *px, *pr, *ptr1;
142 left = bytestream2_get_le16u(&s->
gb);
143 top = bytestream2_get_le16u(&s->
gb);
144 width = bytestream2_get_le16u(&s->
gb);
145 height = bytestream2_get_le16u(&s->
gb);
146 flags = bytestream2_get_byteu(&s->
gb);
147 is_interleaved = flags & 0x40;
148 has_local_palette = flags & 0x80;
149 bits_per_pixel = (flags & 0x07) + 1;
151 av_dlog(s->
avctx,
"image x=%d y=%d w=%d h=%d\n", left, top, width, height);
153 if (has_local_palette) {
154 pal_size = 1 << bits_per_pixel;
187 if (width <= 0 || height <= 0) {
217 frame->
linesize[0] /
sizeof(uint32_t), left, top, width, height);
226 code_size = bytestream2_get_byteu(&s->
gb);
234 linesize = frame->
linesize[0] /
sizeof(uint32_t);
235 ptr1 = (uint32_t *)frame->
data[0] + top * linesize + left;
241 if (count != width) {
249 for (px = ptr, idx = s->
idx_line; px < pr; px++, idx++) {
254 if (is_interleaved) {
263 ptr = ptr1 + linesize * y1;
272 ptr = ptr1 + linesize;
300 int ext_code, ext_len, gce_flags, gce_transparent_index;
307 ext_code = bytestream2_get_byteu(&s->
gb);
308 ext_len = bytestream2_get_byteu(&s->
gb);
310 av_dlog(s->
avctx,
"ext_code=0x%x len=%d\n", ext_code, ext_len);
322 gce_flags = bytestream2_get_byteu(&s->
gb);
324 gce_transparent_index = bytestream2_get_byteu(&s->
gb);
325 if (gce_flags & 0x01)
331 av_dlog(s->
avctx,
"gce_flags=%x tcolor=%d disposal=%d\n",
337 av_dlog(s->
avctx,
"invalid value in gce_disposal (%d). Using default value of 0.\n", ext_len);
340 ext_len = bytestream2_get_byteu(&s->
gb);
352 ext_len = bytestream2_get_byteu(&s->
gb);
363 int background_color_index;
379 v = bytestream2_get_byteu(&s->
gb);
383 background_color_index = bytestream2_get_byteu(&s->
gb);
384 n = bytestream2_get_byteu(&s->
gb);
390 av_dlog(s->
avctx,
"screen_w=%d screen_h=%d bpp=%d global_palette=%d\n",
411 int code = bytestream2_get_byte(&s->
gb);
460 if (avpkt->
size >= 6) {
524 {
"trans_color",
"color value (ARGB) that is used instead of transparent color",
549 .priv_class = &decoder_class,