#include "libavutil/imgutils.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "config.h"
#include "bytestream.h"
#include "internal.h"
#include "tiff.h"
#include "rle.h"
#include "lzw.h"
#include "put_bits.h"
Go to the source code of this file.
Data Structures | |
| struct | TiffEncoderContext |
Defines | |
| #define | TIFF_MAX_ENTRY 32 |
| #define | OFFSET(x) offsetof(TiffEncoderContext, x) |
| #define | VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
Functions | |
| static int | check_size (TiffEncoderContext *s, uint64_t need) |
| Check free space in buffer. | |
| static void | tnput (uint8_t **p, int n, const uint8_t *val, enum TiffTypes type, int flip) |
| Put n values to buffer. | |
| static void | add_entry (TiffEncoderContext *s, enum TiffTags tag, enum TiffTypes type, int count, const void *ptr_val) |
| Add entry to directory in tiff header. | |
| static void | add_entry1 (TiffEncoderContext *s, enum TiffTags tag, enum TiffTypes type, int val) |
| static int | encode_strip (TiffEncoderContext *s, const int8_t *src, uint8_t *dst, int n, int compr) |
| Encode one strip in tiff file. | |
| static void | pack_yuv (TiffEncoderContext *s, uint8_t *dst, int lnum) |
| static av_cold int | encode_init (AVCodecContext *avctx) |
| static int | encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) |
| static av_cold int | encode_close (AVCodecContext *avctx) |
Variables | |
| static const uint8_t | type_sizes2 [14] |
| sizes of various TIFF field types (string size = 1) | |
| static const AVOption | options [] |
| static const AVClass | tiffenc_class |
| AVCodec | ff_tiff_encoder |
Definition in file tiffenc.c.
| #define OFFSET | ( | x | ) | offsetof(TiffEncoderContext, x) |
| #define TIFF_MAX_ENTRY 32 |
| #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM |
| static void add_entry | ( | TiffEncoderContext * | s, | |
| enum TiffTags | tag, | |||
| enum TiffTypes | type, | |||
| int | count, | |||
| const void * | ptr_val | |||
| ) | [static] |
Add entry to directory in tiff header.
| s | Tiff context | |
| tag | tag that identifies the entry | |
| type | entry type | |
| count | the number of values | |
| ptr_val | pointer to values |
Definition at line 127 of file tiffenc.c.
Referenced by add_entry1(), and encode_frame().
| static void add_entry1 | ( | TiffEncoderContext * | s, | |
| enum TiffTags | tag, | |||
| enum TiffTypes | type, | |||
| int | val | |||
| ) | [static] |
| static int check_size | ( | TiffEncoderContext * | s, | |
| uint64_t | need | |||
| ) | [inline, static] |
Check free space in buffer.
| s | Tiff context | |
| need | Needed bytes |
Definition at line 88 of file tiffenc.c.
Referenced by add_entry(), encode_frame(), and encode_strip().
| static av_cold int encode_close | ( | AVCodecContext * | avctx | ) | [static] |
| static int encode_frame | ( | AVCodecContext * | avctx, | |
| AVPacket * | pkt, | |||
| const AVFrame * | pict, | |||
| int * | got_packet | |||
| ) | [static] |
| static av_cold int encode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static int encode_strip | ( | TiffEncoderContext * | s, | |
| const int8_t * | src, | |||
| uint8_t * | dst, | |||
| int | n, | |||
| int | compr | |||
| ) | [static] |
Encode one strip in tiff file.
| s | Tiff context | |
| src | input buffer | |
| dst | output buffer | |
| n | size of input buffer | |
| compr | compression method |
Definition at line 167 of file tiffenc.c.
Referenced by encode_frame().
| static void pack_yuv | ( | TiffEncoderContext * | s, | |
| uint8_t * | dst, | |||
| int | lnum | |||
| ) | [static] |
| static void tnput | ( | uint8_t ** | p, | |
| int | n, | |||
| const uint8_t * | val, | |||
| enum TiffTypes | type, | |||
| int | flip | |||
| ) | [static] |
Put n values to buffer.
| p | pointer to pointer to output buffer | |
| n | number of values | |
| val | pointer to values | |
| type | type of values | |
| flip | = 0 - normal copy, >0 - flip |
Definition at line 107 of file tiffenc.c.
Referenced by add_entry().
Initial value:
{
.name = "tiff",
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_TIFF,
.priv_data_size = sizeof(TiffEncoderContext),
.init = encode_init,
.encode2 = encode_frame,
.close = encode_close,
.pix_fmts = (const enum PixelFormat[]) {
PIX_FMT_RGB24, PIX_FMT_PAL8, PIX_FMT_GRAY8,
PIX_FMT_GRAY8A, PIX_FMT_GRAY16LE,
PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE,
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV440P, PIX_FMT_YUV444P,
PIX_FMT_YUV410P, PIX_FMT_YUV411P, PIX_FMT_RGB48LE,
PIX_FMT_RGBA, PIX_FMT_RGBA64LE,
PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
.priv_class = &tiffenc_class,
}
Initial value:
{
{"dpi", "set the image resolution (in dpi)", OFFSET(dpi), AV_OPT_TYPE_INT, {.i64 = 72}, 1, 0x10000, AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_ENCODING_PARAM},
{ "compression_algo", NULL, OFFSET(compr), AV_OPT_TYPE_INT, {.i64 = TIFF_PACKBITS}, TIFF_RAW, TIFF_DEFLATE, VE, "compression_algo" },
{ "packbits", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = TIFF_PACKBITS}, 0, 0, VE, "compression_algo" },
{ "raw", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = TIFF_RAW}, 0, 0, VE, "compression_algo" },
{ "lzw", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = TIFF_LZW}, 0, 0, VE, "compression_algo" },
{ NULL },
}
const AVClass tiffenc_class [static] |
Initial value:
{
.class_name = "TIFF encoder",
.item_name = av_default_item_name,
.option = options,
.version = LIBAVUTIL_VERSION_INT,
}
const uint8_t type_sizes2[14] [static] |
Initial value:
{
0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4
}
Definition at line 47 of file tiffenc.c.
Referenced by add_entry(), and tnput().
1.5.8