33 #define DEFAULT_TRANSPARENCY_INDEX 0x1f
37 int transparent_color_index = -1;
38 unsigned i, smallest_alpha = 0xff;
44 const uint32_t
v = palette[i];
45 if (v >> 24 < smallest_alpha) {
46 smallest_alpha = v >> 24;
47 transparent_color_index = i;
50 return smallest_alpha < 128 ? transparent_color_index : -1;
54 int loop_count, uint32_t *
palette)
60 if (sar.
num > 0 && sar.
den > 0) {
61 aspect = sar.
num * 64LL / sar.
den - 15;
62 if (aspect < 0 || aspect > 255)
77 for (i = 0; i < 256; i++) {
78 const uint32_t
v = palette[i] & 0xffffff;
88 if (loop_count >= 0 ) {
93 avio_write(pb,
"NETSCAPE2.0",
sizeof(
"NETSCAPE2.0") - 1);
122 "GIF muxer supports only a single video GIF stream.\n");
169 avio_w8(pb, 1<<2 | (bcid >= 0));
226 #define OFFSET(x) offsetof(GIFContext, x)
227 #define ENC AV_OPT_FLAG_ENCODING_PARAM
229 {
"loop",
"Number of times to loop the output: -1 - no loop, 0 - infinite loop",
OFFSET(
loop),
231 {
"final_delay",
"Force delay (in centiseconds) after the last frame",
OFFSET(last_delay),
246 .mime_type =
"image/gif",
254 .priv_class = &gif_muxer_class,