45 #define TIFF_MAX_ENTRY 32
49 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4
111 flip ^= ((
int[]) { 0, 0, 0, 1, 3, 3 })[type];
114 *(*p)++ = val[i ^
flip];
133 bytestream_put_le16(&entries_ptr, tag);
134 bytestream_put_le16(&entries_ptr, type);
135 bytestream_put_le32(&entries_ptr, count);
138 tnput(&entries_ptr, count, ptr_val, type, 0);
140 bytestream_put_le32(&entries_ptr, *s->
buf - s->
buf_start);
142 tnput(s->
buf, count, ptr_val, type, 0);
175 if (compress(dst, &zlen, src, n) != Z_OK) {
189 src, 1, n, 2, 0xff, -1, 0);
205 for (i = 0; i < w; i++) {
214 for (i = 0; i < w; i++) {
226 const AVFrame *pict,
int *got_packet)
236 uint32_t
res[2] = { s->
dpi, 1 };
239 int is_yuv = 0,
alpha = 0;
240 int shift_h, shift_v;
287 "This colors format is not supported\n");
320 bytestream_put_le16(&ptr, 0x4949);
321 bytestream_put_le16(&ptr, 42);
324 bytestream_put_le32(&ptr, 0);
351 zlen = bytes_per_row * s->
rps;
359 for (j = 0; j < s->
rps; j++) {
362 memcpy(zbuf + zn, s->
yuv_line, bytes_per_row);
365 memcpy(zbuf + j * bytes_per_row,
387 for (i = 0; i < s->
height; i++) {
402 ptr, bytes_per_row, s->
compr);
447 uint16_t pal[256 * 3];
448 for (i = 0; i < 256; i++) {
449 uint32_t rgb = *(uint32_t *) (p->
data[1] + i * 4);
450 pal[i] = ((rgb >> 16) & 0xff) * 257;
451 pal[i + 256] = ((rgb >> 8) & 0xff) * 257;
452 pal[i + 512] = (rgb & 0xff) * 257;
460 uint32_t refbw[12] = { 15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1 };
467 bytestream_put_le32(&offset, ptr - pkt->
data);
475 bytestream_put_le32(&ptr, 0);
482 return ret < 0 ? ret : 0;
512 #define OFFSET(x) offsetof(TiffEncoderContext, x)
513 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM