FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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

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

Definition at line 204 of file targaenc.c.

Definition at line 205 of file targaenc.c.

Function Documentation

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().

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().

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

Definition at line 85 of file targaenc.c.

static av_cold int targa_encode_init ( AVCodecContext avctx)
static

Definition at line 187 of file targaenc.c.

Variable Documentation

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

Definition at line 206 of file targaenc.c.

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:206
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
av_default_item_name

Definition at line 212 of file targaenc.c.

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[]){
},
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined ...
Definition: pixfmt.h:116
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:73
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:179
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:96
static const AVClass targa_class
Definition: targaenc.c:212
packed RGB 8:8:8, 24bpp, BGRBGR...
Definition: pixfmt.h:65
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:262
Y , 8bpp.
Definition: pixfmt.h:70
static av_cold int targa_encode_init(AVCodecContext *avctx)
Definition: targaenc.c:187
AVPixelFormat
Pixel format.
Definition: pixfmt.h:60

Definition at line 219 of file targaenc.c.