FFmpeg
Loading...
Searching...
No Matches
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

◆ BOT

#define BOT   0x010000

Definition at line 34 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 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.

◆ 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),
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
@ AV_CODEC_ID_SCPR
Definition codec_id.h:272
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static av_cold int decode_init(AVCodecContext *avctx)
Definition 4xm.c:998
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition 4xm.c:837
static av_cold int decode_close(AVCodecContext *avctx)
Definition aacdec.c:1220

Definition at line 672 of file scpr.c.