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);
143 tnput(s->
buf, count, ptr_val, type, 0);
156 type ==
TIFF_SHORT ? (
void *)&w : (
void *)&dw);
178 if (compress(dst, &zlen, src, n) != Z_OK) {
192 src, 1, n, 2, 0xff, -1, 0);
208 for (i = 0; i < w; i++) {
217 for (i = 0; i < w; i++) {
228 #define ADD_ENTRY(s, tag, type, count, ptr_val) \
230 ret = add_entry(s, tag, type, count, ptr_val); \
235 #define ADD_ENTRY1(s, tag, type, val) \
237 ret = add_entry1(s, tag, type, val); \
243 const AVFrame *pict,
int *got_packet)
253 uint32_t res[2] = { s->
dpi, 1 };
256 int is_yuv = 0,
alpha = 0;
257 int shift_h, shift_v;
306 "This colors format is not supported\n");
328 packet_size = avctx->
height * bytes_per_row * 2 +
344 bytestream_put_le16(&ptr, 0x4949);
345 bytestream_put_le16(&ptr, 42);
348 bytestream_put_le32(&ptr, 0);
377 zlen = bytes_per_row * s->
rps;
385 for (j = 0; j < s->
rps; j++) {
388 memcpy(zbuf + zn, s->
yuv_line, bytes_per_row);
391 memcpy(zbuf + j * bytes_per_row,
413 for (i = 0; i < s->
height; i++) {
428 ptr, bytes_per_row, s->
compr);
480 uint16_t pal[256 * 3];
481 for (i = 0; i < 256; i++) {
482 uint32_t rgb = *(uint32_t *) (p->
data[1] + i * 4);
483 pal[i] = ((rgb >> 16) & 0xff) * 257;
484 pal[i + 256] = ((rgb >> 8) & 0xff) * 257;
485 pal[i + 512] = (rgb & 0xff) * 257;
493 uint32_t refbw[12] = { 15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1 };
500 bytestream_put_le32(&offset, ptr - pkt->
data);
508 bytestream_put_le32(&ptr, 0);
515 return ret < 0 ? ret : 0;
545 #define OFFSET(x) offsetof(TiffEncoderContext, x)
546 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM