FFmpeg
Macros | Functions | Variables
scpr.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "avcodec.h"
#include "bytestream.h"
#include "internal.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, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int decode_init (AVCodecContext *avctx)
 
static av_cold int decode_close (AVCodecContext *avctx)
 

Variables

AVCodec 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,
void *  data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 494 of file scpr.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 623 of file scpr.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 656 of file scpr.c.

Variable Documentation

◆ ff_scpr_decoder

AVCodec ff_scpr_decoder
Initial value:
= {
.name = "scpr",
.long_name = NULL_IF_CONFIG_SMALL("ScreenPressor"),
.priv_data_size = sizeof(SCPRContext),
.close = decode_close,
.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE |
}

Definition at line 667 of file scpr.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:40
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
decode_close
static av_cold int decode_close(AVCodecContext *avctx)
Definition: scpr.c:656
decode_init
static av_cold int decode_init(AVCodecContext *avctx)
Definition: scpr.c:623
decode_frame
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: scpr.c:494
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
AV_CODEC_ID_SCPR
@ AV_CODEC_ID_SCPR
Definition: avcodec.h:440
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:188
SCPRContext
Definition: scpr.h:47
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: internal.h:48
decode
static int decode(GetByteContext *gb, RangeCoder *rc, uint32_t cumFreq, uint32_t freq, uint32_t total_freq)
Definition: scpr.c:102
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201