FFmpeg
Loading...
Searching...
No Matches
sgidec.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "libavutil/attributes.h"
#include "sgi.h"

Go to the source code of this file.

Macros

#define MAP(in_idx, out_idx)
 

Functions

static int expand_rle_row8 (void *logctx, uint8_t *out_buf, GetByteContext *g, unsigned width)
 Expand an RLE row into a channel.
 
static int expand_rle_row16 (void *logctx, uint16_t *out_buf, GetByteContext *g, unsigned width)
 
static int read_rle_sgi (void *logctx, uint8_t *out[4], ptrdiff_t stride[4], GetByteContext *g, unsigned width, int height, unsigned nb_components, unsigned bytes_per_channel)
 Read a run length encoded SGI image.
 
static int read_uncompressed_sgi (uint8_t *const out[4], const ptrdiff_t stride[4], GetByteContext *g, unsigned width, int height, unsigned nb_components, unsigned bytes_per_channel)
 Read an uncompressed SGI image.
 
static int decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
 

Variables

const FFCodec ff_sgi_decoder
 

Macro Definition Documentation

◆ MAP

#define MAP ( in_idx,
out_idx )
Value:
out[(in_idx)] = p->data[(out_idx)]; \
linesize[(in_idx)] = p->linesize[(out_idx)]
static FILE * out
Definition movenc.c:55

Referenced by decode_frame().

Function Documentation

◆ expand_rle_row8()

static int expand_rle_row8 ( void * logctx,
uint8_t * out_buf,
GetByteContext * g,
unsigned width )
static

Expand an RLE row into a channel.

Parameters
logctxa logcontext
out_bufPoints to one line after the output buffer.
gGetByteContext used to read input from
widthlength of out_buf in nb of elements
Returns
nb of elements written, else return error code.

Definition at line 37 of file sgidec.c.

Referenced by read_rle_sgi().

◆ expand_rle_row16()

static int expand_rle_row16 ( void * logctx,
uint16_t * out_buf,
GetByteContext * g,
unsigned width )
static

Definition at line 71 of file sgidec.c.

Referenced by read_rle_sgi().

◆ read_rle_sgi()

static int read_rle_sgi ( void * logctx,
uint8_t * out[4],
ptrdiff_t stride[4],
GetByteContext * g,
unsigned width,
int height,
unsigned nb_components,
unsigned bytes_per_channel )
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 117 of file sgidec.c.

Referenced by decode_frame().

◆ read_uncompressed_sgi()

static int read_uncompressed_sgi ( uint8_t *const out[4],
const ptrdiff_t stride[4],
GetByteContext * g,
unsigned width,
int height,
unsigned nb_components,
unsigned bytes_per_channel )
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 156 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 178 of file sgidec.c.

Variable Documentation

◆ ff_sgi_decoder

const FFCodec ff_sgi_decoder
Initial value:
= {
.p.name = "sgi",
CODEC_LONG_NAME("SGI image"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_SGI,
.p.capabilities = AV_CODEC_CAP_DR1,
}
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_SGI
Definition codec_id.h:151
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837

Definition at line 269 of file sgidec.c.