00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00027 #include "avcodec.h"
00028 #if CONFIG_ZLIB
00029 #include <zlib.h>
00030 #endif
00031 #include "lzw.h"
00032 #include "tiff.h"
00033 #include "faxcompr.h"
00034 #include "libavutil/common.h"
00035 #include "libavutil/intreadwrite.h"
00036 #include "libavutil/imgutils.h"
00037
00038 typedef struct TiffContext {
00039 AVCodecContext *avctx;
00040 AVFrame picture;
00041
00042 int width, height;
00043 unsigned int bpp, bppcount;
00044 uint32_t palette[256];
00045 int palette_is_set;
00046 int le;
00047 enum TiffCompr compr;
00048 int invert;
00049 int fax_opts;
00050 int predictor;
00051 int fill_order;
00052
00053 int strips, rps, sstype;
00054 int sot;
00055 const uint8_t* stripdata;
00056 const uint8_t* stripsizes;
00057 int stripsize, stripoff;
00058 LZWState *lzw;
00059 } TiffContext;
00060
00061 static int tget_short(const uint8_t **p, int le){
00062 int v = le ? AV_RL16(*p) : AV_RB16(*p);
00063 *p += 2;
00064 return v;
00065 }
00066
00067 static int tget_long(const uint8_t **p, int le){
00068 int v = le ? AV_RL32(*p) : AV_RB32(*p);
00069 *p += 4;
00070 return v;
00071 }
00072
00073 static int tget(const uint8_t **p, int type, int le){
00074 switch(type){
00075 case TIFF_BYTE : return *(*p)++;
00076 case TIFF_SHORT: return tget_short(p, le);
00077 case TIFF_LONG : return tget_long (p, le);
00078 default : return -1;
00079 }
00080 }
00081
00082 #if CONFIG_ZLIB
00083 static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src, int size)
00084 {
00085 z_stream zstream;
00086 int zret;
00087
00088 memset(&zstream, 0, sizeof(zstream));
00089 zstream.next_in = src;
00090 zstream.avail_in = size;
00091 zstream.next_out = dst;
00092 zstream.avail_out = *len;
00093 zret = inflateInit(&zstream);
00094 if (zret != Z_OK) {
00095 av_log(NULL, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
00096 return zret;
00097 }
00098 zret = inflate(&zstream, Z_SYNC_FLUSH);
00099 inflateEnd(&zstream);
00100 *len = zstream.total_out;
00101 return zret == Z_STREAM_END ? Z_OK : zret;
00102 }
00103 #endif
00104
00105 static void av_always_inline horizontal_fill(unsigned int bpp, uint8_t* dst,
00106 int usePtr, const uint8_t *src,
00107 uint8_t c, int width, int offset)
00108 {
00109 int i;
00110
00111 if (bpp == 2) {
00112 for (i = 0; i < width; i++) {
00113 dst[(i+offset)*4+0] = (usePtr ? src[i] : c) >> 6;
00114 dst[(i+offset)*4+1] = (usePtr ? src[i] : c) >> 4 & 0x3;
00115 dst[(i+offset)*4+2] = (usePtr ? src[i] : c) >> 2 & 0x3;
00116 dst[(i+offset)*4+3] = (usePtr ? src[i] : c) & 0x3;
00117 }
00118 } else if (bpp == 4) {
00119 for (i = 0; i < width; i++) {
00120 dst[(i+offset)*2+0] = (usePtr ? src[i] : c) >> 4;
00121 dst[(i+offset)*2+1] = (usePtr ? src[i] : c) & 0xF;
00122 }
00123 } else {
00124 if (usePtr) {
00125 memcpy(dst + offset, src, width);
00126 } else {
00127 memset(dst + offset, c, width);
00128 }
00129 }
00130 }
00131
00132 static void av_always_inline split_nibbles(uint8_t *dst, const uint8_t *src,
00133 int width)
00134 {
00135 while (--width >= 0) {
00136
00137 dst[width * 2 + 1] = src[width] & 0xF;
00138 dst[width * 2 + 0] = src[width] >> 4;
00139 }
00140 }
00141
00142 static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uint8_t *src, int size, int lines){
00143 int c, line, pixels, code;
00144 const uint8_t *ssrc = src;
00145 int width = ((s->width * s->bpp) + 7) >> 3;
00146 #if CONFIG_ZLIB
00147 uint8_t *zbuf; unsigned long outlen;
00148
00149 if(s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE){
00150 int ret;
00151 outlen = width * lines;
00152 zbuf = av_malloc(outlen);
00153 ret = tiff_uncompress(zbuf, &outlen, src, size);
00154 if(ret != Z_OK){
00155 av_log(s->avctx, AV_LOG_ERROR, "Uncompressing failed (%lu of %lu) with error %d\n", outlen, (unsigned long)width * lines, ret);
00156 av_free(zbuf);
00157 return -1;
00158 }
00159 src = zbuf;
00160 for(line = 0; line < lines; line++){
00161 if(s->bpp == 4){
00162 split_nibbles(dst, src, width);
00163 }else{
00164 memcpy(dst, src, width);
00165 }
00166 dst += stride;
00167 src += width;
00168 }
00169 av_free(zbuf);
00170 return 0;
00171 }
00172 #endif
00173 if(s->compr == TIFF_LZW){
00174 if(ff_lzw_decode_init(s->lzw, 8, src, size, FF_LZW_TIFF) < 0){
00175 av_log(s->avctx, AV_LOG_ERROR, "Error initializing LZW decoder\n");
00176 return -1;
00177 }
00178 }
00179 if(s->compr == TIFF_CCITT_RLE || s->compr == TIFF_G3 || s->compr == TIFF_G4){
00180 int i, ret = 0;
00181 uint8_t *src2 = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
00182
00183 if(!src2 || (unsigned)size + FF_INPUT_BUFFER_PADDING_SIZE < (unsigned)size){
00184 av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");
00185 return -1;
00186 }
00187 if(s->fax_opts & 2){
00188 av_log(s->avctx, AV_LOG_ERROR, "Uncompressed fax mode is not supported (yet)\n");
00189 av_free(src2);
00190 return -1;
00191 }
00192 if(!s->fill_order){
00193 memcpy(src2, src, size);
00194 }else{
00195 for(i = 0; i < size; i++)
00196 src2[i] = av_reverse[src[i]];
00197 }
00198 memset(src2+size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
00199 switch(s->compr){
00200 case TIFF_CCITT_RLE:
00201 case TIFF_G3:
00202 case TIFF_G4:
00203 ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride, s->compr, s->fax_opts);
00204 break;
00205 }
00206 av_free(src2);
00207 return ret;
00208 }
00209 for(line = 0; line < lines; line++){
00210 if(src - ssrc > size){
00211 av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");
00212 return -1;
00213 }
00214 switch(s->compr){
00215 case TIFF_RAW:
00216 if (ssrc + size - src < width)
00217 return AVERROR_INVALIDDATA;
00218 if (!s->fill_order) {
00219 horizontal_fill(s->bpp, dst, 1, src, 0, width, 0);
00220 } else {
00221 int i;
00222 for (i = 0; i < width; i++)
00223 dst[i] = av_reverse[src[i]];
00224 }
00225 src += width;
00226 break;
00227 case TIFF_PACKBITS:
00228 for(pixels = 0; pixels < width;){
00229 code = (int8_t)*src++;
00230 if(code >= 0){
00231 code++;
00232 if(pixels + code > width){
00233 av_log(s->avctx, AV_LOG_ERROR, "Copy went out of bounds\n");
00234 return -1;
00235 }
00236 horizontal_fill(s->bpp, dst, 1, src, 0, code, pixels);
00237 src += code;
00238 pixels += code;
00239 }else if(code != -128){
00240 code = (-code) + 1;
00241 if(pixels + code > width){
00242 av_log(s->avctx, AV_LOG_ERROR, "Run went out of bounds\n");
00243 return -1;
00244 }
00245 c = *src++;
00246 horizontal_fill(s->bpp, dst, 0, NULL, c, code, pixels);
00247 pixels += code;
00248 }
00249 }
00250 break;
00251 case TIFF_LZW:
00252 pixels = ff_lzw_decode(s->lzw, dst, width);
00253 if(pixels < width){
00254 av_log(s->avctx, AV_LOG_ERROR, "Decoded only %i bytes of %i\n", pixels, width);
00255 return -1;
00256 }
00257 if(s->bpp == 4)
00258 split_nibbles(dst, dst, width);
00259 break;
00260 }
00261 dst += stride;
00262 }
00263 return 0;
00264 }
00265
00266 static int init_image(TiffContext *s)
00267 {
00268 int i, ret;
00269 uint32_t *pal;
00270
00271 switch (s->bpp * 10 + s->bppcount) {
00272 case 11:
00273 s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
00274 break;
00275 case 21:
00276 case 41:
00277 case 81:
00278 s->avctx->pix_fmt = PIX_FMT_PAL8;
00279 break;
00280 case 243:
00281 s->avctx->pix_fmt = PIX_FMT_RGB24;
00282 break;
00283 case 161:
00284 s->avctx->pix_fmt = PIX_FMT_GRAY16BE;
00285 break;
00286 case 324:
00287 s->avctx->pix_fmt = PIX_FMT_RGBA;
00288 break;
00289 case 483:
00290 s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE;
00291 break;
00292 default:
00293 av_log(s->avctx, AV_LOG_ERROR,
00294 "This format is not supported (bpp=%d, bppcount=%d)\n",
00295 s->bpp, s->bppcount);
00296 return AVERROR_INVALIDDATA;
00297 }
00298 if (s->width != s->avctx->width || s->height != s->avctx->height) {
00299 if ((ret = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
00300 return ret;
00301 avcodec_set_dimensions(s->avctx, s->width, s->height);
00302 }
00303 if (s->picture.data[0])
00304 s->avctx->release_buffer(s->avctx, &s->picture);
00305 if ((ret = s->avctx->get_buffer(s->avctx, &s->picture)) < 0) {
00306 av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
00307 return ret;
00308 }
00309 if (s->avctx->pix_fmt == PIX_FMT_PAL8) {
00310 if (s->palette_is_set) {
00311 memcpy(s->picture.data[1], s->palette, sizeof(s->palette));
00312 } else {
00313
00314 pal = (uint32_t *) s->picture.data[1];
00315 for (i = 0; i < 1<<s->bpp; i++)
00316 pal[i] = 0xFF << 24 | i * 255 / ((1<<s->bpp) - 1) * 0x010101;
00317 }
00318 }
00319 return 0;
00320 }
00321
00322 static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *buf, const uint8_t *end_buf)
00323 {
00324 int tag, type, count, off, value = 0;
00325 int i, j;
00326 uint32_t *pal;
00327 const uint8_t *rp, *gp, *bp;
00328
00329 if (end_buf - buf < 12)
00330 return -1;
00331 tag = tget_short(&buf, s->le);
00332 type = tget_short(&buf, s->le);
00333 count = tget_long(&buf, s->le);
00334 off = tget_long(&buf, s->le);
00335
00336 if(count == 1){
00337 switch(type){
00338 case TIFF_BYTE:
00339 case TIFF_SHORT:
00340 buf -= 4;
00341 value = tget(&buf, type, s->le);
00342 buf = NULL;
00343 break;
00344 case TIFF_LONG:
00345 value = off;
00346 buf = NULL;
00347 break;
00348 case TIFF_STRING:
00349 if(count <= 4){
00350 buf -= 4;
00351 break;
00352 }
00353 default:
00354 value = -1;
00355 buf = start + off;
00356 }
00357 }else if(type_sizes[type] * count <= 4){
00358 buf -= 4;
00359 }else{
00360 buf = start + off;
00361 }
00362
00363 if(buf && (buf < start || buf > end_buf)){
00364 av_log(s->avctx, AV_LOG_ERROR, "Tag referencing position outside the image\n");
00365 return -1;
00366 }
00367
00368 switch(tag){
00369 case TIFF_WIDTH:
00370 s->width = value;
00371 break;
00372 case TIFF_HEIGHT:
00373 s->height = value;
00374 break;
00375 case TIFF_BPP:
00376 s->bppcount = count;
00377 if(count > 4){
00378 av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count);
00379 return -1;
00380 }
00381 if(count == 1) s->bpp = value;
00382 else{
00383 switch(type){
00384 case TIFF_BYTE:
00385 s->bpp = (off & 0xFF) + ((off >> 8) & 0xFF) + ((off >> 16) & 0xFF) + ((off >> 24) & 0xFF);
00386 break;
00387 case TIFF_SHORT:
00388 case TIFF_LONG:
00389 s->bpp = 0;
00390 for(i = 0; i < count && buf < end_buf; i++) s->bpp += tget(&buf, type, s->le);
00391 break;
00392 default:
00393 s->bpp = -1;
00394 }
00395 }
00396 break;
00397 case TIFF_SAMPLES_PER_PIXEL:
00398 if (count != 1) {
00399 av_log(s->avctx, AV_LOG_ERROR,
00400 "Samples per pixel requires a single value, many provided\n");
00401 return AVERROR_INVALIDDATA;
00402 }
00403 if (s->bppcount == 1)
00404 s->bpp *= value;
00405 s->bppcount = value;
00406 break;
00407 case TIFF_COMPR:
00408 s->compr = value;
00409 s->predictor = 0;
00410 switch(s->compr){
00411 case TIFF_RAW:
00412 case TIFF_PACKBITS:
00413 case TIFF_LZW:
00414 case TIFF_CCITT_RLE:
00415 break;
00416 case TIFF_G3:
00417 case TIFF_G4:
00418 s->fax_opts = 0;
00419 break;
00420 case TIFF_DEFLATE:
00421 case TIFF_ADOBE_DEFLATE:
00422 #if CONFIG_ZLIB
00423 break;
00424 #else
00425 av_log(s->avctx, AV_LOG_ERROR, "Deflate: ZLib not compiled in\n");
00426 return -1;
00427 #endif
00428 case TIFF_JPEG:
00429 case TIFF_NEWJPEG:
00430 av_log(s->avctx, AV_LOG_ERROR, "JPEG compression is not supported\n");
00431 return -1;
00432 default:
00433 av_log(s->avctx, AV_LOG_ERROR, "Unknown compression method %i\n", s->compr);
00434 return -1;
00435 }
00436 break;
00437 case TIFF_ROWSPERSTRIP:
00438 if(type == TIFF_LONG && value == -1)
00439 value = s->avctx->height;
00440 if(value < 1){
00441 av_log(s->avctx, AV_LOG_ERROR, "Incorrect value of rows per strip\n");
00442 return -1;
00443 }
00444 s->rps = value;
00445 break;
00446 case TIFF_STRIP_OFFS:
00447 if(count == 1){
00448 s->stripdata = NULL;
00449 s->stripoff = value;
00450 }else
00451 s->stripdata = start + off;
00452 s->strips = count;
00453 if(s->strips == 1) s->rps = s->height;
00454 s->sot = type;
00455 if(s->stripdata > end_buf){
00456 av_log(s->avctx, AV_LOG_ERROR, "Tag referencing position outside the image\n");
00457 return -1;
00458 }
00459 break;
00460 case TIFF_STRIP_SIZE:
00461 if(count == 1){
00462 s->stripsizes = NULL;
00463 s->stripsize = value;
00464 s->strips = 1;
00465 }else{
00466 s->stripsizes = start + off;
00467 }
00468 s->strips = count;
00469 s->sstype = type;
00470 if(s->stripsizes > end_buf){
00471 av_log(s->avctx, AV_LOG_ERROR, "Tag referencing position outside the image\n");
00472 return -1;
00473 }
00474 break;
00475 case TIFF_PREDICTOR:
00476 s->predictor = value;
00477 break;
00478 case TIFF_INVERT:
00479 switch(value){
00480 case 0:
00481 s->invert = 1;
00482 break;
00483 case 1:
00484 s->invert = 0;
00485 break;
00486 case 2:
00487 case 3:
00488 break;
00489 default:
00490 av_log(s->avctx, AV_LOG_ERROR, "Color mode %d is not supported\n", value);
00491 return -1;
00492 }
00493 break;
00494 case TIFF_FILL_ORDER:
00495 if(value < 1 || value > 2){
00496 av_log(s->avctx, AV_LOG_ERROR, "Unknown FillOrder value %d, trying default one\n", value);
00497 value = 1;
00498 }
00499 s->fill_order = value - 1;
00500 break;
00501 case TIFF_PAL:
00502 pal = (uint32_t *) s->palette;
00503 off = type_sizes[type];
00504 if (count / 3 > 256 || end_buf - buf < count / 3 * off * 3)
00505 return -1;
00506 rp = buf;
00507 gp = buf + count / 3 * off;
00508 bp = buf + count / 3 * off * 2;
00509 off = (type_sizes[type] - 1) << 3;
00510 for(i = 0; i < count / 3; i++){
00511 j = 0xff << 24;
00512 j |= (tget(&rp, type, s->le) >> off) << 16;
00513 j |= (tget(&gp, type, s->le) >> off) << 8;
00514 j |= tget(&bp, type, s->le) >> off;
00515 pal[i] = j;
00516 }
00517 s->palette_is_set = 1;
00518 break;
00519 case TIFF_PLANAR:
00520 if(value == 2){
00521 av_log(s->avctx, AV_LOG_ERROR, "Planar format is not supported\n");
00522 return -1;
00523 }
00524 break;
00525 case TIFF_T4OPTIONS:
00526 if(s->compr == TIFF_G3)
00527 s->fax_opts = value;
00528 break;
00529 case TIFF_T6OPTIONS:
00530 if(s->compr == TIFF_G4)
00531 s->fax_opts = value;
00532 break;
00533 default:
00534 av_log(s->avctx, AV_LOG_DEBUG, "Unknown or unsupported tag %d/0X%0X\n", tag, tag);
00535 }
00536 return 0;
00537 }
00538
00539 static int decode_frame(AVCodecContext *avctx,
00540 void *data, int *data_size,
00541 AVPacket *avpkt)
00542 {
00543 const uint8_t *buf = avpkt->data;
00544 int buf_size = avpkt->size;
00545 TiffContext * const s = avctx->priv_data;
00546 AVFrame *picture = data;
00547 AVFrame * const p= (AVFrame*)&s->picture;
00548 const uint8_t *orig_buf = buf, *end_buf = buf + buf_size;
00549 unsigned off;
00550 int id, le, ret;
00551 int i, j, entries;
00552 int stride;
00553 unsigned soff, ssize;
00554 uint8_t *dst;
00555
00556
00557 if (end_buf - buf < 8)
00558 return AVERROR_INVALIDDATA;
00559 id = AV_RL16(buf); buf += 2;
00560 if(id == 0x4949) le = 1;
00561 else if(id == 0x4D4D) le = 0;
00562 else{
00563 av_log(avctx, AV_LOG_ERROR, "TIFF header not found\n");
00564 return -1;
00565 }
00566 s->le = le;
00567 s->invert = 0;
00568 s->compr = TIFF_RAW;
00569 s->fill_order = 0;
00570
00571
00572 if(tget_short(&buf, le) != 42){
00573 av_log(avctx, AV_LOG_ERROR, "The answer to life, universe and everything is not correct!\n");
00574 return -1;
00575 }
00576
00577 off = tget_long(&buf, le);
00578 if (off >= UINT_MAX - 14 || end_buf - orig_buf < off + 14) {
00579 av_log(avctx, AV_LOG_ERROR, "IFD offset is greater than image size\n");
00580 return AVERROR_INVALIDDATA;
00581 }
00582 buf = orig_buf + off;
00583 entries = tget_short(&buf, le);
00584 for(i = 0; i < entries; i++){
00585 if(tiff_decode_tag(s, orig_buf, buf, end_buf) < 0)
00586 return -1;
00587 buf += 12;
00588 }
00589 if(!s->stripdata && !s->stripoff){
00590 av_log(avctx, AV_LOG_ERROR, "Image data is missing\n");
00591 return -1;
00592 }
00593
00594 if ((ret = init_image(s)) < 0)
00595 return ret;
00596
00597 if(s->strips == 1 && !s->stripsize){
00598 av_log(avctx, AV_LOG_WARNING, "Image data size missing\n");
00599 s->stripsize = buf_size - s->stripoff;
00600 }
00601 stride = p->linesize[0];
00602 dst = p->data[0];
00603 for(i = 0; i < s->height; i += s->rps){
00604 if(s->stripsizes) {
00605 if (s->stripsizes >= end_buf)
00606 return AVERROR_INVALIDDATA;
00607 ssize = tget(&s->stripsizes, s->sstype, s->le);
00608 } else
00609 ssize = s->stripsize;
00610
00611 if(s->stripdata){
00612 if (s->stripdata >= end_buf)
00613 return AVERROR_INVALIDDATA;
00614 soff = tget(&s->stripdata, s->sot, s->le);
00615 }else
00616 soff = s->stripoff;
00617
00618 if (soff > buf_size || ssize > buf_size - soff) {
00619 av_log(avctx, AV_LOG_ERROR, "Invalid strip size/offset\n");
00620 return -1;
00621 }
00622 if(tiff_unpack_strip(s, dst, stride, orig_buf + soff, ssize, FFMIN(s->rps, s->height - i)) < 0)
00623 break;
00624 dst += s->rps * stride;
00625 }
00626 if(s->predictor == 2){
00627 dst = p->data[0];
00628 soff = s->bpp >> 3;
00629 ssize = s->width * soff;
00630 if (s->avctx->pix_fmt == PIX_FMT_RGB48LE) {
00631 for (i = 0; i < s->height; i++) {
00632 for (j = soff; j < ssize; j += 2)
00633 AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + j - soff));
00634 dst += stride;
00635 }
00636 } else if (s->avctx->pix_fmt == PIX_FMT_RGB48BE) {
00637 for (i = 0; i < s->height; i++) {
00638 for (j = soff; j < ssize; j += 2)
00639 AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + j - soff));
00640 dst += stride;
00641 }
00642 } else {
00643 for(i = 0; i < s->height; i++) {
00644 for(j = soff; j < ssize; j++)
00645 dst[j] += dst[j - soff];
00646 dst += stride;
00647 }
00648 }
00649 }
00650
00651 if(s->invert){
00652 dst = s->picture.data[0];
00653 for(i = 0; i < s->height; i++){
00654 for(j = 0; j < s->picture.linesize[0]; j++)
00655 dst[j] = (s->avctx->pix_fmt == PIX_FMT_PAL8 ? (1<<s->bpp) - 1 : 255) - dst[j];
00656 dst += s->picture.linesize[0];
00657 }
00658 }
00659 *picture= *(AVFrame*)&s->picture;
00660 *data_size = sizeof(AVPicture);
00661
00662 return buf_size;
00663 }
00664
00665 static av_cold int tiff_init(AVCodecContext *avctx){
00666 TiffContext *s = avctx->priv_data;
00667
00668 s->width = 0;
00669 s->height = 0;
00670 s->avctx = avctx;
00671 avcodec_get_frame_defaults((AVFrame*)&s->picture);
00672 avctx->coded_frame= (AVFrame*)&s->picture;
00673 ff_lzw_decode_open(&s->lzw);
00674 ff_ccitt_unpack_init();
00675
00676 return 0;
00677 }
00678
00679 static av_cold int tiff_end(AVCodecContext *avctx)
00680 {
00681 TiffContext * const s = avctx->priv_data;
00682
00683 ff_lzw_decode_close(&s->lzw);
00684 if(s->picture.data[0])
00685 avctx->release_buffer(avctx, &s->picture);
00686 return 0;
00687 }
00688
00689 AVCodec ff_tiff_decoder = {
00690 .name = "tiff",
00691 .type = AVMEDIA_TYPE_VIDEO,
00692 .id = CODEC_ID_TIFF,
00693 .priv_data_size = sizeof(TiffContext),
00694 .init = tiff_init,
00695 .close = tiff_end,
00696 .decode = decode_frame,
00697 .capabilities = CODEC_CAP_DR1,
00698 .long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
00699 };