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");
308 packet_size = avctx->
height * ((avctx->
width * s->
bpp + 7) >> 3) * 2 +
322 bytestream_put_le16(&ptr, 0x4949);
323 bytestream_put_le16(&ptr, 42);
326 bytestream_put_le32(&ptr, 0);
353 zlen = bytes_per_row * s->
rps;
361 for (j = 0; j < s->
rps; j++) {
364 memcpy(zbuf + zn, s->
yuv_line, bytes_per_row);
367 memcpy(zbuf + j * bytes_per_row,
389 for (i = 0; i < s->
height; i++) {
404 ptr, bytes_per_row, s->
compr);
456 uint16_t pal[256 * 3];
457 for (i = 0; i < 256; i++) {
458 uint32_t rgb = *(uint32_t *) (p->
data[1] + i * 4);
459 pal[i] = ((rgb >> 16) & 0xff) * 257;
460 pal[i + 256] = ((rgb >> 8) & 0xff) * 257;
461 pal[i + 512] = (rgb & 0xff) * 257;
469 uint32_t refbw[12] = { 15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1 };
476 bytestream_put_le32(&offset, ptr - pkt->
data);
484 bytestream_put_le32(&ptr, 0);
491 return ret < 0 ? ret : 0;
521 #define OFFSET(x) offsetof(TiffEncoderContext, x)
522 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM