Libav
Data Structures | Macros | Functions | Variables
targaenc.c File Reference
#include <string.h>
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "internal.h"
#include "rle.h"
#include "targa.h"

Go to the source code of this file.

Data Structures

struct  TargaContext
 

Macros

#define OFFSET(x)   offsetof(TargaContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

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. More...
 
static int targa_encode_normal (uint8_t *outbuf, const AVFrame *pic, int bpp, int w, int h)
 
static int targa_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
 
static av_cold int targa_encode_init (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass targa_class
 
AVCodec ff_targa_encoder
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(TargaContext, x)

Definition at line 181 of file targaenc.c.

◆ VE

Definition at line 182 of file targaenc.c.

Function Documentation

◆ targa_encode_rle()

static int targa_encode_rle ( uint8_t outbuf,
int  out_size,
const AVFrame pic,
int  bpp,
int  w,
int  h 
)
static

RLE compress the image, with maximum size of out_size.

Parameters
outbufOutput buffer
out_sizeMaximum output size
picImage to compress
bppBytes per pixel
wImage width
hImage height
Returns
Size of output in bytes, or -1 if larger than out_size

Definition at line 50 of file targaenc.c.

Referenced by targa_encode_frame().

◆ targa_encode_normal()

static int targa_encode_normal ( uint8_t outbuf,
const AVFrame pic,
int  bpp,
int  w,
int  h 
)
static

Definition at line 70 of file targaenc.c.

Referenced by targa_encode_frame().

◆ targa_encode_frame()

static int targa_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame p,
int *  got_packet 
)
static

Definition at line 85 of file targaenc.c.

◆ targa_encode_init()

static av_cold int targa_encode_init ( AVCodecContext avctx)
static

Definition at line 164 of file targaenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "rle", "Use run-length compression", OFFSET(rle), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ NULL },
}
#define VE
Definition: targaenc.c:182
#define OFFSET(x)
Definition: targaenc.c:181
NULL
Definition: eval.c:55

Definition at line 183 of file targaenc.c.

◆ targa_class

const AVClass targa_class
static
Initial value:
= {
.class_name = "targa",
.item_name = av_default_item_name,
.option = options,
}
static const AVOption options[]
Definition: targaenc.c:183
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:55

Definition at line 189 of file targaenc.c.

◆ ff_targa_encoder

AVCodec ff_targa_encoder
Initial value:
= {
.name = "targa",
.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
.priv_data_size = sizeof(TargaContext),
.priv_class = &targa_class,
.encode2 = targa_encode_frame,
.pix_fmts = (const enum AVPixelFormat[]){
},
}
packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 ...
Definition: pixfmt.h:112
static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet)
Definition: targaenc.c:85
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:148
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:92
static const AVClass targa_class
Definition: targaenc.c:189
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:62
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:257
Y , 8bpp.
Definition: pixfmt.h:67
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:582
static av_cold int targa_encode_init(AVCodecContext *avctx)
Definition: targaenc.c:164
AVPixelFormat
Pixel format.
Definition: pixfmt.h:57

Definition at line 196 of file targaenc.c.