FFmpeg  4.0
Enumerations | Functions | Variables
mss12.c File Reference

Common functions for Microsoft Screen 1 and 2. More...

#include <inttypes.h>
#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "mss12.h"

Go to the source code of this file.

Enumerations

enum  SplitMode { SPLIT_VERT = 0, SPLIT_HOR, SPLIT_NONE }
 
enum  ContextDirection { TOP_LEFT = 0, TOP, TOP_RIGHT, LEFT }
 

Functions

static int model_calc_threshold (Model *m)
 
static void model_reset (Model *m)
 
static av_cold void model_init (Model *m, int num_syms, int thr_weight)
 
static void model_rescale_weights (Model *m)
 
void ff_mss12_model_update (Model *m, int val)
 
static void pixctx_reset (PixContext *ctx)
 
static av_cold void pixctx_init (PixContext *ctx, int cache_size, int full_model_syms, int special_initial_cache)
 
static av_always_inline int decode_pixel (ArithCoder *acoder, PixContext *pctx, uint8_t *ngb, int num_ngb, int any_ngb)
 
static int decode_pixel_in_context (ArithCoder *acoder, PixContext *pctx, uint8_t *src, ptrdiff_t stride, int x, int y, int has_right)
 
static int decode_region (ArithCoder *acoder, uint8_t *dst, uint8_t *rgb_pic, int x, int y, int width, int height, ptrdiff_t stride, ptrdiff_t rgb_stride, PixContext *pctx, const uint32_t *pal)
 
static void copy_rectangles (MSS12Context const *c, int x, int y, int width, int height)
 
static int motion_compensation (MSS12Context const *c, int x, int y, int width, int height)
 
static int decode_region_masked (MSS12Context const *c, ArithCoder *acoder, uint8_t *dst, ptrdiff_t stride, uint8_t *mask, ptrdiff_t mask_stride, int x, int y, int width, int height, PixContext *pctx)
 
static av_cold void slicecontext_init (SliceContext *sc, int version, int full_model_syms)
 
void ff_mss12_slicecontext_reset (SliceContext *sc)
 
static int decode_pivot (SliceContext *sc, ArithCoder *acoder, int base)
 
