#include "config.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "encode.h"
#include "lzw.h"
#include "rle.h"
#include "tiff.h"
#include "tiff_common.h"
#include "version.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()
static void tnput |
( |
uint8_t ** |
p, |
|
|
int |
n, |
|
|
const uint8_t * |
val, |
|
|
enum TiffTypes |
type, |
|
|
int |
flip |
|
) |
| |
|
static |
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 107 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 127 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 171 of file tiffenc.c.
Referenced by encode_frame().
◆ pack_yuv()
◆ encode_frame()
according to CCIR Recommendation 601.1
Definition at line 246 of file tiffenc.c.
◆ encode_init()
◆ encode_close()
◆ type_sizes2
const uint8_t type_sizes2[14] |
|
static |
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 49 of file tiffenc.c.
Referenced by add_entry(), and tnput().
◆ options
◆ tiffenc_class
Initial value:= {
.class_name = "TIFF encoder",
}
Definition at line 564 of file tiffenc.c.
◆ ff_tiff_encoder
Initial value:= {
.p.name = "tiff",
},
}
Definition at line 571 of file tiffenc.c.
static av_cold int encode_close(AVCodecContext *avctx)
AVPixelFormat
Pixel format.
@ 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 FF_CODEC_ENCODE_CB(func)
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define CODEC_LONG_NAME(str)
@ 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.
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
int(* init)(AVBSFContext *ctx)
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
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
#define AV_OPT_FLAG_VIDEO_PARAM
@ 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)