45 #define TIFF_MAX_ENTRY 32
49 0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4
113 flip ^= ((
int[]) {0, 0, 0, 1, 3, 3})[type];
116 *(*p)++ = val[i ^
flip];
136 bytestream_put_le16(&entries_ptr, tag);
137 bytestream_put_le16(&entries_ptr, type);
138 bytestream_put_le32(&entries_ptr, count);
141 tnput(&entries_ptr, count, ptr_val, type, 0);
143 bytestream_put_le32(&entries_ptr, *s->
buf - s->
buf_start);
145 tnput(s->
buf, count, ptr_val, type, 0);
178 if (compress(dst, &zlen, src, n) != Z_OK) {
207 for (i = 0; i < w; i++){
216 for (i = 0; i < w; i++){
240 const AVFrame *pict,
int *got_packet)
250 uint32_t res[2] = { s->
dpi, 1 };
253 int is_yuv = 0, alpha = 0;
254 int shift_h, shift_v;
303 "This colors format is not supported\n");
331 bytestream_put_le16(&ptr, 0x4949);
332 bytestream_put_le16(&ptr, 42);
335 bytestream_put_le32(&ptr, 0);
362 zlen = bytes_per_row * s->
rps;
370 for (j = 0; j < s->
rps; j++) {
373 memcpy(zbuf + zn, s->
yuv_line, bytes_per_row);
377 memcpy(zbuf + j * bytes_per_row,
399 for (i = 0; i < s->
height; i++) {
414 ptr, bytes_per_row, s->
compr);
458 uint16_t pal[256 * 3];
459 for (i = 0; i < 256; i++) {
460 uint32_t rgb = *(uint32_t *) (p->
data[1] + i * 4);
461 pal[i] = ((rgb >> 16) & 0xff) * 257;
462 pal[i + 256] = ((rgb >> 8 ) & 0xff) * 257;
463 pal[i + 512] = ( rgb & 0xff) * 257;
471 uint32_t refbw[12] = {15, 1, 235, 1, 128, 1, 240, 1, 128, 1, 240, 1};
477 bytestream_put_le32(&offset, ptr - pkt->
data);
485 bytestream_put_le32(&ptr, 0);
492 return ret < 0 ? ret : 0;
506 #define OFFSET(x) offsetof(TiffEncoderContext, x)
507 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM