#include "config.h"
#include "libavutil/imgutils.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "bytestream.h"
#include "internal.h"
#include "lzw.h"
#include "put_bits.h"
#include "rle.h"
#include "tiff.h"
Go to the source code of this file.
|
static int | check_size (TiffEncoderContext *s, uint64_t need) |
| Check free space in buffer. More...
|
|
static void | tnput (uint8_t **p, int n, const uint8_t *val, enum TiffTypes type, int flip) |
| Put n values to buffer. More...
|
|
static int | add_entry (TiffEncoderContext *s, enum TiffTags tag, enum TiffTypes type, int count, const void *ptr_val) |
| Add entry to directory in tiff header. More...
|
|
static int | 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. More...
|
|
static void | pack_yuv (TiffEncoderContext *s, const AVFrame *p, uint8_t *dst, int lnum) |
|
static int | encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet) |
|
static av_cold int | encode_init (AVCodecContext *avctx) |
|
static av_cold int | encode_close (AVCodecContext *avctx) |
|
TIFF image encoder
- Author
- Bartlomiej Wolowiec
Definition in file tiffenc.c.
◆ TIFF_MAX_ENTRY
#define TIFF_MAX_ENTRY 32 |
◆ ADD_ENTRY
#define ADD_ENTRY |
( |
|
s, |
|
|
|
tag, |
|
|
|
type, |
|
|
|
count, |
|
|
|
ptr_val |
|
) |
| |
◆ ADD_ENTRY1
◆ OFFSET
◆ VE
◆ check_size()
◆ tnput()
Put n values to buffer.
- Parameters
-
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 106 of file tiffenc.c.
Referenced by add_entry().
◆ add_entry()
Add entry to directory in tiff header.
- Parameters
-
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 126 of file tiffenc.c.
Referenced by add_entry1().
◆ add_entry1()
◆ encode_strip()
Encode one strip in tiff file.
- Parameters
-
s | Tiff context |
src | input buffer |
dst | output buffer |
n | size of input buffer |
compr | compression method |
- Returns
- number of output bytes. If an output error is encountered, a negative value corresponding to an AVERROR error code is returned.
Definition at line 170 of file tiffenc.c.
Referenced by encode_frame().
◆ pack_yuv()
◆ encode_frame()
according to CCIR Recommendation 601.1
Definition at line 245 of file tiffenc.c.
◆ encode_init()
◆ encode_close()
◆ type_sizes2
Initial value:= {
0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4
}
sizes of various TIFF field types (string size = 1)
Definition at line 48 of file tiffenc.c.
Referenced by add_entry(), and tnput().
◆ options
◆ tiffenc_class
Initial value:= {
.class_name = "TIFF encoder",
}
Definition at line 570 of file tiffenc.c.
◆ ff_tiff_encoder
static av_cold int encode_close(AVCodecContext *avctx)
AVPixelFormat
Pixel format.
static av_cold int init(AVCodecContext *avctx)
#define AV_OPT_FLAG_VIDEO_PARAM
@ AV_PIX_FMT_MONOWHITE
Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb.
@ AV_PIX_FMT_YUV440P
planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
static int add_entry1(TiffEncoderContext *s, enum TiffTags tag, enum TiffTypes type, int val)
static double val(void *priv, double ch)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
static enum AVPixelFormat pix_fmts[]
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
@ AV_PIX_FMT_GRAY8A
alias for AV_PIX_FMT_YA8
#define LIBAVUTIL_VERSION_INT
@ AV_PIX_FMT_RGB48LE
packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as lit...
@ AV_PIX_FMT_YA16LE
16 bits gray, 16 bits alpha (little-endian)
@ AV_PIX_FMT_MONOBLACK
Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb.
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PIX_FMT_RGBA64LE
packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is st...
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int add_entry(TiffEncoderContext *s, enum TiffTags tag, enum TiffTypes type, int count, const void *ptr_val)
Add entry to directory in tiff header.
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
static const AVClass tiffenc_class
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
static const AVOption options[]
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_GRAY16LE
Y , 16bpp, little-endian.
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ AV_PIX_FMT_YUV411P
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
static av_cold int encode_init(AVCodecContext *avctx)