FFmpeg
Macros | Functions | Variables
sgidec.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.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. More...
 
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. More...
 
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. More...
 
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)]

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 36 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 70 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 116 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 155 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 177 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,
}

Definition at line 268 of file sgidec.c.

out
FILE * out
Definition: movenc.c:55
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
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
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_CODEC_ID_SGI
@ AV_CODEC_ID_SGI
Definition: codec_id.h:153
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *p, int *got_frame, AVPacket *avpkt)
Definition: sgidec.c:177