targa.c File Reference
#include "libavutil/intreadwrite.h"
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "targa.h"

Go to the source code of this file.

Data Structures

struct  TargaContext
 

Macros

#define CHECK_BUFFER_SIZE(buf, buf_end, needed, where)
 

Typedefs

typedef struct TargaContext TargaContext
 

Functions

static int targa_decode_rle (AVCodecContext *avctx, TargaContext *s, const uint8_t *src, int src_size, uint8_t *dst, int w, int h, int stride, int bpp)
 
static int decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
 
static av_cold int targa_init (AVCodecContext *avctx)
 
static av_cold int targa_end (AVCodecContext *avctx)
 

Variables

AVCodec ff_targa_decoder
 

Macro Definition Documentation

#define CHECK_BUFFER_SIZE (   buf,
  buf_end,
  needed,
  where 
)
Value:
if(needed > buf_end - buf){ \
av_log(avctx, AV_LOG_ERROR, "Problem: unexpected end of data while reading " where "\n"); \
return -1; \
} \
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:140
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:111

Definition at line 37 of file targa.c.

Referenced by decode_frame(), and targa_decode_rle().

Typedef Documentation

typedef struct TargaContext TargaContext

Function Documentation

static int decode_frame ( AVCodecContext avctx,
void data,
int *  data_size,
AVPacket avpkt 
)
static

Definition at line 101 of file targa.c.

static int targa_decode_rle ( AVCodecContext avctx,
TargaContext s,
const uint8_t *  src,
int  src_size,
uint8_t *  dst,
int  w,
int  h,
int  stride,
int  bpp 
)
static

Definition at line 43 of file targa.c.

Referenced by decode_frame().

static av_cold int targa_end ( AVCodecContext avctx)
static

Definition at line 266 of file targa.c.

static av_cold int targa_init ( AVCodecContext avctx)
static

Definition at line 257 of file targa.c.

Variable Documentation

AVCodec ff_targa_decoder
Initial value:
= {
.name = "targa",
.priv_data_size = sizeof(TargaContext),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("Truevision Targa image"),
}
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:228
static int init(AVCodecParserContext *s)
Definition: h264_parser.c:336
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:719
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:191
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
Definition: targa.c:101
static av_cold int targa_init(AVCodecContext *avctx)
Definition: targa.c:257
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:327
struct TargaContext TargaContext
static av_cold int targa_end(AVCodecContext *avctx)
Definition: targa.c:266

Definition at line 275 of file targa.c.