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;
288 "This colors format is not supported\n");
310 packet_size = avctx->
height * bytes_per_row * 2 +
324 bytestream_put_le16(&ptr, 0x4949);
325 bytestream_put_le16(&ptr, 42);
328 bytestream_put_le32(&ptr, 0);
357 zlen = bytes_per_row * s->
rps;
365 for (j = 0; j < s->
rps; j++) {
368 memcpy(zbuf + zn, s->
yuv_line, bytes_per_row);
371 memcpy(zbuf + j * bytes_per_row,
393 for (i = 0; i < s->
height; i++) {
408 ptr, bytes_per_row, s->
compr);
460 uint16_t pal[256 * 3];
461 for (i = 0; i < 256; i++) {
462 uint32_t rgb = *(uint32_t *) (p->
data[1] + i * 4);
463 pal[i] = ((rgb >> 16) & 0xff) * 257;
464 pal[i + 256] = ((rgb >> 8) & 0xff) * 257;
465 pal[i + 512] = (rgb & 0xff) * 257;
473 uint32_t refbw[12] = { 15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1 };
480 bytestream_put_le32(&offset, ptr - pkt->
data);
488 bytestream_put_le32(&ptr, 0);
495 return ret < 0 ? ret : 0;
525 #define OFFSET(x) offsetof(TiffEncoderContext, x)
526 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM