FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
mss3.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "mathops.h"
#include "mss34dsp.h"

Go to the source code of this file.

Data Structures

struct  Model2
 
struct  Model
 
struct  Model256
 
struct  RangeCoder
 
struct  BlockTypeContext
 
struct  FillBlockCoder
 
struct  ImageBlockCoder
 
struct  DCTBlockCoder
 
struct  HaarBlockCoder
 
struct  MSS3Context
 

Macros

#define HEADER_SIZE   27
 
#define MODEL2_SCALE   13
 
#define MODEL_SCALE   15
 
#define MODEL256_SEC_SCALE   9
 
#define RAC_BOTTOM   0x01000000
 

Enumerations

enum  BlockType {
  FILL_BLOCK = 0, IMAGE_BLOCK, DCT_BLOCK, HAAR_BLOCK,
  SKIP_BLOCK, SKIP_BLOCK = 0, DCT_BLOCK, IMAGE_BLOCK
}
 

Functions

static void model2_reset (Model2 *m)
 
static void model2_update (Model2 *m, int bit)
 
static void model_update (Model *m, int val)
 
static void model_reset (Model *m)
 
static av_cold void model_init (Model *m, int num_syms)
 
static void model256_update (Model256 *m, int val)
 
static void model256_reset (Model256 *m)
 
static av_cold void model256_init (Model256 *m)
 
static void rac_init (RangeCoder *c, const uint8_t *src, int size)
 
static void rac_normalise (RangeCoder *c)
 
static int rac_get_bit (RangeCoder *c)
 
static int rac_get_bits (RangeCoder *c, int nbits)
 
static int rac_get_model2_sym (RangeCoder *c, Model2 *m)
 
static int rac_get_model_sym (RangeCoder *c, Model *m)
 
static int rac_get_model256_sym (RangeCoder *c, Model256 *m)
 
static int decode_block_type (RangeCoder *c, BlockTypeContext *bt)
 
static int decode_coeff (RangeCoder *c, Model *m)
 
static void decode_fill_block (RangeCoder *c, FillBlockCoder *fc, uint8_t *dst, ptrdiff_t stride, int block_size)
 
static void decode_image_block (RangeCoder *c, ImageBlockCoder *ic, uint8_t *dst, ptrdiff_t stride, int block_size)
 
static int decode_dct (RangeCoder *c, DCTBlockCoder *bc, int *block, int bx, int by)
 
static void decode_dct_block (RangeCoder *c, DCTBlockCoder *bc, uint8_t *dst, ptrdiff_t stride, int block_size, int *block, int mb_x, int mb_y)
 
static void decode_haar_block (RangeCoder *c, HaarBlockCoder *hc, uint8_t *dst, ptrdiff_t stride, int block_size, int *block)
 
static void reset_coders (MSS3Context *ctx, int quality)
 
static av_cold void init_coders (MSS3Context *ctx)
 
static int mss3_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
 
static av_cold int mss3_decode_end (AVCodecContext *avctx)
 
static av_cold int mss3_decode_init (AVCodecContext *avctx)
 

Variables

const FFCodec ff_msa1_decoder
 

Detailed Description

Microsoft Screen 3 (aka Microsoft ATC Screen) decoder

Definition in file mss3.c.

Macro Definition Documentation

◆ HEADER_SIZE

#define HEADER_SIZE   27

Definition at line 34 of file mss3.c.

◆ MODEL2_SCALE

#define MODEL2_SCALE   13

Definition at line 36 of file mss3.c.

◆ MODEL_SCALE

#define MODEL_SCALE   15

Definition at line 37 of file mss3.c.

◆ MODEL256_SEC_SCALE

#define MODEL256_SEC_SCALE   9

Definition at line 38 of file mss3.c.

◆ RAC_BOTTOM

#define RAC_BOTTOM   0x01000000

Definition at line 61 of file mss3.c.

Enumeration Type Documentation

◆ BlockType

enum BlockType
Enumerator
FILL_BLOCK 
IMAGE_BLOCK 
DCT_BLOCK 
HAAR_BLOCK 
SKIP_BLOCK 
SKIP_BLOCK 
DCT_BLOCK 
IMAGE_BLOCK 

Definition at line 69 of file mss3.c.

Function Documentation

◆ model2_reset()

static void model2_reset ( Model2 m)
static

Definition at line 127 of file mss3.c.

Referenced by reset_coders().

◆ model2_update()

static void model2_update ( Model2 m,
int  bit 
)
static

Definition at line 137 of file mss3.c.

Referenced by rac_get_model2_sym().

◆ model_update()

static void model_update ( Model m,
int  val 
)
static

Definition at line 163 of file mss3.c.

Referenced by model_reset(), and rac_get_model_sym().

◆ model_reset()

static void model_reset ( Model m)
static

Definition at line 193 of file mss3.c.

Referenced by model_init(), and reset_coders().

◆ model_init()

static av_cold void model_init ( Model m,
int  num_syms 
)
static

Definition at line 209 of file mss3.c.

Referenced by init_coders().

◆ model256_update()

static void model256_update ( Model256 m,
int  val 
)
static

