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 "codec_internal.h"
#include "decode.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, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold int sga_decode_end (AVCodecContext *avctx)
 

Variables

const FFCodec ff_sga_decoder
 

Macro Definition Documentation

◆ PALDATA_FOLLOWS_TILEDATA

#define PALDATA_FOLLOWS_TILEDATA   4

Definition at line 28 of file sga.c.

◆ HAVE_COMPRESSED_TILEMAP

#define HAVE_COMPRESSED_TILEMAP   32

Definition at line 29 of file sga.c.

◆ HAVE_TILEMAP

#define HAVE_TILEMAP   128

Definition at line 30 of file sga.c.

Function Documentation

◆ sga_decode_init()

static av_cold int sga_decode_init ( AVCodecContext avctx)
static

Definition at line 61 of file sga.c.

◆ decode_palette()

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

Definition at line 67 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 106 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 128 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,
AVFrame frame,
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 512 of file sga.c.

Variable Documentation

◆ ff_sga_decoder

const FFCodec ff_sga_decoder
Initial value:
= {
.p.name = "sga",
CODEC_LONG_NAME("Digital Pictures SGA Video"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SGAVideoContext),
.close = sga_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 525 of file sga.c.

sga_decode_end
static av_cold int sga_decode_end(AVCodecContext *avctx)
Definition: sga.c:512
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
AV_CODEC_ID_SGA_VIDEO
@ AV_CODEC_ID_SGA_VIDEO
Definition: codec_id.h:310
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
sga_decode_frame
static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: sga.c:308
SGAVideoContext
Definition: sga.c:32
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:61