FFmpeg
Macros | Functions | Variables
scpr.c File Reference
#include <string.h>
#include "libavutil/mem.h"
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "scpr.h"
#include "scpr3.h"
#include "scpr3.c"

Go to the source code of this file.

Macros

#define TOP   0x01000000
 
#define BOT   0x010000
 

Functions

static void init_rangecoder (RangeCoder *rc, GetByteContext *gb)
 
static void reinit_tables (SCPRContext *s)
 
static int decode (GetByteContext *gb, RangeCoder *rc, uint32_t cumFreq, uint32_t freq, uint32_t total_freq)
 
static int get_freq (RangeCoder *rc, uint32_t total_freq, uint32_t *freq)
 
static int decode0 (GetByteContext *gb, RangeCoder *rc, uint32_t cumFreq, uint32_t freq, uint32_t total_freq)
 
static int get_freq0 (RangeCoder *rc, uint32_t total_freq, uint32_t *freq)
 
static int decode_value (SCPRContext *s, uint32_t *cnt, uint32_t maxc, uint32_t step, uint32_t *rval)
 
static int decode_unit (SCPRContext *s, PixelModel *pixel, uint32_t step, uint32_t *rval)
 
static int decode_units (SCPRContext *s, uint32_t *r, uint32_t *g, uint32_t *b, int *cx, int *cx1)
 
static int decompress_i (AVCodecContext *avctx, uint32_t *dst, int linesize)
 
static int decompress_p (AVCodecContext *avctx, uint32_t *dst, int linesize, uint32_t *prev, int plinesize)
 
static int decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

const FFCodec ff_scpr_decoder
 

Macro Definition Documentation

◆ TOP

#define TOP   0x01000000

Definition at line 33 of file scpr.c.

◆ BOT

#define BOT   0x010000

Definition at line 34 of file scpr.c.

Function Documentation

◆ init_rangecoder()

static void init_rangecoder ( RangeCoder rc,
GetByteContext gb 
)
static

Definition at line 38 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

◆ reinit_tables()

static void reinit_tables ( SCPRContext s)
static

Definition at line 45 of file scpr.c.

Referenced by decompress_i().

◆ decode()

static int decode ( GetByteContext gb,
RangeCoder rc,
uint32_t  cumFreq,
uint32_t  freq,
uint32_t  total_freq 
)
static

Definition at line 102 of file scpr.c.

Referenced by decode_frame().

◆ get_freq()

static int get_freq ( RangeCoder rc,
uint32_t  total_freq,
uint32_t *  freq 
)
static

Definition at line 116 of file scpr.c.

Referenced by decode_frame().

◆ decode0()

static int decode0 ( GetByteContext gb,
RangeCoder rc,
uint32_t  cumFreq,
uint32_t  freq,
uint32_t  total_freq 
)
static

Definition at line 131 of file scpr.c.

Referenced by decode_frame(), and decode_init().

◆ get_freq0()

static int get_freq0 ( RangeCoder rc,
uint32_t  total_freq,
uint32_t *  freq 
)
static

Definition at line 153 of file scpr.c.

Referenced by decode_frame(), and decode_init().

◆ decode_value()

static int decode_value ( SCPRContext s,
uint32_t *  cnt,
uint32_t  maxc,
uint32_t  step,
uint32_t *  rval 
)
static

Definition at line 163 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

◆ decode_unit()

static int decode_unit ( SCPRContext s,
PixelModel pixel,
uint32_t  step,
uint32_t *  rval 
)
static

Definition at line 207 of file scpr.c.

Referenced by decode_units().

◆ decode_units()

static int decode_units ( SCPRContext s,
uint32_t *  r,
uint32_t *  g,
uint32_t *  b,
int *  cx,
int *  cx1 
)
static

Definition at line 269 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

◆ decompress_i()

static int decompress_i ( AVCodecContext avctx,
uint32_t *  dst,
int  linesize 
)
static

Definition at line 297 of file scpr.c.

Referenced by decode_frame().

◆ decompress_p()

static int decompress_p ( AVCodecContext avctx,
uint32_t *  dst,
int  linesize,
uint32_t *  prev,
int  plinesize 
)
static

Definition at line 369 of file scpr.c.

Referenced by decode_frame().

◆ decode_frame()

static int decode_frame ( AVCodecContext avctx,
AVFrame frame,
int *  got_frame,
AVPacket avpkt 
)
static

Definition at line 497 of file scpr.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 628 of file scpr.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 661 of file scpr.c.

Variable Documentation

◆ ff_scpr_decoder

const FFCodec ff_scpr_decoder
Initial value:
= {
.p.name = "scpr",
CODEC_LONG_NAME("ScreenPressor"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SCPRContext),
.close = decode_close,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 672 of file scpr.c.

FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: scpr.c:661
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: scpr.c:628
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
AV_CODEC_ID_SCPR
@ AV_CODEC_ID_SCPR
Definition: codec_id.h:281
SCPRContext
Definition: scpr.h:42
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
decode_frame
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: scpr.c:497