Definition at line 217 of file mss3.c.

Referenced by model256_reset(), and rac_get_model256_sym().

◆ model256_reset()

static void model256_reset ( Model256 m)
static

Definition at line 254 of file mss3.c.

Referenced by model256_init(), and reset_coders().

◆ model256_init()

static av_cold void model256_init ( Model256 m)
static

Definition at line 270 of file mss3.c.

Referenced by init_coders().

◆ rac_init()

static void rac_init ( RangeCoder c,
const uint8_t *  src,
int  size 
)
static

Definition at line 278 of file mss3.c.

Referenced by mss3_decode_frame().

◆ rac_normalise()

static void rac_normalise ( RangeCoder c)
static

◆ rac_get_bit()

static int rac_get_bit ( RangeCoder c)
static

Definition at line 311 of file mss3.c.

Referenced by decode_coeff().

◆ rac_get_bits()

static int rac_get_bits ( RangeCoder c,
int  nbits 
)
static

Definition at line 327 of file mss3.c.

Referenced by decode_coeff(), and decode_dct().

◆ rac_get_model2_sym()

static int rac_get_model2_sym ( RangeCoder c,
Model2 m 
)
static

Definition at line 341 of file mss3.c.

Referenced by decode_dct().

◆ rac_get_model_sym()

static int rac_get_model_sym ( RangeCoder c,
Model m 
)
static

Definition at line 362 of file mss3.c.

Referenced by decode_block_type(), decode_coeff(), and decode_image_block().

◆ rac_get_model256_sym()

static int rac_get_model256_sym ( RangeCoder c,
Model256 m 
)
static

Definition at line 395 of file mss3.c.

Referenced by decode_dct(), decode_haar_block(), and decode_image_block().

◆ decode_block_type()

static int decode_block_type ( RangeCoder c,
BlockTypeContext bt 
)
static

Definition at line 434 of file mss3.c.

Referenced by mss3_decode_frame().

◆ decode_coeff()

static int decode_coeff ( RangeCoder c,
Model m 
)
static

Definition at line 441 of file mss3.c.

Referenced by decode_dct(), decode_fill_block(), and decode_haar_block().

◆ decode_fill_block()

static void decode_fill_block ( RangeCoder c,
FillBlockCoder fc,
uint8_t *  dst,
ptrdiff_t  stride,
int  block_size 
)
static

Definition at line 459 of file mss3.c.

Referenced by mss3_decode_frame().

◆ decode_image_block()

static void decode_image_block ( RangeCoder c,
ImageBlockCoder ic,
uint8_t *  dst,
ptrdiff_t  stride,
int  block_size 
)
static

Definition at line 470 of file mss3.c.

Referenced by mss3_decode_frame().

◆ decode_dct()

static int decode_dct ( RangeCoder c,
DCTBlockCoder bc,
int block,
int  bx,
int  by 
)
static

Definition at line 504 of file mss3.c.

Referenced by decode_dct_block().

◆ decode_dct_block()

static void decode_dct_block ( RangeCoder c,
DCTBlockCoder bc,
uint8_t *  dst,
ptrdiff_t  stride,
int  block_size,
int block,
int  mb_x,
int  mb_y 
)
static

Definition at line 566 of file mss3.c.

Referenced by mss3_decode_frame().

◆ decode_haar_block()

static void decode_haar_block ( RangeCoder c,
HaarBlockCoder hc,
uint8_t *  dst,
ptrdiff_t  stride,
int  block_size,
int block 
)
static

Definition at line 589 of file mss3.c.

Referenced by mss3_decode_frame().

◆ reset_coders()

static void reset_coders ( MSS3Context ctx,
int  quality 
)
static

Definition at line 630 of file mss3.c.

Referenced by mss3_decode_frame().

◆ init_coders()

static av_cold void init_coders ( MSS3Context ctx)
static

Definition at line 665 of file mss3.c.

Referenced by mss3_decode_init().

◆ mss3_decode_frame()

static int mss3_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 685 of file mss3.c.

◆ mss3_decode_end()

static av_cold int mss3_decode_end ( AVCodecContext avctx)
static

Definition at line 816 of file mss3.c.

◆ mss3_decode_init()

static av_cold int mss3_decode_init ( AVCodecContext avctx)
static

Definition at line 828 of file mss3.c.

Variable Documentation

◆ ff_msa1_decoder

const FFCodec ff_msa1_decoder
Initial value:
= {
.p.name = "msa1",
CODEC_LONG_NAME("MS ATC Screen"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(MSS3Context),
.close = mss3_decode_end,
.p.capabilities = AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 866 of file mss3.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:42
MSS3Context
Definition: mss3.c:110
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
mss3_decode_init
static av_cold int mss3_decode_init(AVCodecContext *avctx)
Definition: mss3.c:828
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
mss3_decode_end
static av_cold int mss3_decode_end(AVCodecContext *avctx)
Definition: mss3.c:816
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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_MSA1
@ AV_CODEC_ID_MSA1
Definition: codec_id.h:215
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
mss3_decode_frame
static int mss3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition: mss3.c:685