39 if (c->
high >= 0x8000) {
40 if (c->
low < 0x8000) {
41 if (c->
low >= 0x4000 && c->
high < 0xC000) {
66 int range = c->high - c->low + 1;
67 int val = (((c->value - c->low + 1) << bits) - 1) / range;
68 int prob = range * val;
70 c->high = ((prob + range) >> bits) + c->low - 1;
71 c->low += prob >>
bits;
80 int range = c->
high - c->
low + 1;
81 int val = ((c->
value - c->
low + 1) * mod_val - 1) / range;
82 int prob = range * val;
84 c->
high = (prob + range) / mod_val + c->
low - 1;
85 c->
low += prob / mod_val;
94 int range = c->
high - c->
low + 1;
95 int val = ((c->
value - c->
low + 1) * probs[0] - 1) / range;
98 while (probs[sym] > val)
101 c->
high = range * probs[sym - 1] / probs[0] + c->
low - 1;
102 c->
low += range * probs[sym] / probs[0];
115 c->get_model_sym = arith_get_model_sym;
121 int i, ncol,
r,
g,
b;
128 for (i = 0; i < ncol; i++) {
132 *pal++ = (r << 16) | (g << 8) |
b;
142 int buf_size = avpkt->
size;
163 c->
keyframe = !arith_get_bit(&acoder);
#define ARITH_GET_BIT(VERSION)
static int decode_pal(MSS12Context *ctx, ArithCoder *acoder)
This structure describes decoded (raw) audio or video data.
int buffer_hints
codec suggestion on buffer type if != 0
void(* release_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called to release buffers which were allocated with get_buffer.
av_cold int ff_mss12_decode_init(MSS12Context *c, int version, SliceContext *sc1, SliceContext *sc2)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVFrame * coded_frame
the picture in the bitstream
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_cold int mss1_decode_end(AVCodecContext *avctx)
int ff_mss12_decode_rect(SliceContext *sc, ArithCoder *acoder, int x, int y, int width, int height)
int(* reget_buffer)(struct AVCodecContext *c, AVFrame *pic)
Called at the beginning of a frame to get cr buffer for it.
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
8 bit with PIX_FMT_RGB32 palette
static int arith_get_bits(ArithCoder *c, int bits)
static void arith_normalise(ArithCoder *c)
static int init(AVCodecParserContext *s)
#define FF_BUFFER_HINTS_READABLE
static int arith_get_prob(ArithCoder *c, int16_t *probs)
int reference
is this picture used as reference The values for this are the same as the MpegEncContext.picture_structure variable, that is 1->top field, 2->bottom field, 3->frame/both fields.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
enum AVPictureType pict_type
Picture type of the frame, see ?_TYPE below.
int width
picture width / height.
av_cold int ff_mss12_decode_end(MSS12Context *c)
struct MSS1Context MSS1Context
int linesize[AV_NUM_DATA_POINTERS]
Size, in bytes, of the data for each picture/channel plane.
main external API structure.
static void close(AVCodecParserContext *s)
union ArithCoder::@48 gbc
static int mss1_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static unsigned int get_bits1(GetBitContext *s)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int palette_has_changed
Tell user application that palette has changed from previous frame.
#define FF_BUFFER_HINTS_REUSABLE
#define FF_BUFFER_HINTS_PRESERVE
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void ff_mss12_slicecontext_reset(SliceContext *sc)
static int arith_get_number(ArithCoder *c, int mod_val)
#define AVERROR_INVALIDDATA
static av_cold int mss1_decode_init(AVCodecContext *avctx)
int key_frame
1 -> keyframe, 0-> not
#define ARITH_GET_MODEL_SYM(VERSION)
#define FF_BUFFER_HINTS_VALID
This structure stores compressed data.
Common header for Microsoft Screen 1 and 2.
static void arith_init(ArithCoder *c, GetBitContext *gb)