FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
mss3.c File Reference
#include "avcodec.h"
#include "bytestream.h"
#include "internal.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, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int mss3_decode_end (AVCodecContext *avctx)
 
static av_cold int mss3_decode_init (AVCodecContext *avctx)
 

Variables

AVCodec 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 33 of file mss3.c.

◆ MODEL2_SCALE

#define MODEL2_SCALE   13

Definition at line 35 of file mss3.c.

◆ MODEL_SCALE

#define MODEL_SCALE   15

Definition at line 36 of file mss3.c.

◆ MODEL256_SEC_SCALE

#define MODEL256_SEC_SCALE   9

Definition at line 37 of file mss3.c.

◆ RAC_BOTTOM

#define RAC_BOTTOM   0x01000000

Definition at line 60 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 68 of file mss3.c.

Function Documentation

◆ model2_reset()

static void model2_reset ( Model2 m)
static

Definition at line 126 of file mss3.c.

Referenced by reset_coders().

◆ model2_update()

static void model2_update ( Model2 m,
int  bit 
)
static

Definition at line 136 of file mss3.c.

Referenced by rac_get_model2_sym().

◆ model_update()

static void model_update ( Model m,
int  val 
)
static

Definition at line 162 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 192 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 208 of file mss3.c.

Referenced by init_coders().

◆ model256_update()

static void model256_update ( Model256 m,
int  val 
)
static

Definition at line 216 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 253 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 269 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 277 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 310 of file mss3.c.

Referenced by decode_coeff().

◆ rac_get_bits()

static int rac_get_bits ( RangeCoder c,
int  nbits 
)
static

Definition at line 326 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 340 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 361 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 394 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 433 of file mss3.c.

Referenced by mss3_decode_frame().

◆ decode_coeff()

static int decode_coeff ( RangeCoder c,
Model m 
)
static

Definition at line 440 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 458 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 469 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 503 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 565 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 588 of file mss3.c.

Referenced by mss3_decode_frame().

◆ reset_coders()

static void reset_coders ( MSS3Context ctx,
int  quality 
)
static

Definition at line 629 of file mss3.c.

Referenced by mss3_decode_frame().

◆ init_coders()

static av_cold void init_coders ( MSS3Context ctx)
static

Definition at line 664 of file mss3.c.

Referenced by mss3_decode_init().

◆ mss3_decode_frame()

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

Definition at line 684 of file mss3.c.

◆ mss3_decode_end()

static av_cold int mss3_decode_end ( AVCodecContext avctx)
static

Definition at line 812 of file mss3.c.

Referenced by mss3_decode_init().

◆ mss3_decode_init()

static av_cold int mss3_decode_init ( AVCodecContext avctx)
static

Definition at line 824 of file mss3.c.

Variable Documentation

◆ ff_msa1_decoder

AVCodec ff_msa1_decoder
Initial value:
= {
.name = "msa1",
.long_name = NULL_IF_CONFIG_SMALL("MS ATC Screen"),
.priv_data_size = sizeof(MSS3Context),
.close = mss3_decode_end,
.capabilities = AV_CODEC_CAP_DR1,
}

Definition at line 869 of file mss3.c.

init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
MSS3Context
Definition: mss3.c:109
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
mss3_decode_init
static av_cold int mss3_decode_init(AVCodecContext *avctx)
Definition: mss3.c:824
mss3_decode_frame
static int mss3_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: mss3.c:684
mss3_decode_end
static av_cold int mss3_decode_end(AVCodecContext *avctx)
Definition: mss3.c:812
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
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
AV_CODEC_ID_MSA1
@ AV_CODEC_ID_MSA1
Definition: avcodec.h:381
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201