Go to the documentation of this file.
52 int bpp,
int w,
int h)
59 for(y = 0; y <
h; y ++) {
74 uint8_t *
out = outbuf;
75 uint8_t *ptr = pic->
data[0];
77 for(
i=0;
i <
h;
i++) {
87 const AVFrame *p,
int *got_packet)
90 int bpp, picsize, datasize = -1,
ret,
i;
111 for (
i = 0;
i < 256;
i++)
121 for (
i = 0;
i < 256;
i++)
172 memcpy(
out,
"\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26);
182 if (avctx->
width > 0xffff || avctx->
height > 0xffff) {
190 #define OFFSET(x) offsetof(TargaContext, x)
191 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
AVPixelFormat
Pixel format.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static const AVClass targa_class
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
const AVCodec ff_targa_encoder
@ AV_PIX_FMT_BGR24
packed RGB 8:8:8, 24bpp, BGRBGR...
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
static int rle(uint8_t *dst, const uint8_t *src, int compressed_size, int uncompressed_size)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
static int targa_encode_rle(uint8_t *outbuf, int out_size, const AVFrame *pic, int bpp, int w, int h)
RLE compress the image, with maximum size of out_size.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static enum AVPixelFormat pix_fmts[]
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
static av_cold int targa_encode_init(AVCodecContext *avctx)
const char * av_default_item_name(void *ptr)
Return the context name.
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align)
Return the size in bytes of the amount of data required to store an image with the given parameters.
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
@ AV_PIX_FMT_RGB555LE
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined
#define i(width, name, range_min, range_max)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *ptr, int bpp, int w, int add_rep, int xor_rep, int add_raw, int xor_raw)
RLE compress the row, with maximum size of out_size.
main external API structure.
static int targa_encode_normal(uint8_t *outbuf, const AVFrame *pic, int bpp, int w, int h)
This structure stores compressed data.
int width
picture width / height.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and allocate data.
static const AVOption options[]
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.