sgidec.c File Reference
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "sgi.h"

Go to the source code of this file.

Data Structures

struct  SgiState

Typedefs

typedef struct SgiState SgiState

Functions

static int expand_rle_row (SgiState *s, uint8_t *out_buf, int len, int pixelstride)
 Expand an RLE row into a channel.
static int read_rle_sgi (uint8_t *out_buf, SgiState *s)
 Read a run length encoded SGI image.
static int read_uncompressed_sgi (unsigned char *out_buf, uint8_t *out_end, SgiState *s)
 Read an uncompressed SGI image.
static int decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
static av_cold int sgi_init (AVCodecContext *avctx)
static av_cold int sgi_end (AVCodecContext *avctx)

Variables

AVCodec ff_sgi_decoder

Typedef Documentation

typedef struct SgiState SgiState

Function Documentation

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

Definition at line 156 of file sgidec.c.

static int expand_rle_row ( SgiState s,
uint8_t *  out_buf,
int  len,
int  pixelstride 
)
static

Expand an RLE row into a channel.

Parameters
sthe current image state
out_bufPoints to one line after the output buffer.
lenlength of out_buf in bytes
pixelstridepixel stride of input buffer
Returns
size of output in bytes, -1 if buffer overflows

Definition at line 46 of file sgidec.c.

Referenced by read_rle_sgi().

static int read_rle_sgi ( uint8_t *  out_buf,
SgiState s 
)
static

Read a run length encoded SGI image.

Parameters
out_bufoutput buffer
sthe current image state
Returns
0 if no error, else return error number.

Definition at line 88 of file sgidec.c.

Referenced by decode_frame().

static int read_uncompressed_sgi ( unsigned char *  out_buf,
uint8_t *  out_end,
SgiState s 
)
static

Read an uncompressed SGI image.

Parameters
out_bufoutput buffer
out_endend ofoutput buffer
sthe current image state
Returns
0 if read success, otherwise return -1.

Definition at line 123 of file sgidec.c.

Referenced by decode_frame().

static av_cold int sgi_end ( AVCodecContext avctx)
static

Definition at line 257 of file sgidec.c.

static av_cold int sgi_init ( AVCodecContext avctx)
static

Definition at line 246 of file sgidec.c.

Variable Documentation

AVCodec ff_sgi_decoder
Initial value:
{
.name = "sgi",
.id = CODEC_ID_SGI,
.priv_data_size = sizeof(SgiState),
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
}

Definition at line 267 of file sgidec.c.