FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
mss3.c File Reference
#include "libavutil/mem.h"
#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 35 of file mss3.c.

◆ MODEL2_SCALE

#define MODEL2_SCALE   13

Definition at line 37 of file mss3.c.

◆ MODEL_SCALE

#define MODEL_SCALE   15

Definition at line 38 of file mss3.c.

◆ MODEL256_SEC_SCALE

#define MODEL256_SEC_SCALE   9

Definition at line 39 of file mss3.c.

◆ RAC_BOTTOM

#define RAC_BOTTOM   0x01000000

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

Function Documentation

◆ model2_reset()

static void model2_reset ( Model2 m)
static

Definition at line 128 of file mss3.c.

Referenced by reset_coders().

◆ model2_update()

static void model2_update ( Model2 m,
int  bit 
)
static

Definition at line 138 of file mss3.c.

Referenced by rac_get_model2_sym().

◆ model_update()

static void model_update ( Model m,
int  val 
)
static

Definition at line 164 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 194 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 210 of file mss3.c.

Referenced by init_coders().

◆ model256_update()

static void model256_update ( Model256 m,
int  val 
)
static

Definition at line 218 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 255 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 271 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 279 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 312 of file mss3.c.

Referenced by decode_coeff().

◆ rac_get_bits()

static int rac_get_bits ( RangeCoder c,
int  nbits 
)
static

Definition at line 328 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 342 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 363 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 396 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 435 of file mss3.c.

Referenced by mss3_decode_frame().

◆ decode_coeff()

static int decode_coeff ( RangeCoder c,
Model m 
)
static

Definition at line 442 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 460 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 471 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 505 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 567 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 590 of file mss3.c.

Referenced by mss3_decode_frame().

◆ reset_coders()

static void reset_coders ( MSS3Context ctx,
int  quality 
)
static

Definition at line 631 of file mss3.c.

Referenced by mss3_decode_frame().

◆ init_coders()

static av_cold void init_coders ( MSS3Context ctx)
static

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

◆ mss3_decode_end()

static av_cold int mss3_decode_end ( AVCodecContext avctx)
static

Definition at line 817 of file mss3.c.

◆ mss3_decode_init()

static av_cold int mss3_decode_init ( AVCodecContext avctx)
static

Definition at line 829 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 867 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:43
MSS3Context
Definition: mss3.c:111
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:311
mss3_decode_init
static av_cold int mss3_decode_init(AVCodecContext *avctx)
Definition: mss3.c:829
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
mss3_decode_end
static av_cold int mss3_decode_end(AVCodecContext *avctx)
Definition: mss3.c:817
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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:217
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:686