static int decode_region_intra (SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
 
static int decode_region_inter (SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
 
int ff_mss12_decode_rect (SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
 
av_cold int ff_mss12_decode_init (MSS12Context *c, int version, SliceContext *sc1, SliceContext *sc2)
 
av_cold int ff_mss12_decode_end (MSS12Context *c)
 

Variables

static const int sec_order_sizes [4] = { 1, 7, 6, 1 }
 

Detailed Description

Common functions for Microsoft Screen 1 and 2.

Definition in file mss12.c.

Enumeration Type Documentation

◆ SplitMode

enum SplitMode
Enumerator
SPLIT_VERT 
SPLIT_HOR 
SPLIT_NONE 

Definition at line 33 of file mss12.c.

◆ ContextDirection

Enumerator
TOP_LEFT 
TOP 
TOP_RIGHT 
LEFT 

Definition at line 41 of file mss12.c.

Function Documentation

◆ model_calc_threshold()

static int model_calc_threshold ( Model m)
static

Definition at line 48 of file mss12.c.

Referenced by model_rescale_weights().

◆ model_reset()

static void model_reset ( Model m)
static

Definition at line 58 of file mss12.c.

Referenced by ff_mss12_slicecontext_reset().

◆ model_init()

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

Definition at line 71 of file mss12.c.

Referenced by pixctx_init(), and slicecontext_init().

◆ model_rescale_weights()

static void model_rescale_weights ( Model m)
static

Definition at line 78 of file mss12.c.

Referenced by ff_mss12_model_update().

◆ ff_mss12_model_update()

void ff_mss12_model_update ( Model m,
int  val 
)

Definition at line 95 of file mss12.c.

◆ pixctx_reset()

static void pixctx_reset ( PixContext ctx)
static

Definition at line 119 of file mss12.c.

Referenced by ff_mss12_slicecontext_reset().

◆ pixctx_init()

static av_cold void pixctx_init ( PixContext ctx,
int  cache_size,
int  full_model_syms,
int  special_initial_cache 
)
static

Definition at line 140 of file mss12.c.

Referenced by slicecontext_init().

◆ decode_pixel()

static av_always_inline int decode_pixel ( ArithCoder acoder,
PixContext pctx,
uint8_t ngb,
int  num_ngb,
int  any_ngb 
)
static

◆ decode_pixel_in_context()

static int decode_pixel_in_context ( ArithCoder acoder,
PixContext pctx,
uint8_t src,
ptrdiff_t  stride,
int  x,
int  y,
int  has_right 
)
static

Definition at line 199 of file mss12.c.

Referenced by decode_region(), and decode_region_masked().

◆ decode_region()

static int decode_region ( ArithCoder acoder,
uint8_t dst,
uint8_t rgb_pic,
int  x,
int  y,
int  width,
int  height,
ptrdiff_t  stride,
ptrdiff_t  rgb_stride,
PixContext pctx,
const uint32_t *  pal 
)
static

Definition at line 292 of file mss12.c.

Referenced by decode_region_inter(), and decode_region_intra().

◆ copy_rectangles()

static void copy_rectangles ( MSS12Context const *  c,
int  x,
int  y,
int  width,
int  height 
)
static

Definition at line 321 of file mss12.c.

Referenced by decode_region_inter(), and decode_region_masked().

◆ motion_compensation()

static int motion_compensation ( MSS12Context const *  c,
int  x,
int  y,
int  width,
int  height 
)
static

Definition at line 337 of file mss12.c.

Referenced by decode_region_inter(), and decode_region_masked().

◆ decode_region_masked()

static int decode_region_masked ( MSS12Context const *  c,
ArithCoder acoder,
uint8_t dst,
ptrdiff_t  stride,
uint8_t mask,
ptrdiff_t  mask_stride,
int  x,
int  y,
int  width,
int  height,
PixContext pctx 
)
static

Definition at line 371 of file mss12.c.

Referenced by decode_region_inter().

◆ slicecontext_init()

static av_cold void slicecontext_init ( SliceContext sc,
int  version,
int  full_model_syms 
)
static

Definition at line 414 of file mss12.c.

Referenced by ff_mss12_decode_init().

◆ ff_mss12_slicecontext_reset()

void ff_mss12_slicecontext_reset ( SliceContext sc)

Definition at line 429 of file mss12.c.

Referenced by mss1_decode_frame(), and mss2_decode_frame().

◆ decode_pivot()

static int decode_pivot ( SliceContext sc,
ArithCoder acoder,
int  base 
)
static

Definition at line 440 of file mss12.c.

Referenced by ff_mss12_decode_rect().

◆ decode_region_intra()

static int decode_region_intra ( SliceContext sc,
ArithCoder acoder,
int  x,
int  y,
int  width,
int  height 
)
static

Definition at line 460 of file mss12.c.

Referenced by decode_region_inter(), and ff_mss12_decode_rect().

◆ decode_region_inter()

static int decode_region_inter ( SliceContext sc,
ArithCoder acoder,
int  x,
int  y,
int  width,
int  height 
)
static

Definition at line 492 of file mss12.c.

Referenced by ff_mss12_decode_rect().

◆ ff_mss12_decode_rect()

int ff_mss12_decode_rect ( SliceContext sc,
ArithCoder acoder,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 529 of file mss12.c.

Referenced by ff_mss12_decode_rect(), mss1_decode_frame(), and mss2_decode_frame().

◆ ff_mss12_decode_init()

av_cold int ff_mss12_decode_init ( MSS12Context c,
int  version,
SliceContext sc1,
SliceContext sc2 
)

Definition at line 565 of file mss12.c.

Referenced by mss1_decode_init(), and mss2_decode_init().

◆ ff_mss12_decode_end()

av_cold int ff_mss12_decode_end ( MSS12Context c)

Definition at line 677 of file mss12.c.

Referenced by mss1_decode_end(), and mss2_decode_end().

Variable Documentation

◆ sec_order_sizes

const int sec_order_sizes[4] = { 1, 7, 6, 1 }
static

Definition at line 39 of file mss12.c.

Referenced by pixctx_init().