39 #define BITSTREAM_WRITER_LE
63 for (y = 0; y < h; y++) {
64 for (x = 0; x < w; x++)
82 int x_start = 0, y_start = 0, trans = -1;
90 int x_end = avctx->
width - 1,
94 while (y_start < y_end) {
95 if (memcmp(ref + y_start*ref_linesize, buf + y_start*linesize,
width))
99 while (y_end > y_start) {
100 if (memcmp(ref + y_end*ref_linesize, buf + y_end*linesize,
width))
104 height = y_end + 1 - y_start;
107 while (x_start < x_end) {
109 for (y = y_start; y < y_end; y++) {
110 if (ref[y*ref_linesize + x_start] != buf[y*linesize + x_start]) {
119 while (x_end > x_start) {
121 for (y = y_start; y < y_end; y++) {
122 if (ref[y*ref_linesize + x_end] != buf[y*linesize + x_end]) {
131 width = x_end + 1 - x_start;
139 bytestream_put_le16(bytestream, x_start);
140 bytestream_put_le16(bytestream, y_start);
141 bytestream_put_le16(bytestream,
width);
142 bytestream_put_le16(bytestream,
height);
145 bytestream_put_byte(bytestream, 0x00);
148 bytestream_put_byte(bytestream, 1<<7 | 0x7);
150 const uint32_t
v = palette[i];
151 bytestream_put_be24(bytestream, v);
166 pal_exdata[trans*4 + 3*!HAVE_BIGENDIAN] = 0x00;
170 bytestream_put_byte(bytestream, 0x08);
175 ptr = buf + y_start*linesize + x_start;
180 for (y = 0; y <
height; y++) {
182 for (x = 0; x <
width; x++)
183 if (ref[x] == ptr[x])
190 for (y = 0; y <
height; y++) {
200 bytestream_put_byte(bytestream, size);
201 if (end - *bytestream < size)
207 bytestream_put_byte(bytestream, 0x00);
215 if (avctx->
width > 65535 || avctx->
height > 65535) {
234 const AVFrame *pict,
int *got_packet)
244 outbuf_ptr = pkt->
data;
256 palette = (uint32_t*)p->
data[1];
289 #define OFFSET(x) offsetof(GIFContext, x)
290 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM