51 int bpp,
int w,
int h)
58 for(y = 0; y <
h; y ++) {
76 for(i=0; i <
h; i++) {
86 const AVFrame *p,
int *got_packet)
89 int bpp, picsize, datasize = -1,
ret,
i;
98 memset(pkt->
data, 0, 12);
104 out = pkt->
data + 18;
110 for (i = 0; i < 256; i++)
118 pkt->
data[7] = pal_bpp;
120 for (i = 0; i < 256; i++)
152 bpp = pkt->
data[16] >> 3;
155 #if FF_API_CODER_TYPE 178 memcpy(out,
"\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26);
189 if (avctx->
width > 0xffff || avctx->
height > 0xffff) {
194 #if FF_API_CODED_FRAME 204 #define OFFSET(x) offsetof(TargaContext, x) 205 #define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM 225 .priv_class = &targa_class,
static const AVOption options[]
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
This structure describes decoded (raw) audio or video data.
#define LIBAVUTIL_VERSION_INT
static av_cold int init(AVCodecContext *avctx)
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc)
Return the number of bits per pixel used by the pixel format described by pixdesc.
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
const char * av_default_item_name(void *ptr)
Return the context name.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
targa file common definitions
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
8 bits with AV_PIX_FMT_RGB32 palette
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
int bits_per_coded_sample
bits per sample/pixel from the demuxer (needed for huffyuv).
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
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...
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
const char * name
Name of the codec implementation.
int flags
A combination of AV_PKT_FLAG values.
common internal API header
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
static const AVClass targa_class
packed RGB 8:8:8, 24bpp, BGRBGR...
attribute_deprecated int coder_type
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
Describe the class of an AVClass context structure.
static enum AVPixelFormat pix_fmts[]
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.
static int targa_encode_normal(uint8_t *outbuf, const AVFrame *pic, int bpp, int w, int h)
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal api header.
#define FF_CODER_TYPE_RAW
attribute_deprecated AVFrame * coded_frame
the picture in the bitstream
static av_cold int targa_encode_init(AVCodecContext *avctx)
#define FF_ENABLE_DEPRECATION_WARNINGS
int key_frame
1 -> keyframe, 0-> not
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.
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.
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
AVPixelFormat
Pixel format.
This structure stores compressed data.