45 #define TIFF_MAX_ENTRY 32
49 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4
112 flip ^= ((
int[]) { 0, 0, 0, 1, 3, 3 })[type];
115 *(*p)++ = val[i ^
flip];
134 bytestream_put_le16(&entries_ptr, tag);
135 bytestream_put_le16(&entries_ptr, type);
136 bytestream_put_le32(&entries_ptr, count);
139 tnput(&entries_ptr, count, ptr_val, type, 0);
141 bytestream_put_le32(&entries_ptr, *s->
buf - s->
buf_start);
143 tnput(s->
buf, count, ptr_val, type, 0);
176 if (compress(dst, &zlen, src, n) != Z_OK) {
190 src, 1, n, 2, 0xff, -1, 0);
206 for (i = 0; i < w; i++) {
215 for (i = 0; i < w; i++) {
239 const AVFrame *pict,
int *got_packet)
249 uint32_t
res[2] = { s->
dpi, 1 };
252 int is_yuv = 0,
alpha = 0;
253 int shift_h, shift_v;
302 "This colors format is not supported\n");
335 bytestream_put_le16(&ptr, 0x4949);
336 bytestream_put_le16(&ptr, 42);
339 bytestream_put_le32(&ptr, 0);
366 zlen = bytes_per_row * s->
rps;
374 for (j = 0; j < s->
rps; j++) {
377 memcpy(zbuf + zn, s->
yuv_line, bytes_per_row);
380 memcpy(zbuf + j * bytes_per_row,
402 for (i = 0; i < s->
height; i++) {
417 ptr, bytes_per_row, s->
compr);
462 uint16_t pal[256 * 3];
463 for (i = 0; i < 256; i++) {
464 uint32_t rgb = *(uint32_t *) (p->
data[1] + i * 4);
465 pal[i] = ((rgb >> 16) & 0xff) * 257;
466 pal[i + 256] = ((rgb >> 8) & 0xff) * 257;
467 pal[i + 512] = (rgb & 0xff) * 257;
475 uint32_t refbw[12] = { 15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1 };
482 bytestream_put_le32(&offset, ptr - pkt->
data);
490 bytestream_put_le32(&ptr, 0);
497 return ret < 0 ? ret : 0;
511 #define OFFSET(x) offsetof(TiffEncoderContext, x)
512 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM