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 "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, 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 181 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 201 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_palmapdata()

static int decode_palmapdata ( AVCodecContext avctx)
static

Definition at line 251 of file sga.c.

Referenced by sga_decode_frame().

◆ decode_tiledata()

static int decode_tiledata ( AVCodecContext avctx)
static

Definition at line 275 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 309 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 FFCodec ff_sga_decoder
Initial value:
= {
.p.name = "sga",
.p.long_name = NULL_IF_CONFIG_SMALL("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 522 of file sga.c.

init
static int init
Definition: av_tx.c:47
sga_decode_end
static av_cold int sga_decode_end(AVCodecContext *avctx)
Definition: sga.c:509
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:260
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
sga_decode_frame
static int sga_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: sga.c:309
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