47 int bpp,
int w,
int h)
54 for(y = 0; y < h; y ++) {
72 for(i=0; i < h; i++) {
82 const AVFrame *p,
int *got_packet)
84 int bpp, picsize, datasize = -1, ret;
87 if(avctx->
width > 0xffff || avctx->
height > 0xffff) {
98 memset(pkt->
data, 0, 12);
126 bpp = pkt->
data[16] >> 3;
128 out = pkt->
data + 18;
146 memcpy(out,
"\0\0\0\0\0\0\0\0TRUEVISION-XFILE.", 26);
This structure describes decoded (raw) audio or video data.
AVFrame * coded_frame
the picture in the bitstream
#define FF_CODER_TYPE_RAW
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
targa file common definitions
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
struct TargaContext TargaContext
static int init(AVCodecParserContext *s)
#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...
void av_log(void *avcl, int level, const char *fmt,...)
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, see ?_TYPE below.
int width
picture width / height.
int ff_alloc_packet(AVPacket *avpkt, int size)
Check AVPacket size and/or allocate data.
packed RGB 8:8:8, 24bpp, BGRBGR...
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
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)
common internal api header.
static av_cold int targa_encode_init(AVCodecContext *avctx)
int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height)
Calculate the size in bytes that a picture of the given width and height would occupy if stored in th...
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.