FFmpeg
Data Structures | Functions | Variables
sgidec.c File Reference
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "internal.h"
#include "sgi.h"

Go to the source code of this file.

Data Structures

struct  SgiState
 

Functions

static int expand_rle_row8 (SgiState *s, uint8_t *out_buf, int len, int pixelstride)
 Expand an RLE row into a channel. More...
 
static int expand_rle_row16 (SgiState *s, uint16_t *out_buf, int len, int pixelstride)
 
static int read_rle_sgi (uint8_t *out_buf, SgiState *s)
 Read a run length encoded SGI image. More...
 
static int read_uncompressed_sgi (unsigned char *out_buf, SgiState *s)
 Read an uncompressed SGI image. More...
 
static int decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
 
static av_cold int sgi_decode_init (AVCodecContext *avctx)
 

Variables

const FFCodec ff_sgi_decoder
 

Function Documentation

◆ expand_rle_row8()

static int expand_rle_row8 ( 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, else return error code.

Definition at line 47 of file sgidec.c.

Referenced by read_rle_sgi().

◆ expand_rle_row16()

static int expand_rle_row16 ( SgiState s,
uint16_t *  out_buf,
int  len,
int  pixelstride 
)
static

Definition at line 85 of file sgidec.c.

Referenced by read_rle_sgi().

◆ 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 code.

Definition at line 131 of file sgidec.c.

Referenced by decode_frame().

◆ read_uncompressed_sgi()

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

Read an uncompressed SGI image.

Parameters
out_bufoutput buffer
sthe current image state
Returns
0 if read success, else return error code.

Definition at line 169 of file sgidec.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame p,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 202 of file sgidec.c.

◆ sgi_decode_init()

static av_cold int sgi_decode_init ( AVCodecContext avctx)
static

Definition at line 280 of file sgidec.c.

Variable Documentation

◆ ff_sgi_decoder

const FFCodec ff_sgi_decoder
Initial value:
= {
.p.name = "sgi",
.p.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_SGI,
.priv_data_size = sizeof(SgiState),
.init = sgi_decode_init,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 289 of file sgidec.c.

SgiState
Definition: sgidec.c:29
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:254
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: codec_internal.h:31
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_SGI
@ AV_CODEC_ID_SGI
Definition: codec_id.h:151
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: sgidec.c:202
sgi_decode_init
static av_cold int sgi_decode_init(AVCodecContext *avctx)
Definition: sgidec.c:280