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.
AVPixelFormat
Pixel format.
This structure stores compressed data.