FFmpeg  4.0
Data Structures | 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"

Go to the source code of this file.

Data Structures

struct  RangeCoder
 
struct  PixelModel
 
struct  SCPRContext
 

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, unsigned cumFreq, unsigned freq, unsigned total_freq)
 
static int get_freq (RangeCoder *rc, unsigned total_freq, unsigned *freq)
 
static int decode0 (GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, unsigned freq, unsigned total_freq)
 
static int get_freq0 (RangeCoder *rc, unsigned total_freq, unsigned *freq)
 
static int decode_value (SCPRContext *s, unsigned *cnt, unsigned maxc, unsigned step, unsigned *rval)
 
static int decode_unit (SCPRContext *s, PixelModel *pixel, unsigned step, unsigned *rval)
 
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 31 of file scpr.c.

Referenced by decode(), and decode0().

◆ BOT

#define BOT   0x010000

Definition at line 32 of file scpr.c.

Referenced by decode_unit(), and decode_value().

Function Documentation

◆ init_rangecoder()

static void init_rangecoder ( RangeCoder rc,
GetByteContext gb 
)
static

Definition at line 69 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

◆ reinit_tables()

static void reinit_tables ( SCPRContext s)
static

Definition at line 76 of file scpr.c.

Referenced by decompress_i().

◆ decode()

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

Definition at line 133 of file scpr.c.

Referenced by decode_frame().

◆ get_freq()

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

Definition at line 147 of file scpr.c.

Referenced by decode_frame().

◆ decode0()

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

Definition at line 162 of file scpr.c.

Referenced by decode_frame(), and decode_init().

◆ get_freq0()

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

Definition at line 184 of file scpr.c.

Referenced by decode_frame(), and decode_init().

◆ decode_value()

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

Definition at line 194 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

◆ decode_unit()

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

Definition at line 238 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 300 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 505 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 752 of file scpr.c.

◆ decode_init()

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 868 of file scpr.c.

◆ decode_close()

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 901 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 |
}
#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
static av_cold int decode_init(AVCodecContext *avctx)
Definition: scpr.c:868
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#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
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: scpr.c:752
static av_cold int decode_close(AVCodecContext *avctx)
Definition: scpr.c:901
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static int decode(GetByteContext *gb, RangeCoder *rc, unsigned cumFreq, unsigned freq, unsigned total_freq)
Definition: scpr.c:133
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959

Definition at line 912 of file scpr.c.