FFmpeg
Data Structures | Macros | Functions | Variables
sga.c File Reference
#include "libavutil/common.h"
#include "avcodec.h"
#include "get_bits.h"
#include "bytestream.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  SGAVideoContext
 

Macros

#define PALDATA_FOLLOWS_TILEDATA   4
 
#define HAVE_COMPRESSED_TILEMAP   32
 
#define HAVE_TILEMAP   128
 

Functions

static av_cold int sga_decode_init (AVCodecContext *avctx)
 
static int decode_palette (GetByteContext *gb, uint32_t *pal)
 
static int decode_index_palmap (SGAVideoContext *s, AVFrame *frame)
 
static int decode_index_tilemap (SGAVideoContext *s, AVFrame *frame)
 
static int decode_index (SGAVideoContext *s, AVFrame *frame)
 
static int lzss_decompress (AVCodecContext *avctx, GetByteContext *gb, uint8_t *dst, int dst_size, int shift, int plus)
 
static int decode_palmapdata (AVCodecContext *avctx)
 
static int decode_tiledata (AVCodecContext *avctx)
 
static int sga_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int sga_decode_end (AVCodecContext *avctx)
 

Variables

const AVCodec ff_sga_decoder
 

Macro Definition Documentation

◆ PALDATA_FOLLOWS_TILEDATA

#define PALDATA_FOLLOWS_TILEDATA   4

Definition at line 27 of file sga.c.

◆ HAVE_COMPRESSED_TILEMAP

#define HAVE_COMPRESSED_TILEMAP   32

Definition at line 28 of file sga.c.

◆ HAVE_TILEMAP

#define HAVE_TILEMAP   128

Definition at line 29 of file sga.c.

Function Documentation

◆ sga_decode_init()

static av_cold int sga_decode_init ( AVCodecContext avctx)
static

Definition at line 60 of file sga.c.

◆ decode_palette()

static int decode_palette ( GetByteContext gb,
uint32_t *  pal 
)
static

Definition at line 66 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_index_palmap()

static int decode_index_palmap ( SGAVideoContext s,
AVFrame frame 
)
static

Definition at line 105 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_index_tilemap()

static int decode_index_tilemap ( SGAVideoContext s,
AVFrame frame 
)
static

Definition at line 127 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_index()

static int decode_index ( SGAVideoContext s,
AVFrame frame 
)
static

Definition at line 180 of file sga.c.

Referenced by sga_decode_frame().

◆ lzss_decompress()

static int lzss_decompress ( AVCodecContext avctx,
GetByteContext gb,
uint8_t *  dst,
int  dst_size,
int  shift,
int  plus 
)
static

Definition at line 200 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_palmapdata()

static int decode_palmapdata ( AVCodecContext avctx)
static

Definition at line 250 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_tiledata()

static int decode_tiledata ( AVCodecContext avctx)
static

Definition at line 274 of file sga.c.

Referenced by sga_decode_frame().

◆ sga_decode_frame()

static int sga_decode_frame ( AVCodecContext avctx,
void *  data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 308 of file sga.c.

◆ sga_decode_end()

static av_cold int sga_decode_end ( AVCodecContext avctx)
static

Definition at line 509 of file sga.c.

Variable Documentation

◆ ff_sga_decoder

const AVCodec ff_sga_decoder
Initial value:
= {
.name = "sga",
.long_name = NULL_IF_CONFIG_SMALL("Digital Pictures SGA Video"),
.priv_data_size = sizeof(SGAVideoContext),
.close = sga_decode_end,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
}

Definition at line 522 of file sga.c.

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: internal.h:42
init
static int init
Definition: av_tx.c:47
sga_decode_frame
static int sga_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: sga.c:308
sga_decode_end
static av_cold int sga_decode_end(AVCodecContext *avctx)
Definition: sga.c:509
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
AV_CODEC_ID_SGA_VIDEO
@ AV_CODEC_ID_SGA_VIDEO
Definition: codec_id.h:309
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
SGAVideoContext
Definition: sga.c:31
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
sga_decode_init
static av_cold int sga_decode_init(AVCodecContext *avctx)
Definition: sga.c:60