FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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

#define TOP   0x01000000

Definition at line 31 of file scpr.c.

Referenced by decode(), and decode0().

#define BOT   0x010000

Definition at line 32 of file scpr.c.

Referenced by decode_unit(), and decode_value().

Function Documentation

static void init_rangecoder ( RangeCoder rc,
GetByteContext gb 
)
static

Definition at line 69 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

static void reinit_tables ( SCPRContext s)
static

Definition at line 76 of file scpr.c.

Referenced by decompress_i().

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().

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

Definition at line 147 of file scpr.c.

Referenced by decode_frame().

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().

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().

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().

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

Definition at line 234 of file scpr.c.

Referenced by decompress_i(), and decompress_p().

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

Definition at line 296 of file scpr.c.

Referenced by decode_frame().

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

Definition at line 501 of file scpr.c.

Referenced by decode_frame().

static int decode_frame ( AVCodecContext avctx,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 742 of file scpr.c.

static av_cold int decode_init ( AVCodecContext avctx)
static

Definition at line 858 of file scpr.c.

static av_cold int decode_close ( AVCodecContext avctx)
static

Definition at line 891 of file scpr.c.

Variable Documentation

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:858
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:742
static av_cold int decode_close(AVCodecContext *avctx)
Definition: scpr.c:891
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:179
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:994

Definition at line 902 of file scpr.c.