mss2.c File Reference

Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder. More...

#include "libavutil/avassert.h"
#include "error_resilience.h"
#include "internal.h"
#include "msmpeg4data.h"
#include "vc1.h"
#include "mss12.h"
#include "mss2dsp.h"
Include dependency graph for mss2.c:

Go to the source code of this file.

Data Structures

struct  MSS2Context
 
struct  Rectangle
 

Macros

#define READ_PAIR(a, b)
 
#define MAX_WMV9_RECTANGLES   20
 
#define ARITH2_PADDING   2
 

Typedefs

typedef struct MSS2Context MSS2Context
 
typedef struct Rectangle Rectangle
 

Functions

static void arith2_normalise (ArithCoder *c)
 
static int arith2_get_scaled_value (int value, int n, int range)
 
static void arith2_rescale_interval (ArithCoder *c, int range, int low, int high, int n)
 
static int arith2_get_number (ArithCoder *c, int n)
 
static int arith2_get_prob (ArithCoder *c, int16_t *probs)
 
static int arith2_get_consumed_bytes (ArithCoder *c)
 
static void arith2_init (ArithCoder *c, GetByteContext *gB)
 
static int decode_pal_v2 (MSS12Context *ctx, const uint8_t *buf, int buf_size)
 
static int decode_555 (GetByteContext *gB, uint16_t *dst, int stride, int keyframe, int w, int h)
 
static int decode_rle (GetBitContext *gb, uint8_t *pal_dst, int pal_stride, uint8_t *rgb_dst, int rgb_stride, uint32_t *pal, int keyframe, int kf_slipt, int slice, int w, int h)
 
static int decode_wmv9 (AVCodecContext *avctx, const uint8_t *buf, int buf_size, int x, int y, int w, int h, int wmv9_mask)
 
static int mss2_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int wmv9_init (AVCodecContext *avctx)
 
static av_cold int mss2_decode_end (AVCodecContext *avctx)
 
static av_cold int mss2_decode_init (AVCodecContext *avctx)
 

Variables

AVCodec ff_mss2_decoder
 

Detailed Description

Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder.

Definition in file mss2.c.

Macro Definition Documentation

#define ARITH2_PADDING   2

Definition at line 463 of file mss2.c.

Referenced by mss2_decode_frame().

#define MAX_WMV9_RECTANGLES   20

Definition at line 462 of file mss2.c.

Referenced by mss2_decode_frame().

#define READ_PAIR (   a,
  b 
)
Value:
a = bytestream2_get_byte(gB) << 4; \
t = bytestream2_get_byte(gB); \
a |= t >> 4; \
b = (t & 0xF) << 8; \
b |= bytestream2_get_byte(gB); \
#define b
Definition: input.c:42
t
Definition: genspecsines3.m:6

Referenced by decode_555().

Typedef Documentation

typedef struct MSS2Context MSS2Context
typedef struct Rectangle Rectangle

Function Documentation

static int arith2_get_consumed_bytes ( ArithCoder c)
static

Definition at line 132 of file mss2.c.

Referenced by mss2_decode_frame().

static int arith2_get_number ( ArithCoder c,
int  n 
)
static

Definition at line 90 of file mss2.c.

Referenced by arith2_init(), and mss2_decode_frame().

static int arith2_get_prob ( ArithCoder c,
int16_t *  probs 
)
static

Definition at line 110 of file mss2.c.

static int arith2_get_scaled_value ( int  value,
int  n,
int  range 
)
static

Definition at line 62 of file mss2.c.

Referenced by arith2_get_number(), and arith2_get_prob().

static void arith2_init ( ArithCoder c,
GetByteContext gB 
)
static

Definition at line 146 of file mss2.c.

Referenced by mss2_decode_frame().

static void arith2_normalise ( ArithCoder c)
static

Definition at line 43 of file mss2.c.

Referenced by arith2_get_number().

static void arith2_rescale_interval ( ArithCoder c,
int  range,
int  low,
int  high,
int  n 
)
static

Definition at line 72 of file mss2.c.

Referenced by arith2_get_number(), and arith2_get_prob().

static int decode_555 ( GetByteContext gB,
uint16_t *  dst,
int  stride,
int  keyframe,
int  w,
int  h 
)
static

Definition at line 173 of file mss2.c.

Referenced by mss2_decode_frame().

static int decode_pal_v2 ( MSS12Context ctx,
const uint8_t buf,
int  buf_size 
)
static

Definition at line 156 of file mss2.c.

Referenced by mss2_decode_frame().

static int decode_rle ( GetBitContext gb,
uint8_t pal_dst,
int  pal_stride,
uint8_t rgb_dst,
int  rgb_stride,
uint32_t *  pal,
int  keyframe,
int  kf_slipt,
int  slice,
int  w,
int  h 
)
static

Definition at line 231 of file mss2.c.

Referenced by mss2_decode_frame().

static int decode_wmv9 ( AVCodecContext avctx,
const uint8_t buf,
int  buf_size,
int  x,
int  y,
int  w,
int  h,
int  wmv9_mask 
)
static

Definition at line 368 of file mss2.c.

Referenced by mss2_decode_frame().

static av_cold int mss2_decode_end ( AVCodecContext avctx)
static

Definition at line 801 of file mss2.c.

Referenced by mss2_decode_init().

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

Definition at line 465 of file mss2.c.

static av_cold int mss2_decode_init ( AVCodecContext avctx)
static

Definition at line 815 of file mss2.c.

static av_cold int wmv9_init ( AVCodecContext avctx)
static

Definition at line 740 of file mss2.c.

Referenced by mss2_decode_init().

Variable Documentation

AVCodec ff_mss2_decoder
Initial value:
= {
.name = "mss2",
.priv_data_size = sizeof(MSS2Context),
.capabilities = CODEC_CAP_DR1,
.long_name = NULL_IF_CONFIG_SMALL("MS Windows Media Video V9 Screen"),
}
static av_cold int mss2_decode_init(AVCodecContext *avctx)
Definition: mss2.c:815
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
struct MSS2Context MSS2Context
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:375
static av_cold int mss2_decode_end(AVCodecContext *avctx)
Definition: mss2.c:801
static int decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: crystalhd.c:868
static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: mss2.c:465

Definition at line 842 of file mss2.c.